-// $Id: CQLLexer.java,v 1.2 2002-10-31 22:22:01 mike Exp $
+// $Id: CQLLexer.java,v 1.11 2007-06-29 11:55:45 mike Exp $
package org.z3950.zing.cql;
import java.io.StreamTokenizer;
static int TT_OR = 1004; // The "or" boolean
static int TT_NOT = 1005; // The "not" boolean
static int TT_PROX = 1006; // The "prox" boolean
- 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
new Keyword(TT_OR, "or"),
new Keyword(TT_NOT, "not"),
new Keyword(TT_PROX, "prox"),
- new Keyword(TT_ANY, "any"),
- new Keyword(TT_ALL, "all"),
- new Keyword(TT_EXACT, "exact"),
new Keyword(TT_pWORD, "word"),
new Keyword(TT_SENTENCE, "sentence"),
new Keyword(TT_PARAGRAPH, "paragraph"),
new Keyword(TT_ELEMENT, "element"),
- new Keyword(TT_ORDERED, "ordered"),
+ new Keyword(TT_ORDERED, "xordered"),
new Keyword(TT_UNORDERED, "unordered"),
};
CQLLexer(String cql, boolean lexdebug) {
super(new StringReader(cql));
+ wordChars('!', '?'); // ASCII-dependency!
+ wordChars('[', '`'); // ASCII-dependency!
+ quoteChar('"');
ordinaryChar('=');
ordinaryChar('<');
ordinaryChar('>');
if (token == TT_EOF) {
return "EOF";
} else if (token == TT_NUMBER) {
- return new Integer((int) nval).toString();
+ if ((double) nval == (int) nval) {
+ return new Integer((int) nval).toString();
+ } else {
+ return new Double((double) nval).toString();
+ }
} else if (token == TT_WORD) {
return "word: " + sval;
} else if (token == '"') {