svn-gvsig-desktop / tags / v1_11_0_Build_1306 / extensions / extSymbology / extSymbology / src / org / gvsig / symbology / fmap / labeling / parse / LabelExpressionParserTokenManager.java @ 35698
History | View | Annotate | Download (22.4 KB)
1 | 35698 | fdiaz | /* Generated By:JavaCC: Do not edit this line. LabelExpressionParserTokenManager.java */
|
---|---|---|---|
2 | 28369 | vcaballero | /* gvSIG. Sistema de Información Geográfica de la Generalitat Valenciana
|
3 | *
|
||
4 | * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
||
5 | *
|
||
6 | * This program is free software; you can redistribute it and/or
|
||
7 | * modify it under the terms of the GNU General Public License
|
||
8 | * as published by the Free Software Foundation; either version 2
|
||
9 | * of the License, or (at your option) any later version.
|
||
10 | *
|
||
11 | * This program is distributed in the hope that it will be useful,
|
||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
14 | * GNU General Public License for more details.
|
||
15 | *
|
||
16 | * You should have received a copy of the GNU General Public License
|
||
17 | * along with this program; if not, write to the Free Software
|
||
18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
||
19 | *
|
||
20 | * For more information, contact:
|
||
21 | *
|
||
22 | * Generalitat Valenciana
|
||
23 | * Conselleria d'Infraestructures i Transport
|
||
24 | * Av. Blasco Ibáñez, 50
|
||
25 | * 46010 VALENCIA
|
||
26 | * SPAIN
|
||
27 | *
|
||
28 | * +34 963862235
|
||
29 | * gvsig@gva.es
|
||
30 | * www.gvsig.gva.es
|
||
31 | *
|
||
32 | * or
|
||
33 | *
|
||
34 | * IVER T.I. S.A
|
||
35 | * Salamanca 50
|
||
36 | * 46005 Valencia
|
||
37 | * Spain
|
||
38 | *
|
||
39 | * +34 963163400
|
||
40 | * dac@iver.es
|
||
41 | 35698 | fdiaz | */
|
42 | package org.gvsig.symbology.fmap.labeling.parse; |
||
43 | import java.util.*; |
||
44 | import java.io.*; |
||
45 | import com.hardcode.gdbms.engine.values.*; |
||
46 | import org.gvsig.symbology.fmap.rendering.filter.operations.*; |
||
47 | import org.gvsig.symbology.fmap.labeling.parse.*; |
||
48 | import org.gvsig.symbology.fmap.labeling.lang.functions.*; |
||
49 | |||
50 | public class LabelExpressionParserTokenManager implements LabelExpressionParserConstants |
||
51 | { |
||
52 | public java.io.PrintStream debugStream = System.out; |
||
53 | public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } |
||
54 | 28369 | vcaballero | private final int jjStopStringLiteralDfa_0(int pos, long active0) |
55 | 35698 | fdiaz | { |
56 | 28369 | vcaballero | switch (pos)
|
57 | 35698 | fdiaz | { |
58 | case 0: |
||
59 | if ((active0 & 0x10000000L) != 0L) |
||
60 | { |
||
61 | jjmatchedKind = 29;
|
||
62 | return 9; |
||
63 | } |
||
64 | if ((active0 & 0x31000L) != 0L) |
||
65 | { |
||
66 | jjmatchedKind = 36;
|
||
67 | return -1; |
||
68 | } |
||
69 | if ((active0 & 0x800000L) != 0L) |
||
70 | return 36; |
||
71 | return -1; |
||
72 | case 1: |
||
73 | if ((active0 & 0x10000000L) != 0L) |
||
74 | { |
||
75 | jjmatchedKind = 29;
|
||
76 | jjmatchedPos = 1;
|
||
77 | return 9; |
||
78 | } |
||
79 | if ((active0 & 0x31000L) != 0L) |
||
80 | { |
||
81 | if (jjmatchedPos == 0) |
||
82 | { |
||
83 | jjmatchedKind = 36;
|
||
84 | jjmatchedPos = 0;
|
||
85 | } |
||
86 | return -1; |
||
87 | } |
||
88 | return -1; |
||
89 | case 2: |
||
90 | if ((active0 & 0x10000000L) != 0L) |
||
91 | { |
||
92 | jjmatchedKind = 29;
|
||
93 | jjmatchedPos = 2;
|
||
94 | return 9; |
||
95 | } |
||
96 | return -1; |
||
97 | default :
|
||
98 | return -1; |
||
99 | } |
||
100 | } |
||
101 | 28369 | vcaballero | private final int jjStartNfa_0(int pos, long active0) |
102 | 35698 | fdiaz | { |
103 | return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1); |
||
104 | } |
||
105 | private final int jjStopAtPos(int pos, int kind) |
||
106 | { |
||
107 | jjmatchedKind = kind; |
||
108 | jjmatchedPos = pos; |
||
109 | return pos + 1; |
||
110 | } |
||
111 | private final int jjStartNfaWithStates_0(int pos, int kind, int state) |
||
112 | { |
||
113 | jjmatchedKind = kind; |
||
114 | jjmatchedPos = pos; |
||
115 | try { curChar = input_stream.readChar(); }
|
||
116 | catch(java.io.IOException e) { return pos + 1; } |
||
117 | return jjMoveNfa_0(state, pos + 1); |
||
118 | } |
||
119 | private final int jjMoveStringLiteralDfa0_0() |
||
120 | { |
||
121 | switch(curChar)
|
||
122 | { |
||
123 | case 9: |
||
124 | return jjStopAtPos(0, 3); |
||
125 | case 32: |
||
126 | return jjStopAtPos(0, 1); |
||
127 | case 33: |
||
128 | jjmatchedKind = 11;
|
||
129 | return jjMoveStringLiteralDfa1_0(0x8000L); |
||
130 | case 34: |
||
131 | return jjStartNfaWithStates_0(0, 23, 36); |
||
132 | case 38: |
||
133 | return jjMoveStringLiteralDfa1_0(0x20000L); |
||
134 | case 40: |
||
135 | return jjStopAtPos(0, 21); |
||
136 | case 41: |
||
137 | return jjStopAtPos(0, 22); |
||
138 | case 42: |
||
139 | return jjStopAtPos(0, 7); |
||
140 | case 43: |
||
141 | return jjStopAtPos(0, 5); |
||
142 | case 44: |
||
143 | return jjStopAtPos(0, 24); |
||
144 | case 45: |
||
145 | return jjStopAtPos(0, 6); |
||
146 | case 47: |
||
147 | return jjStopAtPos(0, 8); |
||
148 | case 58: |
||
149 | return jjStopAtPos(0, 25); |
||
150 | case 59: |
||
151 | return jjStopAtPos(0, 26); |
||
152 | case 60: |
||
153 | jjmatchedKind = 10;
|
||
154 | return jjMoveStringLiteralDfa1_0(0x2000L); |
||
155 | case 61: |
||
156 | return jjMoveStringLiteralDfa1_0(0x1000L); |
||
157 | case 62: |
||
158 | jjmatchedKind = 9;
|
||
159 | return jjMoveStringLiteralDfa1_0(0x4000L); |
||
160 | case 91: |
||
161 | return jjStopAtPos(0, 19); |
||
162 | case 93: |
||
163 | return jjStopAtPos(0, 20); |
||
164 | case 110: |
||
165 | return jjMoveStringLiteralDfa1_0(0x10000000L); |
||
166 | case 124: |
||
167 | return jjMoveStringLiteralDfa1_0(0x10000L); |
||
168 | default :
|
||
169 | return jjMoveNfa_0(3, 0); |
||
170 | } |
||
171 | } |
||
172 | private final int jjMoveStringLiteralDfa1_0(long active0) |
||
173 | { |
||
174 | try { curChar = input_stream.readChar(); }
|
||
175 | catch(java.io.IOException e) {
|
||
176 | jjStopStringLiteralDfa_0(0, active0);
|
||
177 | return 1; |
||
178 | } |
||
179 | switch(curChar)
|
||
180 | { |
||
181 | case 38: |
||
182 | if ((active0 & 0x20000L) != 0L) |
||
183 | return jjStopAtPos(1, 17); |
||
184 | break;
|
||
185 | case 61: |
||
186 | if ((active0 & 0x1000L) != 0L) |
||
187 | return jjStopAtPos(1, 12); |
||
188 | else if ((active0 & 0x2000L) != 0L) |
||
189 | return jjStopAtPos(1, 13); |
||
190 | else if ((active0 & 0x4000L) != 0L) |
||
191 | return jjStopAtPos(1, 14); |
||
192 | else if ((active0 & 0x8000L) != 0L) |
||
193 | return jjStopAtPos(1, 15); |
||
194 | break;
|
||
195 | case 117: |
||
196 | return jjMoveStringLiteralDfa2_0(active0, 0x10000000L); |
||
197 | case 124: |
||
198 | if ((active0 & 0x10000L) != 0L) |
||
199 | return jjStopAtPos(1, 16); |
||
200 | break;
|
||
201 | default :
|
||
202 | break;
|
||
203 | } |
||
204 | return jjStartNfa_0(0, active0); |
||
205 | } |
||
206 | private final int jjMoveStringLiteralDfa2_0(long old0, long active0) |
||
207 | { |
||
208 | if (((active0 &= old0)) == 0L) |
||
209 | return jjStartNfa_0(0, old0); |
||
210 | try { curChar = input_stream.readChar(); }
|
||
211 | catch(java.io.IOException e) {
|
||
212 | jjStopStringLiteralDfa_0(1, active0);
|
||
213 | return 2; |
||
214 | } |
||
215 | switch(curChar)
|
||
216 | { |
||
217 | case 108: |
||
218 | return jjMoveStringLiteralDfa3_0(active0, 0x10000000L); |
||
219 | default :
|
||
220 | break;
|
||
221 | } |
||
222 | return jjStartNfa_0(1, active0); |
||
223 | } |
||
224 | private final int jjMoveStringLiteralDfa3_0(long old0, long active0) |
||
225 | { |
||
226 | if (((active0 &= old0)) == 0L) |
||
227 | return jjStartNfa_0(1, old0); |
||
228 | try { curChar = input_stream.readChar(); }
|
||
229 | catch(java.io.IOException e) {
|
||
230 | jjStopStringLiteralDfa_0(2, active0);
|
||
231 | return 3; |
||
232 | } |
||
233 | switch(curChar)
|
||
234 | { |
||
235 | case 108: |
||
236 | if ((active0 & 0x10000000L) != 0L) |
||
237 | return jjStartNfaWithStates_0(3, 28, 9); |
||
238 | break;
|
||
239 | default :
|
||
240 | break;
|
||
241 | } |
||
242 | return jjStartNfa_0(2, active0); |
||
243 | } |
||
244 | private final void jjCheckNAdd(int state) |
||
245 | { |
||
246 | if (jjrounds[state] != jjround)
|
||
247 | { |
||
248 | jjstateSet[jjnewStateCnt++] = state; |
||
249 | jjrounds[state] = jjround; |
||
250 | } |
||
251 | } |
||
252 | private final void jjAddStates(int start, int end) |
||
253 | { |
||
254 | do {
|
||
255 | jjstateSet[jjnewStateCnt++] = jjnextStates[start]; |
||
256 | } while (start++ != end);
|
||
257 | } |
||
258 | private final void jjCheckNAddTwoStates(int state1, int state2) |
||
259 | { |
||
260 | jjCheckNAdd(state1); |
||
261 | jjCheckNAdd(state2); |
||
262 | } |
||
263 | private final void jjCheckNAddStates(int start, int end) |
||
264 | { |
||
265 | do {
|
||
266 | jjCheckNAdd(jjnextStates[start]); |
||
267 | } while (start++ != end);
|
||
268 | } |
||
269 | private final void jjCheckNAddStates(int start) |
||
270 | { |
||
271 | jjCheckNAdd(jjnextStates[start]); |
||
272 | jjCheckNAdd(jjnextStates[start + 1]);
|
||
273 | } |
||
274 | 28369 | vcaballero | static final long[] jjbitVec0 = { |
275 | 35698 | fdiaz | 0x0L, 0x0L, 0x0L, 0x2000000000000000L |
276 | }; |
||
277 | 28369 | vcaballero | static final long[] jjbitVec1 = { |
278 | 35698 | fdiaz | 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL |
279 | }; |
||
280 | static final long[] jjbitVec3 = { |
||
281 | 28369 | vcaballero | 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL |
282 | 35698 | fdiaz | }; |
283 | private final int jjMoveNfa_0(int startState, int curPos) |
||
284 | { |
||
285 | int[] nextStates; |
||
286 | int startsAt = 0; |
||
287 | jjnewStateCnt = 36;
|
||
288 | int i = 1; |
||
289 | jjstateSet[0] = startState;
|
||
290 | int j, kind = 0x7fffffff; |
||
291 | for (;;)
|
||
292 | { |
||
293 | if (++jjround == 0x7fffffff) |
||
294 | ReInitRounds(); |
||
295 | if (curChar < 64) |
||
296 | { |
||
297 | long l = 1L << curChar; |
||
298 | MatchLoop: do
|
||
299 | { |
||
300 | switch(jjstateSet[--i])
|
||
301 | { |
||
302 | case 36: |
||
303 | if ((0xf7fffffbffffdbffL & l) != 0L) |
||
304 | jjCheckNAddTwoStates(17, 18); |
||
305 | else if (curChar == 34) |
||
306 | { |
||
307 | if (kind > 35) |
||
308 | kind = 35;
|
||
309 | } |
||
310 | break;
|
||
311 | case 3: |
||
312 | if ((0xf7fffffbffffdbffL & l) != 0L) |
||
313 | { |
||
314 | if (kind > 36) |
||
315 | kind = 36;
|
||
316 | } |
||
317 | else if (curChar == 34) |
||
318 | jjCheckNAddTwoStates(17, 18); |
||
319 | if ((0x3ff000000000000L & l) != 0L) |
||
320 | { |
||
321 | if (kind > 32) |
||
322 | kind = 32;
|
||
323 | jjCheckNAddStates(0, 7); |
||
324 | } |
||
325 | else if ((0x3000000000L & l) != 0L) |
||
326 | { |
||
327 | if (kind > 29) |
||
328 | kind = 29;
|
||
329 | jjCheckNAdd(9);
|
||
330 | } |
||
331 | else if (curChar == 46) |
||
332 | jjCheckNAdd(11);
|
||
333 | break;
|
||
334 | case 8: |
||
335 | if ((0x3000000000L & l) == 0L) |
||
336 | break;
|
||
337 | if (kind > 29) |
||
338 | kind = 29;
|
||
339 | jjCheckNAdd(9);
|
||
340 | break;
|
||
341 | case 9: |
||
342 | if ((0x3ff003000000000L & l) == 0L) |
||
343 | break;
|
||
344 | if (kind > 29) |
||
345 | kind = 29;
|
||
346 | jjCheckNAdd(9);
|
||
347 | break;
|
||
348 | case 10: |
||
349 | if (curChar == 46) |
||
350 | jjCheckNAdd(11);
|
||
351 | break;
|
||
352 | case 11: |
||
353 | if ((0x3ff000000000000L & l) == 0L) |
||
354 | break;
|
||
355 | if (kind > 33) |
||
356 | kind = 33;
|
||
357 | jjCheckNAddStates(8, 10); |
||
358 | break;
|
||
359 | case 13: |
||
360 | if ((0x280000000000L & l) != 0L) |
||
361 | jjCheckNAdd(14);
|
||
362 | break;
|
||
363 | case 14: |
||
364 | if ((0x3ff000000000000L & l) == 0L) |
||
365 | break;
|
||
366 | if (kind > 33) |
||
367 | kind = 33;
|
||
368 | jjCheckNAddTwoStates(14, 15); |
||
369 | break;
|
||
370 | case 16: |
||
371 | if (curChar == 34) |
||
372 | jjCheckNAddTwoStates(17, 18); |
||
373 | break;
|
||
374 | case 17: |
||
375 | if ((0xf7fffffbffffdbffL & l) != 0L) |
||
376 | jjCheckNAddTwoStates(17, 18); |
||
377 | break;
|
||
378 | case 18: |
||
379 | if (curChar == 34 && kind > 35) |
||
380 | kind = 35;
|
||
381 | break;
|
||
382 | case 19: |
||
383 | if ((0xf7fffffbffffdbffL & l) != 0L && kind > 36) |
||
384 | kind = 36;
|
||
385 | break;
|
||
386 | case 20: |
||
387 | if ((0x3ff000000000000L & l) == 0L) |
||
388 | break;
|
||
389 | if (kind > 32) |
||
390 | kind = 32;
|
||
391 | jjCheckNAddStates(0, 7); |
||
392 | break;
|
||
393 | case 21: |
||
394 | if ((0x3ff000000000000L & l) == 0L) |
||
395 | break;
|
||
396 | if (kind > 32) |
||
397 | kind = 32;
|
||
398 | jjCheckNAdd(21);
|
||
399 | break;
|
||
400 | case 22: |
||
401 | if ((0x3ff000000000000L & l) != 0L) |
||
402 | jjCheckNAddTwoStates(22, 23); |
||
403 | break;
|
||
404 | case 23: |
||
405 | if (curChar != 46) |
||
406 | break;
|
||
407 | if (kind > 33) |
||
408 | kind = 33;
|
||
409 | jjCheckNAddStates(11, 13); |
||
410 | break;
|
||
411 | case 24: |
||
412 | if ((0x3ff000000000000L & l) == 0L) |
||
413 | break;
|
||
414 | if (kind > 33) |
||
415 | kind = 33;
|
||
416 | jjCheckNAddStates(11, 13); |
||
417 | break;
|
||
418 | case 26: |
||
419 | if ((0x280000000000L & l) != 0L) |
||
420 | jjCheckNAdd(27);
|
||
421 | break;
|
||
422 | case 27: |
||
423 | if ((0x3ff000000000000L & l) == 0L) |
||
424 | break;
|
||
425 | if (kind > 33) |
||
426 | kind = 33;
|
||
427 | jjCheckNAddTwoStates(27, 15); |
||
428 | break;
|
||
429 | case 28: |
||
430 | if ((0x3ff000000000000L & l) != 0L) |
||
431 | jjCheckNAddTwoStates(28, 29); |
||
432 | break;
|
||
433 | case 30: |
||
434 | if ((0x280000000000L & l) != 0L) |
||
435 | jjCheckNAdd(31);
|
||
436 | break;
|
||
437 | case 31: |
||
438 | if ((0x3ff000000000000L & l) == 0L) |
||
439 | break;
|
||
440 | if (kind > 33) |
||
441 | kind = 33;
|
||
442 | jjCheckNAddTwoStates(31, 15); |
||
443 | break;
|
||
444 | case 32: |
||
445 | if ((0x3ff000000000000L & l) != 0L) |
||
446 | jjCheckNAddStates(14, 16); |
||
447 | break;
|
||
448 | case 34: |
||
449 | if ((0x280000000000L & l) != 0L) |
||
450 | jjCheckNAdd(35);
|
||
451 | break;
|
||
452 | case 35: |
||
453 | if ((0x3ff000000000000L & l) != 0L) |
||
454 | jjCheckNAddTwoStates(35, 15); |
||
455 | break;
|
||
456 | default : break; |
||
457 | } |
||
458 | } while(i != startsAt);
|
||
459 | } |
||
460 | else if (curChar < 128) |
||
461 | { |
||
462 | long l = 1L << (curChar & 077); |
||
463 | MatchLoop: do
|
||
464 | { |
||
465 | switch(jjstateSet[--i])
|
||
466 | { |
||
467 | case 36: |
||
468 | case 17: |
||
469 | jjCheckNAddTwoStates(17, 18); |
||
470 | break;
|
||
471 | case 3: |
||
472 | if (kind > 36) |
||
473 | kind = 36;
|
||
474 | if ((0x7fffffe87fffffeL & l) != 0L) |
||
475 | { |
||
476 | if (kind > 29) |
||
477 | kind = 29;
|
||
478 | jjCheckNAdd(9);
|
||
479 | } |
||
480 | if (curChar == 102) |
||
481 | jjstateSet[jjnewStateCnt++] = 6;
|
||
482 | else if (curChar == 116) |
||
483 | jjstateSet[jjnewStateCnt++] = 2;
|
||
484 | break;
|
||
485 | case 0: |
||
486 | if (curChar == 101 && kind > 27) |
||
487 | kind = 27;
|
||
488 | break;
|
||
489 | case 1: |
||
490 | if (curChar == 117) |
||
491 | jjCheckNAdd(0);
|
||
492 | break;
|
||
493 | case 2: |
||
494 | if (curChar == 114) |
||
495 | jjstateSet[jjnewStateCnt++] = 1;
|
||
496 | break;
|
||
497 | case 4: |
||
498 | if (curChar == 115) |
||
499 | jjCheckNAdd(0);
|
||
500 | break;
|
||
501 | case 5: |
||
502 | if (curChar == 108) |
||
503 | jjstateSet[jjnewStateCnt++] = 4;
|
||
504 | break;
|
||
505 | case 6: |
||
506 | if (curChar == 97) |
||
507 | jjstateSet[jjnewStateCnt++] = 5;
|
||
508 | break;
|
||
509 | case 7: |
||
510 | if (curChar == 102) |
||
511 | jjstateSet[jjnewStateCnt++] = 6;
|
||
512 | break;
|
||
513 | case 8: |
||
514 | case 9: |
||
515 | if ((0x7fffffe87fffffeL & l) == 0L) |
||
516 | break;
|
||
517 | if (kind > 29) |
||
518 | kind = 29;
|
||
519 | jjCheckNAdd(9);
|
||
520 | break;
|
||
521 | case 12: |
||
522 | if ((0x2000000020L & l) != 0L) |
||
523 | jjAddStates(17, 18); |
||
524 | break;
|
||
525 | case 15: |
||
526 | if ((0x5000000050L & l) != 0L && kind > 33) |
||
527 | kind = 33;
|
||
528 | break;
|
||
529 | case 19: |
||
530 | if (kind > 36) |
||
531 | kind = 36;
|
||
532 | break;
|
||
533 | case 25: |
||
534 | if ((0x2000000020L & l) != 0L) |
||
535 | jjAddStates(19, 20); |
||
536 | break;
|
||
537 | case 29: |
||
538 | if ((0x2000000020L & l) != 0L) |
||
539 | jjAddStates(21, 22); |
||
540 | break;
|
||
541 | case 33: |
||
542 | if ((0x2000000020L & l) != 0L) |
||
543 | jjAddStates(23, 24); |
||
544 | break;
|
||
545 | default : break; |
||
546 | } |
||
547 | } while(i != startsAt);
|
||
548 | } |
||
549 | else
|
||
550 | { |
||
551 | int hiByte = (int)(curChar >> 8); |
||
552 | int i1 = hiByte >> 6; |
||
553 | long l1 = 1L << (hiByte & 077); |
||
554 | int i2 = (curChar & 0xff) >> 6; |
||
555 | long l2 = 1L << (curChar & 077); |
||
556 | MatchLoop: do
|
||
557 | { |
||
558 | switch(jjstateSet[--i])
|
||
559 | { |
||
560 | case 36: |
||
561 | case 17: |
||
562 | if (jjCanMove_1(hiByte, i1, i2, l1, l2))
|
||
563 | jjCheckNAddTwoStates(17, 18); |
||
564 | break;
|
||
565 | case 3: |
||
566 | if (jjCanMove_0(hiByte, i1, i2, l1, l2))
|
||
567 | { |
||
568 | if (kind > 29) |
||
569 | kind = 29;
|
||
570 | jjCheckNAdd(9);
|
||
571 | } |
||
572 | if (jjCanMove_1(hiByte, i1, i2, l1, l2))
|
||
573 | { |
||
574 | if (kind > 36) |
||
575 | kind = 36;
|
||
576 | } |
||
577 | break;
|
||
578 | case 8: |
||
579 | case 9: |
||
580 | if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
|
||
581 | break;
|
||
582 | if (kind > 29) |
||
583 | kind = 29;
|
||
584 | jjCheckNAdd(9);
|
||
585 | break;
|
||
586 | case 19: |
||
587 | if (jjCanMove_1(hiByte, i1, i2, l1, l2) && kind > 36) |
||
588 | kind = 36;
|
||
589 | break;
|
||
590 | default : break; |
||
591 | } |
||
592 | } while(i != startsAt);
|
||
593 | } |
||
594 | if (kind != 0x7fffffff) |
||
595 | { |
||
596 | jjmatchedKind = kind; |
||
597 | jjmatchedPos = curPos; |
||
598 | kind = 0x7fffffff;
|
||
599 | } |
||
600 | ++curPos; |
||
601 | if ((i = jjnewStateCnt) == (startsAt = 36 - (jjnewStateCnt = startsAt))) |
||
602 | return curPos;
|
||
603 | try { curChar = input_stream.readChar(); }
|
||
604 | catch(java.io.IOException e) { return curPos; } |
||
605 | } |
||
606 | } |
||
607 | 28369 | vcaballero | static final int[] jjnextStates = { |
608 | 21, 22, 23, 28, 29, 32, 33, 15, 11, 12, 15, 24, 25, 15, 32, 33, |
||
609 | 15, 13, 14, 26, 27, 30, 31, 34, 35, |
||
610 | 35698 | fdiaz | }; |
611 | private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2) |
||
612 | { |
||
613 | switch(hiByte)
|
||
614 | { |
||
615 | case 255: |
||
616 | return ((jjbitVec0[i2] & l2) != 0L); |
||
617 | default :
|
||
618 | return false; |
||
619 | } |
||
620 | } |
||
621 | private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, long l2) |
||
622 | { |
||
623 | switch(hiByte)
|
||
624 | { |
||
625 | case 0: |
||
626 | return ((jjbitVec3[i2] & l2) != 0L); |
||
627 | default :
|
||
628 | if ((jjbitVec1[i1] & l1) != 0L) |
||
629 | return true; |
||
630 | return false; |
||
631 | } |
||
632 | } |
||
633 | public static final String[] jjstrLiteralImages = { |
||
634 | "", null, null, null, null, "\53", "\55", "\52", "\57", "\76", "\74", "\41", |
||
635 | "\75\75", "\74\75", "\76\75", "\41\75", "\174\174", "\46\46", null, "\133", "\135", |
||
636 | "\50", "\51", "\42", "\54", "\72", "\73", null, "\156\165\154\154", null, null, null, |
||
637 | null, null, null, null, null, }; |
||
638 | public static final String[] lexStateNames = { |
||
639 | "DEFAULT",
|
||
640 | }; |
||
641 | 28369 | vcaballero | static final long[] jjtoToken = { |
642 | 0x1b3ffbffe1L,
|
||
643 | 35698 | fdiaz | }; |
644 | 28369 | vcaballero | static final long[] jjtoSkip = { |
645 | 0x1eL,
|
||
646 | 35698 | fdiaz | }; |
647 | protected SimpleCharStream input_stream;
|
||
648 | private final int[] jjrounds = new int[36]; |
||
649 | private final int[] jjstateSet = new int[72]; |
||
650 | protected char curChar; |
||
651 | public LabelExpressionParserTokenManager(SimpleCharStream stream){
|
||
652 | if (SimpleCharStream.staticFlag)
|
||
653 | throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); |
||
654 | input_stream = stream; |
||
655 | } |
||
656 | public LabelExpressionParserTokenManager(SimpleCharStream stream, int lexState){ |
||
657 | this(stream);
|
||
658 | SwitchTo(lexState); |
||
659 | } |
||
660 | public void ReInit(SimpleCharStream stream) |
||
661 | { |
||
662 | jjmatchedPos = jjnewStateCnt = 0;
|
||
663 | curLexState = defaultLexState; |
||
664 | input_stream = stream; |
||
665 | ReInitRounds(); |
||
666 | } |
||
667 | private final void ReInitRounds() |
||
668 | { |
||
669 | int i;
|
||
670 | jjround = 0x80000001;
|
||
671 | for (i = 36; i-- > 0;) |
||
672 | jjrounds[i] = 0x80000000;
|
||
673 | } |
||
674 | public void ReInit(SimpleCharStream stream, int lexState) |
||
675 | { |
||
676 | ReInit(stream); |
||
677 | SwitchTo(lexState); |
||
678 | } |
||
679 | public void SwitchTo(int lexState) |
||
680 | { |
||
681 | if (lexState >= 1 || lexState < 0) |
||
682 | throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); |
||
683 | else
|
||
684 | curLexState = lexState; |
||
685 | } |
||
686 | |||
687 | protected Token jjFillToken()
|
||
688 | { |
||
689 | Token t = Token.newToken(jjmatchedKind); |
||
690 | t.kind = jjmatchedKind; |
||
691 | String im = jjstrLiteralImages[jjmatchedKind];
|
||
692 | t.image = (im == null) ? input_stream.GetImage() : im;
|
||
693 | t.beginLine = input_stream.getBeginLine(); |
||
694 | t.beginColumn = input_stream.getBeginColumn(); |
||
695 | t.endLine = input_stream.getEndLine(); |
||
696 | t.endColumn = input_stream.getEndColumn(); |
||
697 | return t;
|
||
698 | } |
||
699 | |||
700 | int curLexState = 0; |
||
701 | int defaultLexState = 0; |
||
702 | int jjnewStateCnt;
|
||
703 | int jjround;
|
||
704 | int jjmatchedPos;
|
||
705 | int jjmatchedKind;
|
||
706 | |||
707 | public Token getNextToken()
|
||
708 | { |
||
709 | int kind;
|
||
710 | Token specialToken = null;
|
||
711 | Token matchedToken; |
||
712 | int curPos = 0; |
||
713 | |||
714 | 28369 | vcaballero | EOFLoop : |
715 | 35698 | fdiaz | for (;;)
|
716 | { |
||
717 | try
|
||
718 | { |
||
719 | curChar = input_stream.BeginToken(); |
||
720 | } |
||
721 | catch(java.io.IOException e)
|
||
722 | { |
||
723 | jjmatchedKind = 0;
|
||
724 | matchedToken = jjFillToken(); |
||
725 | return matchedToken;
|
||
726 | } |
||
727 | |||
728 | try { input_stream.backup(0); |
||
729 | while (curChar <= 13 && (0x2400L & (1L << curChar)) != 0L) |
||
730 | curChar = input_stream.BeginToken(); |
||
731 | } |
||
732 | catch (java.io.IOException e1) { continue EOFLoop; } |
||
733 | jjmatchedKind = 0x7fffffff;
|
||
734 | jjmatchedPos = 0;
|
||
735 | curPos = jjMoveStringLiteralDfa0_0(); |
||
736 | if (jjmatchedKind != 0x7fffffff) |
||
737 | { |
||
738 | if (jjmatchedPos + 1 < curPos) |
||
739 | input_stream.backup(curPos - jjmatchedPos - 1);
|
||
740 | if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) |
||
741 | { |
||
742 | matchedToken = jjFillToken(); |
||
743 | return matchedToken;
|
||
744 | } |
||
745 | else
|
||
746 | { |
||
747 | continue EOFLoop;
|
||
748 | } |
||
749 | } |
||
750 | int error_line = input_stream.getEndLine();
|
||
751 | int error_column = input_stream.getEndColumn();
|
||
752 | String error_after = null; |
||
753 | boolean EOFSeen = false; |
||
754 | try { input_stream.readChar(); input_stream.backup(1); } |
||
755 | catch (java.io.IOException e1) {
|
||
756 | EOFSeen = true;
|
||
757 | error_after = curPos <= 1 ? "" : input_stream.GetImage(); |
||
758 | if (curChar == '\n' || curChar == '\r') { |
||
759 | error_line++; |
||
760 | error_column = 0;
|
||
761 | } |
||
762 | else
|
||
763 | error_column++; |
||
764 | } |
||
765 | if (!EOFSeen) {
|
||
766 | input_stream.backup(1);
|
||
767 | error_after = curPos <= 1 ? "" : input_stream.GetImage(); |
||
768 | } |
||
769 | throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); |
||
770 | } |
||
771 | } |
||
772 | |||
773 | } |