PHP 클래스 Zephir\SymbolTable

A symbol table stores all the variables defined in a method, their data types and default values
파일 보기 프로젝트 열기: phalcon/zephir 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$branchTempVariables
$branchVariables
$compilationContext
$localContext Zephir\Passes\LocalContextPass
$mustGrownStack
$tempVarCount

공개 메소드들

메소드 설명
__construct ( zephir\CompilationContext $compilationContext ) SymbolTable
addRawVariable ( Variable $variable ) : Variable Adds a raw variable to the symbol table (root branch)
addTemp ( string $type, zephir\CompilationContext $context ) : Variable Creates a temporary variable
addVariable ( integer $type, string $name, zephir\CompilationContext $compilationContext, mixed $defaultValue = null ) : Variable Adds a variable to the symbol table
getExpectedMutations ( string $variable ) : integer Returns the number of expected mutations for a variable
getLastCallLine ( ) : integer Returns the last line where any kind of call was performed within the method This is not necessary related to the symbol table but this information is gathered by the LocalContextPass
getLastUnsetLine ( ) : integer Returns the last line where an 'unset' operation was made within the current method This is not necessary related to the symbol table but this information is gathered by the LocalContextPass
getMustGrownStack ( ) : boolean Returns if the current symbol label must add a memory frame
getNextTempVar ( $compilationContext = null )
getTempComplexLiteralVariableForWrite ( string $type, zephir\CompilationContext $context ) : Variable Creates a temporary variable to be used in a write operation the body of the variable is freed between iterations instead of request a new full zval variable
getTempLocalVariableForWrite ( string $type, zephir\CompilationContext $context ) : Variable Creates a temporary variable to be used in a write operation
getTempNonTrackedUninitializedVariable ( string $type, zephir\CompilationContext $context ) : Variable Creates a temporary variable to be used in a read-only operation within native-array-access and property-access These kind of variables MUST not be tracked by the Zephir memory manager
getTempNonTrackedVariable ( $type, zephir\CompilationContext $context, boolean $initNonReferenced = false ) : Variable Creates a temporary variable to be used to point to a heap variable These kind of variables MUST not be tracked by the Zephir memory manager
getTempVariable ( string $type, zephir\CompilationContext $compilationContext ) : Variable Returns a temporal variable
getTempVariableForObserve ( string $type, zephir\CompilationContext $context ) : Variable Creates a temporary variable to be used as intermediate variable of a read operation Variables are automatically tracked by the memory manager
getTempVariableForObserveOrNullify ( string $type, zephir\CompilationContext $context ) : Variable Creates a temporary variable to be used as intermediate variable in a call operation Variables are automatically tracked by the memory manager
getTempVariableForWrite ( string $type, zephir\CompilationContext $context, $init = true ) : Variable Creates a temporary variable to be used in a write operation
getTemporalVariables ( ) : array Returns the temporal variables declared in a given context
getVariable ( $name, $compilationContext = null ) : Variable | boolean Returns a variable in the symbol table
getVariableForRead ( string $name, zephir\CompilationContext $compilationContext = null, array $statement = null ) : Variable Return a variable in the symbol table, it will be used for a read operation
getVariableForUpdate ( string $name, zephir\CompilationContext $compilationContext, array $statement = null ) : Variable Return a variable in the symbol table, it will be used for a mutating operation This method implies mutation of one of the members of the variable but no the variables it self
getVariableForWrite ( string $name, zephir\CompilationContext $compilationContext, array $statement = null ) : boolean | Variable Return a variable in the symbol table, it will be used for a write operation Some variables aren't writable themselves but their members do
getVariables ( ) : array Returns all the variables defined in the symbol table
getVariablesByBranch ( $branchId )
hasVariable ( string $name, $compilationContext = null ) : boolean Check if a variable is declared in the current symbol table
hasVariableInBranch ( $name, $compareBranch, $compilationContext = null )
isSuperGlobal ( string $name ) : boolean Checks if a variable is a superglobal
markTemporalVariablesIdle ( zephir\CompilationContext $compilationContext ) Traverses temporal variables created in a specific branch marking them as idle
mustGrownStack ( boolean $mustGrownStack ) Return a variable in the symbol table, it will be used for a write operation
resolveVariableToBranch ( $name, $compilationContext )
setLocalContext ( LocalContextPass $localContext ) Sets the local context information

보호된 메소드들

메소드 설명
registerTempVariable ( string $type, string $location, Variable $variable, $compilationContext = null ) Register a variable as temporal
reuseTempVariable ( string $type, string $location, $compilationContext = null ) : Variable Reuse variables marked as idle after leave a branch

메소드 상세

__construct() 공개 메소드

SymbolTable
public __construct ( zephir\CompilationContext $compilationContext )
$compilationContext zephir\CompilationContext

addRawVariable() 공개 메소드

Adds a raw variable to the symbol table (root branch)
public addRawVariable ( Variable $variable ) : Variable
$variable Variable
리턴 Variable

addTemp() 공개 메소드

Creates a temporary variable
public addTemp ( string $type, zephir\CompilationContext $context ) : Variable
$type string
$context zephir\CompilationContext
리턴 Variable

addVariable() 공개 메소드

Adds a variable to the symbol table
public addVariable ( integer $type, string $name, zephir\CompilationContext $compilationContext, mixed $defaultValue = null ) : Variable
$type integer
$name string
$compilationContext zephir\CompilationContext
$defaultValue mixed
리턴 Variable

getExpectedMutations() 공개 메소드

Returns the number of expected mutations for a variable
public getExpectedMutations ( string $variable ) : integer
$variable string
리턴 integer

getLastCallLine() 공개 메소드

Returns the last line where any kind of call was performed within the method This is not necessary related to the symbol table but this information is gathered by the LocalContextPass
public getLastCallLine ( ) : integer
리턴 integer

getLastUnsetLine() 공개 메소드

Returns the last line where an 'unset' operation was made within the current method This is not necessary related to the symbol table but this information is gathered by the LocalContextPass
public getLastUnsetLine ( ) : integer
리턴 integer

getMustGrownStack() 공개 메소드

Returns if the current symbol label must add a memory frame
public getMustGrownStack ( ) : boolean
리턴 boolean

getNextTempVar() 공개 메소드

public getNextTempVar ( $compilationContext = null )

getTempComplexLiteralVariableForWrite() 공개 메소드

Creates a temporary variable to be used in a write operation the body of the variable is freed between iterations instead of request a new full zval variable
public getTempComplexLiteralVariableForWrite ( string $type, zephir\CompilationContext $context ) : Variable
$type string
$context zephir\CompilationContext
리턴 Variable

getTempLocalVariableForWrite() 공개 메소드

Creates a temporary variable to be used in a write operation
public getTempLocalVariableForWrite ( string $type, zephir\CompilationContext $context ) : Variable
$type string
$context zephir\CompilationContext
리턴 Variable

getTempNonTrackedUninitializedVariable() 공개 메소드

Creates a temporary variable to be used in a read-only operation within native-array-access and property-access These kind of variables MUST not be tracked by the Zephir memory manager
public getTempNonTrackedUninitializedVariable ( string $type, zephir\CompilationContext $context ) : Variable
$type string
$context zephir\CompilationContext
리턴 Variable

getTempNonTrackedVariable() 공개 메소드

Creates a temporary variable to be used to point to a heap variable These kind of variables MUST not be tracked by the Zephir memory manager
public getTempNonTrackedVariable ( $type, zephir\CompilationContext $context, boolean $initNonReferenced = false ) : Variable
$type
$context zephir\CompilationContext
$initNonReferenced boolean
리턴 Variable

getTempVariable() 공개 메소드

Returns a temporal variable
public getTempVariable ( string $type, zephir\CompilationContext $compilationContext ) : Variable
$type string
$compilationContext zephir\CompilationContext
리턴 Variable

getTempVariableForObserve() 공개 메소드

Creates a temporary variable to be used as intermediate variable of a read operation Variables are automatically tracked by the memory manager
public getTempVariableForObserve ( string $type, zephir\CompilationContext $context ) : Variable
$type string
$context zephir\CompilationContext
리턴 Variable

getTempVariableForObserveOrNullify() 공개 메소드

Creates a temporary variable to be used as intermediate variable in a call operation Variables are automatically tracked by the memory manager
public getTempVariableForObserveOrNullify ( string $type, zephir\CompilationContext $context ) : Variable
$type string
$context zephir\CompilationContext
리턴 Variable

getTempVariableForWrite() 공개 메소드

Creates a temporary variable to be used in a write operation
public getTempVariableForWrite ( string $type, zephir\CompilationContext $context, $init = true ) : Variable
$type string
$context zephir\CompilationContext
리턴 Variable

getTemporalVariables() 공개 메소드

Returns the temporal variables declared in a given context
public getTemporalVariables ( ) : array
리턴 array

getVariable() 공개 메소드

Returns a variable in the symbol table
public getVariable ( $name, $compilationContext = null ) : Variable | boolean
$name
리턴 Variable | boolean

getVariableForRead() 공개 메소드

Return a variable in the symbol table, it will be used for a read operation
public getVariableForRead ( string $name, zephir\CompilationContext $compilationContext = null, array $statement = null ) : Variable
$name string
$compilationContext zephir\CompilationContext
$statement array
리턴 Variable

getVariableForUpdate() 공개 메소드

Return a variable in the symbol table, it will be used for a mutating operation This method implies mutation of one of the members of the variable but no the variables it self
public getVariableForUpdate ( string $name, zephir\CompilationContext $compilationContext, array $statement = null ) : Variable
$name string
$compilationContext zephir\CompilationContext
$statement array
리턴 Variable

getVariableForWrite() 공개 메소드

Return a variable in the symbol table, it will be used for a write operation Some variables aren't writable themselves but their members do
public getVariableForWrite ( string $name, zephir\CompilationContext $compilationContext, array $statement = null ) : boolean | Variable
$name string
$compilationContext zephir\CompilationContext
$statement array
리턴 boolean | Variable

getVariables() 공개 메소드

Returns all the variables defined in the symbol table
public getVariables ( ) : array
리턴 array

getVariablesByBranch() 공개 메소드

public getVariablesByBranch ( $branchId )

hasVariable() 공개 메소드

Check if a variable is declared in the current symbol table
public hasVariable ( string $name, $compilationContext = null ) : boolean
$name string
리턴 boolean

hasVariableInBranch() 공개 메소드

public hasVariableInBranch ( $name, $compareBranch, $compilationContext = null )

isSuperGlobal() 공개 메소드

Checks if a variable is a superglobal
public isSuperGlobal ( string $name ) : boolean
$name string
리턴 boolean

markTemporalVariablesIdle() 공개 메소드

Traverses temporal variables created in a specific branch marking them as idle
public markTemporalVariablesIdle ( zephir\CompilationContext $compilationContext )
$compilationContext zephir\CompilationContext

mustGrownStack() 공개 메소드

Return a variable in the symbol table, it will be used for a write operation
public mustGrownStack ( boolean $mustGrownStack )
$mustGrownStack boolean

registerTempVariable() 보호된 메소드

Register a variable as temporal
protected registerTempVariable ( string $type, string $location, Variable $variable, $compilationContext = null )
$type string
$location string
$variable Variable

resolveVariableToBranch() 공개 메소드

public resolveVariableToBranch ( $name, $compilationContext )

reuseTempVariable() 보호된 메소드

Reuse variables marked as idle after leave a branch
protected reuseTempVariable ( string $type, string $location, $compilationContext = null ) : Variable
$type string
$location string
리턴 Variable

setLocalContext() 공개 메소드

Sets the local context information
public setLocalContext ( LocalContextPass $localContext )
$localContext Zephir\Passes\LocalContextPass

프로퍼티 상세

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

protected $branchTempVariables

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

protected $branchVariables

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

protected $compilationContext

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

protected LocalContextPass,Zephir\Passes $localContext
리턴 Zephir\Passes\LocalContextPass

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

protected $mustGrownStack

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

protected $tempVarCount