Source Code Cross Referenced for ParserTokenManager.java in  » Library » Apache-commons-jexl-1.1-src » org » apache » commons » jexl » parser » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Library » Apache commons jexl 1.1 src » org.apache.commons.jexl.parser 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2002-2006 The Apache Software Foundation.
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *      http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        /* Generated By:JJTree&JavaCC: Do not edit this line. ParserTokenManager.java */
017:        package org.apache.commons.jexl.parser;
018:
019:        public class ParserTokenManager implements  ParserConstants {
020:            public java.io.PrintStream debugStream = System.out;
021:
022:            public void setDebugStream(java.io.PrintStream ds) {
023:                debugStream = ds;
024:            }
025:
026:            private final int jjStopStringLiteralDfa_0(int pos, long active0) {
027:                switch (pos) {
028:                case 0:
029:                    if ((active0 & 0x3ef285550a4800L) != 0L) {
030:                        jjmatchedKind = 58;
031:                        return 5;
032:                    }
033:                    return -1;
034:                case 1:
035:                    if ((active0 & 0x1cf28000084800L) != 0L) {
036:                        jjmatchedKind = 58;
037:                        jjmatchedPos = 1;
038:                        return 5;
039:                    }
040:                    if ((active0 & 0x22000555020000L) != 0L)
041:                        return 5;
042:                    return -1;
043:                case 2:
044:                    if ((active0 & 0x1ce00000004800L) != 0L) {
045:                        jjmatchedKind = 58;
046:                        jjmatchedPos = 2;
047:                        return 5;
048:                    }
049:                    if ((active0 & 0x128000080000L) != 0L)
050:                        return 5;
051:                    return -1;
052:                case 3:
053:                    if ((active0 & 0x18800000000800L) != 0L) {
054:                        jjmatchedKind = 58;
055:                        jjmatchedPos = 3;
056:                        return 5;
057:                    }
058:                    if ((active0 & 0x4600000004000L) != 0L)
059:                        return 5;
060:                    return -1;
061:                case 4:
062:                    if ((active0 & 0x10000000000000L) != 0L) {
063:                        jjmatchedKind = 58;
064:                        jjmatchedPos = 4;
065:                        return 5;
066:                    }
067:                    if ((active0 & 0x8800000000800L) != 0L)
068:                        return 5;
069:                    return -1;
070:                case 5:
071:                    if ((active0 & 0x10000000000000L) != 0L) {
072:                        jjmatchedKind = 58;
073:                        jjmatchedPos = 5;
074:                        return 5;
075:                    }
076:                    return -1;
077:                default:
078:                    return -1;
079:                }
080:            }
081:
082:            private final int jjStartNfa_0(int pos, long active0) {
083:                return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0),
084:                        pos + 1);
085:            }
086:
087:            private final int jjStopAtPos(int pos, int kind) {
088:                jjmatchedKind = kind;
089:                jjmatchedPos = pos;
090:                return pos + 1;
091:            }
092:
093:            private final int jjStartNfaWithStates_0(int pos, int kind,
094:                    int state) {
095:                jjmatchedKind = kind;
096:                jjmatchedPos = pos;
097:                try {
098:                    curChar = input_stream.readChar();
099:                } catch (java.io.IOException e) {
100:                    return pos + 1;
101:                }
102:                return jjMoveNfa_0(state, pos + 1);
103:            }
104:
105:            private final int jjMoveStringLiteralDfa0_0() {
106:                switch (curChar) {
107:                case 33:
108:                    jjmatchedKind = 43;
109:                    return jjMoveStringLiteralDfa1_0(0x2000000L);
110:                case 37:
111:                    return jjStopAtPos(0, 40);
112:                case 38:
113:                    jjmatchedKind = 22;
114:                    return jjMoveStringLiteralDfa1_0(0x40000L);
115:                case 40:
116:                    return jjStopAtPos(0, 12);
117:                case 41:
118:                    return jjStopAtPos(0, 13);
119:                case 42:
120:                    return jjStopAtPos(0, 37);
121:                case 43:
122:                    return jjStopAtPos(0, 35);
123:                case 44:
124:                    return jjStopAtPos(0, 54);
125:                case 45:
126:                    return jjStopAtPos(0, 36);
127:                case 46:
128:                    return jjStopAtPos(0, 57);
129:                case 47:
130:                    return jjStopAtPos(0, 38);
131:                case 59:
132:                    return jjStopAtPos(0, 48);
133:                case 60:
134:                    jjmatchedKind = 27;
135:                    return jjMoveStringLiteralDfa1_0(0x80000000L);
136:                case 61:
137:                    jjmatchedKind = 15;
138:                    return jjMoveStringLiteralDfa1_0(0x800000L);
139:                case 62:
140:                    jjmatchedKind = 29;
141:                    return jjMoveStringLiteralDfa1_0(0x200000000L);
142:                case 91:
143:                    return jjStopAtPos(0, 55);
144:                case 93:
145:                    return jjStopAtPos(0, 56);
146:                case 94:
147:                    return jjStopAtPos(0, 21);
148:                case 97:
149:                    return jjMoveStringLiteralDfa1_0(0x80000L);
150:                case 100:
151:                    return jjMoveStringLiteralDfa1_0(0x8000000000L);
152:                case 101:
153:                    return jjMoveStringLiteralDfa1_0(0x4000001000800L);
154:                case 102:
155:                    return jjMoveStringLiteralDfa1_0(0x10800000000000L);
156:                case 103:
157:                    return jjMoveStringLiteralDfa1_0(0x440000000L);
158:                case 105:
159:                    return jjMoveStringLiteralDfa1_0(0x22000000000000L);
160:                case 108:
161:                    return jjMoveStringLiteralDfa1_0(0x110000000L);
162:                case 109:
163:                    return jjMoveStringLiteralDfa1_0(0x20000000000L);
164:                case 110:
165:                    return jjMoveStringLiteralDfa1_0(0x300004000000L);
166:                case 111:
167:                    return jjMoveStringLiteralDfa1_0(0x20000L);
168:                case 115:
169:                    return jjMoveStringLiteralDfa1_0(0x4000L);
170:                case 116:
171:                    return jjMoveStringLiteralDfa1_0(0x400000000000L);
172:                case 119:
173:                    return jjMoveStringLiteralDfa1_0(0x8000000000000L);
174:                case 123:
175:                    return jjStopAtPos(0, 9);
176:                case 124:
177:                    jjmatchedKind = 20;
178:                    return jjMoveStringLiteralDfa1_0(0x10000L);
179:                case 125:
180:                    return jjStopAtPos(0, 10);
181:                case 126:
182:                    return jjStopAtPos(0, 42);
183:                default:
184:                    return jjMoveNfa_0(3, 0);
185:                }
186:            }
187:
188:            private final int jjMoveStringLiteralDfa1_0(long active0) {
189:                try {
190:                    curChar = input_stream.readChar();
191:                } catch (java.io.IOException e) {
192:                    jjStopStringLiteralDfa_0(0, active0);
193:                    return 1;
194:                }
195:                switch (curChar) {
196:                case 38:
197:                    if ((active0 & 0x40000L) != 0L)
198:                        return jjStopAtPos(1, 18);
199:                    break;
200:                case 61:
201:                    if ((active0 & 0x800000L) != 0L)
202:                        return jjStopAtPos(1, 23);
203:                    else if ((active0 & 0x2000000L) != 0L)
204:                        return jjStopAtPos(1, 25);
205:                    else if ((active0 & 0x80000000L) != 0L)
206:                        return jjStopAtPos(1, 31);
207:                    else if ((active0 & 0x200000000L) != 0L)
208:                        return jjStopAtPos(1, 33);
209:                    break;
210:                case 97:
211:                    return jjMoveStringLiteralDfa2_0(active0, 0x800000000000L);
212:                case 101:
213:                    if ((active0 & 0x4000000L) != 0L)
214:                        return jjStartNfaWithStates_0(1, 26, 5);
215:                    else if ((active0 & 0x100000000L) != 0L)
216:                        return jjStartNfaWithStates_0(1, 32, 5);
217:                    else if ((active0 & 0x400000000L) != 0L)
218:                        return jjStartNfaWithStates_0(1, 34, 5);
219:                    break;
220:                case 102:
221:                    if ((active0 & 0x2000000000000L) != 0L)
222:                        return jjStartNfaWithStates_0(1, 49, 5);
223:                    break;
224:                case 104:
225:                    return jjMoveStringLiteralDfa2_0(active0, 0x8000000000000L);
226:                case 105:
227:                    return jjMoveStringLiteralDfa2_0(active0, 0x8000004000L);
228:                case 108:
229:                    return jjMoveStringLiteralDfa2_0(active0, 0x4000000000000L);
230:                case 109:
231:                    return jjMoveStringLiteralDfa2_0(active0, 0x800L);
232:                case 110:
233:                    if ((active0 & 0x20000000000000L) != 0L)
234:                        return jjStartNfaWithStates_0(1, 53, 5);
235:                    return jjMoveStringLiteralDfa2_0(active0, 0x80000L);
236:                case 111:
237:                    return jjMoveStringLiteralDfa2_0(active0, 0x10120000000000L);
238:                case 113:
239:                    if ((active0 & 0x1000000L) != 0L)
240:                        return jjStartNfaWithStates_0(1, 24, 5);
241:                    break;
242:                case 114:
243:                    if ((active0 & 0x20000L) != 0L)
244:                        return jjStartNfaWithStates_0(1, 17, 5);
245:                    return jjMoveStringLiteralDfa2_0(active0, 0x400000000000L);
246:                case 116:
247:                    if ((active0 & 0x10000000L) != 0L)
248:                        return jjStartNfaWithStates_0(1, 28, 5);
249:                    else if ((active0 & 0x40000000L) != 0L)
250:                        return jjStartNfaWithStates_0(1, 30, 5);
251:                    break;
252:                case 117:
253:                    return jjMoveStringLiteralDfa2_0(active0, 0x200000000000L);
254:                case 124:
255:                    if ((active0 & 0x10000L) != 0L)
256:                        return jjStopAtPos(1, 16);
257:                    break;
258:                default:
259:                    break;
260:                }
261:                return jjStartNfa_0(0, active0);
262:            }
263:
264:            private final int jjMoveStringLiteralDfa2_0(long old0, long active0) {
265:                if (((active0 &= old0)) == 0L)
266:                    return jjStartNfa_0(0, old0);
267:                try {
268:                    curChar = input_stream.readChar();
269:                } catch (java.io.IOException e) {
270:                    jjStopStringLiteralDfa_0(1, active0);
271:                    return 2;
272:                }
273:                switch (curChar) {
274:                case 100:
275:                    if ((active0 & 0x80000L) != 0L)
276:                        return jjStartNfaWithStates_0(2, 19, 5);
277:                    else if ((active0 & 0x20000000000L) != 0L)
278:                        return jjStartNfaWithStates_0(2, 41, 5);
279:                    break;
280:                case 105:
281:                    return jjMoveStringLiteralDfa3_0(active0, 0x8000000000000L);
282:                case 108:
283:                    return jjMoveStringLiteralDfa3_0(active0, 0xa00000000000L);
284:                case 112:
285:                    return jjMoveStringLiteralDfa3_0(active0, 0x800L);
286:                case 114:
287:                    return jjMoveStringLiteralDfa3_0(active0, 0x10000000000000L);
288:                case 115:
289:                    return jjMoveStringLiteralDfa3_0(active0, 0x4000000000000L);
290:                case 116:
291:                    if ((active0 & 0x100000000000L) != 0L)
292:                        return jjStartNfaWithStates_0(2, 44, 5);
293:                    break;
294:                case 117:
295:                    return jjMoveStringLiteralDfa3_0(active0, 0x400000000000L);
296:                case 118:
297:                    if ((active0 & 0x8000000000L) != 0L)
298:                        return jjStartNfaWithStates_0(2, 39, 5);
299:                    break;
300:                case 122:
301:                    return jjMoveStringLiteralDfa3_0(active0, 0x4000L);
302:                default:
303:                    break;
304:                }
305:                return jjStartNfa_0(1, active0);
306:            }
307:
308:            private final int jjMoveStringLiteralDfa3_0(long old0, long active0) {
309:                if (((active0 &= old0)) == 0L)
310:                    return jjStartNfa_0(1, old0);
311:                try {
312:                    curChar = input_stream.readChar();
313:                } catch (java.io.IOException e) {
314:                    jjStopStringLiteralDfa_0(2, active0);
315:                    return 3;
316:                }
317:                switch (curChar) {
318:                case 101:
319:                    if ((active0 & 0x4000L) != 0L)
320:                        return jjStartNfaWithStates_0(3, 14, 5);
321:                    else if ((active0 & 0x400000000000L) != 0L)
322:                        return jjStartNfaWithStates_0(3, 46, 5);
323:                    else if ((active0 & 0x4000000000000L) != 0L)
324:                        return jjStartNfaWithStates_0(3, 50, 5);
325:                    return jjMoveStringLiteralDfa4_0(active0, 0x10000000000000L);
326:                case 108:
327:                    if ((active0 & 0x200000000000L) != 0L)
328:                        return jjStartNfaWithStates_0(3, 45, 5);
329:                    return jjMoveStringLiteralDfa4_0(active0, 0x8000000000000L);
330:                case 115:
331:                    return jjMoveStringLiteralDfa4_0(active0, 0x800000000000L);
332:                case 116:
333:                    return jjMoveStringLiteralDfa4_0(active0, 0x800L);
334:                default:
335:                    break;
336:                }
337:                return jjStartNfa_0(2, active0);
338:            }
339:
340:            private final int jjMoveStringLiteralDfa4_0(long old0, long active0) {
341:                if (((active0 &= old0)) == 0L)
342:                    return jjStartNfa_0(2, old0);
343:                try {
344:                    curChar = input_stream.readChar();
345:                } catch (java.io.IOException e) {
346:                    jjStopStringLiteralDfa_0(3, active0);
347:                    return 4;
348:                }
349:                switch (curChar) {
350:                case 97:
351:                    return jjMoveStringLiteralDfa5_0(active0, 0x10000000000000L);
352:                case 101:
353:                    if ((active0 & 0x800000000000L) != 0L)
354:                        return jjStartNfaWithStates_0(4, 47, 5);
355:                    else if ((active0 & 0x8000000000000L) != 0L)
356:                        return jjStartNfaWithStates_0(4, 51, 5);
357:                    break;
358:                case 121:
359:                    if ((active0 & 0x800L) != 0L)
360:                        return jjStartNfaWithStates_0(4, 11, 5);
361:                    break;
362:                default:
363:                    break;
364:                }
365:                return jjStartNfa_0(3, active0);
366:            }
367:
368:            private final int jjMoveStringLiteralDfa5_0(long old0, long active0) {
369:                if (((active0 &= old0)) == 0L)
370:                    return jjStartNfa_0(3, old0);
371:                try {
372:                    curChar = input_stream.readChar();
373:                } catch (java.io.IOException e) {
374:                    jjStopStringLiteralDfa_0(4, active0);
375:                    return 5;
376:                }
377:                switch (curChar) {
378:                case 99:
379:                    return jjMoveStringLiteralDfa6_0(active0, 0x10000000000000L);
380:                default:
381:                    break;
382:                }
383:                return jjStartNfa_0(4, active0);
384:            }
385:
386:            private final int jjMoveStringLiteralDfa6_0(long old0, long active0) {
387:                if (((active0 &= old0)) == 0L)
388:                    return jjStartNfa_0(4, old0);
389:                try {
390:                    curChar = input_stream.readChar();
391:                } catch (java.io.IOException e) {
392:                    jjStopStringLiteralDfa_0(5, active0);
393:                    return 6;
394:                }
395:                switch (curChar) {
396:                case 104:
397:                    if ((active0 & 0x10000000000000L) != 0L)
398:                        return jjStartNfaWithStates_0(6, 52, 5);
399:                    break;
400:                default:
401:                    break;
402:                }
403:                return jjStartNfa_0(5, active0);
404:            }
405:
406:            private final void jjCheckNAdd(int state) {
407:                if (jjrounds[state] != jjround) {
408:                    jjstateSet[jjnewStateCnt++] = state;
409:                    jjrounds[state] = jjround;
410:                }
411:            }
412:
413:            private final void jjAddStates(int start, int end) {
414:                do {
415:                    jjstateSet[jjnewStateCnt++] = jjnextStates[start];
416:                } while (start++ != end);
417:            }
418:
419:            private final void jjCheckNAddTwoStates(int state1, int state2) {
420:                jjCheckNAdd(state1);
421:                jjCheckNAdd(state2);
422:            }
423:
424:            private final void jjCheckNAddStates(int start, int end) {
425:                do {
426:                    jjCheckNAdd(jjnextStates[start]);
427:                } while (start++ != end);
428:            }
429:
430:            private final void jjCheckNAddStates(int start) {
431:                jjCheckNAdd(jjnextStates[start]);
432:                jjCheckNAdd(jjnextStates[start + 1]);
433:            }
434:
435:            static final long[] jjbitVec0 = { 0x0L, 0x0L, 0xffffffffffffffffL,
436:                    0xffffffffffffffffL };
437:
438:            private final int jjMoveNfa_0(int startState, int curPos) {
439:                int[] nextStates;
440:                int startsAt = 0;
441:                jjnewStateCnt = 17;
442:                int i = 1;
443:                jjstateSet[0] = startState;
444:                int j, kind = 0x7fffffff;
445:                for (;;) {
446:                    if (++jjround == 0x7fffffff)
447:                        ReInitRounds();
448:                    if (curChar < 64) {
449:                        long l = 1L << curChar;
450:                        MatchLoop: do {
451:                            switch (jjstateSet[--i]) {
452:                            case 3:
453:                                if ((0x3ff000000000000L & l) != 0L) {
454:                                    if (kind > 7)
455:                                        kind = 7;
456:                                    jjCheckNAddStates(0, 2);
457:                                } else if (curChar == 39)
458:                                    jjCheckNAddTwoStates(10, 11);
459:                                else if (curChar == 34)
460:                                    jjCheckNAddTwoStates(7, 8);
461:                                else if (curChar == 36) {
462:                                    if (kind > 58)
463:                                        kind = 58;
464:                                    jjCheckNAdd(5);
465:                                } else if (curChar == 35)
466:                                    jjstateSet[jjnewStateCnt++] = 0;
467:                                break;
468:                            case 0:
469:                                if (curChar == 35)
470:                                    jjCheckNAddTwoStates(1, 2);
471:                                break;
472:                            case 1:
473:                                if ((0xfffffffbffffdbffL & l) != 0L)
474:                                    jjCheckNAddTwoStates(1, 2);
475:                                break;
476:                            case 2:
477:                                if ((0x2400L & l) != 0L)
478:                                    kind = 1;
479:                                break;
480:                            case 4:
481:                                if (curChar != 36)
482:                                    break;
483:                                if (kind > 58)
484:                                    kind = 58;
485:                                jjCheckNAdd(5);
486:                                break;
487:                            case 5:
488:                                if ((0x3ff001000000000L & l) == 0L)
489:                                    break;
490:                                if (kind > 58)
491:                                    kind = 58;
492:                                jjCheckNAdd(5);
493:                                break;
494:                            case 6:
495:                                if (curChar == 34)
496:                                    jjCheckNAddTwoStates(7, 8);
497:                                break;
498:                            case 7:
499:                                if ((0xfffffffbffffdbffL & l) != 0L)
500:                                    jjCheckNAddTwoStates(7, 8);
501:                                break;
502:                            case 8:
503:                                if (curChar == 34 && kind > 61)
504:                                    kind = 61;
505:                                break;
506:                            case 9:
507:                                if (curChar == 39)
508:                                    jjCheckNAddTwoStates(10, 11);
509:                                break;
510:                            case 10:
511:                                if ((0xffffff7fffffdbffL & l) != 0L)
512:                                    jjCheckNAddTwoStates(10, 11);
513:                                break;
514:                            case 11:
515:                                if (curChar == 39 && kind > 61)
516:                                    kind = 61;
517:                                break;
518:                            case 12:
519:                                if ((0x3ff000000000000L & l) == 0L)
520:                                    break;
521:                                if (kind > 7)
522:                                    kind = 7;
523:                                jjCheckNAddStates(0, 2);
524:                                break;
525:                            case 13:
526:                                if ((0x3ff000000000000L & l) == 0L)
527:                                    break;
528:                                if (kind > 7)
529:                                    kind = 7;
530:                                jjCheckNAdd(13);
531:                                break;
532:                            case 14:
533:                                if ((0x3ff000000000000L & l) != 0L)
534:                                    jjCheckNAddTwoStates(14, 15);
535:                                break;
536:                            case 15:
537:                                if (curChar == 46)
538:                                    jjCheckNAdd(16);
539:                                break;
540:                            case 16:
541:                                if ((0x3ff000000000000L & l) == 0L)
542:                                    break;
543:                                if (kind > 8)
544:                                    kind = 8;
545:                                jjCheckNAdd(16);
546:                                break;
547:                            default:
548:                                break;
549:                            }
550:                        } while (i != startsAt);
551:                    } else if (curChar < 128) {
552:                        long l = 1L << (curChar & 077);
553:                        MatchLoop: do {
554:                            switch (jjstateSet[--i]) {
555:                            case 3:
556:                            case 5:
557:                                if ((0x7fffffe87fffffeL & l) == 0L)
558:                                    break;
559:                                if (kind > 58)
560:                                    kind = 58;
561:                                jjCheckNAdd(5);
562:                                break;
563:                            case 1:
564:                                jjAddStates(3, 4);
565:                                break;
566:                            case 7:
567:                                jjAddStates(5, 6);
568:                                break;
569:                            case 10:
570:                                jjAddStates(7, 8);
571:                                break;
572:                            default:
573:                                break;
574:                            }
575:                        } while (i != startsAt);
576:                    } else {
577:                        int i2 = (curChar & 0xff) >> 6;
578:                        long l2 = 1L << (curChar & 077);
579:                        MatchLoop: do {
580:                            switch (jjstateSet[--i]) {
581:                            case 1:
582:                                if ((jjbitVec0[i2] & l2) != 0L)
583:                                    jjAddStates(3, 4);
584:                                break;
585:                            case 7:
586:                                if ((jjbitVec0[i2] & l2) != 0L)
587:                                    jjAddStates(5, 6);
588:                                break;
589:                            case 10:
590:                                if ((jjbitVec0[i2] & l2) != 0L)
591:                                    jjAddStates(7, 8);
592:                                break;
593:                            default:
594:                                break;
595:                            }
596:                        } while (i != startsAt);
597:                    }
598:                    if (kind != 0x7fffffff) {
599:                        jjmatchedKind = kind;
600:                        jjmatchedPos = curPos;
601:                        kind = 0x7fffffff;
602:                    }
603:                    ++curPos;
604:                    if ((i = jjnewStateCnt) == (startsAt = 17 - (jjnewStateCnt = startsAt)))
605:                        return curPos;
606:                    try {
607:                        curChar = input_stream.readChar();
608:                    } catch (java.io.IOException e) {
609:                        return curPos;
610:                    }
611:                }
612:            }
613:
614:            static final int[] jjnextStates = { 13, 14, 15, 1, 2, 7, 8, 10, 11, };
615:
616:            public static final String[] jjstrLiteralImages = { "", null, null,
617:                    null, null, null, null, null, null, "\173", "\175",
618:                    "\145\155\160\164\171", "\50", "\51", "\163\151\172\145",
619:                    "\75", "\174\174", "\157\162", "\46\46", "\141\156\144",
620:                    "\174", "\136", "\46", "\75\75", "\145\161", "\41\75",
621:                    "\156\145", "\74", "\154\164", "\76", "\147\164", "\74\75",
622:                    "\154\145", "\76\75", "\147\145", "\53", "\55", "\52",
623:                    "\57", "\144\151\166", "\45", "\155\157\144", "\176",
624:                    "\41", "\156\157\164", "\156\165\154\154",
625:                    "\164\162\165\145", "\146\141\154\163\145", "\73",
626:                    "\151\146", "\145\154\163\145", "\167\150\151\154\145",
627:                    "\146\157\162\145\141\143\150", "\151\156", "\54", "\133",
628:                    "\135", "\56", null, null, null, null, };
629:
630:            public static final String[] lexStateNames = { "DEFAULT", };
631:
632:            static final long[] jjtoToken = { 0x27ffffffffffff81L, };
633:
634:            static final long[] jjtoSkip = { 0x7eL, };
635:
636:            private SimpleCharStream input_stream;
637:
638:            private final int[] jjrounds = new int[17];
639:
640:            private final int[] jjstateSet = new int[34];
641:
642:            protected char curChar;
643:
644:            public ParserTokenManager(SimpleCharStream stream) {
645:                if (SimpleCharStream.staticFlag)
646:                    throw new Error(
647:                            "ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
648:                input_stream = stream;
649:            }
650:
651:            public ParserTokenManager(SimpleCharStream stream, int lexState) {
652:                this (stream);
653:                SwitchTo(lexState);
654:            }
655:
656:            public void ReInit(SimpleCharStream stream) {
657:                jjmatchedPos = jjnewStateCnt = 0;
658:                curLexState = defaultLexState;
659:                input_stream = stream;
660:                ReInitRounds();
661:            }
662:
663:            private final void ReInitRounds() {
664:                int i;
665:                jjround = 0x80000001;
666:                for (i = 17; i-- > 0;)
667:                    jjrounds[i] = 0x80000000;
668:            }
669:
670:            public void ReInit(SimpleCharStream stream, int lexState) {
671:                ReInit(stream);
672:                SwitchTo(lexState);
673:            }
674:
675:            public void SwitchTo(int lexState) {
676:                if (lexState >= 1 || lexState < 0)
677:                    throw new TokenMgrError(
678:                            "Error: Ignoring invalid lexical state : "
679:                                    + lexState + ". State unchanged.",
680:                            TokenMgrError.INVALID_LEXICAL_STATE);
681:                else
682:                    curLexState = lexState;
683:            }
684:
685:            private final Token jjFillToken() {
686:                Token t = Token.newToken(jjmatchedKind);
687:                t.kind = jjmatchedKind;
688:                String im = jjstrLiteralImages[jjmatchedKind];
689:                t.image = (im == null) ? input_stream.GetImage() : im;
690:                t.beginLine = input_stream.getBeginLine();
691:                t.beginColumn = input_stream.getBeginColumn();
692:                t.endLine = input_stream.getEndLine();
693:                t.endColumn = input_stream.getEndColumn();
694:                return t;
695:            }
696:
697:            int curLexState = 0;
698:
699:            int defaultLexState = 0;
700:
701:            int jjnewStateCnt;
702:
703:            int jjround;
704:
705:            int jjmatchedPos;
706:
707:            int jjmatchedKind;
708:
709:            public final Token getNextToken() {
710:                int kind;
711:                Token specialToken = null;
712:                Token matchedToken;
713:                int curPos = 0;
714:
715:                EOFLoop: for (;;) {
716:                    try {
717:                        curChar = input_stream.BeginToken();
718:                    } catch (java.io.IOException e) {
719:                        jjmatchedKind = 0;
720:                        matchedToken = jjFillToken();
721:                        return matchedToken;
722:                    }
723:
724:                    try {
725:                        input_stream.backup(0);
726:                        while (curChar <= 32
727:                                && (0x100003600L & (1L << curChar)) != 0L)
728:                            curChar = input_stream.BeginToken();
729:                    } catch (java.io.IOException e1) {
730:                        continue EOFLoop;
731:                    }
732:                    jjmatchedKind = 0x7fffffff;
733:                    jjmatchedPos = 0;
734:                    curPos = jjMoveStringLiteralDfa0_0();
735:                    if (jjmatchedKind != 0x7fffffff) {
736:                        if (jjmatchedPos + 1 < curPos)
737:                            input_stream.backup(curPos - jjmatchedPos - 1);
738:                        if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) {
739:                            matchedToken = jjFillToken();
740:                            return matchedToken;
741:                        } else {
742:                            continue EOFLoop;
743:                        }
744:                    }
745:                    int error_line = input_stream.getEndLine();
746:                    int error_column = input_stream.getEndColumn();
747:                    String error_after = null;
748:                    boolean EOFSeen = false;
749:                    try {
750:                        input_stream.readChar();
751:                        input_stream.backup(1);
752:                    } catch (java.io.IOException e1) {
753:                        EOFSeen = true;
754:                        error_after = curPos <= 1 ? "" : input_stream
755:                                .GetImage();
756:                        if (curChar == '\n' || curChar == '\r') {
757:                            error_line++;
758:                            error_column = 0;
759:                        } else
760:                            error_column++;
761:                    }
762:                    if (!EOFSeen) {
763:                        input_stream.backup(1);
764:                        error_after = curPos <= 1 ? "" : input_stream
765:                                .GetImage();
766:                    }
767:                    throw new TokenMgrError(EOFSeen, curLexState, error_line,
768:                            error_column, error_after, curChar,
769:                            TokenMgrError.LEXICAL_ERROR);
770:                }
771:            }
772:
773:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.