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