aboutsummaryrefslogtreecommitdiff
path: root/antlr-3.4/runtime/ObjC/Framework/examples/simplecTreeParser/output1/SimpleCTP.m
blob: 1ac09525735ade76ff50ef2c6bf72cba1887446a (plain)
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
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
/** \file
 *  This OBJC source file was generated by $ANTLR version 3.2 Aug 23, 2010 07:48:06
 *
 *     -  From the grammar source file : /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g
 *     -                            On : 2010-08-23 07:55:04
 *     -           for the tree parser : SimpleCTPTreeParser *
 * Editing it, at least manually, is not wise. 
 *
 * ObjC language generator and runtime by Alan Condit, acondit|hereisanat|ipns|dotgoeshere|com.
 *
 *
*/
// [The "BSD licence"]
// Copyright (c) 2010 Alan Condit
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
//    notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
//    notice, this list of conditions and the following disclaimer in the
//    documentation and/or other materials provided with the distribution.
// 3. The name of the author may not be used to endorse or promote products
//    derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

// $ANTLR 3.2 Aug 23, 2010 07:48:06 /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g 2010-08-23 07:55:04

/* -----------------------------------------
 * Include the ANTLR3 generated header file.
 */
#import "SimpleCTP.h"
/* ----------------------------------------- */


/* ============================================================================= */

/* =============================================================================
 * Start of recognizer
 */



#pragma mark Bitsets
static ANTLRBitSet *FOLLOW_declaration_in_program56;
static const unsigned long long FOLLOW_declaration_in_program56_data[] = { 0x0000000000000192LL};
static ANTLRBitSet *FOLLOW_variable_in_declaration76;
static const unsigned long long FOLLOW_variable_in_declaration76_data[] = { 0x0000000000000002LL};
static ANTLRBitSet *FOLLOW_FUNC_DECL_in_declaration87;
static const unsigned long long FOLLOW_FUNC_DECL_in_declaration87_data[] = { 0x0000000000000004LL};
static ANTLRBitSet *FOLLOW_functionHeader_in_declaration89;
static const unsigned long long FOLLOW_functionHeader_in_declaration89_data[] = { 0x0000000000000008LL};
static ANTLRBitSet *FOLLOW_FUNC_DEF_in_declaration101;
static const unsigned long long FOLLOW_FUNC_DEF_in_declaration101_data[] = { 0x0000000000000004LL};
static ANTLRBitSet *FOLLOW_functionHeader_in_declaration103;
static const unsigned long long FOLLOW_functionHeader_in_declaration103_data[] = { 0x0000000000000200LL};
static ANTLRBitSet *FOLLOW_block_in_declaration105;
static const unsigned long long FOLLOW_block_in_declaration105_data[] = { 0x0000000000000008LL};
static ANTLRBitSet *FOLLOW_VAR_DEF_in_variable126;
static const unsigned long long FOLLOW_VAR_DEF_in_variable126_data[] = { 0x0000000000000004LL};
static ANTLRBitSet *FOLLOW_type_in_variable128;
static const unsigned long long FOLLOW_type_in_variable128_data[] = { 0x0000000000000400LL};
static ANTLRBitSet *FOLLOW_declarator_in_variable130;
static const unsigned long long FOLLOW_declarator_in_variable130_data[] = { 0x0000000000000008LL};
static ANTLRBitSet *FOLLOW_K_ID_in_declarator150;
static const unsigned long long FOLLOW_K_ID_in_declarator150_data[] = { 0x0000000000000002LL};
static ANTLRBitSet *FOLLOW_FUNC_HDR_in_functionHeader171;
static const unsigned long long FOLLOW_FUNC_HDR_in_functionHeader171_data[] = { 0x0000000000000004LL};
static ANTLRBitSet *FOLLOW_type_in_functionHeader173;
static const unsigned long long FOLLOW_type_in_functionHeader173_data[] = { 0x0000000000000400LL};
static ANTLRBitSet *FOLLOW_K_ID_in_functionHeader175;
static const unsigned long long FOLLOW_K_ID_in_functionHeader175_data[] = { 0x0000000000000020LL};
static ANTLRBitSet *FOLLOW_formalParameter_in_functionHeader177;
static const unsigned long long FOLLOW_formalParameter_in_functionHeader177_data[] = { 0x0000000000000028LL};
static ANTLRBitSet *FOLLOW_ARG_DEF_in_formalParameter199;
static const unsigned long long FOLLOW_ARG_DEF_in_formalParameter199_data[] = { 0x0000000000000004LL};
static ANTLRBitSet *FOLLOW_type_in_formalParameter201;
static const unsigned long long FOLLOW_type_in_formalParameter201_data[] = { 0x0000000000000400LL};
static ANTLRBitSet *FOLLOW_declarator_in_formalParameter203;
static const unsigned long long FOLLOW_declarator_in_formalParameter203_data[] = { 0x0000000000000008LL};
static ANTLRBitSet *FOLLOW_set_in_type0;
static const unsigned long long FOLLOW_set_in_type0_data[] = { 0x0000000000000002LL};
static ANTLRBitSet *FOLLOW_BLOCK_in_block286;
static const unsigned long long FOLLOW_BLOCK_in_block286_data[] = { 0x0000000000000004LL};
static ANTLRBitSet *FOLLOW_variable_in_block288;
static const unsigned long long FOLLOW_variable_in_block288_data[] = { 0x000000000007CE18LL};
static ANTLRBitSet *FOLLOW_stat_in_block291;
static const unsigned long long FOLLOW_stat_in_block291_data[] = { 0x000000000007CE08LL};
static ANTLRBitSet *FOLLOW_forStat_in_stat305;
static const unsigned long long FOLLOW_forStat_in_stat305_data[] = { 0x0000000000000002LL};
static ANTLRBitSet *FOLLOW_expr_in_stat313;
static const unsigned long long FOLLOW_expr_in_stat313_data[] = { 0x0000000000000002LL};
static ANTLRBitSet *FOLLOW_block_in_stat321;
static const unsigned long long FOLLOW_block_in_stat321_data[] = { 0x0000000000000002LL};
static ANTLRBitSet *FOLLOW_K_FOR_in_forStat341;
static const unsigned long long FOLLOW_K_FOR_in_forStat341_data[] = { 0x0000000000000004LL};
static ANTLRBitSet *FOLLOW_expr_in_forStat343;
static const unsigned long long FOLLOW_expr_in_forStat343_data[] = { 0x0000000000078C00LL};
static ANTLRBitSet *FOLLOW_expr_in_forStat345;
static const unsigned long long FOLLOW_expr_in_forStat345_data[] = { 0x0000000000078C00LL};
static ANTLRBitSet *FOLLOW_expr_in_forStat347;
static const unsigned long long FOLLOW_expr_in_forStat347_data[] = { 0x0000000000000200LL};
static ANTLRBitSet *FOLLOW_block_in_forStat349;
static const unsigned long long FOLLOW_block_in_forStat349_data[] = { 0x0000000000000008LL};
static ANTLRBitSet *FOLLOW_K_EQEQ_in_expr365;
static const unsigned long long FOLLOW_K_EQEQ_in_expr365_data[] = { 0x0000000000000004LL};
static ANTLRBitSet *FOLLOW_expr_in_expr367;
static const unsigned long long FOLLOW_expr_in_expr367_data[] = { 0x0000000000078C00LL};
static ANTLRBitSet *FOLLOW_expr_in_expr369;
static const unsigned long long FOLLOW_expr_in_expr369_data[] = { 0x0000000000000008LL};
static ANTLRBitSet *FOLLOW_K_LT_in_expr381;
static const unsigned long long FOLLOW_K_LT_in_expr381_data[] = { 0x0000000000000004LL};
static ANTLRBitSet *FOLLOW_expr_in_expr383;
static const unsigned long long FOLLOW_expr_in_expr383_data[] = { 0x0000000000078C00LL};
static ANTLRBitSet *FOLLOW_expr_in_expr385;
static const unsigned long long FOLLOW_expr_in_expr385_data[] = { 0x0000000000000008LL};
static ANTLRBitSet *FOLLOW_K_PLUS_in_expr397;
static const unsigned long long FOLLOW_K_PLUS_in_expr397_data[] = { 0x0000000000000004LL};
static ANTLRBitSet *FOLLOW_expr_in_expr399;
static const unsigned long long FOLLOW_expr_in_expr399_data[] = { 0x0000000000078C00LL};
static ANTLRBitSet *FOLLOW_expr_in_expr401;
static const unsigned long long FOLLOW_expr_in_expr401_data[] = { 0x0000000000000008LL};
static ANTLRBitSet *FOLLOW_K_EQ_in_expr413;
static const unsigned long long FOLLOW_K_EQ_in_expr413_data[] = { 0x0000000000000004LL};
static ANTLRBitSet *FOLLOW_K_ID_in_expr415;
static const unsigned long long FOLLOW_K_ID_in_expr415_data[] = { 0x0000000000078C00LL};
static ANTLRBitSet *FOLLOW_expr_in_expr419;
static const unsigned long long FOLLOW_expr_in_expr419_data[] = { 0x0000000000000008LL};
static ANTLRBitSet *FOLLOW_atom_in_expr432;
static const unsigned long long FOLLOW_atom_in_expr432_data[] = { 0x0000000000000002LL};
static ANTLRBitSet *FOLLOW_set_in_atom0;
static const unsigned long long FOLLOW_set_in_atom0_data[] = { 0x0000000000000002LL};


#pragma mark Dynamic Global Scopes
@implementation Symbols_Scope  /* globalAttributeScopeImpl */
/* start of synthesize -- OBJC-Line 1750 */

@synthesize tree;
+ (Symbols_Scope *)newSymbols_Scope
{
    return [[[Symbols_Scope alloc] init] retain];
}
/* start of iterate get and set functions */

- (ANTLRCommonTree *)gettree { return( tree ); }

- (void)settree:(ANTLRCommonTree *)aVal { tree = aVal; }



/* End of iterate get and set functions */

@end /* end of Symbols_Scope implementation */


#pragma mark Dynamic Rule Scopes

#pragma mark Rule return scopes start
@implementation SimpleCTP_expr_return
+ (SimpleCTP_expr_return *)newSimpleCTP_expr_return
{
    return [[[SimpleCTP_expr_return alloc] init] retain];
}




@end /* end of returnScope implementation */



@implementation SimpleCTP  // line 610

+ (void) initialize
{
    #pragma mark Bitsets
    FOLLOW_declaration_in_program56 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_declaration_in_program56_data Count:(NSUInteger)1] retain];
    FOLLOW_variable_in_declaration76 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_variable_in_declaration76_data Count:(NSUInteger)1] retain];
    FOLLOW_FUNC_DECL_in_declaration87 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_FUNC_DECL_in_declaration87_data Count:(NSUInteger)1] retain];
    FOLLOW_functionHeader_in_declaration89 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_functionHeader_in_declaration89_data Count:(NSUInteger)1] retain];
    FOLLOW_FUNC_DEF_in_declaration101 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_FUNC_DEF_in_declaration101_data Count:(NSUInteger)1] retain];
    FOLLOW_functionHeader_in_declaration103 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_functionHeader_in_declaration103_data Count:(NSUInteger)1] retain];
    FOLLOW_block_in_declaration105 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_block_in_declaration105_data Count:(NSUInteger)1] retain];
    FOLLOW_VAR_DEF_in_variable126 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_VAR_DEF_in_variable126_data Count:(NSUInteger)1] retain];
    FOLLOW_type_in_variable128 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_type_in_variable128_data Count:(NSUInteger)1] retain];
    FOLLOW_declarator_in_variable130 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_declarator_in_variable130_data Count:(NSUInteger)1] retain];
    FOLLOW_K_ID_in_declarator150 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_K_ID_in_declarator150_data Count:(NSUInteger)1] retain];
    FOLLOW_FUNC_HDR_in_functionHeader171 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_FUNC_HDR_in_functionHeader171_data Count:(NSUInteger)1] retain];
    FOLLOW_type_in_functionHeader173 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_type_in_functionHeader173_data Count:(NSUInteger)1] retain];
    FOLLOW_K_ID_in_functionHeader175 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_K_ID_in_functionHeader175_data Count:(NSUInteger)1] retain];
    FOLLOW_formalParameter_in_functionHeader177 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_formalParameter_in_functionHeader177_data Count:(NSUInteger)1] retain];
    FOLLOW_ARG_DEF_in_formalParameter199 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_ARG_DEF_in_formalParameter199_data Count:(NSUInteger)1] retain];
    FOLLOW_type_in_formalParameter201 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_type_in_formalParameter201_data Count:(NSUInteger)1] retain];
    FOLLOW_declarator_in_formalParameter203 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_declarator_in_formalParameter203_data Count:(NSUInteger)1] retain];
    FOLLOW_set_in_type0 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_set_in_type0_data Count:(NSUInteger)1] retain];
    FOLLOW_BLOCK_in_block286 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_BLOCK_in_block286_data Count:(NSUInteger)1] retain];
    FOLLOW_variable_in_block288 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_variable_in_block288_data Count:(NSUInteger)1] retain];
    FOLLOW_stat_in_block291 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_stat_in_block291_data Count:(NSUInteger)1] retain];
    FOLLOW_forStat_in_stat305 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_forStat_in_stat305_data Count:(NSUInteger)1] retain];
    FOLLOW_expr_in_stat313 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_expr_in_stat313_data Count:(NSUInteger)1] retain];
    FOLLOW_block_in_stat321 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_block_in_stat321_data Count:(NSUInteger)1] retain];
    FOLLOW_K_FOR_in_forStat341 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_K_FOR_in_forStat341_data Count:(NSUInteger)1] retain];
    FOLLOW_expr_in_forStat343 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_expr_in_forStat343_data Count:(NSUInteger)1] retain];
    FOLLOW_expr_in_forStat345 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_expr_in_forStat345_data Count:(NSUInteger)1] retain];
    FOLLOW_expr_in_forStat347 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_expr_in_forStat347_data Count:(NSUInteger)1] retain];
    FOLLOW_block_in_forStat349 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_block_in_forStat349_data Count:(NSUInteger)1] retain];
    FOLLOW_K_EQEQ_in_expr365 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_K_EQEQ_in_expr365_data Count:(NSUInteger)1] retain];
    FOLLOW_expr_in_expr367 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_expr_in_expr367_data Count:(NSUInteger)1] retain];
    FOLLOW_expr_in_expr369 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_expr_in_expr369_data Count:(NSUInteger)1] retain];
    FOLLOW_K_LT_in_expr381 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_K_LT_in_expr381_data Count:(NSUInteger)1] retain];
    FOLLOW_expr_in_expr383 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_expr_in_expr383_data Count:(NSUInteger)1] retain];
    FOLLOW_expr_in_expr385 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_expr_in_expr385_data Count:(NSUInteger)1] retain];
    FOLLOW_K_PLUS_in_expr397 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_K_PLUS_in_expr397_data Count:(NSUInteger)1] retain];
    FOLLOW_expr_in_expr399 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_expr_in_expr399_data Count:(NSUInteger)1] retain];
    FOLLOW_expr_in_expr401 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_expr_in_expr401_data Count:(NSUInteger)1] retain];
    FOLLOW_K_EQ_in_expr413 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_K_EQ_in_expr413_data Count:(NSUInteger)1] retain];
    FOLLOW_K_ID_in_expr415 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_K_ID_in_expr415_data Count:(NSUInteger)1] retain];
    FOLLOW_expr_in_expr419 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_expr_in_expr419_data Count:(NSUInteger)1] retain];
    FOLLOW_atom_in_expr432 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_atom_in_expr432_data Count:(NSUInteger)1] retain];
    FOLLOW_set_in_atom0 = [[ANTLRBitSet newANTLRBitSetWithBits:(const unsigned long long *)FOLLOW_set_in_atom0_data Count:(NSUInteger)1] retain];

    [ANTLRBaseRecognizer setTokenNames:[[[NSArray alloc] initWithObjects:@"<invalid>", @"<EOR>", @"<DOWN>", @"<UP>", 
 @"VAR_DEF", @"ARG_DEF", @"FUNC_HDR", @"FUNC_DECL", @"FUNC_DEF", @"BLOCK", 
 @"K_ID", @"K_INT", @"K_CHAR", @"K_VOID", @"K_FOR", @"K_EQ", @"K_EQEQ", 
 @"K_LT", @"K_PLUS", @"K_INT_TYPE", @"WS", @"';'", @"'('", @"','", @"')'", 
 @"'{'", @"'}'", nil] retain]];
}

+ (SimpleCTP *)newSimpleCTP:(id<ANTLRTreeNodeStream>)aStream
{

    return [[SimpleCTP alloc] initWithStream:aStream];

}


- (id) initWithStream:(id<ANTLRTreeNodeStream>)aStream
{
    if ((self = [super initWithStream:aStream State:[[ANTLRRecognizerSharedState newANTLRRecognizerSharedStateWithRuleLen:12+1] retain]]) != nil) {



        /* start of actions-actionScope-init */
        /* start of init */
    }
    return self;
}

- (void) dealloc
{
    [Symbols_scope release];
    [super dealloc];
}
// start actions.actionScope.methods
// start methods()
// start rules
/*
 * $ANTLR start program
 * /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:13:1: program : ( declaration )+ ;
 */
- (void) program
{
    /* ruleScopeSetUp */

    @try {
        // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:14:5: ( ( declaration )+ ) // ruleBlockSingleAlt
        // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:14:9: ( declaration )+ // alt
        {
        // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:14:9: ( declaration )+ // positiveClosureBlock
        NSInteger cnt1=0;
        do {
            NSInteger alt1=2;
            NSInteger LA1_0 = [input LA:1];
            if ( (LA1_0==VAR_DEF||(LA1_0>=FUNC_DECL && LA1_0<=FUNC_DEF)) ) {
                alt1=1;
            }


            switch (alt1) {
                case 1 : ;
                    // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:14:9: declaration // alt
                    {
                    [self pushFollow:FOLLOW_declaration_in_program56];
                    [self declaration];
                    [self popFollow];

                      /* element() */
                     /* elements */
                    }
                    break;

                default :
                    if ( cnt1 >= 1 )
                        goto loop1;
                    ANTLREarlyExitException *eee = [ANTLREarlyExitException exceptionWithStream:input decisionNumber:1];
                    @throw eee;
            }
            cnt1++;
        } while (YES);
        loop1: ;
          /* element() */
         /* elements */
        }

        // token+rule list labels

    }
    @catch (ANTLRRecognitionException *re) {
        [self reportError:re];
        [self recover:input Exception:re];
    }    @finally {
    }
    return ;
}
/* $ANTLR end program */
/*
 * $ANTLR start declaration
 * /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:17:1: declaration : ( variable | ^( FUNC_DECL functionHeader ) | ^( FUNC_DEF functionHeader block ) );
 */
- (void) declaration
{
    /* ruleScopeSetUp */

    @try {
        // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:18:5: ( variable | ^( FUNC_DECL functionHeader ) | ^( FUNC_DEF functionHeader block ) ) //ruleblock
        NSInteger alt2=3;
        switch ([input LA:1]) {
            case VAR_DEF: ;
                {
                alt2=1;
                }
                break;
            case FUNC_DECL: ;
                {
                alt2=2;
                }
                break;
            case FUNC_DEF: ;
                {
                alt2=3;
                }
                break;

        default: ;
            ANTLRNoViableAltException *nvae = [ANTLRNoViableAltException newANTLRNoViableAltException:2 state:0 stream:input];
            @throw nvae;
        }

        switch (alt2) {
            case 1 : ;
                // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:18:9: variable // alt
                {
                [self pushFollow:FOLLOW_variable_in_declaration76];
                [self variable];
                [self popFollow];

                  /* element() */
                 /* elements */
                }
                break;
            case 2 : ;
                // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:19:9: ^( FUNC_DECL functionHeader ) // alt
                {
                [self match:input TokenType:FUNC_DECL Follow:FOLLOW_FUNC_DECL_in_declaration87];   /* element() */

                    [self match:input TokenType:ANTLRTokenTypeDOWN Follow:nil]; 
                    [self pushFollow:FOLLOW_functionHeader_in_declaration89];
                    [self functionHeader];
                    [self popFollow];

                      /* element() */

                    [self match:input TokenType:ANTLRTokenTypeUP Follow:nil];   /* element() */
                 /* elements */
                }
                break;
            case 3 : ;
                // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:20:9: ^( FUNC_DEF functionHeader block ) // alt
                {
                [self match:input TokenType:FUNC_DEF Follow:FOLLOW_FUNC_DEF_in_declaration101];   /* element() */

                    [self match:input TokenType:ANTLRTokenTypeDOWN Follow:nil]; 
                    [self pushFollow:FOLLOW_functionHeader_in_declaration103];
                    [self functionHeader];
                    [self popFollow];

                      /* element() */
                    [self pushFollow:FOLLOW_block_in_declaration105];
                    [self block];
                    [self popFollow];

                      /* element() */

                    [self match:input TokenType:ANTLRTokenTypeUP Follow:nil];   /* element() */
                 /* elements */
                }
                break;

        }
        // token+rule list labels

    }
    @catch (ANTLRRecognitionException *re) {
        [self reportError:re];
        [self recover:input Exception:re];
    }    @finally {
    }
    return ;
}
/* $ANTLR end declaration */
/*
 * $ANTLR start variable
 * /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:23:1: variable : ^( VAR_DEF type declarator ) ;
 */
- (void) variable
{
    /* ruleScopeSetUp */

    @try {
        // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:24:5: ( ^( VAR_DEF type declarator ) ) // ruleBlockSingleAlt
        // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:24:9: ^( VAR_DEF type declarator ) // alt
        {
        [self match:input TokenType:VAR_DEF Follow:FOLLOW_VAR_DEF_in_variable126];   /* element() */

            [self match:input TokenType:ANTLRTokenTypeDOWN Follow:nil]; 
            [self pushFollow:FOLLOW_type_in_variable128];
            [self type];
            [self popFollow];

              /* element() */
            [self pushFollow:FOLLOW_declarator_in_variable130];
            [self declarator];
            [self popFollow];

              /* element() */

            [self match:input TokenType:ANTLRTokenTypeUP Follow:nil];   /* element() */
         /* elements */
        }

        // token+rule list labels

    }
    @catch (ANTLRRecognitionException *re) {
        [self reportError:re];
        [self recover:input Exception:re];
    }    @finally {
    }
    return ;
}
/* $ANTLR end variable */
/*
 * $ANTLR start declarator
 * /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:27:1: declarator : K_ID ;
 */
- (void) declarator
{
    /* ruleScopeSetUp */

    @try {
        // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:28:5: ( K_ID ) // ruleBlockSingleAlt
        // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:28:9: K_ID // alt
        {
        [self match:input TokenType:K_ID Follow:FOLLOW_K_ID_in_declarator150];   /* element() */
         /* elements */
        }

        // token+rule list labels

    }
    @catch (ANTLRRecognitionException *re) {
        [self reportError:re];
        [self recover:input Exception:re];
    }    @finally {
    }
    return ;
}
/* $ANTLR end declarator */
/*
 * $ANTLR start functionHeader
 * /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:31:1: functionHeader : ^( FUNC_HDR type K_ID ( formalParameter )+ ) ;
 */
- (void) functionHeader
{
    /* ruleScopeSetUp */

    @try {
        // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:32:5: ( ^( FUNC_HDR type K_ID ( formalParameter )+ ) ) // ruleBlockSingleAlt
        // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:32:9: ^( FUNC_HDR type K_ID ( formalParameter )+ ) // alt
        {
        [self match:input TokenType:FUNC_HDR Follow:FOLLOW_FUNC_HDR_in_functionHeader171];   /* element() */

            [self match:input TokenType:ANTLRTokenTypeDOWN Follow:nil]; 
            [self pushFollow:FOLLOW_type_in_functionHeader173];
            [self type];
            [self popFollow];

              /* element() */
            [self match:input TokenType:K_ID Follow:FOLLOW_K_ID_in_functionHeader175];   /* element() */
            // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:32:30: ( formalParameter )+ // positiveClosureBlock
            NSInteger cnt3=0;
            do {
                NSInteger alt3=2;
                NSInteger LA3_0 = [input LA:1];
                if ( (LA3_0==ARG_DEF) ) {
                    alt3=1;
                }


                switch (alt3) {
                    case 1 : ;
                        // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:32:30: formalParameter // alt
                        {
                        [self pushFollow:FOLLOW_formalParameter_in_functionHeader177];
                        [self formalParameter];
                        [self popFollow];

                          /* element() */
                         /* elements */
                        }
                        break;

                    default :
                        if ( cnt3 >= 1 )
                            goto loop3;
                        ANTLREarlyExitException *eee = [ANTLREarlyExitException exceptionWithStream:input decisionNumber:3];
                        @throw eee;
                }
                cnt3++;
            } while (YES);
            loop3: ;
              /* element() */

            [self match:input TokenType:ANTLRTokenTypeUP Follow:nil];   /* element() */
         /* elements */
        }

        // token+rule list labels

    }
    @catch (ANTLRRecognitionException *re) {
        [self reportError:re];
        [self recover:input Exception:re];
    }    @finally {
    }
    return ;
}
/* $ANTLR end functionHeader */
/*
 * $ANTLR start formalParameter
 * /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:35:1: formalParameter : ^( ARG_DEF type declarator ) ;
 */
- (void) formalParameter
{
    /* ruleScopeSetUp */

    @try {
        // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:36:5: ( ^( ARG_DEF type declarator ) ) // ruleBlockSingleAlt
        // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:36:9: ^( ARG_DEF type declarator ) // alt
        {
        [self match:input TokenType:ARG_DEF Follow:FOLLOW_ARG_DEF_in_formalParameter199];   /* element() */

            [self match:input TokenType:ANTLRTokenTypeDOWN Follow:nil]; 
            [self pushFollow:FOLLOW_type_in_formalParameter201];
            [self type];
            [self popFollow];

              /* element() */
            [self pushFollow:FOLLOW_declarator_in_formalParameter203];
            [self declarator];
            [self popFollow];

              /* element() */

            [self match:input TokenType:ANTLRTokenTypeUP Follow:nil];   /* element() */
         /* elements */
        }

        // token+rule list labels

    }
    @catch (ANTLRRecognitionException *re) {
        [self reportError:re];
        [self recover:input Exception:re];
    }    @finally {
    }
    return ;
}
/* $ANTLR end formalParameter */
/*
 * $ANTLR start type
 * /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:39:1: type : ( K_INT | K_CHAR | K_VOID | K_ID );
 */
- (void) type
{
    /* ruleScopeSetUp */

    @try {
        // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:40:5: ( K_INT | K_CHAR | K_VOID | K_ID ) // ruleBlockSingleAlt
        // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g: // alt
        {
        if ((([input LA:1] >= K_ID) && ([input LA:1] <= K_VOID))) {
            [input consume];
            [state setIsErrorRecovery:NO];
        } else {
            ANTLRMismatchedSetException *mse = [ANTLRMismatchedSetException exceptionWithSet:nil stream:input];
            @throw mse;
        }
          /* element() */
         /* elements */
        }

        // token+rule list labels

    }
    @catch (ANTLRRecognitionException *re) {
        [self reportError:re];
        [self recover:input Exception:re];
    }    @finally {
    }
    return ;
}
/* $ANTLR end type */
/*
 * $ANTLR start block
 * /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:46:1: block : ^( BLOCK ( variable )* ( stat )* ) ;
 */
- (void) block
{
    /* ruleScopeSetUp */

    @try {
        // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:47:5: ( ^( BLOCK ( variable )* ( stat )* ) ) // ruleBlockSingleAlt
        // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:47:9: ^( BLOCK ( variable )* ( stat )* ) // alt
        {
        [self match:input TokenType:BLOCK Follow:FOLLOW_BLOCK_in_block286];   /* element() */

        if ( [input LA:1] == ANTLRTokenTypeDOWN ) {
            [self match:input TokenType:ANTLRTokenTypeDOWN Follow:nil]; 
            do {
                NSInteger alt4=2;
                NSInteger LA4_0 = [input LA:1];
                if ( (LA4_0==VAR_DEF) ) {
                    alt4=1;
                }


                switch (alt4) {
                    case 1 : ;
                        // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:47:17: variable // alt
                        {
                        [self pushFollow:FOLLOW_variable_in_block288];
                        [self variable];
                        [self popFollow];

                          /* element() */
                         /* elements */
                        }
                        break;

                    default :
                        goto loop4;
                }
            } while (YES);
            loop4: ;
              /* element() */
            do {
                NSInteger alt5=2;
                NSInteger LA5_0 = [input LA:1];
                if ( ((LA5_0>=BLOCK && LA5_0<=K_INT)||(LA5_0>=K_FOR && LA5_0<=K_PLUS)) ) {
                    alt5=1;
                }


                switch (alt5) {
                    case 1 : ;
                        // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:47:27: stat // alt
                        {
                        [self pushFollow:FOLLOW_stat_in_block291];
                        [self stat];
                        [self popFollow];

                          /* element() */
                         /* elements */
                        }
                        break;

                    default :
                        goto loop5;
                }
            } while (YES);
            loop5: ;
              /* element() */

            [self match:input TokenType:ANTLRTokenTypeUP Follow:nil]; 
        }  /* element() */
         /* elements */
        }

        // token+rule list labels

    }
    @catch (ANTLRRecognitionException *re) {
        [self reportError:re];
        [self recover:input Exception:re];
    }    @finally {
    }
    return ;
}
/* $ANTLR end block */
/*
 * $ANTLR start stat
 * /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:50:1: stat : ( forStat | expr | block );
 */
- (void) stat
{
    /* ruleScopeSetUp */

    @try {
        // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:50:5: ( forStat | expr | block ) //ruleblock
        NSInteger alt6=3;
        switch ([input LA:1]) {
            case K_FOR: ;
                {
                alt6=1;
                }
                break;
            case K_ID: ;
            case K_INT: ;
            case K_EQ: ;
            case K_EQEQ: ;
            case K_LT: ;
            case K_PLUS: ;
                {
                alt6=2;
                }
                break;
            case BLOCK: ;
                {
                alt6=3;
                }
                break;

        default: ;
            ANTLRNoViableAltException *nvae = [ANTLRNoViableAltException newANTLRNoViableAltException:6 state:0 stream:input];
            @throw nvae;
        }

        switch (alt6) {
            case 1 : ;
                // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:50:7: forStat // alt
                {
                [self pushFollow:FOLLOW_forStat_in_stat305];
                [self forStat];
                [self popFollow];

                  /* element() */
                 /* elements */
                }
                break;
            case 2 : ;
                // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:51:7: expr // alt
                {
                [self pushFollow:FOLLOW_expr_in_stat313];
                [self expr];
                [self popFollow];

                  /* element() */
                 /* elements */
                }
                break;
            case 3 : ;
                // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:52:7: block // alt
                {
                [self pushFollow:FOLLOW_block_in_stat321];
                [self block];
                [self popFollow];

                  /* element() */
                 /* elements */
                }
                break;

        }
        // token+rule list labels

    }
    @catch (ANTLRRecognitionException *re) {
        [self reportError:re];
        [self recover:input Exception:re];
    }    @finally {
    }
    return ;
}
/* $ANTLR end stat */
/*
 * $ANTLR start forStat
 * /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:55:1: forStat : ^( K_FOR expr expr expr block ) ;
 */
- (void) forStat
{
    /* ruleScopeSetUp */

    @try {
        // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:56:5: ( ^( K_FOR expr expr expr block ) ) // ruleBlockSingleAlt
        // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:56:9: ^( K_FOR expr expr expr block ) // alt
        {
        [self match:input TokenType:K_FOR Follow:FOLLOW_K_FOR_in_forStat341];   /* element() */

            [self match:input TokenType:ANTLRTokenTypeDOWN Follow:nil]; 
            [self pushFollow:FOLLOW_expr_in_forStat343];
            [self expr];
            [self popFollow];

              /* element() */
            [self pushFollow:FOLLOW_expr_in_forStat345];
            [self expr];
            [self popFollow];

              /* element() */
            [self pushFollow:FOLLOW_expr_in_forStat347];
            [self expr];
            [self popFollow];

              /* element() */
            [self pushFollow:FOLLOW_block_in_forStat349];
            [self block];
            [self popFollow];

              /* element() */

            [self match:input TokenType:ANTLRTokenTypeUP Follow:nil];   /* element() */
         /* elements */
        }

        // token+rule list labels

    }
    @catch (ANTLRRecognitionException *re) {
        [self reportError:re];
        [self recover:input Exception:re];
    }    @finally {
    }
    return ;
}
/* $ANTLR end forStat */
/*
 * $ANTLR start expr
 * /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:59:1: expr : ( ^( K_EQEQ expr expr ) | ^( K_LT expr expr ) | ^( K_PLUS expr expr ) | ^( K_EQ K_ID e= expr ) | atom );
 */
- (SimpleCTP_expr_return *) expr
{
    /* ruleScopeSetUp */

    SimpleCTP_expr_return * retval = [SimpleCTP_expr_return newSimpleCTP_expr_return];
    [retval setStart:[input LT:1]];

    @try {
        ANTLRCommonTree *K_ID1 = nil;
        SimpleCTP_expr_return * e = nil;


        // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:59:5: ( ^( K_EQEQ expr expr ) | ^( K_LT expr expr ) | ^( K_PLUS expr expr ) | ^( K_EQ K_ID e= expr ) | atom ) //ruleblock
        NSInteger alt7=5;
        switch ([input LA:1]) {
            case K_EQEQ: ;
                {
                alt7=1;
                }
                break;
            case K_LT: ;
                {
                alt7=2;
                }
                break;
            case K_PLUS: ;
                {
                alt7=3;
                }
                break;
            case K_EQ: ;
                {
                alt7=4;
                }
                break;
            case K_ID: ;
            case K_INT: ;
                {
                alt7=5;
                }
                break;

        default: ;
            ANTLRNoViableAltException *nvae = [ANTLRNoViableAltException newANTLRNoViableAltException:7 state:0 stream:input];
            @throw nvae;
        }

        switch (alt7) {
            case 1 : ;
                // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:59:9: ^( K_EQEQ expr expr ) // alt
                {
                [self match:input TokenType:K_EQEQ Follow:FOLLOW_K_EQEQ_in_expr365];   /* element() */

                    [self match:input TokenType:ANTLRTokenTypeDOWN Follow:nil]; 
                    [self pushFollow:FOLLOW_expr_in_expr367];
                    [self expr];
                    [self popFollow];

                      /* element() */
                    [self pushFollow:FOLLOW_expr_in_expr369];
                    [self expr];
                    [self popFollow];

                      /* element() */

                    [self match:input TokenType:ANTLRTokenTypeUP Follow:nil];   /* element() */
                 /* elements */
                }
                break;
            case 2 : ;
                // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:60:9: ^( K_LT expr expr ) // alt
                {
                [self match:input TokenType:K_LT Follow:FOLLOW_K_LT_in_expr381];   /* element() */

                    [self match:input TokenType:ANTLRTokenTypeDOWN Follow:nil]; 
                    [self pushFollow:FOLLOW_expr_in_expr383];
                    [self expr];
                    [self popFollow];

                      /* element() */
                    [self pushFollow:FOLLOW_expr_in_expr385];
                    [self expr];
                    [self popFollow];

                      /* element() */

                    [self match:input TokenType:ANTLRTokenTypeUP Follow:nil];   /* element() */
                 /* elements */
                }
                break;
            case 3 : ;
                // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:61:9: ^( K_PLUS expr expr ) // alt
                {
                [self match:input TokenType:K_PLUS Follow:FOLLOW_K_PLUS_in_expr397];   /* element() */

                    [self match:input TokenType:ANTLRTokenTypeDOWN Follow:nil]; 
                    [self pushFollow:FOLLOW_expr_in_expr399];
                    [self expr];
                    [self popFollow];

                      /* element() */
                    [self pushFollow:FOLLOW_expr_in_expr401];
                    [self expr];
                    [self popFollow];

                      /* element() */

                    [self match:input TokenType:ANTLRTokenTypeUP Follow:nil];   /* element() */
                 /* elements */
                }
                break;
            case 4 : ;
                // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:62:9: ^( K_EQ K_ID e= expr ) // alt
                {
                [self match:input TokenType:K_EQ Follow:FOLLOW_K_EQ_in_expr413];   /* element() */

                    [self match:input TokenType:ANTLRTokenTypeDOWN Follow:nil]; 
                    K_ID1=(ANTLRCommonTree *)[self match:input TokenType:K_ID Follow:FOLLOW_K_ID_in_expr415];   /* element() */
                    [self pushFollow:FOLLOW_expr_in_expr419];
                    e = [self expr];
                    [self popFollow];

                      /* element() */

                    [self match:input TokenType:ANTLRTokenTypeUP Follow:nil];   /* element() */
                 NSLog(@"assigning %@ to variable %@", (e!=nil?[[input getTokenStream] toStringFromStart:[[input getTreeAdaptor] getTokenStartIndex:[e getStart]]
                         ToEnd:[[input getTreeAdaptor] getTokenStopIndex:[e getStart]]]:nil), (K_ID1!=nil?[K_ID1 getText]:0));   /* element() */
                 /* elements */
                }
                break;
            case 5 : ;
                // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:63:9: atom // alt
                {
                [self pushFollow:FOLLOW_atom_in_expr432];
                [self atom];
                [self popFollow];

                  /* element() */
                 /* elements */
                }
                break;

        }
        // token+rule list labels

    }
    @catch (ANTLRRecognitionException *re) {
        [self reportError:re];
        [self recover:input Exception:re];
    }    @finally {
    }
    return retval;
}
/* $ANTLR end expr */
/*
 * $ANTLR start atom
 * /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:66:1: atom : ( K_ID | K_INT );
 */
- (void) atom
{
    /* ruleScopeSetUp */

    @try {
        // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g:67:5: ( K_ID | K_INT ) // ruleBlockSingleAlt
        // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/simplecTreeParser/SimpleCTP.g: // alt
        {
        if ((([input LA:1] >= K_ID) && ([input LA:1] <= K_INT))) {
            [input consume];
            [state setIsErrorRecovery:NO];
        } else {
            ANTLRMismatchedSetException *mse = [ANTLRMismatchedSetException exceptionWithSet:nil stream:input];
            @throw mse;
        }
          /* element() */
         /* elements */
        }

        // token+rule list labels

    }
    @catch (ANTLRRecognitionException *re) {
        [self reportError:re];
        [self recover:input Exception:re];
    }    @finally {
    }
    return ;
}
/* $ANTLR end atom */

@end /* end of SimpleCTP implementation line 669 */


/* End of code
 * =============================================================================
 */