How to use eof method of Gherkin Package

Best Gherkin-ruby code snippet using Gherkin.eof

parser.rb

Source:parser.rb Github

copy

Full Screen

...67 token = nil68 begin69 token = read_token(context)70 state = match_token(state, token, context)71 end until(token.eof?)72 end_rule(context, :GherkinDocument)73 raise CompositeParserException.new(context.errors) if context.errors.any?74 get_result()75 end76 def build(context, token)77 handle_ast_error(context) do78 @ast_builder.build(token)79 end80 end81 def add_error(context, error)82 context.errors.push(error)83 raise CompositeParserException, context.errors if context.errors.length > 1084 end85 def start_rule(context, rule_type)86 handle_ast_error(context) do87 @ast_builder.start_rule(rule_type)88 end89 end90 def end_rule(context, rule_type)91 handle_ast_error(context) do92 @ast_builder.end_rule(rule_type)93 end94 end95 def get_result()96 @ast_builder.get_result97 end98 def read_token(context)99 context.token_queue.any? ? context.token_queue.shift : context.token_scanner.read100 end101 def match_EOF( context, token)102 return handle_external_error(context, false) do103 context.token_matcher.match_EOF(token)104 end105 end106 def match_Empty( context, token)107 return false if token.eof?108 return handle_external_error(context, false) do109 context.token_matcher.match_Empty(token)110 end111 end112 def match_Comment( context, token)113 return false if token.eof?114 return handle_external_error(context, false) do115 context.token_matcher.match_Comment(token)116 end117 end118 def match_TagLine( context, token)119 return false if token.eof?120 return handle_external_error(context, false) do121 context.token_matcher.match_TagLine(token)122 end123 end124 def match_FeatureLine( context, token)125 return false if token.eof?126 return handle_external_error(context, false) do127 context.token_matcher.match_FeatureLine(token)128 end129 end130 def match_BackgroundLine( context, token)131 return false if token.eof?132 return handle_external_error(context, false) do133 context.token_matcher.match_BackgroundLine(token)134 end135 end136 def match_ScenarioLine( context, token)137 return false if token.eof?138 return handle_external_error(context, false) do139 context.token_matcher.match_ScenarioLine(token)140 end141 end142 def match_ScenarioOutlineLine( context, token)143 return false if token.eof?144 return handle_external_error(context, false) do145 context.token_matcher.match_ScenarioOutlineLine(token)146 end147 end148 def match_ExamplesLine( context, token)149 return false if token.eof?150 return handle_external_error(context, false) do151 context.token_matcher.match_ExamplesLine(token)152 end153 end154 def match_StepLine( context, token)155 return false if token.eof?156 return handle_external_error(context, false) do157 context.token_matcher.match_StepLine(token)158 end159 end160 def match_DocStringSeparator( context, token)161 return false if token.eof?162 return handle_external_error(context, false) do163 context.token_matcher.match_DocStringSeparator(token)164 end165 end166 def match_TableRow( context, token)167 return false if token.eof?168 return handle_external_error(context, false) do169 context.token_matcher.match_TableRow(token)170 end171 end172 def match_Language( context, token)173 return false if token.eof?174 return handle_external_error(context, false) do175 context.token_matcher.match_Language(token)176 end177 end178 def match_Other( context, token)179 return false if token.eof?180 return handle_external_error(context, false) do181 context.token_matcher.match_Other(token)182 end183 end184 def match_token(state, token, context)185 case state186 when 0187 match_token_at_0(token, context)188 when 1189 match_token_at_1(token, context)190 when 2191 match_token_at_2(token, context)192 when 3193 match_token_at_3(token, context)194 when 4195 match_token_at_4(token, context)196 when 5197 match_token_at_5(token, context)198 when 6199 match_token_at_6(token, context)200 when 7201 match_token_at_7(token, context)202 when 8203 match_token_at_8(token, context)204 when 9205 match_token_at_9(token, context)206 when 10207 match_token_at_10(token, context)208 when 11209 match_token_at_11(token, context)210 when 12211 match_token_at_12(token, context)212 when 13213 match_token_at_13(token, context)214 when 14215 match_token_at_14(token, context)216 when 15217 match_token_at_15(token, context)218 when 16219 match_token_at_16(token, context)220 when 17221 match_token_at_17(token, context)222 when 18223 match_token_at_18(token, context)224 when 19225 match_token_at_19(token, context)226 when 20227 match_token_at_20(token, context)228 when 21229 match_token_at_21(token, context)230 when 22231 match_token_at_22(token, context)232 when 23233 match_token_at_23(token, context)234 when 24235 match_token_at_24(token, context)236 when 25237 match_token_at_25(token, context)238 when 26239 match_token_at_26(token, context)240 when 28241 match_token_at_28(token, context)242 when 29243 match_token_at_29(token, context)244 when 30245 match_token_at_30(token, context)246 when 31247 match_token_at_31(token, context)248 when 32249 match_token_at_32(token, context)250 when 33251 match_token_at_33(token, context)252 else253 raise InvalidOperationException, "Unknown state: #{state}"254 end255 end256 # Start257 def match_token_at_0(token, context)258 if match_EOF(context, token)259 build(context, token);260 return 27261 end262 if match_Language(context, token)263 start_rule(context, :Feature);264 start_rule(context, :Feature_Header);265 build(context, token);266 return 1267 end268 if match_TagLine(context, token)269 start_rule(context, :Feature);270 start_rule(context, :Feature_Header);271 start_rule(context, :Tags);272 build(context, token);273 return 2274 end275 if match_FeatureLine(context, token)276 start_rule(context, :Feature);277 start_rule(context, :Feature_Header);278 build(context, token);279 return 3280 end281 if match_Comment(context, token)282 build(context, token);283 return 0284 end285 if match_Empty(context, token)286 build(context, token);287 return 0288 end289 290 state_comment = "State: 0 - Start"291 token.detach292 expected_tokens = ["#EOF", "#Language", "#TagLine", "#FeatureLine", "#Comment", "#Empty"]293 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)294 raise error if (stop_at_first_error)295 add_error(context, error)296 return 0297 end298 # GherkinDocument:0>Feature:0>Feature_Header:0>#Language:0299 def match_token_at_1(token, context)300 if match_TagLine(context, token)301 start_rule(context, :Tags);302 build(context, token);303 return 2304 end305 if match_FeatureLine(context, token)306 build(context, token);307 return 3308 end309 if match_Comment(context, token)310 build(context, token);311 return 1312 end313 if match_Empty(context, token)314 build(context, token);315 return 1316 end317 318 state_comment = "State: 1 - GherkinDocument:0>Feature:0>Feature_Header:0>#Language:0"319 token.detach320 expected_tokens = ["#TagLine", "#FeatureLine", "#Comment", "#Empty"]321 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)322 raise error if (stop_at_first_error)323 add_error(context, error)324 return 1325 end326 # GherkinDocument:0>Feature:0>Feature_Header:1>Tags:0>#TagLine:0327 def match_token_at_2(token, context)328 if match_TagLine(context, token)329 build(context, token);330 return 2331 end332 if match_FeatureLine(context, token)333 end_rule(context, :Tags);334 build(context, token);335 return 3336 end337 if match_Comment(context, token)338 build(context, token);339 return 2340 end341 if match_Empty(context, token)342 build(context, token);343 return 2344 end345 346 state_comment = "State: 2 - GherkinDocument:0>Feature:0>Feature_Header:1>Tags:0>#TagLine:0"347 token.detach348 expected_tokens = ["#TagLine", "#FeatureLine", "#Comment", "#Empty"]349 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)350 raise error if (stop_at_first_error)351 add_error(context, error)352 return 2353 end354 # GherkinDocument:0>Feature:0>Feature_Header:2>#FeatureLine:0355 def match_token_at_3(token, context)356 if match_EOF(context, token)357 end_rule(context, :Feature_Header);358 end_rule(context, :Feature);359 build(context, token);360 return 27361 end362 if match_Empty(context, token)363 build(context, token);364 return 3365 end366 if match_Comment(context, token)367 build(context, token);368 return 5369 end370 if match_BackgroundLine(context, token)371 end_rule(context, :Feature_Header);372 start_rule(context, :Background);373 build(context, token);374 return 6375 end376 if match_TagLine(context, token)377 end_rule(context, :Feature_Header);378 start_rule(context, :Scenario_Definition);379 start_rule(context, :Tags);380 build(context, token);381 return 11382 end383 if match_ScenarioLine(context, token)384 end_rule(context, :Feature_Header);385 start_rule(context, :Scenario_Definition);386 start_rule(context, :Scenario);387 build(context, token);388 return 12389 end390 if match_ScenarioOutlineLine(context, token)391 end_rule(context, :Feature_Header);392 start_rule(context, :Scenario_Definition);393 start_rule(context, :ScenarioOutline);394 build(context, token);395 return 17396 end397 if match_Other(context, token)398 start_rule(context, :Description);399 build(context, token);400 return 4401 end402 403 state_comment = "State: 3 - GherkinDocument:0>Feature:0>Feature_Header:2>#FeatureLine:0"404 token.detach405 expected_tokens = ["#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"]406 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)407 raise error if (stop_at_first_error)408 add_error(context, error)409 return 3410 end411 # GherkinDocument:0>Feature:0>Feature_Header:3>Description_Helper:1>Description:0>#Other:0412 def match_token_at_4(token, context)413 if match_EOF(context, token)414 end_rule(context, :Description);415 end_rule(context, :Feature_Header);416 end_rule(context, :Feature);417 build(context, token);418 return 27419 end420 if match_Comment(context, token)421 end_rule(context, :Description);422 build(context, token);423 return 5424 end425 if match_BackgroundLine(context, token)426 end_rule(context, :Description);427 end_rule(context, :Feature_Header);428 start_rule(context, :Background);429 build(context, token);430 return 6431 end432 if match_TagLine(context, token)433 end_rule(context, :Description);434 end_rule(context, :Feature_Header);435 start_rule(context, :Scenario_Definition);436 start_rule(context, :Tags);437 build(context, token);438 return 11439 end440 if match_ScenarioLine(context, token)441 end_rule(context, :Description);442 end_rule(context, :Feature_Header);443 start_rule(context, :Scenario_Definition);444 start_rule(context, :Scenario);445 build(context, token);446 return 12447 end448 if match_ScenarioOutlineLine(context, token)449 end_rule(context, :Description);450 end_rule(context, :Feature_Header);451 start_rule(context, :Scenario_Definition);452 start_rule(context, :ScenarioOutline);453 build(context, token);454 return 17455 end456 if match_Other(context, token)457 build(context, token);458 return 4459 end460 461 state_comment = "State: 4 - GherkinDocument:0>Feature:0>Feature_Header:3>Description_Helper:1>Description:0>#Other:0"462 token.detach463 expected_tokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"]464 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)465 raise error if (stop_at_first_error)466 add_error(context, error)467 return 4468 end469 # GherkinDocument:0>Feature:0>Feature_Header:3>Description_Helper:2>#Comment:0470 def match_token_at_5(token, context)471 if match_EOF(context, token)472 end_rule(context, :Feature_Header);473 end_rule(context, :Feature);474 build(context, token);475 return 27476 end477 if match_Comment(context, token)478 build(context, token);479 return 5480 end481 if match_BackgroundLine(context, token)482 end_rule(context, :Feature_Header);483 start_rule(context, :Background);484 build(context, token);485 return 6486 end487 if match_TagLine(context, token)488 end_rule(context, :Feature_Header);489 start_rule(context, :Scenario_Definition);490 start_rule(context, :Tags);491 build(context, token);492 return 11493 end494 if match_ScenarioLine(context, token)495 end_rule(context, :Feature_Header);496 start_rule(context, :Scenario_Definition);497 start_rule(context, :Scenario);498 build(context, token);499 return 12500 end501 if match_ScenarioOutlineLine(context, token)502 end_rule(context, :Feature_Header);503 start_rule(context, :Scenario_Definition);504 start_rule(context, :ScenarioOutline);505 build(context, token);506 return 17507 end508 if match_Empty(context, token)509 build(context, token);510 return 5511 end512 513 state_comment = "State: 5 - GherkinDocument:0>Feature:0>Feature_Header:3>Description_Helper:2>#Comment:0"514 token.detach515 expected_tokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"]516 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)517 raise error if (stop_at_first_error)518 add_error(context, error)519 return 5520 end521 # GherkinDocument:0>Feature:1>Background:0>#BackgroundLine:0522 def match_token_at_6(token, context)523 if match_EOF(context, token)524 end_rule(context, :Background);525 end_rule(context, :Feature);526 build(context, token);527 return 27528 end529 if match_Empty(context, token)530 build(context, token);531 return 6532 end533 if match_Comment(context, token)534 build(context, token);535 return 8536 end537 if match_StepLine(context, token)538 start_rule(context, :Step);539 build(context, token);540 return 9541 end542 if match_TagLine(context, token)543 end_rule(context, :Background);544 start_rule(context, :Scenario_Definition);545 start_rule(context, :Tags);546 build(context, token);547 return 11548 end549 if match_ScenarioLine(context, token)550 end_rule(context, :Background);551 start_rule(context, :Scenario_Definition);552 start_rule(context, :Scenario);553 build(context, token);554 return 12555 end556 if match_ScenarioOutlineLine(context, token)557 end_rule(context, :Background);558 start_rule(context, :Scenario_Definition);559 start_rule(context, :ScenarioOutline);560 build(context, token);561 return 17562 end563 if match_Other(context, token)564 start_rule(context, :Description);565 build(context, token);566 return 7567 end568 569 state_comment = "State: 6 - GherkinDocument:0>Feature:1>Background:0>#BackgroundLine:0"570 token.detach571 expected_tokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"]572 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)573 raise error if (stop_at_first_error)574 add_error(context, error)575 return 6576 end577 # GherkinDocument:0>Feature:1>Background:1>Description_Helper:1>Description:0>#Other:0578 def match_token_at_7(token, context)579 if match_EOF(context, token)580 end_rule(context, :Description);581 end_rule(context, :Background);582 end_rule(context, :Feature);583 build(context, token);584 return 27585 end586 if match_Comment(context, token)587 end_rule(context, :Description);588 build(context, token);589 return 8590 end591 if match_StepLine(context, token)592 end_rule(context, :Description);593 start_rule(context, :Step);594 build(context, token);595 return 9596 end597 if match_TagLine(context, token)598 end_rule(context, :Description);599 end_rule(context, :Background);600 start_rule(context, :Scenario_Definition);601 start_rule(context, :Tags);602 build(context, token);603 return 11604 end605 if match_ScenarioLine(context, token)606 end_rule(context, :Description);607 end_rule(context, :Background);608 start_rule(context, :Scenario_Definition);609 start_rule(context, :Scenario);610 build(context, token);611 return 12612 end613 if match_ScenarioOutlineLine(context, token)614 end_rule(context, :Description);615 end_rule(context, :Background);616 start_rule(context, :Scenario_Definition);617 start_rule(context, :ScenarioOutline);618 build(context, token);619 return 17620 end621 if match_Other(context, token)622 build(context, token);623 return 7624 end625 626 state_comment = "State: 7 - GherkinDocument:0>Feature:1>Background:1>Description_Helper:1>Description:0>#Other:0"627 token.detach628 expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"]629 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)630 raise error if (stop_at_first_error)631 add_error(context, error)632 return 7633 end634 # GherkinDocument:0>Feature:1>Background:1>Description_Helper:2>#Comment:0635 def match_token_at_8(token, context)636 if match_EOF(context, token)637 end_rule(context, :Background);638 end_rule(context, :Feature);639 build(context, token);640 return 27641 end642 if match_Comment(context, token)643 build(context, token);644 return 8645 end646 if match_StepLine(context, token)647 start_rule(context, :Step);648 build(context, token);649 return 9650 end651 if match_TagLine(context, token)652 end_rule(context, :Background);653 start_rule(context, :Scenario_Definition);654 start_rule(context, :Tags);655 build(context, token);656 return 11657 end658 if match_ScenarioLine(context, token)659 end_rule(context, :Background);660 start_rule(context, :Scenario_Definition);661 start_rule(context, :Scenario);662 build(context, token);663 return 12664 end665 if match_ScenarioOutlineLine(context, token)666 end_rule(context, :Background);667 start_rule(context, :Scenario_Definition);668 start_rule(context, :ScenarioOutline);669 build(context, token);670 return 17671 end672 if match_Empty(context, token)673 build(context, token);674 return 8675 end676 677 state_comment = "State: 8 - GherkinDocument:0>Feature:1>Background:1>Description_Helper:2>#Comment:0"678 token.detach679 expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"]680 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)681 raise error if (stop_at_first_error)682 add_error(context, error)683 return 8684 end685 # GherkinDocument:0>Feature:1>Background:2>Step:0>#StepLine:0686 def match_token_at_9(token, context)687 if match_EOF(context, token)688 end_rule(context, :Step);689 end_rule(context, :Background);690 end_rule(context, :Feature);691 build(context, token);692 return 27693 end694 if match_TableRow(context, token)695 start_rule(context, :DataTable);696 build(context, token);697 return 10698 end699 if match_DocStringSeparator(context, token)700 start_rule(context, :DocString);701 build(context, token);702 return 32703 end704 if match_StepLine(context, token)705 end_rule(context, :Step);706 start_rule(context, :Step);707 build(context, token);708 return 9709 end710 if match_TagLine(context, token)711 end_rule(context, :Step);712 end_rule(context, :Background);713 start_rule(context, :Scenario_Definition);714 start_rule(context, :Tags);715 build(context, token);716 return 11717 end718 if match_ScenarioLine(context, token)719 end_rule(context, :Step);720 end_rule(context, :Background);721 start_rule(context, :Scenario_Definition);722 start_rule(context, :Scenario);723 build(context, token);724 return 12725 end726 if match_ScenarioOutlineLine(context, token)727 end_rule(context, :Step);728 end_rule(context, :Background);729 start_rule(context, :Scenario_Definition);730 start_rule(context, :ScenarioOutline);731 build(context, token);732 return 17733 end734 if match_Comment(context, token)735 build(context, token);736 return 9737 end738 if match_Empty(context, token)739 build(context, token);740 return 9741 end742 743 state_comment = "State: 9 - GherkinDocument:0>Feature:1>Background:2>Step:0>#StepLine:0"744 token.detach745 expected_tokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"]746 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)747 raise error if (stop_at_first_error)748 add_error(context, error)749 return 9750 end751 # GherkinDocument:0>Feature:1>Background:2>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0752 def match_token_at_10(token, context)753 if match_EOF(context, token)754 end_rule(context, :DataTable);755 end_rule(context, :Step);756 end_rule(context, :Background);757 end_rule(context, :Feature);758 build(context, token);759 return 27760 end761 if match_TableRow(context, token)762 build(context, token);763 return 10764 end765 if match_StepLine(context, token)766 end_rule(context, :DataTable);767 end_rule(context, :Step);768 start_rule(context, :Step);769 build(context, token);770 return 9771 end772 if match_TagLine(context, token)773 end_rule(context, :DataTable);774 end_rule(context, :Step);775 end_rule(context, :Background);776 start_rule(context, :Scenario_Definition);777 start_rule(context, :Tags);778 build(context, token);779 return 11780 end781 if match_ScenarioLine(context, token)782 end_rule(context, :DataTable);783 end_rule(context, :Step);784 end_rule(context, :Background);785 start_rule(context, :Scenario_Definition);786 start_rule(context, :Scenario);787 build(context, token);788 return 12789 end790 if match_ScenarioOutlineLine(context, token)791 end_rule(context, :DataTable);792 end_rule(context, :Step);793 end_rule(context, :Background);794 start_rule(context, :Scenario_Definition);795 start_rule(context, :ScenarioOutline);796 build(context, token);797 return 17798 end799 if match_Comment(context, token)800 build(context, token);801 return 10802 end803 if match_Empty(context, token)804 build(context, token);805 return 10806 end807 808 state_comment = "State: 10 - GherkinDocument:0>Feature:1>Background:2>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0"809 token.detach810 expected_tokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"]811 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)812 raise error if (stop_at_first_error)813 add_error(context, error)814 return 10815 end816 # GherkinDocument:0>Feature:2>Scenario_Definition:0>Tags:0>#TagLine:0817 def match_token_at_11(token, context)818 if match_TagLine(context, token)819 build(context, token);820 return 11821 end822 if match_ScenarioLine(context, token)823 end_rule(context, :Tags);824 start_rule(context, :Scenario);825 build(context, token);826 return 12827 end828 if match_ScenarioOutlineLine(context, token)829 end_rule(context, :Tags);830 start_rule(context, :ScenarioOutline);831 build(context, token);832 return 17833 end834 if match_Comment(context, token)835 build(context, token);836 return 11837 end838 if match_Empty(context, token)839 build(context, token);840 return 11841 end842 843 state_comment = "State: 11 - GherkinDocument:0>Feature:2>Scenario_Definition:0>Tags:0>#TagLine:0"844 token.detach845 expected_tokens = ["#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"]846 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)847 raise error if (stop_at_first_error)848 add_error(context, error)849 return 11850 end851 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:0>#ScenarioLine:0852 def match_token_at_12(token, context)853 if match_EOF(context, token)854 end_rule(context, :Scenario);855 end_rule(context, :Scenario_Definition);856 end_rule(context, :Feature);857 build(context, token);858 return 27859 end860 if match_Empty(context, token)861 build(context, token);862 return 12863 end864 if match_Comment(context, token)865 build(context, token);866 return 14867 end868 if match_StepLine(context, token)869 start_rule(context, :Step);870 build(context, token);871 return 15872 end873 if match_TagLine(context, token)874 end_rule(context, :Scenario);875 end_rule(context, :Scenario_Definition);876 start_rule(context, :Scenario_Definition);877 start_rule(context, :Tags);878 build(context, token);879 return 11880 end881 if match_ScenarioLine(context, token)882 end_rule(context, :Scenario);883 end_rule(context, :Scenario_Definition);884 start_rule(context, :Scenario_Definition);885 start_rule(context, :Scenario);886 build(context, token);887 return 12888 end889 if match_ScenarioOutlineLine(context, token)890 end_rule(context, :Scenario);891 end_rule(context, :Scenario_Definition);892 start_rule(context, :Scenario_Definition);893 start_rule(context, :ScenarioOutline);894 build(context, token);895 return 17896 end897 if match_Other(context, token)898 start_rule(context, :Description);899 build(context, token);900 return 13901 end902 903 state_comment = "State: 12 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:0>#ScenarioLine:0"904 token.detach905 expected_tokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"]906 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)907 raise error if (stop_at_first_error)908 add_error(context, error)909 return 12910 end911 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Description_Helper:1>Description:0>#Other:0912 def match_token_at_13(token, context)913 if match_EOF(context, token)914 end_rule(context, :Description);915 end_rule(context, :Scenario);916 end_rule(context, :Scenario_Definition);917 end_rule(context, :Feature);918 build(context, token);919 return 27920 end921 if match_Comment(context, token)922 end_rule(context, :Description);923 build(context, token);924 return 14925 end926 if match_StepLine(context, token)927 end_rule(context, :Description);928 start_rule(context, :Step);929 build(context, token);930 return 15931 end932 if match_TagLine(context, token)933 end_rule(context, :Description);934 end_rule(context, :Scenario);935 end_rule(context, :Scenario_Definition);936 start_rule(context, :Scenario_Definition);937 start_rule(context, :Tags);938 build(context, token);939 return 11940 end941 if match_ScenarioLine(context, token)942 end_rule(context, :Description);943 end_rule(context, :Scenario);944 end_rule(context, :Scenario_Definition);945 start_rule(context, :Scenario_Definition);946 start_rule(context, :Scenario);947 build(context, token);948 return 12949 end950 if match_ScenarioOutlineLine(context, token)951 end_rule(context, :Description);952 end_rule(context, :Scenario);953 end_rule(context, :Scenario_Definition);954 start_rule(context, :Scenario_Definition);955 start_rule(context, :ScenarioOutline);956 build(context, token);957 return 17958 end959 if match_Other(context, token)960 build(context, token);961 return 13962 end963 964 state_comment = "State: 13 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Description_Helper:1>Description:0>#Other:0"965 token.detach966 expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"]967 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)968 raise error if (stop_at_first_error)969 add_error(context, error)970 return 13971 end972 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Description_Helper:2>#Comment:0973 def match_token_at_14(token, context)974 if match_EOF(context, token)975 end_rule(context, :Scenario);976 end_rule(context, :Scenario_Definition);977 end_rule(context, :Feature);978 build(context, token);979 return 27980 end981 if match_Comment(context, token)982 build(context, token);983 return 14984 end985 if match_StepLine(context, token)986 start_rule(context, :Step);987 build(context, token);988 return 15989 end990 if match_TagLine(context, token)991 end_rule(context, :Scenario);992 end_rule(context, :Scenario_Definition);993 start_rule(context, :Scenario_Definition);994 start_rule(context, :Tags);995 build(context, token);996 return 11997 end998 if match_ScenarioLine(context, token)999 end_rule(context, :Scenario);1000 end_rule(context, :Scenario_Definition);1001 start_rule(context, :Scenario_Definition);1002 start_rule(context, :Scenario);1003 build(context, token);1004 return 121005 end1006 if match_ScenarioOutlineLine(context, token)1007 end_rule(context, :Scenario);1008 end_rule(context, :Scenario_Definition);1009 start_rule(context, :Scenario_Definition);1010 start_rule(context, :ScenarioOutline);1011 build(context, token);1012 return 171013 end1014 if match_Empty(context, token)1015 build(context, token);1016 return 141017 end1018 1019 state_comment = "State: 14 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Description_Helper:2>#Comment:0"1020 token.detach1021 expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"]1022 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)1023 raise error if (stop_at_first_error)1024 add_error(context, error)1025 return 141026 end1027 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:0>#StepLine:01028 def match_token_at_15(token, context)1029 if match_EOF(context, token)1030 end_rule(context, :Step);1031 end_rule(context, :Scenario);1032 end_rule(context, :Scenario_Definition);1033 end_rule(context, :Feature);1034 build(context, token);1035 return 271036 end1037 if match_TableRow(context, token)1038 start_rule(context, :DataTable);1039 build(context, token);1040 return 161041 end1042 if match_DocStringSeparator(context, token)1043 start_rule(context, :DocString);1044 build(context, token);1045 return 301046 end1047 if match_StepLine(context, token)1048 end_rule(context, :Step);1049 start_rule(context, :Step);1050 build(context, token);1051 return 151052 end1053 if match_TagLine(context, token)1054 end_rule(context, :Step);1055 end_rule(context, :Scenario);1056 end_rule(context, :Scenario_Definition);1057 start_rule(context, :Scenario_Definition);1058 start_rule(context, :Tags);1059 build(context, token);1060 return 111061 end1062 if match_ScenarioLine(context, token)1063 end_rule(context, :Step);1064 end_rule(context, :Scenario);1065 end_rule(context, :Scenario_Definition);1066 start_rule(context, :Scenario_Definition);1067 start_rule(context, :Scenario);1068 build(context, token);1069 return 121070 end1071 if match_ScenarioOutlineLine(context, token)1072 end_rule(context, :Step);1073 end_rule(context, :Scenario);1074 end_rule(context, :Scenario_Definition);1075 start_rule(context, :Scenario_Definition);1076 start_rule(context, :ScenarioOutline);1077 build(context, token);1078 return 171079 end1080 if match_Comment(context, token)1081 build(context, token);1082 return 151083 end1084 if match_Empty(context, token)1085 build(context, token);1086 return 151087 end1088 1089 state_comment = "State: 15 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:0>#StepLine:0"1090 token.detach1091 expected_tokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"]1092 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)1093 raise error if (stop_at_first_error)1094 add_error(context, error)1095 return 151096 end1097 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:01098 def match_token_at_16(token, context)1099 if match_EOF(context, token)1100 end_rule(context, :DataTable);1101 end_rule(context, :Step);1102 end_rule(context, :Scenario);1103 end_rule(context, :Scenario_Definition);1104 end_rule(context, :Feature);1105 build(context, token);1106 return 271107 end1108 if match_TableRow(context, token)1109 build(context, token);1110 return 161111 end1112 if match_StepLine(context, token)1113 end_rule(context, :DataTable);1114 end_rule(context, :Step);1115 start_rule(context, :Step);1116 build(context, token);1117 return 151118 end1119 if match_TagLine(context, token)1120 end_rule(context, :DataTable);1121 end_rule(context, :Step);1122 end_rule(context, :Scenario);1123 end_rule(context, :Scenario_Definition);1124 start_rule(context, :Scenario_Definition);1125 start_rule(context, :Tags);1126 build(context, token);1127 return 111128 end1129 if match_ScenarioLine(context, token)1130 end_rule(context, :DataTable);1131 end_rule(context, :Step);1132 end_rule(context, :Scenario);1133 end_rule(context, :Scenario_Definition);1134 start_rule(context, :Scenario_Definition);1135 start_rule(context, :Scenario);1136 build(context, token);1137 return 121138 end1139 if match_ScenarioOutlineLine(context, token)1140 end_rule(context, :DataTable);1141 end_rule(context, :Step);1142 end_rule(context, :Scenario);1143 end_rule(context, :Scenario_Definition);1144 start_rule(context, :Scenario_Definition);1145 start_rule(context, :ScenarioOutline);1146 build(context, token);1147 return 171148 end1149 if match_Comment(context, token)1150 build(context, token);1151 return 161152 end1153 if match_Empty(context, token)1154 build(context, token);1155 return 161156 end1157 1158 state_comment = "State: 16 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0"1159 token.detach1160 expected_tokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"]1161 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)1162 raise error if (stop_at_first_error)1163 add_error(context, error)1164 return 161165 end1166 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:0>#ScenarioOutlineLine:01167 def match_token_at_17(token, context)1168 if match_EOF(context, token)1169 end_rule(context, :ScenarioOutline);1170 end_rule(context, :Scenario_Definition);1171 end_rule(context, :Feature);1172 build(context, token);1173 return 271174 end1175 if match_Empty(context, token)1176 build(context, token);1177 return 171178 end1179 if match_Comment(context, token)1180 build(context, token);1181 return 191182 end1183 if match_StepLine(context, token)1184 start_rule(context, :Step);1185 build(context, token);1186 return 201187 end1188 if match_TagLine(context, token)1189 if lookahead_0(context, token)1190 start_rule(context, :Examples_Definition);1191 start_rule(context, :Tags);1192 build(context, token);1193 return 221194 end1195 end1196 if match_TagLine(context, token)1197 end_rule(context, :ScenarioOutline);1198 end_rule(context, :Scenario_Definition);1199 start_rule(context, :Scenario_Definition);1200 start_rule(context, :Tags);1201 build(context, token);1202 return 111203 end1204 if match_ExamplesLine(context, token)1205 start_rule(context, :Examples_Definition);1206 start_rule(context, :Examples);1207 build(context, token);1208 return 231209 end1210 if match_ScenarioLine(context, token)1211 end_rule(context, :ScenarioOutline);1212 end_rule(context, :Scenario_Definition);1213 start_rule(context, :Scenario_Definition);1214 start_rule(context, :Scenario);1215 build(context, token);1216 return 121217 end1218 if match_ScenarioOutlineLine(context, token)1219 end_rule(context, :ScenarioOutline);1220 end_rule(context, :Scenario_Definition);1221 start_rule(context, :Scenario_Definition);1222 start_rule(context, :ScenarioOutline);1223 build(context, token);1224 return 171225 end1226 if match_Other(context, token)1227 start_rule(context, :Description);1228 build(context, token);1229 return 181230 end1231 1232 state_comment = "State: 17 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:0>#ScenarioOutlineLine:0"1233 token.detach1234 expected_tokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"]1235 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)1236 raise error if (stop_at_first_error)1237 add_error(context, error)1238 return 171239 end1240 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>Description_Helper:1>Description:0>#Other:01241 def match_token_at_18(token, context)1242 if match_EOF(context, token)1243 end_rule(context, :Description);1244 end_rule(context, :ScenarioOutline);1245 end_rule(context, :Scenario_Definition);1246 end_rule(context, :Feature);1247 build(context, token);1248 return 271249 end1250 if match_Comment(context, token)1251 end_rule(context, :Description);1252 build(context, token);1253 return 191254 end1255 if match_StepLine(context, token)1256 end_rule(context, :Description);1257 start_rule(context, :Step);1258 build(context, token);1259 return 201260 end1261 if match_TagLine(context, token)1262 if lookahead_0(context, token)1263 end_rule(context, :Description);1264 start_rule(context, :Examples_Definition);1265 start_rule(context, :Tags);1266 build(context, token);1267 return 221268 end1269 end1270 if match_TagLine(context, token)1271 end_rule(context, :Description);1272 end_rule(context, :ScenarioOutline);1273 end_rule(context, :Scenario_Definition);1274 start_rule(context, :Scenario_Definition);1275 start_rule(context, :Tags);1276 build(context, token);1277 return 111278 end1279 if match_ExamplesLine(context, token)1280 end_rule(context, :Description);1281 start_rule(context, :Examples_Definition);1282 start_rule(context, :Examples);1283 build(context, token);1284 return 231285 end1286 if match_ScenarioLine(context, token)1287 end_rule(context, :Description);1288 end_rule(context, :ScenarioOutline);1289 end_rule(context, :Scenario_Definition);1290 start_rule(context, :Scenario_Definition);1291 start_rule(context, :Scenario);1292 build(context, token);1293 return 121294 end1295 if match_ScenarioOutlineLine(context, token)1296 end_rule(context, :Description);1297 end_rule(context, :ScenarioOutline);1298 end_rule(context, :Scenario_Definition);1299 start_rule(context, :Scenario_Definition);1300 start_rule(context, :ScenarioOutline);1301 build(context, token);1302 return 171303 end1304 if match_Other(context, token)1305 build(context, token);1306 return 181307 end1308 1309 state_comment = "State: 18 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>Description_Helper:1>Description:0>#Other:0"1310 token.detach1311 expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"]1312 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)1313 raise error if (stop_at_first_error)1314 add_error(context, error)1315 return 181316 end1317 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>Description_Helper:2>#Comment:01318 def match_token_at_19(token, context)1319 if match_EOF(context, token)1320 end_rule(context, :ScenarioOutline);1321 end_rule(context, :Scenario_Definition);1322 end_rule(context, :Feature);1323 build(context, token);1324 return 271325 end1326 if match_Comment(context, token)1327 build(context, token);1328 return 191329 end1330 if match_StepLine(context, token)1331 start_rule(context, :Step);1332 build(context, token);1333 return 201334 end1335 if match_TagLine(context, token)1336 if lookahead_0(context, token)1337 start_rule(context, :Examples_Definition);1338 start_rule(context, :Tags);1339 build(context, token);1340 return 221341 end1342 end1343 if match_TagLine(context, token)1344 end_rule(context, :ScenarioOutline);1345 end_rule(context, :Scenario_Definition);1346 start_rule(context, :Scenario_Definition);1347 start_rule(context, :Tags);1348 build(context, token);1349 return 111350 end1351 if match_ExamplesLine(context, token)1352 start_rule(context, :Examples_Definition);1353 start_rule(context, :Examples);1354 build(context, token);1355 return 231356 end1357 if match_ScenarioLine(context, token)1358 end_rule(context, :ScenarioOutline);1359 end_rule(context, :Scenario_Definition);1360 start_rule(context, :Scenario_Definition);1361 start_rule(context, :Scenario);1362 build(context, token);1363 return 121364 end1365 if match_ScenarioOutlineLine(context, token)1366 end_rule(context, :ScenarioOutline);1367 end_rule(context, :Scenario_Definition);1368 start_rule(context, :Scenario_Definition);1369 start_rule(context, :ScenarioOutline);1370 build(context, token);1371 return 171372 end1373 if match_Empty(context, token)1374 build(context, token);1375 return 191376 end1377 1378 state_comment = "State: 19 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>Description_Helper:2>#Comment:0"1379 token.detach1380 expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"]1381 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)1382 raise error if (stop_at_first_error)1383 add_error(context, error)1384 return 191385 end1386 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:0>#StepLine:01387 def match_token_at_20(token, context)1388 if match_EOF(context, token)1389 end_rule(context, :Step);1390 end_rule(context, :ScenarioOutline);1391 end_rule(context, :Scenario_Definition);1392 end_rule(context, :Feature);1393 build(context, token);1394 return 271395 end1396 if match_TableRow(context, token)1397 start_rule(context, :DataTable);1398 build(context, token);1399 return 211400 end1401 if match_DocStringSeparator(context, token)1402 start_rule(context, :DocString);1403 build(context, token);1404 return 281405 end1406 if match_StepLine(context, token)1407 end_rule(context, :Step);1408 start_rule(context, :Step);1409 build(context, token);1410 return 201411 end1412 if match_TagLine(context, token)1413 if lookahead_0(context, token)1414 end_rule(context, :Step);1415 start_rule(context, :Examples_Definition);1416 start_rule(context, :Tags);1417 build(context, token);1418 return 221419 end1420 end1421 if match_TagLine(context, token)1422 end_rule(context, :Step);1423 end_rule(context, :ScenarioOutline);1424 end_rule(context, :Scenario_Definition);1425 start_rule(context, :Scenario_Definition);1426 start_rule(context, :Tags);1427 build(context, token);1428 return 111429 end1430 if match_ExamplesLine(context, token)1431 end_rule(context, :Step);1432 start_rule(context, :Examples_Definition);1433 start_rule(context, :Examples);1434 build(context, token);1435 return 231436 end1437 if match_ScenarioLine(context, token)1438 end_rule(context, :Step);1439 end_rule(context, :ScenarioOutline);1440 end_rule(context, :Scenario_Definition);1441 start_rule(context, :Scenario_Definition);1442 start_rule(context, :Scenario);1443 build(context, token);1444 return 121445 end1446 if match_ScenarioOutlineLine(context, token)1447 end_rule(context, :Step);1448 end_rule(context, :ScenarioOutline);1449 end_rule(context, :Scenario_Definition);1450 start_rule(context, :Scenario_Definition);1451 start_rule(context, :ScenarioOutline);1452 build(context, token);1453 return 171454 end1455 if match_Comment(context, token)1456 build(context, token);1457 return 201458 end1459 if match_Empty(context, token)1460 build(context, token);1461 return 201462 end1463 1464 state_comment = "State: 20 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:0>#StepLine:0"1465 token.detach1466 expected_tokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"]1467 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)1468 raise error if (stop_at_first_error)1469 add_error(context, error)1470 return 201471 end1472 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:01473 def match_token_at_21(token, context)1474 if match_EOF(context, token)1475 end_rule(context, :DataTable);1476 end_rule(context, :Step);1477 end_rule(context, :ScenarioOutline);1478 end_rule(context, :Scenario_Definition);1479 end_rule(context, :Feature);1480 build(context, token);1481 return 271482 end1483 if match_TableRow(context, token)1484 build(context, token);1485 return 211486 end1487 if match_StepLine(context, token)1488 end_rule(context, :DataTable);1489 end_rule(context, :Step);1490 start_rule(context, :Step);1491 build(context, token);1492 return 201493 end1494 if match_TagLine(context, token)1495 if lookahead_0(context, token)1496 end_rule(context, :DataTable);1497 end_rule(context, :Step);1498 start_rule(context, :Examples_Definition);1499 start_rule(context, :Tags);1500 build(context, token);1501 return 221502 end1503 end1504 if match_TagLine(context, token)1505 end_rule(context, :DataTable);1506 end_rule(context, :Step);1507 end_rule(context, :ScenarioOutline);1508 end_rule(context, :Scenario_Definition);1509 start_rule(context, :Scenario_Definition);1510 start_rule(context, :Tags);1511 build(context, token);1512 return 111513 end1514 if match_ExamplesLine(context, token)1515 end_rule(context, :DataTable);1516 end_rule(context, :Step);1517 start_rule(context, :Examples_Definition);1518 start_rule(context, :Examples);1519 build(context, token);1520 return 231521 end1522 if match_ScenarioLine(context, token)1523 end_rule(context, :DataTable);1524 end_rule(context, :Step);1525 end_rule(context, :ScenarioOutline);1526 end_rule(context, :Scenario_Definition);1527 start_rule(context, :Scenario_Definition);1528 start_rule(context, :Scenario);1529 build(context, token);1530 return 121531 end1532 if match_ScenarioOutlineLine(context, token)1533 end_rule(context, :DataTable);1534 end_rule(context, :Step);1535 end_rule(context, :ScenarioOutline);1536 end_rule(context, :Scenario_Definition);1537 start_rule(context, :Scenario_Definition);1538 start_rule(context, :ScenarioOutline);1539 build(context, token);1540 return 171541 end1542 if match_Comment(context, token)1543 build(context, token);1544 return 211545 end1546 if match_Empty(context, token)1547 build(context, token);1548 return 211549 end1550 1551 state_comment = "State: 21 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0"1552 token.detach1553 expected_tokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"]1554 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)1555 raise error if (stop_at_first_error)1556 add_error(context, error)1557 return 211558 end1559 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:0>Tags:0>#TagLine:01560 def match_token_at_22(token, context)1561 if match_TagLine(context, token)1562 build(context, token);1563 return 221564 end1565 if match_ExamplesLine(context, token)1566 end_rule(context, :Tags);1567 start_rule(context, :Examples);1568 build(context, token);1569 return 231570 end1571 if match_Comment(context, token)1572 build(context, token);1573 return 221574 end1575 if match_Empty(context, token)1576 build(context, token);1577 return 221578 end1579 1580 state_comment = "State: 22 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:0>Tags:0>#TagLine:0"1581 token.detach1582 expected_tokens = ["#TagLine", "#ExamplesLine", "#Comment", "#Empty"]1583 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)1584 raise error if (stop_at_first_error)1585 add_error(context, error)1586 return 221587 end1588 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:0>#ExamplesLine:01589 def match_token_at_23(token, context)1590 if match_EOF(context, token)1591 end_rule(context, :Examples);1592 end_rule(context, :Examples_Definition);1593 end_rule(context, :ScenarioOutline);1594 end_rule(context, :Scenario_Definition);1595 end_rule(context, :Feature);1596 build(context, token);1597 return 271598 end1599 if match_Empty(context, token)1600 build(context, token);1601 return 231602 end1603 if match_Comment(context, token)1604 build(context, token);1605 return 251606 end1607 if match_TableRow(context, token)1608 start_rule(context, :Examples_Table);1609 build(context, token);1610 return 261611 end1612 if match_TagLine(context, token)1613 if lookahead_0(context, token)1614 end_rule(context, :Examples);1615 end_rule(context, :Examples_Definition);1616 start_rule(context, :Examples_Definition);1617 start_rule(context, :Tags);1618 build(context, token);1619 return 221620 end1621 end1622 if match_TagLine(context, token)1623 end_rule(context, :Examples);1624 end_rule(context, :Examples_Definition);1625 end_rule(context, :ScenarioOutline);1626 end_rule(context, :Scenario_Definition);1627 start_rule(context, :Scenario_Definition);1628 start_rule(context, :Tags);1629 build(context, token);1630 return 111631 end1632 if match_ExamplesLine(context, token)1633 end_rule(context, :Examples);1634 end_rule(context, :Examples_Definition);1635 start_rule(context, :Examples_Definition);1636 start_rule(context, :Examples);1637 build(context, token);1638 return 231639 end1640 if match_ScenarioLine(context, token)1641 end_rule(context, :Examples);1642 end_rule(context, :Examples_Definition);1643 end_rule(context, :ScenarioOutline);1644 end_rule(context, :Scenario_Definition);1645 start_rule(context, :Scenario_Definition);1646 start_rule(context, :Scenario);1647 build(context, token);1648 return 121649 end1650 if match_ScenarioOutlineLine(context, token)1651 end_rule(context, :Examples);1652 end_rule(context, :Examples_Definition);1653 end_rule(context, :ScenarioOutline);1654 end_rule(context, :Scenario_Definition);1655 start_rule(context, :Scenario_Definition);1656 start_rule(context, :ScenarioOutline);1657 build(context, token);1658 return 171659 end1660 if match_Other(context, token)1661 start_rule(context, :Description);1662 build(context, token);1663 return 241664 end1665 1666 state_comment = "State: 23 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:0>#ExamplesLine:0"1667 token.detach1668 expected_tokens = ["#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"]1669 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)1670 raise error if (stop_at_first_error)1671 add_error(context, error)1672 return 231673 end1674 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Description_Helper:1>Description:0>#Other:01675 def match_token_at_24(token, context)1676 if match_EOF(context, token)1677 end_rule(context, :Description);1678 end_rule(context, :Examples);1679 end_rule(context, :Examples_Definition);1680 end_rule(context, :ScenarioOutline);1681 end_rule(context, :Scenario_Definition);1682 end_rule(context, :Feature);1683 build(context, token);1684 return 271685 end1686 if match_Comment(context, token)1687 end_rule(context, :Description);1688 build(context, token);1689 return 251690 end1691 if match_TableRow(context, token)1692 end_rule(context, :Description);1693 start_rule(context, :Examples_Table);1694 build(context, token);1695 return 261696 end1697 if match_TagLine(context, token)1698 if lookahead_0(context, token)1699 end_rule(context, :Description);1700 end_rule(context, :Examples);1701 end_rule(context, :Examples_Definition);1702 start_rule(context, :Examples_Definition);1703 start_rule(context, :Tags);1704 build(context, token);1705 return 221706 end1707 end1708 if match_TagLine(context, token)1709 end_rule(context, :Description);1710 end_rule(context, :Examples);1711 end_rule(context, :Examples_Definition);1712 end_rule(context, :ScenarioOutline);1713 end_rule(context, :Scenario_Definition);1714 start_rule(context, :Scenario_Definition);1715 start_rule(context, :Tags);1716 build(context, token);1717 return 111718 end1719 if match_ExamplesLine(context, token)1720 end_rule(context, :Description);1721 end_rule(context, :Examples);1722 end_rule(context, :Examples_Definition);1723 start_rule(context, :Examples_Definition);1724 start_rule(context, :Examples);1725 build(context, token);1726 return 231727 end1728 if match_ScenarioLine(context, token)1729 end_rule(context, :Description);1730 end_rule(context, :Examples);1731 end_rule(context, :Examples_Definition);1732 end_rule(context, :ScenarioOutline);1733 end_rule(context, :Scenario_Definition);1734 start_rule(context, :Scenario_Definition);1735 start_rule(context, :Scenario);1736 build(context, token);1737 return 121738 end1739 if match_ScenarioOutlineLine(context, token)1740 end_rule(context, :Description);1741 end_rule(context, :Examples);1742 end_rule(context, :Examples_Definition);1743 end_rule(context, :ScenarioOutline);1744 end_rule(context, :Scenario_Definition);1745 start_rule(context, :Scenario_Definition);1746 start_rule(context, :ScenarioOutline);1747 build(context, token);1748 return 171749 end1750 if match_Other(context, token)1751 build(context, token);1752 return 241753 end1754 1755 state_comment = "State: 24 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Description_Helper:1>Description:0>#Other:0"1756 token.detach1757 expected_tokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"]1758 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)1759 raise error if (stop_at_first_error)1760 add_error(context, error)1761 return 241762 end1763 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Description_Helper:2>#Comment:01764 def match_token_at_25(token, context)1765 if match_EOF(context, token)1766 end_rule(context, :Examples);1767 end_rule(context, :Examples_Definition);1768 end_rule(context, :ScenarioOutline);1769 end_rule(context, :Scenario_Definition);1770 end_rule(context, :Feature);1771 build(context, token);1772 return 271773 end1774 if match_Comment(context, token)1775 build(context, token);1776 return 251777 end1778 if match_TableRow(context, token)1779 start_rule(context, :Examples_Table);1780 build(context, token);1781 return 261782 end1783 if match_TagLine(context, token)1784 if lookahead_0(context, token)1785 end_rule(context, :Examples);1786 end_rule(context, :Examples_Definition);1787 start_rule(context, :Examples_Definition);1788 start_rule(context, :Tags);1789 build(context, token);1790 return 221791 end1792 end1793 if match_TagLine(context, token)1794 end_rule(context, :Examples);1795 end_rule(context, :Examples_Definition);1796 end_rule(context, :ScenarioOutline);1797 end_rule(context, :Scenario_Definition);1798 start_rule(context, :Scenario_Definition);1799 start_rule(context, :Tags);1800 build(context, token);1801 return 111802 end1803 if match_ExamplesLine(context, token)1804 end_rule(context, :Examples);1805 end_rule(context, :Examples_Definition);1806 start_rule(context, :Examples_Definition);1807 start_rule(context, :Examples);1808 build(context, token);1809 return 231810 end1811 if match_ScenarioLine(context, token)1812 end_rule(context, :Examples);1813 end_rule(context, :Examples_Definition);1814 end_rule(context, :ScenarioOutline);1815 end_rule(context, :Scenario_Definition);1816 start_rule(context, :Scenario_Definition);1817 start_rule(context, :Scenario);1818 build(context, token);1819 return 121820 end1821 if match_ScenarioOutlineLine(context, token)1822 end_rule(context, :Examples);1823 end_rule(context, :Examples_Definition);1824 end_rule(context, :ScenarioOutline);1825 end_rule(context, :Scenario_Definition);1826 start_rule(context, :Scenario_Definition);1827 start_rule(context, :ScenarioOutline);1828 build(context, token);1829 return 171830 end1831 if match_Empty(context, token)1832 build(context, token);1833 return 251834 end1835 1836 state_comment = "State: 25 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Description_Helper:2>#Comment:0"1837 token.detach1838 expected_tokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"]1839 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)1840 raise error if (stop_at_first_error)1841 add_error(context, error)1842 return 251843 end1844 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:2>Examples_Table:0>#TableRow:01845 def match_token_at_26(token, context)1846 if match_EOF(context, token)1847 end_rule(context, :Examples_Table);1848 end_rule(context, :Examples);1849 end_rule(context, :Examples_Definition);1850 end_rule(context, :ScenarioOutline);1851 end_rule(context, :Scenario_Definition);1852 end_rule(context, :Feature);1853 build(context, token);1854 return 271855 end1856 if match_TableRow(context, token)1857 build(context, token);1858 return 261859 end1860 if match_TagLine(context, token)1861 if lookahead_0(context, token)1862 end_rule(context, :Examples_Table);1863 end_rule(context, :Examples);1864 end_rule(context, :Examples_Definition);1865 start_rule(context, :Examples_Definition);1866 start_rule(context, :Tags);1867 build(context, token);1868 return 221869 end1870 end1871 if match_TagLine(context, token)1872 end_rule(context, :Examples_Table);1873 end_rule(context, :Examples);1874 end_rule(context, :Examples_Definition);1875 end_rule(context, :ScenarioOutline);1876 end_rule(context, :Scenario_Definition);1877 start_rule(context, :Scenario_Definition);1878 start_rule(context, :Tags);1879 build(context, token);1880 return 111881 end1882 if match_ExamplesLine(context, token)1883 end_rule(context, :Examples_Table);1884 end_rule(context, :Examples);1885 end_rule(context, :Examples_Definition);1886 start_rule(context, :Examples_Definition);1887 start_rule(context, :Examples);1888 build(context, token);1889 return 231890 end1891 if match_ScenarioLine(context, token)1892 end_rule(context, :Examples_Table);1893 end_rule(context, :Examples);1894 end_rule(context, :Examples_Definition);1895 end_rule(context, :ScenarioOutline);1896 end_rule(context, :Scenario_Definition);1897 start_rule(context, :Scenario_Definition);1898 start_rule(context, :Scenario);1899 build(context, token);1900 return 121901 end1902 if match_ScenarioOutlineLine(context, token)1903 end_rule(context, :Examples_Table);1904 end_rule(context, :Examples);1905 end_rule(context, :Examples_Definition);1906 end_rule(context, :ScenarioOutline);1907 end_rule(context, :Scenario_Definition);1908 start_rule(context, :Scenario_Definition);1909 start_rule(context, :ScenarioOutline);1910 build(context, token);1911 return 171912 end1913 if match_Comment(context, token)1914 build(context, token);1915 return 261916 end1917 if match_Empty(context, token)1918 build(context, token);1919 return 261920 end1921 1922 state_comment = "State: 26 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:2>Examples_Table:0>#TableRow:0"1923 token.detach1924 expected_tokens = ["#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"]1925 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)1926 raise error if (stop_at_first_error)1927 add_error(context, error)1928 return 261929 end1930 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:01931 def match_token_at_28(token, context)1932 if match_DocStringSeparator(context, token)1933 build(context, token);1934 return 291935 end1936 if match_Other(context, token)1937 build(context, token);1938 return 281939 end1940 1941 state_comment = "State: 28 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0"1942 token.detach1943 expected_tokens = ["#DocStringSeparator", "#Other"]1944 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)1945 raise error if (stop_at_first_error)1946 add_error(context, error)1947 return 281948 end1949 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:01950 def match_token_at_29(token, context)1951 if match_EOF(context, token)1952 end_rule(context, :DocString);1953 end_rule(context, :Step);1954 end_rule(context, :ScenarioOutline);1955 end_rule(context, :Scenario_Definition);1956 end_rule(context, :Feature);1957 build(context, token);1958 return 271959 end1960 if match_StepLine(context, token)1961 end_rule(context, :DocString);1962 end_rule(context, :Step);1963 start_rule(context, :Step);1964 build(context, token);1965 return 201966 end1967 if match_TagLine(context, token)1968 if lookahead_0(context, token)1969 end_rule(context, :DocString);1970 end_rule(context, :Step);1971 start_rule(context, :Examples_Definition);1972 start_rule(context, :Tags);1973 build(context, token);1974 return 221975 end1976 end1977 if match_TagLine(context, token)1978 end_rule(context, :DocString);1979 end_rule(context, :Step);1980 end_rule(context, :ScenarioOutline);1981 end_rule(context, :Scenario_Definition);1982 start_rule(context, :Scenario_Definition);1983 start_rule(context, :Tags);1984 build(context, token);1985 return 111986 end1987 if match_ExamplesLine(context, token)1988 end_rule(context, :DocString);1989 end_rule(context, :Step);1990 start_rule(context, :Examples_Definition);1991 start_rule(context, :Examples);1992 build(context, token);1993 return 231994 end1995 if match_ScenarioLine(context, token)1996 end_rule(context, :DocString);1997 end_rule(context, :Step);1998 end_rule(context, :ScenarioOutline);1999 end_rule(context, :Scenario_Definition);2000 start_rule(context, :Scenario_Definition);2001 start_rule(context, :Scenario);2002 build(context, token);2003 return 122004 end2005 if match_ScenarioOutlineLine(context, token)2006 end_rule(context, :DocString);2007 end_rule(context, :Step);2008 end_rule(context, :ScenarioOutline);2009 end_rule(context, :Scenario_Definition);2010 start_rule(context, :Scenario_Definition);2011 start_rule(context, :ScenarioOutline);2012 build(context, token);2013 return 172014 end2015 if match_Comment(context, token)2016 build(context, token);2017 return 292018 end2019 if match_Empty(context, token)2020 build(context, token);2021 return 292022 end2023 2024 state_comment = "State: 29 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0"2025 token.detach2026 expected_tokens = ["#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"]2027 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)2028 raise error if (stop_at_first_error)2029 add_error(context, error)2030 return 292031 end2032 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:02033 def match_token_at_30(token, context)2034 if match_DocStringSeparator(context, token)2035 build(context, token);2036 return 312037 end2038 if match_Other(context, token)2039 build(context, token);2040 return 302041 end2042 2043 state_comment = "State: 30 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0"2044 token.detach2045 expected_tokens = ["#DocStringSeparator", "#Other"]2046 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)2047 raise error if (stop_at_first_error)2048 add_error(context, error)2049 return 302050 end2051 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:02052 def match_token_at_31(token, context)2053 if match_EOF(context, token)2054 end_rule(context, :DocString);2055 end_rule(context, :Step);2056 end_rule(context, :Scenario);2057 end_rule(context, :Scenario_Definition);2058 end_rule(context, :Feature);2059 build(context, token);2060 return 272061 end2062 if match_StepLine(context, token)2063 end_rule(context, :DocString);2064 end_rule(context, :Step);2065 start_rule(context, :Step);2066 build(context, token);2067 return 152068 end2069 if match_TagLine(context, token)2070 end_rule(context, :DocString);2071 end_rule(context, :Step);2072 end_rule(context, :Scenario);2073 end_rule(context, :Scenario_Definition);2074 start_rule(context, :Scenario_Definition);2075 start_rule(context, :Tags);2076 build(context, token);2077 return 112078 end2079 if match_ScenarioLine(context, token)2080 end_rule(context, :DocString);2081 end_rule(context, :Step);2082 end_rule(context, :Scenario);2083 end_rule(context, :Scenario_Definition);2084 start_rule(context, :Scenario_Definition);2085 start_rule(context, :Scenario);2086 build(context, token);2087 return 122088 end2089 if match_ScenarioOutlineLine(context, token)2090 end_rule(context, :DocString);2091 end_rule(context, :Step);2092 end_rule(context, :Scenario);2093 end_rule(context, :Scenario_Definition);2094 start_rule(context, :Scenario_Definition);2095 start_rule(context, :ScenarioOutline);2096 build(context, token);2097 return 172098 end2099 if match_Comment(context, token)2100 build(context, token);2101 return 312102 end2103 if match_Empty(context, token)2104 build(context, token);2105 return 312106 end2107 2108 state_comment = "State: 31 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0"2109 token.detach2110 expected_tokens = ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"]2111 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)2112 raise error if (stop_at_first_error)2113 add_error(context, error)2114 return 312115 end2116 # GherkinDocument:0>Feature:1>Background:2>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:02117 def match_token_at_32(token, context)2118 if match_DocStringSeparator(context, token)2119 build(context, token);2120 return 332121 end2122 if match_Other(context, token)2123 build(context, token);2124 return 322125 end2126 2127 state_comment = "State: 32 - GherkinDocument:0>Feature:1>Background:2>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0"2128 token.detach2129 expected_tokens = ["#DocStringSeparator", "#Other"]2130 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)2131 raise error if (stop_at_first_error)2132 add_error(context, error)2133 return 322134 end2135 # GherkinDocument:0>Feature:1>Background:2>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:02136 def match_token_at_33(token, context)2137 if match_EOF(context, token)2138 end_rule(context, :DocString);2139 end_rule(context, :Step);2140 end_rule(context, :Background);2141 end_rule(context, :Feature);2142 build(context, token);2143 return 272144 end2145 if match_StepLine(context, token)2146 end_rule(context, :DocString);2147 end_rule(context, :Step);2148 start_rule(context, :Step);2149 build(context, token);2150 return 92151 end2152 if match_TagLine(context, token)2153 end_rule(context, :DocString);2154 end_rule(context, :Step);2155 end_rule(context, :Background);2156 start_rule(context, :Scenario_Definition);2157 start_rule(context, :Tags);2158 build(context, token);2159 return 112160 end2161 if match_ScenarioLine(context, token)2162 end_rule(context, :DocString);2163 end_rule(context, :Step);2164 end_rule(context, :Background);2165 start_rule(context, :Scenario_Definition);2166 start_rule(context, :Scenario);2167 build(context, token);2168 return 122169 end2170 if match_ScenarioOutlineLine(context, token)2171 end_rule(context, :DocString);2172 end_rule(context, :Step);2173 end_rule(context, :Background);2174 start_rule(context, :Scenario_Definition);2175 start_rule(context, :ScenarioOutline);2176 build(context, token);2177 return 172178 end2179 if match_Comment(context, token)2180 build(context, token);2181 return 332182 end2183 if match_Empty(context, token)2184 build(context, token);2185 return 332186 end2187 2188 state_comment = "State: 33 - GherkinDocument:0>Feature:1>Background:2>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0"2189 token.detach2190 expected_tokens = ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"]2191 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)2192 raise error if (stop_at_first_error)2193 add_error(context, error)2194 return 332195 end2196 2197 def lookahead_0(context, currentToken)2198 currentToken.detach2199 token = nil2200 queue = []2201 match = false2202 loop do2203 token = read_token(context)2204 token.detach2205 queue.push(token)...

Full Screen

Full Screen

i18n_spec.rb

Source:i18n_spec.rb Github

copy

Full Screen

...18 [:scenario, "Scenario", "Parsing many languages", "", 4],19 [:step, "Gitt ", "Gherkin supports many languages", 5],20 [:step, "Når ", "Norwegian keywords are parsed", 6],21 [:step, "Så ", "they should be recognized", 7],22 [:eof]23 ]24 end25 it "should recognize keywords that are a little ambiguous" do26 lexer = Gherkin::Lexer::I18nLexer.new(@listener, false)27 scan_file(lexer, "i18n_fr2.feature")28 @listener.to_sexp.should == [29 [:comment, "#language:fr", 1],30 [:feature, "Fonctionnalité", "i18n", "", 2],31 [:scenario, "Scénario", "Le French", "", 4],32 [:step, "Etant donné ", "qqch", 5],33 [:step, "Etant donnée ", "qqch", 6],34 [:step, "Etant donnés ", "qqch", 7],35 [:step, "Etant données ", "qqch", 8],36 [:eof]37 ]38 end39 it "should parse languages without a space after keywords" do40 lexer = Gherkin::Lexer::I18nLexer.new(@listener, false)41 scan_file(lexer, "i18n_zh-CN.feature")42 @listener.to_sexp.should == [43 [:comment, "#language:zh-CN", 1],44 [:feature, "功能", "加法", "", 2],45 [:scenario, "场景", "两个数相加", "", 4],46 [:step, "假如", "我已经在计算器里输入6", 5],47 [:step, "而且", "我已经在计算器里输入7", 6],48 [:step, "当", "我按相加按钮", 7],49 [:step, "那么", "我应该在屏幕上看到的结果是13", 8],50 [:eof]51 ]52 end53 it "should parse languages with spaces after some keywords but not others" do54 lexer = Gherkin::Lexer::I18nLexer.new(@listener, false)55 scan_file(lexer, "i18n_fr.feature")56 @listener.to_sexp.should == [57 [:comment, "#language:fr", 1],58 [:feature, "Fonctionnalité", "Addition", "", 2],59 [:scenario_outline, "Plan du scénario", "Addition de produits dérivés", "", 3],60 [:step, "Soit ", "une calculatrice", 4],61 [:step, "Etant donné ", "qu'on tape <a>", 5],62 [:step, "Et ", "qu'on tape <b>", 6],63 [:step, "Lorsqu'", "on tape additionner", 7],64 [:step, "Alors ", "le résultat doit être <somme>", 8],65 [:examples, "Exemples", "", "", 10],66 [:row, %w{a b somme}, 11],67 [:row, %w{2 2 4}, 12],68 [:row, %w{2 3 5}, 13],69 [:eof]70 ]71 end72 it "should recognize keywords in Portuguese (1st variant)" do73 lexer = Gherkin::Lexer::I18nLexer.new(@listener, false)74 scan_file(lexer, "i18n_pt1.feature")75 @listener.to_sexp.should == [76 [:comment, "# language: pt", 1],77 [:feature, "Funcionalidade", "Reconhece \"Funcionalidade\"", "", 2],78 [:background, "Contexto", "Reconhece \"Contexto\"", "", 4],79 [:scenario, "Cenário", "Reconhece \"Cenário\" com acento", "", 6],80 [:scenario, "Cenario", "Reconhece \"Cenário\" sem acento", "", 8],81 [:scenario_outline, "Esquema do Cenário", "Reconhece \"Esquema do Cenário\" com acento", "", 10],82 [:step, "Dado ", "que <Valor> é um valor e que reconhece \"Dado\";", 11],83 [:step, "Dada ", "a afirmação de que reconhece \"Dada\";", 12],84 [:step, "Dados ", "os factos acima e ainda que reconhece \"Dados\";", 13],85 [:step, "Dadas ", "as afirmações acima e ainda que reconhece \"Dadas\";", 14],86 [:step, "Quando ", "reconhece \"Quando\";", 15],87 [:step, "Então ", "também reconhece \"Então\" com acento e", 16],88 [:step, "Entao ", "também reconhece \"Então\" sem acento;", 17],89 [:step, "E ", "reconhece \"E\";", 18],90 [:step, "Mas ", "também reconhece \"Mas\".", 19],91 [:examples, "Exemplos", "Reconhece \"Exemplos\"", "", 21],92 [:row, ["Valor"], 22],93 [:row, ["1"], 23],94 [:scenario_outline, "Esquema do Cenario", "Reconhece \"Esquema do Cenário\" sem acento", "", 25],95 [:step, "Dado ", "que <Valor> é um valor;", 26],96 [:examples, "Cenários", "Reconhece \"Cenários\" com acento", "", 28],97 [:row, ["Valor"], 29],98 [:row, ["1"], 30],99 [:scenario_outline, "Delineação do Cenário", "Reconhece \"Delineação do Cenário\" com acento", "", 32],100 [:step, "Dado ", "que <Valor> é um valor;", 33],101 [:examples, "Cenarios", "Reconhece \"Cenários\" sem acento", "", 35],102 [:row, ["Valor"], 36],103 [:row, ["1"], 37],104 [:scenario_outline, "Delineacao do Cenario", "Reconhece \"Delineação do Cenário\" sem acento", "", 39],105 [:step, "Dado ", "que <Valor> é um valor;", 40],106 [:examples, "Exemplos", "Reconhece \"Exemplos\"", "", 42],107 [:row, ["Valor"], 43],108 [:row, ["1"], 44],109 [:eof]110 ]111 end112 it "should recognize keywords in Portuguese (2nd variant)" do113 lexer = Gherkin::Lexer::I18nLexer.new(@listener, false)114 scan_file(lexer, "i18n_pt2.feature")115 @listener.to_sexp.should == [116 [:comment, "# language: pt", 1],117 [:feature, "Característica", "Reconhece \"Característica\" com acento", "", 2],118 [:background, "Cenário de Fundo", "Reconhece \"Cenário de Fundo\" com acento", "", 4],119 [:eof]120 ]121 end122 it "should recognize keywords in Portuguese (3rd variant)" do123 lexer = Gherkin::Lexer::I18nLexer.new(@listener, false)124 scan_file(lexer, "i18n_pt3.feature")125 @listener.to_sexp.should == [126 [:comment, "# language: pt", 1],127 [:feature, "Caracteristica", "Reconhece \"Característica\" sem acento", "", 2],128 [:background, "Cenario de Fundo", "Reconhece \"Cenário de Fundo\" sem acento", "", 4],129 [:eof]130 ]131 end132 it "should recognize keywords in Portuguese (4th variant)" do133 lexer = Gherkin::Lexer::I18nLexer.new(@listener, false)134 scan_file(lexer, "i18n_pt4.feature")135 @listener.to_sexp.should == [136 [:comment, "# language: pt", 1],137 [:feature, "Característica", "Reconhece \"Característica\" com acento", "", 2],138 [:background, "Fundo", "Reconhece \"Fundo\"", "", 4],139 [:eof]140 ]141 end142 describe 'keywords' do143 it "should have code keywords without space, comma, exclamation or apostrophe" do144 ['Avast', 'Akkor', 'Etantdonné', 'Lorsque', '假設'].each do |code_keyword|145 Gherkin::I18n.code_keywords.should include(code_keyword)146 end147 end148 it "should reject the bullet stars" do149 Gherkin::I18n.code_keywords.should_not include('*')150 end151 it "should report keyword regexp" do152 Gherkin::I18n.keyword_regexp(:step).should =~ /\|Quando \|Quand \|Quan \|Pryd \|/153 end...

Full Screen

Full Screen

xcfit

Source:xcfit Github

copy

Full Screen

1#!/usr/bin/env ruby2require "bundler/setup"3require "xcfit"4require 'fileutils'5require 'tempfile'6require 'json'7require 'rubygems'8require 'XCFit/version'9require 'XCFit/main'10lib_dir = File.expand_path('../lib', File.dirname(__FILE__))11$LOAD_PATH.unshift lib_dir unless $LOAD_PATH.include?(lib_dir)12$:.unshift lib_dir unless $:.include?(lib_dir)13XCFit::Main.start(ARGV)14# @root_dir = File.expand_path('~')15# @root_lib_dir = File.join(@root_dir, 'Library')16# @root_developer_dir = File.join(@root_lib_dir, 'Developer')17# @root_xcode_dir = File.join(@root_developer_dir, 'Xcode')18# @root_template_dir = File.join(@root_xcode_dir, 'Templates')19# @root_xcfit_dir = File.join(@root_template_dir, 'XCfit')20# @root_gherkin_dir = File.join(@root_template_dir, 'Gherkin')21# @source_dir = File.join(File.dirname(__FILE__), '..', 'XCFit_Templates')22# @source_xcfit_dir = File.join(@source_dir, 'XCFit')23# @source_gherkin_dir = File.join(@source_dir, 'Gherkin')24# puts "Hello"25# puts (@root_template_dir)26# def setup_xcfit27# if File.exist?(@root_xcfit_dir)28# puts 'There is already XCFit directory. Please move existing XCFit directory to carry on '29# exit 130# end31# FileUtils.cp_r(@source_xcfit_dir, @root_template_dir)32# end33# def setup_gherkin34# if File.exist?(@root_gherkin_dir)35# puts 'There is already Gherkin directory. Please move existing Gherkin directory to carry on '36# exit 137# end38# FileUtils.cp_r(@source_gherkin_dir, @root_template_dir)39# end40# def print_usage41# puts <<EOF42# Usage: xcfit <command-name>43# <command-name> can be one of44# help45# prints more detailed help information.46# setup_xcfit47# generate a Xcode Templates for the Cucumberish and Fitnesse48# setup_gherkin49# generate Xcode Templates for the Gherkin Feature Files50# version51# prints the gem version52# <options> can be53# -v, --verbose Turns on verbose logging54# EOF55# end56# def print_help57# puts <<EOF58# Usage: xcfit <command-name>59# <command-name> can be one of60# help61# setup_xcfit62# setup_gherkin63# version64# Commands:65# help : prints more detailed help information.66# setup_xcfit : Generate a Xcode Templates for the Cucumberish and Fitnesse67# setup_gherkin : Generate Xcode Templates for the Gherkin Feature Files68# version : prints the gem version69# <Options>70# -v, --verbose Turns on verbose logging71# EOF72# end73# if ARGV.length == 074# print_usage75# else76# cmd = ARGV.shift77# if cmd == 'help'78# print_help79# elsif cmd == 'setup_xcfit'80# setup_xcfit81# elsif cmd == 'version'82# puts XCFit::VERSION83# elsif cmd == 'setup_gherkin'84# setup_gherkin85# else86# print_usage87# end88# end...

Full Screen

Full Screen

eof

Using AI Code Generation

copy

Full Screen

1Gherkin::Gherkin.new("test.txt").eof2 def initialize(file)3 File.open(@file) do |f|

Full Screen

Full Screen

eof

Using AI Code Generation

copy

Full Screen

1f = File.open('test.feature', 'r')2gherkin = Gherkin::Parser::Parser.new.parse(f)3f = File.open('test.feature', 'r')4gherkin = Gherkin::Parser::Parser.new.parse(f)5f = File.open('test.feature', 'r')6gherkin = Gherkin::Parser::Parser.new.parse(f)

Full Screen

Full Screen

eof

Using AI Code Generation

copy

Full Screen

1file = File.open('features/test.feature')2gherkin.parse(file, 'features/test.feature', 0)3gherkin.parse(file, 'features/test.feature', 0)4gherkin.parse(file, 'features/test.feature', 0)5gherkin.parse(file, 'features/test.feature', 0)6gherkin.parse(file, 'features/test.feature', 0)7gherkin.parse(file, 'features/test.feature', 0)8gherkin.parse(file, 'features/test.feature', 0)9gherkin.parse(file, 'features/test.feature', 0)

Full Screen

Full Screen

eof

Using AI Code Generation

copy

Full Screen

1file = File.open('features/test.feature')2gherkin.parse(file, 'features/test.feature', 0)3gherkin.parse(file, 'features/test.feature', 0)4gherkin.parse(file, 'features/test.feature', 0)5gherkin.parse(file, 'features/test.feature', 0)6gherkin.parse(file, 'features/test.feature', 0)7gherkin.parse(file, 'features/test.feature', 0)8gherkin.parse(file, 'features/test.feature', 0)9gherkin.parse(file, 'features/test.feature', 0)

Full Screen

Full Screen

eof

Using AI Code Generation

copy

Full Screen

1 def self.read_file(filename)2 gherkin.parse(File.open(filename).read, filename)3GherkinExample.read_file(filename)4You can also use the parse method to read from STDIN. Just use $stdin.read instead of File.open(filename).read

Full Screen

Full Screen

eof

Using AI Code Generation

copy

Full Screen

15 file = File . open ( 'features/1.feature' , 'r' ) 26 gherkin = Gherkin . new ( file ) 35 file = File . open ( 'features/1.feature' , 'r' ) 46 gherkin = Gherkin . new ( file ) 58 while ( line = gherkin . readline ) != nil do 65 file = File . open ( 'features/1.feature' , 'r' ) 76 gherkin = Gherkin . new ( file ) 88 while ( line = gherkin . readline ) do 95 file = File . open ( 'feature/1.fatue' , 'r' )

Full Screen

Full Screen

eof

Using AI Code Generation

copy

Full Screen

1Gherkin::Parser::Parser.new.parse(STDIN.read).eof?2 def self.read_string(string)3 gherkin.parse(string)4GherkinExample.read_string('Feature: A feature5 def self.read_io(io)6 gherkin.parse(io)7GherkinExample.read_io($stdin)

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Gherkin-ruby automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used method in

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful