Exemplo n.º 1
0
        public void TestCalculator()
        {
            var testString = @"a=1+2*3; print a;";

            CalculatorLexer   lexer  = new CalculatorLexer(new AntlrInputStream(testString));
            CommonTokenStream tokens = new CommonTokenStream(lexer);
            CalculatorParser  p      = new CalculatorParser(tokens);

            p.BuildParseTree = true;
            p.AddParseListener(new CalculatorListener());
            ParserRuleContext t = p.program();
        }