aslakhellesoy-cucumber 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. metadata +14 -2
  2. data/History.txt +0 -4
  3. data/License.txt +0 -20
  4. data/Manifest.txt +0 -98
  5. data/README.txt +0 -42
  6. data/Rakefile +0 -4
  7. data/TODO.txt +0 -30
  8. data/bin/cucumber +0 -3
  9. data/config/hoe.rb +0 -69
  10. data/config/requirements.rb +0 -15
  11. data/examples/calculator/Rakefile +0 -6
  12. data/examples/calculator/features/addition.feature +0 -16
  13. data/examples/calculator/features/division.feature +0 -11
  14. data/examples/calculator/features/steps/calculator_steps.rb +0 -30
  15. data/examples/calculator/lib/calculator.rb +0 -16
  16. data/examples/calculator_ruby_features/Rakefile +0 -6
  17. data/examples/calculator_ruby_features/features/addition.rb +0 -23
  18. data/examples/calculator_ruby_features/features/steps/calculator_steps.rb +0 -43
  19. data/examples/java/README.textile +0 -22
  20. data/examples/java/Rakefile +0 -12
  21. data/examples/java/features/hello.feature +0 -11
  22. data/examples/java/features/steps/hello_steps.rb +0 -25
  23. data/examples/java/features/steps/tree_steps.rb +0 -14
  24. data/examples/java/features/tree.feature +0 -9
  25. data/examples/java/src/cucumber/demo/Hello.java +0 -15
  26. data/examples/norwegian_calculator/Rakefile +0 -6
  27. data/examples/norwegian_calculator/features/kalkulator_steps.rb +0 -31
  28. data/examples/norwegian_calculator/features/summering.feature +0 -13
  29. data/examples/watir/Rakefile +0 -6
  30. data/examples/watir/features/search.feature +0 -9
  31. data/examples/watir/features/steps/stories_steps.rb +0 -51
  32. data/gem_tasks/deployment.rake +0 -34
  33. data/gem_tasks/environment.rake +0 -7
  34. data/gem_tasks/fix_cr_lf.rake +0 -10
  35. data/gem_tasks/gemspec.rake +0 -6
  36. data/gem_tasks/rspec.rake +0 -21
  37. data/gem_tasks/treetop.rake +0 -27
  38. data/gem_tasks/website.rake +0 -17
  39. data/generators/cucumber/cucumber_generator.rb +0 -20
  40. data/generators/cucumber/templates/common_webrat.rb +0 -30
  41. data/generators/cucumber/templates/cucumber.rake +0 -7
  42. data/generators/cucumber/templates/env.rb +0 -6
  43. data/generators/feature/feature_generator.rb +0 -17
  44. data/generators/feature/templates/feature.erb +0 -27
  45. data/generators/feature/templates/steps.erb +0 -22
  46. data/lib/cucumber/cli.rb +0 -133
  47. data/lib/cucumber/core_ext/proc.rb +0 -43
  48. data/lib/cucumber/core_ext/string.rb +0 -17
  49. data/lib/cucumber/executor.rb +0 -79
  50. data/lib/cucumber/formatters/ansicolor.rb +0 -89
  51. data/lib/cucumber/formatters/html_formatter.rb +0 -272
  52. data/lib/cucumber/formatters/pretty_formatter.rb +0 -129
  53. data/lib/cucumber/formatters/progress_formatter.rb +0 -41
  54. data/lib/cucumber/formatters.rb +0 -1
  55. data/lib/cucumber/languages.yml +0 -31
  56. data/lib/cucumber/rails/rspec.rb +0 -12
  57. data/lib/cucumber/rails/world.rb +0 -71
  58. data/lib/cucumber/rake/task.rb +0 -75
  59. data/lib/cucumber/step_methods.rb +0 -41
  60. data/lib/cucumber/step_mother.rb +0 -38
  61. data/lib/cucumber/tree/feature.rb +0 -45
  62. data/lib/cucumber/tree/features.rb +0 -21
  63. data/lib/cucumber/tree/scenario.rb +0 -85
  64. data/lib/cucumber/tree/step.rb +0 -141
  65. data/lib/cucumber/tree/table.rb +0 -26
  66. data/lib/cucumber/tree/top_down_visitor.rb +0 -23
  67. data/lib/cucumber/tree.rb +0 -18
  68. data/lib/cucumber/treetop_parser/feature.treetop.erb +0 -102
  69. data/lib/cucumber/treetop_parser/feature_en.rb +0 -974
  70. data/lib/cucumber/treetop_parser/feature_fr.rb +0 -974
  71. data/lib/cucumber/treetop_parser/feature_no.rb +0 -974
  72. data/lib/cucumber/treetop_parser/feature_parser.rb +0 -32
  73. data/lib/cucumber/treetop_parser/feature_pt.rb +0 -974
  74. data/lib/cucumber/version.rb +0 -9
  75. data/lib/cucumber.rb +0 -32
  76. data/script/console +0 -10
  77. data/script/console.cmd +0 -1
  78. data/script/destroy +0 -14
  79. data/script/destroy.cmd +0 -1
  80. data/script/generate +0 -14
  81. data/script/generate.cmd +0 -1
  82. data/script/txt2html +0 -74
  83. data/script/txt2html.cmd +0 -1
  84. data/setup.rb +0 -1585
  85. data/spec/cucumber/core_ext/string_spec.rb +0 -20
  86. data/spec/cucumber/executor_spec.rb +0 -55
  87. data/spec/cucumber/formatters/ansicolor_spec.rb +0 -18
  88. data/spec/cucumber/formatters/features.html +0 -274
  89. data/spec/cucumber/formatters/html_formatter_spec.rb +0 -59
  90. data/spec/cucumber/sell_cucumbers.feature +0 -9
  91. data/spec/cucumber/treetop_parser/feature_parser_spec.rb +0 -40
  92. data/spec/cucumber/treetop_parser/spaces.feature +0 -10
  93. data/spec/spec.opts +0 -2
  94. data/spec/spec_helper.rb +0 -14
  95. data/website/index.html +0 -11
  96. data/website/index.txt +0 -39
  97. data/website/javascripts/rounded_corners_lite.inc.js +0 -285
  98. data/website/stylesheets/screen.css +0 -138
  99. data/website/template.html.erb +0 -48
@@ -1,974 +0,0 @@
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 scenarios
17
- elements[2]
18
- end
19
- end
20
-
21
- module Root1
22
-
23
- def feature
24
- f = Tree::Feature.new(header.text_value.strip)
25
- scenarios.populate(f)
26
- f
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
- s2, i2 = [], index
43
- loop do
44
- r3 = _nt_whitespace
45
- if r3
46
- s2 << r3
47
- else
48
- break
49
- end
50
- end
51
- r2 = SyntaxNode.new(input, i2...index, s2)
52
- s0 << r2
53
- if r2
54
- r4 = _nt_scenarios
55
- s0 << r4
56
- end
57
- end
58
- if s0.last
59
- r0 = (SyntaxNode).new(input, i0...index, s0)
60
- r0.extend(Root0)
61
- r0.extend(Root1)
62
- else
63
- self.index = i0
64
- r0 = nil
65
- end
66
-
67
- node_cache[:root][start_index] = r0
68
-
69
- return r0
70
- end
71
-
72
- module Header0
73
- end
74
-
75
- def _nt_header
76
- start_index = index
77
- if node_cache[:header].has_key?(index)
78
- cached = node_cache[:header][index]
79
- @index = cached.interval.end if cached
80
- return cached
81
- end
82
-
83
- s0, i0 = [], index
84
- loop do
85
- i1, s1 = index, []
86
- i2 = index
87
- r3 = _nt_step_scenario
88
- if r3
89
- r2 = nil
90
- else
91
- self.index = i2
92
- r2 = SyntaxNode.new(input, index...index)
93
- end
94
- s1 << r2
95
- if r2
96
- if index < input_length
97
- r4 = (SyntaxNode).new(input, index...(index + 1))
98
- @index += 1
99
- else
100
- terminal_parse_failure("any character")
101
- r4 = nil
102
- end
103
- s1 << r4
104
- end
105
- if s1.last
106
- r1 = (SyntaxNode).new(input, i1...index, s1)
107
- r1.extend(Header0)
108
- else
109
- self.index = i1
110
- r1 = nil
111
- end
112
- if r1
113
- s0 << r1
114
- else
115
- break
116
- end
117
- end
118
- r0 = SyntaxNode.new(input, i0...index, s0)
119
-
120
- node_cache[:header][start_index] = r0
121
-
122
- return r0
123
- end
124
-
125
- module Scenarios0
126
- def step_scenario
127
- elements[0]
128
- end
129
-
130
- def more
131
- elements[1]
132
- end
133
- end
134
-
135
- module Scenarios1
136
- def populate(feature)
137
- step_scenario.populate(feature)
138
- more.elements.each { |m| m.populate(feature) }
139
- end
140
- end
141
-
142
- def _nt_scenarios
143
- start_index = index
144
- if node_cache[:scenarios].has_key?(index)
145
- cached = node_cache[:scenarios][index]
146
- @index = cached.interval.end if cached
147
- return cached
148
- end
149
-
150
- i0, s0 = index, []
151
- r1 = _nt_step_scenario
152
- s0 << r1
153
- if r1
154
- s2, i2 = [], index
155
- loop do
156
- i3 = index
157
- r4 = _nt_table
158
- if r4
159
- r3 = r4
160
- else
161
- r5 = _nt_step_scenario
162
- if r5
163
- r3 = r5
164
- else
165
- self.index = i3
166
- r3 = nil
167
- end
168
- end
169
- if r3
170
- s2 << r3
171
- else
172
- break
173
- end
174
- end
175
- r2 = SyntaxNode.new(input, i2...index, s2)
176
- s0 << r2
177
- end
178
- if s0.last
179
- r0 = (SyntaxNode).new(input, i0...index, s0)
180
- r0.extend(Scenarios0)
181
- r0.extend(Scenarios1)
182
- else
183
- self.index = i0
184
- r0 = nil
185
- end
186
-
187
- node_cache[:scenarios][start_index] = r0
188
-
189
- return r0
190
- end
191
-
192
- module StepScenario0
193
- end
194
-
195
- module StepScenario1
196
- def scenario_keyword
197
- elements[0]
198
- end
199
-
200
- def name
201
- elements[3]
202
- end
203
-
204
- def blanks
205
- elements[5]
206
- end
207
-
208
- def steps
209
- elements[6]
210
- end
211
- end
212
-
213
- module StepScenario2
214
- def populate(feature)
215
- sc = feature.add_scenario(name.text_value.strip)
216
- steps.elements.each{|s| s.populate(sc)}
217
- Feature.last_scenario = sc
218
- end
219
- end
220
-
221
- def _nt_step_scenario
222
- start_index = index
223
- if node_cache[:step_scenario].has_key?(index)
224
- cached = node_cache[:step_scenario][index]
225
- @index = cached.interval.end if cached
226
- return cached
227
- end
228
-
229
- i0, s0 = index, []
230
- r1 = _nt_scenario_keyword
231
- s0 << r1
232
- if r1
233
- if input.index(":", index) == index
234
- r2 = (SyntaxNode).new(input, index...(index + 1))
235
- @index += 1
236
- else
237
- terminal_parse_failure(":")
238
- r2 = nil
239
- end
240
- s0 << r2
241
- if r2
242
- s3, i3 = [], index
243
- loop do
244
- r4 = _nt_whitespace
245
- if r4
246
- s3 << r4
247
- else
248
- break
249
- end
250
- end
251
- r3 = SyntaxNode.new(input, i3...index, s3)
252
- s0 << r3
253
- if r3
254
- s5, i5 = [], index
255
- loop do
256
- i6, s6 = index, []
257
- i7 = index
258
- r8 = _nt_newline
259
- if r8
260
- r7 = nil
261
- else
262
- self.index = i7
263
- r7 = SyntaxNode.new(input, index...index)
264
- end
265
- s6 << r7
266
- if r7
267
- if index < input_length
268
- r9 = (SyntaxNode).new(input, index...(index + 1))
269
- @index += 1
270
- else
271
- terminal_parse_failure("any character")
272
- r9 = nil
273
- end
274
- s6 << r9
275
- end
276
- if s6.last
277
- r6 = (SyntaxNode).new(input, i6...index, s6)
278
- r6.extend(StepScenario0)
279
- else
280
- self.index = i6
281
- r6 = nil
282
- end
283
- if r6
284
- s5 << r6
285
- else
286
- break
287
- end
288
- end
289
- r5 = SyntaxNode.new(input, i5...index, s5)
290
- s0 << r5
291
- if r5
292
- s10, i10 = [], index
293
- loop do
294
- r11 = _nt_newline
295
- if r11
296
- s10 << r11
297
- else
298
- break
299
- end
300
- end
301
- r10 = SyntaxNode.new(input, i10...index, s10)
302
- s0 << r10
303
- if r10
304
- r12 = _nt_blanks
305
- s0 << r12
306
- if r12
307
- s13, i13 = [], index
308
- loop do
309
- r14 = _nt_step
310
- if r14
311
- s13 << r14
312
- else
313
- break
314
- end
315
- end
316
- if s13.empty?
317
- self.index = i13
318
- r13 = nil
319
- else
320
- r13 = SyntaxNode.new(input, i13...index, s13)
321
- end
322
- s0 << r13
323
- end
324
- end
325
- end
326
- end
327
- end
328
- end
329
- if s0.last
330
- r0 = (SyntaxNode).new(input, i0...index, s0)
331
- r0.extend(StepScenario1)
332
- r0.extend(StepScenario2)
333
- else
334
- self.index = i0
335
- r0 = nil
336
- end
337
-
338
- node_cache[:step_scenario][start_index] = r0
339
-
340
- return r0
341
- end
342
-
343
- module Step0
344
- end
345
-
346
- module Step1
347
- def step_keyword
348
- elements[1]
349
- end
350
-
351
- def name
352
- elements[3]
353
- end
354
-
355
- def blanks
356
- elements[5]
357
- end
358
- end
359
-
360
- module Step2
361
- def populate(scenario)
362
- line = input.line_of(interval.first)
363
- scenario.add_step(step_keyword.text_value, name.text_value.strip, line)
364
- end
365
- end
366
-
367
- def _nt_step
368
- start_index = index
369
- if node_cache[:step].has_key?(index)
370
- cached = node_cache[:step][index]
371
- @index = cached.interval.end if cached
372
- return cached
373
- end
374
-
375
- i0, s0 = index, []
376
- s1, i1 = [], index
377
- loop do
378
- r2 = _nt_whitespace
379
- if r2
380
- s1 << r2
381
- else
382
- break
383
- end
384
- end
385
- r1 = SyntaxNode.new(input, i1...index, s1)
386
- s0 << r1
387
- if r1
388
- r3 = _nt_step_keyword
389
- s0 << r3
390
- if r3
391
- s4, i4 = [], index
392
- loop do
393
- r5 = _nt_whitespace
394
- if r5
395
- s4 << r5
396
- else
397
- break
398
- end
399
- end
400
- r4 = SyntaxNode.new(input, i4...index, s4)
401
- s0 << r4
402
- if r4
403
- s6, i6 = [], index
404
- loop do
405
- i7, s7 = index, []
406
- i8 = index
407
- r9 = _nt_newline
408
- if r9
409
- r8 = nil
410
- else
411
- self.index = i8
412
- r8 = SyntaxNode.new(input, index...index)
413
- end
414
- s7 << r8
415
- if r8
416
- if index < input_length
417
- r10 = (SyntaxNode).new(input, index...(index + 1))
418
- @index += 1
419
- else
420
- terminal_parse_failure("any character")
421
- r10 = nil
422
- end
423
- s7 << r10
424
- end
425
- if s7.last
426
- r7 = (SyntaxNode).new(input, i7...index, s7)
427
- r7.extend(Step0)
428
- else
429
- self.index = i7
430
- r7 = nil
431
- end
432
- if r7
433
- s6 << r7
434
- else
435
- break
436
- end
437
- end
438
- r6 = SyntaxNode.new(input, i6...index, s6)
439
- s0 << r6
440
- if r6
441
- s11, i11 = [], index
442
- loop do
443
- r12 = _nt_newline
444
- if r12
445
- s11 << r12
446
- else
447
- break
448
- end
449
- end
450
- r11 = SyntaxNode.new(input, i11...index, s11)
451
- s0 << r11
452
- if r11
453
- r13 = _nt_blanks
454
- s0 << r13
455
- end
456
- end
457
- end
458
- end
459
- end
460
- if s0.last
461
- r0 = (SyntaxNode).new(input, i0...index, s0)
462
- r0.extend(Step1)
463
- r0.extend(Step2)
464
- else
465
- self.index = i0
466
- r0 = nil
467
- end
468
-
469
- node_cache[:step][start_index] = r0
470
-
471
- return r0
472
- end
473
-
474
- def _nt_step_keyword
475
- start_index = index
476
- if node_cache[:step_keyword].has_key?(index)
477
- cached = node_cache[:step_keyword][index]
478
- @index = cached.interval.end if cached
479
- return cached
480
- end
481
-
482
- i0 = index
483
- if input.index('Soit', index) == index
484
- r1 = (SyntaxNode).new(input, index...(index + 4))
485
- @index += 4
486
- else
487
- terminal_parse_failure('Soit')
488
- r1 = nil
489
- end
490
- if r1
491
- r0 = r1
492
- else
493
- if input.index('Lorsque', index) == index
494
- r2 = (SyntaxNode).new(input, index...(index + 7))
495
- @index += 7
496
- else
497
- terminal_parse_failure('Lorsque')
498
- r2 = nil
499
- end
500
- if r2
501
- r0 = r2
502
- else
503
- if input.index('Alors', index) == index
504
- r3 = (SyntaxNode).new(input, index...(index + 5))
505
- @index += 5
506
- else
507
- terminal_parse_failure('Alors')
508
- r3 = nil
509
- end
510
- if r3
511
- r0 = r3
512
- else
513
- if input.index('Et', index) == index
514
- r4 = (SyntaxNode).new(input, index...(index + 2))
515
- @index += 2
516
- else
517
- terminal_parse_failure('Et')
518
- r4 = nil
519
- end
520
- if r4
521
- r0 = r4
522
- else
523
- self.index = i0
524
- r0 = nil
525
- end
526
- end
527
- end
528
- end
529
-
530
- node_cache[:step_keyword][start_index] = r0
531
-
532
- return r0
533
- end
534
-
535
- def _nt_scenario_keyword
536
- start_index = index
537
- if node_cache[:scenario_keyword].has_key?(index)
538
- cached = node_cache[:scenario_keyword][index]
539
- @index = cached.interval.end if cached
540
- return cached
541
- end
542
-
543
- if input.index('Scenario', index) == index
544
- r0 = (SyntaxNode).new(input, index...(index + 8))
545
- @index += 8
546
- else
547
- terminal_parse_failure('Scenario')
548
- r0 = nil
549
- end
550
-
551
- node_cache[:scenario_keyword][start_index] = r0
552
-
553
- return r0
554
- end
555
-
556
- module Table0
557
- def newline
558
- elements[0]
559
- end
560
-
561
- def table_line
562
- elements[1]
563
- end
564
- end
565
-
566
- module Table1
567
- def table_line
568
- elements[0]
569
- end
570
-
571
- def more
572
- elements[1]
573
- end
574
-
575
- end
576
-
577
- module Table2
578
- def populate(feature)
579
- Feature.last_scenario.table_header = table_line.values
580
- more.elements.each do |e|
581
- feature.add_row_scenario(Feature.last_scenario, e.table_line.values, e.table_line.line)
582
- end
583
- end
584
- end
585
-
586
- def _nt_table
587
- start_index = index
588
- if node_cache[:table].has_key?(index)
589
- cached = node_cache[:table][index]
590
- @index = cached.interval.end if cached
591
- return cached
592
- end
593
-
594
- i0, s0 = index, []
595
- r1 = _nt_table_line
596
- s0 << r1
597
- if r1
598
- s2, i2 = [], index
599
- loop do
600
- i3, s3 = index, []
601
- r4 = _nt_newline
602
- s3 << r4
603
- if r4
604
- r5 = _nt_table_line
605
- s3 << r5
606
- end
607
- if s3.last
608
- r3 = (SyntaxNode).new(input, i3...index, s3)
609
- r3.extend(Table0)
610
- else
611
- self.index = i3
612
- r3 = nil
613
- end
614
- if r3
615
- s2 << r3
616
- else
617
- break
618
- end
619
- end
620
- if s2.empty?
621
- self.index = i2
622
- r2 = nil
623
- else
624
- r2 = SyntaxNode.new(input, i2...index, s2)
625
- end
626
- s0 << r2
627
- if r2
628
- s6, i6 = [], index
629
- loop do
630
- r7 = _nt_newline
631
- if r7
632
- s6 << r7
633
- else
634
- break
635
- end
636
- end
637
- r6 = SyntaxNode.new(input, i6...index, s6)
638
- s0 << r6
639
- end
640
- end
641
- if s0.last
642
- r0 = (SyntaxNode).new(input, i0...index, s0)
643
- r0.extend(Table1)
644
- r0.extend(Table2)
645
- else
646
- self.index = i0
647
- r0 = nil
648
- end
649
-
650
- node_cache[:table][start_index] = r0
651
-
652
- return r0
653
- end
654
-
655
- module TableLine0
656
- def cell_value
657
- elements[1]
658
- end
659
-
660
- def separator
661
- elements[3]
662
- end
663
- end
664
-
665
- module TableLine1
666
- def separator
667
- elements[1]
668
- end
669
-
670
- def cells
671
- elements[2]
672
- end
673
- end
674
-
675
- module TableLine2
676
- def values
677
- cells.elements.map { |cell| cell.cell_value.text_value }
678
- end
679
-
680
- def line
681
- input.line_of(interval.first)
682
- end
683
- end
684
-
685
- def _nt_table_line
686
- start_index = index
687
- if node_cache[:table_line].has_key?(index)
688
- cached = node_cache[:table_line][index]
689
- @index = cached.interval.end if cached
690
- return cached
691
- end
692
-
693
- i0, s0 = index, []
694
- s1, i1 = [], index
695
- loop do
696
- r2 = _nt_whitespace
697
- if r2
698
- s1 << r2
699
- else
700
- break
701
- end
702
- end
703
- r1 = SyntaxNode.new(input, i1...index, s1)
704
- s0 << r1
705
- if r1
706
- r3 = _nt_separator
707
- s0 << r3
708
- if r3
709
- s4, i4 = [], index
710
- loop do
711
- i5, s5 = index, []
712
- s6, i6 = [], index
713
- loop do
714
- r7 = _nt_whitespace
715
- if r7
716
- s6 << r7
717
- else
718
- break
719
- end
720
- end
721
- r6 = SyntaxNode.new(input, i6...index, s6)
722
- s5 << r6
723
- if r6
724
- r8 = _nt_cell_value
725
- s5 << r8
726
- if r8
727
- s9, i9 = [], index
728
- loop do
729
- r10 = _nt_whitespace
730
- if r10
731
- s9 << r10
732
- else
733
- break
734
- end
735
- end
736
- r9 = SyntaxNode.new(input, i9...index, s9)
737
- s5 << r9
738
- if r9
739
- r11 = _nt_separator
740
- s5 << r11
741
- end
742
- end
743
- end
744
- if s5.last
745
- r5 = (SyntaxNode).new(input, i5...index, s5)
746
- r5.extend(TableLine0)
747
- else
748
- self.index = i5
749
- r5 = nil
750
- end
751
- if r5
752
- s4 << r5
753
- else
754
- break
755
- end
756
- end
757
- if s4.empty?
758
- self.index = i4
759
- r4 = nil
760
- else
761
- r4 = SyntaxNode.new(input, i4...index, s4)
762
- end
763
- s0 << r4
764
- end
765
- end
766
- if s0.last
767
- r0 = (SyntaxNode).new(input, i0...index, s0)
768
- r0.extend(TableLine1)
769
- r0.extend(TableLine2)
770
- else
771
- self.index = i0
772
- r0 = nil
773
- end
774
-
775
- node_cache[:table_line][start_index] = r0
776
-
777
- return r0
778
- end
779
-
780
- module CellValue0
781
- end
782
-
783
- def _nt_cell_value
784
- start_index = index
785
- if node_cache[:cell_value].has_key?(index)
786
- cached = node_cache[:cell_value][index]
787
- @index = cached.interval.end if cached
788
- return cached
789
- end
790
-
791
- s0, i0 = [], index
792
- loop do
793
- i1, s1 = index, []
794
- i2 = index
795
- i3 = index
796
- r4 = _nt_separator
797
- if r4
798
- r3 = r4
799
- else
800
- r5 = _nt_newline
801
- if r5
802
- r3 = r5
803
- else
804
- r6 = _nt_whitespace
805
- if r6
806
- r3 = r6
807
- else
808
- self.index = i3
809
- r3 = nil
810
- end
811
- end
812
- end
813
- if r3
814
- r2 = nil
815
- else
816
- self.index = i2
817
- r2 = SyntaxNode.new(input, index...index)
818
- end
819
- s1 << r2
820
- if r2
821
- if index < input_length
822
- r7 = (SyntaxNode).new(input, index...(index + 1))
823
- @index += 1
824
- else
825
- terminal_parse_failure("any character")
826
- r7 = nil
827
- end
828
- s1 << r7
829
- end
830
- if s1.last
831
- r1 = (SyntaxNode).new(input, i1...index, s1)
832
- r1.extend(CellValue0)
833
- else
834
- self.index = i1
835
- r1 = nil
836
- end
837
- if r1
838
- s0 << r1
839
- else
840
- break
841
- end
842
- end
843
- r0 = SyntaxNode.new(input, i0...index, s0)
844
-
845
- node_cache[:cell_value][start_index] = r0
846
-
847
- return r0
848
- end
849
-
850
- def _nt_separator
851
- start_index = index
852
- if node_cache[:separator].has_key?(index)
853
- cached = node_cache[:separator][index]
854
- @index = cached.interval.end if cached
855
- return cached
856
- end
857
-
858
- if input.index('|', index) == index
859
- r0 = (SyntaxNode).new(input, index...(index + 1))
860
- @index += 1
861
- else
862
- terminal_parse_failure('|')
863
- r0 = nil
864
- end
865
-
866
- node_cache[:separator][start_index] = r0
867
-
868
- return r0
869
- end
870
-
871
- def _nt_blanks
872
- start_index = index
873
- if node_cache[:blanks].has_key?(index)
874
- cached = node_cache[:blanks][index]
875
- @index = cached.interval.end if cached
876
- return cached
877
- end
878
-
879
- s0, i0 = [], index
880
- loop do
881
- i1 = index
882
- r2 = _nt_newline
883
- if r2
884
- r1 = r2
885
- else
886
- r3 = _nt_whitespace
887
- if r3
888
- r1 = r3
889
- else
890
- self.index = i1
891
- r1 = nil
892
- end
893
- end
894
- if r1
895
- s0 << r1
896
- else
897
- break
898
- end
899
- end
900
- r0 = SyntaxNode.new(input, i0...index, s0)
901
-
902
- node_cache[:blanks][start_index] = r0
903
-
904
- return r0
905
- end
906
-
907
- def _nt_newline
908
- start_index = index
909
- if node_cache[:newline].has_key?(index)
910
- cached = node_cache[:newline][index]
911
- @index = cached.interval.end if cached
912
- return cached
913
- end
914
-
915
- i0 = index
916
- if input.index("\r\n?", index) == index
917
- r1 = (SyntaxNode).new(input, index...(index + 3))
918
- @index += 3
919
- else
920
- terminal_parse_failure("\r\n?")
921
- r1 = nil
922
- end
923
- if r1
924
- r0 = r1
925
- else
926
- if input.index("\n", index) == index
927
- r2 = (SyntaxNode).new(input, index...(index + 1))
928
- @index += 1
929
- else
930
- terminal_parse_failure("\n")
931
- r2 = nil
932
- end
933
- if r2
934
- r0 = r2
935
- else
936
- self.index = i0
937
- r0 = nil
938
- end
939
- end
940
-
941
- node_cache[:newline][start_index] = r0
942
-
943
- return r0
944
- end
945
-
946
- def _nt_whitespace
947
- start_index = index
948
- if node_cache[:whitespace].has_key?(index)
949
- cached = node_cache[:whitespace][index]
950
- @index = cached.interval.end if cached
951
- return cached
952
- end
953
-
954
- if input.index(Regexp.new('[ \\t]'), index) == index
955
- r0 = (SyntaxNode).new(input, index...(index + 1))
956
- @index += 1
957
- else
958
- r0 = nil
959
- end
960
-
961
- node_cache[:whitespace][start_index] = r0
962
-
963
- return r0
964
- end
965
-
966
- end
967
-
968
- class FeatureParser < Treetop::Runtime::CompiledParser
969
- include Feature
970
- end
971
-
972
-
973
- end
974
- end