Property | Type | Description | |
---|---|---|---|
$YY2TBLSTATE | |||
$YYNLSTATES | |||
$action | Table of actions. Indexed according to $actionBase comment. | ||
$actionBase | Map of states to a displacement into the $action table. The corresponding action for this state/symbol pair is $action[$actionBase[$state] + $symbol]. If $actionBase[$state] is 0, the action is defaulted, i.e. $actionDefault[$state] should be used instead. | ||
$actionCheck | Table indexed analogously to $action. If $actionCheck[$actionBase[$state] + $symbol] != $symbol then the action is defaulted, i.e. $actionDefault[$state] should be used instead. | ||
$actionDefault | Map of states to their default action | ||
$actionTableSize | Size of $action table | ||
$defaultAction | Action number signifying default action | ||
$endAttributeStack | End attribute stack | ||
$endAttributes | End attributes of last *shifted* token | ||
$errorHandler | Error handler | ||
$errorState | Error state, used to avoid error floods | ||
$errorSymbol | Symbol number of error recovery token | ||
$errors | Errors collected during last parse | ||
$goto | Table of states to goto after reduction. Indexed according to $gotoBase comment. | ||
$gotoBase | Map of non-terminals to a displacement into the $goto table. The corresponding goto state for this non-terminal/state pair is $goto[$gotoBase[$nonTerminal] + $state] (unless defaulted) | ||
$gotoCheck | Table indexed analogously to $goto. If $gotoCheck[$gotoBase[$nonTerminal] + $state] != $nonTerminal then the goto state is defaulted, i.e. $gotoDefault[$nonTerminal] should be used. | ||
$gotoDefault | Map of non-terminals to the default state to goto after their reduction | ||
$gotoTableSize | Size of $goto table | ||
$invalidSymbol | Symbol number signifying an invalid token | ||
$lexer | Lexer that is used when parsing | ||
$lookaheadStartAttributes | Start attributes of last *read* token | ||
$productions | Names of the production rules (only necessary for debugging) | ||
$ruleToLength | Map of rules to the length of their right-hand side, which is the number of elements that have to be popped from the stack(s) on reduction. | ||
$ruleToNonTerminal | Map of rules to the non-terminal on their left-hand side, i.e. the non-terminal to use for determining the state to goto after reduction. | ||
$semStack | Semantic value stack (contains values of tokens and semantic action results) | ||
$semValue | Temporary value containing the result of last semantic action (reduction) | ||
$specialNames | |||
$stackPos | Position in stacks (state stack, semantic value stack, attribute stack) | ||
$startAttributeStack | Start attribute stack | ||
$symbolToName | Map of symbols to their names | ||
$tokenToSymbol | Map of lexer tokens to internal symbols | ||
$tokenToSymbolMapSize | Size of $tokenToSymbol map | ||
$unexpectedTokenRule | Rule number signifying that an unexpected token was encountered |
Method | Description | |
---|---|---|
__construct ( |
Creates a parser instance. | |
parse ( string $code, phpparser\ErrorHandler $errorHandler = null ) : phpparser\Node[] | null | Parses PHP code into a node tree. |
Method | Description | |
---|---|---|
checkClass ( |
||
checkClassConst ( |
||
checkClassMethod ( |
||
checkInterface ( |
||
checkModifier ( $a, $b, $modifierPos ) | ||
checkNamespace ( |
||
checkParam ( |
||
checkProperty ( |
||
checkTryCatch ( |
||
checkUseUse ( |
||
emitError ( |
||
getAttributesAt ( $pos ) | ||
getErrorMessage ( $symbol, $state ) | ||
getExpectedTokens ( $state ) | ||
handleBuiltinTypes ( |
||
handleNamespaces ( array $stmts ) : phpparser\Node[] | Moves statements of semicolon-style namespaces into $ns->stmts and checks various error conditions. | |
parseLNumber ( $str, $attributes, $allowInvalidOctal = false ) | ||
parseNumString ( $str, $attributes ) |
Method | Description | |
---|---|---|
getNamespacingStyle ( array $stmts ) |
public __construct ( |
||
$lexer | A lexer | |
$options | array | Options array. Currently no options are supported. |
protected checkClass ( |
||
$node |
protected checkClassConst ( |
||
$node |
protected checkClassMethod ( |
||
$node |
protected checkInterface ( |
||
$node |
protected checkNamespace ( |
||
$node |
protected checkProperty ( |
||
$node |
protected checkTryCatch ( |
||
$node |
protected checkUseUse ( |
||
$node |
protected handleBuiltinTypes ( |
||
$name |
protected handleNamespaces ( array $stmts ) : phpparser\Node[] | ||
$stmts | array | |
return | phpparser\Node[] |
public parse ( string $code, phpparser\ErrorHandler $errorHandler = null ) : phpparser\Node[] | null | ||
$code | string | The source code to parse |
$errorHandler | phpparser\ErrorHandler | Error handler to use for lexer/parser errors, defaults to ErrorHandler\Throwing. |
return | phpparser\Node[] | null | Array of statements (or null if the 'throwOnError' option is disabled and the parser was unable to recover from an error). |
protected parseLNumber ( $str, $attributes, $allowInvalidOctal = false ) |
protected $action |
protected $actionBase |
protected $actionCheck |
protected $defaultAction |
protected $endAttributes |
protected $goto |
protected $gotoBase |
protected $gotoCheck |
protected $gotoDefault |
protected $invalidSymbol |
protected $lookaheadStartAttributes |
protected $productions |
protected $ruleToLength |
protected $ruleToNonTerminal |
protected $semStack |
protected $semValue |
protected $stackPos |
protected $tokenToSymbol |
protected $tokenToSymbolMapSize |