コード例 #1
0
 List<Symbol> Follow(Formula formula, bool terminal = true)
 {
     List<Symbol> list = new List<Symbol>();
     foreach (var symbol in formula.Symbols)
     {
         if (symbol.IsTerminal == terminal)
             list.Add(symbol);
     }
     return list;
 }
コード例 #2
0
 Symbol First(Formula formula, bool terminal = true)
 {
     foreach (var symbol in formula.Symbols)
     {
         if (symbol.IsTerminal == terminal)
             return symbol;
     }
     return null;
 }