2 * Copyright (c) 1995-2014, Index Datassss
4 * See the file LICENSE for details.
6 package org.z3950.zing.cql;
9 * API bridge between the parser and lexer implementation
12 public interface CQLTokenizer {
14 public static final int TT_EOF = -1;
15 public static final int TT_WORD = -3;
16 public static final int TT_NOTHING = -4;
18 public final static int TT_STRING = 999; // quoted string
19 public final static int TT_LE = 1000; // The "<=" relation
20 public final static int TT_GE = 1001; // The ">=" relation
21 public final static int TT_NE = 1002; // The "<>" relation
22 public final static int TT_EQEQ = 1003; // The "==" relation
23 public final static int TT_AND = 1004; // The "and" boolean
24 public final static int TT_OR = 1005; // The "or" boolean
25 public final static int TT_NOT = 1006; // The "not" boolean
26 public final static int TT_PROX = 1007; // The "prox" boolean
27 public final static int TT_SORTBY = 1008; // The "sortby" operator
30 * Consume next input token
35 * Return the value of the last consumed token
36 * @return value of the token
38 public String value();
41 * Return the type of the last consumed token
42 * @return last consumed token
47 * Render the type and value of the last consumed token
48 * @return human-readable string
50 public String render();
53 * Render specified token type
54 * @param what token type
55 * @param quote true, if single characters should be quoted for readability
56 * @return human-readable string
58 public String render(int what, boolean quote);