From 1b70f711eb07665540df0c15208a8fe18744d65f Mon Sep 17 00:00:00 2001 From: mike Date: Fri, 29 Jun 2007 12:54:05 +0000 Subject: [PATCH] Remove obsolete keywords! Whoop! --- src/org/z3950/zing/cql/CQLLexer.java | 14 +------------- src/org/z3950/zing/cql/CQLParser.java | 12 +++--------- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/src/org/z3950/zing/cql/CQLLexer.java b/src/org/z3950/zing/cql/CQLLexer.java index ac7f97d..11c99ea 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.11 2007-06-29 11:55:45 mike Exp $ +// $Id: CQLLexer.java,v 1.12 2007-06-29 12:54:05 mike Exp $ package org.z3950.zing.cql; import java.io.StreamTokenizer; @@ -23,12 +23,6 @@ class CQLLexer extends 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_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 // Support for keywords. It would be nice to compile this linear // list into a Hashtable, but it's hard to store ints as hash @@ -49,12 +43,6 @@ class CQLLexer extends StreamTokenizer { new Keyword(TT_OR, "or"), new Keyword(TT_NOT, "not"), new Keyword(TT_PROX, "prox"), - new Keyword(TT_pWORD, "word"), - new Keyword(TT_SENTENCE, "sentence"), - new Keyword(TT_PARAGRAPH, "paragraph"), - new Keyword(TT_ELEMENT, "element"), - new Keyword(TT_ORDERED, "xordered"), - new Keyword(TT_UNORDERED, "unordered"), }; // For halfDecentPushBack() and the code at the top of nextToken() diff --git a/src/org/z3950/zing/cql/CQLParser.java b/src/org/z3950/zing/cql/CQLParser.java index 6d49c56..0ccd539 100644 --- a/src/org/z3950/zing/cql/CQLParser.java +++ b/src/org/z3950/zing/cql/CQLParser.java @@ -1,4 +1,4 @@ -// $Id: CQLParser.java,v 1.33 2007-06-29 12:27:08 mike Exp $ +// $Id: CQLParser.java,v 1.34 2007-06-29 12:54:05 mike Exp $ package org.z3950.zing.cql; import java.io.IOException; @@ -12,7 +12,7 @@ import java.io.FileNotFoundException; /** * Compiles CQL strings into parse trees of CQLNode subtypes. * - * @version $Id: CQLParser.java,v 1.33 2007-06-29 12:27:08 mike Exp $ + * @version $Id: CQLParser.java,v 1.34 2007-06-29 12:54:05 mike Exp $ * @see http://zing.z3950.org/cql/index.html */ @@ -204,13 +204,7 @@ public class CQLParser { lexer.ttype == lexer.TT_AND || lexer.ttype == lexer.TT_OR || lexer.ttype == lexer.TT_NOT || - lexer.ttype == lexer.TT_PROX || - lexer.ttype == lexer.TT_pWORD || - lexer.ttype == lexer.TT_SENTENCE || - lexer.ttype == lexer.TT_PARAGRAPH || - lexer.ttype == lexer.TT_ELEMENT || - lexer.ttype == lexer.TT_ORDERED || - lexer.ttype == lexer.TT_UNORDERED) { + lexer.ttype == lexer.TT_PROX) { String symbol = (lexer.ttype == lexer.TT_NUMBER) ? lexer.render() : lexer.sval; match(lexer.ttype); -- 1.7.10.4