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