/** * Boilerplate method for {@code current().isNotEnd()} * * @return <tt>true</tt> if the current token is not an "end of input" token, <tt>false</tt> otherwise. */ public boolean more() { return current().isNotEnd(); }
/** * Boilerplate method for {@code current().isNotEnd()} * * @return <tt>true</tt> if the current token is not an "end of input" token, <tt>false</tt> otherwise. */ public boolean more() { return current().isNotEnd(); }
/** * Parses the expression in <tt>input</tt> * * @return the parsed expression * @throws ParseException if the expression contains one or more errors */ protected Expression parse() throws ParseException { Expression result = expression().simplify(); if (tokenizer.current().isNotEnd()) { Token token = tokenizer.consume(); errors.add(ParseError.error(token, String.format("Unexpected token: '%s'. Expected an expression.", token.getSource()))); } if (!errors.isEmpty()) { throw ParseException.create(errors); } return result; }
/** * Parses the expression in <tt>input</tt> * * @return the parsed expression * @throws ParseException if the expression contains one or more errors */ protected Expression parse() throws ParseException { Expression result = expression().simplify(); if (tokenizer.current().isNotEnd()) { Token token = tokenizer.consume(); errors.add(ParseError.error(token, String.format("Unexpected token: '%s'. Expected an expression.", token.getSource()))); } if (!errors.isEmpty()) { throw ParseException.create(errors); } return result; }
while (!tokenizer.current().isSymbol(")") && tokenizer.current().isNotEnd()) { if (!call.getParameters().isEmpty()) { expect(Token.TokenType.SYMBOL, ",");
while (!tokenizer.current().isSymbol(")") && tokenizer.current().isNotEnd()) { if (!call.getParameters().isEmpty()) { expect(Token.TokenType.SYMBOL, ",");