예제 #1
0
        private ITree ParseExpression(SimpleLanguageLexer lexer)
        {
            var parser = new SimpleLanguageParser(new CommonTokenStream(lexer));
              parser.Error += m => OnError("Parser", m);

              return (ITree) parser.program().Tree;
        }
예제 #2
0
 private SimpleLanguageLexer CreateLexer(string expression)
 {
     var lexer = new SimpleLanguageLexer(new ANTLRStringStream(expression));
       lexer.Error += m => OnError("Lexer", m);
       return lexer;
 }