Add new and more general isRelation() that recognises well-known word relations.
authorMike Taylor <mike@miketaylor.org.uk>
Wed, 19 May 2010 23:27:40 +0000 (00:27 +0100)
committerMike Taylor <mike@miketaylor.org.uk>
Wed, 19 May 2010 23:27:40 +0000 (00:27 +0100)
src/main/java/org/z3950/zing/cql/CQLParser.java

index 7580959..dab0e80 100644 (file)
@@ -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() + ")");