Add classes for visitor traversal
[cql-java-moved-to-github.git] / src / main / java / org / z3950 / zing / cql / CQLTokenizer.java
index 4ab0702..2d8b6b1 100644 (file)
@@ -6,7 +6,7 @@
 package org.z3950.zing.cql;
 
 /**
- *
+ * API bridge between the parser and lexer implementation
  * @author jakub
  */
 public interface CQLTokenizer {
@@ -15,6 +15,7 @@ public interface CQLTokenizer {
   public static final int TT_WORD = -3;
   public static final int TT_NOTHING = -4;
   
+  public final static int TT_STRING = 999;      // quoted string
   public final static int TT_LE     = 1000;    // The "<=" relation
   public final static int TT_GE     = 1001;    // The ">=" relation
   public final static int TT_NE     = 1002;    // The "<>" relation
@@ -25,14 +26,35 @@ public interface CQLTokenizer {
   public final static int TT_PROX   = 1007;    // The "prox" boolean
   public final static int TT_SORTBY = 1008;    // The "sortby" operator
   
+  /**
+   * Consume next input token
+   */
   public void move();
   
+  /**
+   * Return the value of the last consumed token
+   * @return value of the token
+   */
   public String value();
   
+  /**
+   * Return the type of the last consumed token
+   * @return last consumed token
+   */
   public int what();
   
+  /**
+   * Render the type and value of the last consumed token
+   * @return human-readable string
+   */
   public String render();
   
+  /**
+   * Render specified token type
+   * @param what token type
+   * @param quote true, if single characters should be quoted for readability
+   * @return human-readable string
+   */
   public String render(int what, boolean quote);
   
   public int pos();