// ------------------------------------------------------------------------------ // // This code was generated by Berp (http://https://github.com/gasparnagy/berp/). // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // // ------------------------------------------------------------------------------ #import "GHParser.h" #import "GHAstBuilder.h" #import "GHToken.h" #import "GHParserException.h" @implementation GHParserContext @synthesize tokenScanner; @synthesize tokenMatcher; @synthesize tokenQueue; @synthesize errors; @end @implementation GHParser { id astBuilder; } @synthesize stopAtFirstError; - (id)init { return [self initWithAstBuilder: [[GHAstBuilder alloc] init]]; } - (id)initWithAstBuilder:(id)theAstBuilder { if (self = [super init]) { astBuilder = theAstBuilder; } return self; } - (id)parseWithTokenScanner:(id)theTokenScanner { return [self parseWithTokenScanner: theTokenScanner tokenMatcher: [[GHTokenMatcher alloc] init]]; } - (id)parseWithTokenScanner:(id)theTokenScanner tokenMatcher:(id)theTokenMatcher { [theTokenMatcher reset]; [astBuilder reset]; GHParserContext * context = [[GHParserContext alloc] init]; [context setTokenScanner: theTokenScanner]; [context setTokenMatcher: theTokenMatcher]; [context setTokenQueue: [[NSMutableArray alloc] init]]; [context setErrors: [[NSMutableArray alloc] init]]; [self startRuleWithContext: context ruleType: GHRuleTypeFeature]; NSUInteger state = 0; GHToken * token; do { token = [self readTokenWithContext: context]; state = [self matchToken: token withState: state context: context]; } while(![token isEOF]); [self endRuleWithContext: context ruleType: GHRuleTypeFeature]; if ([[context errors] count]) { @throw [[GHCompositeParserException alloc] initWithErrors: [context errors]]; } return [self resultWithContext: context]; } - (void)addError:(GHParserException *)theParserError withContext:(GHParserContext *)theContext { [[theContext errors] addObject: theParserError]; if ([[theContext errors] count] > 10) @throw [[GHCompositeParserException alloc] initWithErrors: [theContext errors]]; } - (void)handleAstErrorWithContext:(GHParserContext *)theContext actionBlock:(void (^)())theActionBlock { [self handleExternalErrorWithContext: theContext actionBlock: ^() { theActionBlock(); return YES; } defaultValue: NO]; } - (BOOL)handleExternalErrorWithContext:(GHParserContext *)theContext actionBlock:(BOOL (^)())theActionBlock defaultValue:(BOOL)theDefaultValue { if (stopAtFirstError) { return theActionBlock(); } @try { return theActionBlock(); } @catch (GHCompositeParserException * compositeParserException) { for (GHParserException * error in [compositeParserException errors]) { [self addError: error withContext: theContext]; } } @catch (GHParserException * error) { [self addError: error withContext: theContext]; } return theDefaultValue; } - (void)buildWithContext:(GHParserContext *)theContext token:(GHToken *)theToken { [self handleAstErrorWithContext: theContext actionBlock: ^() { [astBuilder buildWithToken: theToken]; }]; } - (void)startRuleWithContext:(GHParserContext *)theContext ruleType:(GHRuleType)theRuleType { [self handleAstErrorWithContext: theContext actionBlock: ^() { [astBuilder startRuleWithType: theRuleType]; }]; } - (void)endRuleWithContext:(GHParserContext *)theContext ruleType:(GHRuleType)theRuleType { [self handleAstErrorWithContext: theContext actionBlock: ^() { [astBuilder endRuleWithType: theRuleType]; }]; } - (id)resultWithContext:(GHParserContext *)theContext { return [astBuilder result]; } - (GHToken *)readTokenWithContext:(GHParserContext *)theContext { if ([[theContext tokenQueue] count] > 0) { id firstObject = [[theContext tokenQueue] firstObject]; [[theContext tokenQueue] removeObjectAtIndex: 0]; return firstObject; } else return [[theContext tokenScanner] read]; } - (BOOL)matchEOFWithContext:(GHParserContext *)theContext token:(GHToken *)theToken { return [self handleExternalErrorWithContext: theContext actionBlock: ^() { return [[theContext tokenMatcher] matchEOFWithToken: theToken]; } defaultValue: NO]; } - (BOOL)matchEmptyWithContext:(GHParserContext *)theContext token:(GHToken *)theToken { if ([theToken isEOF]) return NO; return [self handleExternalErrorWithContext: theContext actionBlock: ^() { return [[theContext tokenMatcher] matchEmptyWithToken: theToken]; } defaultValue: NO]; } - (BOOL)matchCommentWithContext:(GHParserContext *)theContext token:(GHToken *)theToken { if ([theToken isEOF]) return NO; return [self handleExternalErrorWithContext: theContext actionBlock: ^() { return [[theContext tokenMatcher] matchCommentWithToken: theToken]; } defaultValue: NO]; } - (BOOL)matchTagLineWithContext:(GHParserContext *)theContext token:(GHToken *)theToken { if ([theToken isEOF]) return NO; return [self handleExternalErrorWithContext: theContext actionBlock: ^() { return [[theContext tokenMatcher] matchTagLineWithToken: theToken]; } defaultValue: NO]; } - (BOOL)matchFeatureLineWithContext:(GHParserContext *)theContext token:(GHToken *)theToken { if ([theToken isEOF]) return NO; return [self handleExternalErrorWithContext: theContext actionBlock: ^() { return [[theContext tokenMatcher] matchFeatureLineWithToken: theToken]; } defaultValue: NO]; } - (BOOL)matchBackgroundLineWithContext:(GHParserContext *)theContext token:(GHToken *)theToken { if ([theToken isEOF]) return NO; return [self handleExternalErrorWithContext: theContext actionBlock: ^() { return [[theContext tokenMatcher] matchBackgroundLineWithToken: theToken]; } defaultValue: NO]; } - (BOOL)matchScenarioLineWithContext:(GHParserContext *)theContext token:(GHToken *)theToken { if ([theToken isEOF]) return NO; return [self handleExternalErrorWithContext: theContext actionBlock: ^() { return [[theContext tokenMatcher] matchScenarioLineWithToken: theToken]; } defaultValue: NO]; } - (BOOL)matchScenarioOutlineLineWithContext:(GHParserContext *)theContext token:(GHToken *)theToken { if ([theToken isEOF]) return NO; return [self handleExternalErrorWithContext: theContext actionBlock: ^() { return [[theContext tokenMatcher] matchScenarioOutlineLineWithToken: theToken]; } defaultValue: NO]; } - (BOOL)matchExamplesLineWithContext:(GHParserContext *)theContext token:(GHToken *)theToken { if ([theToken isEOF]) return NO; return [self handleExternalErrorWithContext: theContext actionBlock: ^() { return [[theContext tokenMatcher] matchExamplesLineWithToken: theToken]; } defaultValue: NO]; } - (BOOL)matchStepLineWithContext:(GHParserContext *)theContext token:(GHToken *)theToken { if ([theToken isEOF]) return NO; return [self handleExternalErrorWithContext: theContext actionBlock: ^() { return [[theContext tokenMatcher] matchStepLineWithToken: theToken]; } defaultValue: NO]; } - (BOOL)matchDocStringSeparatorWithContext:(GHParserContext *)theContext token:(GHToken *)theToken { if ([theToken isEOF]) return NO; return [self handleExternalErrorWithContext: theContext actionBlock: ^() { return [[theContext tokenMatcher] matchDocStringSeparatorWithToken: theToken]; } defaultValue: NO]; } - (BOOL)matchTableRowWithContext:(GHParserContext *)theContext token:(GHToken *)theToken { if ([theToken isEOF]) return NO; return [self handleExternalErrorWithContext: theContext actionBlock: ^() { return [[theContext tokenMatcher] matchTableRowWithToken: theToken]; } defaultValue: NO]; } - (BOOL)matchLanguageWithContext:(GHParserContext *)theContext token:(GHToken *)theToken { if ([theToken isEOF]) return NO; return [self handleExternalErrorWithContext: theContext actionBlock: ^() { return [[theContext tokenMatcher] matchLanguageWithToken: theToken]; } defaultValue: NO]; } - (BOOL)matchOtherWithContext:(GHParserContext *)theContext token:(GHToken *)theToken { if ([theToken isEOF]) return NO; return [self handleExternalErrorWithContext: theContext actionBlock: ^() { return [[theContext tokenMatcher] matchOtherWithToken: theToken]; } defaultValue: NO]; } - (NSUInteger)matchToken:(GHToken *)theToken withState:(NSUInteger)theState context:(GHParserContext *)theContext { NSUInteger newState; switch (theState) { case 0: newState = [self matchTokenAt_0: theToken context: theContext]; break; case 1: newState = [self matchTokenAt_1: theToken context: theContext]; break; case 2: newState = [self matchTokenAt_2: theToken context: theContext]; break; case 3: newState = [self matchTokenAt_3: theToken context: theContext]; break; case 4: newState = [self matchTokenAt_4: theToken context: theContext]; break; case 5: newState = [self matchTokenAt_5: theToken context: theContext]; break; case 6: newState = [self matchTokenAt_6: theToken context: theContext]; break; case 7: newState = [self matchTokenAt_7: theToken context: theContext]; break; case 8: newState = [self matchTokenAt_8: theToken context: theContext]; break; case 9: newState = [self matchTokenAt_9: theToken context: theContext]; break; case 10: newState = [self matchTokenAt_10: theToken context: theContext]; break; case 11: newState = [self matchTokenAt_11: theToken context: theContext]; break; case 12: newState = [self matchTokenAt_12: theToken context: theContext]; break; case 13: newState = [self matchTokenAt_13: theToken context: theContext]; break; case 14: newState = [self matchTokenAt_14: theToken context: theContext]; break; case 15: newState = [self matchTokenAt_15: theToken context: theContext]; break; case 16: newState = [self matchTokenAt_16: theToken context: theContext]; break; case 17: newState = [self matchTokenAt_17: theToken context: theContext]; break; case 18: newState = [self matchTokenAt_18: theToken context: theContext]; break; case 19: newState = [self matchTokenAt_19: theToken context: theContext]; break; case 20: newState = [self matchTokenAt_20: theToken context: theContext]; break; case 21: newState = [self matchTokenAt_21: theToken context: theContext]; break; case 22: newState = [self matchTokenAt_22: theToken context: theContext]; break; case 23: newState = [self matchTokenAt_23: theToken context: theContext]; break; case 24: newState = [self matchTokenAt_24: theToken context: theContext]; break; case 25: newState = [self matchTokenAt_25: theToken context: theContext]; break; case 26: newState = [self matchTokenAt_26: theToken context: theContext]; break; case 28: newState = [self matchTokenAt_28: theToken context: theContext]; break; case 29: newState = [self matchTokenAt_29: theToken context: theContext]; break; case 30: newState = [self matchTokenAt_30: theToken context: theContext]; break; case 31: newState = [self matchTokenAt_31: theToken context: theContext]; break; case 32: newState = [self matchTokenAt_32: theToken context: theContext]; break; case 33: newState = [self matchTokenAt_33: theToken context: theContext]; break; default: @throw [NSException exceptionWithName: NSInvalidArgumentException reason: [@"Unknown state: " stringByAppendingFormat: @"%d", (int)theState] userInfo: nil]; } return newState; } // Start - (int)matchTokenAt_0:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchLanguageWithContext: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeFeature_Header]; [self buildWithContext: theContext token: theToken]; return 1; } if ([self matchTagLineWithContext: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeFeature_Header]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 2; } if ([self matchFeatureLineWithContext: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeFeature_Header]; [self buildWithContext: theContext token: theToken]; return 3; } if ([self matchCommentWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 0; } if ([self matchEmptyWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 0; } if(theToken.matchedType == GHTokenTypeNone){ return 0; } NSString * stateComment = @"State: 0 - Start"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#Language", @"#TagLine", @"#FeatureLine", @"#Comment", @"#Empty", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 0; } // Feature:0>Feature_Header:0>#Language:0 - (int)matchTokenAt_1:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchTagLineWithContext: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 2; } if ([self matchFeatureLineWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 3; } if ([self matchCommentWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 1; } if ([self matchEmptyWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 1; } NSString * stateComment = @"State: 1 - Feature:0>Feature_Header:0>#Language:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#TagLine", @"#FeatureLine", @"#Comment", @"#Empty", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 1; } // Feature:0>Feature_Header:1>Tags:0>#TagLine:0 - (int)matchTokenAt_2:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchTagLineWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 2; } if ([self matchFeatureLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 3; } if ([self matchCommentWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 2; } if ([self matchEmptyWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 2; } NSString * stateComment = @"State: 2 - Feature:0>Feature_Header:1>Tags:0>#TagLine:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#TagLine", @"#FeatureLine", @"#Comment", @"#Empty", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 2; } // Feature:0>Feature_Header:2>#FeatureLine:0 - (int)matchTokenAt_3:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchEOFWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeFeature_Header]; [self buildWithContext: theContext token: theToken]; return 27; } if ([self matchEmptyWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 3; } if ([self matchCommentWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 5; } if ([self matchBackgroundLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeFeature_Header]; [self startRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self buildWithContext: theContext token: theToken]; return 6; } if ([self matchTagLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeFeature_Header]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeFeature_Header]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeFeature_Header]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchOtherWithContext: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self buildWithContext: theContext token: theToken]; return 4; } NSString * stateComment = @"State: 3 - Feature:0>Feature_Header:2>#FeatureLine:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#EOF", @"#Empty", @"#Comment", @"#BackgroundLine", @"#TagLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Other", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 3; } // Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:1>Description:0>#Other:0 - (int)matchTokenAt_4:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchEOFWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self endRuleWithContext: theContext ruleType: GHRuleTypeFeature_Header]; [self buildWithContext: theContext token: theToken]; return 27; } if ([self matchCommentWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self buildWithContext: theContext token: theToken]; return 5; } if ([self matchBackgroundLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self endRuleWithContext: theContext ruleType: GHRuleTypeFeature_Header]; [self startRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self buildWithContext: theContext token: theToken]; return 6; } if ([self matchTagLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self endRuleWithContext: theContext ruleType: GHRuleTypeFeature_Header]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self endRuleWithContext: theContext ruleType: GHRuleTypeFeature_Header]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self endRuleWithContext: theContext ruleType: GHRuleTypeFeature_Header]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchOtherWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 4; } NSString * stateComment = @"State: 4 - Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:1>Description:0>#Other:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#EOF", @"#Comment", @"#BackgroundLine", @"#TagLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Other", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 4; } // Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:2>#Comment:0 - (int)matchTokenAt_5:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchEOFWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeFeature_Header]; [self buildWithContext: theContext token: theToken]; return 27; } if ([self matchCommentWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 5; } if ([self matchBackgroundLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeFeature_Header]; [self startRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self buildWithContext: theContext token: theToken]; return 6; } if ([self matchTagLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeFeature_Header]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeFeature_Header]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeFeature_Header]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchEmptyWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 5; } NSString * stateComment = @"State: 5 - Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:2>#Comment:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#EOF", @"#Comment", @"#BackgroundLine", @"#TagLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Empty", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 5; } // Feature:1>Background:0>#BackgroundLine:0 - (int)matchTokenAt_6:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchEOFWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self buildWithContext: theContext token: theToken]; return 27; } if ([self matchEmptyWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 6; } if ([self matchCommentWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 8; } if ([self matchStepLineWithContext: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self buildWithContext: theContext token: theToken]; return 9; } if ([self matchTagLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchOtherWithContext: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self buildWithContext: theContext token: theToken]; return 7; } NSString * stateComment = @"State: 6 - Feature:1>Background:0>#BackgroundLine:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#EOF", @"#Empty", @"#Comment", @"#StepLine", @"#TagLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Other", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 6; } // Feature:1>Background:1>Background_Description:0>Description_Helper:1>Description:0>#Other:0 - (int)matchTokenAt_7:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchEOFWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self endRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self buildWithContext: theContext token: theToken]; return 27; } if ([self matchCommentWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self buildWithContext: theContext token: theToken]; return 8; } if ([self matchStepLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self startRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self buildWithContext: theContext token: theToken]; return 9; } if ([self matchTagLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self endRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self endRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self endRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchOtherWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 7; } NSString * stateComment = @"State: 7 - Feature:1>Background:1>Background_Description:0>Description_Helper:1>Description:0>#Other:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#EOF", @"#Comment", @"#StepLine", @"#TagLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Other", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 7; } // Feature:1>Background:1>Background_Description:0>Description_Helper:2>#Comment:0 - (int)matchTokenAt_8:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchEOFWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self buildWithContext: theContext token: theToken]; return 27; } if ([self matchCommentWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 8; } if ([self matchStepLineWithContext: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self buildWithContext: theContext token: theToken]; return 9; } if ([self matchTagLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchEmptyWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 8; } NSString * stateComment = @"State: 8 - Feature:1>Background:1>Background_Description:0>Description_Helper:2>#Comment:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#EOF", @"#Comment", @"#StepLine", @"#TagLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Empty", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 8; } // Feature:1>Background:2>Scenario_Step:0>Step:0>#StepLine:0 - (int)matchTokenAt_9:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchEOFWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self buildWithContext: theContext token: theToken]; return 27; } if ([self matchTableRowWithContext: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeDataTable]; [self buildWithContext: theContext token: theToken]; return 10; } if ([self matchDocStringSeparatorWithContext: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeDocString]; [self buildWithContext: theContext token: theToken]; return 32; } if ([self matchStepLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self startRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self buildWithContext: theContext token: theToken]; return 9; } if ([self matchTagLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchCommentWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 9; } if ([self matchEmptyWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 9; } NSString * stateComment = @"State: 9 - Feature:1>Background:2>Scenario_Step:0>Step:0>#StepLine:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#EOF", @"#TableRow", @"#DocStringSeparator", @"#StepLine", @"#TagLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Comment", @"#Empty", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 9; } // Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0 - (int)matchTokenAt_10:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchEOFWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDataTable]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self buildWithContext: theContext token: theToken]; return 27; } if ([self matchTableRowWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 10; } if ([self matchStepLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDataTable]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self startRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self buildWithContext: theContext token: theToken]; return 9; } if ([self matchTagLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDataTable]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDataTable]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDataTable]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchCommentWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 10; } if ([self matchEmptyWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 10; } NSString * stateComment = @"State: 10 - Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#EOF", @"#TableRow", @"#StepLine", @"#TagLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Comment", @"#Empty", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 10; } // Feature:2>Scenario_Definition:0>Tags:0>#TagLine:0 - (int)matchTokenAt_11:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchTagLineWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchCommentWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchEmptyWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 11; } NSString * stateComment = @"State: 11 - Feature:2>Scenario_Definition:0>Tags:0>#TagLine:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#TagLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Comment", @"#Empty", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 11; } // Feature:2>Scenario_Definition:1>__alt0:0>Scenario:0>#ScenarioLine:0 - (int)matchTokenAt_12:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchEOFWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self buildWithContext: theContext token: theToken]; return 27; } if ([self matchEmptyWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchCommentWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 14; } if ([self matchStepLineWithContext: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self buildWithContext: theContext token: theToken]; return 15; } if ([self matchTagLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchOtherWithContext: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self buildWithContext: theContext token: theToken]; return 13; } NSString * stateComment = @"State: 12 - Feature:2>Scenario_Definition:1>__alt0:0>Scenario:0>#ScenarioLine:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#EOF", @"#Empty", @"#Comment", @"#StepLine", @"#TagLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Other", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 12; } // Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:1>Description:0>#Other:0 - (int)matchTokenAt_13:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchEOFWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self buildWithContext: theContext token: theToken]; return 27; } if ([self matchCommentWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self buildWithContext: theContext token: theToken]; return 14; } if ([self matchStepLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self startRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self buildWithContext: theContext token: theToken]; return 15; } if ([self matchTagLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchOtherWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 13; } NSString * stateComment = @"State: 13 - Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:1>Description:0>#Other:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#EOF", @"#Comment", @"#StepLine", @"#TagLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Other", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 13; } // Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:2>#Comment:0 - (int)matchTokenAt_14:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchEOFWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self buildWithContext: theContext token: theToken]; return 27; } if ([self matchCommentWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 14; } if ([self matchStepLineWithContext: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self buildWithContext: theContext token: theToken]; return 15; } if ([self matchTagLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchEmptyWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 14; } NSString * stateComment = @"State: 14 - Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:2>#Comment:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#EOF", @"#Comment", @"#StepLine", @"#TagLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Empty", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 14; } // Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:0>#StepLine:0 - (int)matchTokenAt_15:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchEOFWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self buildWithContext: theContext token: theToken]; return 27; } if ([self matchTableRowWithContext: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeDataTable]; [self buildWithContext: theContext token: theToken]; return 16; } if ([self matchDocStringSeparatorWithContext: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeDocString]; [self buildWithContext: theContext token: theToken]; return 30; } if ([self matchStepLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self startRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self buildWithContext: theContext token: theToken]; return 15; } if ([self matchTagLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchCommentWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 15; } if ([self matchEmptyWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 15; } NSString * stateComment = @"State: 15 - Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:0>#StepLine:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#EOF", @"#TableRow", @"#DocStringSeparator", @"#StepLine", @"#TagLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Comment", @"#Empty", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 15; } // Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0 - (int)matchTokenAt_16:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchEOFWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDataTable]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self buildWithContext: theContext token: theToken]; return 27; } if ([self matchTableRowWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 16; } if ([self matchStepLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDataTable]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self startRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self buildWithContext: theContext token: theToken]; return 15; } if ([self matchTagLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDataTable]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDataTable]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDataTable]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchCommentWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 16; } if ([self matchEmptyWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 16; } NSString * stateComment = @"State: 16 - Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#EOF", @"#TableRow", @"#StepLine", @"#TagLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Comment", @"#Empty", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 16; } // Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:0>#ScenarioOutlineLine:0 - (int)matchTokenAt_17:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchEOFWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self buildWithContext: theContext token: theToken]; return 27; } if ([self matchEmptyWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchCommentWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 19; } if ([self matchStepLineWithContext: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self buildWithContext: theContext token: theToken]; return 20; } if ([self matchTagLineWithContext: theContext token: theToken]) { if ([self lookAheadWithContext_0: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 22; } } if ([self matchTagLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchExamplesLineWithContext: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self buildWithContext: theContext token: theToken]; return 23; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchOtherWithContext: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self buildWithContext: theContext token: theToken]; return 18; } NSString * stateComment = @"State: 17 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:0>#ScenarioOutlineLine:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#EOF", @"#Empty", @"#Comment", @"#StepLine", @"#TagLine", @"#ExamplesLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Other", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 17; } // Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>ScenarioOutline_Description:0>Description_Helper:1>Description:0>#Other:0 - (int)matchTokenAt_18:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchEOFWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self buildWithContext: theContext token: theToken]; return 27; } if ([self matchCommentWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self buildWithContext: theContext token: theToken]; return 19; } if ([self matchStepLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self startRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self buildWithContext: theContext token: theToken]; return 20; } if ([self matchTagLineWithContext: theContext token: theToken]) { if ([self lookAheadWithContext_0: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 22; } } if ([self matchTagLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchExamplesLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self buildWithContext: theContext token: theToken]; return 23; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchOtherWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 18; } NSString * stateComment = @"State: 18 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>ScenarioOutline_Description:0>Description_Helper:1>Description:0>#Other:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#EOF", @"#Comment", @"#StepLine", @"#TagLine", @"#ExamplesLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Other", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 18; } // Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>ScenarioOutline_Description:0>Description_Helper:2>#Comment:0 - (int)matchTokenAt_19:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchEOFWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self buildWithContext: theContext token: theToken]; return 27; } if ([self matchCommentWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 19; } if ([self matchStepLineWithContext: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self buildWithContext: theContext token: theToken]; return 20; } if ([self matchTagLineWithContext: theContext token: theToken]) { if ([self lookAheadWithContext_0: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 22; } } if ([self matchTagLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchExamplesLineWithContext: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self buildWithContext: theContext token: theToken]; return 23; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchEmptyWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 19; } NSString * stateComment = @"State: 19 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>ScenarioOutline_Description:0>Description_Helper:2>#Comment:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#EOF", @"#Comment", @"#StepLine", @"#TagLine", @"#ExamplesLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Empty", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 19; } // Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:0>#StepLine:0 - (int)matchTokenAt_20:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchEOFWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self buildWithContext: theContext token: theToken]; return 27; } if ([self matchTableRowWithContext: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeDataTable]; [self buildWithContext: theContext token: theToken]; return 21; } if ([self matchDocStringSeparatorWithContext: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeDocString]; [self buildWithContext: theContext token: theToken]; return 28; } if ([self matchStepLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self startRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self buildWithContext: theContext token: theToken]; return 20; } if ([self matchTagLineWithContext: theContext token: theToken]) { if ([self lookAheadWithContext_0: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 22; } } if ([self matchTagLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchExamplesLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self buildWithContext: theContext token: theToken]; return 23; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchCommentWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 20; } if ([self matchEmptyWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 20; } NSString * stateComment = @"State: 20 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:0>#StepLine:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#EOF", @"#TableRow", @"#DocStringSeparator", @"#StepLine", @"#TagLine", @"#ExamplesLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Comment", @"#Empty", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 20; } // Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0 - (int)matchTokenAt_21:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchEOFWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDataTable]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self buildWithContext: theContext token: theToken]; return 27; } if ([self matchTableRowWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 21; } if ([self matchStepLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDataTable]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self startRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self buildWithContext: theContext token: theToken]; return 20; } if ([self matchTagLineWithContext: theContext token: theToken]) { if ([self lookAheadWithContext_0: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDataTable]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 22; } } if ([self matchTagLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDataTable]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchExamplesLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDataTable]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self buildWithContext: theContext token: theToken]; return 23; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDataTable]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDataTable]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchCommentWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 21; } if ([self matchEmptyWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 21; } NSString * stateComment = @"State: 21 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#EOF", @"#TableRow", @"#StepLine", @"#TagLine", @"#ExamplesLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Comment", @"#Empty", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 21; } // Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:0>Tags:0>#TagLine:0 - (int)matchTokenAt_22:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchTagLineWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 22; } if ([self matchExamplesLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self buildWithContext: theContext token: theToken]; return 23; } if ([self matchCommentWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 22; } if ([self matchEmptyWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 22; } NSString * stateComment = @"State: 22 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:0>Tags:0>#TagLine:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#TagLine", @"#ExamplesLine", @"#Comment", @"#Empty", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 22; } // Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:0>#ExamplesLine:0 - (int)matchTokenAt_23:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchEOFWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self buildWithContext: theContext token: theToken]; return 27; } if ([self matchEmptyWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 23; } if ([self matchCommentWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 25; } if ([self matchTableRowWithContext: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples_Table]; [self buildWithContext: theContext token: theToken]; return 26; } if ([self matchTagLineWithContext: theContext token: theToken]) { if ([self lookAheadWithContext_0: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 22; } } if ([self matchTagLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchExamplesLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self buildWithContext: theContext token: theToken]; return 23; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchOtherWithContext: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self buildWithContext: theContext token: theToken]; return 24; } NSString * stateComment = @"State: 23 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:0>#ExamplesLine:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#EOF", @"#Empty", @"#Comment", @"#TableRow", @"#TagLine", @"#ExamplesLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Other", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 23; } // Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Examples_Description:0>Description_Helper:1>Description:0>#Other:0 - (int)matchTokenAt_24:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchEOFWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self buildWithContext: theContext token: theToken]; return 27; } if ([self matchCommentWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self buildWithContext: theContext token: theToken]; return 25; } if ([self matchTableRowWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples_Table]; [self buildWithContext: theContext token: theToken]; return 26; } if ([self matchTagLineWithContext: theContext token: theToken]) { if ([self lookAheadWithContext_0: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 22; } } if ([self matchTagLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchExamplesLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self buildWithContext: theContext token: theToken]; return 23; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDescription]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchOtherWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 24; } NSString * stateComment = @"State: 24 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Examples_Description:0>Description_Helper:1>Description:0>#Other:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#EOF", @"#Comment", @"#TableRow", @"#TagLine", @"#ExamplesLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Other", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 24; } // Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Examples_Description:0>Description_Helper:2>#Comment:0 - (int)matchTokenAt_25:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchEOFWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self buildWithContext: theContext token: theToken]; return 27; } if ([self matchCommentWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 25; } if ([self matchTableRowWithContext: theContext token: theToken]) { [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples_Table]; [self buildWithContext: theContext token: theToken]; return 26; } if ([self matchTagLineWithContext: theContext token: theToken]) { if ([self lookAheadWithContext_0: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 22; } } if ([self matchTagLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchExamplesLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self buildWithContext: theContext token: theToken]; return 23; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchEmptyWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 25; } NSString * stateComment = @"State: 25 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Examples_Description:0>Description_Helper:2>#Comment:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#EOF", @"#Comment", @"#TableRow", @"#TagLine", @"#ExamplesLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Empty", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 25; } // Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:2>Examples_Table:0>#TableRow:0 - (int)matchTokenAt_26:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchEOFWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Table]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self buildWithContext: theContext token: theToken]; return 27; } if ([self matchTableRowWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 26; } if ([self matchTagLineWithContext: theContext token: theToken]) { if ([self lookAheadWithContext_0: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Table]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 22; } } if ([self matchTagLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Table]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchExamplesLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Table]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self buildWithContext: theContext token: theToken]; return 23; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Table]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Table]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self endRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchCommentWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 26; } if ([self matchEmptyWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 26; } NSString * stateComment = @"State: 26 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:2>Examples_Table:0>#TableRow:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#EOF", @"#TableRow", @"#TagLine", @"#ExamplesLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Comment", @"#Empty", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 26; } // Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0 - (int)matchTokenAt_28:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchDocStringSeparatorWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 29; } if ([self matchOtherWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 28; } NSString * stateComment = @"State: 28 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#DocStringSeparator", @"#Other", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 28; } // Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0 - (int)matchTokenAt_29:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchEOFWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDocString]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self buildWithContext: theContext token: theToken]; return 27; } if ([self matchStepLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDocString]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self startRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self buildWithContext: theContext token: theToken]; return 20; } if ([self matchTagLineWithContext: theContext token: theToken]) { if ([self lookAheadWithContext_0: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDocString]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 22; } } if ([self matchTagLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDocString]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchExamplesLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDocString]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeExamples]; [self buildWithContext: theContext token: theToken]; return 23; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDocString]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDocString]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchCommentWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 29; } if ([self matchEmptyWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 29; } NSString * stateComment = @"State: 29 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#EOF", @"#StepLine", @"#TagLine", @"#ExamplesLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Comment", @"#Empty", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 29; } // Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0 - (int)matchTokenAt_30:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchDocStringSeparatorWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 31; } if ([self matchOtherWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 30; } NSString * stateComment = @"State: 30 - Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#DocStringSeparator", @"#Other", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 30; } // Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0 - (int)matchTokenAt_31:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchEOFWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDocString]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self buildWithContext: theContext token: theToken]; return 27; } if ([self matchStepLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDocString]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self startRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self buildWithContext: theContext token: theToken]; return 15; } if ([self matchTagLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDocString]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDocString]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDocString]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self endRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchCommentWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 31; } if ([self matchEmptyWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 31; } NSString * stateComment = @"State: 31 - Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#EOF", @"#StepLine", @"#TagLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Comment", @"#Empty", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 31; } // Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0 - (int)matchTokenAt_32:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchDocStringSeparatorWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 33; } if ([self matchOtherWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 32; } NSString * stateComment = @"State: 32 - Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#DocStringSeparator", @"#Other", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 32; } // Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0 - (int)matchTokenAt_33:(GHToken *)theToken context:(GHParserContext *)theContext { if ([self matchEOFWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDocString]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self buildWithContext: theContext token: theToken]; return 27; } if ([self matchStepLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDocString]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self startRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self buildWithContext: theContext token: theToken]; return 9; } if ([self matchTagLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDocString]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeTags]; [self buildWithContext: theContext token: theToken]; return 11; } if ([self matchScenarioLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDocString]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario]; [self buildWithContext: theContext token: theToken]; return 12; } if ([self matchScenarioOutlineLineWithContext: theContext token: theToken]) { [self endRuleWithContext: theContext ruleType: GHRuleTypeDocString]; [self endRuleWithContext: theContext ruleType: GHRuleTypeStep]; [self endRuleWithContext: theContext ruleType: GHRuleTypeBackground]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenario_Definition]; [self startRuleWithContext: theContext ruleType: GHRuleTypeScenarioOutline]; [self buildWithContext: theContext token: theToken]; return 17; } if ([self matchCommentWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 33; } if ([self matchEmptyWithContext: theContext token: theToken]) { [self buildWithContext: theContext token: theToken]; return 33; } NSString * stateComment = @"State: 33 - Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0"; [theToken detach]; NSArray * expectedTokens = [[NSArray alloc] initWithObjects: @"#EOF", @"#StepLine", @"#TagLine", @"#ScenarioLine", @"#ScenarioOutlineLine", @"#Comment", @"#Empty", nil]; id error = [theToken isEOF] ? (GHParserException *)[[GHUnexpectedEOFException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment] : [[GHUnexpectedTokenException alloc] initWithToken: theToken expectedTokenTypes: expectedTokens stateComment: stateComment]; if (stopAtFirstError) @throw error; [self addError: error withContext: theContext]; return 33; } - (BOOL)lookAheadWithContext_0:(GHParserContext *)theContext token:(GHToken *)currentToken { [currentToken detach]; GHToken * theToken; NSMutableArray * tokenBuffer = [[NSMutableArray alloc] init]; BOOL match = NO; do { theToken = [self readTokenWithContext: theContext]; [theToken detach]; [tokenBuffer addObject: theToken]; if (NO || [self matchExamplesLineWithContext: theContext token: theToken] ) { match = YES; break; } } while (NO || [self matchEmptyWithContext: theContext token: theToken] || [self matchCommentWithContext: theContext token: theToken] || [self matchTagLineWithContext: theContext token: theToken] ); for (GHToken * token in tokenBuffer) { [[theContext tokenQueue] addObject: token]; } return match; } @end