Constants |
public PhpParser\ParserAbstract ::SYMBOL_NONE = -1 |
Methods |
public
__construct
(
PhpParser\Lexer
$lexer
,
array
$options
=
[
]
) Creates a parser instance. Options: Currently none. |
public
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
|
Properties |
protected
$action
|
protected
$actionBase
|
protected
$actionCheck
|
protected
$actionDefault
|
protected
$actionTableSize
|
protected
$defaultAction
|
protected
$endAttributes
|
protected
$endAttributeStack
|
protected
$errorHandler
|
protected
$errorState
|
protected
$errorSymbol
|
protected
$goto
|
protected
$gotoBase
|
protected
$gotoCheck
|
protected
$gotoDefault
|
protected
$gotoTableSize
|
protected
$invalidSymbol
|
protected
$lexer
|
protected
$lookaheadStartAttributes
|
protected
$numNonLeafStates
|
protected
$productions
|
protected
$reduceCallbacks
|
protected
$ruleToLength
|
protected
$ruleToNonTerminal
|
protected
$semStack
|
protected
$semValue
|
protected
$startAttributeStack
|
protected
$symbolToName
|
protected
$tokenToSymbol
|
protected
$tokenToSymbolMapSize
|
protected
$unexpectedTokenRule
|
protected $YY2TBLSTATE |
Methods |
protected checkClass ( PhpParser\Node\Stmt\Class_ $node , $namePos ) |
protected checkClassConst ( PhpParser\Node\Stmt\ClassConst $node , $modifierPos ) |
protected checkClassMethod ( PhpParser\Node\Stmt\ClassMethod $node , $modifierPos ) |
protected checkInterface ( PhpParser\Node\Stmt\Interface_ $node , $namePos ) |
protected checkModifier ( $a , $b , $modifierPos ) |
protected checkNamespace ( PhpParser\Node\Stmt\Namespace_ $node ) |
protected checkParam ( PhpParser\Node\Param $node ) |
protected checkProperty ( PhpParser\Node\Stmt\Property $node , $modifierPos ) |
protected checkTryCatch ( PhpParser\Node\Stmt\TryCatch $node ) |
protected checkUseUse ( PhpParser\Node\Stmt\UseUse $node , $namePos ) |
protected
createCommentNopAttributes
(
array
$comments
) Create attributes for a zero-length common-capturing nop.
|
protected doParse () |
protected emitError ( PhpParser\Error $error ) |
protected
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
|
protected fixupStartAttributes ( PhpParser\Node $to , PhpParser\Node $from ) |
protected
getAttributesAt
(
int
$pos
) :
array
Get combined start and end attributes at a stack location
|
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 handleBuiltinTypes ( PhpParser\Node\Name $name ) |
protected
handleNamespaces
(
array
$stmts
) :
array
Moves statements of semicolon-style namespaces into $ns->stmts and checks various error conditions.
|
protected
abstract
initReduceCallbacks
() Initialize $reduceCallbacks map. |
protected parseDocString ( string $startToken , $contents , string $endToken , array $attributes , array $endTokenAttributes , bool $parseUnicodeEscape ) |
protected parseLNumber ( $str , $attributes , $allowInvalidOctal = false ) |
protected
parseNumString
(
string
$str
,
array
$attributes
) Parse a T_NUM_STRING token into either an integer or string node.
|
protected stripIndentation ( string $string , int $indentLen , string $indentChar , bool $newlineAtStart , bool $newlineAtEnd , array $attributes ) |
Methods |
private fixupNamespaceAttributes ( PhpParser\Node\Stmt\Namespace_ $stmt ) |
private
getNamespacingStyle
(
array
$stmts
) Determine namespacing style (semicolon or brace)
|