/** * Determines if the underlying input is looking at a valid character to start an identifier * <p> * By default, only letters can start identifiers * * @return <tt>true</tt> if the underlying input is looking at a valid identifier starter, <tt>false</tt> otherwise */ protected boolean isAtStartOfIdentifier() { return input.current().isLetter(); }
/** * Determines if the underlying input is looking at the start of a special id. * <p> * By default this is one of the given <tt>specialIdStarters</tt>. * * @return <tt>true</tt> if the current input is the start of a special id, <tt>false</tt> otherwise */ protected boolean isAtStartOfSpecialId() { return specialIdStarters.contains(input.current().getValue()); }
@Override protected Token endOfInput() { return Token.createAndFill(Token.TokenType.EOI, input.current()); }
/** * Determines if the underlying input is looking at the start of a special id. * <p> * By default this is one of the given <tt>specialIdStarters</tt>. * * @return <tt>true</tt> if the current input is the start of a special id, <tt>false</tt> otherwise */ protected boolean isAtStartOfSpecialId() { return specialIdStarters.contains(input.current().getValue()); }
protected void skipWhitespace(LookaheadReader reader) { while (reader.current().isWhitepace()) { reader.consume(); } }
@Override protected boolean isAtBracket(boolean inSymbol) { // Treat % as single symbol so that 10%; is not tokenized to // "10", "%;" but to "10", "%", ";" // The title of this method might be a bit misleading return super.isAtBracket(inSymbol) || input.current().is('%'); }
private boolean skipWhitespace(LookaheadReader reader) { boolean skipped = false; while (reader.current().isWhitepace()) { reader.consume(); skipped = true; } return skipped; }
private C parseBrackets() { reader.consume(); C inner = parseOR(); if (reader.current().is(')')) { reader.consume(); } return inner; }
protected QueryBuilder parseTokenInBrackets(LookaheadReader reader) { reader.consume(); QueryBuilder qb = parseOR(reader); if (reader.current().is(')')) { reader.consume(); } return qb; }