private Parser(Lexer lexer, ShiftTable shift, ReduceTable reduce, GotoTable @goto) { this.Lexer = lexer; this.Shift = shift; this.Reduce = reduce; this.Goto = @goto; }
public static Parser From(XDocument definition, Func <Lexer, Lexer> lexicalRules) => new Parser(lexicalRules(LexerLoader.From(definition)), ShiftTable.From(definition), ReduceTable.From(definition), GotoTable.From(definition));
public static Parser From(ParserDefinition definition) => new Parser( LexerLoader.From(definition), ShiftTable.From(definition.Table.Shift), ReduceTable.From(definition.Table.Reduce, definition.Grammar.Rules.ToArray()), GotoTable.From(definition.Table.Goto));