Skip to content

Package: Parser

Parser

nameinstructionbranchcomplexitylinemethod
Parser()
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
Parser(Reader, RouterConfiguration, String)
M: 28 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 8 C: 0
0%
M: 1 C: 0
0%
Parser(boolean)
M: 10 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
debug(String)
M: 7 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
dump_stacks(int)
M: 51 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
dup_yyval(ParserVal)
M: 22 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%
getMyTree()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
init_stacks()
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
run()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
state_drop(int)
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
state_peek(int)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
state_pop()
M: 11 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
state_push(int)
M: 42 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 11 C: 0
0%
M: 1 C: 0
0%
static {...}
M: 2042 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 11 C: 0
0%
M: 1 C: 0
0%
val_drop(int)
M: 12 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
val_init()
M: 18 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
val_peek(int)
M: 16 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
val_pop()
M: 18 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
val_push(ParserVal)
M: 17 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
yycheck()
M: 1060 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
yyerror(String)
M: 11 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
yylex()
M: 20 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%
yylexdebug(int, int)
M: 38 C: 0
0%
M: 6 C: 0
0%
M: 4 C: 0
0%
M: 9 C: 0
0%
M: 1 C: 0
0%
yyparse()
M: 1101 C: 0
0%
M: 120 C: 0
0%
M: 72 C: 0
0%
M: 193 C: 0
0%
M: 1 C: 0
0%
yytable()
M: 1060 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%

Coverage

1: // ### This file created by BYACC 1.8(/Java extension 1.15)
2: // ### Java capabilities added 7 Jan 97, Bob Jamison
3: // ### Updated : 27 Nov 97 -- Bob Jamison, Joe Nieten
4: // ### 01 Jan 98 -- Bob Jamison -- fixed generic semantic constructor
5: // ### 01 Jun 99 -- Bob Jamison -- added Runnable support
6: // ### 06 Aug 00 -- Bob Jamison -- made state variables class-global
7: // ### 03 Jan 01 -- Bob Jamison -- improved flags, tracing
8: // ### 16 May 01 -- Bob Jamison -- added custom stack sizing
9: // ### 04 Mar 02 -- Yuval Oren -- improved java performance, added options
10: // ### 14 Mar 02 -- Tomas Hurka -- -d support, static initializer workaround
11: // ### Please send bug reports to tom@hukatronic.cz
12: // ### static char yysccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/90";
13:
14: // #line 27 "var_parser.y"
15: package parser;
16:
17: import java.io.IOException;
18: import java.io.Reader;
19: import java.util.ArrayList;
20: import java.util.List;
21:
22: import model.Comment;
23: import model.Position;
24: import model.RouterConfiguration;
25: import model.assignment.AssignmentFile;
26: import parser.nodes.AbsoluteIndex;
27: import parser.nodes.AbstractNode;
28: import parser.nodes.ConfigNode;
29: import parser.nodes.EmptyAssignment;
30: import parser.nodes.EmptyTarget;
31: import parser.nodes.ErrorNode;
32: import parser.nodes.FreeIndex;
33: import parser.nodes.Statement;
34: import parser.nodes.SubLevelTarget;
35: import parser.nodes.Target;
36: import parser.nodes.TopLevelTarget;
37: import parser.nodes.UnconfiguredVariableAssignment;
38: import scanner.VarDefScanner;
39:
40: /* This will suppress all the PMD warnings in this class */
41: @SuppressWarnings("PMD")
42: // #line 27 "Parser.java"
43:
44: public class Parser {
45:
46:         boolean yydebug; // do I want debug output?
47:         int yynerrs; // number of errors so far
48:         int yyerrflag; // was there an error?
49:         int yychar; // the current working character
50:
51:         // ########## MESSAGES ##########
52:         // ###############################################################
53:         // method: debug
54:         // ###############################################################
55:         void debug(String msg) {
56:•                if (yydebug)
57:                         System.out.println(msg);
58:         }
59:
60:         // ########## STATE STACK ##########
61:         final static int YYSTACKSIZE = 500; // maximum stack size
62:         int statestk[] = new int[YYSTACKSIZE]; // state stack
63:         int stateptr;
64:         int stateptrmax; // highest index of stackptr
65:         int statemax; // state when highest index reached
66:         // ###############################################################
67:         // methods: state stack push,pop,drop,peek
68:         // ###############################################################
69:
70:         final void state_push(int state) {
71:                 try {
72:                         stateptr++;
73:                         statestk[stateptr] = state;
74:                 } catch (ArrayIndexOutOfBoundsException e) {
75:                         int oldsize = statestk.length;
76:                         int newsize = oldsize * 2;
77:                         int[] newstack = new int[newsize];
78:                         System.arraycopy(statestk, 0, newstack, 0, oldsize);
79:                         statestk = newstack;
80:                         statestk[stateptr] = state;
81:                 }
82:         }
83:
84:         final int state_pop() {
85:                 return statestk[stateptr--];
86:         }
87:
88:         final void state_drop(int cnt) {
89:                 stateptr -= cnt;
90:         }
91:
92:         final int state_peek(int relative) {
93:                 return statestk[stateptr - relative];
94:         }
95:
96:         // ###############################################################
97:         // method: init_stacks : allocate and prepare stacks
98:         // ###############################################################
99:         final boolean init_stacks() {
100:                 stateptr = -1;
101:                 val_init();
102:                 return true;
103:         }
104:
105:         // ###############################################################
106:         // method: dump_stacks : show n levels of the stacks
107:         // ###############################################################
108:         void dump_stacks(int count) {
109:                 int i;
110:                 System.out.println("=index==state====value= s:" + stateptr + " v:" + valptr);
111:•                for (i = 0; i < count; i++)
112:                         System.out.println(" " + i + " " + statestk[i] + " " + valstk[i]);
113:                 System.out.println("======================");
114:         }
115:
116:         // ########## SEMANTIC VALUES ##########
117:         // public class ParserVal is defined in ParserVal.java
118:
119:         String yytext;// user variable to return contextual strings
120:         ParserVal yyval; // used to return semantic vals from action routines
121:         public ParserVal yylval;// the 'lval' (result) I got from yylex()
122:         ParserVal valstk[];
123:         int valptr;
124:
125:         // ###############################################################
126:         // methods: value stack push,pop,drop,peek.
127:         // ###############################################################
128:         void val_init() {
129:                 valstk = new ParserVal[YYSTACKSIZE];
130:                 yyval = new ParserVal();
131:                 yylval = new ParserVal();
132:                 valptr = -1;
133:         }
134:
135:         void val_push(ParserVal val) {
136:•                if (valptr >= YYSTACKSIZE)
137:                         return;
138:                 valstk[++valptr] = val;
139:         }
140:
141:         ParserVal val_pop() {
142:•                if (valptr < 0)
143:                         return new ParserVal();
144:                 return valstk[valptr--];
145:         }
146:
147:         void val_drop(int cnt) {
148:                 int ptr;
149:                 ptr = valptr - cnt;
150:•                if (ptr < 0)
151:                         return;
152:                 valptr = ptr;
153:         }
154:
155:         ParserVal val_peek(int relative) {
156:                 int ptr;
157:                 ptr = valptr - relative;
158:•                if (ptr < 0)
159:                         return new ParserVal();
160:                 return valstk[ptr];
161:         }
162:
163:         final ParserVal dup_yyval(ParserVal val) {
164:                 ParserVal dup = new ParserVal();
165:                 dup.ival = val.ival;
166:                 dup.dval = val.dval;
167:                 dup.sval = val.sval;
168:                 dup.obj = val.obj;
169:                 return dup;
170:         }
171:
172:         // #### end semantic value section ####
173:         public final static short ID = 257;
174:         public final static short EQ = 258;
175:         public final static short LBRACKET = 259;
176:         public final static short RBRACKET = 260;
177:         public final static short DOT = 261;
178:         public final static short LBRACE = 262;
179:         public final static short RBRACE = 263;
180:         public final static short QSTRING = 264;
181:         public final static short COMMENT = 265;
182:         public final static short UNKNOWN = 266;
183:         public final static short ABSOLUTE_INDEX = 267;
184:         public final static short YYERRCODE = 256;
185:         final static short yylhs[] = {
186:                         -1,
187:                         0,
188:                         1,
189:                         1,
190:                         2,
191:                         2,
192:                         4,
193:                         4,
194:                         4,
195:                         4,
196:                         5,
197:                         5,
198:                         5,
199:                         5,
200:                         5,
201:                         5,
202:                         3,
203:                         3,
204:                         9,
205:                         9,
206:                         7,
207:                         7,
208:                         8,
209:                         10,
210:                         10,
211:                         6,
212:                         6, };
213:         final static short yylen[] =
214:                         { 2, 1, 0, 2, 1, 1, 1, 3, 4, 3, 1, 3, 3, 4, 2, 3, 5, 3, 5, 3, 0, 1, 3, 0, 2, 0, 1, };
215:         final static short yydefred[] = {
216:                         2,
217:                         0,
218:                         0,
219:                         5,
220:                         6,
221:                         3,
222:                         4,
223:                         0,
224:                         0,
225:                         0,
226:                         0,
227:                         26,
228:                         0,
229:                         0,
230:                         9,
231:                         0,
232:                         7,
233:                         23,
234:                         17,
235:                         0,
236:                         8,
237:                         0,
238:                         16,
239:                         21,
240:                         10,
241:                         0,
242:                         22,
243:                         0,
244:                         24,
245:                         14,
246:                         0,
247:                         0,
248:                         0,
249:                         0,
250:                         0,
251:                         12,
252:                         0,
253:                         15,
254:                         0,
255:                         11,
256:                         19,
257:                         0,
258:                         13,
259:                         18, };
260:         final static short yydgoto[] = { 1, 2, 5, 6, 7, 27, 12, 22, 23, 28, 21, };
261:         final static short yysindex[] = {
262:                         0,
263:                         0,
264:                         -235,
265:                         0,
266:                         0,
267:                         0,
268:                         0,
269:                         -254,
270:                         -258,
271:                         -252,
272:                         -240,
273:                         0,
274:                         -243,
275:                         -228,
276:                         0,
277:                         -225,
278:                         0,
279:                         0,
280:                         0,
281:                         -243,
282:                         0,
283:                         -230,
284:                         0,
285:                         0,
286:                         0,
287:                         -247,
288:                         0,
289:                         -249,
290:                         0,
291:                         0,
292:                         -222,
293:                         -234,
294:                         -242,
295:                         -218,
296:                         -243,
297:                         0,
298:                         -228,
299:                         0,
300:                         -219,
301:                         0,
302:                         0,
303:                         -243,
304:                         0,
305:                         0, };
306:         final static short yyrindex[] = {
307:                         0,
308:                         0,
309:                         42,
310:                         0,
311:                         0,
312:                         0,
313:                         0,
314:                         -217,
315:                         0,
316:                         0,
317:                         0,
318:                         0,
319:                         0,
320:                         1,
321:                         0,
322:                         0,
323:                         0,
324:                         0,
325:                         0,
326:                         3,
327:                         0,
328:                         0,
329:                         0,
330:                         0,
331:                         0,
332:                         0,
333:                         0,
334:                         -217,
335:                         0,
336:                         0,
337:                         0,
338:                         0,
339:                         0,
340:                         0,
341:                         0,
342:                         0,
343:                         -231,
344:                         0,
345:                         0,
346:                         0,
347:                         0,
348:                         -223,
349:                         0,
350:                         0, };
351:         final static short yygindex[] = { 0, 0, 0, 0, 0, 0, -13, 2, -10, 0, 0, };
352:         final static int YYTABLESIZE = 263;
353:         static short yytable[];
354:         static {
355:                 yytable();
356:         }
357:
358:         static void yytable() {
359:                 yytable = new short[] {
360:                                 19,
361:                                 25,
362:                                 18,
363:                                 20,
364:                                 8,
365:                                 9,
366:                                 13,
367:                                 10,
368:                                 14,
369:                                 31,
370:                                 32,
371:                                 11,
372:                                 33,
373:                                 29,
374:                                 34,
375:                                 15,
376:                                 11,
377:                                 16,
378:                                 37,
379:                                 17,
380:                                 30,
381:                                 3,
382:                                 4,
383:                                 41,
384:                                 40,
385:                                 38,
386:                                 25,
387:                                 24,
388:                                 25,
389:                                 25,
390:                                 36,
391:                                 25,
392:                                 25,
393:                                 26,
394:                                 20,
395:                                 20,
396:                                 20,
397:                                 11,
398:                                 35,
399:                                 39,
400:                                 20,
401:                                 42,
402:                                 1,
403:                                 43,
404:                                 0,
405:                                 25,
406:                                 0,
407:                                 0,
408:                                 0,
409:                                 0,
410:                                 0,
411:                                 0,
412:                                 0,
413:                                 0,
414:                                 0,
415:                                 0,
416:                                 0,
417:                                 0,
418:                                 0,
419:                                 0,
420:                                 0,
421:                                 0,
422:                                 0,
423:                                 0,
424:                                 0,
425:                                 0,
426:                                 0,
427:                                 0,
428:                                 0,
429:                                 0,
430:                                 0,
431:                                 0,
432:                                 0,
433:                                 0,
434:                                 0,
435:                                 0,
436:                                 0,
437:                                 0,
438:                                 0,
439:                                 0,
440:                                 0,
441:                                 0,
442:                                 0,
443:                                 0,
444:                                 0,
445:                                 0,
446:                                 0,
447:                                 0,
448:                                 0,
449:                                 0,
450:                                 0,
451:                                 0,
452:                                 0,
453:                                 0,
454:                                 0,
455:                                 0,
456:                                 0,
457:                                 0,
458:                                 0,
459:                                 0,
460:                                 0,
461:                                 0,
462:                                 0,
463:                                 0,
464:                                 0,
465:                                 0,
466:                                 0,
467:                                 0,
468:                                 0,
469:                                 0,
470:                                 0,
471:                                 0,
472:                                 0,
473:                                 0,
474:                                 0,
475:                                 0,
476:                                 0,
477:                                 0,
478:                                 0,
479:                                 0,
480:                                 0,
481:                                 0,
482:                                 0,
483:                                 0,
484:                                 0,
485:                                 0,
486:                                 0,
487:                                 0,
488:                                 0,
489:                                 0,
490:                                 0,
491:                                 0,
492:                                 0,
493:                                 0,
494:                                 0,
495:                                 0,
496:                                 0,
497:                                 0,
498:                                 0,
499:                                 0,
500:                                 0,
501:                                 0,
502:                                 0,
503:                                 0,
504:                                 0,
505:                                 0,
506:                                 0,
507:                                 0,
508:                                 0,
509:                                 0,
510:                                 0,
511:                                 0,
512:                                 0,
513:                                 0,
514:                                 0,
515:                                 0,
516:                                 0,
517:                                 0,
518:                                 0,
519:                                 0,
520:                                 0,
521:                                 0,
522:                                 0,
523:                                 0,
524:                                 0,
525:                                 0,
526:                                 0,
527:                                 0,
528:                                 0,
529:                                 0,
530:                                 0,
531:                                 0,
532:                                 0,
533:                                 0,
534:                                 0,
535:                                 0,
536:                                 0,
537:                                 0,
538:                                 0,
539:                                 0,
540:                                 0,
541:                                 0,
542:                                 0,
543:                                 0,
544:                                 0,
545:                                 0,
546:                                 0,
547:                                 0,
548:                                 0,
549:                                 0,
550:                                 0,
551:                                 0,
552:                                 0,
553:                                 0,
554:                                 0,
555:                                 0,
556:                                 0,
557:                                 0,
558:                                 0,
559:                                 0,
560:                                 0,
561:                                 0,
562:                                 0,
563:                                 0,
564:                                 0,
565:                                 0,
566:                                 0,
567:                                 0,
568:                                 0,
569:                                 0,
570:                                 0,
571:                                 0,
572:                                 0,
573:                                 0,
574:                                 0,
575:                                 0,
576:                                 0,
577:                                 0,
578:                                 0,
579:                                 0,
580:                                 0,
581:                                 0,
582:                                 0,
583:                                 0,
584:                                 0,
585:                                 0,
586:                                 0,
587:                                 0,
588:                                 0,
589:                                 0,
590:                                 0,
591:                                 0,
592:                                 0,
593:                                 0,
594:                                 0,
595:                                 0,
596:                                 0,
597:                                 0,
598:                                 0,
599:                                 0,
600:                                 0,
601:                                 0,
602:                                 0,
603:                                 0,
604:                                 0,
605:                                 0,
606:                                 0,
607:                                 0,
608:                                 0,
609:                                 0,
610:                                 0,
611:                                 0,
612:                                 0,
613:                                 0,
614:                                 0,
615:                                 0,
616:                                 0,
617:                                 25,
618:                                 25,
619:                                 20,
620:                                 20,
621:                                 0,
622:                                 0,
623:                                 25, };
624:         }
625:
626:         static short yycheck[];
627:         static {
628:                 yycheck();
629:         }
630:
631:         static void yycheck() {
632:                 yycheck = new short[] {
633:                                 13,
634:                                 0,
635:                                 12,
636:                                 0,
637:                                 258,
638:                                 259,
639:                                 264,
640:                                 261,
641:                                 260,
642:                                 258,
643:                                 259,
644:                                 265,
645:                                 261,
646:                                 260,
647:                                 27,
648:                                 267,
649:                                 265,
650:                                 257,
651:                                 260,
652:                                 262,
653:                                 267,
654:                                 256,
655:                                 257,
656:                                 36,
657:                                 34,
658:                                 267,
659:                                 257,
660:                                 257,
661:                                 259,
662:                                 259,
663:                                 264,
664:                                 262,
665:                                 263,
666:                                 263,
667:                                 257,
668:                                 260,
669:                                 259,
670:                                 265,
671:                                 260,
672:                                 257,
673:                                 263,
674:                                 260,
675:                                 0,
676:                                 41,
677:                                 -1,
678:                                 262,
679:                                 -1,
680:                                 -1,
681:                                 -1,
682:                                 -1,
683:                                 -1,
684:                                 -1,
685:                                 -1,
686:                                 -1,
687:                                 -1,
688:                                 -1,
689:                                 -1,
690:                                 -1,
691:                                 -1,
692:                                 -1,
693:                                 -1,
694:                                 -1,
695:                                 -1,
696:                                 -1,
697:                                 -1,
698:                                 -1,
699:                                 -1,
700:                                 -1,
701:                                 -1,
702:                                 -1,
703:                                 -1,
704:                                 -1,
705:                                 -1,
706:                                 -1,
707:                                 -1,
708:                                 -1,
709:                                 -1,
710:                                 -1,
711:                                 -1,
712:                                 -1,
713:                                 -1,
714:                                 -1,
715:                                 -1,
716:                                 -1,
717:                                 -1,
718:                                 -1,
719:                                 -1,
720:                                 -1,
721:                                 -1,
722:                                 -1,
723:                                 -1,
724:                                 -1,
725:                                 -1,
726:                                 -1,
727:                                 -1,
728:                                 -1,
729:                                 -1,
730:                                 -1,
731:                                 -1,
732:                                 -1,
733:                                 -1,
734:                                 -1,
735:                                 -1,
736:                                 -1,
737:                                 -1,
738:                                 -1,
739:                                 -1,
740:                                 -1,
741:                                 -1,
742:                                 -1,
743:                                 -1,
744:                                 -1,
745:                                 -1,
746:                                 -1,
747:                                 -1,
748:                                 -1,
749:                                 -1,
750:                                 -1,
751:                                 -1,
752:                                 -1,
753:                                 -1,
754:                                 -1,
755:                                 -1,
756:                                 -1,
757:                                 -1,
758:                                 -1,
759:                                 -1,
760:                                 -1,
761:                                 -1,
762:                                 -1,
763:                                 -1,
764:                                 -1,
765:                                 -1,
766:                                 -1,
767:                                 -1,
768:                                 -1,
769:                                 -1,
770:                                 -1,
771:                                 -1,
772:                                 -1,
773:                                 -1,
774:                                 -1,
775:                                 -1,
776:                                 -1,
777:                                 -1,
778:                                 -1,
779:                                 -1,
780:                                 -1,
781:                                 -1,
782:                                 -1,
783:                                 -1,
784:                                 -1,
785:                                 -1,
786:                                 -1,
787:                                 -1,
788:                                 -1,
789:                                 -1,
790:                                 -1,
791:                                 -1,
792:                                 -1,
793:                                 -1,
794:                                 -1,
795:                                 -1,
796:                                 -1,
797:                                 -1,
798:                                 -1,
799:                                 -1,
800:                                 -1,
801:                                 -1,
802:                                 -1,
803:                                 -1,
804:                                 -1,
805:                                 -1,
806:                                 -1,
807:                                 -1,
808:                                 -1,
809:                                 -1,
810:                                 -1,
811:                                 -1,
812:                                 -1,
813:                                 -1,
814:                                 -1,
815:                                 -1,
816:                                 -1,
817:                                 -1,
818:                                 -1,
819:                                 -1,
820:                                 -1,
821:                                 -1,
822:                                 -1,
823:                                 -1,
824:                                 -1,
825:                                 -1,
826:                                 -1,
827:                                 -1,
828:                                 -1,
829:                                 -1,
830:                                 -1,
831:                                 -1,
832:                                 -1,
833:                                 -1,
834:                                 -1,
835:                                 -1,
836:                                 -1,
837:                                 -1,
838:                                 -1,
839:                                 -1,
840:                                 -1,
841:                                 -1,
842:                                 -1,
843:                                 -1,
844:                                 -1,
845:                                 -1,
846:                                 -1,
847:                                 -1,
848:                                 -1,
849:                                 -1,
850:                                 -1,
851:                                 -1,
852:                                 -1,
853:                                 -1,
854:                                 -1,
855:                                 -1,
856:                                 -1,
857:                                 -1,
858:                                 -1,
859:                                 -1,
860:                                 -1,
861:                                 -1,
862:                                 -1,
863:                                 -1,
864:                                 -1,
865:                                 -1,
866:                                 -1,
867:                                 -1,
868:                                 -1,
869:                                 -1,
870:                                 -1,
871:                                 -1,
872:                                 -1,
873:                                 -1,
874:                                 -1,
875:                                 -1,
876:                                 -1,
877:                                 -1,
878:                                 -1,
879:                                 -1,
880:                                 -1,
881:                                 -1,
882:                                 -1,
883:                                 -1,
884:                                 -1,
885:                                 -1,
886:                                 -1,
887:                                 -1,
888:                                 -1,
889:                                 -1,
890:                                 256,
891:                                 257,
892:                                 256,
893:                                 257,
894:                                 -1,
895:                                 -1,
896:                                 262, };
897:         }
898:
899:         final static short YYFINAL = 1;
900:         final static short YYMAXTOKEN = 267;
901:         final static String yyname[] = {
902:                         "end-of-file",
903:                         null,
904:                         null,
905:                         null,
906:                         null,
907:                         null,
908:                         null,
909:                         null,
910:                         null,
911:                         null,
912:                         null,
913:                         null,
914:                         null,
915:                         null,
916:                         null,
917:                         null,
918:                         null,
919:                         null,
920:                         null,
921:                         null,
922:                         null,
923:                         null,
924:                         null,
925:                         null,
926:                         null,
927:                         null,
928:                         null,
929:                         null,
930:                         null,
931:                         null,
932:                         null,
933:                         null,
934:                         null,
935:                         null,
936:                         null,
937:                         null,
938:                         null,
939:                         null,
940:                         null,
941:                         null,
942:                         null,
943:                         null,
944:                         null,
945:                         null,
946:                         null,
947:                         null,
948:                         null,
949:                         null,
950:                         null,
951:                         null,
952:                         null,
953:                         null,
954:                         null,
955:                         null,
956:                         null,
957:                         null,
958:                         null,
959:                         null,
960:                         null,
961:                         null,
962:                         null,
963:                         null,
964:                         null,
965:                         null,
966:                         null,
967:                         null,
968:                         null,
969:                         null,
970:                         null,
971:                         null,
972:                         null,
973:                         null,
974:                         null,
975:                         null,
976:                         null,
977:                         null,
978:                         null,
979:                         null,
980:                         null,
981:                         null,
982:                         null,
983:                         null,
984:                         null,
985:                         null,
986:                         null,
987:                         null,
988:                         null,
989:                         null,
990:                         null,
991:                         null,
992:                         null,
993:                         null,
994:                         null,
995:                         null,
996:                         null,
997:                         null,
998:                         null,
999:                         null,
1000:                         null,
1001:                         null,
1002:                         null,
1003:                         null,
1004:                         null,
1005:                         null,
1006:                         null,
1007:                         null,
1008:                         null,
1009:                         null,
1010:                         null,
1011:                         null,
1012:                         null,
1013:                         null,
1014:                         null,
1015:                         null,
1016:                         null,
1017:                         null,
1018:                         null,
1019:                         null,
1020:                         null,
1021:                         null,
1022:                         null,
1023:                         null,
1024:                         null,
1025:                         null,
1026:                         null,
1027:                         null,
1028:                         null,
1029:                         null,
1030:                         null,
1031:                         null,
1032:                         null,
1033:                         null,
1034:                         null,
1035:                         null,
1036:                         null,
1037:                         null,
1038:                         null,
1039:                         null,
1040:                         null,
1041:                         null,
1042:                         null,
1043:                         null,
1044:                         null,
1045:                         null,
1046:                         null,
1047:                         null,
1048:                         null,
1049:                         null,
1050:                         null,
1051:                         null,
1052:                         null,
1053:                         null,
1054:                         null,
1055:                         null,
1056:                         null,
1057:                         null,
1058:                         null,
1059:                         null,
1060:                         null,
1061:                         null,
1062:                         null,
1063:                         null,
1064:                         null,
1065:                         null,
1066:                         null,
1067:                         null,
1068:                         null,
1069:                         null,
1070:                         null,
1071:                         null,
1072:                         null,
1073:                         null,
1074:                         null,
1075:                         null,
1076:                         null,
1077:                         null,
1078:                         null,
1079:                         null,
1080:                         null,
1081:                         null,
1082:                         null,
1083:                         null,
1084:                         null,
1085:                         null,
1086:                         null,
1087:                         null,
1088:                         null,
1089:                         null,
1090:                         null,
1091:                         null,
1092:                         null,
1093:                         null,
1094:                         null,
1095:                         null,
1096:                         null,
1097:                         null,
1098:                         null,
1099:                         null,
1100:                         null,
1101:                         null,
1102:                         null,
1103:                         null,
1104:                         null,
1105:                         null,
1106:                         null,
1107:                         null,
1108:                         null,
1109:                         null,
1110:                         null,
1111:                         null,
1112:                         null,
1113:                         null,
1114:                         null,
1115:                         null,
1116:                         null,
1117:                         null,
1118:                         null,
1119:                         null,
1120:                         null,
1121:                         null,
1122:                         null,
1123:                         null,
1124:                         null,
1125:                         null,
1126:                         null,
1127:                         null,
1128:                         null,
1129:                         null,
1130:                         null,
1131:                         null,
1132:                         null,
1133:                         null,
1134:                         null,
1135:                         null,
1136:                         null,
1137:                         null,
1138:                         null,
1139:                         null,
1140:                         null,
1141:                         null,
1142:                         null,
1143:                         null,
1144:                         null,
1145:                         null,
1146:                         null,
1147:                         null,
1148:                         null,
1149:                         null,
1150:                         null,
1151:                         null,
1152:                         null,
1153:                         null,
1154:                         null,
1155:                         null,
1156:                         null,
1157:                         null,
1158:                         null,
1159:                         "ID",
1160:                         "EQ",
1161:                         "LBRACKET",
1162:                         "RBRACKET",
1163:                         "DOT",
1164:                         "LBRACE",
1165:                         "RBRACE",
1166:                         "QSTRING",
1167:                         "COMMENT",
1168:                         "UNKNOWN",
1169:                         "ABSOLUTE_INDEX", };
1170:         final static String yyrule[] = {
1171:                         "$accept : file",
1172:                         "file : statements",
1173:                         "statements :",
1174:                         "statements : statements statement",
1175:                         "statement : assignment",
1176:                         "statement : error",
1177:                         "target : ID",
1178:                         "target : target DOT ID",
1179:                         "target : target LBRACKET ABSOLUTE_INDEX RBRACKET",
1180:                         "target : target LBRACKET RBRACKET",
1181:                         "nested_target : ID",
1182:                         "nested_target : nested_target DOT ID",
1183:                         "nested_target : LBRACKET ABSOLUTE_INDEX RBRACKET",
1184:                         "nested_target : nested_target LBRACKET ABSOLUTE_INDEX RBRACKET",
1185:                         "nested_target : LBRACKET RBRACKET",
1186:                         "nested_target : nested_target LBRACKET RBRACKET",
1187:                         "assignment : target EQ QSTRING comment assBlock",
1188:                         "assignment : target comment nonEmptyAssBlock",
1189:                         "nested_assignment : nested_target EQ QSTRING comment assBlock",
1190:                         "nested_assignment : nested_target comment nonEmptyAssBlock",
1191:                         "assBlock :",
1192:                         "assBlock : nonEmptyAssBlock",
1193:                         "nonEmptyAssBlock : LBRACE assList RBRACE",
1194:                         "assList :",
1195:                         "assList : assList nested_assignment",
1196:                         "comment :",
1197:                         "comment : COMMENT", };
1198:
1199:         // #line 195 "var_parser.y"
1200:         /* a reference to the lexer object */
1201:         private VarDefScanner lexer;
1202:         private ConfigNode myTree;
1203:         private AssignmentFile myAssFile;
1204:         private RouterConfiguration rc;
1205:         private String path;
1206:
1207:         /* interface to the lexer */
1208:         private int yylex() {
1209:                 int yyl_return = -1;
1210:                 try {
1211:                         yyl_return = lexer.next_token();
1212:                 } catch (IOException e) {
1213:                         System.err.println("IO error :" + e);
1214:                 }
1215:                 return yyl_return;
1216:         }
1217:
1218:         /* error reporting */
1219:         public void yyerror(String error) {
1220:                 System.err.println("Error: " + error);
1221:         }
1222:
1223:         /*
1224:          * lexer is created in the constructor routerconfiguration is set path: sets the path of the
1225:          * config file creates a new Assignmentfile, which will host the resulting assignments
1226:          */
1227:         public Parser(Reader r, RouterConfiguration rc, String path) {
1228:                 lexer = new VarDefScanner(r, this);
1229:                 rc = rc;
1230:                 myAssFile = new AssignmentFile();
1231:                 path = path;
1232:                 myTree = new ConfigNode();
1233:         }
1234:
1235:         public AbstractNode getMyTree() {
1236:                 return this.myTree;
1237:         }
1238:
1239:         // #line 306 "Parser.java"
1240:         // ###############################################################
1241:         // method: yylexdebug : check lexer state
1242:         // ###############################################################
1243:         void yylexdebug(int state, int ch) {
1244:                 String s = null;
1245:•                if (ch < 0)
1246:                         ch = 0;
1247:•                if (ch <= YYMAXTOKEN) // check index bounds
1248:                         s = yyname[ch]; // now get it
1249:•                if (s == null)
1250:                         s = "illegal-symbol";
1251:                 debug("state " + state + ", reading " + ch + " (" + s + ")");
1252:         }
1253:
1254:         // The following are now global, to aid in error reporting
1255:         int yyn; // next next thing to do
1256:         int yym; //
1257:         int yystate; // current parsing state from state table
1258:         String yys; // current token string
1259:
1260:         // ###############################################################
1261:         // method: yyparse : parse input and execute indicated items
1262:         // ###############################################################
1263:         int yyparse() {
1264:                 boolean doaction;
1265:                 init_stacks();
1266:                 yynerrs = 0;
1267:                 yyerrflag = 0;
1268:                 yychar = -1; // impossible char forces a read
1269:                 yystate = 0; // initial state
1270:                 state_push(yystate); // save it
1271:                 val_push(yylval); // save empty value
1272:                 while (true) // until parsing is done, either correctly, or w/error
1273:                 {
1274:                         doaction = true;
1275:•                        if (yydebug)
1276:                                 debug("loop");
1277:                         // #### NEXT ACTION (from reduction table)
1278:•                        for (yyn = yydefred[yystate]; yyn == 0; yyn = yydefred[yystate]) {
1279:•                                if (yydebug)
1280:                                         debug("yyn:" + yyn + " state:" + yystate + " yychar:" + yychar);
1281:•                                if (yychar < 0) // we want a char?
1282:                                 {
1283:                                         yychar = yylex(); // get next token
1284:•                                        if (yydebug)
1285:                                                 debug(" next yychar:" + yychar);
1286:                                         // #### ERROR CHECK ####
1287:•                                        if (yychar < 0) // it it didn't work/error
1288:                                         {
1289:                                                 yychar = 0; // change it to default string (no -1!)
1290:•                                                if (yydebug)
1291:                                                         yylexdebug(yystate, yychar);
1292:                                         }
1293:                                 } // yychar<0
1294:                                 yyn = yysindex[yystate]; // get amount to shift by (shift index)
1295:•                                if ((yyn != 0) && (yyn += yychar) >= 0 && yyn <= YYTABLESIZE
1296:                                                 && yycheck[yyn] == yychar) {
1297:•                                        if (yydebug)
1298:                                                 debug("state " + yystate + ", shifting to state " + yytable[yyn]);
1299:                                         // #### NEXT STATE ####
1300:                                         yystate = yytable[yyn];// we are in a new state
1301:                                         state_push(yystate); // save it
1302:                                         val_push(yylval); // push our lval as the input for next rule
1303:                                         yychar = -1; // since we have 'eaten' a token, say we need another
1304:•                                        if (yyerrflag > 0) // have we recovered an error?
1305:                                                 --yyerrflag; // give ourselves credit
1306:                                         doaction = false; // but don't process yet
1307:                                         break; // quit the yyn=0 loop
1308:                                 }
1309:
1310:                                 yyn = yyrindex[yystate]; // reduce
1311:•                                if ((yyn != 0) && (yyn += yychar) >= 0 && yyn <= YYTABLESIZE
1312:                                                 && yycheck[yyn] == yychar) { // we reduced!
1313:•                                        if (yydebug)
1314:                                                 debug("reduce");
1315:                                         yyn = yytable[yyn];
1316:                                         doaction = true; // get ready to execute
1317:                                         break; // drop down to actions
1318:                                 } else // ERROR RECOVERY
1319:                                 {
1320:•                                        if (yyerrflag == 0) {
1321:                                                 yyerror("syntax error");
1322:                                                 yynerrs++;
1323:                                         }
1324:•                                        if (yyerrflag < 3) // low error count?
1325:                                         {
1326:                                                 yyerrflag = 3;
1327:                                                 while (true) // do until break
1328:                                                 {
1329:•                                                        if (stateptr < 0) // check for under & overflow here
1330:                                                         {
1331:                                                                 yyerror("stack underflow. aborting..."); // note lower case 's'
1332:                                                                 return 1;
1333:                                                         }
1334:                                                         yyn = yysindex[state_peek(0)];
1335:•                                                        if ((yyn != 0) && (yyn += YYERRCODE) >= 0 && yyn <= YYTABLESIZE
1336:                                                                         && yycheck[yyn] == YYERRCODE) {
1337:•                                                                if (yydebug)
1338:                                                                         debug("state " + state_peek(0)
1339:                                                                                         + ", error recovery shifting to state " + yytable[yyn]
1340:                                                                                         + " ");
1341:                                                                 yystate = yytable[yyn];
1342:                                                                 state_push(yystate);
1343:                                                                 val_push(yylval);
1344:                                                                 doaction = false;
1345:                                                                 break;
1346:                                                         } else {
1347:•                                                                if (yydebug)
1348:                                                                         debug("error recovery discarding state " + state_peek(0)
1349:                                                                                         + " ");
1350:•                                                                if (stateptr < 0) // check for under & overflow here
1351:                                                                 {
1352:                                                                         yyerror("Stack underflow. aborting..."); // capital 'S'
1353:                                                                         return 1;
1354:                                                                 }
1355:                                                                 state_pop();
1356:                                                                 val_pop();
1357:                                                         }
1358:                                                 }
1359:                                         } else // discard this token
1360:                                         {
1361:•                                                if (yychar == 0)
1362:                                                         return 1; // yyabort
1363:•                                                if (yydebug) {
1364:                                                         yys = null;
1365:•                                                        if (yychar <= YYMAXTOKEN)
1366:                                                                 yys = yyname[yychar];
1367:•                                                        if (yys == null)
1368:                                                                 yys = "illegal-symbol";
1369:                                                         debug("state " + yystate + ", error recovery discards token " + yychar
1370:                                                                         + " (" + yys + ")");
1371:                                                 }
1372:                                                 yychar = -1; // read another
1373:                                         }
1374:                                 } // end error recovery
1375:                         } // yyn=0 loop
1376:•                        if (!doaction) // any reason not to proceed?
1377:                                 continue; // skip action
1378:                         yym = yylen[yyn]; // get count of terminals on rhs
1379:•                        if (yydebug)
1380:                                 debug("state " + yystate + ", reducing " + yym + " by rule " + yyn + " ("
1381:                                                 + yyrule[yyn] + ")");
1382:•                        if (yym > 0) // if count of rhs not 'nil'
1383:                                 yyval = val_peek(yym - 1); // get current semantic value
1384:                         yyval = dup_yyval(yyval); // duplicate yyval if ParserVal is used as semantic value
1385:•                        switch (yyn) {
1386:                         // ########## USER-SUPPLIED ACTIONS ##########
1387:                         case 4:
1388:                         // #line 61 "var_parser.y"
1389:                         {
1390:                                 myTree.add((UnconfiguredVariableAssignment) val_peek(0).obj);
1391:                                 try {
1392:                                         myAssFile.configureAndAdd((UnconfiguredVariableAssignment) val_peek(0).obj,
1393:                                                         this.path, this.rc);
1394:                                 } catch (ParserException e) {
1395:                                         /* TODO */
1396:                                 }
1397:                         }
1398:                                 break;
1399:                         case 5:
1400:                         // #line 68 "var_parser.y"
1401:                         {
1402:                                 myTree.ok = false;
1403:                                 myTree.add(new ErrorNode());
1404:                         }
1405:                                 break;
1406:                         case 6:
1407:                         // #line 78 "var_parser.y"
1408:                         {
1409:                                 yyval = new ParserVal(new TopLevelTarget(val_peek(0).sval));
1410:                         }
1411:                                 break;
1412:                         case 7:
1413:                         // #line 81 "var_parser.y"
1414:                         {
1415:                                 ((Target) val_peek(2).obj).addSub(new SubLevelTarget(val_peek(0).sval));
1416:                                 yyval = val_peek(2);
1417:                         }
1418:                                 break;
1419:                         case 8:
1420:                         // #line 85 "var_parser.y"
1421:                         {
1422:                                 ((Target) val_peek(3).obj).addIndex(new AbsoluteIndex(val_peek(1).ival));
1423:                                 yyval = val_peek(3);
1424:                         }
1425:                                 break;
1426:                         case 9:
1427:                         // #line 89 "var_parser.y"
1428:                         {
1429:                                 ((Target) val_peek(2).obj).addIndex(new FreeIndex());
1430:                                 yyval = val_peek(2);
1431:                         }
1432:                                 break;
1433:                         case 10:
1434:                         // #line 96 "var_parser.y"
1435:                         {
1436:                                 TopLevelTarget target = new TopLevelTarget(null);
1437:                                 target.addSub(new SubLevelTarget(val_peek(0).sval));
1438:                                 yyval = new ParserVal(target);
1439:                         }
1440:                                 break;
1441:                         case 11:
1442:                         // #line 101 "var_parser.y"
1443:                         {
1444:                                 ((Target) val_peek(2).obj).addSub(new SubLevelTarget(val_peek(0).sval));
1445:                                 yyval = val_peek(2);
1446:                         }
1447:                                 break;
1448:                         case 12:
1449:                         // #line 105 "var_parser.y"
1450:                         {
1451:                                 EmptyTarget target = new EmptyTarget();
1452:                                 target.addIndex(new AbsoluteIndex(val_peek(1).ival));
1453:                                 yyval = new ParserVal(target);
1454:                         }
1455:                                 break;
1456:                         case 13:
1457:                         // #line 110 "var_parser.y"
1458:                         {
1459:                                 ((Target) val_peek(3).obj).addIndex(new AbsoluteIndex(val_peek(1).ival));
1460:                                 yyval = val_peek(3);
1461:                         }
1462:                                 break;
1463:                         case 14:
1464:                         // #line 114 "var_parser.y"
1465:                         {
1466:                                 EmptyTarget target = new EmptyTarget();
1467:                                 target.addIndex(new FreeIndex());
1468:                                 yyval = new ParserVal(target);
1469:                         }
1470:                                 break;
1471:                         case 15:
1472:                         // #line 119 "var_parser.y"
1473:                         {
1474:                                 ((Target) val_peek(2).obj).addIndex(new FreeIndex());
1475:                                 yyval = val_peek(2);
1476:                         }
1477:                                 break;
1478:                         case 16:
1479:                         // #line 128 "var_parser.y"
1480:                         {
1481:                                 Position location = new Position(((Target) val_peek(4).obj).getLine(),
1482:                                                 ((Target) val_peek(4).obj).getColumn(), this.path);
1483:                                 yyval = new ParserVal(new UnconfiguredVariableAssignment((Target) val_peek(4).obj,
1484:                                                 val_peek(2).sval, location, (ArrayList<Statement>) val_peek(0).obj));
1485:                         }
1486:                                 break;
1487:                         case 17:
1488:                         // #line 135 "var_parser.y"
1489:                         {
1490:                                 Position location = new Position(((Target) val_peek(2).obj).getLine(),
1491:                                                 ((Target) val_peek(2).obj).getColumn(), this.path);
1492:                                 yyval = new ParserVal(new UnconfiguredVariableAssignment((Target) val_peek(2).obj,
1493:                                                 null, location, (ArrayList<Statement>) val_peek(0).obj));
1494:                         }
1495:                                 break;
1496:                         case 18:
1497:                         // #line 145 "var_parser.y"
1498:                         {
1499:                                 Position location = new Position(((Target) val_peek(4).obj).getLine(),
1500:                                                 ((Target) val_peek(4).obj).getColumn(), this.path);
1501:                                 yyval = new ParserVal(new UnconfiguredVariableAssignment((Target) val_peek(4).obj,
1502:                                                 val_peek(2).sval, location, (ArrayList<Statement>) val_peek(0).obj));
1503:                         }
1504:                                 break;
1505:                         case 19:
1506:                         // #line 152 "var_parser.y"
1507:                         {
1508:                                 Position location = new Position(((Target) val_peek(2).obj).getLine(),
1509:                                                 ((Target) val_peek(2).obj).getColumn(), this.path);
1510:                                 yyval = new ParserVal(new UnconfiguredVariableAssignment((Target) val_peek(2).obj,
1511:                                                 null, location, (ArrayList<Statement>) val_peek(0).obj));
1512:                         }
1513:                                 break;
1514:                         case 20:
1515:                         // #line 161 "var_parser.y"
1516:                         {
1517:                                 yyval = new ParserVal(new ArrayList<Statement>());
1518:                         }
1519:                                 break;
1520:                         case 21:
1521:                         // #line 162 "var_parser.y"
1522:                         {
1523:                                 yyval = val_peek(0);
1524:                         }
1525:                                 break;
1526:                         case 22:
1527:                         // #line 166 "var_parser.y"
1528:                         {
1529:                                 yyval = val_peek(1);
1530:                         }
1531:                                 break;
1532:                         case 23:
1533:                         // #line 170 "var_parser.y"
1534:                         {
1535:                                 ArrayList<Statement> list = new ArrayList<Statement>();
1536:                                 list.add(new EmptyAssignment());
1537:                                 yyval = new ParserVal(list);
1538:                         }
1539:                                 break;
1540:                         case 24:
1541:                         // #line 174 "var_parser.y"
1542:                         {
1543:                                 List<Statement> newList = new ArrayList<Statement>();
1544:                                 newList.addAll((List<Statement>) val_peek(1).obj);
1545:                                 newList.add((UnconfiguredVariableAssignment) val_peek(0).obj);
1546:                                 yyval = new ParserVal(newList);
1547:                         }
1548:                                 break;
1549:                         case 25:
1550:                         // #line 184 "var_parser.y"
1551:                         {
1552:                                 yyval = new ParserVal("");
1553:                         }
1554:                                 break;
1555:                         case 26:
1556:                         // #line 185 "var_parser.y"
1557:                         {
1558:                                 Position location = new Position(((Target) val_peek(0).obj).getLine(),
1559:                                                 ((Target) val_peek(0).obj).getColumn(), this.path);
1560:                                 myAssFile.getComments().add(new Comment(val_peek(0).sval, location));
1561:                                 yyval = val_peek(0);
1562:                         }
1563:                                 break;
1564:                         // #line 622 "Parser.java"
1565:                         // ########## END OF USER-SUPPLIED ACTIONS ##########
1566:                         }// switch
1567:                                 // #### Now let's reduce... ####
1568:•                        if (yydebug)
1569:                                 debug("reduce");
1570:                         state_drop(yym); // we just reduced yylen states
1571:                         yystate = state_peek(0); // get new state
1572:                         val_drop(yym); // corresponding value drop
1573:                         yym = yylhs[yyn]; // select next TERMINAL(on lhs)
1574:•                        if (yystate == 0 && yym == 0)// done? 'rest' state and at first TERMINAL
1575:                         {
1576:•                                if (yydebug)
1577:                                         debug("After reduction, shifting from state 0 to state " + YYFINAL + "");
1578:                                 yystate = YYFINAL; // explicitly say we're done
1579:                                 state_push(YYFINAL); // and save it
1580:                                 val_push(yyval); // also save the semantic value of parsing
1581:•                                if (yychar < 0) // we want another character?
1582:                                 {
1583:                                         yychar = yylex(); // get next character
1584:•                                        if (yychar < 0)
1585:                                                 yychar = 0; // clean, if necessary
1586:•                                        if (yydebug)
1587:                                                 yylexdebug(yystate, yychar);
1588:                                 }
1589:•                                if (yychar == 0) // Good exit (if lex returns 0 ;-)
1590:                                         break; // quit the loop--all DONE
1591:                         } // if yystate
1592:                         else // else not done yet
1593:                         { // get next state and push, for next yydefred[]
1594:                                 yyn = yygindex[yym]; // find out where to go
1595:•                                if ((yyn != 0) && (yyn += yystate) >= 0 && yyn <= YYTABLESIZE
1596:                                                 && yycheck[yyn] == yystate)
1597:                                         yystate = yytable[yyn]; // get new state
1598:                                 else
1599:                                         yystate = yydgoto[yym]; // else go to new defred
1600:•                                if (yydebug)
1601:                                         debug("after reduction, shifting from state " + state_peek(0) + " to state "
1602:                                                         + yystate + "");
1603:                                 state_push(yystate); // going again, so push state & val...
1604:                                 val_push(yyval); // for next action
1605:                         }
1606:                 } // main loop
1607:                 return 0;// yyaccept!!
1608:         }
1609:         // ## end of method parse() ######################################
1610:
1611:         // ## run() --- for Thread #######################################
1612:         /**
1613:          * A default run method, used for operating this parser object in the background. It is intended
1614:          * for extending Thread or implementing Runnable. Turn off with -Jnorun .
1615:          */
1616:         public void run() {
1617:                 yyparse();
1618:         }
1619:         // ## end of method run() ########################################
1620:
1621:         // ## Constructors ###############################################
1622:         /**
1623:          * Default constructor. Turn off with -Jnoconstruct .
1624:          *
1625:          */
1626:         public Parser() {
1627:                 // nothing to do
1628:         }
1629:
1630:         /**
1631:          * Create a parser, setting the debug to true or false.
1632:          *
1633:          * @param debugMe
1634:          * true for debugging, false for no debug.
1635:          */
1636:         public Parser(boolean debugMe) {
1637:                 yydebug = debugMe;
1638:         }
1639:         // ###############################################################
1640:
1641: }
1642: // ################### END OF CLASS ##############################