Source Code Cross Referenced for JavadocParser.java in  » Code-Analyzer » beautyJ » de » gulden » util » javasource » jjt » 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 » Code Analyzer » beautyJ » de.gulden.util.javasource.jjt 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* Generated By:JJTree&JavaCC: Do not edit this line. JavadocParser.java */
002:        package de.gulden.util.javasource.jjt;
003:
004:        import de.gulden.util.javasource.SourceParser;
005:        import java.io.*;
006:
007:        public class JavadocParser/*@bgen(jjtree)*/implements 
008:                JavadocParserTreeConstants, JavadocParserConstants {/*@bgen(jjtree)*/
009:            protected JJTJavadocParserState jjtree = new JJTJavadocParserState();
010:
011:            /**
012:             * Parses Javadoc comments.
013:             * This method is reentrant.
014:             */
015:            public static Node parse(String s) throws ParseException {
016:                return parse(new ByteArrayInputStream(s.getBytes()));
017:            }
018:
019:            /**
020:             * Parses Javadoc comments.
021:             * This method is reentrant.
022:             */
023:            public static Node parse(java.io.InputStream in)
024:                    throws ParseException {
025:                Node node;
026:                JavadocParser parser = new JavadocParser(in);
027:                parser.CompilationUnit();
028:                node = parser.jjtree.rootNode();
029:                //showTree(node,System.out);
030:                return node;
031:            }
032:
033:            /*****************************************
034:             * The Javadoc Grammar starts here.      *
035:             *****************************************/
036:
037:            /*
038:             * Javadoc-comment structuring syntax follows.
039:             */
040:            final public void CompilationUnit() throws ParseException {
041:                /*@bgen(jjtree) CompilationUnit */
042:                SimpleNode jjtn000 = new SimpleNode(JJTCOMPILATIONUNIT);
043:                boolean jjtc000 = true;
044:                jjtree.openNodeScope(jjtn000);
045:                try {
046:                    DocStart();
047:                    Description();
048:                    Tags();
049:                    DocEnd();
050:                    jj_consume_token(0);
051:                } catch (Throwable jjte000) {
052:                    if (jjtc000) {
053:                        jjtree.clearNodeScope(jjtn000);
054:                        jjtc000 = false;
055:                    } else {
056:                        jjtree.popNode();
057:                    }
058:                    if (jjte000 instanceof  RuntimeException) {
059:                        {
060:                            if (true)
061:                                throw (RuntimeException) jjte000;
062:                        }
063:                    }
064:                    if (jjte000 instanceof  ParseException) {
065:                        {
066:                            if (true)
067:                                throw (ParseException) jjte000;
068:                        }
069:                    }
070:                    {
071:                        if (true)
072:                            throw (Error) jjte000;
073:                    }
074:                } finally {
075:                    if (jjtc000) {
076:                        jjtree.closeNodeScope(jjtn000, true);
077:                    }
078:                }
079:            }
080:
081:            final public void DocStart() throws ParseException {
082:                jj_consume_token(DOCSTART);
083:            }
084:
085:            final public void DocEnd() throws ParseException {
086:                if (jj_2_1(2147483647)) {
087:                    jj_consume_token(EOL);
088:                } else {
089:                    ;
090:                }
091:                label_1: while (true) {
092:                    switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
093:                    case STAR:
094:                        ;
095:                        break;
096:                    default:
097:                        jj_la1[0] = jj_gen;
098:                        break label_1;
099:                    }
100:                    jj_consume_token(STAR);
101:                }
102:                jj_consume_token(DOCEND);
103:            }
104:
105:            final public void Description() throws ParseException {
106:                /*@bgen(jjtree) Description */
107:                SimpleNode jjtn000 = new SimpleNode(JJTDESCRIPTION);
108:                boolean jjtc000 = true;
109:                jjtree.openNodeScope(jjtn000);
110:                try {
111:                    switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
112:                    case WORD:
113:                        FirstLine();
114:                        break;
115:                    default:
116:                        jj_la1[1] = jj_gen;
117:                        ;
118:                    }
119:                    MoreLines();
120:                } catch (Throwable jjte000) {
121:                    if (jjtc000) {
122:                        jjtree.clearNodeScope(jjtn000);
123:                        jjtc000 = false;
124:                    } else {
125:                        jjtree.popNode();
126:                    }
127:                    if (jjte000 instanceof  RuntimeException) {
128:                        {
129:                            if (true)
130:                                throw (RuntimeException) jjte000;
131:                        }
132:                    }
133:                    if (jjte000 instanceof  ParseException) {
134:                        {
135:                            if (true)
136:                                throw (ParseException) jjte000;
137:                        }
138:                    }
139:                    {
140:                        if (true)
141:                            throw (Error) jjte000;
142:                    }
143:                } finally {
144:                    if (jjtc000) {
145:                        jjtree.closeNodeScope(jjtn000, true);
146:                    }
147:                }
148:            }
149:
150:            final public void Tags() throws ParseException {
151:                label_2: while (true) {
152:                    if (jj_2_2(2147483647)) {
153:                        ;
154:                    } else {
155:                        break label_2;
156:                    }
157:                    Tag();
158:                }
159:            }
160:
161:            final public void Line() throws ParseException {
162:                /*@bgen(jjtree) Line */
163:                SimpleNode jjtn000 = new SimpleNode(JJTLINE);
164:                boolean jjtc000 = true;
165:                jjtree.openNodeScope(jjtn000);
166:                try {
167:                    label_3: while (true) {
168:                        switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
169:                        case WORD:
170:                            ;
171:                            break;
172:                        default:
173:                            jj_la1[2] = jj_gen;
174:                            break label_3;
175:                        }
176:                        Word();
177:                    }
178:                } catch (Throwable jjte000) {
179:                    if (jjtc000) {
180:                        jjtree.clearNodeScope(jjtn000);
181:                        jjtc000 = false;
182:                    } else {
183:                        jjtree.popNode();
184:                    }
185:                    if (jjte000 instanceof  RuntimeException) {
186:                        {
187:                            if (true)
188:                                throw (RuntimeException) jjte000;
189:                        }
190:                    }
191:                    if (jjte000 instanceof  ParseException) {
192:                        {
193:                            if (true)
194:                                throw (ParseException) jjte000;
195:                        }
196:                    }
197:                    {
198:                        if (true)
199:                            throw (Error) jjte000;
200:                    }
201:                } finally {
202:                    if (jjtc000) {
203:                        jjtree.closeNodeScope(jjtn000, true);
204:                    }
205:                }
206:            }
207:
208:            final public void FirstLine() throws ParseException {
209:                /*@bgen(jjtree) #Line( true) */
210:                SimpleNode jjtn000 = new SimpleNode(JJTLINE);
211:                boolean jjtc000 = true;
212:                jjtree.openNodeScope(jjtn000);
213:                try {
214:                    label_4: while (true) {
215:                        Word();
216:                        switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
217:                        case WORD:
218:                            ;
219:                            break;
220:                        default:
221:                            jj_la1[3] = jj_gen;
222:                            break label_4;
223:                        }
224:                    }
225:                } catch (Throwable jjte000) {
226:                    if (jjtc000) {
227:                        jjtree.clearNodeScope(jjtn000);
228:                        jjtc000 = false;
229:                    } else {
230:                        jjtree.popNode();
231:                    }
232:                    if (jjte000 instanceof  RuntimeException) {
233:                        {
234:                            if (true)
235:                                throw (RuntimeException) jjte000;
236:                        }
237:                    }
238:                    if (jjte000 instanceof  ParseException) {
239:                        {
240:                            if (true)
241:                                throw (ParseException) jjte000;
242:                        }
243:                    }
244:                    {
245:                        if (true)
246:                            throw (Error) jjte000;
247:                    }
248:                } finally {
249:                    if (jjtc000) {
250:                        jjtree.closeNodeScope(jjtn000, true);
251:                    }
252:                }
253:            }
254:
255:            final public void MoreLines() throws ParseException {
256:                label_5: while (true) {
257:                    if (jj_2_3(2147483647)) {
258:                        ;
259:                    } else {
260:                        break label_5;
261:                    }
262:                    NextLine();
263:                }
264:            }
265:
266:            final public void NextLine() throws ParseException {
267:                jj_consume_token(EOL);
268:                label_6: while (true) {
269:                    switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
270:                    case STAR:
271:                        ;
272:                        break;
273:                    default:
274:                        jj_la1[4] = jj_gen;
275:                        break label_6;
276:                    }
277:                    jj_consume_token(STAR);
278:                }
279:                Line();
280:            }
281:
282:            final public void Word() throws ParseException {
283:                /*@bgen(jjtree) Word */
284:                SimpleNode jjtn000 = new SimpleNode(JJTWORD);
285:                boolean jjtc000 = true;
286:                jjtree.openNodeScope(jjtn000);
287:                Token t;
288:                try {
289:                    t = jj_consume_token(WORD);
290:                    jjtree.closeNodeScope(jjtn000, true);
291:                    jjtc000 = false;
292:                    jjtn000.setValue(t.toString());
293:                } finally {
294:                    if (jjtc000) {
295:                        jjtree.closeNodeScope(jjtn000, true);
296:                    }
297:                }
298:            }
299:
300:            final public void Tag() throws ParseException {
301:                /*@bgen(jjtree) Tag */
302:                SimpleNode jjtn000 = new SimpleNode(JJTTAG);
303:                boolean jjtc000 = true;
304:                jjtree.openNodeScope(jjtn000);
305:                Token t;
306:                try {
307:                    jj_consume_token(EOL);
308:                    label_7: while (true) {
309:                        switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
310:                        case STAR:
311:                            ;
312:                            break;
313:                        default:
314:                            jj_la1[5] = jj_gen;
315:                            break label_7;
316:                        }
317:                        jj_consume_token(STAR);
318:                    }
319:                    switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
320:                    case TAG_AUTHOR:
321:                        t = jj_consume_token(TAG_AUTHOR);
322:                        break;
323:                    case TAG_DEPRECATED:
324:                        t = jj_consume_token(TAG_DEPRECATED);
325:                        break;
326:                    case TAG_EXCEPTION:
327:                        t = jj_consume_token(TAG_EXCEPTION);
328:                        TagItem();
329:                        break;
330:                    case TAG_THROWS:
331:                        t = jj_consume_token(TAG_THROWS);
332:                        TagItem();
333:                        break;
334:                    case TAG_PARAM:
335:                        t = jj_consume_token(TAG_PARAM);
336:                        TagItem();
337:                        break;
338:                    case TAG_RETURN:
339:                        t = jj_consume_token(TAG_RETURN);
340:                        break;
341:                    case TAG_SINCE:
342:                        t = jj_consume_token(TAG_SINCE);
343:                        break;
344:                    case TAG_SEE:
345:                        t = jj_consume_token(TAG_SEE);
346:                        break;
347:                    case TAG_VERSION:
348:                        t = jj_consume_token(TAG_VERSION);
349:                        break;
350:                    case TAG_ID:
351:                        t = jj_consume_token(TAG_ID);
352:                        break;
353:                    default:
354:                        jj_la1[6] = jj_gen;
355:                        jj_consume_token(-1);
356:                        throw new ParseException();
357:                    }
358:                    jjtn000.setValue(t.toString());
359:                    Line();
360:                    MoreLines();
361:                } catch (Throwable jjte000) {
362:                    if (jjtc000) {
363:                        jjtree.clearNodeScope(jjtn000);
364:                        jjtc000 = false;
365:                    } else {
366:                        jjtree.popNode();
367:                    }
368:                    if (jjte000 instanceof  RuntimeException) {
369:                        {
370:                            if (true)
371:                                throw (RuntimeException) jjte000;
372:                        }
373:                    }
374:                    if (jjte000 instanceof  ParseException) {
375:                        {
376:                            if (true)
377:                                throw (ParseException) jjte000;
378:                        }
379:                    }
380:                    {
381:                        if (true)
382:                            throw (Error) jjte000;
383:                    }
384:                } finally {
385:                    if (jjtc000) {
386:                        jjtree.closeNodeScope(jjtn000, true);
387:                    }
388:                }
389:            }
390:
391:            final public void TagItem() throws ParseException {
392:                /*@bgen(jjtree) TagItem */
393:                SimpleNode jjtn000 = new SimpleNode(JJTTAGITEM);
394:                boolean jjtc000 = true;
395:                jjtree.openNodeScope(jjtn000);
396:                try {
397:                    Word();
398:                } catch (Throwable jjte000) {
399:                    if (jjtc000) {
400:                        jjtree.clearNodeScope(jjtn000);
401:                        jjtc000 = false;
402:                    } else {
403:                        jjtree.popNode();
404:                    }
405:                    if (jjte000 instanceof  RuntimeException) {
406:                        {
407:                            if (true)
408:                                throw (RuntimeException) jjte000;
409:                        }
410:                    }
411:                    if (jjte000 instanceof  ParseException) {
412:                        {
413:                            if (true)
414:                                throw (ParseException) jjte000;
415:                        }
416:                    }
417:                    {
418:                        if (true)
419:                            throw (Error) jjte000;
420:                    }
421:                } finally {
422:                    if (jjtc000) {
423:                        jjtree.closeNodeScope(jjtn000, true);
424:                    }
425:                }
426:            }
427:
428:            final private boolean jj_2_1(int xla) {
429:                jj_la = xla;
430:                jj_lastpos = jj_scanpos = token;
431:                try {
432:                    return !jj_3_1();
433:                } catch (LookaheadSuccess ls) {
434:                    return true;
435:                } finally {
436:                    jj_save(0, xla);
437:                }
438:            }
439:
440:            final private boolean jj_2_2(int xla) {
441:                jj_la = xla;
442:                jj_lastpos = jj_scanpos = token;
443:                try {
444:                    return !jj_3_2();
445:                } catch (LookaheadSuccess ls) {
446:                    return true;
447:                } finally {
448:                    jj_save(1, xla);
449:                }
450:            }
451:
452:            final private boolean jj_2_3(int xla) {
453:                jj_la = xla;
454:                jj_lastpos = jj_scanpos = token;
455:                try {
456:                    return !jj_3_3();
457:                } catch (LookaheadSuccess ls) {
458:                    return true;
459:                } finally {
460:                    jj_save(2, xla);
461:                }
462:            }
463:
464:            final private boolean jj_3_1() {
465:                if (jj_scan_token(EOL))
466:                    return true;
467:                Token xsp;
468:                while (true) {
469:                    xsp = jj_scanpos;
470:                    if (jj_scan_token(7)) {
471:                        jj_scanpos = xsp;
472:                        break;
473:                    }
474:                }
475:                if (jj_scan_token(DOCEND))
476:                    return true;
477:                return false;
478:            }
479:
480:            final private boolean jj_3_2() {
481:                if (jj_scan_token(EOL))
482:                    return true;
483:                Token xsp;
484:                while (true) {
485:                    xsp = jj_scanpos;
486:                    if (jj_scan_token(7)) {
487:                        jj_scanpos = xsp;
488:                        break;
489:                    }
490:                }
491:                xsp = jj_scanpos;
492:                if (jj_scan_token(8)) {
493:                    jj_scanpos = xsp;
494:                    if (jj_scan_token(9)) {
495:                        jj_scanpos = xsp;
496:                        if (jj_scan_token(10)) {
497:                            jj_scanpos = xsp;
498:                            if (jj_scan_token(15)) {
499:                                jj_scanpos = xsp;
500:                                if (jj_scan_token(11)) {
501:                                    jj_scanpos = xsp;
502:                                    if (jj_scan_token(12)) {
503:                                        jj_scanpos = xsp;
504:                                        if (jj_scan_token(14)) {
505:                                            jj_scanpos = xsp;
506:                                            if (jj_scan_token(13)) {
507:                                                jj_scanpos = xsp;
508:                                                if (jj_scan_token(16)) {
509:                                                    jj_scanpos = xsp;
510:                                                    if (jj_scan_token(17))
511:                                                        return true;
512:                                                }
513:                                            }
514:                                        }
515:                                    }
516:                                }
517:                            }
518:                        }
519:                    }
520:                }
521:                return false;
522:            }
523:
524:            final private boolean jj_3_3() {
525:                if (jj_scan_token(EOL))
526:                    return true;
527:                Token xsp;
528:                while (true) {
529:                    xsp = jj_scanpos;
530:                    if (jj_scan_token(7)) {
531:                        jj_scanpos = xsp;
532:                        break;
533:                    }
534:                }
535:                xsp = jj_scanpos;
536:                if (jj_scan_token(18)) {
537:                    jj_scanpos = xsp;
538:                    if (jj_scan_token(4))
539:                        return true;
540:                }
541:                return false;
542:            }
543:
544:            public JavadocParserTokenManager token_source;
545:            JavaCharStream jj_input_stream;
546:            public Token token, jj_nt;
547:            private int jj_ntk;
548:            private Token jj_scanpos, jj_lastpos;
549:            private int jj_la;
550:            public boolean lookingAhead = false;
551:            private boolean jj_semLA;
552:            private int jj_gen;
553:            final private int[] jj_la1 = new int[7];
554:            static private int[] jj_la1_0;
555:            static {
556:                jj_la1_0();
557:            }
558:
559:            private static void jj_la1_0() {
560:                jj_la1_0 = new int[] { 0x80, 0x40000, 0x40000, 0x40000, 0x80,
561:                        0x80, 0x3ff00, };
562:            }
563:
564:            final private JJCalls[] jj_2_rtns = new JJCalls[3];
565:            private boolean jj_rescan = false;
566:            private int jj_gc = 0;
567:
568:            public JavadocParser(java.io.InputStream stream) {
569:                jj_input_stream = new JavaCharStream(stream, 1, 1);
570:                token_source = new JavadocParserTokenManager(jj_input_stream);
571:                token = new Token();
572:                jj_ntk = -1;
573:                jj_gen = 0;
574:                for (int i = 0; i < 7; i++)
575:                    jj_la1[i] = -1;
576:                for (int i = 0; i < jj_2_rtns.length; i++)
577:                    jj_2_rtns[i] = new JJCalls();
578:            }
579:
580:            public void ReInit(java.io.InputStream stream) {
581:                jj_input_stream.ReInit(stream, 1, 1);
582:                token_source.ReInit(jj_input_stream);
583:                token = new Token();
584:                jj_ntk = -1;
585:                jjtree.reset();
586:                jj_gen = 0;
587:                for (int i = 0; i < 7; i++)
588:                    jj_la1[i] = -1;
589:                for (int i = 0; i < jj_2_rtns.length; i++)
590:                    jj_2_rtns[i] = new JJCalls();
591:            }
592:
593:            public JavadocParser(java.io.Reader stream) {
594:                jj_input_stream = new JavaCharStream(stream, 1, 1);
595:                token_source = new JavadocParserTokenManager(jj_input_stream);
596:                token = new Token();
597:                jj_ntk = -1;
598:                jj_gen = 0;
599:                for (int i = 0; i < 7; i++)
600:                    jj_la1[i] = -1;
601:                for (int i = 0; i < jj_2_rtns.length; i++)
602:                    jj_2_rtns[i] = new JJCalls();
603:            }
604:
605:            public void ReInit(java.io.Reader stream) {
606:                jj_input_stream.ReInit(stream, 1, 1);
607:                token_source.ReInit(jj_input_stream);
608:                token = new Token();
609:                jj_ntk = -1;
610:                jjtree.reset();
611:                jj_gen = 0;
612:                for (int i = 0; i < 7; i++)
613:                    jj_la1[i] = -1;
614:                for (int i = 0; i < jj_2_rtns.length; i++)
615:                    jj_2_rtns[i] = new JJCalls();
616:            }
617:
618:            public JavadocParser(JavadocParserTokenManager tm) {
619:                token_source = tm;
620:                token = new Token();
621:                jj_ntk = -1;
622:                jj_gen = 0;
623:                for (int i = 0; i < 7; i++)
624:                    jj_la1[i] = -1;
625:                for (int i = 0; i < jj_2_rtns.length; i++)
626:                    jj_2_rtns[i] = new JJCalls();
627:            }
628:
629:            public void ReInit(JavadocParserTokenManager tm) {
630:                token_source = tm;
631:                token = new Token();
632:                jj_ntk = -1;
633:                jjtree.reset();
634:                jj_gen = 0;
635:                for (int i = 0; i < 7; i++)
636:                    jj_la1[i] = -1;
637:                for (int i = 0; i < jj_2_rtns.length; i++)
638:                    jj_2_rtns[i] = new JJCalls();
639:            }
640:
641:            final private Token jj_consume_token(int kind)
642:                    throws ParseException {
643:                Token oldToken;
644:                if ((oldToken = token).next != null)
645:                    token = token.next;
646:                else
647:                    token = token.next = token_source.getNextToken();
648:                jj_ntk = -1;
649:                if (token.kind == kind) {
650:                    jj_gen++;
651:                    if (++jj_gc > 100) {
652:                        jj_gc = 0;
653:                        for (int i = 0; i < jj_2_rtns.length; i++) {
654:                            JJCalls c = jj_2_rtns[i];
655:                            while (c != null) {
656:                                if (c.gen < jj_gen)
657:                                    c.first = null;
658:                                c = c.next;
659:                            }
660:                        }
661:                    }
662:                    return token;
663:                }
664:                token = oldToken;
665:                jj_kind = kind;
666:                throw generateParseException();
667:            }
668:
669:            static private final class LookaheadSuccess extends java.lang.Error {
670:            }
671:
672:            final private LookaheadSuccess jj_ls = new LookaheadSuccess();
673:
674:            final private boolean jj_scan_token(int kind) {
675:                if (jj_scanpos == jj_lastpos) {
676:                    jj_la--;
677:                    if (jj_scanpos.next == null) {
678:                        jj_lastpos = jj_scanpos = jj_scanpos.next = token_source
679:                                .getNextToken();
680:                    } else {
681:                        jj_lastpos = jj_scanpos = jj_scanpos.next;
682:                    }
683:                } else {
684:                    jj_scanpos = jj_scanpos.next;
685:                }
686:                if (jj_rescan) {
687:                    int i = 0;
688:                    Token tok = token;
689:                    while (tok != null && tok != jj_scanpos) {
690:                        i++;
691:                        tok = tok.next;
692:                    }
693:                    if (tok != null)
694:                        jj_add_error_token(kind, i);
695:                }
696:                if (jj_scanpos.kind != kind)
697:                    return true;
698:                if (jj_la == 0 && jj_scanpos == jj_lastpos)
699:                    throw jj_ls;
700:                return false;
701:            }
702:
703:            final public Token getNextToken() {
704:                if (token.next != null)
705:                    token = token.next;
706:                else
707:                    token = token.next = token_source.getNextToken();
708:                jj_ntk = -1;
709:                jj_gen++;
710:                return token;
711:            }
712:
713:            final public Token getToken(int index) {
714:                Token t = lookingAhead ? jj_scanpos : token;
715:                for (int i = 0; i < index; i++) {
716:                    if (t.next != null)
717:                        t = t.next;
718:                    else
719:                        t = t.next = token_source.getNextToken();
720:                }
721:                return t;
722:            }
723:
724:            final private int jj_ntk() {
725:                if ((jj_nt = token.next) == null)
726:                    return (jj_ntk = (token.next = token_source.getNextToken()).kind);
727:                else
728:                    return (jj_ntk = jj_nt.kind);
729:            }
730:
731:            private java.util.Vector jj_expentries = new java.util.Vector();
732:            private int[] jj_expentry;
733:            private int jj_kind = -1;
734:            private int[] jj_lasttokens = new int[100];
735:            private int jj_endpos;
736:
737:            private void jj_add_error_token(int kind, int pos) {
738:                if (pos >= 100)
739:                    return;
740:                if (pos == jj_endpos + 1) {
741:                    jj_lasttokens[jj_endpos++] = kind;
742:                } else if (jj_endpos != 0) {
743:                    jj_expentry = new int[jj_endpos];
744:                    for (int i = 0; i < jj_endpos; i++) {
745:                        jj_expentry[i] = jj_lasttokens[i];
746:                    }
747:                    boolean exists = false;
748:                    for (java.util.Enumeration e = jj_expentries.elements(); e
749:                            .hasMoreElements();) {
750:                        int[] oldentry = (int[]) (e.nextElement());
751:                        if (oldentry.length == jj_expentry.length) {
752:                            exists = true;
753:                            for (int i = 0; i < jj_expentry.length; i++) {
754:                                if (oldentry[i] != jj_expentry[i]) {
755:                                    exists = false;
756:                                    break;
757:                                }
758:                            }
759:                            if (exists)
760:                                break;
761:                        }
762:                    }
763:                    if (!exists)
764:                        jj_expentries.addElement(jj_expentry);
765:                    if (pos != 0)
766:                        jj_lasttokens[(jj_endpos = pos) - 1] = kind;
767:                }
768:            }
769:
770:            public ParseException generateParseException() {
771:                jj_expentries.removeAllElements();
772:                boolean[] la1tokens = new boolean[19];
773:                for (int i = 0; i < 19; i++) {
774:                    la1tokens[i] = false;
775:                }
776:                if (jj_kind >= 0) {
777:                    la1tokens[jj_kind] = true;
778:                    jj_kind = -1;
779:                }
780:                for (int i = 0; i < 7; i++) {
781:                    if (jj_la1[i] == jj_gen) {
782:                        for (int j = 0; j < 32; j++) {
783:                            if ((jj_la1_0[i] & (1 << j)) != 0) {
784:                                la1tokens[j] = true;
785:                            }
786:                        }
787:                    }
788:                }
789:                for (int i = 0; i < 19; i++) {
790:                    if (la1tokens[i]) {
791:                        jj_expentry = new int[1];
792:                        jj_expentry[0] = i;
793:                        jj_expentries.addElement(jj_expentry);
794:                    }
795:                }
796:                jj_endpos = 0;
797:                jj_rescan_token();
798:                jj_add_error_token(0, 0);
799:                int[][] exptokseq = new int[jj_expentries.size()][];
800:                for (int i = 0; i < jj_expentries.size(); i++) {
801:                    exptokseq[i] = (int[]) jj_expentries.elementAt(i);
802:                }
803:                return new ParseException(token, exptokseq, tokenImage);
804:            }
805:
806:            final public void enable_tracing() {
807:            }
808:
809:            final public void disable_tracing() {
810:            }
811:
812:            final private void jj_rescan_token() {
813:                jj_rescan = true;
814:                for (int i = 0; i < 3; i++) {
815:                    JJCalls p = jj_2_rtns[i];
816:                    do {
817:                        if (p.gen > jj_gen) {
818:                            jj_la = p.arg;
819:                            jj_lastpos = jj_scanpos = p.first;
820:                            switch (i) {
821:                            case 0:
822:                                jj_3_1();
823:                                break;
824:                            case 1:
825:                                jj_3_2();
826:                                break;
827:                            case 2:
828:                                jj_3_3();
829:                                break;
830:                            }
831:                        }
832:                        p = p.next;
833:                    } while (p != null);
834:                }
835:                jj_rescan = false;
836:            }
837:
838:            final private void jj_save(int index, int xla) {
839:                JJCalls p = jj_2_rtns[index];
840:                while (p.gen > jj_gen) {
841:                    if (p.next == null) {
842:                        p = p.next = new JJCalls();
843:                        break;
844:                    }
845:                    p = p.next;
846:                }
847:                p.gen = jj_gen + xla - jj_la;
848:                p.first = token;
849:                p.arg = xla;
850:            }
851:
852:            static final class JJCalls {
853:                int gen;
854:                Token first;
855:                int arg;
856:                JJCalls next;
857:            }
858:
859:            /*
860:             public static void showTree(Node node,PrintStream out) {
861:             showTree(node,out,0);
862:             }
863:
864:             private static void showTree(Node node,PrintStream out,int depth) {
865:             out.println(SourceParser.repeat("  ",depth)+JavadocParserTreeConstants.jjtNodeName[node.getId()]);
866:             for (int i=0;i<node.jjtGetNumChildren();i++) {
867:             Node n=node.jjtGetChild(i);
868:             showTree(n,out,depth+1);
869:             }
870:             }
871:             */
872:            /*
873:             public void jjtreeOpenNodeScope(Node n) {
874:             n.setStartToken(getToken(1));
875:             }
876:
877:             public void jjtreeCloseNodeScope(Node n) {
878:             n.setEndToken(getToken(1));
879:             }
880:             */
881:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.