gherkin 2.12.2 → 3.2.0

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