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 final int STAR_OPERATOR = 31;
101
102 static String getTokenText( int tokenType )
103 {
104 switch( tokenType )
105 {
106 case ERROR:
107 return "(error)";
108 case SKIP:
109 return "(skip)";
110 case EOF:
111 return "(eof)";
112 case 0:
113 return "Unrecognized token type: 0";
114 case EQUALS:
115 return "=";
116 case NOT_EQUALS:
117 return "!=";
118 case LESS_THAN_SIGN:
119 return "<";
120 case LESS_THAN_OR_EQUALS_SIGN:
121 return "<=";
122 case GREATER_THAN_SIGN:
123 return ">";
124 case GREATER_THAN_OR_EQUALS_SIGN:
125 return ">=";
126 case PLUS:
127 return "+";
128 case MINUS:
129 return "-";
130 case STAR:
131 return "*";
132 case STAR_OPERATOR:
133 return "*";
134 case DIV:
135 return "div";
136 case MOD:
137 return "mod";
138 case SLASH:
139 return "/";
140 case DOUBLE_SLASH:
141 return "//";
142 case DOT:
143 return ".";
144 case DOT_DOT:
145 return "..";
146 case IDENTIFIER:
147 return "(identifier)";
148 case AT:
149 return "@";
150 case PIPE:
151 return "|";
152 case COLON:
153 return ":";
154 case DOUBLE_COLON:
155 return "::";
156 case LEFT_BRACKET:
157 return "[";
158 case RIGHT_BRACKET:
159 return "]";
160 case LEFT_PAREN:
161 return "(";
162 case RIGHT_PAREN:
163 return ")";
164 case DOLLAR:
165 return "$";
166 case LITERAL:
167 return "(literal)";
168 case AND:
169 return "and";
170 case OR:
171 return "or";
172 case DOUBLE:
173 return "(double)";
174 case COMMA:
175 return ",";
176 default:
177
178
179
180
181
182
183
184 return("Unrecognized token type: " + tokenType);
185 }
186 }
187 }