gherkin 5.1.0 → 6.0.10

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