public static void CorrectGrammar(Grammar grammar) { AddNewStartSymbolIfNeeded(grammar); }
private static void AddNewStartSymbol(Grammar grammar) { grammar.StartSymbol = new NonTerminalSymbol("S'"); grammar.NonTerminals.Add(grammar.StartSymbol); grammar.Rules.Add(new Rule(grammar.StartSymbol, Grammar.DefaultStartSymbol)); }