1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49 package org.jaxen.saxpath.base;
50
51
52 class TokenTypes
53 {
54 static final int EOF = -1;
55 static final int SKIP = -2;
56 static final int ERROR = -3;
57
58 static final int EQUALS = 1;
59 static final int NOT_EQUALS = 2;
60
61 static final int LESS_THAN_SIGN = 3;
62 static final int LESS_THAN_OR_EQUALS_SIGN = 4;
63 static final int GREATER_THAN_SIGN = 5;
64 static final int GREATER_THAN_OR_EQUALS_SIGN = 6;
65
66 static final int PLUS = 7;
67 static final int MINUS = 8;
68 static final int STAR = 9;
69 static final int MOD = 10;
70 static final int DIV = 11;
71
72 static final int SLASH = 12;
73 static final int DOUBLE_SLASH = 13;
74 static final int DOT = 14;
75 static final int DOT_DOT = 15;
76
77 static final int IDENTIFIER = 16;
78
79 static final int AT = 17;
80 static final int PIPE = 18;
81 static final int COLON = 19;
82 static final int DOUBLE_COLON = 20;
83
84 static final int LEFT_BRACKET = 21;
85 static final int RIGHT_BRACKET = 22;
86 static final int LEFT_PAREN = 23;
87 static final int RIGHT_PAREN = 24;
88
89
90 static final int DOLLAR = 25;
91 static final int LITERAL = 26;
92 static final int AND = 27;
93 static final int OR = 28;
94
95
96
97 static final int DOUBLE = 29;
98 static final int COMMA = 30;
99
100 static String getTokenText( int tokenType )
101 {
102 switch( tokenType )
103 {
104 case ERROR:
105 return "(error)";
106 case SKIP:
107 return "(skip)";
108 case EOF:
109 return "(eof)";
110 case 0:
111 return "Unrecognized token type: 0";
112 case EQUALS:
113 return "=";
114 case NOT_EQUALS:
115 return "!=";
116 case LESS_THAN_SIGN:
117 return "<";
118 case LESS_THAN_OR_EQUALS_SIGN:
119 return "<=";
120 case GREATER_THAN_SIGN:
121 return ">";
122 case GREATER_THAN_OR_EQUALS_SIGN:
123 return ">=";
124 case PLUS:
125 return "+";
126 case MINUS:
127 return "-";
128 case STAR:
129 return "*";
130 case DIV:
131 return "div";
132 case MOD:
133 return "mod";
134 case SLASH:
135 return "/";
136 case DOUBLE_SLASH:
137 return "//";
138 case DOT:
139 return ".";
140 case DOT_DOT:
141 return "..";
142 case IDENTIFIER:
143 return "(identifier)";
144 case AT:
145 return "@";
146 case PIPE:
147 return "|";
148 case COLON:
149 return ":";
150 case DOUBLE_COLON:
151 return "::";
152 case LEFT_BRACKET:
153 return "[";
154 case RIGHT_BRACKET:
155 return "]";
156 case LEFT_PAREN:
157 return "(";
158 case RIGHT_PAREN:
159 return ")";
160 case DOLLAR:
161 return "$";
162 case LITERAL:
163 return "(literal)";
164 case AND:
165 return "and";
166 case OR:
167 return "or";
168 case DOUBLE:
169 return "(double)";
170 case COMMA:
171 return ",";
172 default:
173
174
175
176
177
178
179
180 return("Unrecognized token type: " + tokenType);
181 }
182 }
183 }