cucumber 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +3 -0
- data/License.txt +20 -0
- data/Manifest.txt +152 -0
- data/README.txt +42 -0
- data/Rakefile +4 -0
- data/TODO.txt +26 -0
- data/bin/cucumber +4 -0
- data/config/hoe.rb +69 -0
- data/config/requirements.rb +15 -0
- data/cucumber.yml +1 -0
- data/examples/calculator/Rakefile +6 -0
- data/examples/calculator/cucumber.yml +1 -0
- data/examples/calculator/features/addition.feature +16 -0
- data/examples/calculator/features/division.feature +10 -0
- data/examples/calculator/features/steps/calculator_steps.rb +31 -0
- data/examples/calculator/lib/calculator.rb +16 -0
- data/examples/calculator_ruby_features/Rakefile +6 -0
- data/examples/calculator_ruby_features/features/addition.rb +23 -0
- data/examples/calculator_ruby_features/features/steps/calculator_steps.rb +43 -0
- data/examples/calculatrice_francaise_avec_soit_scenario/Rakefile +6 -0
- data/examples/calculatrice_francaise_avec_soit_scenario/features/addition.feature +13 -0
- data/examples/calculatrice_francaise_avec_soit_scenario/features/calculatrice_steps.rb +31 -0
- data/examples/cs/README.textile +22 -0
- data/examples/cs/Rakefile +12 -0
- data/examples/cs/features/hello.feature +11 -0
- data/examples/cs/features/steps/hello_steps.rb +25 -0
- data/examples/cs/features/steps/tree_steps.rb +14 -0
- data/examples/cs/features/tree.feature +9 -0
- data/examples/cs/src/Hello.cs +18 -0
- data/examples/danish_calculator/Rakefile +6 -0
- data/examples/danish_calculator/features/steps/kalkulator_steps.rb +22 -0
- data/examples/danish_calculator/features/summering.feature +17 -0
- data/examples/danish_calculator/lib/kalkulator.rb +11 -0
- data/examples/estonian_calculator/Rakefile +6 -0
- data/examples/estonian_calculator/features/kalkulaator_steps.rb +35 -0
- data/examples/estonian_calculator/features/liitmine.feature +16 -0
- data/examples/java/README.textile +22 -0
- data/examples/java/Rakefile +12 -0
- data/examples/java/features/hello.feature +11 -0
- data/examples/java/features/steps/hello_steps.rb +25 -0
- data/examples/java/features/steps/tree_steps.rb +14 -0
- data/examples/java/features/tree.feature +9 -0
- data/examples/java/src/cucumber/demo/Hello.java +16 -0
- data/examples/norwegian_calculator/Rakefile +6 -0
- data/examples/norwegian_calculator/features/steps/kalkulator_steps.rb +22 -0
- data/examples/norwegian_calculator/features/summering.feature +17 -0
- data/examples/norwegian_calculator/lib/kalkulator.rb +11 -0
- data/examples/portuguese_calculator/Rakefile +6 -0
- data/examples/portuguese_calculator/features/adicao.feature +10 -0
- data/examples/portuguese_calculator/features/calculadora_steps.rb +31 -0
- data/examples/selenium/Rakefile +6 -0
- data/examples/selenium/features/search.feature +9 -0
- data/examples/selenium/features/steps/stories_steps.rb +41 -0
- data/examples/spanish_calculator/Rakefile +6 -0
- data/examples/spanish_calculator/features/adicion.feature +17 -0
- data/examples/spanish_calculator/features/steps/calculador_steps.rb +22 -0
- data/examples/spanish_calculator/lib/Calculador.rb +11 -0
- data/examples/tickets/Rakefile +4 -0
- data/examples/tickets/features/steps/tickets_steps.rb +5 -0
- data/examples/tickets/features/tickets.feature +7 -0
- data/examples/watir/Rakefile +6 -0
- data/examples/watir/features/search.feature +9 -0
- data/examples/watir/features/steps/stories_steps.rb +51 -0
- data/features/see_features.feature +8 -0
- data/features/steps/features_steps.rb +9 -0
- data/gem_tasks/deployment.rake +34 -0
- data/gem_tasks/environment.rake +7 -0
- data/gem_tasks/features.rake +6 -0
- data/gem_tasks/fix_cr_lf.rake +10 -0
- data/gem_tasks/flog.rake +4 -0
- data/gem_tasks/gemspec.rake +6 -0
- data/gem_tasks/rspec.rake +21 -0
- data/gem_tasks/treetop.rake +27 -0
- data/generators/cucumber/cucumber_generator.rb +27 -0
- data/generators/cucumber/templates/common_webrat.rb +51 -0
- data/generators/cucumber/templates/cucumber +2 -0
- data/generators/cucumber/templates/cucumber.rake +7 -0
- data/generators/cucumber/templates/env.rb +8 -0
- data/generators/feature/feature_generator.rb +17 -0
- data/generators/feature/templates/feature.erb +27 -0
- data/generators/feature/templates/steps.erb +22 -0
- data/lib/cucumber.rb +32 -0
- data/lib/cucumber/cli.rb +163 -0
- data/lib/cucumber/core_ext/proc.rb +43 -0
- data/lib/cucumber/core_ext/string.rb +22 -0
- data/lib/cucumber/executor.rb +120 -0
- data/lib/cucumber/formatters.rb +1 -0
- data/lib/cucumber/formatters/ansicolor.rb +90 -0
- data/lib/cucumber/formatters/cucumber.css +132 -0
- data/lib/cucumber/formatters/cucumber.js +11 -0
- data/lib/cucumber/formatters/html_formatter.rb +125 -0
- data/lib/cucumber/formatters/jquery.js +32 -0
- data/lib/cucumber/formatters/pretty_formatter.rb +126 -0
- data/lib/cucumber/formatters/progress_formatter.rb +42 -0
- data/lib/cucumber/languages.yml +83 -0
- data/lib/cucumber/rails/rspec.rb +12 -0
- data/lib/cucumber/rails/world.rb +75 -0
- data/lib/cucumber/rake/task.rb +75 -0
- data/lib/cucumber/step_methods.rb +45 -0
- data/lib/cucumber/step_mother.rb +82 -0
- data/lib/cucumber/tree.rb +18 -0
- data/lib/cucumber/tree/feature.rb +53 -0
- data/lib/cucumber/tree/features.rb +21 -0
- data/lib/cucumber/tree/given_scenario.rb +13 -0
- data/lib/cucumber/tree/scenario.rb +110 -0
- data/lib/cucumber/tree/step.rb +123 -0
- data/lib/cucumber/tree/table.rb +26 -0
- data/lib/cucumber/tree/top_down_visitor.rb +23 -0
- data/lib/cucumber/treetop_parser/feature.treetop.erb +159 -0
- data/lib/cucumber/treetop_parser/feature_da.rb +1214 -0
- data/lib/cucumber/treetop_parser/feature_de.rb +1214 -0
- data/lib/cucumber/treetop_parser/feature_en.rb +1214 -0
- data/lib/cucumber/treetop_parser/feature_es.rb +1214 -0
- data/lib/cucumber/treetop_parser/feature_et.rb +1214 -0
- data/lib/cucumber/treetop_parser/feature_fr.rb +1214 -0
- data/lib/cucumber/treetop_parser/feature_no.rb +1214 -0
- data/lib/cucumber/treetop_parser/feature_parser.rb +32 -0
- data/lib/cucumber/treetop_parser/feature_pt.rb +1214 -0
- data/lib/cucumber/treetop_parser/feature_ru.rb +1214 -0
- data/lib/cucumber/treetop_parser/feature_se.rb +1214 -0
- data/lib/cucumber/version.rb +9 -0
- data/script/console +10 -0
- data/script/console.cmd +1 -0
- data/script/destroy +14 -0
- data/script/destroy.cmd +1 -0
- data/script/generate +14 -0
- data/script/generate.cmd +1 -0
- data/script/txt2html +74 -0
- data/script/txt2html.cmd +1 -0
- data/setup.rb +1585 -0
- data/spec/cucumber/cli_spec.rb +36 -0
- data/spec/cucumber/core_ext/proc_spec.rb +39 -0
- data/spec/cucumber/core_ext/string_spec.rb +34 -0
- data/spec/cucumber/executor_spec.rb +131 -0
- data/spec/cucumber/formatters/ansicolor_spec.rb +23 -0
- data/spec/cucumber/formatters/features.html +269 -0
- data/spec/cucumber/formatters/html_formatter_spec.rb +59 -0
- data/spec/cucumber/formatters/pretty_formatter_spec.rb +17 -0
- data/spec/cucumber/formatters/progress_formatter_spec.rb +44 -0
- data/spec/cucumber/sell_cucumbers.feature +9 -0
- data/spec/cucumber/step_mother_spec.rb +53 -0
- data/spec/cucumber/tree/scenario_spec.rb +15 -0
- data/spec/cucumber/treetop_parser/empty_feature.feature +4 -0
- data/spec/cucumber/treetop_parser/empty_scenario.feature +9 -0
- data/spec/cucumber/treetop_parser/feature_parser_spec.rb +73 -0
- data/spec/cucumber/treetop_parser/fit_scenario.feature +7 -0
- data/spec/cucumber/treetop_parser/given_scenario.feature +9 -0
- data/spec/cucumber/treetop_parser/multiple_tables.feature +27 -0
- data/spec/cucumber/treetop_parser/spaces.feature +10 -0
- data/spec/cucumber/treetop_parser/with_comments.feature +6 -0
- data/spec/spec.opts +2 -0
- data/spec/spec_helper.rb +23 -0
- metadata +259 -0
@@ -0,0 +1,1214 @@
|
|
1
|
+
module Cucumber
|
2
|
+
module TreetopParser
|
3
|
+
|
4
|
+
module Feature
|
5
|
+
include Treetop::Runtime
|
6
|
+
|
7
|
+
def root
|
8
|
+
@root || :root
|
9
|
+
end
|
10
|
+
|
11
|
+
module Root0
|
12
|
+
def header
|
13
|
+
elements[0]
|
14
|
+
end
|
15
|
+
|
16
|
+
def scenario_sequence
|
17
|
+
elements[1]
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
module Root1
|
23
|
+
def compile
|
24
|
+
feature = Tree::Feature.new(header.text_value.strip)
|
25
|
+
scenario_sequence.compile(feature)
|
26
|
+
feature
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def _nt_root
|
31
|
+
start_index = index
|
32
|
+
if node_cache[:root].has_key?(index)
|
33
|
+
cached = node_cache[:root][index]
|
34
|
+
@index = cached.interval.end if cached
|
35
|
+
return cached
|
36
|
+
end
|
37
|
+
|
38
|
+
i0, s0 = index, []
|
39
|
+
r1 = _nt_header
|
40
|
+
s0 << r1
|
41
|
+
if r1
|
42
|
+
r2 = _nt_scenario_sequence
|
43
|
+
s0 << r2
|
44
|
+
if r2
|
45
|
+
r4 = _nt_space
|
46
|
+
if r4
|
47
|
+
r3 = r4
|
48
|
+
else
|
49
|
+
r3 = SyntaxNode.new(input, index...index)
|
50
|
+
end
|
51
|
+
s0 << r3
|
52
|
+
end
|
53
|
+
end
|
54
|
+
if s0.last
|
55
|
+
r0 = (SyntaxNode).new(input, i0...index, s0)
|
56
|
+
r0.extend(Root0)
|
57
|
+
r0.extend(Root1)
|
58
|
+
else
|
59
|
+
self.index = i0
|
60
|
+
r0 = nil
|
61
|
+
end
|
62
|
+
|
63
|
+
node_cache[:root][start_index] = r0
|
64
|
+
|
65
|
+
return r0
|
66
|
+
end
|
67
|
+
|
68
|
+
module Header0
|
69
|
+
end
|
70
|
+
|
71
|
+
def _nt_header
|
72
|
+
start_index = index
|
73
|
+
if node_cache[:header].has_key?(index)
|
74
|
+
cached = node_cache[:header][index]
|
75
|
+
@index = cached.interval.end if cached
|
76
|
+
return cached
|
77
|
+
end
|
78
|
+
|
79
|
+
s0, i0 = [], index
|
80
|
+
loop do
|
81
|
+
i1, s1 = index, []
|
82
|
+
i2 = index
|
83
|
+
r3 = _nt_scenario_keyword
|
84
|
+
if r3
|
85
|
+
r2 = nil
|
86
|
+
else
|
87
|
+
self.index = i2
|
88
|
+
r2 = SyntaxNode.new(input, index...index)
|
89
|
+
end
|
90
|
+
s1 << r2
|
91
|
+
if r2
|
92
|
+
if index < input_length
|
93
|
+
r4 = (SyntaxNode).new(input, index...(index + 1))
|
94
|
+
@index += 1
|
95
|
+
else
|
96
|
+
terminal_parse_failure("any character")
|
97
|
+
r4 = nil
|
98
|
+
end
|
99
|
+
s1 << r4
|
100
|
+
end
|
101
|
+
if s1.last
|
102
|
+
r1 = (SyntaxNode).new(input, i1...index, s1)
|
103
|
+
r1.extend(Header0)
|
104
|
+
else
|
105
|
+
self.index = i1
|
106
|
+
r1 = nil
|
107
|
+
end
|
108
|
+
if r1
|
109
|
+
s0 << r1
|
110
|
+
else
|
111
|
+
break
|
112
|
+
end
|
113
|
+
end
|
114
|
+
if s0.empty?
|
115
|
+
self.index = i0
|
116
|
+
r0 = nil
|
117
|
+
else
|
118
|
+
r0 = SyntaxNode.new(input, i0...index, s0)
|
119
|
+
end
|
120
|
+
|
121
|
+
node_cache[:header][start_index] = r0
|
122
|
+
|
123
|
+
return r0
|
124
|
+
end
|
125
|
+
|
126
|
+
module ScenarioSequence0
|
127
|
+
def space
|
128
|
+
elements[0]
|
129
|
+
end
|
130
|
+
|
131
|
+
def scenario_or_table
|
132
|
+
elements[1]
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
module ScenarioSequence1
|
137
|
+
def head
|
138
|
+
elements[0]
|
139
|
+
end
|
140
|
+
|
141
|
+
def tail
|
142
|
+
elements[1]
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
module ScenarioSequence2
|
147
|
+
def compile(feature)
|
148
|
+
([head] + tail).each do |scenario_or_table|
|
149
|
+
scenario_or_table.compile(feature) if scenario_or_table.respond_to?(:compile)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
def tail
|
154
|
+
super.elements.map { |elt| elt.scenario_or_table }
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
def _nt_scenario_sequence
|
159
|
+
start_index = index
|
160
|
+
if node_cache[:scenario_sequence].has_key?(index)
|
161
|
+
cached = node_cache[:scenario_sequence][index]
|
162
|
+
@index = cached.interval.end if cached
|
163
|
+
return cached
|
164
|
+
end
|
165
|
+
|
166
|
+
i0, s0 = index, []
|
167
|
+
r2 = _nt_scenario
|
168
|
+
if r2
|
169
|
+
r1 = r2
|
170
|
+
else
|
171
|
+
r1 = SyntaxNode.new(input, index...index)
|
172
|
+
end
|
173
|
+
s0 << r1
|
174
|
+
if r1
|
175
|
+
s3, i3 = [], index
|
176
|
+
loop do
|
177
|
+
i4, s4 = index, []
|
178
|
+
r5 = _nt_space
|
179
|
+
s4 << r5
|
180
|
+
if r5
|
181
|
+
r6 = _nt_scenario_or_table
|
182
|
+
s4 << r6
|
183
|
+
end
|
184
|
+
if s4.last
|
185
|
+
r4 = (SyntaxNode).new(input, i4...index, s4)
|
186
|
+
r4.extend(ScenarioSequence0)
|
187
|
+
else
|
188
|
+
self.index = i4
|
189
|
+
r4 = nil
|
190
|
+
end
|
191
|
+
if r4
|
192
|
+
s3 << r4
|
193
|
+
else
|
194
|
+
break
|
195
|
+
end
|
196
|
+
end
|
197
|
+
r3 = SyntaxNode.new(input, i3...index, s3)
|
198
|
+
s0 << r3
|
199
|
+
end
|
200
|
+
if s0.last
|
201
|
+
r0 = (SyntaxNode).new(input, i0...index, s0)
|
202
|
+
r0.extend(ScenarioSequence1)
|
203
|
+
r0.extend(ScenarioSequence2)
|
204
|
+
else
|
205
|
+
self.index = i0
|
206
|
+
r0 = nil
|
207
|
+
end
|
208
|
+
|
209
|
+
node_cache[:scenario_sequence][start_index] = r0
|
210
|
+
|
211
|
+
return r0
|
212
|
+
end
|
213
|
+
|
214
|
+
module Scenario0
|
215
|
+
def space
|
216
|
+
elements[0]
|
217
|
+
end
|
218
|
+
|
219
|
+
def step_sequence
|
220
|
+
elements[1]
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
module Scenario1
|
225
|
+
def scenario_keyword
|
226
|
+
elements[0]
|
227
|
+
end
|
228
|
+
|
229
|
+
def space
|
230
|
+
elements[1]
|
231
|
+
end
|
232
|
+
|
233
|
+
def name
|
234
|
+
elements[2]
|
235
|
+
end
|
236
|
+
|
237
|
+
def steps
|
238
|
+
elements[3]
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
242
|
+
module Scenario2
|
243
|
+
def compile(feature)
|
244
|
+
scenario = feature.add_scenario(name.text_value.strip)
|
245
|
+
steps.step_sequence.compile(scenario) if steps.respond_to?(:step_sequence)
|
246
|
+
# TODO - GET RID OF THIS last_scenario NASTINESS
|
247
|
+
# Use a better datastructure, like a linked list...
|
248
|
+
Feature.last_scenario = scenario
|
249
|
+
end
|
250
|
+
end
|
251
|
+
|
252
|
+
def _nt_scenario
|
253
|
+
start_index = index
|
254
|
+
if node_cache[:scenario].has_key?(index)
|
255
|
+
cached = node_cache[:scenario][index]
|
256
|
+
@index = cached.interval.end if cached
|
257
|
+
return cached
|
258
|
+
end
|
259
|
+
|
260
|
+
i0, s0 = index, []
|
261
|
+
r1 = _nt_scenario_keyword
|
262
|
+
s0 << r1
|
263
|
+
if r1
|
264
|
+
r2 = _nt_space
|
265
|
+
s0 << r2
|
266
|
+
if r2
|
267
|
+
r3 = _nt_line_to_eol
|
268
|
+
s0 << r3
|
269
|
+
if r3
|
270
|
+
i5, s5 = index, []
|
271
|
+
r6 = _nt_space
|
272
|
+
s5 << r6
|
273
|
+
if r6
|
274
|
+
r7 = _nt_step_sequence
|
275
|
+
s5 << r7
|
276
|
+
end
|
277
|
+
if s5.last
|
278
|
+
r5 = (SyntaxNode).new(input, i5...index, s5)
|
279
|
+
r5.extend(Scenario0)
|
280
|
+
else
|
281
|
+
self.index = i5
|
282
|
+
r5 = nil
|
283
|
+
end
|
284
|
+
if r5
|
285
|
+
r4 = r5
|
286
|
+
else
|
287
|
+
r4 = SyntaxNode.new(input, index...index)
|
288
|
+
end
|
289
|
+
s0 << r4
|
290
|
+
end
|
291
|
+
end
|
292
|
+
end
|
293
|
+
if s0.last
|
294
|
+
r0 = (SyntaxNode).new(input, i0...index, s0)
|
295
|
+
r0.extend(Scenario1)
|
296
|
+
r0.extend(Scenario2)
|
297
|
+
else
|
298
|
+
self.index = i0
|
299
|
+
r0 = nil
|
300
|
+
end
|
301
|
+
|
302
|
+
node_cache[:scenario][start_index] = r0
|
303
|
+
|
304
|
+
return r0
|
305
|
+
end
|
306
|
+
|
307
|
+
def _nt_scenario_or_table
|
308
|
+
start_index = index
|
309
|
+
if node_cache[:scenario_or_table].has_key?(index)
|
310
|
+
cached = node_cache[:scenario_or_table][index]
|
311
|
+
@index = cached.interval.end if cached
|
312
|
+
return cached
|
313
|
+
end
|
314
|
+
|
315
|
+
i0 = index
|
316
|
+
r1 = _nt_scenario
|
317
|
+
if r1
|
318
|
+
r0 = r1
|
319
|
+
else
|
320
|
+
r2 = _nt_table
|
321
|
+
if r2
|
322
|
+
r0 = r2
|
323
|
+
else
|
324
|
+
self.index = i0
|
325
|
+
r0 = nil
|
326
|
+
end
|
327
|
+
end
|
328
|
+
|
329
|
+
node_cache[:scenario_or_table][start_index] = r0
|
330
|
+
|
331
|
+
return r0
|
332
|
+
end
|
333
|
+
|
334
|
+
module Table0
|
335
|
+
def eol
|
336
|
+
elements[1]
|
337
|
+
end
|
338
|
+
|
339
|
+
def table_line
|
340
|
+
elements[3]
|
341
|
+
end
|
342
|
+
end
|
343
|
+
|
344
|
+
module Table1
|
345
|
+
def head
|
346
|
+
elements[0]
|
347
|
+
end
|
348
|
+
|
349
|
+
def body
|
350
|
+
elements[1]
|
351
|
+
end
|
352
|
+
end
|
353
|
+
|
354
|
+
module Table2
|
355
|
+
def compile(feature)
|
356
|
+
Feature.last_scenario.table_header = head.cell_values
|
357
|
+
body.each do |table_line|
|
358
|
+
feature.add_row_scenario(Feature.last_scenario, table_line.cell_values, table_line.line)
|
359
|
+
end
|
360
|
+
end
|
361
|
+
|
362
|
+
def body
|
363
|
+
super.elements.map { |elt| elt.table_line }
|
364
|
+
end
|
365
|
+
end
|
366
|
+
|
367
|
+
def _nt_table
|
368
|
+
start_index = index
|
369
|
+
if node_cache[:table].has_key?(index)
|
370
|
+
cached = node_cache[:table][index]
|
371
|
+
@index = cached.interval.end if cached
|
372
|
+
return cached
|
373
|
+
end
|
374
|
+
|
375
|
+
i0, s0 = index, []
|
376
|
+
r1 = _nt_table_line
|
377
|
+
s0 << r1
|
378
|
+
if r1
|
379
|
+
s2, i2 = [], index
|
380
|
+
loop do
|
381
|
+
i3, s3 = index, []
|
382
|
+
s4, i4 = [], index
|
383
|
+
loop do
|
384
|
+
r5 = _nt_blank
|
385
|
+
if r5
|
386
|
+
s4 << r5
|
387
|
+
else
|
388
|
+
break
|
389
|
+
end
|
390
|
+
end
|
391
|
+
r4 = SyntaxNode.new(input, i4...index, s4)
|
392
|
+
s3 << r4
|
393
|
+
if r4
|
394
|
+
r6 = _nt_eol
|
395
|
+
s3 << r6
|
396
|
+
if r6
|
397
|
+
r8 = _nt_space
|
398
|
+
if r8
|
399
|
+
r7 = r8
|
400
|
+
else
|
401
|
+
r7 = SyntaxNode.new(input, index...index)
|
402
|
+
end
|
403
|
+
s3 << r7
|
404
|
+
if r7
|
405
|
+
r9 = _nt_table_line
|
406
|
+
s3 << r9
|
407
|
+
end
|
408
|
+
end
|
409
|
+
end
|
410
|
+
if s3.last
|
411
|
+
r3 = (SyntaxNode).new(input, i3...index, s3)
|
412
|
+
r3.extend(Table0)
|
413
|
+
else
|
414
|
+
self.index = i3
|
415
|
+
r3 = nil
|
416
|
+
end
|
417
|
+
if r3
|
418
|
+
s2 << r3
|
419
|
+
else
|
420
|
+
break
|
421
|
+
end
|
422
|
+
end
|
423
|
+
r2 = SyntaxNode.new(input, i2...index, s2)
|
424
|
+
s0 << r2
|
425
|
+
end
|
426
|
+
if s0.last
|
427
|
+
r0 = (SyntaxNode).new(input, i0...index, s0)
|
428
|
+
r0.extend(Table1)
|
429
|
+
r0.extend(Table2)
|
430
|
+
else
|
431
|
+
self.index = i0
|
432
|
+
r0 = nil
|
433
|
+
end
|
434
|
+
|
435
|
+
node_cache[:table][start_index] = r0
|
436
|
+
|
437
|
+
return r0
|
438
|
+
end
|
439
|
+
|
440
|
+
module TableLine0
|
441
|
+
def cell_value
|
442
|
+
elements[1]
|
443
|
+
end
|
444
|
+
|
445
|
+
def separator
|
446
|
+
elements[3]
|
447
|
+
end
|
448
|
+
end
|
449
|
+
|
450
|
+
module TableLine1
|
451
|
+
def separator
|
452
|
+
elements[0]
|
453
|
+
end
|
454
|
+
|
455
|
+
def cells
|
456
|
+
elements[1]
|
457
|
+
end
|
458
|
+
end
|
459
|
+
|
460
|
+
module TableLine2
|
461
|
+
def cell_values
|
462
|
+
cells.elements.map { |elt| elt.cell_value.text_value.strip }
|
463
|
+
end
|
464
|
+
|
465
|
+
def line
|
466
|
+
input.line_of(interval.first)
|
467
|
+
end
|
468
|
+
end
|
469
|
+
|
470
|
+
def _nt_table_line
|
471
|
+
start_index = index
|
472
|
+
if node_cache[:table_line].has_key?(index)
|
473
|
+
cached = node_cache[:table_line][index]
|
474
|
+
@index = cached.interval.end if cached
|
475
|
+
return cached
|
476
|
+
end
|
477
|
+
|
478
|
+
i0, s0 = index, []
|
479
|
+
r1 = _nt_separator
|
480
|
+
s0 << r1
|
481
|
+
if r1
|
482
|
+
s2, i2 = [], index
|
483
|
+
loop do
|
484
|
+
i3, s3 = index, []
|
485
|
+
s4, i4 = [], index
|
486
|
+
loop do
|
487
|
+
r5 = _nt_blank
|
488
|
+
if r5
|
489
|
+
s4 << r5
|
490
|
+
else
|
491
|
+
break
|
492
|
+
end
|
493
|
+
end
|
494
|
+
r4 = SyntaxNode.new(input, i4...index, s4)
|
495
|
+
s3 << r4
|
496
|
+
if r4
|
497
|
+
r6 = _nt_cell_value
|
498
|
+
s3 << r6
|
499
|
+
if r6
|
500
|
+
s7, i7 = [], index
|
501
|
+
loop do
|
502
|
+
r8 = _nt_blank
|
503
|
+
if r8
|
504
|
+
s7 << r8
|
505
|
+
else
|
506
|
+
break
|
507
|
+
end
|
508
|
+
end
|
509
|
+
r7 = SyntaxNode.new(input, i7...index, s7)
|
510
|
+
s3 << r7
|
511
|
+
if r7
|
512
|
+
r9 = _nt_separator
|
513
|
+
s3 << r9
|
514
|
+
end
|
515
|
+
end
|
516
|
+
end
|
517
|
+
if s3.last
|
518
|
+
r3 = (SyntaxNode).new(input, i3...index, s3)
|
519
|
+
r3.extend(TableLine0)
|
520
|
+
else
|
521
|
+
self.index = i3
|
522
|
+
r3 = nil
|
523
|
+
end
|
524
|
+
if r3
|
525
|
+
s2 << r3
|
526
|
+
else
|
527
|
+
break
|
528
|
+
end
|
529
|
+
end
|
530
|
+
if s2.empty?
|
531
|
+
self.index = i2
|
532
|
+
r2 = nil
|
533
|
+
else
|
534
|
+
r2 = SyntaxNode.new(input, i2...index, s2)
|
535
|
+
end
|
536
|
+
s0 << r2
|
537
|
+
end
|
538
|
+
if s0.last
|
539
|
+
r0 = (SyntaxNode).new(input, i0...index, s0)
|
540
|
+
r0.extend(TableLine1)
|
541
|
+
r0.extend(TableLine2)
|
542
|
+
else
|
543
|
+
self.index = i0
|
544
|
+
r0 = nil
|
545
|
+
end
|
546
|
+
|
547
|
+
node_cache[:table_line][start_index] = r0
|
548
|
+
|
549
|
+
return r0
|
550
|
+
end
|
551
|
+
|
552
|
+
module CellValue0
|
553
|
+
end
|
554
|
+
|
555
|
+
def _nt_cell_value
|
556
|
+
start_index = index
|
557
|
+
if node_cache[:cell_value].has_key?(index)
|
558
|
+
cached = node_cache[:cell_value][index]
|
559
|
+
@index = cached.interval.end if cached
|
560
|
+
return cached
|
561
|
+
end
|
562
|
+
|
563
|
+
s0, i0 = [], index
|
564
|
+
loop do
|
565
|
+
i1, s1 = index, []
|
566
|
+
i2 = index
|
567
|
+
i3 = index
|
568
|
+
r4 = _nt_separator
|
569
|
+
if r4
|
570
|
+
r3 = r4
|
571
|
+
else
|
572
|
+
r5 = _nt_eol
|
573
|
+
if r5
|
574
|
+
r3 = r5
|
575
|
+
else
|
576
|
+
self.index = i3
|
577
|
+
r3 = nil
|
578
|
+
end
|
579
|
+
end
|
580
|
+
if r3
|
581
|
+
r2 = nil
|
582
|
+
else
|
583
|
+
self.index = i2
|
584
|
+
r2 = SyntaxNode.new(input, index...index)
|
585
|
+
end
|
586
|
+
s1 << r2
|
587
|
+
if r2
|
588
|
+
if index < input_length
|
589
|
+
r6 = (SyntaxNode).new(input, index...(index + 1))
|
590
|
+
@index += 1
|
591
|
+
else
|
592
|
+
terminal_parse_failure("any character")
|
593
|
+
r6 = nil
|
594
|
+
end
|
595
|
+
s1 << r6
|
596
|
+
end
|
597
|
+
if s1.last
|
598
|
+
r1 = (SyntaxNode).new(input, i1...index, s1)
|
599
|
+
r1.extend(CellValue0)
|
600
|
+
else
|
601
|
+
self.index = i1
|
602
|
+
r1 = nil
|
603
|
+
end
|
604
|
+
if r1
|
605
|
+
s0 << r1
|
606
|
+
else
|
607
|
+
break
|
608
|
+
end
|
609
|
+
end
|
610
|
+
r0 = SyntaxNode.new(input, i0...index, s0)
|
611
|
+
|
612
|
+
node_cache[:cell_value][start_index] = r0
|
613
|
+
|
614
|
+
return r0
|
615
|
+
end
|
616
|
+
|
617
|
+
module StepSequence0
|
618
|
+
def space
|
619
|
+
elements[0]
|
620
|
+
end
|
621
|
+
|
622
|
+
def step
|
623
|
+
elements[1]
|
624
|
+
end
|
625
|
+
end
|
626
|
+
|
627
|
+
module StepSequence1
|
628
|
+
def head
|
629
|
+
elements[0]
|
630
|
+
end
|
631
|
+
|
632
|
+
def tail
|
633
|
+
elements[1]
|
634
|
+
end
|
635
|
+
end
|
636
|
+
|
637
|
+
module StepSequence2
|
638
|
+
def compile(scenario)
|
639
|
+
([head] + tail).each do |step|
|
640
|
+
step.compile(scenario)
|
641
|
+
end
|
642
|
+
end
|
643
|
+
|
644
|
+
def tail
|
645
|
+
super.elements.map { |elt| elt.step }
|
646
|
+
end
|
647
|
+
end
|
648
|
+
|
649
|
+
def _nt_step_sequence
|
650
|
+
start_index = index
|
651
|
+
if node_cache[:step_sequence].has_key?(index)
|
652
|
+
cached = node_cache[:step_sequence][index]
|
653
|
+
@index = cached.interval.end if cached
|
654
|
+
return cached
|
655
|
+
end
|
656
|
+
|
657
|
+
i0, s0 = index, []
|
658
|
+
r1 = _nt_step
|
659
|
+
s0 << r1
|
660
|
+
if r1
|
661
|
+
s2, i2 = [], index
|
662
|
+
loop do
|
663
|
+
i3, s3 = index, []
|
664
|
+
r4 = _nt_space
|
665
|
+
s3 << r4
|
666
|
+
if r4
|
667
|
+
r5 = _nt_step
|
668
|
+
s3 << r5
|
669
|
+
end
|
670
|
+
if s3.last
|
671
|
+
r3 = (SyntaxNode).new(input, i3...index, s3)
|
672
|
+
r3.extend(StepSequence0)
|
673
|
+
else
|
674
|
+
self.index = i3
|
675
|
+
r3 = nil
|
676
|
+
end
|
677
|
+
if r3
|
678
|
+
s2 << r3
|
679
|
+
else
|
680
|
+
break
|
681
|
+
end
|
682
|
+
end
|
683
|
+
r2 = SyntaxNode.new(input, i2...index, s2)
|
684
|
+
s0 << r2
|
685
|
+
end
|
686
|
+
if s0.last
|
687
|
+
r0 = (SyntaxNode).new(input, i0...index, s0)
|
688
|
+
r0.extend(StepSequence1)
|
689
|
+
r0.extend(StepSequence2)
|
690
|
+
else
|
691
|
+
self.index = i0
|
692
|
+
r0 = nil
|
693
|
+
end
|
694
|
+
|
695
|
+
node_cache[:step_sequence][start_index] = r0
|
696
|
+
|
697
|
+
return r0
|
698
|
+
end
|
699
|
+
|
700
|
+
def _nt_step
|
701
|
+
start_index = index
|
702
|
+
if node_cache[:step].has_key?(index)
|
703
|
+
cached = node_cache[:step][index]
|
704
|
+
@index = cached.interval.end if cached
|
705
|
+
return cached
|
706
|
+
end
|
707
|
+
|
708
|
+
i0 = index
|
709
|
+
r1 = _nt_given_scenario
|
710
|
+
if r1
|
711
|
+
r0 = r1
|
712
|
+
else
|
713
|
+
r2 = _nt_plain_step
|
714
|
+
if r2
|
715
|
+
r0 = r2
|
716
|
+
else
|
717
|
+
self.index = i0
|
718
|
+
r0 = nil
|
719
|
+
end
|
720
|
+
end
|
721
|
+
|
722
|
+
node_cache[:step][start_index] = r0
|
723
|
+
|
724
|
+
return r0
|
725
|
+
end
|
726
|
+
|
727
|
+
module GivenScenario0
|
728
|
+
def given_scenario_keyword
|
729
|
+
elements[0]
|
730
|
+
end
|
731
|
+
|
732
|
+
def space
|
733
|
+
elements[1]
|
734
|
+
end
|
735
|
+
|
736
|
+
def name
|
737
|
+
elements[2]
|
738
|
+
end
|
739
|
+
end
|
740
|
+
|
741
|
+
module GivenScenario1
|
742
|
+
def compile(scenario)
|
743
|
+
line = input.line_of(interval.first)
|
744
|
+
scenario.add_given_scenario(name.text_value.strip, line)
|
745
|
+
end
|
746
|
+
end
|
747
|
+
|
748
|
+
def _nt_given_scenario
|
749
|
+
start_index = index
|
750
|
+
if node_cache[:given_scenario].has_key?(index)
|
751
|
+
cached = node_cache[:given_scenario][index]
|
752
|
+
@index = cached.interval.end if cached
|
753
|
+
return cached
|
754
|
+
end
|
755
|
+
|
756
|
+
i0, s0 = index, []
|
757
|
+
r1 = _nt_given_scenario_keyword
|
758
|
+
s0 << r1
|
759
|
+
if r1
|
760
|
+
r2 = _nt_space
|
761
|
+
s0 << r2
|
762
|
+
if r2
|
763
|
+
r3 = _nt_line_to_eol
|
764
|
+
s0 << r3
|
765
|
+
end
|
766
|
+
end
|
767
|
+
if s0.last
|
768
|
+
r0 = (SyntaxNode).new(input, i0...index, s0)
|
769
|
+
r0.extend(GivenScenario0)
|
770
|
+
r0.extend(GivenScenario1)
|
771
|
+
else
|
772
|
+
self.index = i0
|
773
|
+
r0 = nil
|
774
|
+
end
|
775
|
+
|
776
|
+
node_cache[:given_scenario][start_index] = r0
|
777
|
+
|
778
|
+
return r0
|
779
|
+
end
|
780
|
+
|
781
|
+
module PlainStep0
|
782
|
+
def step_keyword
|
783
|
+
elements[0]
|
784
|
+
end
|
785
|
+
|
786
|
+
def space
|
787
|
+
elements[1]
|
788
|
+
end
|
789
|
+
|
790
|
+
def name
|
791
|
+
elements[2]
|
792
|
+
end
|
793
|
+
end
|
794
|
+
|
795
|
+
module PlainStep1
|
796
|
+
def compile(scenario)
|
797
|
+
line = input.line_of(interval.first)
|
798
|
+
scenario.add_step(step_keyword.text_value, name.text_value.strip, line)
|
799
|
+
end
|
800
|
+
end
|
801
|
+
|
802
|
+
def _nt_plain_step
|
803
|
+
start_index = index
|
804
|
+
if node_cache[:plain_step].has_key?(index)
|
805
|
+
cached = node_cache[:plain_step][index]
|
806
|
+
@index = cached.interval.end if cached
|
807
|
+
return cached
|
808
|
+
end
|
809
|
+
|
810
|
+
i0, s0 = index, []
|
811
|
+
r1 = _nt_step_keyword
|
812
|
+
s0 << r1
|
813
|
+
if r1
|
814
|
+
r2 = _nt_space
|
815
|
+
s0 << r2
|
816
|
+
if r2
|
817
|
+
r3 = _nt_line_to_eol
|
818
|
+
s0 << r3
|
819
|
+
end
|
820
|
+
end
|
821
|
+
if s0.last
|
822
|
+
r0 = (SyntaxNode).new(input, i0...index, s0)
|
823
|
+
r0.extend(PlainStep0)
|
824
|
+
r0.extend(PlainStep1)
|
825
|
+
else
|
826
|
+
self.index = i0
|
827
|
+
r0 = nil
|
828
|
+
end
|
829
|
+
|
830
|
+
node_cache[:plain_step][start_index] = r0
|
831
|
+
|
832
|
+
return r0
|
833
|
+
end
|
834
|
+
|
835
|
+
def _nt_separator
|
836
|
+
start_index = index
|
837
|
+
if node_cache[:separator].has_key?(index)
|
838
|
+
cached = node_cache[:separator][index]
|
839
|
+
@index = cached.interval.end if cached
|
840
|
+
return cached
|
841
|
+
end
|
842
|
+
|
843
|
+
if input.index('|', index) == index
|
844
|
+
r0 = (SyntaxNode).new(input, index...(index + 1))
|
845
|
+
@index += 1
|
846
|
+
else
|
847
|
+
terminal_parse_failure('|')
|
848
|
+
r0 = nil
|
849
|
+
end
|
850
|
+
|
851
|
+
node_cache[:separator][start_index] = r0
|
852
|
+
|
853
|
+
return r0
|
854
|
+
end
|
855
|
+
|
856
|
+
def _nt_space
|
857
|
+
start_index = index
|
858
|
+
if node_cache[:space].has_key?(index)
|
859
|
+
cached = node_cache[:space][index]
|
860
|
+
@index = cached.interval.end if cached
|
861
|
+
return cached
|
862
|
+
end
|
863
|
+
|
864
|
+
s0, i0 = [], index
|
865
|
+
loop do
|
866
|
+
i1 = index
|
867
|
+
r2 = _nt_white
|
868
|
+
if r2
|
869
|
+
r1 = r2
|
870
|
+
else
|
871
|
+
r3 = _nt_comment_to_eol
|
872
|
+
if r3
|
873
|
+
r1 = r3
|
874
|
+
else
|
875
|
+
self.index = i1
|
876
|
+
r1 = nil
|
877
|
+
end
|
878
|
+
end
|
879
|
+
if r1
|
880
|
+
s0 << r1
|
881
|
+
else
|
882
|
+
break
|
883
|
+
end
|
884
|
+
end
|
885
|
+
if s0.empty?
|
886
|
+
self.index = i0
|
887
|
+
r0 = nil
|
888
|
+
else
|
889
|
+
r0 = SyntaxNode.new(input, i0...index, s0)
|
890
|
+
end
|
891
|
+
|
892
|
+
node_cache[:space][start_index] = r0
|
893
|
+
|
894
|
+
return r0
|
895
|
+
end
|
896
|
+
|
897
|
+
module LineToEol0
|
898
|
+
end
|
899
|
+
|
900
|
+
def _nt_line_to_eol
|
901
|
+
start_index = index
|
902
|
+
if node_cache[:line_to_eol].has_key?(index)
|
903
|
+
cached = node_cache[:line_to_eol][index]
|
904
|
+
@index = cached.interval.end if cached
|
905
|
+
return cached
|
906
|
+
end
|
907
|
+
|
908
|
+
s0, i0 = [], index
|
909
|
+
loop do
|
910
|
+
i1, s1 = index, []
|
911
|
+
i2 = index
|
912
|
+
r3 = _nt_eol
|
913
|
+
if r3
|
914
|
+
r2 = nil
|
915
|
+
else
|
916
|
+
self.index = i2
|
917
|
+
r2 = SyntaxNode.new(input, index...index)
|
918
|
+
end
|
919
|
+
s1 << r2
|
920
|
+
if r2
|
921
|
+
if index < input_length
|
922
|
+
r4 = (SyntaxNode).new(input, index...(index + 1))
|
923
|
+
@index += 1
|
924
|
+
else
|
925
|
+
terminal_parse_failure("any character")
|
926
|
+
r4 = nil
|
927
|
+
end
|
928
|
+
s1 << r4
|
929
|
+
end
|
930
|
+
if s1.last
|
931
|
+
r1 = (SyntaxNode).new(input, i1...index, s1)
|
932
|
+
r1.extend(LineToEol0)
|
933
|
+
else
|
934
|
+
self.index = i1
|
935
|
+
r1 = nil
|
936
|
+
end
|
937
|
+
if r1
|
938
|
+
s0 << r1
|
939
|
+
else
|
940
|
+
break
|
941
|
+
end
|
942
|
+
end
|
943
|
+
r0 = SyntaxNode.new(input, i0...index, s0)
|
944
|
+
|
945
|
+
node_cache[:line_to_eol][start_index] = r0
|
946
|
+
|
947
|
+
return r0
|
948
|
+
end
|
949
|
+
|
950
|
+
module CommentToEol0
|
951
|
+
def line_to_eol
|
952
|
+
elements[1]
|
953
|
+
end
|
954
|
+
end
|
955
|
+
|
956
|
+
def _nt_comment_to_eol
|
957
|
+
start_index = index
|
958
|
+
if node_cache[:comment_to_eol].has_key?(index)
|
959
|
+
cached = node_cache[:comment_to_eol][index]
|
960
|
+
@index = cached.interval.end if cached
|
961
|
+
return cached
|
962
|
+
end
|
963
|
+
|
964
|
+
i0, s0 = index, []
|
965
|
+
if input.index('#', index) == index
|
966
|
+
r1 = (SyntaxNode).new(input, index...(index + 1))
|
967
|
+
@index += 1
|
968
|
+
else
|
969
|
+
terminal_parse_failure('#')
|
970
|
+
r1 = nil
|
971
|
+
end
|
972
|
+
s0 << r1
|
973
|
+
if r1
|
974
|
+
r2 = _nt_line_to_eol
|
975
|
+
s0 << r2
|
976
|
+
end
|
977
|
+
if s0.last
|
978
|
+
r0 = (SyntaxNode).new(input, i0...index, s0)
|
979
|
+
r0.extend(CommentToEol0)
|
980
|
+
else
|
981
|
+
self.index = i0
|
982
|
+
r0 = nil
|
983
|
+
end
|
984
|
+
|
985
|
+
node_cache[:comment_to_eol][start_index] = r0
|
986
|
+
|
987
|
+
return r0
|
988
|
+
end
|
989
|
+
|
990
|
+
def _nt_white
|
991
|
+
start_index = index
|
992
|
+
if node_cache[:white].has_key?(index)
|
993
|
+
cached = node_cache[:white][index]
|
994
|
+
@index = cached.interval.end if cached
|
995
|
+
return cached
|
996
|
+
end
|
997
|
+
|
998
|
+
i0 = index
|
999
|
+
r1 = _nt_blank
|
1000
|
+
if r1
|
1001
|
+
r0 = r1
|
1002
|
+
else
|
1003
|
+
r2 = _nt_eol
|
1004
|
+
if r2
|
1005
|
+
r0 = r2
|
1006
|
+
else
|
1007
|
+
self.index = i0
|
1008
|
+
r0 = nil
|
1009
|
+
end
|
1010
|
+
end
|
1011
|
+
|
1012
|
+
node_cache[:white][start_index] = r0
|
1013
|
+
|
1014
|
+
return r0
|
1015
|
+
end
|
1016
|
+
|
1017
|
+
def _nt_blank
|
1018
|
+
start_index = index
|
1019
|
+
if node_cache[:blank].has_key?(index)
|
1020
|
+
cached = node_cache[:blank][index]
|
1021
|
+
@index = cached.interval.end if cached
|
1022
|
+
return cached
|
1023
|
+
end
|
1024
|
+
|
1025
|
+
if input.index(Regexp.new('[ \\t]'), index) == index
|
1026
|
+
r0 = (SyntaxNode).new(input, index...(index + 1))
|
1027
|
+
@index += 1
|
1028
|
+
else
|
1029
|
+
r0 = nil
|
1030
|
+
end
|
1031
|
+
|
1032
|
+
node_cache[:blank][start_index] = r0
|
1033
|
+
|
1034
|
+
return r0
|
1035
|
+
end
|
1036
|
+
|
1037
|
+
def _nt_eol
|
1038
|
+
start_index = index
|
1039
|
+
if node_cache[:eol].has_key?(index)
|
1040
|
+
cached = node_cache[:eol][index]
|
1041
|
+
@index = cached.interval.end if cached
|
1042
|
+
return cached
|
1043
|
+
end
|
1044
|
+
|
1045
|
+
i0 = index
|
1046
|
+
if input.index("\r\n?", index) == index
|
1047
|
+
r1 = (SyntaxNode).new(input, index...(index + 3))
|
1048
|
+
@index += 3
|
1049
|
+
else
|
1050
|
+
terminal_parse_failure("\r\n?")
|
1051
|
+
r1 = nil
|
1052
|
+
end
|
1053
|
+
if r1
|
1054
|
+
r0 = r1
|
1055
|
+
else
|
1056
|
+
if input.index("\n", index) == index
|
1057
|
+
r2 = (SyntaxNode).new(input, index...(index + 1))
|
1058
|
+
@index += 1
|
1059
|
+
else
|
1060
|
+
terminal_parse_failure("\n")
|
1061
|
+
r2 = nil
|
1062
|
+
end
|
1063
|
+
if r2
|
1064
|
+
r0 = r2
|
1065
|
+
else
|
1066
|
+
self.index = i0
|
1067
|
+
r0 = nil
|
1068
|
+
end
|
1069
|
+
end
|
1070
|
+
|
1071
|
+
node_cache[:eol][start_index] = r0
|
1072
|
+
|
1073
|
+
return r0
|
1074
|
+
end
|
1075
|
+
|
1076
|
+
def _nt_step_keyword
|
1077
|
+
start_index = index
|
1078
|
+
if node_cache[:step_keyword].has_key?(index)
|
1079
|
+
cached = node_cache[:step_keyword][index]
|
1080
|
+
@index = cached.interval.end if cached
|
1081
|
+
return cached
|
1082
|
+
end
|
1083
|
+
|
1084
|
+
i0 = index
|
1085
|
+
if input.index('Gitt', index) == index
|
1086
|
+
r1 = (SyntaxNode).new(input, index...(index + 4))
|
1087
|
+
@index += 4
|
1088
|
+
else
|
1089
|
+
terminal_parse_failure('Gitt')
|
1090
|
+
r1 = nil
|
1091
|
+
end
|
1092
|
+
if r1
|
1093
|
+
r0 = r1
|
1094
|
+
else
|
1095
|
+
if input.index('Når', index) == index
|
1096
|
+
r2 = (SyntaxNode).new(input, index...(index + 4))
|
1097
|
+
@index += 4
|
1098
|
+
else
|
1099
|
+
terminal_parse_failure('Når')
|
1100
|
+
r2 = nil
|
1101
|
+
end
|
1102
|
+
if r2
|
1103
|
+
r0 = r2
|
1104
|
+
else
|
1105
|
+
if input.index('Så', index) == index
|
1106
|
+
r3 = (SyntaxNode).new(input, index...(index + 3))
|
1107
|
+
@index += 3
|
1108
|
+
else
|
1109
|
+
terminal_parse_failure('Så')
|
1110
|
+
r3 = nil
|
1111
|
+
end
|
1112
|
+
if r3
|
1113
|
+
r0 = r3
|
1114
|
+
else
|
1115
|
+
if input.index('Og', index) == index
|
1116
|
+
r4 = (SyntaxNode).new(input, index...(index + 2))
|
1117
|
+
@index += 2
|
1118
|
+
else
|
1119
|
+
terminal_parse_failure('Og')
|
1120
|
+
r4 = nil
|
1121
|
+
end
|
1122
|
+
if r4
|
1123
|
+
r0 = r4
|
1124
|
+
else
|
1125
|
+
self.index = i0
|
1126
|
+
r0 = nil
|
1127
|
+
end
|
1128
|
+
end
|
1129
|
+
end
|
1130
|
+
end
|
1131
|
+
|
1132
|
+
node_cache[:step_keyword][start_index] = r0
|
1133
|
+
|
1134
|
+
return r0
|
1135
|
+
end
|
1136
|
+
|
1137
|
+
def _nt_scenario_keyword
|
1138
|
+
start_index = index
|
1139
|
+
if node_cache[:scenario_keyword].has_key?(index)
|
1140
|
+
cached = node_cache[:scenario_keyword][index]
|
1141
|
+
@index = cached.interval.end if cached
|
1142
|
+
return cached
|
1143
|
+
end
|
1144
|
+
|
1145
|
+
if input.index('Scenario:', index) == index
|
1146
|
+
r0 = (SyntaxNode).new(input, index...(index + 9))
|
1147
|
+
@index += 9
|
1148
|
+
else
|
1149
|
+
terminal_parse_failure('Scenario:')
|
1150
|
+
r0 = nil
|
1151
|
+
end
|
1152
|
+
|
1153
|
+
node_cache[:scenario_keyword][start_index] = r0
|
1154
|
+
|
1155
|
+
return r0
|
1156
|
+
end
|
1157
|
+
|
1158
|
+
module GivenScenarioKeyword0
|
1159
|
+
end
|
1160
|
+
|
1161
|
+
def _nt_given_scenario_keyword
|
1162
|
+
start_index = index
|
1163
|
+
if node_cache[:given_scenario_keyword].has_key?(index)
|
1164
|
+
cached = node_cache[:given_scenario_keyword][index]
|
1165
|
+
@index = cached.interval.end if cached
|
1166
|
+
return cached
|
1167
|
+
end
|
1168
|
+
|
1169
|
+
i0, s0 = index, []
|
1170
|
+
if input.index('GittScenario', index) == index
|
1171
|
+
r1 = (SyntaxNode).new(input, index...(index + 12))
|
1172
|
+
@index += 12
|
1173
|
+
else
|
1174
|
+
terminal_parse_failure('GittScenario')
|
1175
|
+
r1 = nil
|
1176
|
+
end
|
1177
|
+
s0 << r1
|
1178
|
+
if r1
|
1179
|
+
if input.index(':', index) == index
|
1180
|
+
r3 = (SyntaxNode).new(input, index...(index + 1))
|
1181
|
+
@index += 1
|
1182
|
+
else
|
1183
|
+
terminal_parse_failure(':')
|
1184
|
+
r3 = nil
|
1185
|
+
end
|
1186
|
+
if r3
|
1187
|
+
r2 = r3
|
1188
|
+
else
|
1189
|
+
r2 = SyntaxNode.new(input, index...index)
|
1190
|
+
end
|
1191
|
+
s0 << r2
|
1192
|
+
end
|
1193
|
+
if s0.last
|
1194
|
+
r0 = (SyntaxNode).new(input, i0...index, s0)
|
1195
|
+
r0.extend(GivenScenarioKeyword0)
|
1196
|
+
else
|
1197
|
+
self.index = i0
|
1198
|
+
r0 = nil
|
1199
|
+
end
|
1200
|
+
|
1201
|
+
node_cache[:given_scenario_keyword][start_index] = r0
|
1202
|
+
|
1203
|
+
return r0
|
1204
|
+
end
|
1205
|
+
|
1206
|
+
end
|
1207
|
+
|
1208
|
+
class FeatureParser < Treetop::Runtime::CompiledParser
|
1209
|
+
include Feature
|
1210
|
+
end
|
1211
|
+
|
1212
|
+
|
1213
|
+
end
|
1214
|
+
end
|