X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Forg%2Fz3950%2Fzing%2Fcql%2FCQLLexer.java;h=2cb0369e282b490c3f09763642e5702ef7acf1cc;hb=57b8aeb26a6aacaa478e6886ade3e40ca6eae2bb;hp=52b81f76b3293ea00067af72a5f721d64c30e93f;hpb=f8154c71944186a9b64ddb782082a2026c5a912f;p=cql-java-moved-to-github.git diff --git a/src/org/z3950/zing/cql/CQLLexer.java b/src/org/z3950/zing/cql/CQLLexer.java index 52b81f7..2cb0369 100644 --- a/src/org/z3950/zing/cql/CQLLexer.java +++ b/src/org/z3950/zing/cql/CQLLexer.java @@ -1,4 +1,4 @@ -// $Id: CQLLexer.java,v 1.2 2002-10-31 22:22:01 mike Exp $ +// $Id: CQLLexer.java,v 1.6 2002-11-17 23:29:02 mike Exp $ package org.z3950.zing.cql; import java.io.StreamTokenizer; @@ -26,12 +26,17 @@ class CQLLexer extends StreamTokenizer { static int TT_ANY = 1007; // The "any" relation static int TT_ALL = 1008; // The "all" relation static int TT_EXACT = 1009; // The "exact" relation - static int TT_pWORD = 1010; // The "word" proximity unit + static int TT_pWORD = 1010; // The "word" proximity unit static int TT_SENTENCE = 1011; // The "sentence" proximity unit static int TT_PARAGRAPH = 1012; // The "paragraph" proximity unit static int TT_ELEMENT = 1013; // The "element" proximity unit static int TT_ORDERED = 1014; // The "ordered" proximity ordering static int TT_UNORDERED = 1015; // The "unordered" proximity ordering + static int TT_RELEVANT = 1016; // The "relevant" relation modifier + static int TT_FUZZY = 1017; // The "fuzzy" relation modifier + static int TT_STEM = 1018; // The "stem" relation modifier + static int TT_SCR = 1019; // The server choice relation + static int TT_PHONETIC = 1020; // The "phonetic" relation modifier // Support for keywords. It would be nice to compile this linear // list into a Hashtable, but it's hard to store ints as hash @@ -61,6 +66,11 @@ class CQLLexer extends StreamTokenizer { new Keyword(TT_ELEMENT, "element"), new Keyword(TT_ORDERED, "ordered"), new Keyword(TT_UNORDERED, "unordered"), + new Keyword(TT_RELEVANT, "relevant"), + new Keyword(TT_FUZZY, "fuzzy"), + new Keyword(TT_STEM, "stem"), + new Keyword(TT_SCR, "scr"), + new Keyword(TT_PHONETIC, "phonetic"), }; // For halfDecentPushBack() and the code at the top of nextToken() @@ -74,6 +84,9 @@ class CQLLexer extends StreamTokenizer { CQLLexer(String cql, boolean lexdebug) { super(new StringReader(cql)); + wordChars('!', '?'); // ASCII-dependency! + wordChars('[', '`'); // ASCII-dependency! + quoteChar('"'); ordinaryChar('='); ordinaryChar('<'); ordinaryChar('>');