PDepend\Source\Language\PHP\AbstractPHPParser::parseCompoundVariableOrLiteral PHP Метод

parseCompoundVariableOrLiteral() приватный Метод

Parses a PHP compound variable or a simple literal node.
С версии: 0.9.19
private parseCompoundVariableOrLiteral ( ) : PDepend\Source\AST\ASTNode
Результат PDepend\Source\AST\ASTNode
    private function parseCompoundVariableOrLiteral()
    {
        $this->tokenStack->push();
        // Read the dollar token
        $token = $this->consumeToken(Tokens::T_DOLLAR);
        $this->consumeComments();
        // Get next token type
        $tokenType = $this->tokenizer->peek();
        switch ($tokenType) {
            case Tokens::T_CURLY_BRACE_OPEN:
                $variable = $this->builder->buildAstCompoundVariable($token->image);
                $variable->addChild($this->parseCompoundExpression());
                break;
            default:
                $variable = $this->builder->buildAstLiteral($token->image);
                break;
        }
        return $this->setNodePositionsAndReturn($variable);
    }
AbstractPHPParser