示例#1
0
 public static void Derive([NotNull, ItemNotNull] this List <Symbol> tape, [NotNull] GrammarType0 grammar,
                           [NotNull] IDerivationTracker tracker)
 {
     while (tape.TryDerive(grammar, tracker))
     {
     }
 }
示例#2
0
 private static bool TryDerive([NotNull, ItemNotNull] this List <Symbol> tape, [NotNull] GrammarType0 grammar,
                               [NotNull] IDerivationTracker tracker)
 {
     if (!grammar.Rules.Any(rule => TryDerive(tape, rule, tracker)))
     {
         return(false);
     }
     return(true);
 }