/** * This method parses a php string with all possible embedded expressions. * * <code> * $string = "Manuel $Pichler <{$email}>"; * * // \PDepend\Source\AST\ASTSTring * // |-- ASTLiteral - "Manuel ") * // |-- ASTVariable - $Pichler * // |-- ASTLiteral - " <" * // |-- ASTCompoundExpression - {...} * // | |-- ASTVariable - $email * // |-- ASTLiteral - ">" * </code> * * @param integer $delimiterType The start/stop token type. * * @return \PDepend\Source\AST\ASTString * @throws \PDepend\Source\Parser\UnexpectedTokenException * @since 0.9.10 */ private function parseString($delimiterType) { $token = $this->consumeToken($delimiterType); $string = $this->builder->buildAstString(); $string->setStartLine($token->startLine); $string->setStartColumn($token->startColumn); $this->parseStringExpressions($string, $delimiterType); $token = $this->consumeToken($delimiterType); $string->setEndLine($token->endLine); $string->setEndColumn($token->endColumn); return $string; }
/** * This method parses a php string with all possible embedded expressions. * * <code> * $string = "Manuel $Pichler <{$email}>"; * * // \PDepend\Source\AST\ASTSTring * // |-- ASTLiteral - "Manuel ") * // |-- ASTVariable - $Pichler * // |-- ASTLiteral - " <" * // |-- ASTCompoundExpression - {...} * // | |-- ASTVariable - $email * // |-- ASTLiteral - ">" * </code> * * @param integer $delimiterType The start/stop token type. * * @return \PDepend\Source\AST\ASTString * @throws \PDepend\Source\Parser\UnexpectedTokenException * @since 0.9.10 */ private function parseString($delimiterType) { $token = $this->consumeToken($delimiterType); $string = $this->builder->buildAstString(); $startLine = $token->startLine; $startColumn = $token->startColumn; $this->parseStringExpressions($string, $delimiterType); $token = $this->consumeToken($delimiterType); $endLine = $token->endLine; $endColumn = $token->endColumn; $string->configureLinesAndColumns($startLine, $endLine, $startColumn, $endColumn); return $string; }