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

parseLiteralOrString() protected method

This method parses a {@link \PDepend\Source\AST\ASTLiteral} node or an instance of {@link \PDepend\Source\AST\ASTString} that represents a string in double quotes or surrounded by backticks.
protected parseLiteralOrString ( ) : PDepend\Source\AST\ASTNode
return PDepend\Source\AST\ASTNode
    protected function parseLiteralOrString()
    {
        $tokenType = $this->tokenizer->peek();
        switch ($tokenType) {
            case Tokens::T_NULL:
            case Tokens::T_TRUE:
            case Tokens::T_FALSE:
            case Tokens::T_DNUMBER:
            case Tokens::T_CONSTANT_ENCAPSED_STRING:
                $token = $this->consumeToken($tokenType);
                $literal = $this->builder->buildAstLiteral($token->image);
                $literal->configureLinesAndColumns($token->startLine, $token->endLine, $token->startColumn, $token->endColumn);
                return $literal;
            case Tokens::T_LNUMBER:
                return $this->parseIntegerNumber();
            default:
                return $this->parseString($tokenType);
        }
    }
AbstractPHPParser