203 lines
6.0 KiB
Objective-C
203 lines
6.0 KiB
Objective-C
/** \file
|
|
* This OBJC source file was generated by $ANTLR version 3.4
|
|
*
|
|
* - From the grammar source file : /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/combined/Combined.g
|
|
* - On : 2012-02-16 17:33:49
|
|
* - for the parser : CombinedParserParser
|
|
*
|
|
* Editing it, at least manually, is not wise.
|
|
*
|
|
* ObjC language generator and runtime by Alan Condit, acondit|hereisanat|ipns|dotgoeshere|com.
|
|
*
|
|
*
|
|
*/
|
|
// $ANTLR 3.4 /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/combined/Combined.g 2012-02-16 17:33:49
|
|
|
|
|
|
/* -----------------------------------------
|
|
* Include the ANTLR3 generated header file.
|
|
*/
|
|
#import "CombinedParser.h"
|
|
/* ----------------------------------------- */
|
|
|
|
|
|
/* ============================================================================= */
|
|
/* =============================================================================
|
|
* Start of recognizer
|
|
*/
|
|
|
|
#pragma mark Bitsets
|
|
static ANTLRBitSet *FOLLOW_identifier_in_stat20;
|
|
static const unsigned long long FOLLOW_identifier_in_stat20_data[] = { 0x0000000000000012LL};
|
|
static ANTLRBitSet *FOLLOW_ID_in_identifier35;
|
|
static const unsigned long long FOLLOW_ID_in_identifier35_data[] = { 0x0000000000000002LL};
|
|
|
|
|
|
#pragma mark Dynamic Global globalAttributeScopeImplementation
|
|
|
|
#pragma mark Dynamic Rule Scopes ruleAttributeScopeImplementation
|
|
|
|
#pragma mark Rule Return Scopes returnScopeImplementation
|
|
|
|
@implementation CombinedParser // line 637
|
|
|
|
/* ObjC start of ruleAttributeScope */
|
|
#pragma mark Dynamic Rule Scopes ruleAttributeScope
|
|
/* ObjC end of ruleAttributeScope */
|
|
#pragma mark global Attribute Scopes globalAttributeScope
|
|
/* ObjC start globalAttributeScope */
|
|
/* ObjC end globalAttributeScope */
|
|
/* ObjC start actions.(actionScope).synthesize */
|
|
/* ObjC start synthesize() */
|
|
|
|
+ (void) initialize
|
|
{
|
|
#pragma mark Bitsets
|
|
FOLLOW_identifier_in_stat20 = [[ANTLRBitSet newBitSetWithBits:(const unsigned long long *)FOLLOW_identifier_in_stat20_data Count:(NSUInteger)1] retain];
|
|
FOLLOW_ID_in_identifier35 = [[ANTLRBitSet newBitSetWithBits:(const unsigned long long *)FOLLOW_ID_in_identifier35_data Count:(NSUInteger)1] retain];
|
|
|
|
[BaseRecognizer setTokenNames:[[AMutableArray arrayWithObjects:@"<invalid>", @"<EOR>", @"<DOWN>", @"<UP>",
|
|
@"ID", @"INT", @"WS", nil] retain]];
|
|
[BaseRecognizer setGrammarFileName:@"/Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/combined/Combined.g"];
|
|
}
|
|
|
|
+ (CombinedParser *)newCombinedParser:(id<TokenStream>)aStream
|
|
{
|
|
return [[CombinedParser alloc] initWithTokenStream:aStream];
|
|
}
|
|
|
|
- (id) initWithTokenStream:(id<TokenStream>)aStream
|
|
{
|
|
self = [super initWithTokenStream:aStream State:[[RecognizerSharedState newRecognizerSharedStateWithRuleLen:2+1] retain]];
|
|
if ( self != nil ) {
|
|
/* start of actions-actionScope-init */
|
|
/* start of init */
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (void) dealloc
|
|
{
|
|
[super dealloc];
|
|
}
|
|
|
|
/* ObjC start actions.(actionScope).methods */
|
|
/* ObjC end actions.(actionScope).methods */
|
|
/* ObjC start methods() */
|
|
/* ObjC end methods() */
|
|
/* ObjC start rules */
|
|
/*
|
|
* $ANTLR start stat
|
|
* /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/combined/Combined.g:7:1: stat : ( identifier )+ ;
|
|
*/
|
|
- (void) stat
|
|
{
|
|
/* ruleScopeSetUp */
|
|
|
|
/* ruleDeclarations */
|
|
|
|
@try {
|
|
/* ruleLabelDefs entry */
|
|
|
|
|
|
// /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/combined/Combined.g:7:5: ( ( identifier )+ ) // ruleBlockSingleAlt
|
|
// /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/combined/Combined.g:7:7: ( identifier )+ // alt
|
|
{
|
|
|
|
// /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/combined/Combined.g:7:7: ( identifier )+ // positiveClosureBlock
|
|
NSInteger cnt1 = 0;
|
|
do {
|
|
NSInteger alt1 = 2;
|
|
NSInteger LA1_0 = [input LA:1];
|
|
if ( (LA1_0==ID) ) {
|
|
alt1=1;
|
|
}
|
|
|
|
|
|
switch (alt1) {
|
|
case 1 : ;
|
|
// /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/combined/Combined.g:7:7: identifier // alt
|
|
{
|
|
|
|
/* ruleRef */
|
|
[self pushFollow:FOLLOW_identifier_in_stat20];
|
|
[self identifier];
|
|
|
|
[self popFollow];
|
|
|
|
|
|
|
|
}
|
|
break;
|
|
|
|
default :
|
|
if ( cnt1 >= 1 )
|
|
goto loop1;
|
|
EarlyExitException *eee =
|
|
[EarlyExitException newException:input decisionNumber:1];
|
|
@throw eee;
|
|
}
|
|
cnt1++;
|
|
} while (YES);
|
|
loop1: ;
|
|
|
|
|
|
}
|
|
|
|
/* token+rule list labels */
|
|
|
|
}
|
|
@catch (RecognitionException *re) {
|
|
[self reportError:re];
|
|
[self recover:input Exception:re];
|
|
}
|
|
|
|
@finally {
|
|
/* ruleScopeCleanUp */
|
|
|
|
}
|
|
return ;
|
|
}
|
|
/* $ANTLR end stat */
|
|
|
|
/*
|
|
* $ANTLR start identifier
|
|
* /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/combined/Combined.g:9:1: identifier : ID ;
|
|
*/
|
|
- (void) identifier
|
|
{
|
|
/* ruleScopeSetUp */
|
|
|
|
/* ruleDeclarations */
|
|
|
|
@try {
|
|
/* ruleLabelDefs entry */
|
|
|
|
|
|
// /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/combined/Combined.g:10:5: ( ID ) // ruleBlockSingleAlt
|
|
// /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/combined/Combined.g:10:7: ID // alt
|
|
{
|
|
|
|
[self match:input TokenType:ID Follow:FOLLOW_ID_in_identifier35];
|
|
|
|
}
|
|
|
|
/* token+rule list labels */
|
|
|
|
}
|
|
@catch (RecognitionException *re) {
|
|
[self reportError:re];
|
|
[self recover:input Exception:re];
|
|
}
|
|
|
|
@finally {
|
|
/* ruleScopeCleanUp */
|
|
|
|
}
|
|
return ;
|
|
}
|
|
/* $ANTLR end identifier */
|
|
/* ObjC end rules */
|
|
|
|
@end /* end of CombinedParser implementation line 692 */
|