Behat\Gherkin\Parser::parseExpression PHP Method

parseExpression() protected method

Parses current expression & returns Node.
protected parseExpression ( ) : string | Behat\Gherkin\Node\FeatureNode | Behat\Gherkin\Node\BackgroundNode | Behat\Gherkin\Node\ScenarioNode | Behat\Gherkin\Node\OutlineNode | Behat\Gherkin\Node\TableNode | Behat\Gherkin\Node\StepNode
return string | Behat\Gherkin\Node\FeatureNode | Behat\Gherkin\Node\BackgroundNode | Behat\Gherkin\Node\ScenarioNode | Behat\Gherkin\Node\OutlineNode | Behat\Gherkin\Node\TableNode | Behat\Gherkin\Node\StepNode
    protected function parseExpression()
    {
        switch ($type = $this->predictTokenType()) {
            case 'Feature':
                return $this->parseFeature();
            case 'Background':
                return $this->parseBackground();
            case 'Scenario':
                return $this->parseScenario();
            case 'Outline':
                return $this->parseOutline();
            case 'Examples':
                return $this->parseExamples();
            case 'TableRow':
                return $this->parseTable();
            case 'PyStringOp':
                return $this->parsePyString();
            case 'Step':
                return $this->parseStep();
            case 'Text':
                return $this->parseText();
            case 'Newline':
                return $this->parseNewline();
            case 'Tag':
                return $this->parseTags();
            case 'Comment':
                return $this->parseComment();
            case 'Language':
                return $this->parseLanguage();
            case 'EOS':
                return '';
        }
        throw new ParserException(sprintf('Unknown token type: %s', $type));
    }