Copied!
CloneableInstantiable
Constants
public PhpParser\ParserAbstract::SYMBOL_NONE = -1
Methods
public PhpParser\ParserAbstract::__construct(PhpParser\Lexer $lexer, array $options = [])
 

Creates a parser instance.

Options: Currently none.

public PhpParser\ParserAbstract::parse(string $code, ?PhpParser\ErrorHandler $errorHandler = NULL)
 

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 $action
protected $actionBase
protected $actionCheck
protected $actionDefault
protected $actionTableSize
protected $defaultAction
protected PhpParser\ParserAbstract::$endAttributes
 
protected PhpParser\ParserAbstract::$endAttributeStack
 
protected PhpParser\ParserAbstract::$errorHandler
protected PhpParser\ParserAbstract::$errorState
 
protected $errorSymbol
protected $goto
protected $gotoBase
protected $gotoCheck
protected $gotoDefault
protected $gotoTableSize
protected $invalidSymbol
protected PhpParser\ParserAbstract::$lexer
 
protected PhpParser\ParserAbstract::$lookaheadStartAttributes
 
protected $numNonLeafStates
protected PhpParser\ParserAbstract::$productions
 
protected PhpParser\ParserAbstract::$reduceCallbacks
 
protected $ruleToLength
protected $ruleToNonTerminal
protected PhpParser\ParserAbstract::$semStack
 
protected PhpParser\ParserAbstract::$semValue
 
protected PhpParser\ParserAbstract::$startAttributeStack
 
protected $symbolToName
protected $tokenToSymbol
protected $tokenToSymbolMapSize
protected $unexpectedTokenRule
protected $YY2TBLSTATE
Methods
protected PhpParser\ParserAbstract::checkClass(PhpParser\Node\Stmt\Class_ $node, $namePos)
protected PhpParser\ParserAbstract::checkClassConst(PhpParser\Node\Stmt\ClassConst $node, $modifierPos)
protected PhpParser\ParserAbstract::checkClassMethod(PhpParser\Node\Stmt\ClassMethod $node, $modifierPos)
protected PhpParser\ParserAbstract::checkClassModifier( $a, $b, $modifierPos)
protected PhpParser\ParserAbstract::checkEnum(PhpParser\Node\Stmt\Enum_ $node, $namePos)
protected PhpParser\ParserAbstract::checkInterface(PhpParser\Node\Stmt\Interface_ $node, $namePos)
protected PhpParser\ParserAbstract::checkModifier( $a, $b, $modifierPos)
protected PhpParser\ParserAbstract::checkNamespace(PhpParser\Node\Stmt\Namespace_ $node)
protected PhpParser\ParserAbstract::checkParam(PhpParser\Node\Param $node)
protected PhpParser\ParserAbstract::checkProperty(PhpParser\Node\Stmt\Property $node, $modifierPos)
protected PhpParser\ParserAbstract::checkTryCatch(PhpParser\Node\Stmt\TryCatch $node)
protected PhpParser\ParserAbstract::checkUseUse(PhpParser\Node\Stmt\UseUse $node, $namePos)
protected PhpParser\ParserAbstract::createCommentNopAttributes(array $comments)
 

Create attributes for a zero-length common-capturing nop.

protected PhpParser\ParserAbstract::doParse()
protected PhpParser\ParserAbstract::emitError(PhpParser\Error $error)
protected PhpParser\ParserAbstract::fixupAlternativeElse( $node)
protected PhpParser\ParserAbstract::fixupPhp5StaticPropCall( $prop, array $args, array $attributes) : PhpParser\Node\Expr\StaticCall
 

Fix up parsing of static property calls in PHP 5.

In PHP 5 A::$b[c][d] and A::$b[c][d]() have very different interpretation. The former is
interpreted as (A::$b)[c][d], while the latter is the same as A::{$b[c][d]}(). We parse the
latter as the former initially and this method fixes the AST into the correct form when we
encounter the "()".

protected PhpParser\ParserAbstract::fixupStartAttributes(PhpParser\Node $to, PhpParser\Node $from)
protected PhpParser\ParserAbstract::getAttributesAt(int $pos) : array
 

Get combined start and end attributes at a stack location

protected PhpParser\ParserAbstract::getErrorMessage(int $symbol, int $state) : string
 

Format error message including expected tokens.

protected PhpParser\ParserAbstract::getExpectedTokens(int $state) : array
 

Get limited number of expected tokens in given state.

protected PhpParser\ParserAbstract::getFloatCastKind(string $cast) : int
protected PhpParser\ParserAbstract::handleBuiltinTypes(PhpParser\Node\Name $name)
protected PhpParser\ParserAbstract::handleNamespaces(array $stmts) : array
 

Moves statements of semicolon-style namespaces into $ns->stmts and checks various error conditions.

protected initReduceCallbacks()
protected PhpParser\ParserAbstract::parseDocString(string $startToken, $contents, string $endToken, array $attributes, array $endTokenAttributes, bool $parseUnicodeEscape)
protected PhpParser\ParserAbstract::parseLNumber( $str, $attributes, $allowInvalidOctal = false)
protected PhpParser\ParserAbstract::parseNumString(string $str, array $attributes)
 

Parse a T_NUM_STRING token into either an integer or string node.

protected PhpParser\ParserAbstract::stripIndentation(string $string, int $indentLen, string $indentChar, bool $newlineAtStart, bool $newlineAtEnd, array $attributes)
© 2023 Bruce Wells
Search Namespaces \ Classes
Configuration