From: Mike Taylor Date: Wed, 19 May 2010 23:27:40 +0000 (+0100) Subject: Add new and more general isRelation() that recognises well-known word relations. X-Git-Tag: v1.5~16 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=937c1bab3e8708237535d1c402ae093bb9b5e000;p=cql-java-moved-to-github.git Add new and more general isRelation() that recognises well-known word relations. --- 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() + ")");