gherkin3 3.0.0.alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,66 @@
1
+ module Gherkin3
2
+ class GherkinLine
3
+ attr_reader :indent, :trimmed_line_text
4
+ def initialize(line_text, line_number)
5
+ @line_text = line_text
6
+ @line_number = line_number
7
+ @trimmed_line_text = @line_text.lstrip
8
+ @indent = @line_text.length - @trimmed_line_text.length
9
+ end
10
+
11
+ def start_with?(prefix)
12
+ @trimmed_line_text.start_with?(prefix)
13
+ end
14
+
15
+ def start_with_title_keyword?(keyword)
16
+ start_with?(keyword+':') # The C# impl is more complicated. Find out why.
17
+ end
18
+
19
+ def get_rest_trimmed(length)
20
+ @trimmed_line_text[length..-1].strip
21
+ end
22
+
23
+ def empty?
24
+ @trimmed_line_text.empty?
25
+ end
26
+
27
+ def get_line_text(indent_to_remove)
28
+ indent_to_remove ||= 0
29
+ if indent_to_remove < 0 || indent_to_remove > indent
30
+ @trimmed_line_text
31
+ else
32
+ @line_text[indent_to_remove..-1]
33
+ end
34
+ end
35
+
36
+ def table_cells
37
+ column = @indent + 1
38
+ items = @trimmed_line_text.split('|')
39
+ if @trimmed_line_text[-1] == '|'
40
+ items = items[1..-1] # There is no space after last |, only skip space before first |
41
+ else
42
+ items = items[1..-2] # Skip space before and after outer |
43
+ end
44
+ items.map do |item|
45
+ cell_indent = item.length - item.lstrip.length + 1
46
+ span = Span.new(column + cell_indent, item.strip)
47
+ column += item.length + 1
48
+ span
49
+ end
50
+ end
51
+
52
+ def tags
53
+ column = @indent + 1;
54
+ items = @trimmed_line_text.strip.split('@')
55
+ items = items[1..-1] # ignore before the first @
56
+ items.map do |item|
57
+ length = item.length
58
+ span = Span.new(column, '@' + item.strip)
59
+ column += length + 1
60
+ span
61
+ end
62
+ end
63
+
64
+ class Span < Struct.new(:column, :text); end
65
+ end
66
+ end
@@ -0,0 +1,1903 @@
1
+ # This file is generated. Do not edit! Edit gherkin-ruby.razor instead.
2
+ require_relative 'ast_builder'
3
+ require_relative 'token_matcher'
4
+ require_relative 'errors'
5
+
6
+ module Gherkin3
7
+
8
+ RULE_TYPE = [
9
+ :None,
10
+ :_EOF, # #EOF
11
+ :_Empty, # #Empty
12
+ :_Comment, # #Comment
13
+ :_TagLine, # #TagLine
14
+ :_FeatureLine, # #FeatureLine
15
+ :_BackgroundLine, # #BackgroundLine
16
+ :_ScenarioLine, # #ScenarioLine
17
+ :_ScenarioOutlineLine, # #ScenarioOutlineLine
18
+ :_ExamplesLine, # #ExamplesLine
19
+ :_StepLine, # #StepLine
20
+ :_DocStringSeparator, # #DocStringSeparator
21
+ :_TableRow, # #TableRow
22
+ :_Language, # #Language
23
+ :_Other, # #Other
24
+ :Feature, # Feature! := Feature_Header Background? Scenario_Definition*
25
+ :Feature_Header, # Feature_Header! := #Language? Tags? #FeatureLine Feature_Description
26
+ :Background, # Background! := #BackgroundLine Background_Description Scenario_Step*
27
+ :Scenario_Definition, # Scenario_Definition! := Tags? (Scenario | ScenarioOutline)
28
+ :Scenario, # Scenario! := #ScenarioLine Scenario_Description Scenario_Step*
29
+ :ScenarioOutline, # ScenarioOutline! := #ScenarioOutlineLine ScenarioOutline_Description ScenarioOutline_Step* Examples_Definition+
30
+ :Examples_Definition, # Examples_Definition! [#Empty|#Comment|#TagLine-&gt;#ExamplesLine] := Tags? Examples
31
+ :Examples, # Examples! := #ExamplesLine Examples_Description #TableRow #TableRow+
32
+ :Scenario_Step, # Scenario_Step := Step
33
+ :ScenarioOutline_Step, # ScenarioOutline_Step := Step
34
+ :Step, # Step! := #StepLine Step_Arg?
35
+ :Step_Arg, # Step_Arg := (DataTable | DocString)
36
+ :DataTable, # DataTable! := #TableRow+
37
+ :DocString, # DocString! := #DocStringSeparator #Other* #DocStringSeparator
38
+ :Tags, # Tags! := #TagLine+
39
+ :Feature_Description, # Feature_Description := Description_Helper
40
+ :Background_Description, # Background_Description := Description_Helper
41
+ :Scenario_Description, # Scenario_Description := Description_Helper
42
+ :ScenarioOutline_Description, # ScenarioOutline_Description := Description_Helper
43
+ :Examples_Description, # Examples_Description := Description_Helper
44
+ :Description_Helper, # Description_Helper := #Empty* Description? #Comment*
45
+ :Description, # Description! := #Other+
46
+ ]
47
+
48
+ class ParserContext
49
+ attr_reader :token_scanner, :ast_builder, :token_matcher, :token_queue, :errors
50
+
51
+ def initialize(token_scanner, ast_builder, token_matcher, token_queue, errors)
52
+ @token_scanner = token_scanner
53
+ @ast_builder = ast_builder
54
+ @token_matcher = token_matcher
55
+ @token_queue = token_queue
56
+ @errors = errors
57
+ end
58
+ end
59
+
60
+ class Parser
61
+ attr_accessor :stop_at_first_error
62
+
63
+ def parse(token_scanner, ast_builder=AstBuilder.new, token_matcher=TokenMatcher.new)
64
+ context = ParserContext.new(
65
+ token_scanner,
66
+ ast_builder,
67
+ token_matcher,
68
+ [],
69
+ []
70
+ )
71
+
72
+ start_rule(context, :Feature);
73
+ state = 0
74
+ token = nil
75
+ begin
76
+ token = read_token(context)
77
+ state = match_token(state, token, context)
78
+ end until(token.eof?)
79
+
80
+ end_rule(context, :Feature)
81
+
82
+ raise CompositeParserException.new(context.errors) if context.errors.any?
83
+
84
+ get_result(context)
85
+ end
86
+
87
+ def build(context, token)
88
+ handle_ast_error(context) do
89
+ context.ast_builder.build(token)
90
+ end
91
+ end
92
+
93
+ def add_error(context, error)
94
+ context.errors.push(error)
95
+ raise CompositeParserException, context.errors if context.errors.length > 10
96
+ end
97
+
98
+ def start_rule(context, rule_type)
99
+ handle_ast_error(context) do
100
+ context.ast_builder.start_rule(rule_type)
101
+ end
102
+ end
103
+
104
+ def end_rule(context, rule_type)
105
+ handle_ast_error(context) do
106
+ context.ast_builder.end_rule(rule_type)
107
+ end
108
+ end
109
+
110
+ def get_result(context)
111
+ context.ast_builder.get_result
112
+ end
113
+
114
+ def read_token(context)
115
+ context.token_queue.any? ? context.token_queue.shift : context.token_scanner.read
116
+ end
117
+
118
+
119
+ def match_EOF( context, token)
120
+ return handle_external_error(context, false) do
121
+ context.token_matcher.match_EOF(token)
122
+ end
123
+ end
124
+
125
+ def match_Empty( context, token)
126
+ return false if token.eof?
127
+ return handle_external_error(context, false) do
128
+ context.token_matcher.match_Empty(token)
129
+ end
130
+ end
131
+
132
+ def match_Comment( context, token)
133
+ return false if token.eof?
134
+ return handle_external_error(context, false) do
135
+ context.token_matcher.match_Comment(token)
136
+ end
137
+ end
138
+
139
+ def match_TagLine( context, token)
140
+ return false if token.eof?
141
+ return handle_external_error(context, false) do
142
+ context.token_matcher.match_TagLine(token)
143
+ end
144
+ end
145
+
146
+ def match_FeatureLine( context, token)
147
+ return false if token.eof?
148
+ return handle_external_error(context, false) do
149
+ context.token_matcher.match_FeatureLine(token)
150
+ end
151
+ end
152
+
153
+ def match_BackgroundLine( context, token)
154
+ return false if token.eof?
155
+ return handle_external_error(context, false) do
156
+ context.token_matcher.match_BackgroundLine(token)
157
+ end
158
+ end
159
+
160
+ def match_ScenarioLine( context, token)
161
+ return false if token.eof?
162
+ return handle_external_error(context, false) do
163
+ context.token_matcher.match_ScenarioLine(token)
164
+ end
165
+ end
166
+
167
+ def match_ScenarioOutlineLine( context, token)
168
+ return false if token.eof?
169
+ return handle_external_error(context, false) do
170
+ context.token_matcher.match_ScenarioOutlineLine(token)
171
+ end
172
+ end
173
+
174
+ def match_ExamplesLine( context, token)
175
+ return false if token.eof?
176
+ return handle_external_error(context, false) do
177
+ context.token_matcher.match_ExamplesLine(token)
178
+ end
179
+ end
180
+
181
+ def match_StepLine( context, token)
182
+ return false if token.eof?
183
+ return handle_external_error(context, false) do
184
+ context.token_matcher.match_StepLine(token)
185
+ end
186
+ end
187
+
188
+ def match_DocStringSeparator( context, token)
189
+ return false if token.eof?
190
+ return handle_external_error(context, false) do
191
+ context.token_matcher.match_DocStringSeparator(token)
192
+ end
193
+ end
194
+
195
+ def match_TableRow( context, token)
196
+ return false if token.eof?
197
+ return handle_external_error(context, false) do
198
+ context.token_matcher.match_TableRow(token)
199
+ end
200
+ end
201
+
202
+ def match_Language( context, token)
203
+ return false if token.eof?
204
+ return handle_external_error(context, false) do
205
+ context.token_matcher.match_Language(token)
206
+ end
207
+ end
208
+
209
+ def match_Other( context, token)
210
+ return false if token.eof?
211
+ return handle_external_error(context, false) do
212
+ context.token_matcher.match_Other(token)
213
+ end
214
+ end
215
+
216
+ def match_token(state, token, context)
217
+ case state
218
+ when 0
219
+ match_token_at_0(token, context)
220
+ when 1
221
+ match_token_at_1(token, context)
222
+ when 2
223
+ match_token_at_2(token, context)
224
+ when 3
225
+ match_token_at_3(token, context)
226
+ when 4
227
+ match_token_at_4(token, context)
228
+ when 5
229
+ match_token_at_5(token, context)
230
+ when 6
231
+ match_token_at_6(token, context)
232
+ when 7
233
+ match_token_at_7(token, context)
234
+ when 8
235
+ match_token_at_8(token, context)
236
+ when 9
237
+ match_token_at_9(token, context)
238
+ when 10
239
+ match_token_at_10(token, context)
240
+ when 11
241
+ match_token_at_11(token, context)
242
+ when 12
243
+ match_token_at_12(token, context)
244
+ when 13
245
+ match_token_at_13(token, context)
246
+ when 14
247
+ match_token_at_14(token, context)
248
+ when 15
249
+ match_token_at_15(token, context)
250
+ when 16
251
+ match_token_at_16(token, context)
252
+ when 17
253
+ match_token_at_17(token, context)
254
+ when 18
255
+ match_token_at_18(token, context)
256
+ when 19
257
+ match_token_at_19(token, context)
258
+ when 20
259
+ match_token_at_20(token, context)
260
+ when 21
261
+ match_token_at_21(token, context)
262
+ when 22
263
+ match_token_at_22(token, context)
264
+ when 23
265
+ match_token_at_23(token, context)
266
+ when 24
267
+ match_token_at_24(token, context)
268
+ when 25
269
+ match_token_at_25(token, context)
270
+ when 26
271
+ match_token_at_26(token, context)
272
+ when 27
273
+ match_token_at_27(token, context)
274
+ when 29
275
+ match_token_at_29(token, context)
276
+ when 30
277
+ match_token_at_30(token, context)
278
+ when 31
279
+ match_token_at_31(token, context)
280
+ when 32
281
+ match_token_at_32(token, context)
282
+ when 33
283
+ match_token_at_33(token, context)
284
+ when 34
285
+ match_token_at_34(token, context)
286
+ else
287
+ raise InvalidOperationException, "Unknown state: #{state}"
288
+ end
289
+ end
290
+
291
+
292
+ # Start
293
+ def match_token_at_0(token, context)
294
+ if match_Language(context, token)
295
+ start_rule(context, :Feature_Header);
296
+ build(context, token);
297
+ return 1
298
+ end
299
+ if match_TagLine(context, token)
300
+ start_rule(context, :Feature_Header);
301
+ start_rule(context, :Tags);
302
+ build(context, token);
303
+ return 2
304
+ end
305
+ if match_FeatureLine(context, token)
306
+ start_rule(context, :Feature_Header);
307
+ build(context, token);
308
+ return 3
309
+ end
310
+ if match_Comment(context, token)
311
+ build(context, token);
312
+ return 0
313
+ end
314
+ if match_Empty(context, token)
315
+ build(context, token);
316
+ return 0
317
+ end
318
+
319
+ state_comment = "State: 0 - Start"
320
+ token.detach
321
+ expected_tokens = ["#Language", "#TagLine", "#FeatureLine", "#Comment", "#Empty"]
322
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
323
+ raise error if (stop_at_first_error)
324
+ add_error(context, error)
325
+ return 0
326
+ end
327
+
328
+ # Feature:0>Feature_Header:0>#Language:0
329
+ def match_token_at_1(token, context)
330
+ if match_TagLine(context, token)
331
+ start_rule(context, :Tags);
332
+ build(context, token);
333
+ return 2
334
+ end
335
+ if match_FeatureLine(context, token)
336
+ build(context, token);
337
+ return 3
338
+ end
339
+ if match_Comment(context, token)
340
+ build(context, token);
341
+ return 1
342
+ end
343
+ if match_Empty(context, token)
344
+ build(context, token);
345
+ return 1
346
+ end
347
+
348
+ state_comment = "State: 1 - Feature:0>Feature_Header:0>#Language:0"
349
+ token.detach
350
+ expected_tokens = ["#TagLine", "#FeatureLine", "#Comment", "#Empty"]
351
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
352
+ raise error if (stop_at_first_error)
353
+ add_error(context, error)
354
+ return 1
355
+ end
356
+
357
+ # Feature:0>Feature_Header:1>Tags:0>#TagLine:0
358
+ def match_token_at_2(token, context)
359
+ if match_TagLine(context, token)
360
+ build(context, token);
361
+ return 2
362
+ end
363
+ if match_FeatureLine(context, token)
364
+ end_rule(context, :Tags);
365
+ build(context, token);
366
+ return 3
367
+ end
368
+ if match_Comment(context, token)
369
+ build(context, token);
370
+ return 2
371
+ end
372
+ if match_Empty(context, token)
373
+ build(context, token);
374
+ return 2
375
+ end
376
+
377
+ state_comment = "State: 2 - Feature:0>Feature_Header:1>Tags:0>#TagLine:0"
378
+ token.detach
379
+ expected_tokens = ["#TagLine", "#FeatureLine", "#Comment", "#Empty"]
380
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
381
+ raise error if (stop_at_first_error)
382
+ add_error(context, error)
383
+ return 2
384
+ end
385
+
386
+ # Feature:0>Feature_Header:2>#FeatureLine:0
387
+ def match_token_at_3(token, context)
388
+ if match_EOF(context, token)
389
+ end_rule(context, :Feature_Header);
390
+ build(context, token);
391
+ return 28
392
+ end
393
+ if match_Empty(context, token)
394
+ build(context, token);
395
+ return 3
396
+ end
397
+ if match_Comment(context, token)
398
+ build(context, token);
399
+ return 5
400
+ end
401
+ if match_BackgroundLine(context, token)
402
+ end_rule(context, :Feature_Header);
403
+ start_rule(context, :Background);
404
+ build(context, token);
405
+ return 6
406
+ end
407
+ if match_TagLine(context, token)
408
+ end_rule(context, :Feature_Header);
409
+ start_rule(context, :Scenario_Definition);
410
+ start_rule(context, :Tags);
411
+ build(context, token);
412
+ return 11
413
+ end
414
+ if match_ScenarioLine(context, token)
415
+ end_rule(context, :Feature_Header);
416
+ start_rule(context, :Scenario_Definition);
417
+ start_rule(context, :Scenario);
418
+ build(context, token);
419
+ return 12
420
+ end
421
+ if match_ScenarioOutlineLine(context, token)
422
+ end_rule(context, :Feature_Header);
423
+ start_rule(context, :Scenario_Definition);
424
+ start_rule(context, :ScenarioOutline);
425
+ build(context, token);
426
+ return 17
427
+ end
428
+ if match_Other(context, token)
429
+ start_rule(context, :Description);
430
+ build(context, token);
431
+ return 4
432
+ end
433
+
434
+ state_comment = "State: 3 - Feature:0>Feature_Header:2>#FeatureLine:0"
435
+ token.detach
436
+ expected_tokens = ["#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"]
437
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
438
+ raise error if (stop_at_first_error)
439
+ add_error(context, error)
440
+ return 3
441
+ end
442
+
443
+ # Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:1>Description:0>#Other:0
444
+ def match_token_at_4(token, context)
445
+ if match_EOF(context, token)
446
+ end_rule(context, :Description);
447
+ end_rule(context, :Feature_Header);
448
+ build(context, token);
449
+ return 28
450
+ end
451
+ if match_Comment(context, token)
452
+ end_rule(context, :Description);
453
+ build(context, token);
454
+ return 5
455
+ end
456
+ if match_BackgroundLine(context, token)
457
+ end_rule(context, :Description);
458
+ end_rule(context, :Feature_Header);
459
+ start_rule(context, :Background);
460
+ build(context, token);
461
+ return 6
462
+ end
463
+ if match_TagLine(context, token)
464
+ end_rule(context, :Description);
465
+ end_rule(context, :Feature_Header);
466
+ start_rule(context, :Scenario_Definition);
467
+ start_rule(context, :Tags);
468
+ build(context, token);
469
+ return 11
470
+ end
471
+ if match_ScenarioLine(context, token)
472
+ end_rule(context, :Description);
473
+ end_rule(context, :Feature_Header);
474
+ start_rule(context, :Scenario_Definition);
475
+ start_rule(context, :Scenario);
476
+ build(context, token);
477
+ return 12
478
+ end
479
+ if match_ScenarioOutlineLine(context, token)
480
+ end_rule(context, :Description);
481
+ end_rule(context, :Feature_Header);
482
+ start_rule(context, :Scenario_Definition);
483
+ start_rule(context, :ScenarioOutline);
484
+ build(context, token);
485
+ return 17
486
+ end
487
+ if match_Other(context, token)
488
+ build(context, token);
489
+ return 4
490
+ end
491
+
492
+ state_comment = "State: 4 - Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:1>Description:0>#Other:0"
493
+ token.detach
494
+ expected_tokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"]
495
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
496
+ raise error if (stop_at_first_error)
497
+ add_error(context, error)
498
+ return 4
499
+ end
500
+
501
+ # Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:2>#Comment:0
502
+ def match_token_at_5(token, context)
503
+ if match_EOF(context, token)
504
+ end_rule(context, :Feature_Header);
505
+ build(context, token);
506
+ return 28
507
+ end
508
+ if match_Comment(context, token)
509
+ build(context, token);
510
+ return 5
511
+ end
512
+ if match_BackgroundLine(context, token)
513
+ end_rule(context, :Feature_Header);
514
+ start_rule(context, :Background);
515
+ build(context, token);
516
+ return 6
517
+ end
518
+ if match_TagLine(context, token)
519
+ end_rule(context, :Feature_Header);
520
+ start_rule(context, :Scenario_Definition);
521
+ start_rule(context, :Tags);
522
+ build(context, token);
523
+ return 11
524
+ end
525
+ if match_ScenarioLine(context, token)
526
+ end_rule(context, :Feature_Header);
527
+ start_rule(context, :Scenario_Definition);
528
+ start_rule(context, :Scenario);
529
+ build(context, token);
530
+ return 12
531
+ end
532
+ if match_ScenarioOutlineLine(context, token)
533
+ end_rule(context, :Feature_Header);
534
+ start_rule(context, :Scenario_Definition);
535
+ start_rule(context, :ScenarioOutline);
536
+ build(context, token);
537
+ return 17
538
+ end
539
+ if match_Empty(context, token)
540
+ build(context, token);
541
+ return 5
542
+ end
543
+
544
+ state_comment = "State: 5 - Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:2>#Comment:0"
545
+ token.detach
546
+ expected_tokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"]
547
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
548
+ raise error if (stop_at_first_error)
549
+ add_error(context, error)
550
+ return 5
551
+ end
552
+
553
+ # Feature:1>Background:0>#BackgroundLine:0
554
+ def match_token_at_6(token, context)
555
+ if match_EOF(context, token)
556
+ end_rule(context, :Background);
557
+ build(context, token);
558
+ return 28
559
+ end
560
+ if match_Empty(context, token)
561
+ build(context, token);
562
+ return 6
563
+ end
564
+ if match_Comment(context, token)
565
+ build(context, token);
566
+ return 8
567
+ end
568
+ if match_StepLine(context, token)
569
+ start_rule(context, :Step);
570
+ build(context, token);
571
+ return 9
572
+ end
573
+ if match_TagLine(context, token)
574
+ end_rule(context, :Background);
575
+ start_rule(context, :Scenario_Definition);
576
+ start_rule(context, :Tags);
577
+ build(context, token);
578
+ return 11
579
+ end
580
+ if match_ScenarioLine(context, token)
581
+ end_rule(context, :Background);
582
+ start_rule(context, :Scenario_Definition);
583
+ start_rule(context, :Scenario);
584
+ build(context, token);
585
+ return 12
586
+ end
587
+ if match_ScenarioOutlineLine(context, token)
588
+ end_rule(context, :Background);
589
+ start_rule(context, :Scenario_Definition);
590
+ start_rule(context, :ScenarioOutline);
591
+ build(context, token);
592
+ return 17
593
+ end
594
+ if match_Other(context, token)
595
+ start_rule(context, :Description);
596
+ build(context, token);
597
+ return 7
598
+ end
599
+
600
+ state_comment = "State: 6 - Feature:1>Background:0>#BackgroundLine:0"
601
+ token.detach
602
+ expected_tokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"]
603
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
604
+ raise error if (stop_at_first_error)
605
+ add_error(context, error)
606
+ return 6
607
+ end
608
+
609
+ # Feature:1>Background:1>Background_Description:0>Description_Helper:1>Description:0>#Other:0
610
+ def match_token_at_7(token, context)
611
+ if match_EOF(context, token)
612
+ end_rule(context, :Description);
613
+ end_rule(context, :Background);
614
+ build(context, token);
615
+ return 28
616
+ end
617
+ if match_Comment(context, token)
618
+ end_rule(context, :Description);
619
+ build(context, token);
620
+ return 8
621
+ end
622
+ if match_StepLine(context, token)
623
+ end_rule(context, :Description);
624
+ start_rule(context, :Step);
625
+ build(context, token);
626
+ return 9
627
+ end
628
+ if match_TagLine(context, token)
629
+ end_rule(context, :Description);
630
+ end_rule(context, :Background);
631
+ start_rule(context, :Scenario_Definition);
632
+ start_rule(context, :Tags);
633
+ build(context, token);
634
+ return 11
635
+ end
636
+ if match_ScenarioLine(context, token)
637
+ end_rule(context, :Description);
638
+ end_rule(context, :Background);
639
+ start_rule(context, :Scenario_Definition);
640
+ start_rule(context, :Scenario);
641
+ build(context, token);
642
+ return 12
643
+ end
644
+ if match_ScenarioOutlineLine(context, token)
645
+ end_rule(context, :Description);
646
+ end_rule(context, :Background);
647
+ start_rule(context, :Scenario_Definition);
648
+ start_rule(context, :ScenarioOutline);
649
+ build(context, token);
650
+ return 17
651
+ end
652
+ if match_Other(context, token)
653
+ build(context, token);
654
+ return 7
655
+ end
656
+
657
+ state_comment = "State: 7 - Feature:1>Background:1>Background_Description:0>Description_Helper:1>Description:0>#Other:0"
658
+ token.detach
659
+ expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"]
660
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
661
+ raise error if (stop_at_first_error)
662
+ add_error(context, error)
663
+ return 7
664
+ end
665
+
666
+ # Feature:1>Background:1>Background_Description:0>Description_Helper:2>#Comment:0
667
+ def match_token_at_8(token, context)
668
+ if match_EOF(context, token)
669
+ end_rule(context, :Background);
670
+ build(context, token);
671
+ return 28
672
+ end
673
+ if match_Comment(context, token)
674
+ build(context, token);
675
+ return 8
676
+ end
677
+ if match_StepLine(context, token)
678
+ start_rule(context, :Step);
679
+ build(context, token);
680
+ return 9
681
+ end
682
+ if match_TagLine(context, token)
683
+ end_rule(context, :Background);
684
+ start_rule(context, :Scenario_Definition);
685
+ start_rule(context, :Tags);
686
+ build(context, token);
687
+ return 11
688
+ end
689
+ if match_ScenarioLine(context, token)
690
+ end_rule(context, :Background);
691
+ start_rule(context, :Scenario_Definition);
692
+ start_rule(context, :Scenario);
693
+ build(context, token);
694
+ return 12
695
+ end
696
+ if match_ScenarioOutlineLine(context, token)
697
+ end_rule(context, :Background);
698
+ start_rule(context, :Scenario_Definition);
699
+ start_rule(context, :ScenarioOutline);
700
+ build(context, token);
701
+ return 17
702
+ end
703
+ if match_Empty(context, token)
704
+ build(context, token);
705
+ return 8
706
+ end
707
+
708
+ state_comment = "State: 8 - Feature:1>Background:1>Background_Description:0>Description_Helper:2>#Comment:0"
709
+ token.detach
710
+ expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"]
711
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
712
+ raise error if (stop_at_first_error)
713
+ add_error(context, error)
714
+ return 8
715
+ end
716
+
717
+ # Feature:1>Background:2>Scenario_Step:0>Step:0>#StepLine:0
718
+ def match_token_at_9(token, context)
719
+ if match_EOF(context, token)
720
+ end_rule(context, :Step);
721
+ end_rule(context, :Background);
722
+ build(context, token);
723
+ return 28
724
+ end
725
+ if match_TableRow(context, token)
726
+ start_rule(context, :DataTable);
727
+ build(context, token);
728
+ return 10
729
+ end
730
+ if match_DocStringSeparator(context, token)
731
+ start_rule(context, :DocString);
732
+ build(context, token);
733
+ return 33
734
+ end
735
+ if match_StepLine(context, token)
736
+ end_rule(context, :Step);
737
+ start_rule(context, :Step);
738
+ build(context, token);
739
+ return 9
740
+ end
741
+ if match_TagLine(context, token)
742
+ end_rule(context, :Step);
743
+ end_rule(context, :Background);
744
+ start_rule(context, :Scenario_Definition);
745
+ start_rule(context, :Tags);
746
+ build(context, token);
747
+ return 11
748
+ end
749
+ if match_ScenarioLine(context, token)
750
+ end_rule(context, :Step);
751
+ end_rule(context, :Background);
752
+ start_rule(context, :Scenario_Definition);
753
+ start_rule(context, :Scenario);
754
+ build(context, token);
755
+ return 12
756
+ end
757
+ if match_ScenarioOutlineLine(context, token)
758
+ end_rule(context, :Step);
759
+ end_rule(context, :Background);
760
+ start_rule(context, :Scenario_Definition);
761
+ start_rule(context, :ScenarioOutline);
762
+ build(context, token);
763
+ return 17
764
+ end
765
+ if match_Comment(context, token)
766
+ build(context, token);
767
+ return 9
768
+ end
769
+ if match_Empty(context, token)
770
+ build(context, token);
771
+ return 9
772
+ end
773
+
774
+ state_comment = "State: 9 - Feature:1>Background:2>Scenario_Step:0>Step:0>#StepLine:0"
775
+ token.detach
776
+ expected_tokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"]
777
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
778
+ raise error if (stop_at_first_error)
779
+ add_error(context, error)
780
+ return 9
781
+ end
782
+
783
+ # Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0
784
+ def match_token_at_10(token, context)
785
+ if match_EOF(context, token)
786
+ end_rule(context, :DataTable);
787
+ end_rule(context, :Step);
788
+ end_rule(context, :Background);
789
+ build(context, token);
790
+ return 28
791
+ end
792
+ if match_TableRow(context, token)
793
+ build(context, token);
794
+ return 10
795
+ end
796
+ if match_StepLine(context, token)
797
+ end_rule(context, :DataTable);
798
+ end_rule(context, :Step);
799
+ start_rule(context, :Step);
800
+ build(context, token);
801
+ return 9
802
+ end
803
+ if match_TagLine(context, token)
804
+ end_rule(context, :DataTable);
805
+ end_rule(context, :Step);
806
+ end_rule(context, :Background);
807
+ start_rule(context, :Scenario_Definition);
808
+ start_rule(context, :Tags);
809
+ build(context, token);
810
+ return 11
811
+ end
812
+ if match_ScenarioLine(context, token)
813
+ end_rule(context, :DataTable);
814
+ end_rule(context, :Step);
815
+ end_rule(context, :Background);
816
+ start_rule(context, :Scenario_Definition);
817
+ start_rule(context, :Scenario);
818
+ build(context, token);
819
+ return 12
820
+ end
821
+ if match_ScenarioOutlineLine(context, token)
822
+ end_rule(context, :DataTable);
823
+ end_rule(context, :Step);
824
+ end_rule(context, :Background);
825
+ start_rule(context, :Scenario_Definition);
826
+ start_rule(context, :ScenarioOutline);
827
+ build(context, token);
828
+ return 17
829
+ end
830
+ if match_Comment(context, token)
831
+ build(context, token);
832
+ return 10
833
+ end
834
+ if match_Empty(context, token)
835
+ build(context, token);
836
+ return 10
837
+ end
838
+
839
+ state_comment = "State: 10 - Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0"
840
+ token.detach
841
+ expected_tokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"]
842
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
843
+ raise error if (stop_at_first_error)
844
+ add_error(context, error)
845
+ return 10
846
+ end
847
+
848
+ # Feature:2>Scenario_Definition:0>Tags:0>#TagLine:0
849
+ def match_token_at_11(token, context)
850
+ if match_TagLine(context, token)
851
+ build(context, token);
852
+ return 11
853
+ end
854
+ if match_ScenarioLine(context, token)
855
+ end_rule(context, :Tags);
856
+ start_rule(context, :Scenario);
857
+ build(context, token);
858
+ return 12
859
+ end
860
+ if match_ScenarioOutlineLine(context, token)
861
+ end_rule(context, :Tags);
862
+ start_rule(context, :ScenarioOutline);
863
+ build(context, token);
864
+ return 17
865
+ end
866
+ if match_Comment(context, token)
867
+ build(context, token);
868
+ return 11
869
+ end
870
+ if match_Empty(context, token)
871
+ build(context, token);
872
+ return 11
873
+ end
874
+
875
+ state_comment = "State: 11 - Feature:2>Scenario_Definition:0>Tags:0>#TagLine:0"
876
+ token.detach
877
+ expected_tokens = ["#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"]
878
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
879
+ raise error if (stop_at_first_error)
880
+ add_error(context, error)
881
+ return 11
882
+ end
883
+
884
+ # Feature:2>Scenario_Definition:1>__alt0:0>Scenario:0>#ScenarioLine:0
885
+ def match_token_at_12(token, context)
886
+ if match_EOF(context, token)
887
+ end_rule(context, :Scenario);
888
+ end_rule(context, :Scenario_Definition);
889
+ build(context, token);
890
+ return 28
891
+ end
892
+ if match_Empty(context, token)
893
+ build(context, token);
894
+ return 12
895
+ end
896
+ if match_Comment(context, token)
897
+ build(context, token);
898
+ return 14
899
+ end
900
+ if match_StepLine(context, token)
901
+ start_rule(context, :Step);
902
+ build(context, token);
903
+ return 15
904
+ end
905
+ if match_TagLine(context, token)
906
+ end_rule(context, :Scenario);
907
+ end_rule(context, :Scenario_Definition);
908
+ start_rule(context, :Scenario_Definition);
909
+ start_rule(context, :Tags);
910
+ build(context, token);
911
+ return 11
912
+ end
913
+ if match_ScenarioLine(context, token)
914
+ end_rule(context, :Scenario);
915
+ end_rule(context, :Scenario_Definition);
916
+ start_rule(context, :Scenario_Definition);
917
+ start_rule(context, :Scenario);
918
+ build(context, token);
919
+ return 12
920
+ end
921
+ if match_ScenarioOutlineLine(context, token)
922
+ end_rule(context, :Scenario);
923
+ end_rule(context, :Scenario_Definition);
924
+ start_rule(context, :Scenario_Definition);
925
+ start_rule(context, :ScenarioOutline);
926
+ build(context, token);
927
+ return 17
928
+ end
929
+ if match_Other(context, token)
930
+ start_rule(context, :Description);
931
+ build(context, token);
932
+ return 13
933
+ end
934
+
935
+ state_comment = "State: 12 - Feature:2>Scenario_Definition:1>__alt0:0>Scenario:0>#ScenarioLine:0"
936
+ token.detach
937
+ expected_tokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"]
938
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
939
+ raise error if (stop_at_first_error)
940
+ add_error(context, error)
941
+ return 12
942
+ end
943
+
944
+ # Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:1>Description:0>#Other:0
945
+ def match_token_at_13(token, context)
946
+ if match_EOF(context, token)
947
+ end_rule(context, :Description);
948
+ end_rule(context, :Scenario);
949
+ end_rule(context, :Scenario_Definition);
950
+ build(context, token);
951
+ return 28
952
+ end
953
+ if match_Comment(context, token)
954
+ end_rule(context, :Description);
955
+ build(context, token);
956
+ return 14
957
+ end
958
+ if match_StepLine(context, token)
959
+ end_rule(context, :Description);
960
+ start_rule(context, :Step);
961
+ build(context, token);
962
+ return 15
963
+ end
964
+ if match_TagLine(context, token)
965
+ end_rule(context, :Description);
966
+ end_rule(context, :Scenario);
967
+ end_rule(context, :Scenario_Definition);
968
+ start_rule(context, :Scenario_Definition);
969
+ start_rule(context, :Tags);
970
+ build(context, token);
971
+ return 11
972
+ end
973
+ if match_ScenarioLine(context, token)
974
+ end_rule(context, :Description);
975
+ end_rule(context, :Scenario);
976
+ end_rule(context, :Scenario_Definition);
977
+ start_rule(context, :Scenario_Definition);
978
+ start_rule(context, :Scenario);
979
+ build(context, token);
980
+ return 12
981
+ end
982
+ if match_ScenarioOutlineLine(context, token)
983
+ end_rule(context, :Description);
984
+ end_rule(context, :Scenario);
985
+ end_rule(context, :Scenario_Definition);
986
+ start_rule(context, :Scenario_Definition);
987
+ start_rule(context, :ScenarioOutline);
988
+ build(context, token);
989
+ return 17
990
+ end
991
+ if match_Other(context, token)
992
+ build(context, token);
993
+ return 13
994
+ end
995
+
996
+ state_comment = "State: 13 - Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:1>Description:0>#Other:0"
997
+ token.detach
998
+ expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"]
999
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
1000
+ raise error if (stop_at_first_error)
1001
+ add_error(context, error)
1002
+ return 13
1003
+ end
1004
+
1005
+ # Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:2>#Comment:0
1006
+ def match_token_at_14(token, context)
1007
+ if match_EOF(context, token)
1008
+ end_rule(context, :Scenario);
1009
+ end_rule(context, :Scenario_Definition);
1010
+ build(context, token);
1011
+ return 28
1012
+ end
1013
+ if match_Comment(context, token)
1014
+ build(context, token);
1015
+ return 14
1016
+ end
1017
+ if match_StepLine(context, token)
1018
+ start_rule(context, :Step);
1019
+ build(context, token);
1020
+ return 15
1021
+ end
1022
+ if match_TagLine(context, token)
1023
+ end_rule(context, :Scenario);
1024
+ end_rule(context, :Scenario_Definition);
1025
+ start_rule(context, :Scenario_Definition);
1026
+ start_rule(context, :Tags);
1027
+ build(context, token);
1028
+ return 11
1029
+ end
1030
+ if match_ScenarioLine(context, token)
1031
+ end_rule(context, :Scenario);
1032
+ end_rule(context, :Scenario_Definition);
1033
+ start_rule(context, :Scenario_Definition);
1034
+ start_rule(context, :Scenario);
1035
+ build(context, token);
1036
+ return 12
1037
+ end
1038
+ if match_ScenarioOutlineLine(context, token)
1039
+ end_rule(context, :Scenario);
1040
+ end_rule(context, :Scenario_Definition);
1041
+ start_rule(context, :Scenario_Definition);
1042
+ start_rule(context, :ScenarioOutline);
1043
+ build(context, token);
1044
+ return 17
1045
+ end
1046
+ if match_Empty(context, token)
1047
+ build(context, token);
1048
+ return 14
1049
+ end
1050
+
1051
+ state_comment = "State: 14 - Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:2>#Comment:0"
1052
+ token.detach
1053
+ expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"]
1054
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
1055
+ raise error if (stop_at_first_error)
1056
+ add_error(context, error)
1057
+ return 14
1058
+ end
1059
+
1060
+ # Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:0>#StepLine:0
1061
+ def match_token_at_15(token, context)
1062
+ if match_EOF(context, token)
1063
+ end_rule(context, :Step);
1064
+ end_rule(context, :Scenario);
1065
+ end_rule(context, :Scenario_Definition);
1066
+ build(context, token);
1067
+ return 28
1068
+ end
1069
+ if match_TableRow(context, token)
1070
+ start_rule(context, :DataTable);
1071
+ build(context, token);
1072
+ return 16
1073
+ end
1074
+ if match_DocStringSeparator(context, token)
1075
+ start_rule(context, :DocString);
1076
+ build(context, token);
1077
+ return 31
1078
+ end
1079
+ if match_StepLine(context, token)
1080
+ end_rule(context, :Step);
1081
+ start_rule(context, :Step);
1082
+ build(context, token);
1083
+ return 15
1084
+ end
1085
+ if match_TagLine(context, token)
1086
+ end_rule(context, :Step);
1087
+ end_rule(context, :Scenario);
1088
+ end_rule(context, :Scenario_Definition);
1089
+ start_rule(context, :Scenario_Definition);
1090
+ start_rule(context, :Tags);
1091
+ build(context, token);
1092
+ return 11
1093
+ end
1094
+ if match_ScenarioLine(context, token)
1095
+ end_rule(context, :Step);
1096
+ end_rule(context, :Scenario);
1097
+ end_rule(context, :Scenario_Definition);
1098
+ start_rule(context, :Scenario_Definition);
1099
+ start_rule(context, :Scenario);
1100
+ build(context, token);
1101
+ return 12
1102
+ end
1103
+ if match_ScenarioOutlineLine(context, token)
1104
+ end_rule(context, :Step);
1105
+ end_rule(context, :Scenario);
1106
+ end_rule(context, :Scenario_Definition);
1107
+ start_rule(context, :Scenario_Definition);
1108
+ start_rule(context, :ScenarioOutline);
1109
+ build(context, token);
1110
+ return 17
1111
+ end
1112
+ if match_Comment(context, token)
1113
+ build(context, token);
1114
+ return 15
1115
+ end
1116
+ if match_Empty(context, token)
1117
+ build(context, token);
1118
+ return 15
1119
+ end
1120
+
1121
+ state_comment = "State: 15 - Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:0>#StepLine:0"
1122
+ token.detach
1123
+ expected_tokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"]
1124
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
1125
+ raise error if (stop_at_first_error)
1126
+ add_error(context, error)
1127
+ return 15
1128
+ end
1129
+
1130
+ # Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0
1131
+ def match_token_at_16(token, context)
1132
+ if match_EOF(context, token)
1133
+ end_rule(context, :DataTable);
1134
+ end_rule(context, :Step);
1135
+ end_rule(context, :Scenario);
1136
+ end_rule(context, :Scenario_Definition);
1137
+ build(context, token);
1138
+ return 28
1139
+ end
1140
+ if match_TableRow(context, token)
1141
+ build(context, token);
1142
+ return 16
1143
+ end
1144
+ if match_StepLine(context, token)
1145
+ end_rule(context, :DataTable);
1146
+ end_rule(context, :Step);
1147
+ start_rule(context, :Step);
1148
+ build(context, token);
1149
+ return 15
1150
+ end
1151
+ if match_TagLine(context, token)
1152
+ end_rule(context, :DataTable);
1153
+ end_rule(context, :Step);
1154
+ end_rule(context, :Scenario);
1155
+ end_rule(context, :Scenario_Definition);
1156
+ start_rule(context, :Scenario_Definition);
1157
+ start_rule(context, :Tags);
1158
+ build(context, token);
1159
+ return 11
1160
+ end
1161
+ if match_ScenarioLine(context, token)
1162
+ end_rule(context, :DataTable);
1163
+ end_rule(context, :Step);
1164
+ end_rule(context, :Scenario);
1165
+ end_rule(context, :Scenario_Definition);
1166
+ start_rule(context, :Scenario_Definition);
1167
+ start_rule(context, :Scenario);
1168
+ build(context, token);
1169
+ return 12
1170
+ end
1171
+ if match_ScenarioOutlineLine(context, token)
1172
+ end_rule(context, :DataTable);
1173
+ end_rule(context, :Step);
1174
+ end_rule(context, :Scenario);
1175
+ end_rule(context, :Scenario_Definition);
1176
+ start_rule(context, :Scenario_Definition);
1177
+ start_rule(context, :ScenarioOutline);
1178
+ build(context, token);
1179
+ return 17
1180
+ end
1181
+ if match_Comment(context, token)
1182
+ build(context, token);
1183
+ return 16
1184
+ end
1185
+ if match_Empty(context, token)
1186
+ build(context, token);
1187
+ return 16
1188
+ end
1189
+
1190
+ state_comment = "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"
1191
+ token.detach
1192
+ expected_tokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"]
1193
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
1194
+ raise error if (stop_at_first_error)
1195
+ add_error(context, error)
1196
+ return 16
1197
+ end
1198
+
1199
+ # Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:0>#ScenarioOutlineLine:0
1200
+ def match_token_at_17(token, context)
1201
+ if match_Empty(context, token)
1202
+ build(context, token);
1203
+ return 17
1204
+ end
1205
+ if match_Comment(context, token)
1206
+ build(context, token);
1207
+ return 19
1208
+ end
1209
+ if match_StepLine(context, token)
1210
+ start_rule(context, :Step);
1211
+ build(context, token);
1212
+ return 20
1213
+ end
1214
+ if match_TagLine(context, token)
1215
+ start_rule(context, :Examples_Definition);
1216
+ start_rule(context, :Tags);
1217
+ build(context, token);
1218
+ return 22
1219
+ end
1220
+ if match_ExamplesLine(context, token)
1221
+ start_rule(context, :Examples_Definition);
1222
+ start_rule(context, :Examples);
1223
+ build(context, token);
1224
+ return 23
1225
+ end
1226
+ if match_Other(context, token)
1227
+ start_rule(context, :Description);
1228
+ build(context, token);
1229
+ return 18
1230
+ end
1231
+
1232
+ state_comment = "State: 17 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:0>#ScenarioOutlineLine:0"
1233
+ token.detach
1234
+ expected_tokens = ["#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#Other"]
1235
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
1236
+ raise error if (stop_at_first_error)
1237
+ add_error(context, error)
1238
+ return 17
1239
+ end
1240
+
1241
+ # Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>ScenarioOutline_Description:0>Description_Helper:1>Description:0>#Other:0
1242
+ def match_token_at_18(token, context)
1243
+ if match_Comment(context, token)
1244
+ end_rule(context, :Description);
1245
+ build(context, token);
1246
+ return 19
1247
+ end
1248
+ if match_StepLine(context, token)
1249
+ end_rule(context, :Description);
1250
+ start_rule(context, :Step);
1251
+ build(context, token);
1252
+ return 20
1253
+ end
1254
+ if match_TagLine(context, token)
1255
+ end_rule(context, :Description);
1256
+ start_rule(context, :Examples_Definition);
1257
+ start_rule(context, :Tags);
1258
+ build(context, token);
1259
+ return 22
1260
+ end
1261
+ if match_ExamplesLine(context, token)
1262
+ end_rule(context, :Description);
1263
+ start_rule(context, :Examples_Definition);
1264
+ start_rule(context, :Examples);
1265
+ build(context, token);
1266
+ return 23
1267
+ end
1268
+ if match_Other(context, token)
1269
+ build(context, token);
1270
+ return 18
1271
+ end
1272
+
1273
+ state_comment = "State: 18 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>ScenarioOutline_Description:0>Description_Helper:1>Description:0>#Other:0"
1274
+ token.detach
1275
+ expected_tokens = ["#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#Other"]
1276
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
1277
+ raise error if (stop_at_first_error)
1278
+ add_error(context, error)
1279
+ return 18
1280
+ end
1281
+
1282
+ # Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>ScenarioOutline_Description:0>Description_Helper:2>#Comment:0
1283
+ def match_token_at_19(token, context)
1284
+ if match_Comment(context, token)
1285
+ build(context, token);
1286
+ return 19
1287
+ end
1288
+ if match_StepLine(context, token)
1289
+ start_rule(context, :Step);
1290
+ build(context, token);
1291
+ return 20
1292
+ end
1293
+ if match_TagLine(context, token)
1294
+ start_rule(context, :Examples_Definition);
1295
+ start_rule(context, :Tags);
1296
+ build(context, token);
1297
+ return 22
1298
+ end
1299
+ if match_ExamplesLine(context, token)
1300
+ start_rule(context, :Examples_Definition);
1301
+ start_rule(context, :Examples);
1302
+ build(context, token);
1303
+ return 23
1304
+ end
1305
+ if match_Empty(context, token)
1306
+ build(context, token);
1307
+ return 19
1308
+ end
1309
+
1310
+ state_comment = "State: 19 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>ScenarioOutline_Description:0>Description_Helper:2>#Comment:0"
1311
+ token.detach
1312
+ expected_tokens = ["#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#Empty"]
1313
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
1314
+ raise error if (stop_at_first_error)
1315
+ add_error(context, error)
1316
+ return 19
1317
+ end
1318
+
1319
+ # Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:0>#StepLine:0
1320
+ def match_token_at_20(token, context)
1321
+ if match_TableRow(context, token)
1322
+ start_rule(context, :DataTable);
1323
+ build(context, token);
1324
+ return 21
1325
+ end
1326
+ if match_DocStringSeparator(context, token)
1327
+ start_rule(context, :DocString);
1328
+ build(context, token);
1329
+ return 29
1330
+ end
1331
+ if match_StepLine(context, token)
1332
+ end_rule(context, :Step);
1333
+ start_rule(context, :Step);
1334
+ build(context, token);
1335
+ return 20
1336
+ end
1337
+ if match_TagLine(context, token)
1338
+ end_rule(context, :Step);
1339
+ start_rule(context, :Examples_Definition);
1340
+ start_rule(context, :Tags);
1341
+ build(context, token);
1342
+ return 22
1343
+ end
1344
+ if match_ExamplesLine(context, token)
1345
+ end_rule(context, :Step);
1346
+ start_rule(context, :Examples_Definition);
1347
+ start_rule(context, :Examples);
1348
+ build(context, token);
1349
+ return 23
1350
+ end
1351
+ if match_Comment(context, token)
1352
+ build(context, token);
1353
+ return 20
1354
+ end
1355
+ if match_Empty(context, token)
1356
+ build(context, token);
1357
+ return 20
1358
+ end
1359
+
1360
+ state_comment = "State: 20 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:0>#StepLine:0"
1361
+ token.detach
1362
+ expected_tokens = ["#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#Comment", "#Empty"]
1363
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
1364
+ raise error if (stop_at_first_error)
1365
+ add_error(context, error)
1366
+ return 20
1367
+ end
1368
+
1369
+ # Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0
1370
+ def match_token_at_21(token, context)
1371
+ if match_TableRow(context, token)
1372
+ build(context, token);
1373
+ return 21
1374
+ end
1375
+ if match_StepLine(context, token)
1376
+ end_rule(context, :DataTable);
1377
+ end_rule(context, :Step);
1378
+ start_rule(context, :Step);
1379
+ build(context, token);
1380
+ return 20
1381
+ end
1382
+ if match_TagLine(context, token)
1383
+ end_rule(context, :DataTable);
1384
+ end_rule(context, :Step);
1385
+ start_rule(context, :Examples_Definition);
1386
+ start_rule(context, :Tags);
1387
+ build(context, token);
1388
+ return 22
1389
+ end
1390
+ if match_ExamplesLine(context, token)
1391
+ end_rule(context, :DataTable);
1392
+ end_rule(context, :Step);
1393
+ start_rule(context, :Examples_Definition);
1394
+ start_rule(context, :Examples);
1395
+ build(context, token);
1396
+ return 23
1397
+ end
1398
+ if match_Comment(context, token)
1399
+ build(context, token);
1400
+ return 21
1401
+ end
1402
+ if match_Empty(context, token)
1403
+ build(context, token);
1404
+ return 21
1405
+ end
1406
+
1407
+ state_comment = "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"
1408
+ token.detach
1409
+ expected_tokens = ["#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#Comment", "#Empty"]
1410
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
1411
+ raise error if (stop_at_first_error)
1412
+ add_error(context, error)
1413
+ return 21
1414
+ end
1415
+
1416
+ # Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:0>Tags:0>#TagLine:0
1417
+ def match_token_at_22(token, context)
1418
+ if match_TagLine(context, token)
1419
+ build(context, token);
1420
+ return 22
1421
+ end
1422
+ if match_ExamplesLine(context, token)
1423
+ end_rule(context, :Tags);
1424
+ start_rule(context, :Examples);
1425
+ build(context, token);
1426
+ return 23
1427
+ end
1428
+ if match_Comment(context, token)
1429
+ build(context, token);
1430
+ return 22
1431
+ end
1432
+ if match_Empty(context, token)
1433
+ build(context, token);
1434
+ return 22
1435
+ end
1436
+
1437
+ state_comment = "State: 22 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:0>Tags:0>#TagLine:0"
1438
+ token.detach
1439
+ expected_tokens = ["#TagLine", "#ExamplesLine", "#Comment", "#Empty"]
1440
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
1441
+ raise error if (stop_at_first_error)
1442
+ add_error(context, error)
1443
+ return 22
1444
+ end
1445
+
1446
+ # Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:0>#ExamplesLine:0
1447
+ def match_token_at_23(token, context)
1448
+ if match_Empty(context, token)
1449
+ build(context, token);
1450
+ return 23
1451
+ end
1452
+ if match_Comment(context, token)
1453
+ build(context, token);
1454
+ return 25
1455
+ end
1456
+ if match_TableRow(context, token)
1457
+ build(context, token);
1458
+ return 26
1459
+ end
1460
+ if match_Other(context, token)
1461
+ start_rule(context, :Description);
1462
+ build(context, token);
1463
+ return 24
1464
+ end
1465
+
1466
+ state_comment = "State: 23 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:0>#ExamplesLine:0"
1467
+ token.detach
1468
+ expected_tokens = ["#Empty", "#Comment", "#TableRow", "#Other"]
1469
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
1470
+ raise error if (stop_at_first_error)
1471
+ add_error(context, error)
1472
+ return 23
1473
+ end
1474
+
1475
+ # Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Examples_Description:0>Description_Helper:1>Description:0>#Other:0
1476
+ def match_token_at_24(token, context)
1477
+ if match_Comment(context, token)
1478
+ end_rule(context, :Description);
1479
+ build(context, token);
1480
+ return 25
1481
+ end
1482
+ if match_TableRow(context, token)
1483
+ end_rule(context, :Description);
1484
+ build(context, token);
1485
+ return 26
1486
+ end
1487
+ if match_Other(context, token)
1488
+ build(context, token);
1489
+ return 24
1490
+ end
1491
+
1492
+ state_comment = "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"
1493
+ token.detach
1494
+ expected_tokens = ["#Comment", "#TableRow", "#Other"]
1495
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
1496
+ raise error if (stop_at_first_error)
1497
+ add_error(context, error)
1498
+ return 24
1499
+ end
1500
+
1501
+ # Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Examples_Description:0>Description_Helper:2>#Comment:0
1502
+ def match_token_at_25(token, context)
1503
+ if match_Comment(context, token)
1504
+ build(context, token);
1505
+ return 25
1506
+ end
1507
+ if match_TableRow(context, token)
1508
+ build(context, token);
1509
+ return 26
1510
+ end
1511
+ if match_Empty(context, token)
1512
+ build(context, token);
1513
+ return 25
1514
+ end
1515
+
1516
+ state_comment = "State: 25 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Examples_Description:0>Description_Helper:2>#Comment:0"
1517
+ token.detach
1518
+ expected_tokens = ["#Comment", "#TableRow", "#Empty"]
1519
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
1520
+ raise error if (stop_at_first_error)
1521
+ add_error(context, error)
1522
+ return 25
1523
+ end
1524
+
1525
+ # Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:2>#TableRow:0
1526
+ def match_token_at_26(token, context)
1527
+ if match_TableRow(context, token)
1528
+ build(context, token);
1529
+ return 27
1530
+ end
1531
+ if match_Comment(context, token)
1532
+ build(context, token);
1533
+ return 26
1534
+ end
1535
+ if match_Empty(context, token)
1536
+ build(context, token);
1537
+ return 26
1538
+ end
1539
+
1540
+ state_comment = "State: 26 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:2>#TableRow:0"
1541
+ token.detach
1542
+ expected_tokens = ["#TableRow", "#Comment", "#Empty"]
1543
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
1544
+ raise error if (stop_at_first_error)
1545
+ add_error(context, error)
1546
+ return 26
1547
+ end
1548
+
1549
+ # Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:3>#TableRow:0
1550
+ def match_token_at_27(token, context)
1551
+ if match_EOF(context, token)
1552
+ end_rule(context, :Examples);
1553
+ end_rule(context, :Examples_Definition);
1554
+ end_rule(context, :ScenarioOutline);
1555
+ end_rule(context, :Scenario_Definition);
1556
+ build(context, token);
1557
+ return 28
1558
+ end
1559
+ if match_TableRow(context, token)
1560
+ build(context, token);
1561
+ return 27
1562
+ end
1563
+ if match_TagLine(context, token)
1564
+ if lookahead_0(context, token)
1565
+ end_rule(context, :Examples);
1566
+ end_rule(context, :Examples_Definition);
1567
+ start_rule(context, :Examples_Definition);
1568
+ start_rule(context, :Tags);
1569
+ build(context, token);
1570
+ return 22
1571
+ end
1572
+ end
1573
+ if match_TagLine(context, token)
1574
+ end_rule(context, :Examples);
1575
+ end_rule(context, :Examples_Definition);
1576
+ end_rule(context, :ScenarioOutline);
1577
+ end_rule(context, :Scenario_Definition);
1578
+ start_rule(context, :Scenario_Definition);
1579
+ start_rule(context, :Tags);
1580
+ build(context, token);
1581
+ return 11
1582
+ end
1583
+ if match_ExamplesLine(context, token)
1584
+ end_rule(context, :Examples);
1585
+ end_rule(context, :Examples_Definition);
1586
+ start_rule(context, :Examples_Definition);
1587
+ start_rule(context, :Examples);
1588
+ build(context, token);
1589
+ return 23
1590
+ end
1591
+ if match_ScenarioLine(context, token)
1592
+ end_rule(context, :Examples);
1593
+ end_rule(context, :Examples_Definition);
1594
+ end_rule(context, :ScenarioOutline);
1595
+ end_rule(context, :Scenario_Definition);
1596
+ start_rule(context, :Scenario_Definition);
1597
+ start_rule(context, :Scenario);
1598
+ build(context, token);
1599
+ return 12
1600
+ end
1601
+ if match_ScenarioOutlineLine(context, token)
1602
+ end_rule(context, :Examples);
1603
+ end_rule(context, :Examples_Definition);
1604
+ end_rule(context, :ScenarioOutline);
1605
+ end_rule(context, :Scenario_Definition);
1606
+ start_rule(context, :Scenario_Definition);
1607
+ start_rule(context, :ScenarioOutline);
1608
+ build(context, token);
1609
+ return 17
1610
+ end
1611
+ if match_Comment(context, token)
1612
+ build(context, token);
1613
+ return 27
1614
+ end
1615
+ if match_Empty(context, token)
1616
+ build(context, token);
1617
+ return 27
1618
+ end
1619
+
1620
+ state_comment = "State: 27 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:3>#TableRow:0"
1621
+ token.detach
1622
+ expected_tokens = ["#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"]
1623
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
1624
+ raise error if (stop_at_first_error)
1625
+ add_error(context, error)
1626
+ return 27
1627
+ end
1628
+
1629
+ # Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0
1630
+ def match_token_at_29(token, context)
1631
+ if match_DocStringSeparator(context, token)
1632
+ build(context, token);
1633
+ return 30
1634
+ end
1635
+ if match_Other(context, token)
1636
+ build(context, token);
1637
+ return 29
1638
+ end
1639
+
1640
+ state_comment = "State: 29 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0"
1641
+ token.detach
1642
+ expected_tokens = ["#DocStringSeparator", "#Other"]
1643
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
1644
+ raise error if (stop_at_first_error)
1645
+ add_error(context, error)
1646
+ return 29
1647
+ end
1648
+
1649
+ # Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0
1650
+ def match_token_at_30(token, context)
1651
+ if match_StepLine(context, token)
1652
+ end_rule(context, :DocString);
1653
+ end_rule(context, :Step);
1654
+ start_rule(context, :Step);
1655
+ build(context, token);
1656
+ return 20
1657
+ end
1658
+ if match_TagLine(context, token)
1659
+ end_rule(context, :DocString);
1660
+ end_rule(context, :Step);
1661
+ start_rule(context, :Examples_Definition);
1662
+ start_rule(context, :Tags);
1663
+ build(context, token);
1664
+ return 22
1665
+ end
1666
+ if match_ExamplesLine(context, token)
1667
+ end_rule(context, :DocString);
1668
+ end_rule(context, :Step);
1669
+ start_rule(context, :Examples_Definition);
1670
+ start_rule(context, :Examples);
1671
+ build(context, token);
1672
+ return 23
1673
+ end
1674
+ if match_Comment(context, token)
1675
+ build(context, token);
1676
+ return 30
1677
+ end
1678
+ if match_Empty(context, token)
1679
+ build(context, token);
1680
+ return 30
1681
+ end
1682
+
1683
+ state_comment = "State: 30 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0"
1684
+ token.detach
1685
+ expected_tokens = ["#StepLine", "#TagLine", "#ExamplesLine", "#Comment", "#Empty"]
1686
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
1687
+ raise error if (stop_at_first_error)
1688
+ add_error(context, error)
1689
+ return 30
1690
+ end
1691
+
1692
+ # Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0
1693
+ def match_token_at_31(token, context)
1694
+ if match_DocStringSeparator(context, token)
1695
+ build(context, token);
1696
+ return 32
1697
+ end
1698
+ if match_Other(context, token)
1699
+ build(context, token);
1700
+ return 31
1701
+ end
1702
+
1703
+ state_comment = "State: 31 - Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0"
1704
+ token.detach
1705
+ expected_tokens = ["#DocStringSeparator", "#Other"]
1706
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
1707
+ raise error if (stop_at_first_error)
1708
+ add_error(context, error)
1709
+ return 31
1710
+ end
1711
+
1712
+ # Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0
1713
+ def match_token_at_32(token, context)
1714
+ if match_EOF(context, token)
1715
+ end_rule(context, :DocString);
1716
+ end_rule(context, :Step);
1717
+ end_rule(context, :Scenario);
1718
+ end_rule(context, :Scenario_Definition);
1719
+ build(context, token);
1720
+ return 28
1721
+ end
1722
+ if match_StepLine(context, token)
1723
+ end_rule(context, :DocString);
1724
+ end_rule(context, :Step);
1725
+ start_rule(context, :Step);
1726
+ build(context, token);
1727
+ return 15
1728
+ end
1729
+ if match_TagLine(context, token)
1730
+ end_rule(context, :DocString);
1731
+ end_rule(context, :Step);
1732
+ end_rule(context, :Scenario);
1733
+ end_rule(context, :Scenario_Definition);
1734
+ start_rule(context, :Scenario_Definition);
1735
+ start_rule(context, :Tags);
1736
+ build(context, token);
1737
+ return 11
1738
+ end
1739
+ if match_ScenarioLine(context, token)
1740
+ end_rule(context, :DocString);
1741
+ end_rule(context, :Step);
1742
+ end_rule(context, :Scenario);
1743
+ end_rule(context, :Scenario_Definition);
1744
+ start_rule(context, :Scenario_Definition);
1745
+ start_rule(context, :Scenario);
1746
+ build(context, token);
1747
+ return 12
1748
+ end
1749
+ if match_ScenarioOutlineLine(context, token)
1750
+ end_rule(context, :DocString);
1751
+ end_rule(context, :Step);
1752
+ end_rule(context, :Scenario);
1753
+ end_rule(context, :Scenario_Definition);
1754
+ start_rule(context, :Scenario_Definition);
1755
+ start_rule(context, :ScenarioOutline);
1756
+ build(context, token);
1757
+ return 17
1758
+ end
1759
+ if match_Comment(context, token)
1760
+ build(context, token);
1761
+ return 32
1762
+ end
1763
+ if match_Empty(context, token)
1764
+ build(context, token);
1765
+ return 32
1766
+ end
1767
+
1768
+ state_comment = "State: 32 - Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0"
1769
+ token.detach
1770
+ expected_tokens = ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"]
1771
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
1772
+ raise error if (stop_at_first_error)
1773
+ add_error(context, error)
1774
+ return 32
1775
+ end
1776
+
1777
+ # Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0
1778
+ def match_token_at_33(token, context)
1779
+ if match_DocStringSeparator(context, token)
1780
+ build(context, token);
1781
+ return 34
1782
+ end
1783
+ if match_Other(context, token)
1784
+ build(context, token);
1785
+ return 33
1786
+ end
1787
+
1788
+ state_comment = "State: 33 - Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0"
1789
+ token.detach
1790
+ expected_tokens = ["#DocStringSeparator", "#Other"]
1791
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
1792
+ raise error if (stop_at_first_error)
1793
+ add_error(context, error)
1794
+ return 33
1795
+ end
1796
+
1797
+ # Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0
1798
+ def match_token_at_34(token, context)
1799
+ if match_EOF(context, token)
1800
+ end_rule(context, :DocString);
1801
+ end_rule(context, :Step);
1802
+ end_rule(context, :Background);
1803
+ build(context, token);
1804
+ return 28
1805
+ end
1806
+ if match_StepLine(context, token)
1807
+ end_rule(context, :DocString);
1808
+ end_rule(context, :Step);
1809
+ start_rule(context, :Step);
1810
+ build(context, token);
1811
+ return 9
1812
+ end
1813
+ if match_TagLine(context, token)
1814
+ end_rule(context, :DocString);
1815
+ end_rule(context, :Step);
1816
+ end_rule(context, :Background);
1817
+ start_rule(context, :Scenario_Definition);
1818
+ start_rule(context, :Tags);
1819
+ build(context, token);
1820
+ return 11
1821
+ end
1822
+ if match_ScenarioLine(context, token)
1823
+ end_rule(context, :DocString);
1824
+ end_rule(context, :Step);
1825
+ end_rule(context, :Background);
1826
+ start_rule(context, :Scenario_Definition);
1827
+ start_rule(context, :Scenario);
1828
+ build(context, token);
1829
+ return 12
1830
+ end
1831
+ if match_ScenarioOutlineLine(context, token)
1832
+ end_rule(context, :DocString);
1833
+ end_rule(context, :Step);
1834
+ end_rule(context, :Background);
1835
+ start_rule(context, :Scenario_Definition);
1836
+ start_rule(context, :ScenarioOutline);
1837
+ build(context, token);
1838
+ return 17
1839
+ end
1840
+ if match_Comment(context, token)
1841
+ build(context, token);
1842
+ return 34
1843
+ end
1844
+ if match_Empty(context, token)
1845
+ build(context, token);
1846
+ return 34
1847
+ end
1848
+
1849
+ state_comment = "State: 34 - Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0"
1850
+ token.detach
1851
+ expected_tokens = ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"]
1852
+ error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)
1853
+ raise error if (stop_at_first_error)
1854
+ add_error(context, error)
1855
+ return 34
1856
+ end
1857
+
1858
+
1859
+ def lookahead_0(context, currentToken)
1860
+ currentToken.detach
1861
+ token = nil
1862
+ queue = []
1863
+ match = false
1864
+ loop do
1865
+ token = read_token(context)
1866
+ token.detach
1867
+ queue.unshift(token)
1868
+
1869
+ if (false || match_ExamplesLine(context, token))
1870
+ match = true
1871
+ break
1872
+ end
1873
+
1874
+ break unless (false || match_Empty(context, token)|| match_Comment(context, token)|| match_TagLine(context, token))
1875
+ end
1876
+
1877
+ context.token_queue.concat(queue)
1878
+
1879
+ return match
1880
+ end
1881
+
1882
+
1883
+ private
1884
+
1885
+ def handle_ast_error(context, &action)
1886
+ handle_external_error(context, true, &action)
1887
+ end
1888
+
1889
+ def handle_external_error(context, default_value, &action)
1890
+ return action.call if stop_at_first_error
1891
+
1892
+ begin
1893
+ return action.call
1894
+ rescue CompositeParserException => e
1895
+ e.errors.each { |error| add_error(context, error) }
1896
+ rescue ParserException => e
1897
+ add_error(context, e)
1898
+ end
1899
+ default_value
1900
+ end
1901
+
1902
+ end
1903
+ end