示例#1
0
 public Parser(Lexer lexer)
 {
     this.pos = 0;
     this.lexer = lexer;
     this.line = 1;
     this.totalTokens = lexer.tokens.Count;
 }
示例#2
0
        protected static void ExecuteCode(string code)
        {
            Lexer lex = new Lexer(code + "\n");
            lex.tokenize();

            Parser parser = new Parser(lex);
            var exprs = parser.start();
            CodeGenerator cg = new CodeGenerator(exprs);
            cg.generate();
        }