<?php

declare(strict_types=1);

/**
 * This code was generated by Berp (http://https://github.com/gasparnagy/berp/).
 *
 *  Changes to this file may cause incorrect behavior and will be lost if
 *  the code is regenerated.
 */

namespace Cucumber\Gherkin;

use Cucumber\Gherkin\Parser\ParserContext;
use Cucumber\Gherkin\Parser\ParserTrait;
use Cucumber\Gherkin\Parser\RuleType;
use Cucumber\Gherkin\ParserException\UnexpectedTokenException;
use Cucumber\Gherkin\ParserException\UnexpectedEofException;

/**
 * @template T
 */
final class Parser
{
    /**
     * @use ParserTrait<T>
     */
    use ParserTrait;

    private function match_EOF(ParserContext $context, Token $token): bool
    {
        return $this->handleExternalError(
            $context,
            fn () => $context->tokenMatcher->match_EOF($token),
            false,
        );
    }

    private function match_Empty(ParserContext $context, Token $token): bool
    {
        if ($token->isEOF()) {
            return false;
        }

        return $this->handleExternalError(
            $context,
            fn () => $context->tokenMatcher->match_Empty($token),
            false,
        );
    }

    private function match_Comment(ParserContext $context, Token $token): bool
    {
        if ($token->isEOF()) {
            return false;
        }

        return $this->handleExternalError(
            $context,
            fn () => $context->tokenMatcher->match_Comment($token),
            false,
        );
    }

    private function match_TagLine(ParserContext $context, Token $token): bool
    {
        if ($token->isEOF()) {
            return false;
        }

        return $this->handleExternalError(
            $context,
            fn () => $context->tokenMatcher->match_TagLine($token),
            false,
        );
    }

    private function match_FeatureLine(ParserContext $context, Token $token): bool
    {
        if ($token->isEOF()) {
            return false;
        }

        return $this->handleExternalError(
            $context,
            fn () => $context->tokenMatcher->match_FeatureLine($token),
            false,
        );
    }

    private function match_RuleLine(ParserContext $context, Token $token): bool
    {
        if ($token->isEOF()) {
            return false;
        }

        return $this->handleExternalError(
            $context,
            fn () => $context->tokenMatcher->match_RuleLine($token),
            false,
        );
    }

    private function match_BackgroundLine(ParserContext $context, Token $token): bool
    {
        if ($token->isEOF()) {
            return false;
        }

        return $this->handleExternalError(
            $context,
            fn () => $context->tokenMatcher->match_BackgroundLine($token),
            false,
        );
    }

    private function match_ScenarioLine(ParserContext $context, Token $token): bool
    {
        if ($token->isEOF()) {
            return false;
        }

        return $this->handleExternalError(
            $context,
            fn () => $context->tokenMatcher->match_ScenarioLine($token),
            false,
        );
    }

    private function match_ExamplesLine(ParserContext $context, Token $token): bool
    {
        if ($token->isEOF()) {
            return false;
        }

        return $this->handleExternalError(
            $context,
            fn () => $context->tokenMatcher->match_ExamplesLine($token),
            false,
        );
    }

    private function match_StepLine(ParserContext $context, Token $token): bool
    {
        if ($token->isEOF()) {
            return false;
        }

        return $this->handleExternalError(
            $context,
            fn () => $context->tokenMatcher->match_StepLine($token),
            false,
        );
    }

    private function match_DocStringSeparator(ParserContext $context, Token $token): bool
    {
        if ($token->isEOF()) {
            return false;
        }

        return $this->handleExternalError(
            $context,
            fn () => $context->tokenMatcher->match_DocStringSeparator($token),
            false,
        );
    }

    private function match_TableRow(ParserContext $context, Token $token): bool
    {
        if ($token->isEOF()) {
            return false;
        }

        return $this->handleExternalError(
            $context,
            fn () => $context->tokenMatcher->match_TableRow($token),
            false,
        );
    }

    private function match_Language(ParserContext $context, Token $token): bool
    {
        if ($token->isEOF()) {
            return false;
        }

        return $this->handleExternalError(
            $context,
            fn () => $context->tokenMatcher->match_Language($token),
            false,
        );
    }

    private function match_Other(ParserContext $context, Token $token): bool
    {
        if ($token->isEOF()) {
            return false;
        }

        return $this->handleExternalError(
            $context,
            fn () => $context->tokenMatcher->match_Other($token),
            false,
        );
    }

    private function matchToken(int $state, Token $token, ParserContext $context): int
    {
        return match ($state) {
            0 => $this->matchTokenAt_0($token, $context),
            1 => $this->matchTokenAt_1($token, $context),
            2 => $this->matchTokenAt_2($token, $context),
            3 => $this->matchTokenAt_3($token, $context),
            4 => $this->matchTokenAt_4($token, $context),
            5 => $this->matchTokenAt_5($token, $context),
            6 => $this->matchTokenAt_6($token, $context),
            7 => $this->matchTokenAt_7($token, $context),
            8 => $this->matchTokenAt_8($token, $context),
            9 => $this->matchTokenAt_9($token, $context),
            10 => $this->matchTokenAt_10($token, $context),
            11 => $this->matchTokenAt_11($token, $context),
            12 => $this->matchTokenAt_12($token, $context),
            13 => $this->matchTokenAt_13($token, $context),
            14 => $this->matchTokenAt_14($token, $context),
            15 => $this->matchTokenAt_15($token, $context),
            16 => $this->matchTokenAt_16($token, $context),
            17 => $this->matchTokenAt_17($token, $context),
            18 => $this->matchTokenAt_18($token, $context),
            19 => $this->matchTokenAt_19($token, $context),
            20 => $this->matchTokenAt_20($token, $context),
            21 => $this->matchTokenAt_21($token, $context),
            22 => $this->matchTokenAt_22($token, $context),
            23 => $this->matchTokenAt_23($token, $context),
            24 => $this->matchTokenAt_24($token, $context),
            25 => $this->matchTokenAt_25($token, $context),
            26 => $this->matchTokenAt_26($token, $context),
            27 => $this->matchTokenAt_27($token, $context),
            28 => $this->matchTokenAt_28($token, $context),
            29 => $this->matchTokenAt_29($token, $context),
            30 => $this->matchTokenAt_30($token, $context),
            31 => $this->matchTokenAt_31($token, $context),
            32 => $this->matchTokenAt_32($token, $context),
            33 => $this->matchTokenAt_33($token, $context),
            35 => $this->matchTokenAt_35($token, $context),
            36 => $this->matchTokenAt_36($token, $context),
            37 => $this->matchTokenAt_37($token, $context),
            38 => $this->matchTokenAt_38($token, $context),
            39 => $this->matchTokenAt_39($token, $context),
            40 => $this->matchTokenAt_40($token, $context),
            41 => $this->matchTokenAt_41($token, $context),
            42 => $this->matchTokenAt_42($token, $context),
            default => throw new \LogicException("Unknown state: $state"),
        };
    }


    // Start
    private function matchTokenAt_0(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_Language($context, $token)) {
            $this->startRule($context, RuleType::Feature);
            $this->startRule($context, RuleType::FeatureHeader);
            $this->build($context, $token);
            return 1;
        }
        if ($this->match_TagLine($context, $token)) {
            $this->startRule($context, RuleType::Feature);
            $this->startRule($context, RuleType::FeatureHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 2;
        }
        if ($this->match_FeatureLine($context, $token)) {
            $this->startRule($context, RuleType::Feature);
            $this->startRule($context, RuleType::FeatureHeader);
            $this->build($context, $token);
            return 3;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 0;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 0;
        }

        $stateComment = "State: 0 - Start";
        $expectedTokens = ["#EOF", "#Language", "#TagLine", "#FeatureLine", "#Comment", "#Empty"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 0;
    }

    // GherkinDocument:0>Feature:0>FeatureHeader:0>#Language:0
    private function matchTokenAt_1(Token $token, ParserContext $context): int
    {
        if ($this->match_TagLine($context, $token)) {
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 2;
        }
        if ($this->match_FeatureLine($context, $token)) {
            $this->build($context, $token);
            return 3;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 1;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 1;
        }

        $stateComment = "State: 1 - GherkinDocument:0>Feature:0>FeatureHeader:0>#Language:0";
        $expectedTokens = ["#TagLine", "#FeatureLine", "#Comment", "#Empty"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 1;
    }

    // GherkinDocument:0>Feature:0>FeatureHeader:1>Tags:0>#TagLine:0
    private function matchTokenAt_2(Token $token, ParserContext $context): int
    {
        if ($this->match_TagLine($context, $token)) {
            $this->build($context, $token);
            return 2;
        }
        if ($this->match_FeatureLine($context, $token)) {
            $this->endRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 3;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 2;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 2;
        }

        $stateComment = "State: 2 - GherkinDocument:0>Feature:0>FeatureHeader:1>Tags:0>#TagLine:0";
        $expectedTokens = ["#TagLine", "#FeatureLine", "#Comment", "#Empty"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 2;
    }

    // GherkinDocument:0>Feature:0>FeatureHeader:2>#FeatureLine:0
    private function matchTokenAt_3(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::FeatureHeader);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 3;
        }
        if ($this->match_Comment($context, $token)) {
            $this->startRule($context, RuleType::Description);
            $this->build($context, $token);
            return 4;
        }
        if ($this->match_BackgroundLine($context, $token)) {
            $this->endRule($context, RuleType::FeatureHeader);
            $this->startRule($context, RuleType::Background);
            $this->build($context, $token);
            return 5;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::FeatureHeader);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 9;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::FeatureHeader);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::FeatureHeader);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 10;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::FeatureHeader);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Other($context, $token)) {
            $this->startRule($context, RuleType::Description);
            $this->build($context, $token);
            return 4;
        }

        $stateComment = "State: 3 - GherkinDocument:0>Feature:0>FeatureHeader:2>#FeatureLine:0";
        $expectedTokens = ["#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 3;
    }

    // GherkinDocument:0>Feature:0>FeatureHeader:3>DescriptionHelper:1>Description:0>__alt1:0>#Other:0
    private function matchTokenAt_4(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::FeatureHeader);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 4;
        }
        if ($this->match_BackgroundLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::FeatureHeader);
            $this->startRule($context, RuleType::Background);
            $this->build($context, $token);
            return 5;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::Description);
                $this->endRule($context, RuleType::FeatureHeader);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 9;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::FeatureHeader);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::FeatureHeader);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 10;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::FeatureHeader);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Other($context, $token)) {
            $this->build($context, $token);
            return 4;
        }

        $stateComment = "State: 4 - GherkinDocument:0>Feature:0>FeatureHeader:3>DescriptionHelper:1>Description:0>__alt1:0>#Other:0";
        $expectedTokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 4;
    }

    // GherkinDocument:0>Feature:1>Background:0>#BackgroundLine:0
    private function matchTokenAt_5(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::Background);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 5;
        }
        if ($this->match_Comment($context, $token)) {
            $this->startRule($context, RuleType::Description);
            $this->build($context, $token);
            return 6;
        }
        if ($this->match_StepLine($context, $token)) {
            $this->startRule($context, RuleType::Step);
            $this->build($context, $token);
            return 7;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::Background);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 9;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::Background);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::Background);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 10;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::Background);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Other($context, $token)) {
            $this->startRule($context, RuleType::Description);
            $this->build($context, $token);
            return 6;
        }

        $stateComment = "State: 5 - GherkinDocument:0>Feature:1>Background:0>#BackgroundLine:0";
        $expectedTokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 5;
    }

    // GherkinDocument:0>Feature:1>Background:1>DescriptionHelper:1>Description:0>__alt1:0>#Other:0
    private function matchTokenAt_6(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Background);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 6;
        }
        if ($this->match_StepLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->startRule($context, RuleType::Step);
            $this->build($context, $token);
            return 7;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::Description);
                $this->endRule($context, RuleType::Background);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 9;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Background);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Background);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 10;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Background);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Other($context, $token)) {
            $this->build($context, $token);
            return 6;
        }

        $stateComment = "State: 6 - GherkinDocument:0>Feature:1>Background:1>DescriptionHelper:1>Description:0>__alt1:0>#Other:0";
        $expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 6;
    }

    // GherkinDocument:0>Feature:1>Background:2>Step:0>#StepLine:0
    private function matchTokenAt_7(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Background);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_TableRow($context, $token)) {
            $this->startRule($context, RuleType::DataTable);
            $this->build($context, $token);
            return 8;
        }
        if ($this->match_DocStringSeparator($context, $token)) {
            $this->startRule($context, RuleType::DocString);
            $this->build($context, $token);
            return 41;
        }
        if ($this->match_StepLine($context, $token)) {
            $this->endRule($context, RuleType::Step);
            $this->startRule($context, RuleType::Step);
            $this->build($context, $token);
            return 7;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::Step);
                $this->endRule($context, RuleType::Background);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 9;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Background);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Background);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 10;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Background);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 7;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 7;
        }

        $stateComment = "State: 7 - GherkinDocument:0>Feature:1>Background:2>Step:0>#StepLine:0";
        $expectedTokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 7;
    }

    // GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0
    private function matchTokenAt_8(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::DataTable);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Background);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_TableRow($context, $token)) {
            $this->build($context, $token);
            return 8;
        }
        if ($this->match_StepLine($context, $token)) {
            $this->endRule($context, RuleType::DataTable);
            $this->endRule($context, RuleType::Step);
            $this->startRule($context, RuleType::Step);
            $this->build($context, $token);
            return 7;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::DataTable);
                $this->endRule($context, RuleType::Step);
                $this->endRule($context, RuleType::Background);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 9;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::DataTable);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Background);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::DataTable);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Background);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 10;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::DataTable);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Background);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 8;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 8;
        }

        $stateComment = "State: 8 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0";
        $expectedTokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 8;
    }

    // GherkinDocument:0>Feature:2>ScenarioDefinition:0>Tags:0>#TagLine:0
    private function matchTokenAt_9(Token $token, ParserContext $context): int
    {
        if ($this->match_TagLine($context, $token)) {
            $this->build($context, $token);
            return 9;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::Tags);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 10;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 9;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 9;
        }

        $stateComment = "State: 9 - GherkinDocument:0>Feature:2>ScenarioDefinition:0>Tags:0>#TagLine:0";
        $expectedTokens = ["#TagLine", "#ScenarioLine", "#Comment", "#Empty"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 9;
    }

    // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0
    private function matchTokenAt_10(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 10;
        }
        if ($this->match_Comment($context, $token)) {
            $this->startRule($context, RuleType::Description);
            $this->build($context, $token);
            return 11;
        }
        if ($this->match_StepLine($context, $token)) {
            $this->startRule($context, RuleType::Step);
            $this->build($context, $token);
            return 12;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_1($context)) {
                $this->startRule($context, RuleType::ExamplesDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 14;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::Scenario);
                $this->endRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 9;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ExamplesLine($context, $token)) {
            $this->startRule($context, RuleType::ExamplesDefinition);
            $this->startRule($context, RuleType::Examples);
            $this->build($context, $token);
            return 15;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 10;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Other($context, $token)) {
            $this->startRule($context, RuleType::Description);
            $this->build($context, $token);
            return 11;
        }

        $stateComment = "State: 10 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0";
        $expectedTokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 10;
    }

    // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>__alt1:0>#Other:0
    private function matchTokenAt_11(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 11;
        }
        if ($this->match_StepLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->startRule($context, RuleType::Step);
            $this->build($context, $token);
            return 12;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_1($context)) {
                $this->endRule($context, RuleType::Description);
                $this->startRule($context, RuleType::ExamplesDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 14;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::Description);
                $this->endRule($context, RuleType::Scenario);
                $this->endRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 9;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ExamplesLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->startRule($context, RuleType::ExamplesDefinition);
            $this->startRule($context, RuleType::Examples);
            $this->build($context, $token);
            return 15;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 10;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Other($context, $token)) {
            $this->build($context, $token);
            return 11;
        }

        $stateComment = "State: 11 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>__alt1:0>#Other:0";
        $expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 11;
    }

    // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0
    private function matchTokenAt_12(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_TableRow($context, $token)) {
            $this->startRule($context, RuleType::DataTable);
            $this->build($context, $token);
            return 13;
        }
        if ($this->match_DocStringSeparator($context, $token)) {
            $this->startRule($context, RuleType::DocString);
            $this->build($context, $token);
            return 39;
        }
        if ($this->match_StepLine($context, $token)) {
            $this->endRule($context, RuleType::Step);
            $this->startRule($context, RuleType::Step);
            $this->build($context, $token);
            return 12;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_1($context)) {
                $this->endRule($context, RuleType::Step);
                $this->startRule($context, RuleType::ExamplesDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 14;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::Step);
                $this->endRule($context, RuleType::Scenario);
                $this->endRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 9;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ExamplesLine($context, $token)) {
            $this->endRule($context, RuleType::Step);
            $this->startRule($context, RuleType::ExamplesDefinition);
            $this->startRule($context, RuleType::Examples);
            $this->build($context, $token);
            return 15;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 10;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 12;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 12;
        }

        $stateComment = "State: 12 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0";
        $expectedTokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 12;
    }

    // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0
    private function matchTokenAt_13(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::DataTable);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_TableRow($context, $token)) {
            $this->build($context, $token);
            return 13;
        }
        if ($this->match_StepLine($context, $token)) {
            $this->endRule($context, RuleType::DataTable);
            $this->endRule($context, RuleType::Step);
            $this->startRule($context, RuleType::Step);
            $this->build($context, $token);
            return 12;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_1($context)) {
                $this->endRule($context, RuleType::DataTable);
                $this->endRule($context, RuleType::Step);
                $this->startRule($context, RuleType::ExamplesDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 14;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::DataTable);
                $this->endRule($context, RuleType::Step);
                $this->endRule($context, RuleType::Scenario);
                $this->endRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 9;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::DataTable);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ExamplesLine($context, $token)) {
            $this->endRule($context, RuleType::DataTable);
            $this->endRule($context, RuleType::Step);
            $this->startRule($context, RuleType::ExamplesDefinition);
            $this->startRule($context, RuleType::Examples);
            $this->build($context, $token);
            return 15;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::DataTable);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 10;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::DataTable);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 13;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 13;
        }

        $stateComment = "State: 13 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0";
        $expectedTokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 13;
    }

    // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:0>Tags:0>#TagLine:0
    private function matchTokenAt_14(Token $token, ParserContext $context): int
    {
        if ($this->match_TagLine($context, $token)) {
            $this->build($context, $token);
            return 14;
        }
        if ($this->match_ExamplesLine($context, $token)) {
            $this->endRule($context, RuleType::Tags);
            $this->startRule($context, RuleType::Examples);
            $this->build($context, $token);
            return 15;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 14;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 14;
        }

        $stateComment = "State: 14 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:0>Tags:0>#TagLine:0";
        $expectedTokens = ["#TagLine", "#ExamplesLine", "#Comment", "#Empty"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 14;
    }

    // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0
    private function matchTokenAt_15(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 15;
        }
        if ($this->match_Comment($context, $token)) {
            $this->startRule($context, RuleType::Description);
            $this->build($context, $token);
            return 16;
        }
        if ($this->match_TableRow($context, $token)) {
            $this->startRule($context, RuleType::ExamplesTable);
            $this->build($context, $token);
            return 17;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_1($context)) {
                $this->endRule($context, RuleType::Examples);
                $this->endRule($context, RuleType::ExamplesDefinition);
                $this->startRule($context, RuleType::ExamplesDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 14;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::Examples);
                $this->endRule($context, RuleType::ExamplesDefinition);
                $this->endRule($context, RuleType::Scenario);
                $this->endRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 9;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ExamplesLine($context, $token)) {
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->startRule($context, RuleType::ExamplesDefinition);
            $this->startRule($context, RuleType::Examples);
            $this->build($context, $token);
            return 15;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 10;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Other($context, $token)) {
            $this->startRule($context, RuleType::Description);
            $this->build($context, $token);
            return 16;
        }

        $stateComment = "State: 15 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0";
        $expectedTokens = ["#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 15;
    }

    // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>__alt1:0>#Other:0
    private function matchTokenAt_16(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 16;
        }
        if ($this->match_TableRow($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->startRule($context, RuleType::ExamplesTable);
            $this->build($context, $token);
            return 17;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_1($context)) {
                $this->endRule($context, RuleType::Description);
                $this->endRule($context, RuleType::Examples);
                $this->endRule($context, RuleType::ExamplesDefinition);
                $this->startRule($context, RuleType::ExamplesDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 14;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::Description);
                $this->endRule($context, RuleType::Examples);
                $this->endRule($context, RuleType::ExamplesDefinition);
                $this->endRule($context, RuleType::Scenario);
                $this->endRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 9;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ExamplesLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->startRule($context, RuleType::ExamplesDefinition);
            $this->startRule($context, RuleType::Examples);
            $this->build($context, $token);
            return 15;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 10;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Other($context, $token)) {
            $this->build($context, $token);
            return 16;
        }

        $stateComment = "State: 16 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>__alt1:0>#Other:0";
        $expectedTokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 16;
    }

    // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0
    private function matchTokenAt_17(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::ExamplesTable);
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_TableRow($context, $token)) {
            $this->build($context, $token);
            return 17;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_1($context)) {
                $this->endRule($context, RuleType::ExamplesTable);
                $this->endRule($context, RuleType::Examples);
                $this->endRule($context, RuleType::ExamplesDefinition);
                $this->startRule($context, RuleType::ExamplesDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 14;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::ExamplesTable);
                $this->endRule($context, RuleType::Examples);
                $this->endRule($context, RuleType::ExamplesDefinition);
                $this->endRule($context, RuleType::Scenario);
                $this->endRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 9;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::ExamplesTable);
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ExamplesLine($context, $token)) {
            $this->endRule($context, RuleType::ExamplesTable);
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->startRule($context, RuleType::ExamplesDefinition);
            $this->startRule($context, RuleType::Examples);
            $this->build($context, $token);
            return 15;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::ExamplesTable);
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 10;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::ExamplesTable);
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 17;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 17;
        }

        $stateComment = "State: 17 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0";
        $expectedTokens = ["#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 17;
    }

    // GherkinDocument:0>Feature:3>Rule:0>RuleHeader:0>Tags:0>#TagLine:0
    private function matchTokenAt_18(Token $token, ParserContext $context): int
    {
        if ($this->match_TagLine($context, $token)) {
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 18;
        }

        $stateComment = "State: 18 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:0>Tags:0>#TagLine:0";
        $expectedTokens = ["#TagLine", "#RuleLine", "#Comment", "#Empty"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 18;
    }

    // GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>#RuleLine:0
    private function matchTokenAt_19(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::RuleHeader);
            $this->endRule($context, RuleType::Rule);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Comment($context, $token)) {
            $this->startRule($context, RuleType::Description);
            $this->build($context, $token);
            return 20;
        }
        if ($this->match_BackgroundLine($context, $token)) {
            $this->endRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Background);
            $this->build($context, $token);
            return 21;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::RuleHeader);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 25;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::RuleHeader);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 26;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::RuleHeader);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Other($context, $token)) {
            $this->startRule($context, RuleType::Description);
            $this->build($context, $token);
            return 20;
        }

        $stateComment = "State: 19 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>#RuleLine:0";
        $expectedTokens = ["#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 19;
    }

    // GherkinDocument:0>Feature:3>Rule:0>RuleHeader:2>DescriptionHelper:1>Description:0>__alt1:0>#Other:0
    private function matchTokenAt_20(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::RuleHeader);
            $this->endRule($context, RuleType::Rule);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 20;
        }
        if ($this->match_BackgroundLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Background);
            $this->build($context, $token);
            return 21;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::Description);
                $this->endRule($context, RuleType::RuleHeader);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 25;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::RuleHeader);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 26;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::RuleHeader);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Other($context, $token)) {
            $this->build($context, $token);
            return 20;
        }

        $stateComment = "State: 20 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:2>DescriptionHelper:1>Description:0>__alt1:0>#Other:0";
        $expectedTokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 20;
    }

    // GherkinDocument:0>Feature:3>Rule:1>Background:0>#BackgroundLine:0
    private function matchTokenAt_21(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::Background);
            $this->endRule($context, RuleType::Rule);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 21;
        }
        if ($this->match_Comment($context, $token)) {
            $this->startRule($context, RuleType::Description);
            $this->build($context, $token);
            return 22;
        }
        if ($this->match_StepLine($context, $token)) {
            $this->startRule($context, RuleType::Step);
            $this->build($context, $token);
            return 23;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::Background);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 25;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::Background);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::Background);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 26;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::Background);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Other($context, $token)) {
            $this->startRule($context, RuleType::Description);
            $this->build($context, $token);
            return 22;
        }

        $stateComment = "State: 21 - GherkinDocument:0>Feature:3>Rule:1>Background:0>#BackgroundLine:0";
        $expectedTokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 21;
    }

    // GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:1>Description:0>__alt1:0>#Other:0
    private function matchTokenAt_22(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Background);
            $this->endRule($context, RuleType::Rule);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 22;
        }
        if ($this->match_StepLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->startRule($context, RuleType::Step);
            $this->build($context, $token);
            return 23;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::Description);
                $this->endRule($context, RuleType::Background);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 25;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Background);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Background);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 26;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Background);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Other($context, $token)) {
            $this->build($context, $token);
            return 22;
        }

        $stateComment = "State: 22 - GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:1>Description:0>__alt1:0>#Other:0";
        $expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 22;
    }

    // GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:0>#StepLine:0
    private function matchTokenAt_23(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Background);
            $this->endRule($context, RuleType::Rule);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_TableRow($context, $token)) {
            $this->startRule($context, RuleType::DataTable);
            $this->build($context, $token);
            return 24;
        }
        if ($this->match_DocStringSeparator($context, $token)) {
            $this->startRule($context, RuleType::DocString);
            $this->build($context, $token);
            return 37;
        }
        if ($this->match_StepLine($context, $token)) {
            $this->endRule($context, RuleType::Step);
            $this->startRule($context, RuleType::Step);
            $this->build($context, $token);
            return 23;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::Step);
                $this->endRule($context, RuleType::Background);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 25;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Background);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Background);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 26;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Background);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 23;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 23;
        }

        $stateComment = "State: 23 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:0>#StepLine:0";
        $expectedTokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 23;
    }

    // GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0
    private function matchTokenAt_24(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::DataTable);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Background);
            $this->endRule($context, RuleType::Rule);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_TableRow($context, $token)) {
            $this->build($context, $token);
            return 24;
        }
        if ($this->match_StepLine($context, $token)) {
            $this->endRule($context, RuleType::DataTable);
            $this->endRule($context, RuleType::Step);
            $this->startRule($context, RuleType::Step);
            $this->build($context, $token);
            return 23;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::DataTable);
                $this->endRule($context, RuleType::Step);
                $this->endRule($context, RuleType::Background);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 25;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::DataTable);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Background);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::DataTable);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Background);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 26;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::DataTable);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Background);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 24;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 24;
        }

        $stateComment = "State: 24 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0";
        $expectedTokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 24;
    }

    // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:0>Tags:0>#TagLine:0
    private function matchTokenAt_25(Token $token, ParserContext $context): int
    {
        if ($this->match_TagLine($context, $token)) {
            $this->build($context, $token);
            return 25;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::Tags);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 26;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 25;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 25;
        }

        $stateComment = "State: 25 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:0>Tags:0>#TagLine:0";
        $expectedTokens = ["#TagLine", "#ScenarioLine", "#Comment", "#Empty"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 25;
    }

    // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0
    private function matchTokenAt_26(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Rule);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 26;
        }
        if ($this->match_Comment($context, $token)) {
            $this->startRule($context, RuleType::Description);
            $this->build($context, $token);
            return 27;
        }
        if ($this->match_StepLine($context, $token)) {
            $this->startRule($context, RuleType::Step);
            $this->build($context, $token);
            return 28;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_1($context)) {
                $this->startRule($context, RuleType::ExamplesDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 30;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::Scenario);
                $this->endRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 25;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ExamplesLine($context, $token)) {
            $this->startRule($context, RuleType::ExamplesDefinition);
            $this->startRule($context, RuleType::Examples);
            $this->build($context, $token);
            return 31;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 26;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Other($context, $token)) {
            $this->startRule($context, RuleType::Description);
            $this->build($context, $token);
            return 27;
        }

        $stateComment = "State: 26 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0";
        $expectedTokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 26;
    }

    // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>__alt1:0>#Other:0
    private function matchTokenAt_27(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Rule);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 27;
        }
        if ($this->match_StepLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->startRule($context, RuleType::Step);
            $this->build($context, $token);
            return 28;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_1($context)) {
                $this->endRule($context, RuleType::Description);
                $this->startRule($context, RuleType::ExamplesDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 30;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::Description);
                $this->endRule($context, RuleType::Scenario);
                $this->endRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 25;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ExamplesLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->startRule($context, RuleType::ExamplesDefinition);
            $this->startRule($context, RuleType::Examples);
            $this->build($context, $token);
            return 31;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 26;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Other($context, $token)) {
            $this->build($context, $token);
            return 27;
        }

        $stateComment = "State: 27 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>__alt1:0>#Other:0";
        $expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 27;
    }

    // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0
    private function matchTokenAt_28(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Rule);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_TableRow($context, $token)) {
            $this->startRule($context, RuleType::DataTable);
            $this->build($context, $token);
            return 29;
        }
        if ($this->match_DocStringSeparator($context, $token)) {
            $this->startRule($context, RuleType::DocString);
            $this->build($context, $token);
            return 35;
        }
        if ($this->match_StepLine($context, $token)) {
            $this->endRule($context, RuleType::Step);
            $this->startRule($context, RuleType::Step);
            $this->build($context, $token);
            return 28;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_1($context)) {
                $this->endRule($context, RuleType::Step);
                $this->startRule($context, RuleType::ExamplesDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 30;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::Step);
                $this->endRule($context, RuleType::Scenario);
                $this->endRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 25;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ExamplesLine($context, $token)) {
            $this->endRule($context, RuleType::Step);
            $this->startRule($context, RuleType::ExamplesDefinition);
            $this->startRule($context, RuleType::Examples);
            $this->build($context, $token);
            return 31;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 26;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 28;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 28;
        }

        $stateComment = "State: 28 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0";
        $expectedTokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 28;
    }

    // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0
    private function matchTokenAt_29(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::DataTable);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Rule);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_TableRow($context, $token)) {
            $this->build($context, $token);
            return 29;
        }
        if ($this->match_StepLine($context, $token)) {
            $this->endRule($context, RuleType::DataTable);
            $this->endRule($context, RuleType::Step);
            $this->startRule($context, RuleType::Step);
            $this->build($context, $token);
            return 28;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_1($context)) {
                $this->endRule($context, RuleType::DataTable);
                $this->endRule($context, RuleType::Step);
                $this->startRule($context, RuleType::ExamplesDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 30;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::DataTable);
                $this->endRule($context, RuleType::Step);
                $this->endRule($context, RuleType::Scenario);
                $this->endRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 25;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::DataTable);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ExamplesLine($context, $token)) {
            $this->endRule($context, RuleType::DataTable);
            $this->endRule($context, RuleType::Step);
            $this->startRule($context, RuleType::ExamplesDefinition);
            $this->startRule($context, RuleType::Examples);
            $this->build($context, $token);
            return 31;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::DataTable);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 26;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::DataTable);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 29;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 29;
        }

        $stateComment = "State: 29 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0";
        $expectedTokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 29;
    }

    // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:0>Tags:0>#TagLine:0
    private function matchTokenAt_30(Token $token, ParserContext $context): int
    {
        if ($this->match_TagLine($context, $token)) {
            $this->build($context, $token);
            return 30;
        }
        if ($this->match_ExamplesLine($context, $token)) {
            $this->endRule($context, RuleType::Tags);
            $this->startRule($context, RuleType::Examples);
            $this->build($context, $token);
            return 31;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 30;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 30;
        }

        $stateComment = "State: 30 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:0>Tags:0>#TagLine:0";
        $expectedTokens = ["#TagLine", "#ExamplesLine", "#Comment", "#Empty"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 30;
    }

    // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0
    private function matchTokenAt_31(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Rule);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 31;
        }
        if ($this->match_Comment($context, $token)) {
            $this->startRule($context, RuleType::Description);
            $this->build($context, $token);
            return 32;
        }
        if ($this->match_TableRow($context, $token)) {
            $this->startRule($context, RuleType::ExamplesTable);
            $this->build($context, $token);
            return 33;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_1($context)) {
                $this->endRule($context, RuleType::Examples);
                $this->endRule($context, RuleType::ExamplesDefinition);
                $this->startRule($context, RuleType::ExamplesDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 30;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::Examples);
                $this->endRule($context, RuleType::ExamplesDefinition);
                $this->endRule($context, RuleType::Scenario);
                $this->endRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 25;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ExamplesLine($context, $token)) {
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->startRule($context, RuleType::ExamplesDefinition);
            $this->startRule($context, RuleType::Examples);
            $this->build($context, $token);
            return 31;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 26;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Other($context, $token)) {
            $this->startRule($context, RuleType::Description);
            $this->build($context, $token);
            return 32;
        }

        $stateComment = "State: 31 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0";
        $expectedTokens = ["#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 31;
    }

    // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>__alt1:0>#Other:0
    private function matchTokenAt_32(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Rule);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 32;
        }
        if ($this->match_TableRow($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->startRule($context, RuleType::ExamplesTable);
            $this->build($context, $token);
            return 33;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_1($context)) {
                $this->endRule($context, RuleType::Description);
                $this->endRule($context, RuleType::Examples);
                $this->endRule($context, RuleType::ExamplesDefinition);
                $this->startRule($context, RuleType::ExamplesDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 30;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::Description);
                $this->endRule($context, RuleType::Examples);
                $this->endRule($context, RuleType::ExamplesDefinition);
                $this->endRule($context, RuleType::Scenario);
                $this->endRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 25;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ExamplesLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->startRule($context, RuleType::ExamplesDefinition);
            $this->startRule($context, RuleType::Examples);
            $this->build($context, $token);
            return 31;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 26;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::Description);
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Other($context, $token)) {
            $this->build($context, $token);
            return 32;
        }

        $stateComment = "State: 32 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>__alt1:0>#Other:0";
        $expectedTokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 32;
    }

    // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0
    private function matchTokenAt_33(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::ExamplesTable);
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Rule);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_TableRow($context, $token)) {
            $this->build($context, $token);
            return 33;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_1($context)) {
                $this->endRule($context, RuleType::ExamplesTable);
                $this->endRule($context, RuleType::Examples);
                $this->endRule($context, RuleType::ExamplesDefinition);
                $this->startRule($context, RuleType::ExamplesDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 30;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::ExamplesTable);
                $this->endRule($context, RuleType::Examples);
                $this->endRule($context, RuleType::ExamplesDefinition);
                $this->endRule($context, RuleType::Scenario);
                $this->endRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 25;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::ExamplesTable);
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ExamplesLine($context, $token)) {
            $this->endRule($context, RuleType::ExamplesTable);
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->startRule($context, RuleType::ExamplesDefinition);
            $this->startRule($context, RuleType::Examples);
            $this->build($context, $token);
            return 31;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::ExamplesTable);
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 26;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::ExamplesTable);
            $this->endRule($context, RuleType::Examples);
            $this->endRule($context, RuleType::ExamplesDefinition);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 33;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 33;
        }

        $stateComment = "State: 33 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0";
        $expectedTokens = ["#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 33;
    }

    // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0
    private function matchTokenAt_35(Token $token, ParserContext $context): int
    {
        if ($this->match_DocStringSeparator($context, $token)) {
            $this->build($context, $token);
            return 36;
        }
        if ($this->match_Other($context, $token)) {
            $this->build($context, $token);
            return 35;
        }

        $stateComment = "State: 35 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0";
        $expectedTokens = ["#DocStringSeparator", "#Other"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 35;
    }

    // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0
    private function matchTokenAt_36(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::DocString);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Rule);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_StepLine($context, $token)) {
            $this->endRule($context, RuleType::DocString);
            $this->endRule($context, RuleType::Step);
            $this->startRule($context, RuleType::Step);
            $this->build($context, $token);
            return 28;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_1($context)) {
                $this->endRule($context, RuleType::DocString);
                $this->endRule($context, RuleType::Step);
                $this->startRule($context, RuleType::ExamplesDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 30;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::DocString);
                $this->endRule($context, RuleType::Step);
                $this->endRule($context, RuleType::Scenario);
                $this->endRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 25;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::DocString);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ExamplesLine($context, $token)) {
            $this->endRule($context, RuleType::DocString);
            $this->endRule($context, RuleType::Step);
            $this->startRule($context, RuleType::ExamplesDefinition);
            $this->startRule($context, RuleType::Examples);
            $this->build($context, $token);
            return 31;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::DocString);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 26;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::DocString);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 36;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 36;
        }

        $stateComment = "State: 36 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0";
        $expectedTokens = ["#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 36;
    }

    // GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0
    private function matchTokenAt_37(Token $token, ParserContext $context): int
    {
        if ($this->match_DocStringSeparator($context, $token)) {
            $this->build($context, $token);
            return 38;
        }
        if ($this->match_Other($context, $token)) {
            $this->build($context, $token);
            return 37;
        }

        $stateComment = "State: 37 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0";
        $expectedTokens = ["#DocStringSeparator", "#Other"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 37;
    }

    // GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0
    private function matchTokenAt_38(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::DocString);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Background);
            $this->endRule($context, RuleType::Rule);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_StepLine($context, $token)) {
            $this->endRule($context, RuleType::DocString);
            $this->endRule($context, RuleType::Step);
            $this->startRule($context, RuleType::Step);
            $this->build($context, $token);
            return 23;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::DocString);
                $this->endRule($context, RuleType::Step);
                $this->endRule($context, RuleType::Background);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 25;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::DocString);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Background);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::DocString);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Background);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 26;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::DocString);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Background);
            $this->endRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 38;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 38;
        }

        $stateComment = "State: 38 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0";
        $expectedTokens = ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 38;
    }

    // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0
    private function matchTokenAt_39(Token $token, ParserContext $context): int
    {
        if ($this->match_DocStringSeparator($context, $token)) {
            $this->build($context, $token);
            return 40;
        }
        if ($this->match_Other($context, $token)) {
            $this->build($context, $token);
            return 39;
        }

        $stateComment = "State: 39 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0";
        $expectedTokens = ["#DocStringSeparator", "#Other"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 39;
    }

    // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0
    private function matchTokenAt_40(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::DocString);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_StepLine($context, $token)) {
            $this->endRule($context, RuleType::DocString);
            $this->endRule($context, RuleType::Step);
            $this->startRule($context, RuleType::Step);
            $this->build($context, $token);
            return 12;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_1($context)) {
                $this->endRule($context, RuleType::DocString);
                $this->endRule($context, RuleType::Step);
                $this->startRule($context, RuleType::ExamplesDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 14;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::DocString);
                $this->endRule($context, RuleType::Step);
                $this->endRule($context, RuleType::Scenario);
                $this->endRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 9;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::DocString);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ExamplesLine($context, $token)) {
            $this->endRule($context, RuleType::DocString);
            $this->endRule($context, RuleType::Step);
            $this->startRule($context, RuleType::ExamplesDefinition);
            $this->startRule($context, RuleType::Examples);
            $this->build($context, $token);
            return 15;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::DocString);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 10;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::DocString);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Scenario);
            $this->endRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 40;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 40;
        }

        $stateComment = "State: 40 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0";
        $expectedTokens = ["#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 40;
    }

    // GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0
    private function matchTokenAt_41(Token $token, ParserContext $context): int
    {
        if ($this->match_DocStringSeparator($context, $token)) {
            $this->build($context, $token);
            return 42;
        }
        if ($this->match_Other($context, $token)) {
            $this->build($context, $token);
            return 41;
        }

        $stateComment = "State: 41 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0";
        $expectedTokens = ["#DocStringSeparator", "#Other"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 41;
    }

    // GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0
    private function matchTokenAt_42(Token $token, ParserContext $context): int
    {
        if ($this->match_EOF($context, $token)) {
            $this->endRule($context, RuleType::DocString);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Background);
            $this->endRule($context, RuleType::Feature);
            $this->build($context, $token);
            return 34;
        }
        if ($this->match_StepLine($context, $token)) {
            $this->endRule($context, RuleType::DocString);
            $this->endRule($context, RuleType::Step);
            $this->startRule($context, RuleType::Step);
            $this->build($context, $token);
            return 7;
        }
        if ($this->match_TagLine($context, $token)) {
            if ($this->lookahead_0($context)) {
                $this->endRule($context, RuleType::DocString);
                $this->endRule($context, RuleType::Step);
                $this->endRule($context, RuleType::Background);
                $this->startRule($context, RuleType::ScenarioDefinition);
                $this->startRule($context, RuleType::Tags);
                $this->build($context, $token);
                return 9;
            }
        }
        if ($this->match_TagLine($context, $token)) {
            $this->endRule($context, RuleType::DocString);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Background);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->startRule($context, RuleType::Tags);
            $this->build($context, $token);
            return 18;
        }
        if ($this->match_ScenarioLine($context, $token)) {
            $this->endRule($context, RuleType::DocString);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Background);
            $this->startRule($context, RuleType::ScenarioDefinition);
            $this->startRule($context, RuleType::Scenario);
            $this->build($context, $token);
            return 10;
        }
        if ($this->match_RuleLine($context, $token)) {
            $this->endRule($context, RuleType::DocString);
            $this->endRule($context, RuleType::Step);
            $this->endRule($context, RuleType::Background);
            $this->startRule($context, RuleType::Rule);
            $this->startRule($context, RuleType::RuleHeader);
            $this->build($context, $token);
            return 19;
        }
        if ($this->match_Comment($context, $token)) {
            $this->build($context, $token);
            return 42;
        }
        if ($this->match_Empty($context, $token)) {
            $this->build($context, $token);
            return 42;
        }

        $stateComment = "State: 42 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0";
        $expectedTokens = ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"];
        $error = $token->isEOF()
                ? new UnexpectedEofException($token, $expectedTokens, $stateComment)
                : new UnexpectedTokenException($token, $expectedTokens, $stateComment);

        $this->addError($context, $error);

        return 42;
    }


    private function lookahead_0(ParserContext $context): bool
    {
        $queue = [];
        $match = false;
        do {
            $token = $this->readToken($context);
            $queue[] = $token;

            if (false
                || $this->match_ScenarioLine($context, $token)
            ) {
                $match = true;
                break;
            }
        } while (false
            || $this->match_Empty($context, $token)
            || $this->match_Comment($context, $token)
            || $this->match_TagLine($context, $token)
        );

        $context->tokenQueue = [...$context->tokenQueue, ...$queue];

        return $match;
    }

    private function lookahead_1(ParserContext $context): bool
    {
        $queue = [];
        $match = false;
        do {
            $token = $this->readToken($context);
            $queue[] = $token;

            if (false
                || $this->match_ExamplesLine($context, $token)
            ) {
                $match = true;
                break;
            }
        } while (false
            || $this->match_Empty($context, $token)
            || $this->match_Comment($context, $token)
            || $this->match_TagLine($context, $token)
        );

        $context->tokenQueue = [...$context->tokenQueue, ...$queue];

        return $match;
    }
}
