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

parseIndexExpression() private method

Parses an index expression as it is valid to access elements in a php string or array.
Since: 0.9.12
private parseIndexExpression ( PDepend\Source\AST\ASTNode $node, PDepend\Source\AST\ASTExpression $expr, integer $open, integer $close ) : PDepend\Source\AST\ASTNode
$node PDepend\Source\AST\ASTNode The context source node.
$expr PDepend\Source\AST\ASTExpression The concrete index expression.
$open integer The open token type.
$close integer The close token type.
return PDepend\Source\AST\ASTNode
    private function parseIndexExpression(\PDepend\Source\AST\ASTNode $node, \PDepend\Source\AST\ASTExpression $expr, $open, $close)
    {
        $this->consumeToken($open);
        if (($child = $this->parseOptionalExpression()) != null) {
            $expr->addChild($child);
        }
        $token = $this->consumeToken($close);
        $expr->configureLinesAndColumns($node->getStartLine(), $token->endLine, $node->getStartColumn(), $token->endColumn);
        return $this->parseOptionalIndexExpression($expr);
    }
AbstractPHPParser