From 937c1bab3e8708237535d1c402ae093bb9b5e000 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Thu, 20 May 2010 00:27:40 +0100 Subject: [PATCH] Add new and more general isRelation() that recognises well-known word relations. --- src/main/java/org/z3950/zing/cql/CQLParser.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/z3950/zing/cql/CQLParser.java b/src/main/java/org/z3950/zing/cql/CQLParser.java index 7580959..dab0e80 100644 --- a/src/main/java/org/z3950/zing/cql/CQLParser.java +++ b/src/main/java/org/z3950/zing/cql/CQLParser.java @@ -231,7 +231,19 @@ public class CQLParser { return new CQLPrefixNode(name, identifier, node); } - // Checks for a relation + private boolean isRelation() { + debug("isRelation: checking ttype=" + lexer.ttype + + " (" + lexer.render() + ")"); + if (lexer.ttype == lexer.TT_WORD && + (lexer.sval == "exact" || + lexer.sval == "any" || + lexer.sval == "all" || + (lexer.sval == "scr" && compat == V1POINT2))) + return true; + + return isSymbolicRelation(); + } + private boolean isSymbolicRelation() { debug("isSymbolicRelation: checking ttype=" + lexer.ttype + " (" + lexer.render() + ")"); -- 1.7.10.4