PHP 클래스 PhpParser\ParserAbstract

상속: implements phpparser\Parser
파일 보기 프로젝트 열기: nikic/PHP-Parser 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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

공개 메소드들

메소드 설명
__construct ( Lexer $lexer, array $options = [] ) Creates a parser instance.
parse ( string $code, phpparser\ErrorHandler $errorHandler = null ) : phpparser\Node[] | null Parses PHP code into a node tree.

보호된 메소드들

메소드 설명
checkClass ( Class_ $node, $namePos )
checkClassConst ( ClassConst $node, $modifierPos )
checkClassMethod ( ClassMethod $node, $modifierPos )
checkInterface ( Interface_ $node, $namePos )
checkModifier ( $a, $b, $modifierPos )
checkNamespace ( Namespace_ $node )
checkParam ( Param $node )
checkProperty ( Property $node, $modifierPos )
checkTryCatch ( TryCatch $node )
checkUseUse ( UseUse $node, $namePos )
emitError ( Error $error )
getAttributesAt ( $pos )
getErrorMessage ( $symbol, $state )
getExpectedTokens ( $state )
handleBuiltinTypes ( Name $name )
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 )

비공개 메소드들

메소드 설명
getNamespacingStyle ( array $stmts )

메소드 상세

__construct() 공개 메소드

Creates a parser instance.
public __construct ( Lexer $lexer, array $options = [] )
$lexer Lexer A lexer
$options array Options array. Currently no options are supported.

checkClass() 보호된 메소드

protected checkClass ( Class_ $node, $namePos )
$node PhpParser\Node\Stmt\Class_

checkClassConst() 보호된 메소드

protected checkClassConst ( ClassConst $node, $modifierPos )
$node PhpParser\Node\Stmt\ClassConst

checkClassMethod() 보호된 메소드

protected checkClassMethod ( ClassMethod $node, $modifierPos )
$node PhpParser\Node\Stmt\ClassMethod

checkInterface() 보호된 메소드

protected checkInterface ( Interface_ $node, $namePos )
$node PhpParser\Node\Stmt\Interface_

checkModifier() 보호된 메소드

protected checkModifier ( $a, $b, $modifierPos )

checkNamespace() 보호된 메소드

protected checkNamespace ( Namespace_ $node )
$node PhpParser\Node\Stmt\Namespace_

checkParam() 보호된 메소드

protected checkParam ( Param $node )
$node PhpParser\Node\Param

checkProperty() 보호된 메소드

protected checkProperty ( Property $node, $modifierPos )
$node PhpParser\Node\Stmt\Property

checkTryCatch() 보호된 메소드

protected checkTryCatch ( TryCatch $node )
$node PhpParser\Node\Stmt\TryCatch

checkUseUse() 보호된 메소드

protected checkUseUse ( UseUse $node, $namePos )
$node PhpParser\Node\Stmt\UseUse

emitError() 보호된 메소드

protected emitError ( Error $error )
$error Error

getAttributesAt() 보호된 메소드

protected getAttributesAt ( $pos )

getErrorMessage() 보호된 메소드

protected getErrorMessage ( $symbol, $state )

getExpectedTokens() 보호된 메소드

protected getExpectedTokens ( $state )

handleBuiltinTypes() 보호된 메소드

protected handleBuiltinTypes ( Name $name )
$name PhpParser\Node\Name

handleNamespaces() 보호된 메소드

Moves statements of semicolon-style namespaces into $ns->stmts and checks various error conditions.
protected handleNamespaces ( array $stmts ) : phpparser\Node[]
$stmts array
리턴 phpparser\Node[]

parse() 공개 메소드

If a non-throwing error handler is used, the parser will continue parsing after an error occurred and attempt to build a partial AST.
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.
리턴 phpparser\Node[] | null Array of statements (or null if the 'throwOnError' option is disabled and the parser was unable to recover from an error).

parseLNumber() 보호된 메소드

protected parseLNumber ( $str, $attributes, $allowInvalidOctal = false )

parseNumString() 보호된 메소드

protected parseNumString ( $str, $attributes )

프로퍼티 상세

$YY2TBLSTATE 보호되어 있는 프로퍼티

protected $YY2TBLSTATE

$YYNLSTATES 보호되어 있는 프로퍼티

protected $YYNLSTATES

$action 보호되어 있는 프로퍼티

Table of actions. Indexed according to $actionBase comment.
protected $action

$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.
protected $actionBase

$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.
protected $actionCheck

$actionDefault 보호되어 있는 프로퍼티

Map of states to their default action
protected $actionDefault

$actionTableSize 보호되어 있는 프로퍼티

Size of $action table
protected $actionTableSize

$defaultAction 보호되어 있는 프로퍼티

Action number signifying default action
protected $defaultAction

$endAttributeStack 보호되어 있는 프로퍼티

End attribute stack
protected $endAttributeStack

$endAttributes 보호되어 있는 프로퍼티

End attributes of last *shifted* token
protected $endAttributes

$errorHandler 보호되어 있는 프로퍼티

Error handler
protected $errorHandler

$errorState 보호되어 있는 프로퍼티

Error state, used to avoid error floods
protected $errorState

$errorSymbol 보호되어 있는 프로퍼티

Symbol number of error recovery token
protected $errorSymbol

$errors 보호되어 있는 프로퍼티

Errors collected during last parse
protected $errors

$goto 보호되어 있는 프로퍼티

Table of states to goto after reduction. Indexed according to $gotoBase comment.
protected $goto

$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)
protected $gotoBase

$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.
protected $gotoCheck

$gotoDefault 보호되어 있는 프로퍼티

Map of non-terminals to the default state to goto after their reduction
protected $gotoDefault

$gotoTableSize 보호되어 있는 프로퍼티

Size of $goto table
protected $gotoTableSize

$invalidSymbol 보호되어 있는 프로퍼티

Symbol number signifying an invalid token
protected $invalidSymbol

$lexer 보호되어 있는 프로퍼티

Lexer that is used when parsing
protected $lexer

$lookaheadStartAttributes 보호되어 있는 프로퍼티

Start attributes of last *read* token
protected $lookaheadStartAttributes

$productions 보호되어 있는 프로퍼티

Names of the production rules (only necessary for debugging)
protected $productions

$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.
protected $ruleToLength

$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.
protected $ruleToNonTerminal

$semStack 보호되어 있는 프로퍼티

Semantic value stack (contains values of tokens and semantic action results)
protected $semStack

$semValue 보호되어 있는 프로퍼티

Temporary value containing the result of last semantic action (reduction)
protected $semValue

$specialNames 보호되어 있는 정적으로 프로퍼티

protected static $specialNames

$stackPos 보호되어 있는 프로퍼티

Position in stacks (state stack, semantic value stack, attribute stack)
protected $stackPos

$startAttributeStack 보호되어 있는 프로퍼티

Start attribute stack
protected $startAttributeStack

$symbolToName 보호되어 있는 프로퍼티

Map of symbols to their names
protected $symbolToName

$tokenToSymbol 보호되어 있는 프로퍼티

Map of lexer tokens to internal symbols
protected $tokenToSymbol

$tokenToSymbolMapSize 보호되어 있는 프로퍼티

Size of $tokenToSymbol map
protected $tokenToSymbolMapSize

$unexpectedTokenRule 보호되어 있는 프로퍼티

Rule number signifying that an unexpected token was encountered
protected $unexpectedTokenRule