Exemplo n.º 1
0
 public bool GetNext(out BuildingProduction next)
 {
     if (Next != null)
     {
         next = Next;
         return(true);
     }
     else if (Index < Elems.Length)
     {
         next = Next = new BuildingProduction(Prod, Index + 1, LookAheads);
         return(true);
     }
     next = null;
     return(false);
 }
Exemplo n.º 2
0
 // 匹配产生式的左部、右部、索引、展望符,且另一个的展望符集要包含于自身的展望符集
 public bool IsCompatible(BuildingProduction another)
 {
     return(Comparation.EqualsWithOrder(Elems, another.Elems) &&
            another.Index == Index &&
            Comparation.IncludesAll(LookAheads, another.LookAheads));
 }
Exemplo n.º 3
0
 // 仅仅匹配产生式右部和项目索引
 public bool IsConcentric(BuildingProduction another)
 {
     return(Comparation.EqualsWithOrder(Elems, another.Elems) && another.Index == Index);
 }
Exemplo n.º 4
0
 // 匹配产生式左部、右部、索引、展望符
 public bool Equals(BuildingProduction another)
 {
     return(another.Prod == Prod &&
            another.Index == Index &&
            Comparation.EqualsWithoutOrder(another.LookAheads, LookAheads));
 }
Exemplo n.º 5
0
 // 匹配产生式左部、右部、索引
 public bool CanPile(BuildingProduction another)
 {
     return(another.Prod == Prod &&
            another.Index == Index);
 }