private ITree ParseExpression(SimpleLanguageLexer lexer) { var parser = new SimpleLanguageParser(new CommonTokenStream(lexer)); parser.Error += m => OnError("Parser", m); return (ITree) parser.program().Tree; }
private SimpleLanguageLexer CreateLexer(string expression) { var lexer = new SimpleLanguageLexer(new ANTLRStringStream(expression)); lexer.Error += m => OnError("Lexer", m); return lexer; }