| Methods |
| public __construct(PhpParser Creates a parser instance. Options:
|
| public getTokens() : array |
| public parse(string $code, ?PhpParser Parses PHP code into a node tree. If a non-throwing error handler is used, the parser will continue parsing after an error occurred and attempt to build a partial AST.
|
| Properties |
protected array $action
|
protected array $actionBase
|
protected array $actionCheck
|
protected array $actionDefault
|
protected int $actionTableSize
|
protected ?SplObjectStorage $createdArrays
|
protected int $defaultAction
|
protected array $dropTokens
|
protected PhpParser
|
protected int $errorState
|
protected int $errorSymbol
|
protected array $goto
|
protected array $gotoBase
|
protected array $gotoCheck
|
protected array $gotoDefault
|
protected int $gotoTableSize
|
protected int $invalidSymbol
|
protected PhpParser
|
protected int $numNonLeafStates
|
protected ?SplObjectStorage $parenthesizedArrowFunctions
|
protected array $phpTokenToSymbol
|
protected PhpParser
|
protected array $productions
|
protected array $reduceCallbacks
|
protected array $ruleToLength
|
protected array $ruleToNonTerminal
|
protected array $semStack
|
protected $semValue = NULL
|
protected array $symbolToName
|
protected array $tokenEndStack
|
protected int $tokenPos
|
protected array $tokens
|
protected array $tokenStartStack
|
protected array $tokenToSymbol
|
protected int $tokenToSymbolMapSize
|
protected int $unexpectedTokenRule
|
| protected int $YY2TBLSTATE |
| Methods |
protected addPropertyNameToHooks(PhpParser
|
| protected checkClass(PhpParser |
| protected checkClassConst(PhpParser |
| protected checkClassMethod(PhpParser |
| protected checkClassModifier(int $a, int $b, int $modifierPos) : void |
| protected checkConstantAttributes(PhpParser |
protected checkEmptyPropertyHookList(array $hooks, int $hookPos) : void
|
| protected checkEnum(PhpParser |
| protected checkInterface(PhpParser |
| protected checkModifier(int $a, int $b, int $modifierPos) : void |
| protected checkNamespace(PhpParser |
| protected checkParam(PhpParser |
| protected checkPipeOperatorParentheses(PhpParser |
| protected checkPropertyHook(PhpParser |
| protected checkPropertyHookModifiers(int $a, int $b, int $modifierPos) : void |
| protected checkPropertyHooksForMultiProperty(PhpParser |
| protected checkTryCatch(PhpParser |
| protected checkUseUse(PhpParser |
| protected createCommentFromToken(PhpParser |
protected createEmptyElemAttributes(int $tokenPos) : array
|
protected createExitExpr(string $name, int $namePos, array $args, array $attrs) : PhpParser
|
| protected createTokenMap() : array Creates the token map. The token map maps the PHP internal token identifiers to the identifiers used by the Parser. Additionally it maps T_OPEN_TAG_WITH_ECHO to T_ECHO and T_CLOSE_TAG to ';'.
|
protected doParse() : ?array
|
| protected emitError(PhpParser |
protected fixupAlternativeElse( $node) : void
|
| protected fixupArrayDestructuring(PhpParser |
| protected getAttributes(int $tokenStartPos, int $tokenEndPos) : array Get attributes for a node with the given start and end token positions.
|
| protected getAttributesAt(int $stackPos) : array Get combined start and end attributes at a stack location
|
| protected getAttributesForToken(int $tokenPos) : array Get attributes for a single token at the given token position.
|
| protected getBoolCastKind(string $cast) : int |
| protected getCommentBeforeToken(int $tokenPos) : ?PhpParser Get last comment before the given token position, if any |
| protected getErrorMessage(int $symbol, int $state) : string Format error message including expected tokens.
|
| protected getExpectedTokens(int $state) : array Get limited number of expected tokens in given state.
|
| protected getFloatCastKind(string $cast) : int |
| protected getIntCastKind(string $cast) : int |
| protected getStringCastKind(string $cast) : int |
protected handleBuiltinTypes(PhpParser
|
| protected handleHaltCompiler() : string |
| protected handleNamespaces(array $stmts) : array Moves statements of semicolon-style namespaces into $ns->stmts and checks various error conditions.
|
| protected abstract initReduceCallbacks() : void Initialize $reduceCallbacks map. |
| protected inlineHtmlHasLeadingNewline(int $stackPos) : bool |
| protected maybeCreateNop(int $tokenStartPos, int $tokenEndPos) : ?PhpParser |
| protected maybeCreateZeroLengthNop(int $tokenPos) : ?PhpParser Create a zero-length nop to capture preceding comments, if any. |
protected parseDocString(string $startToken, $contents, string $endToken, array $attributes, array $endTokenAttributes, bool $parseUnicodeEscape) : PhpParser
|
protected parseLNumber(string $str, array $attributes, bool $allowInvalidOctal = false) : PhpParser
|
| protected parseNumString(string $str, array $attributes) Parse a T_NUM_STRING token into either an integer or string node.
|
| protected postprocessList(PhpParser |
protected stripIndentation(string $string, int $indentLen, string $indentChar, bool $newlineAtStart, bool $newlineAtEnd, array $attributes) : string
|
| Constants |
| private PhpParser |
| Methods |
| private checkClassName(?PhpParser |
private checkImplementedInterfaces(array $interfaces) : void
|
| private fixupNamespaceAttributes(PhpParser |
private getNamespaceErrorAttributes(PhpParser
|
| private getNamespacingStyle(array $stmts) : ?string Determine namespacing style (semicolon or brace)
|
private isSimpleExit(array $args) : bool
|