PDepend\Source\Language\PHP\AbstractPHPParser::parseSwitchLabel PHP Method

parseSwitchLabel() private method

This method parses a case label of a switch statement.
Since: 0.9.8
private parseSwitchLabel ( ) : PDepend\Source\AST\ASTSwitchLabel
return PDepend\Source\AST\ASTSwitchLabel
    private function parseSwitchLabel()
    {
        $this->tokenStack->push();
        $token = $this->consumeToken(Tokens::T_CASE);
        $label = $this->builder->buildAstSwitchLabel($token->image);
        $label->addChild($this->parseExpression());
        if ($this->tokenizer->peek() === Tokens::T_COLON) {
            $this->consumeToken(Tokens::T_COLON);
        } else {
            $this->consumeToken(Tokens::T_SEMICOLON);
        }
        $this->parseSwitchLabelBody($label);
        return $this->setNodePositionsAndReturn($label);
    }
AbstractPHPParser