PHP Класс PDepend\Source\Language\PHP\AbstractPHPParser

With the default settings the parser includes annotations, better known as doc comment tags, in the generated result. This means it extracts the type information of @var tags for properties, and types in @return + @throws tags of functions and methods. The current implementation tries to ignore all scalar types from boolean to void. You should disable this feature for project that have more or less invalid doc comments, because it could produce invalid results. $parser->setIgnoreAnnotations(); Note: Due to the fact that it is possible to use the same name for multiple classes and interfaces, and there is no way to determine to which package it belongs, while the parser handles class, interface or method signatures, the parser could/will create a code tree that doesn't reflect the real source structure.
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$builder PDepend\Source\Builder\Builder The used data structure builder.
$cache PDepend\Util\Cache\CacheDriver
$compilationUnit PDepend\Source\AST\ASTCompilationUnit The currently parsed file instance.
$tokenStack PDepend\Source\Tokenizer\TokenStack Stack with all active token scopes.
$tokenizer * The used code tokenizer.

Открытые методы

Метод Описание
__construct ( PDepend\Source\Tokenizer\Tokenizer $tokenizer, PDepend\Source\Builder\Builder $builder, PDepend\Util\Cache\CacheDriver $cache ) Constructs a new source parser.
parse ( ) : void Parses the contents of the tokenizer and generates a node tree based on the found tokens.
setIgnoreAnnotations ( ) : void Sets the ignore annotations flag. This means that the parser will ignore doc comment annotations.
setMaxNestingLevel ( integer $maxNestingLevel ) : void Configures the maximum allowed nesting level.

Защищенные методы

Метод Описание
consumeComments ( ) : void This method will consume all comment tokens from the token stream.
consumeToken ( integer $tokenType ) : PDepend\Source\Tokenizer\Token This method will consume the next token in the token stream. It will throw an exception if the type of this token is not identical with $tokenType.
doParseArray ( $static = false ) : PDepend\Source\AST\ASTArray Parses an array structure.
getMaxNestingLevel ( ) : integer Returns the maximum allowed nesting/recursion level.
isArrayStartDelimiter ( ) : boolean Tests if the next token is a valid array start delimiter in the supported PHP version.
isClassName ( integer $tokenType ) : boolean Will return true if the given $tokenType is a valid class name part.
isFileComment ( ) : boolean Checks that the current token could be used as file comment.
isFunctionName ( integer $tokenType ) : boolean Tests if the give token is a valid function name in the supported PHP version.
isKeyword ( $tokenType ) : boolean Tests if the given token type is a reserved keyword in the supported PHP version.
isMethodName ( integer $tokenType ) : boolean
isNextTokenArguments ( ) : boolean This method checks if the next available token starts an arguments node.
isTypeHint ( integer $tokenType ) : boolean Tests if the given token type is a valid formal parameter in the supported PHP version.
parseAllocationExpressionTypeReference ( PDepend\Source\AST\ASTAllocationExpression $allocation ) : PDepend\Source\AST\ASTNode Parse the type reference used in an allocation expression.
parseArguments ( ) : PDepend\Source\AST\ASTArguments This method parses the arguments passed to a function- or method-call.
parseArray ( PDepend\Source\AST\ASTArray $array, boolean $static = false ) : PDepend\Source\AST\ASTArray Parses a php array declaration.
parseArrayElement ( boolean $static = false ) : PDepend\Source\AST\ASTArrayElement Parses a single array element.
parseArrayElements ( PDepend\Source\AST\ASTArray $array, integer $endDelimiter, boolean $static = false ) : PDepend\Source\AST\ASTArray Parses all elements in an array.
parseArrayType ( ) : PDepend\Source\AST\ASTTypeArray
parseAssignmentExpression ( PDepend\Source\AST\ASTNode $left ) : PDepend\Source\AST\ASTAssignmentExpression Parses an assingment expression node.
parseBooleanAndExpression ( ) : PDepend\Source\AST\ASTBooleanAndExpression This method parses a boolean and-expression.
parseBooleanOrExpression ( ) : PDepend\Source\AST\ASTBooleanOrExpression This method parses a boolean or-expression.
parseCallableDeclarationAddition ( PDepend\Source\AST\AbstractASTCallable $callable ) : PDepend\Source\AST\AbstractASTCallable Extension for version specific additions.
parseCastExpression ( ) : PDepend\Source\AST\ASTCaseExpression Parses a cast-expression node.
parseClassDeclaration ( ) : PDepend\Source\AST\ASTClass Parses the dependencies in a class signature.
parseClassExtends ( PDepend\Source\AST\ASTClass $class ) : PDepend\Source\AST\ASTClass Parses a parent class declaration for the given $class.
parseClassName ( ) : string Parses a valid class or interface name and returns the image of the parsed token.
parseClassSignature ( ) : PDepend\Source\AST\ASTClass Parses the signature of a class.
parseCompoundExpression ( ) : PDepend\Source\AST\ASTCompoundExpression This method parses a compound expression node.
parseCompoundVariableOrVariableVariableOrVariable ( ) : PDepend\Source\AST\ASTNode This method is a decision point between the different variable types availanle in PHP. It peeks the next token and then decides whether it is a regular variable or when the next token is of type T_DOLLAR a compound- or variable-variable.
parseConditionalExpression ( ) : PDepend\Source\AST\ASTConditionalExpression This method parses a conditional-expression.
parseConstant ( ) : PDepend\Source\AST\ASTNode Parses a simple PHP constant use and returns a corresponding node.
parseConstantDeclarator ( ) : PDepend\Source\AST\ASTConstantDeclarator Parses a single constant declarator.
parseConstantDeclaratorValue ( ) : PDepend\Source\AST\ASTValue Parses the value of a php constant. By default this can be only static values that were allowed in the oldest supported PHP version.
parseExpressionTypeReference ( PDepend\Source\AST\ASTNode $expr, boolean $classRef ) : PDepend\Source\AST\ASTNode This method parses a type identifier as it is used in expression nodes like {@link \PDepend\Source\AST\ASTInstanceOfExpression} or an object allocation node like {@link \PDepend\Source\AST\ASTAllocationExpression}.
parseFormalParameter ( ) : PDepend\Source\AST\ASTFormalParameter This method will parse a formal parameter. A formal parameter is at least a variable name, but can also contain a default parameter value.
parseFormalParameterOrByReference ( ) : PDepend\Source\AST\ASTFormalParameter This method will parse a formal parameter that can optionally be passed by reference.
parseFunctionName ( ) : string Parses a function name from the given tokenizer and returns the string literal representing the function name. If no valid token exists in the token stream, this method will throw an exception.
parseHeredoc ( ) : PDepend\Source\AST\ASTHeredoc Parses a here- or nowdoc string instance.
parseIdentifier ( ) : PDepend\Source\AST\ASTIdentifier Parses a static identifier expression, as it is used for method and function names.
parseIntegerNumber ( ) : PDepend\Source\AST\ASTLiteral Parses an integer value.
parseInterfaceList ( PDepend\Source\AST\AbstractASTClassOrInterface $abstractType ) : void This method parses a list of interface names as used in the extends part of a interface declaration or in the implements part of a class declaration.
parseLiteral ( ) : PDepend\Source\AST\ASTLiteral This method parses a simple literal and configures the position properties.
parseLiteralOrString ( ) : PDepend\Source\AST\ASTNode 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.
parseLogicalAndExpression ( ) : PDepend\Source\AST\ASTLogicalAndExpression This method parses a logical and-expression.
parseLogicalOrExpression ( ) : PDepend\Source\AST\ASTLogicalOrExpression This method parses a logical or-expression.
parseLogicalXorExpression ( ) : PDepend\Source\AST\ASTLogicalXorExpression This method parses a logical xor-expression.
parseMethodName ( ) : string
parseOptionalExpression ( ) : PDepend\Source\AST\ASTNode This method optionally parses an expression node and returns it. When no expression was found this method will return null.
parseOptionalExpressionForVersion ( ) : PDepend\Source\AST\ASTNode This method will be called when the base parser cannot handle an expression in the base version. In this method you can implement version specific expressions.
parseOptionalIndexExpression ( PDepend\Source\AST\ASTNode $node ) : PDepend\Source\AST\ASTNode Parses one or more optional php array or string expressions.
parseParentType ( ) : PDepend\Source\AST\ASTParentReference
parseParenthesisExpressionOrPrimaryPrefix ( ) : PDepend\Source\AST\ASTNode Parses a simple parenthesis expression or a direct object access, which was introduced with PHP 5.4.0:
parsePostfixIdentifier ( ) : PDepend\Source\AST\ASTNode This method parses a PHP version specific identifier for method and property postfix expressions.
parseQualifiedName ( ) : string Parses a php class/method name chain.
parseSelfReference ( PDepend\Source\Tokenizer\Token $token ) : PDepend\Source\AST\ASTSelfReference This method parses a {@link \PDepend\Source\AST\ASTSelfReference} node.
parseSelfType ( ) : PDepend\Source\AST\ASTSelfReference
parseShiftLeftExpression ( ) : PDepend\Source\AST\ASTShiftLeftExpression This method parses a shift left expression node.
parseShiftRightExpression ( ) : PDepend\Source\AST\ASTShiftRightExpression This method parses a shift right expression node.
parseStaticValue ( ) : PDepend\Source\AST\ASTValue This method will parse a static default value as it is used for a parameter, property or constant declaration.
parseStaticValueOrStaticArray ( ) : PDepend\Source\AST\ASTValue This method will parse a static value or a static array as it is used as default value for a parameter or property declaration.
parseStaticValueVersionSpecific ( PDepend\Source\AST\ASTValue $value ) : PDepend\Source\AST\ASTValue Parses additional static values that are valid in the supported php version.
parseTypeBody ( AbstractASTType $type ) : AbstractASTType Parses a class/interface/trait body.
parseTypeHint ( ) : PDepend\Source\AST\ASTNode Parses a type hint that is valid in the supported PHP version.
parseUseDeclaration ( ) : void This method parses a single use declaration and adds a mapping between short name and full qualified name to the use symbol table.
parseUseDeclarations ( ) : void This method parses a list of PHP 5.3 use declarations and adds a mapping between short name and full qualified name to the use symbol table.
parseVariableDeclarator ( ) : PDepend\Source\AST\ASTVariableDeclarator This method will parse a variable declarator.
parseVariableOrConstantOrPrimaryPrefix ( ) : PDepend\Source\AST\ASTNode This method implements the parsing for various expression types like variables, object/static method. All these expressions are valid in several php language constructs like, isset, empty, unset etc.
reduce ( array $expressions ) : PDepend\Source\AST\ASTExpression[] Applies all reduce rules against the given expression list.
reset ( integer $modifiers ) : void Resets some object properties.
setNodePositionsAndReturn ( PDepend\Source\AST\ASTNode $node, array &$tokens = null ) : PDepend\Source\AST\ASTNode This method configures the given node with its start and end positions.
setUpEnvironment ( ) : void Initializes the parser environment.
tearDownEnvironment ( ) : void Restores the parser environment back.
throwUnexpectedTokenException ( PDepend\Source\Tokenizer\Token $token = null ) : void Throws an UnexpectedTokenException

Приватные методы

Метод Описание
createQualifiedTypeName ( string $localName ) : string This method creates a qualified class or interface name based on the current parser state. By default method uses the current namespace scope as prefix for the given local name. And it will fallback to a previously parsed package annotation, when no namespace declaration was parsed.
extractPostfixImage ( PDepend\Source\AST\ASTNode $node ) : string This method will extract the image/name of the real property/variable that is wrapped by {@link \PDepend\Source\AST\ASTIndexExpression} nodes. If the given node is now wrapped by index expressions, this method will return the image of the entire $node.
getNamespaceOrPackage ( ) : PDepend\Source\AST\ASTNamespace Returns the currently active package or namespace.
getNamespaceOrPackageName ( ) : string Returns the name of a declared names. When the parsed code is not namespaced this method will return the name from the @package annotation.
isAlternativeScopeTermination ( integer $tokenType ) : boolean This method returns true when the given token identifier represents the end token of a alternative scope termination symbol. Otherwise this method will return false.
isNextTokenByReference ( ) : boolean Tests that the next available token is the returns by reference token.
isNextTokenFormalParameterList ( ) : boolean Tests that the next available token is an opening parenthesis.
isReadWriteVariable ( PDepend\Source\AST\ASTNode $expr ) : boolean Checks if the given expression is a read/write variable as defined in the PHP zend_language_parser.y definition.
parseAllocationExpression ( ) : PDepend\Source\AST\ASTAllocationExpression Parses an allocation expression.
parseAlternativeScope ( ) : PDepend\Source\AST\ASTScopeStatement Parses the scope of a statement that is surrounded with PHP's alternative syntax for statements.
parseAlternativeScopeTermination ( integer $tokenType ) : void Parses a series of tokens that represent an alternative scope termination.
parseArrayIndexExpression ( PDepend\Source\AST\ASTNode $node ) : PDepend\Source\AST\ASTArrayIndexExpression Parses a mandatory array index expression.
parseBoundVariables ( PDepend\Source\AST\ASTClosure $closure ) : PDepend\Source\AST\ASTClosure Parses a list of bound closure variables.
parseBraceExpression ( PDepend\Source\AST\ASTNode $node, PDepend\Source\Tokenizer\Token $start, integer $closeToken ) : PDepend\Source\AST\ASTNode This method parses a brace expression and adds all parsed node instances to the given {@link \PDepend\Source\AST\ASTNode} object. Finally it returns the prepared input node.
parseBreakStatement ( ) : PDepend\Source\AST\ASTBreakStatement This method parses a break-statement node.
parseByReference ( ) : boolean This method parses a returns by reference token and returns true.
parseCallableDeclaration ( PDepend\Source\AST\AbstractASTCallable $callable ) : void Parses a function or a method and adds it to the parent context node.
parseCatchStatement ( ) : PDepend\Source\AST\ASTCatchStatement This method parses a catch-statement.
parseClassModifiers ( ) : void This method parses an optional class modifier. Valid class modifiers are final or abstract.
parseClassOrInterfaceReference ( boolean $classReference ) : PDepend\Source\AST\ASTClassOrInterfaceReference Parses a class or interface reference node.
parseCloneExpression ( ) : PDepend\Source\AST\ASTCloneExpression Parses a clone-expression node.
parseClosureDeclaration ( ) : PDepend\Source\AST\ASTClosure This method parses a PHP 5.3 closure or lambda function.
parseCommentWithOptionalInlineClassOrInterfaceReference ( ) : PDepend\Source\AST\ASTComment Parses a comment and optionally an embedded class or interface type annotation.
parseCompoundExpressionOrLiteral ( ) : PDepend\Source\AST\ASTNode This method parses a compound expression like:
parseCompoundVariable ( PDepend\Source\Tokenizer\Token $token ) : PDepend\Source\AST\ASTCompoundVariable This method parses a compound variable like:
parseCompoundVariableOrLiteral ( ) : PDepend\Source\AST\ASTNode Parses a PHP compound variable or a simple literal node.
parseCompoundVariableOrVariableVariable ( ) : PDepend\Source\AST\ASTNode This method implements a decision point between compound-variables and variable-variable. It expects that the next token in the token-stream is of type T_DOLLAR and removes it from the stream. Then this method peeks the next available token when it is of type T_CURLY_BRACE_OPEN this is compound variable, otherwise it can be a variable-variable or a compound-variable.
parseConstantDefinition ( ) : PDepend\Source\AST\ASTConstantDefinition Parses a single constant definition with one or more constant declarators.
parseConstantOrParentMemberPrimaryPrefix ( ) : PDepend\Source\AST\ASTNode This method parses a {@link \PDepend\Source\AST\ASTConstant} node or an instance of {@link \PDepend\Source\AST\ASTParentReference} as part of a {@link \PDepend\Source\AST\ASTMemberPrimaryPrefix} that contains the parent reference as its first child when the self token is followed by a double colon token.
parseConstantOrSelfMemberPrimaryPrefix ( ) : PDepend\Source\AST\ASTNode This method parses a {@link \PDepend\Source\AST\ASTConstant} node or an instance of {@link \PDepend\Source\AST\ASTSelfReference} as part of a {@link \PDepend\Source\AST\ASTMemberPrimaryPrefix} that contains the self reference as its first child when the self token is followed by a double colon token.
parseContinueStatement ( ) : PDepend\Source\AST\ASTContinueStatement This method parses a continue-statement node.
parseDeclareList ( PDepend\Source\AST\ASTDeclareStatement $stmt ) : PDepend\Source\AST\ASTDeclareStatement This method parses a list of declare values. A declare list value always consists of a string token and a static scalar.
parseDeclareStatement ( ) : PDepend\Source\AST\ASTDeclareStatement This method parses a declare-statement.
parseDecrementExpression ( array &$expressions ) : PDepend\Source\AST\ASTExpression This method will parse an decrement-expression. Depending on the previous node this can be a {@link \PDepend\Source\AST\ASTPostDecrementExpression} or {@link \PDepend\Source\AST\ASTPostfixExpression}.
parseDoWhileStatement ( ) : PDepend\Source\AST\ASTDoWhileStatement This method parses a do/while-statement.
parseEchoStatement ( ) : PDepend\Source\AST\ASTEchoStatement This method parses a echo-statement node.
parseElseIfStatement ( ) : PDepend\Source\AST\ASTElseIfStatement This method parses a single elseif-statement node.
parseEscapedAstLiteralString ( ) : PDepend\Source\AST\ASTLiteral This method parses an escaped sequence of literal tokens.
parseEvalExpression ( ) : PDepend\Source\AST\ASTEvalExpression Parses a eval-expression node.
parseExitExpression ( ) : PDepend\Source\AST\ASTExitExpression This method parses an exit-expression.
parseExpression ( ) : PDepend\Source\AST\ASTNode This method parses an expression node and returns it. When no expression was found this method will throw an InvalidStateException.
parseExpressionList ( PDepend\Source\AST\ASTNode $exprList ) : PDepend\Source\AST\ASTNode This method parses multiple expressions and adds them as children to the given $exprList node.
parseFieldDeclaration ( ) : PDepend\Source\AST\ASTFieldDeclaration This method will parse a class field declaration with all it's variables.
parseFieldDeclarationClassOrInterfaceReference ( ) : PDepend\Source\AST\ASTClassOrInterfaceReference Extracts non scalar types from a field doc comment and creates a matching type instance.
parseFieldDeclarationType ( ) : PDepend\Source\AST\ASTType This method will extract the type information of a property from it's doc comment information. The returned value will be null when no type information exists.
parseFinallyStatement ( ) : PDepend\Source\AST\ASTFinallyStatement This method parses a finally-statement.
parseForExpression ( ) : PDepend\Source\AST\ASTExpression Parses the expression part of a for-statement.
parseForInit ( ) : PDepend\Source\AST\ASTForInit Parses the init part of a for-statement.
parseForStatement ( ) : PDepend\Source\AST\ASTForStatement This method parses a single for-statement node.
parseForUpdate ( ) : PDepend\Source\AST\ASTForUpdate Parses the update part of a for-statement.
parseForeachStatement ( ) : PDepend\Source\AST\ASTForeachStatement This method parses a single foreach-statement node.
parseFormalParameterAndArrayTypeHint ( ) : PDepend\Source\AST\ASTFormalParameter This method parses a formal parameter that has an array type hint.
parseFormalParameterAndByReference ( ) : PDepend\Source\AST\ASTFormalParameter This method will parse a formal parameter that is passed by reference.
parseFormalParameterAndParentTypeHint ( ) : PDepend\Source\AST\ASTFormalParameter This method will parse a formal parameter that has the keyword parent as parameter type hint.
parseFormalParameterAndSelfTypeHint ( ) : PDepend\Source\AST\ASTFormalParameter This method will parse a formal parameter that has the keyword self as parameter type hint.
parseFormalParameterAndTypeHint ( ) : PDepend\Source\AST\ASTFormalParameter This method parses a formal parameter that has a regular class type hint.
parseFormalParameterOrTypeHintOrByReference ( ) : PDepend\Source\AST\ASTFormalParameter This method parses a formal parameter in all it's variations.
parseFormalParameters ( ) : PDepend\Source\AST\ASTFormalParameters Extracts all dependencies from a callable signature.
parseFullQualifiedClassNamePostfix ( ) : PDepend\Source\AST\ASTClassFqnPostfix Parses a full qualified class name postfix.
parseFunctionDeclaration ( ) : PDepend\Source\AST\ASTFunction This method parses a function declaration.
parseFunctionOrClosureDeclaration ( ) : PDepend\Source\AST\AbstractASTCallable This method parses a simple function or a PHP 5.3 lambda function or closure.
parseFunctionPostfix ( PDepend\Source\AST\ASTNode $node ) : PDepend\Source\AST\ASTNode This method parses a function postfix expression. An object of type {@link \PDepend\Source\AST\ASTFunctionPostfix} represents any valid php function call.
parseGlobalStatement ( ) : PDepend\Source\AST\ASTGlobalStatement This method parses a global-statement.
parseGotoStatement ( ) : PDepend\Source\AST\ASTGotoStatement This method parses a goto-statement.
parseIfStatement ( ) : PDepend\Source\AST\ASTIfStatement This method parses a single if-statement node.
parseIncludeExpression ( ) : PDepend\Source\AST\ASTIncludeExpression Parses a include-expression node.
parseIncludeOnceExpression ( ) : PDepend\Source\AST\ASTIncludeExpression Parses a include_once-expression node.
parseIncrementExpression ( array &$expressions ) : PDepend\Source\AST\ASTExpression This method will parse an increment-expression. Depending on the previous node this can be a {@link \PDepend\Source\AST\ASTPostIncrementExpression} or {@link \PDepend\Source\AST\ASTPostfixExpression}.
parseIndexExpression ( PDepend\Source\AST\ASTNode $node, PDepend\Source\AST\ASTExpression $expr, integer $open, integer $close ) : PDepend\Source\AST\ASTNode Parses an index expression as it is valid to access elements in a php string or array.
parseInstanceOfExpression ( ) : PDepend\Source\AST\ASTInstanceOfExpression This method parse an instance of expression with its associated class or interface reference.
parseInterfaceDeclaration ( ) : PDepend\Source\AST\ASTInterface Parses the dependencies in a interface signature.
parseInterfaceSignature ( ) : PDepend\Source\AST\ASTInterface Parses the signature of an interface and finally returns a configured interface instance.
parseIssetExpression ( ) : PDepend\Source\AST\ASTIssetExpression Parses an isset-expression node.
parseLabelStatement ( ) : PDepend\Source\AST\ASTLabelStatement This method parses a label-statement.
parseListExpression ( ) : PDepend\Source\AST\ASTListExpression This method parses a single list-statement node.
parseMemberPrefixOrFunctionPostfix ( ) : PDepend\Source\AST\ASTNode This method parses a member primary prefix expression or a function postfix expression node.
parseMemberPrimaryPrefix ( PDepend\Source\AST\ASTNode $node ) : PDepend\Source\AST\ASTMemberPrimaryPrefix This method parses a dynamic or object bound member primary expression.
parseMethodDeclaration ( ) : PDepend\Source\AST\ASTMethod This method parses a method declaration.
parseMethodOrConstantPostfix ( ) : PDepend\Source\AST\ASTNode This method parses a method- or constant-postfix expression. This expression will contain an identifier node as nested child.
parseMethodOrFieldDeclaration ( integer $modifiers ) : PDepend\Source\AST\ASTMethod | PDepend\Source\AST\ASTFieldDeclaration This method will parse a list of modifiers and a following property or method.
parseMethodOrPropertyPostfix ( PDepend\Source\AST\ASTNode $node ) : PDepend\Source\AST\ASTNode This method parses a method- or property-postfix expression. This expression will contain the given node as method or property identifier.
parseMethodPostfix ( PDepend\Source\AST\ASTNode $node ) : PDepend\Source\AST\ASTMethodPostfix Parses a method postfix node instance.
parseNamespaceDeclaration ( ) : void This method parses a PHP 5.3 namespace declaration.
parseNonePhpCode ( ) : integer Parses a sequence of none php code tokens and returns the token type of the next token.
parseOptionalAlternativeScopeTermination ( ) : void Parses the termination of a scope statement that uses PHP's laternative syntax format.
parseOptionalBoundVariables ( PDepend\Source\AST\ASTClosure $closure ) : PDepend\Source\AST\ASTClosure Parses an optional set of bound closure variables.
parseOptionalByReference ( ) : boolean Parses an optional by reference token. The return value will be true when a reference token was found, otherwise this method will return false.
parseOptionalElseOrElseIfStatement ( PDepend\Source\AST\ASTStatement $stmt ) : PDepend\Source\AST\ASTStatement This method parses an optional else-, else+if- or elseif-statement.
parseOptionalExtendsList ( PDepend\Source\AST\ASTInterface $interface ) : PDepend\Source\AST\ASTInterface Parses an optional interface list of an interface declaration.
parseOptionalFunctionPostfix ( PDepend\Source\AST\ASTNode $node ) : PDepend\Source\AST\ASTNode This method will parse an optional function postfix.
parseOptionalMemberPrimaryPrefix ( PDepend\Source\AST\ASTNode $node ) : PDepend\Source\AST\ASTNode This method parses an optional member primary expression. It will parse the primary expression when an object operator can be found at the actual token stream position. Otherwise this method simply returns the input {@link \PDepend\Source\AST\ASTNode} instance.
parseOptionalStatement ( ) : PDepend\Source\AST\ASTNode Parses an optional statement or returns null.
parseOptionalStaticMemberPrimaryPrefix ( PDepend\Source\AST\ASTNode $node ) : PDepend\Source\AST\ASTNode This method parses an optional member primary expression. It will parse the primary expression when a double colon operator can be found at the actual token stream position. Otherwise this method simply returns the input {@link \PDepend\Source\AST\ASTNode} instance.
parseOptionalTraitAdaptation ( PDepend\Source\AST\ASTTraitUseStatement $useStatement ) : PDepend\Source\AST\ASTTraitUseStatement Parses the adaptation list of the given use statement or simply reads the terminating semicolon, when no adaptation list exists.
parsePackageAnnotation ( string $comment ) : string Extracts the @package information from the given comment.
parseParentReference ( PDepend\Source\Tokenizer\Token $token ) : PDepend\Source\AST\ASTNode This method parses a {@link \PDepend\Source\AST\ASTParentReference} node.
parseParenthesisExpression ( ) : PDepend\Source\AST\ASTExpression Parses any expression that is surrounded by an opening and a closing parenthesis
parsePostDecrementExpression ( PDepend\Source\AST\ASTNode $child ) : PDepend\Source\AST\ASTPostfixExpression Parses a post decrement-expression and adds the given child to that node.
parsePostIncrementExpression ( PDepend\Source\AST\ASTNode $child ) : PDepend\Source\AST\ASTPostfixExpression Parses a post increment-expression and adds the given child to that node.
parsePreDecrementExpression ( ) : PDepend\Source\AST\ASTPreDecrementExpression Parses a pre decrement-expression and adds the given child to that node.
parsePreIncrementExpression ( ) : PDepend\Source\AST\ASTPreIncrementExpression Parses a pre increment-expression and adds the given child to that node.
parsePropertyPostfix ( PDepend\Source\AST\ASTNode $node ) : PDepend\Source\AST\ASTPropertyPostfix Parses/Creates a property postfix node instance.
parseQualifiedNameRaw ( ) : array(string) This method parses a qualified PHP 5.3 class, interface and namespace identifier and returns the collected tokens as a string array.
parseRegularScope ( ) : PDepend\Source\AST\ASTScope Parse a scope enclosed by curly braces.
parseRequireExpression ( ) : PDepend\Source\AST\ASTRequireExpression Parses a require-expression node.
parseRequireOnceExpression ( ) : PDepend\Source\AST\ASTRequireExpression Parses a require_once-expression node.
parseRequireOrIncludeExpression ( PDepend\Source\AST\ASTExpression $expr, integer $type ) : PDepend\Source\AST\ASTExpression Parses a require_once-, require-, include_once- or include-expression node.
parseReturnAnnotation ( string $comment ) : string This method parses the given doc comment text for a return annotation and it returns the found return type.
parseReturnStatement ( ) : PDepend\Source\AST\ASTReturnStatement This method parses a single return-statement node.
parseScope ( ) : PDepend\Source\AST\ASTScope Extracts all dependencies from a callable body.
parseScopeStatements ( ) : PDepend\Source\AST\ASTScopeStatement Parses all statements that exist in a scope an adds them to a scope instance.
parseStatement ( ) : PDepend\Source\AST\ASTNode Parse a statement.
parseStatementBody ( PDepend\Source\AST\ASTStatement $stmt ) : PDepend\Source\AST\ASTStatement Parses the body of the given statement instance and adds all parsed nodes to that statement.
parseStatementTermination ( ) : void Parses the termination token for a statement. This termination token can be a semicolon or a closing php tag.
parseStaticMemberPrimaryPrefix ( PDepend\Source\AST\ASTNode $node ) : PDepend\Source\AST\ASTMemberPrimaryPrefix This method parses a static member primary expression. The given node contains the used static class or interface identifier. A static member primary prefix can represent the following code expressions:
parseStaticReference ( PDepend\Source\Tokenizer\Token $token ) : PDepend\Source\AST\ASTStaticReference This method parses a {@link \PDepend\Source\AST\ASTStaticReference} node.
parseStaticVariableDeclaration ( PDepend\Source\Tokenizer\Token $token ) : PDepend\Source\AST\ASTStaticVariableDeclaration This method will parse a static variable declaration.
parseStaticVariableDeclarationOrMemberPrimaryPrefix ( ) : PDepend\Source\AST\ASTConstant This method parses a static variable declaration list, a member primary prefix invoked in the static context of a class or it parses a static closure declaration.
parseString ( integer $delimiterType ) : PDepend\Source\AST\ASTString This method parses a php string with all possible embedded expressions.
parseStringExpressions ( PDepend\Source\AST\ASTNode $node, integer $stopToken ) : PDepend\Source\AST\ASTNode This method parses the contents of a string or here-/now-doc node. It will not consume the given stop token, so it is up to the calling method to consume the stop token. The return value of this method is the prepared input string node.
parseStringIndexExpression ( PDepend\Source\AST\ASTNode $node ) : PDepend\Source\AST\ASTStringIndexExpression Parses a mandatory array index expression.
parseStringSequence ( integer $tokenType ) : string Parses a simple string sequence between two tokens of the same type.
parseSwitchLabel ( ) : PDepend\Source\AST\ASTSwitchLabel This method parses a case label of a switch statement.
parseSwitchLabelBody ( PDepend\Source\AST\ASTSwitchLabel $label ) : PDepend\Source\AST\ASTSwitchLabel Parses the body of an switch label node.
parseSwitchLabelDefault ( ) : PDepend\Source\AST\ASTSwitchLabel This method parses the default label of a switch statement.
parseSwitchStatement ( ) : PDepend\Source\AST\ASTSwitchStatement This method parses a switch statement.
parseSwitchStatementBody ( PDepend\Source\AST\ASTSwitchStatement $switch ) : PDepend\Source\AST\ASTSwitchStatement Parses the body of a switch statement.
parseThrowStatement ( ) : PDepend\Source\AST\ASTThrowStatement This method parses a throw-statement.
parseThrowsAnnotations ( string $comment ) : array Returns the class names of all throws annotations with in the given comment block.
parseTraitAdaptation ( ) : PDepend\Source\AST\ASTTraitAdaptation Parses the adaptation expression of a trait use statement.
parseTraitAdaptationAliasStatement ( array $reference ) : PDepend\Source\AST\ASTTraitAdaptationAlias Parses a trait adaptation alias statement.
parseTraitAdaptationPrecedenceStatement ( array $reference ) : PDepend\Source\AST\ASTTraitAdaptationPrecedence Parses a trait adaptation precedence statement.
parseTraitDeclaration ( ) : PDepend\Source\AST\ASTTrait Parses a trait declaration.
parseTraitMethodReference ( ) : array Parses a trait method reference and returns the found reference as an array.
parseTraitReference ( ) : PDepend\Source\AST\ASTTraitReference Parses a trait reference instance.
parseTraitSignature ( ) : PDepend\Source\AST\ASTTrait Parses the signature of a trait.
parseTraitUseStatement ( ) : PDepend\Source\AST\ASTTraitUseStatement Parses a trait use statement.
parseTryStatement ( ) : PDepend\Source\AST\ASTTryStatement This method parses a try-statement + associated catch-statements.
parseUnsetStatement ( ) : PDepend\Source\AST\ASTUnsetStatement This method parses a unset-statement.
parseVarAnnotation ( string $comment ) : array(string) This method parses the given doc comment text for a var annotation and it returns the found property types.
parseVariable ( ) : PDepend\Source\AST\ASTVariable This method parses a simple PHP variable.
parseVariableList ( PDepend\Source\AST\ASTNode $node ) : PDepend\Source\AST\ASTNode This method parses a comma separated list of valid php variables and/or properties and adds them to the given node instance.
parseVariableOrFunctionPostfixOrMemberPrimaryPrefix ( ) : PDepend\Source\AST\ASTNode This method parses any type of variable, function postfix expressions or any kind of member primary prefix.
parseVariableOrMemberByReference ( ) : PDepend\Source\AST\ASTUnaryExpression Parses a variable or any other valid member expression that is prefixed with PHP's reference operator.
parseVariableOrMemberOptionalByReference ( ) : PDepend\Source\AST\ASTUnaryExpression Parses a variable or any other valid member expression that is optionally prefixed with PHP's reference operator.
parseWhileStatement ( ) : PDepend\Source\AST\ASTWhileStatement This method parses a single while-statement node.
parseYield ( ) : PDepend\Source\AST\ASTYieldStatmenet This method parses a yield-statement node.
prepareCallable ( PDepend\Source\AST\AbstractASTCallable $callable ) : void Extracts documented throws and return types and sets them to the given $callable instance.
reduceUnaryExpression ( array $expressions ) : PDepend\Source\AST\ASTExpression[] Reduces all unary-expressions in the given expression list.
stripTrailingComments ( array $tokens ) : PDepend\Source\Tokenizer\Token[] Strips all trailing comments from the given token stream.

Описание методов

__construct() публичный Метод

Constructs a new source parser.
public __construct ( PDepend\Source\Tokenizer\Tokenizer $tokenizer, PDepend\Source\Builder\Builder $builder, PDepend\Util\Cache\CacheDriver $cache )
$tokenizer PDepend\Source\Tokenizer\Tokenizer
$builder PDepend\Source\Builder\Builder
$cache PDepend\Util\Cache\CacheDriver

consumeComments() защищенный Метод

This method will consume all comment tokens from the token stream.
protected consumeComments ( ) : void
Результат void

consumeToken() защищенный Метод

This method will consume the next token in the token stream. It will throw an exception if the type of this token is not identical with $tokenType.
protected consumeToken ( integer $tokenType ) : PDepend\Source\Tokenizer\Token
$tokenType integer The next expected token type.
Результат PDepend\Source\Tokenizer\Token

doParseArray() защищенный Метод

Parses an array structure.
С версии: 1.0.0
protected doParseArray ( $static = false ) : PDepend\Source\AST\ASTArray
Результат PDepend\Source\AST\ASTArray

getMaxNestingLevel() защищенный Метод

Returns the maximum allowed nesting/recursion level.
С версии: 0.9.12
protected getMaxNestingLevel ( ) : integer
Результат integer

isArrayStartDelimiter() абстрактный защищенный Метод

Tests if the next token is a valid array start delimiter in the supported PHP version.
С версии: 1.0.0
abstract protected isArrayStartDelimiter ( ) : boolean
Результат boolean

isClassName() защищенный Метод

Will return true if the given $tokenType is a valid class name part.
С версии: 0.10.6
protected isClassName ( integer $tokenType ) : boolean
$tokenType integer
Результат boolean

isFileComment() защищенный Метод

This method checks that the previous token is an open tag and the following token is not a class, a interface, final, abstract or a function.
protected isFileComment ( ) : boolean
Результат boolean

isFunctionName() защищенный Метод

Tests if the give token is a valid function name in the supported PHP version.
С версии: 2.3
protected isFunctionName ( integer $tokenType ) : boolean
$tokenType integer
Результат boolean

isKeyword() абстрактный защищенный Метод

Tests if the given token type is a reserved keyword in the supported PHP version.
С версии: 1.1.1
abstract protected isKeyword ( $tokenType ) : boolean
$tokenType
Результат boolean

isMethodName() защищенный Метод

protected isMethodName ( integer $tokenType ) : boolean
$tokenType integer
Результат boolean

isNextTokenArguments() защищенный Метод

This method checks if the next available token starts an arguments node.
С версии: 0.9.8
protected isNextTokenArguments ( ) : boolean
Результат boolean

isTypeHint() защищенный Метод

Tests if the given token type is a valid formal parameter in the supported PHP version.
С версии: 1.0.0
protected isTypeHint ( integer $tokenType ) : boolean
$tokenType integer
Результат boolean

parse() публичный Метод

Parses the contents of the tokenizer and generates a node tree based on the found tokens.
public parse ( ) : void
Результат void

parseAllocationExpressionTypeReference() защищенный Метод

Parse the type reference used in an allocation expression.
С версии: 2.3
protected parseAllocationExpressionTypeReference ( PDepend\Source\AST\ASTAllocationExpression $allocation ) : PDepend\Source\AST\ASTNode
$allocation PDepend\Source\AST\ASTAllocationExpression
Результат PDepend\Source\AST\ASTNode

parseArguments() защищенный Метод

This method parses the arguments passed to a function- or method-call.
С версии: 0.9.6
protected parseArguments ( ) : PDepend\Source\AST\ASTArguments
Результат PDepend\Source\AST\ASTArguments

parseArray() абстрактный защищенный Метод

Parses a php array declaration.
С версии: 1.0.0
abstract protected parseArray ( PDepend\Source\AST\ASTArray $array, boolean $static = false ) : PDepend\Source\AST\ASTArray
$array PDepend\Source\AST\ASTArray
$static boolean
Результат PDepend\Source\AST\ASTArray

parseArrayElement() защищенный Метод

An array element can have a simple value, a key/value pair, a value by reference or a key/value pair with a referenced value.
С версии: 1.0.0
protected parseArrayElement ( boolean $static = false ) : PDepend\Source\AST\ASTArrayElement
$static boolean
Результат PDepend\Source\AST\ASTArrayElement

parseArrayElements() защищенный Метод

Parses all elements in an array.
С версии: 1.0.0
protected parseArrayElements ( PDepend\Source\AST\ASTArray $array, integer $endDelimiter, boolean $static = false ) : PDepend\Source\AST\ASTArray
$array PDepend\Source\AST\ASTArray
$endDelimiter integer
$static boolean
Результат PDepend\Source\AST\ASTArray

parseArrayType() защищенный Метод

protected parseArrayType ( ) : PDepend\Source\AST\ASTTypeArray
Результат PDepend\Source\AST\ASTTypeArray

parseAssignmentExpression() защищенный Метод

Parses an assingment expression node.
С версии: 0.9.12
protected parseAssignmentExpression ( PDepend\Source\AST\ASTNode $left ) : PDepend\Source\AST\ASTAssignmentExpression
$left PDepend\Source\AST\ASTNode The left part of the assignment expression that will be parsed by this method.
Результат PDepend\Source\AST\ASTAssignmentExpression

parseBooleanAndExpression() защищенный Метод

This method parses a boolean and-expression.
С версии: 0.9.8
protected parseBooleanAndExpression ( ) : PDepend\Source\AST\ASTBooleanAndExpression
Результат PDepend\Source\AST\ASTBooleanAndExpression

parseBooleanOrExpression() защищенный Метод

This method parses a boolean or-expression.
С версии: 0.9.8
protected parseBooleanOrExpression ( ) : PDepend\Source\AST\ASTBooleanOrExpression
Результат PDepend\Source\AST\ASTBooleanOrExpression

parseCallableDeclarationAddition() защищенный Метод

Extension for version specific additions.
protected parseCallableDeclarationAddition ( PDepend\Source\AST\AbstractASTCallable $callable ) : PDepend\Source\AST\AbstractASTCallable
$callable PDepend\Source\AST\AbstractASTCallable
Результат PDepend\Source\AST\AbstractASTCallable

parseCastExpression() защищенный Метод

Parses a cast-expression node.
С версии: 0.10.0
protected parseCastExpression ( ) : PDepend\Source\AST\ASTCaseExpression
Результат PDepend\Source\AST\ASTCaseExpression

parseClassDeclaration() защищенный Метод

Parses the dependencies in a class signature.
protected parseClassDeclaration ( ) : PDepend\Source\AST\ASTClass
Результат PDepend\Source\AST\ASTClass

parseClassExtends() защищенный Метод

Parses a parent class declaration for the given $class.
С версии: 1.0.0
protected parseClassExtends ( PDepend\Source\AST\ASTClass $class ) : PDepend\Source\AST\ASTClass
$class PDepend\Source\AST\ASTClass
Результат PDepend\Source\AST\ASTClass

parseClassName() защищенный Метод

Parses a valid class or interface name and returns the image of the parsed token.
protected parseClassName ( ) : string
Результат string

parseClassSignature() защищенный Метод

The signature of a class consists of optional class modifiers like, final or abstract, the T_CLASS token, the class name, an optional parent class and an optional list of implemented interfaces.
С версии: 1.0.0
protected parseClassSignature ( ) : PDepend\Source\AST\ASTClass
Результат PDepend\Source\AST\ASTClass

parseCompoundExpression() защищенный Метод

------------------ {'_' . foo . $bar} ------------------
С версии: 0.9.6
protected parseCompoundExpression ( ) : PDepend\Source\AST\ASTCompoundExpression
Результат PDepend\Source\AST\ASTCompoundExpression

parseCompoundVariableOrVariableVariableOrVariable() защищенный Метод

---- $foo; ---- ----- $$foo; ----- ------ ${FOO}; ------
С версии: 0.9.6
protected parseCompoundVariableOrVariableVariableOrVariable ( ) : PDepend\Source\AST\ASTNode
Результат PDepend\Source\AST\ASTNode

parseConditionalExpression() защищенный Метод

-------------- $foo = ($bar ? 42 : 23); --------------
С версии: 0.9.8
protected parseConditionalExpression ( ) : PDepend\Source\AST\ASTConditionalExpression
Результат PDepend\Source\AST\ASTConditionalExpression

parseConstant() защищенный Метод

Parses a simple PHP constant use and returns a corresponding node.
С версии: 1.0.0
protected parseConstant ( ) : PDepend\Source\AST\ASTNode
Результат PDepend\Source\AST\ASTNode

parseConstantDeclarator() защищенный Метод

class Foo { -------- const BAR = 42; -------- } Or in a comma separated constant defintion: class Foo { -------- const BAR = 42, -------- -------------- const BAZ = 'Foobar', -------------- ---------- const FOO = 3.14; ---------- }
С версии: 0.9.6
protected parseConstantDeclarator ( ) : PDepend\Source\AST\ASTConstantDeclarator
Результат PDepend\Source\AST\ASTConstantDeclarator

parseConstantDeclaratorValue() защищенный Метод

Parses the value of a php constant. By default this can be only static values that were allowed in the oldest supported PHP version.
С версии: 2.2.x
protected parseConstantDeclaratorValue ( ) : PDepend\Source\AST\ASTValue
Результат PDepend\Source\AST\ASTValue

parseExpressionTypeReference() защищенный Метод

This method parses a type identifier as it is used in expression nodes like {@link \PDepend\Source\AST\ASTInstanceOfExpression} or an object allocation node like {@link \PDepend\Source\AST\ASTAllocationExpression}.
protected parseExpressionTypeReference ( PDepend\Source\AST\ASTNode $expr, boolean $classRef ) : PDepend\Source\AST\ASTNode
$expr PDepend\Source\AST\ASTNode
$classRef boolean
Результат PDepend\Source\AST\ASTNode

parseFormalParameter() защищенный Метод

-- ------- function foo(Bar $x, $y = 42) } -- -------
С версии: 0.9.6
protected parseFormalParameter ( ) : PDepend\Source\AST\ASTFormalParameter
Результат PDepend\Source\AST\ASTFormalParameter

parseFormalParameterOrByReference() защищенный Метод

--- ------- function foo(array &$x, $y = 42) } --- -------
С версии: 0.9.6
protected parseFormalParameterOrByReference ( ) : PDepend\Source\AST\ASTFormalParameter
Результат PDepend\Source\AST\ASTFormalParameter

parseFunctionName() защищенный Метод

Parses a function name from the given tokenizer and returns the string literal representing the function name. If no valid token exists in the token stream, this method will throw an exception.
С версии: 0.10.0
protected parseFunctionName ( ) : string
Результат string

parseHeredoc() защищенный Метод

Parses a here- or nowdoc string instance.
С версии: 0.9.12
protected parseHeredoc ( ) : PDepend\Source\AST\ASTHeredoc
Результат PDepend\Source\AST\ASTHeredoc

parseIdentifier() защищенный Метод

Parses a static identifier expression, as it is used for method and function names.
С версии: 0.9.12
protected parseIdentifier ( ) : PDepend\Source\AST\ASTIdentifier
Результат PDepend\Source\AST\ASTIdentifier

parseIntegerNumber() защищенный Метод

Parses an integer value.
С версии: 1.0.0
protected parseIntegerNumber ( ) : PDepend\Source\AST\ASTLiteral
Результат PDepend\Source\AST\ASTLiteral

parseInterfaceList() защищенный Метод

This method parses a list of interface names as used in the extends part of a interface declaration or in the implements part of a class declaration.
protected parseInterfaceList ( PDepend\Source\AST\AbstractASTClassOrInterface $abstractType ) : void
$abstractType PDepend\Source\AST\AbstractASTClassOrInterface
Результат void

parseLiteral() защищенный Метод

This method parses a simple literal and configures the position properties.
С версии: 0.9.10
protected parseLiteral ( ) : PDepend\Source\AST\ASTLiteral
Результат PDepend\Source\AST\ASTLiteral

parseLiteralOrString() защищенный Метод

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
Результат PDepend\Source\AST\ASTNode

parseLogicalAndExpression() защищенный Метод

This method parses a logical and-expression.
С версии: 0.9.8
protected parseLogicalAndExpression ( ) : PDepend\Source\AST\ASTLogicalAndExpression
Результат PDepend\Source\AST\ASTLogicalAndExpression

parseLogicalOrExpression() защищенный Метод

This method parses a logical or-expression.
С версии: 0.9.8
protected parseLogicalOrExpression ( ) : PDepend\Source\AST\ASTLogicalOrExpression
Результат PDepend\Source\AST\ASTLogicalOrExpression

parseLogicalXorExpression() защищенный Метод

This method parses a logical xor-expression.
С версии: 0.9.8
protected parseLogicalXorExpression ( ) : PDepend\Source\AST\ASTLogicalXorExpression
Результат PDepend\Source\AST\ASTLogicalXorExpression

parseMethodName() защищенный Метод

protected parseMethodName ( ) : string
Результат string

parseOptionalExpression() защищенный Метод

This method optionally parses an expression node and returns it. When no expression was found this method will return null.
С версии: 0.9.6
protected parseOptionalExpression ( ) : PDepend\Source\AST\ASTNode
Результат PDepend\Source\AST\ASTNode

parseOptionalExpressionForVersion() защищенный Метод

This method will be called when the base parser cannot handle an expression in the base version. In this method you can implement version specific expressions.
С версии: 2.2
protected parseOptionalExpressionForVersion ( ) : PDepend\Source\AST\ASTNode
Результат PDepend\Source\AST\ASTNode

parseOptionalIndexExpression() защищенный Метод

--------- $array[0]; --------- ---------------- $array[1]['foo']; ---------------- ---------------- $string{1}[0]{0}; ----------------
С версии: 0.9.12
protected parseOptionalIndexExpression ( PDepend\Source\AST\ASTNode $node ) : PDepend\Source\AST\ASTNode
$node PDepend\Source\AST\ASTNode The parent/context node instance.
Результат PDepend\Source\AST\ASTNode

parseParentType() защищенный Метод

protected parseParentType ( ) : PDepend\Source\AST\ASTParentReference
Результат PDepend\Source\AST\ASTParentReference

parseParenthesisExpressionOrPrimaryPrefix() защищенный Метод

(new MyClass())->bar();
С версии: 1.0.0
protected parseParenthesisExpressionOrPrimaryPrefix ( ) : PDepend\Source\AST\ASTNode
Результат PDepend\Source\AST\ASTNode

parsePostfixIdentifier() защищенный Метод

This method parses a PHP version specific identifier for method and property postfix expressions.
С версии: 1.0.0
protected parsePostfixIdentifier ( ) : PDepend\Source\AST\ASTNode
Результат PDepend\Source\AST\ASTNode

parseQualifiedName() защищенный Метод

PDepend\Source\Parser::parse();
protected parseQualifiedName ( ) : string
Результат string

parseSelfReference() защищенный Метод

This method parses a {@link \PDepend\Source\AST\ASTSelfReference} node.
С версии: 0.9.6
protected parseSelfReference ( PDepend\Source\Tokenizer\Token $token ) : PDepend\Source\AST\ASTSelfReference
$token PDepend\Source\Tokenizer\Token The "self" keyword token.
Результат PDepend\Source\AST\ASTSelfReference

parseSelfType() защищенный Метод

protected parseSelfType ( ) : PDepend\Source\AST\ASTSelfReference
Результат PDepend\Source\AST\ASTSelfReference

parseShiftLeftExpression() защищенный Метод

This method parses a shift left expression node.
С версии: 1.0.1
protected parseShiftLeftExpression ( ) : PDepend\Source\AST\ASTShiftLeftExpression
Результат PDepend\Source\AST\ASTShiftLeftExpression

parseShiftRightExpression() защищенный Метод

This method parses a shift right expression node.
С версии: 1.0.1
protected parseShiftRightExpression ( ) : PDepend\Source\AST\ASTShiftRightExpression
Результат PDepend\Source\AST\ASTShiftRightExpression

parseStaticValue() защищенный Метод

This method will parse a static default value as it is used for a parameter, property or constant declaration.
С версии: 0.9.5
protected parseStaticValue ( ) : PDepend\Source\AST\ASTValue
Результат PDepend\Source\AST\ASTValue

parseStaticValueOrStaticArray() защищенный Метод

This method will parse a static value or a static array as it is used as default value for a parameter or property declaration.
С версии: 0.9.6
protected parseStaticValueOrStaticArray ( ) : PDepend\Source\AST\ASTValue
Результат PDepend\Source\AST\ASTValue

parseStaticValueVersionSpecific() защищенный Метод

Parses additional static values that are valid in the supported php version.
protected parseStaticValueVersionSpecific ( PDepend\Source\AST\ASTValue $value ) : PDepend\Source\AST\ASTValue
$value PDepend\Source\AST\ASTValue
Результат PDepend\Source\AST\ASTValue

parseTypeBody() защищенный Метод

Parses a class/interface/trait body.
protected parseTypeBody ( AbstractASTType $type ) : AbstractASTType
$type PDepend\Source\AST\AbstractASTType
Результат PDepend\Source\AST\AbstractASTType

parseTypeHint() защищенный Метод

Parses a type hint that is valid in the supported PHP version.
С версии: 1.0.0
protected parseTypeHint ( ) : PDepend\Source\AST\ASTNode
Результат PDepend\Source\AST\ASTNode

parseUseDeclaration() защищенный Метод

This method parses a single use declaration and adds a mapping between short name and full qualified name to the use symbol table.
С версии: 0.9.5
protected parseUseDeclaration ( ) : void
Результат void

parseUseDeclarations() защищенный Метод

use \foo\bar as fb, \foobar\Bar;
С версии: 0.9.5
protected parseUseDeclarations ( ) : void
Результат void

parseVariableDeclarator() защищенный Метод

Parameter declarator function foo($x = 23) { } Property declarator class Foo{ protected $bar = 42; } Static declarator function baz() { static $foo; }
С версии: 0.9.6
protected parseVariableDeclarator ( ) : PDepend\Source\AST\ASTVariableDeclarator
Результат PDepend\Source\AST\ASTVariableDeclarator

parseVariableOrConstantOrPrimaryPrefix() защищенный Метод

This method implements the parsing for various expression types like variables, object/static method. All these expressions are valid in several php language constructs like, isset, empty, unset etc.
С версии: 0.9.12
protected parseVariableOrConstantOrPrimaryPrefix ( ) : PDepend\Source\AST\ASTNode
Результат PDepend\Source\AST\ASTNode

reduce() защищенный Метод

Applies all reduce rules against the given expression list.
С версии: 0.10.0
protected reduce ( array $expressions ) : PDepend\Source\AST\ASTExpression[]
$expressions array Unprepared input array with parsed expression nodes found in the source tree.
Результат PDepend\Source\AST\ASTExpression[]

reset() защищенный Метод

Resets some object properties.
protected reset ( integer $modifiers ) : void
$modifiers integer Optional default modifiers.
Результат void

setIgnoreAnnotations() публичный Метод

Sets the ignore annotations flag. This means that the parser will ignore doc comment annotations.
public setIgnoreAnnotations ( ) : void
Результат void

setMaxNestingLevel() публичный Метод

Configures the maximum allowed nesting level.
С версии: 0.9.12
public setMaxNestingLevel ( integer $maxNestingLevel ) : void
$maxNestingLevel integer The maximum allowed nesting level.
Результат void

setNodePositionsAndReturn() защищенный Метод

This method configures the given node with its start and end positions.
С версии: 0.9.8
protected setNodePositionsAndReturn ( PDepend\Source\AST\ASTNode $node, array &$tokens = null ) : PDepend\Source\AST\ASTNode
$node PDepend\Source\AST\ASTNode
$tokens array
Результат PDepend\Source\AST\ASTNode

setUpEnvironment() защищенный Метод

Initializes the parser environment.
С версии: 0.9.12
protected setUpEnvironment ( ) : void
Результат void

tearDownEnvironment() защищенный Метод

Restores the parser environment back.
С версии: 0.9.12
protected tearDownEnvironment ( ) : void
Результат void

throwUnexpectedTokenException() защищенный Метод

Throws an UnexpectedTokenException
С версии: 2.2.5
protected throwUnexpectedTokenException ( PDepend\Source\Tokenizer\Token $token = null ) : void
$token PDepend\Source\Tokenizer\Token
Результат void

Описание свойств

$builder защищенное свойство

The used data structure builder.
protected Builder,PDepend\Source\Builder $builder
Результат PDepend\Source\Builder\Builder

$cache защищенное свойство

С версии: 0.10.0
protected CacheDriver,PDepend\Util\Cache $cache
Результат PDepend\Util\Cache\CacheDriver

$compilationUnit защищенное свойство

The currently parsed file instance.
protected ASTCompilationUnit,PDepend\Source\AST $compilationUnit
Результат PDepend\Source\AST\ASTCompilationUnit

$tokenStack защищенное свойство

Stack with all active token scopes.
protected TokenStack,PDepend\Source\Tokenizer $tokenStack
Результат PDepend\Source\Tokenizer\TokenStack

$tokenizer защищенное свойство

* The used code tokenizer.
protected $tokenizer