- private void gatherProxDistance(CQLProxNode node)
- throws CQLParseException, IOException {
- if (lexer.ttype != lexer.TT_NUMBER)
- throw new CQLParseException("expected proximity distance, got " +
- lexer.render());
- node.addModifier("distance", null, lexer.render(lexer.ttype, false));
- match(lexer.ttype);
- debug("gPD matched " + lexer.render(lexer.ttype, false));
- }
-
- private void gatherProxUnit(CQLProxNode node)
- throws CQLParseException, IOException {
- if (lexer.ttype != lexer.TT_pWORD &&
- lexer.ttype != lexer.TT_SENTENCE &&
- lexer.ttype != lexer.TT_PARAGRAPH &&
- lexer.ttype != lexer.TT_ELEMENT)
- throw new CQLParseException("expected proximity unit, got " +
- lexer.render());
- node.addModifier("unit", null, lexer.render());
- match(lexer.ttype);
- }
-
- private void gatherProxOrdering(CQLProxNode node)
- throws CQLParseException, IOException {
- if (lexer.ttype != lexer.TT_ORDERED &&
- lexer.ttype != lexer.TT_UNORDERED)
- throw new CQLParseException("expected proximity ordering, got " +
- lexer.render());
- node.addModifier("ordering", null, lexer.render());
- match(lexer.ttype);
- }
-
- private boolean isBaseRelation()
- throws CQLParseException {
- debug("isBaseRelation: checking ttype=" + lexer.ttype +
- " (" + lexer.render() + ")");
-
- if (lexer.ttype == lexer.TT_WORD &&
- lexer.sval.indexOf('.') == -1)
- throw new CQLParseException("unknown first-class relation: " +
- lexer.sval);
-
- return (isProxRelation() ||
- lexer.ttype == lexer.TT_ANY ||
- lexer.ttype == lexer.TT_ALL ||
- lexer.ttype == lexer.TT_EXACT ||
- lexer.ttype == lexer.TT_SCR ||
- lexer.ttype == lexer.TT_WORD);
- }
-
- // Checks for a relation that may be used inside a prox operator
- private boolean isProxRelation() {
- debug("isProxRelation: checking ttype=" + lexer.ttype +