gherkin3-pre-alpha 3.0.0.alpha.1

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