public static <T> Expression<T> parse(String expression, TokenMapper<T> mapper) {
try {
//lexer splits input into tokens
ANTLRStringStream input = new ANTLRStringStream(expression);
TokenStream tokens = new CommonTokenStream(new BooleanExprLexer(input));
//parser generates abstract syntax tree
BooleanExprParser parser = new BooleanExprParser(tokens);
BooleanExprParser.expression_return ret = parser.expression();