Example #1
0
 private LL1Item find(NTType first, VTType second)
 {
     if (LL1ItemList.Any(v => v.NT == first && v.meet == second))
     {
         return(LL1ItemList.First(v => v.NT == first && v.meet == second));
     }
     return(null);
 }
Example #2
0
 public Rule(NTType start, List <NTVTType> words)
 {
     _start = start;
     _words = new List <NTVTType>();
     _words.AddRange(words);
 }
Example #3
0
 public Rule(NTType start)
 {
     _start = start;
     _words = new List <NTVTType>();
 }
Example #4
0
 /// <summary>
 /// 若first课归结为ε,返回True,否则返回False
 /// </summary>
 /// <param name="first"></param>
 /// <returns></returns>
 private bool existX(NTType first)
 {
     return(LL1ItemList.Any(v => v.NT == first &&
                            v.Rule.Contains(NTVTType.ε)));
 }
Example #5
0
 private NTVTType toNTVT(NTType nt)
 {
     return((NTVTType)Enum.Parse(typeof(NTVTType), nt.ToString()));
 }