public FrontendPipeline(string grammar) { Rules <IASTNode> rules; (Lexer, PrototypeDictionary, rules) = new ParsersParser1().ParseParser(grammar); SymbolDictionary = Lexer.SymbolDictionary(); Parser = new Ll1Parser <IASTNode>(rules, SymbolDictionary, (token, id) => new ASTLeaf(token, id)); }
public ParsersLexer() { foreach (var field in typeof(ParsersLexer).GetFields()) { if (field.FieldType != typeof(int)) { continue; } field.SetValue(this, _lexer[field.Name]); } END = _lexer["END"]; SymbolDictionary = _lexer.SymbolDictionary(); }