I'm trying to parse a logical expression using Antlr version 4.0 and generate the tree to evaluate the expression.
I ran the antlr tool and generated the parser and lexer, but when i place the generated files in the project I get the following errors: "The constructor LogicLexer(ANTLRStringStream) is undefined" and "The constructor CommonTokenStream(LogicLexer) is undefined".
the code is below:
LogicLexer lexer = new LogicLexer(new ANTLRStringStream(expression));
LogicParser parser = new LogicParser(new CommonTokenStream(lexer));
CommonTree tree = (CommonTree)parser.parse().getTree();