• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/** \file
2 *  This OBJC source file was generated by $ANTLR version 3.4
3 *
4 *     -  From the grammar source file : /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/combined/Combined.g
5 *     -                            On : 2012-02-16 17:33:49
6 *     -                for the parser : CombinedParserParser
7 *
8 * Editing it, at least manually, is not wise.
9 *
10 * ObjC language generator and runtime by Alan Condit, acondit|hereisanat|ipns|dotgoeshere|com.
11 *
12 *
13*/
14// $ANTLR 3.4 /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/combined/Combined.g 2012-02-16 17:33:49
15
16
17/* -----------------------------------------
18 * Include the ANTLR3 generated header file.
19 */
20#import "CombinedParser.h"
21/* ----------------------------------------- */
22
23
24/* ============================================================================= */
25/* =============================================================================
26 * Start of recognizer
27 */
28
29#pragma mark Bitsets
30static ANTLRBitSet *FOLLOW_identifier_in_stat20;
31static const unsigned long long FOLLOW_identifier_in_stat20_data[] = { 0x0000000000000012LL};
32static ANTLRBitSet *FOLLOW_ID_in_identifier35;
33static const unsigned long long FOLLOW_ID_in_identifier35_data[] = { 0x0000000000000002LL};
34
35
36#pragma mark Dynamic Global globalAttributeScopeImplementation
37
38#pragma mark Dynamic Rule Scopes ruleAttributeScopeImplementation
39
40#pragma mark Rule Return Scopes returnScopeImplementation
41
42@implementation CombinedParser  // line 637
43
44/* ObjC start of ruleAttributeScope */
45#pragma mark Dynamic Rule Scopes ruleAttributeScope
46/* ObjC end of ruleAttributeScope */
47#pragma mark global Attribute Scopes globalAttributeScope
48/* ObjC start globalAttributeScope */
49/* ObjC end globalAttributeScope */
50/* ObjC start actions.(actionScope).synthesize */
51/* ObjC start synthesize() */
52
53+ (void) initialize
54{
55    #pragma mark Bitsets
56    FOLLOW_identifier_in_stat20 = [[ANTLRBitSet newBitSetWithBits:(const unsigned long long *)FOLLOW_identifier_in_stat20_data Count:(NSUInteger)1] retain];
57    FOLLOW_ID_in_identifier35 = [[ANTLRBitSet newBitSetWithBits:(const unsigned long long *)FOLLOW_ID_in_identifier35_data Count:(NSUInteger)1] retain];
58
59    [BaseRecognizer setTokenNames:[[AMutableArray arrayWithObjects:@"<invalid>", @"<EOR>", @"<DOWN>", @"<UP>",
60 @"ID", @"INT", @"WS", nil] retain]];
61    [BaseRecognizer setGrammarFileName:@"/Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/combined/Combined.g"];
62}
63
64+ (CombinedParser *)newCombinedParser:(id<TokenStream>)aStream
65{
66    return [[CombinedParser alloc] initWithTokenStream:aStream];
67}
68
69- (id) initWithTokenStream:(id<TokenStream>)aStream
70{
71    self = [super initWithTokenStream:aStream State:[[RecognizerSharedState newRecognizerSharedStateWithRuleLen:2+1] retain]];
72    if ( self != nil ) {
73        /* start of actions-actionScope-init */
74        /* start of init */
75    }
76    return self;
77}
78
79- (void) dealloc
80{
81    [super dealloc];
82}
83
84/* ObjC start actions.(actionScope).methods */
85/* ObjC end actions.(actionScope).methods */
86/* ObjC start methods() */
87/* ObjC end methods() */
88/* ObjC start rules */
89/*
90 * $ANTLR start stat
91 * /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/combined/Combined.g:7:1: stat : ( identifier )+ ;
92 */
93- (void) stat
94{
95    /* ruleScopeSetUp */
96
97    /* ruleDeclarations */
98
99    @try {
100        /* ruleLabelDefs entry */
101
102
103        // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/combined/Combined.g:7:5: ( ( identifier )+ ) // ruleBlockSingleAlt
104        // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/combined/Combined.g:7:7: ( identifier )+ // alt
105        {
106
107        // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/combined/Combined.g:7:7: ( identifier )+ // positiveClosureBlock
108        NSInteger cnt1 = 0;
109        do {
110            NSInteger alt1 = 2;
111            NSInteger LA1_0 = [input LA:1];
112            if ( (LA1_0==ID) ) {
113                alt1=1;
114            }
115
116
117            switch (alt1) {
118                case 1 : ;
119                    // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/combined/Combined.g:7:7: identifier // alt
120                    {
121
122                    /* ruleRef */
123                    [self pushFollow:FOLLOW_identifier_in_stat20];
124                    [self identifier];
125
126                    [self popFollow];
127
128
129
130                    }
131                    break;
132
133                default :
134                    if ( cnt1 >= 1 )
135                        goto loop1;
136                    EarlyExitException *eee =
137                        [EarlyExitException newException:input decisionNumber:1];
138                    @throw eee;
139            }
140            cnt1++;
141        } while (YES);
142        loop1: ;
143
144
145        }
146
147        /* token+rule list labels */
148
149    }
150    @catch (RecognitionException *re) {
151        [self reportError:re];
152        [self recover:input Exception:re];
153    }
154
155    @finally {
156        /* ruleScopeCleanUp */
157
158    }
159    return ;
160}
161/* $ANTLR end stat */
162
163/*
164 * $ANTLR start identifier
165 * /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/combined/Combined.g:9:1: identifier : ID ;
166 */
167- (void) identifier
168{
169    /* ruleScopeSetUp */
170
171    /* ruleDeclarations */
172
173    @try {
174        /* ruleLabelDefs entry */
175
176
177        // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/combined/Combined.g:10:5: ( ID ) // ruleBlockSingleAlt
178        // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/combined/Combined.g:10:7: ID // alt
179        {
180
181        [self match:input TokenType:ID Follow:FOLLOW_ID_in_identifier35];
182
183        }
184
185        /* token+rule list labels */
186
187    }
188    @catch (RecognitionException *re) {
189        [self reportError:re];
190        [self recover:input Exception:re];
191    }
192
193    @finally {
194        /* ruleScopeCleanUp */
195
196    }
197    return ;
198}
199/* $ANTLR end identifier */
200/* ObjC end rules */
201
202@end /* end of CombinedParser implementation line 692 */
203