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); }
// 匹配产生式的左部、右部、索引、展望符,且另一个的展望符集要包含于自身的展望符集 public bool IsCompatible(BuildingProduction another) { return(Comparation.EqualsWithOrder(Elems, another.Elems) && another.Index == Index && Comparation.IncludesAll(LookAheads, another.LookAheads)); }
// 仅仅匹配产生式右部和项目索引 public bool IsConcentric(BuildingProduction another) { return(Comparation.EqualsWithOrder(Elems, another.Elems) && another.Index == Index); }
// 匹配产生式左部、右部、索引、展望符 public bool Equals(BuildingProduction another) { return(another.Prod == Prod && another.Index == Index && Comparation.EqualsWithoutOrder(another.LookAheads, LookAheads)); }
// 匹配产生式左部、右部、索引 public bool CanPile(BuildingProduction another) { return(another.Prod == Prod && another.Index == Index); }