Example #1
0
 private Parser(Lexer lexer, ShiftTable shift, ReduceTable reduce, GotoTable @goto)
 {
     this.Lexer  = lexer;
     this.Shift  = shift;
     this.Reduce = reduce;
     this.Goto   = @goto;
 }
Example #2
0
 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));
Example #3
0
 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));