-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathASTParser.java
822 lines (740 loc) · 39.3 KB
/
ASTParser.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
//----------------------------------------------------
// The following code was generated by CUP v0.10k
// Tue Apr 24 05:09:00 PDT 2012
//----------------------------------------------------
import java_cup.runtime.*;
/** CUP v0.10k generated parser.
* @version Tue Apr 24 05:09:00 PDT 2012
*/
public class ASTParser extends java_cup.runtime.lr_parser {
/** Default constructor. */
public ASTParser() {super();}
/** Constructor which sets the default scanner. */
public ASTParser(java_cup.runtime.Scanner s) {super(s);}
/** Production table. */
protected static final short _production_table[][] =
unpackFromStrings(new String[] {
"\000\062\000\002\003\005\000\002\002\004\000\002\003" +
"\002\000\002\004\003\000\002\004\004\000\002\005\012" +
"\000\002\007\002\000\002\007\003\000\002\006\003\000" +
"\002\006\004\000\002\010\010\000\002\010\007\000\002" +
"\011\002\000\002\011\003\000\002\012\003\000\002\012" +
"\004\000\002\013\006\000\002\015\005\000\002\015\005" +
"\000\002\014\006\000\002\014\010\000\002\014\007\000" +
"\002\014\007\000\002\014\006\000\002\014\005\000\002" +
"\014\010\000\002\014\006\000\002\014\005\000\002\014" +
"\005\000\002\014\006\000\002\014\006\000\002\014\006" +
"\000\002\014\006\000\002\014\005\000\002\014\006\000" +
"\002\014\006\000\002\014\006\000\002\014\005\000\002" +
"\014\005\000\002\014\005\000\002\014\005\000\002\014" +
"\005\000\002\014\004\000\002\016\004\000\002\016\005" +
"\000\002\017\003\000\002\017\004\000\002\020\003\000" +
"\002\020\004\000\002\021\007" });
/** Access to production table. */
public short[][] production_table() {return _production_table;}
/** Parse-action table. */
protected static final short[][] _action_table =
unpackFromStrings(new String[] {
"\000\171\000\006\002\uffff\051\005\001\002\000\004\002" +
"\173\001\002\000\004\004\006\001\002\000\004\051\011" +
"\001\002\000\006\002\001\051\011\001\002\000\006\002" +
"\ufffe\051\ufffe\001\002\000\004\005\012\001\002\000\004" +
"\050\013\001\002\000\004\050\014\001\002\000\004\046" +
"\015\001\002\000\004\015\016\001\002\000\006\016\ufffb" +
"\051\022\001\002\000\006\016\ufff9\051\ufff9\001\002\000" +
"\004\016\171\001\002\000\006\016\ufffa\051\022\001\002" +
"\000\006\006\024\007\023\001\002\000\004\050\165\001" +
"\002\000\004\050\025\001\002\000\006\050\ufff5\051\031" +
"\001\002\000\006\050\ufff4\051\031\001\002\000\006\050" +
"\ufff3\051\ufff3\001\002\000\004\050\035\001\002\000\004" +
"\010\032\001\002\000\004\050\033\001\002\000\004\050" +
"\034\001\002\000\006\050\ufff1\051\ufff1\001\002\000\004" +
"\051\036\001\002\000\062\012\063\013\060\014\057\020" +
"\066\021\051\022\054\023\073\024\061\025\046\026\052" +
"\027\072\030\056\031\045\032\044\033\064\034\067\035" +
"\050\036\047\037\062\040\070\041\065\042\071\043\055" +
"\044\053\001\002\000\006\016\ufff7\051\ufff7\001\002\000" +
"\004\017\041\001\002\000\006\045\043\050\042\001\002" +
"\000\012\016\ufff0\017\ufff0\050\ufff0\051\ufff0\001\002\000" +
"\012\016\uffef\017\uffef\050\uffef\051\uffef\001\002\000\004" +
"\051\036\001\002\000\004\051\036\001\002\000\004\051" +
"\036\001\002\000\004\047\156\001\002\000\004\051\036" +
"\001\002\000\004\051\036\001\002\000\004\051\036\001" +
"\002\000\004\050\150\001\002\000\004\051\036\001\002" +
"\000\004\017\uffd7\001\002\000\004\051\036\001\002\000" +
"\004\051\036\001\002\000\004\051\036\001\002\000\004" +
"\050\116\001\002\000\004\046\115\001\002\000\004\050" +
"\113\001\002\000\004\051\036\001\002\000\004\050\110" +
"\001\002\000\004\051\036\001\002\000\004\051\036\001" +
"\002\000\004\047\102\001\002\000\004\051\036\001\002" +
"\000\004\051\036\001\002\000\004\051\036\001\002\000" +
"\006\017\uffe9\051\036\001\002\000\010\016\uffd4\017\uffd4" +
"\051\uffd4\001\002\000\010\016\uffd3\017\uffd3\051\uffd3\001" +
"\002\000\004\051\036\001\002\000\004\017\uffe2\001\002" +
"\000\004\017\uffe5\001\002\000\004\017\uffd9\001\002\000" +
"\004\051\036\001\002\000\004\017\uffdd\001\002\000\004" +
"\051\036\001\002\000\004\051\036\001\002\000\004\017" +
"\uffeb\001\002\000\004\017\uffe6\001\002\000\004\051\036" +
"\001\002\000\004\017\uffde\001\002\000\004\051\036\001" +
"\002\000\004\017\uffee\001\002\000\004\017\uffda\001\002" +
"\000\004\050\117\001\002\000\004\051\036\001\002\000" +
"\004\051\036\001\002\000\004\017\uffe8\001\002\000\004" +
"\050\123\001\002\000\004\050\124\001\002\000\004\015" +
"\126\001\002\000\004\017\uffed\001\002\000\006\016\127" +
"\051\036\001\002\000\004\017\uffd6\001\002\000\006\016" +
"\131\051\036\001\002\000\004\017\uffd5\001\002\000\004" +
"\050\133\001\002\000\004\015\126\001\002\000\004\017" +
"\uffec\001\002\000\004\051\036\001\002\000\004\017\uffe1" +
"\001\002\000\004\051\141\001\002\000\006\017\uffe7\051" +
"\141\001\002\000\004\011\143\001\002\000\006\017\uffd2" +
"\051\uffd2\001\002\000\004\050\144\001\002\000\004\050" +
"\145\001\002\000\004\051\036\001\002\000\006\017\uffd0" +
"\051\uffd0\001\002\000\006\017\uffd1\051\uffd1\001\002\000" +
"\004\017\uffd8\001\002\000\004\051\036\001\002\000\004" +
"\017\uffe3\001\002\000\004\051\036\001\002\000\004\017" +
"\uffea\001\002\000\004\017\uffdc\001\002\000\004\017\uffdb" +
"\001\002\000\004\051\036\001\002\000\004\017\uffe4\001" +
"\002\000\004\017\uffe0\001\002\000\004\051\036\001\002" +
"\000\004\017\uffdf\001\002\000\006\050\ufff2\051\ufff2\001" +
"\002\000\004\050\166\001\002\000\004\051\036\001\002" +
"\000\006\016\ufff6\051\ufff6\001\002\000\006\016\ufff8\051" +
"\ufff8\001\002\000\006\002\ufffc\051\ufffc\001\002\000\006" +
"\002\ufffd\051\ufffd\001\002\000\004\002\000\001\002" });
/** Access to parse-action table. */
public short[][] action_table() {return _action_table;}
/** <code>reduce_goto</code> table. */
protected static final short[][] _reduce_table =
unpackFromStrings(new String[] {
"\000\171\000\004\003\003\001\001\000\002\001\001\000" +
"\002\001\001\000\006\004\006\005\007\001\001\000\004" +
"\005\171\001\001\000\002\001\001\000\002\001\001\000" +
"\002\001\001\000\002\001\001\000\002\001\001\000\002" +
"\001\001\000\010\006\020\007\017\010\016\001\001\000" +
"\002\001\001\000\002\001\001\000\004\010\167\001\001" +
"\000\002\001\001\000\002\001\001\000\002\001\001\000" +
"\010\011\027\012\025\013\026\001\001\000\004\013\163" +
"\001\001\000\002\001\001\000\002\001\001\000\002\001" +
"\001\000\002\001\001\000\002\001\001\000\002\001\001" +
"\000\006\014\037\015\036\001\001\000\002\001\001\000" +
"\002\001\001\000\002\001\001\000\002\001\001\000\002" +
"\001\001\000\002\001\001\000\006\014\037\015\161\001" +
"\001\000\006\014\037\015\160\001\001\000\006\014\037" +
"\015\156\001\001\000\002\001\001\000\006\014\037\015" +
"\154\001\001\000\006\014\037\015\152\001\001\000\006" +
"\014\037\015\150\001\001\000\002\001\001\000\006\014" +
"\037\015\136\001\001\000\002\001\001\000\006\014\037" +
"\015\134\001\001\000\006\014\037\015\131\001\001\000" +
"\006\014\037\015\121\001\001\000\002\001\001\000\002" +
"\001\001\000\002\001\001\000\006\014\037\015\110\001" +
"\001\000\002\001\001\000\006\014\037\015\104\001\001" +
"\000\006\014\037\015\102\001\001\000\002\001\001\000" +
"\006\014\037\015\100\001\001\000\006\014\037\015\076" +
"\001\001\000\010\014\037\015\074\017\073\001\001\000" +
"\006\014\037\015\075\001\001\000\002\001\001\000\002" +
"\001\001\000\006\014\037\015\077\001\001\000\002\001" +
"\001\000\002\001\001\000\002\001\001\000\006\014\037" +
"\015\103\001\001\000\002\001\001\000\006\014\037\015" +
"\105\001\001\000\006\014\037\015\106\001\001\000\002" +
"\001\001\000\002\001\001\000\006\014\037\015\111\001" +
"\001\000\002\001\001\000\006\014\037\015\113\001\001" +
"\000\002\001\001\000\002\001\001\000\002\001\001\000" +
"\006\014\037\015\117\001\001\000\006\014\037\015\120" +
"\001\001\000\002\001\001\000\002\001\001\000\002\001" +
"\001\000\004\016\124\001\001\000\002\001\001\000\010" +
"\014\037\015\074\017\127\001\001\000\002\001\001\000" +
"\006\014\037\015\075\001\001\000\002\001\001\000\002" +
"\001\001\000\004\016\133\001\001\000\002\001\001\000" +
"\006\014\037\015\135\001\001\000\002\001\001\000\006" +
"\020\137\021\141\001\001\000\004\021\146\001\001\000" +
"\002\001\001\000\002\001\001\000\002\001\001\000\002" +
"\001\001\000\006\014\037\015\145\001\001\000\002\001" +
"\001\000\002\001\001\000\002\001\001\000\006\014\037" +
"\015\151\001\001\000\002\001\001\000\006\014\037\015" +
"\153\001\001\000\002\001\001\000\002\001\001\000\002" +
"\001\001\000\006\014\037\015\157\001\001\000\002\001" +
"\001\000\002\001\001\000\006\014\037\015\162\001\001" +
"\000\002\001\001\000\002\001\001\000\002\001\001\000" +
"\006\014\037\015\166\001\001\000\002\001\001\000\002" +
"\001\001\000\002\001\001\000\002\001\001\000\002\001" +
"\001" });
/** Access to <code>reduce_goto</code> table. */
public short[][] reduce_table() {return _reduce_table;}
/** Instance of action encapsulation class. */
protected CUP$ASTParser$actions action_obj;
/** Action encapsulation object initializer. */
protected void init_actions()
{
action_obj = new CUP$ASTParser$actions(this);
}
/** Invoke a user supplied parse action. */
public java_cup.runtime.Symbol do_action(
int act_num,
java_cup.runtime.lr_parser parser,
java.util.Stack stack,
int top)
throws java.lang.Exception
{
/* call code in generated class */
return action_obj.CUP$ASTParser$do_action(act_num, parser, stack, top);
}
/** Indicates start state. */
public int start_state() {return 0;}
/** Indicates start production. */
public int start_production() {return 1;}
/** <code>EOF</code> Symbol index. */
public int EOF_sym() {return 0;}
/** <code>error</code> Symbol index. */
public int error_sym() {return 1;}
public void syntax_error(Symbol cur_token) {
System.err.println("??? unexpected error in ast parsing: " + ((ASTLexer)getScanner()).line());
System.exit(1);
}
public void unrecovered_syntax_error(Symbol cur_token) {
}
}
/** Cup generated class to encapsulate user supplied action code.*/
class CUP$ASTParser$actions {
Integer curr_lineno = new Integer(0);
private final ASTParser parser;
/** Constructor */
CUP$ASTParser$actions(ASTParser parser) {
this.parser = parser;
}
/** Method with the actual generated action code. */
public final java_cup.runtime.Symbol CUP$ASTParser$do_action(
int CUP$ASTParser$act_num,
java_cup.runtime.lr_parser CUP$ASTParser$parser,
java.util.Stack CUP$ASTParser$stack,
int CUP$ASTParser$top)
throws java.lang.Exception
{
/* Symbol object for return from actions */
java_cup.runtime.Symbol CUP$ASTParser$result;
/* select the action based on the action number */
switch (CUP$ASTParser$act_num)
{
/*. . . . . . . . . . . . . . . . . . . .*/
case 49: // simple_case ::= LINENO BRANCH ID ID expr
{
branch RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-4)).value;
AbstractSymbol n = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
AbstractSymbol t = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new branch(l.intValue(), n, t, e);
CUP$ASTParser$result = new java_cup.runtime.Symbol(15/*simple_case*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 48: // case_list ::= case_list simple_case
{
Cases RESULT = null;
Cases cl = (Cases)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
branch c = (branch)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
RESULT = cl.appendElement(c);
CUP$ASTParser$result = new java_cup.runtime.Symbol(14/*case_list*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 47: // case_list ::= simple_case
{
Cases RESULT = null;
branch c = (branch)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
RESULT = (new Cases(curr_lineno.intValue())).appendElement(c);
CUP$ASTParser$result = new java_cup.runtime.Symbol(14/*case_list*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 46: // expr_list ::= expr_list expr
{
Expressions RESULT = null;
Expressions el = (Expressions)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
RESULT = el.appendElement(e);
CUP$ASTParser$result = new java_cup.runtime.Symbol(13/*expr_list*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 45: // expr_list ::= expr
{
Expressions RESULT = null;
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
RESULT = (new Expressions(curr_lineno.intValue())).appendElement(e);
CUP$ASTParser$result = new java_cup.runtime.Symbol(13/*expr_list*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 44: // actuals ::= LPAREN expr_list RPAREN
{
Expressions RESULT = null;
Expressions el = (Expressions)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
RESULT = el;
CUP$ASTParser$result = new java_cup.runtime.Symbol(12/*actuals*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 43: // actuals ::= LPAREN RPAREN
{
Expressions RESULT = null;
RESULT = new Expressions(curr_lineno.intValue());
CUP$ASTParser$result = new java_cup.runtime.Symbol(12/*actuals*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 42: // expr_aux ::= LINENO NO_EXPR
{
Expression RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
curr_lineno = l; RESULT = new no_expr(l.intValue());
CUP$ASTParser$result = new java_cup.runtime.Symbol(10/*expr_aux*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 41: // expr_aux ::= LINENO OBJECT ID
{
Expression RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
AbstractSymbol n = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new object(l.intValue(), n);
CUP$ASTParser$result = new java_cup.runtime.Symbol(10/*expr_aux*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 40: // expr_aux ::= LINENO BOOL INT_CONST
{
Expression RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
AbstractSymbol b = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l;
if (b.getString().charAt(0) == '1')
RESULT = new bool_const(l.intValue(), Boolean.TRUE);
else
RESULT = new bool_const(l.intValue(), Boolean.FALSE);
CUP$ASTParser$result = new java_cup.runtime.Symbol(10/*expr_aux*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 39: // expr_aux ::= LINENO STR STR_CONST
{
Expression RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
AbstractSymbol s = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new string_const(l.intValue(), s);
CUP$ASTParser$result = new java_cup.runtime.Symbol(10/*expr_aux*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 38: // expr_aux ::= LINENO INT INT_CONST
{
Expression RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
AbstractSymbol i = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new int_const(l.intValue(), i);
CUP$ASTParser$result = new java_cup.runtime.Symbol(10/*expr_aux*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 37: // expr_aux ::= LINENO COMP expr
{
Expression RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new comp(l.intValue(), e);
CUP$ASTParser$result = new java_cup.runtime.Symbol(10/*expr_aux*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 36: // expr_aux ::= LINENO LEQ expr expr
{
Expression RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
Expression e1 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
Expression e2 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new leq(l.intValue(), e1, e2);
CUP$ASTParser$result = new java_cup.runtime.Symbol(10/*expr_aux*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 35: // expr_aux ::= LINENO EQ expr expr
{
Expression RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
Expression e1 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
Expression e2 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new eq(l.intValue(), e1, e2);
CUP$ASTParser$result = new java_cup.runtime.Symbol(10/*expr_aux*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 34: // expr_aux ::= LINENO LT expr expr
{
Expression RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
Expression e1 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
Expression e2 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new lt(l.intValue(), e1, e2);
CUP$ASTParser$result = new java_cup.runtime.Symbol(10/*expr_aux*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 33: // expr_aux ::= LINENO NEG expr
{
Expression RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new neg(l.intValue(), e);
CUP$ASTParser$result = new java_cup.runtime.Symbol(10/*expr_aux*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 32: // expr_aux ::= LINENO DIVIDE expr expr
{
Expression RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
Expression e1 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
Expression e2 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new divide(l.intValue(), e1, e2);
CUP$ASTParser$result = new java_cup.runtime.Symbol(10/*expr_aux*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 31: // expr_aux ::= LINENO MUL expr expr
{
Expression RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
Expression e1 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
Expression e2 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new mul(l.intValue(), e1, e2);
CUP$ASTParser$result = new java_cup.runtime.Symbol(10/*expr_aux*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 30: // expr_aux ::= LINENO SUB expr expr
{
Expression RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
Expression e1 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
Expression e2 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new sub(l.intValue(), e1, e2);
CUP$ASTParser$result = new java_cup.runtime.Symbol(10/*expr_aux*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 29: // expr_aux ::= LINENO PLUS expr expr
{
Expression RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
Expression e1 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
Expression e2 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new plus(l.intValue(), e1, e2);
CUP$ASTParser$result = new java_cup.runtime.Symbol(10/*expr_aux*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 28: // expr_aux ::= LINENO ISVOID expr
{
Expression RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new isvoid(l.intValue(), e);
CUP$ASTParser$result = new java_cup.runtime.Symbol(10/*expr_aux*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 27: // expr_aux ::= LINENO NEW ID
{
Expression RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
AbstractSymbol t = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new new_(l.intValue(), t);
CUP$ASTParser$result = new java_cup.runtime.Symbol(10/*expr_aux*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 26: // expr_aux ::= LINENO TYPCASE expr case_list
{
Expression RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
Cases cl = (Cases)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new typcase(l.intValue(), e, cl);
CUP$ASTParser$result = new java_cup.runtime.Symbol(10/*expr_aux*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 25: // expr_aux ::= LINENO LET ID ID expr expr
{
Expression RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-5)).value;
AbstractSymbol n = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
AbstractSymbol t = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
Expression i = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
Expression b = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new let(l.intValue(), n, t, i, b);
CUP$ASTParser$result = new java_cup.runtime.Symbol(10/*expr_aux*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 24: // expr_aux ::= LINENO BLOCK expr_list
{
Expression RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
Expressions el = (Expressions)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new block(l.intValue(), el);
CUP$ASTParser$result = new java_cup.runtime.Symbol(10/*expr_aux*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 23: // expr_aux ::= LINENO LOOP expr expr
{
Expression RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
Expression p = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
Expression b = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new loop(l.intValue(), p, b);
CUP$ASTParser$result = new java_cup.runtime.Symbol(10/*expr_aux*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 22: // expr_aux ::= LINENO COND expr expr expr
{
Expression RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-4)).value;
Expression p = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
Expression t = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new cond(l.intValue(), p, t, e);
CUP$ASTParser$result = new java_cup.runtime.Symbol(10/*expr_aux*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 21: // expr_aux ::= LINENO DISPATCH expr ID actuals
{
Expression RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-4)).value;
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
AbstractSymbol n = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
Expressions a = (Expressions)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new dispatch(l.intValue(), e, n, a);
CUP$ASTParser$result = new java_cup.runtime.Symbol(10/*expr_aux*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 20: // expr_aux ::= LINENO STATIC_DISPATCH expr ID ID actuals
{
Expression RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-5)).value;
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
AbstractSymbol t = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
AbstractSymbol n = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
Expressions a = (Expressions)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new static_dispatch(l.intValue(), e, t, n, a);
CUP$ASTParser$result = new java_cup.runtime.Symbol(10/*expr_aux*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 19: // expr_aux ::= LINENO ASSIGN ID expr
{
Expression RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
AbstractSymbol n = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new assign(l.intValue(), n,e);
CUP$ASTParser$result = new java_cup.runtime.Symbol(10/*expr_aux*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 18: // expr ::= expr_aux COLON NO_TYPE
{
Expression RESULT = null;
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
RESULT = e;
CUP$ASTParser$result = new java_cup.runtime.Symbol(11/*expr*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 17: // expr ::= expr_aux COLON ID
{
Expression RESULT = null;
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
AbstractSymbol t = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
RESULT = e; e.set_type(t);
CUP$ASTParser$result = new java_cup.runtime.Symbol(11/*expr*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 16: // formal ::= LINENO FORMAL ID ID
{
Formal RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
AbstractSymbol n = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
AbstractSymbol t = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new formal(l.intValue(), n, t);
CUP$ASTParser$result = new java_cup.runtime.Symbol(9/*formal*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 15: // formal_list ::= formal_list formal
{
Formals RESULT = null;
Formals fl = (Formals)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
Formal f = (Formal)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
RESULT = fl.appendElement(f);
CUP$ASTParser$result = new java_cup.runtime.Symbol(8/*formal_list*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 14: // formal_list ::= formal
{
Formals RESULT = null;
Formal f = (Formal)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
RESULT = (new Formals(curr_lineno.intValue())).appendElement(f);
CUP$ASTParser$result = new java_cup.runtime.Symbol(8/*formal_list*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 13: // formals ::= formal_list
{
Formals RESULT = null;
Formals fl = (Formals)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
RESULT = fl;
CUP$ASTParser$result = new java_cup.runtime.Symbol(7/*formals*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 12: // formals ::=
{
Formals RESULT = null;
RESULT = new Formals(curr_lineno.intValue());
CUP$ASTParser$result = new java_cup.runtime.Symbol(7/*formals*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 11: // feature ::= LINENO ATTR ID ID expr
{
Feature RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-4)).value;
AbstractSymbol n = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
AbstractSymbol t = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
Expression i = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new attr(l.intValue(), n, t, i);
CUP$ASTParser$result = new java_cup.runtime.Symbol(6/*feature*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 10: // feature ::= LINENO METHOD ID formals ID expr
{
Feature RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-5)).value;
AbstractSymbol n = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
Formals f = (Formals)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
AbstractSymbol t = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
Expression b = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new method(l.intValue(), n,f,t,b);
CUP$ASTParser$result = new java_cup.runtime.Symbol(6/*feature*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 9: // feature_list ::= feature_list feature
{
Features RESULT = null;
Features fl = (Features)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
Feature f = (Feature)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
RESULT = fl.appendElement(f);
CUP$ASTParser$result = new java_cup.runtime.Symbol(4/*feature_list*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 8: // feature_list ::= feature
{
Features RESULT = null;
Feature f = (Feature)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
RESULT = (new Features(curr_lineno.intValue())).appendElement(f);
CUP$ASTParser$result = new java_cup.runtime.Symbol(4/*feature_list*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 7: // optional_feature_list ::= feature_list
{
Features RESULT = null;
Features fl = (Features)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
RESULT = fl;
CUP$ASTParser$result = new java_cup.runtime.Symbol(5/*optional_feature_list*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 6: // optional_feature_list ::=
{
Features RESULT = null;
RESULT = new Features(curr_lineno.intValue());
CUP$ASTParser$result = new java_cup.runtime.Symbol(5/*optional_feature_list*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 5: // class ::= LINENO CLASS ID ID STR_CONST LPAREN optional_feature_list RPAREN
{
class_ RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-7)).value;
AbstractSymbol n = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-5)).value;
AbstractSymbol p = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-4)).value;
AbstractSymbol file = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
Features f = (Features)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
curr_lineno = l; RESULT = new class_(l.intValue(), n, p, f, file);
CUP$ASTParser$result = new java_cup.runtime.Symbol(3/*class*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 4: // class_list ::= class_list class
{
Classes RESULT = null;
Classes cl = (Classes)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
class_ c = (class_)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
RESULT = cl.appendElement(c);
CUP$ASTParser$result = new java_cup.runtime.Symbol(2/*class_list*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 3: // class_list ::= class
{
Classes RESULT = null;
class_ c = (class_)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
RESULT = (new Classes(curr_lineno.intValue())).appendElement(c);
CUP$ASTParser$result = new java_cup.runtime.Symbol(2/*class_list*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 2: // program ::=
{
program RESULT = null;
RESULT = null; System.exit(1);
CUP$ASTParser$result = new java_cup.runtime.Symbol(1/*program*/, RESULT);
}
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 1: // $START ::= program EOF
{
Object RESULT = null;
program start_val = (program)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
RESULT = start_val;
CUP$ASTParser$result = new java_cup.runtime.Symbol(0/*$START*/, RESULT);
}
/* ACCEPT */
CUP$ASTParser$parser.done_parsing();
return CUP$ASTParser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 0: // program ::= LINENO PROGRAM class_list
{
program RESULT = null;
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
Classes cl = (Classes)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-0)).value;
curr_lineno = l; RESULT = new program(l.intValue(), cl);
CUP$ASTParser$result = new java_cup.runtime.Symbol(1/*program*/, RESULT);
}
return CUP$ASTParser$result;
/* . . . . . .*/
default:
throw new Exception(
"Invalid action number found in internal parse table");
}
}
}