예제 #1
0
        /// <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);
        }
예제 #2
0
        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!");
            }
        }
예제 #3
0
        public LLkParser GetParser(TokenStream lexer)
        {
            LLkParser result = (LLkParser)parserConstructorInfo.Invoke(new object[] { lexer });

            return(result);
        }
예제 #4
0
 public void CallParser(LLkParser parser)
 {
     mainParsingMethodInfo.Invoke(parser, no_args);
 }