private void factor() { token = lexer.nextToken(); if (token == Lexer.LEFT) { expression(); if (token != Lexer.RIGHT) { throw new MalformedExpressionException( String.format("')' instead of <%s> expected.", token)); } else { token = lexer.nextToken(); } } else { condition(); } }
@SuppressWarnings("unchecked") public ASTNode<Boolean> build() { expression(); return root; }