public static void Derive([NotNull, ItemNotNull] this List <Symbol> tape, [NotNull] GrammarType0 grammar, [NotNull] IDerivationTracker tracker) { while (tape.TryDerive(grammar, tracker)) { } }
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); }