-// $Id: CQLLexer.java,v 1.14 2007-07-03 13:30:42 mike Exp $
package org.z3950.zing.cql;
+import java.io.InputStream;
+import java.io.Reader;
import java.io.StreamTokenizer;
import java.io.StringReader;
-import java.util.Hashtable;
// This is a semi-trivial subclass for java.io.StreamTokenizer that:
private static boolean DEBUG;
CQLLexer(String cql, boolean lexdebug) {
- super(new StringReader(cql));
+ this(new StringReader(cql), lexdebug);
+ }
+
+ CQLLexer(Reader cql, boolean lexdebug) {
+ super(cql);
wordChars('!', '?'); // ASCII-dependency!
wordChars('[', '`'); // ASCII-dependency!
quoteChar('"');
ordinaryChar('/');
ordinaryChar('(');
ordinaryChar(')');
+ ordinaryChar('.');
+ wordChars('.', '.');
wordChars('\'', '\''); // prevent this from introducing strings
//parseNumbers();
ordinaryChar('-');
saved_sval = sval;
}
+ @Override
public int nextToken() throws java.io.IOException {
if (saved_ttype != TT_UNDEFINED) {
ttype = saved_ttype;