/// <summary> /// This method parses the given parameter string with the configured parser and loads the resulting AST into the given graph. /// </summary> /// <param name="from"></param> /// <param name="to"></param> public void Load(string from, IGraph to) { TokenStream lexer = parserpackage.GetLexer(from); LLkParser instance = parserpackage.GetParser(lexer); Load(instance, to); }
private void Load(LLkParser instance, IGraph to) { AST a; parserpackage.CallParser(instance); a = instance.getAST(); if (a != null) { Emit(a, to); } else { throw new Exception("No AST!"); } }
public LLkParser GetParser(TokenStream lexer) { LLkParser result = (LLkParser)parserConstructorInfo.Invoke(new object[] { lexer }); return(result); }
public void CallParser(LLkParser parser) { mainParsingMethodInfo.Invoke(parser, no_args); }