Add javadoc
[cql-java-moved-to-github.git] / src / main / java / org / z3950 / zing / cql / CQLTokenizer.java
1 /*
2  * Copyright (c) 1995-2014, Index Datassss
3  * All rights reserved.
4  * See the file LICENSE for details.
5  */
6 package org.z3950.zing.cql;
7
8 /**
9  * API bridge between the parser and lexer implementation
10  * @author jakub
11  */
12 public interface CQLTokenizer {
13   
14   public static final int TT_EOF  = -1;
15   public static final int TT_WORD = -3;
16   public static final int TT_NOTHING = -4;
17   
18   public final static int TT_LE     = 1000;     // The "<=" relation
19   public final static int TT_GE     = 1001;     // The ">=" relation
20   public final static int TT_NE     = 1002;     // The "<>" relation
21   public final static int TT_EQEQ   = 1003;     // The "==" relation
22   public final static int TT_AND    = 1004;     // The "and" boolean
23   public final static int TT_OR     = 1005;     // The "or" boolean
24   public final static int TT_NOT    = 1006;     // The "not" boolean
25   public final static int TT_PROX   = 1007;     // The "prox" boolean
26   public final static int TT_SORTBY = 1008;     // The "sortby" operator
27   
28   /**
29    * Consume next input token
30    */
31   public void move();
32   
33   /**
34    * Return the value of the last consumed token
35    * @return value of the token
36    */
37   public String value();
38   
39   /**
40    * Return the type of the last consumed token
41    * @return last consumed token
42    */
43   public int what();
44   
45   /**
46    * Render the type and value of the last consumed token
47    * @return human-readable string
48    */
49   public String render();
50   
51   /**
52    * Render specified token type
53    * @param what token type
54    * @param quote true, if single characters should be quoted for readability
55    * @return human-readable string
56    */
57   public String render(int what, boolean quote);
58   
59   public int pos();
60   
61 }