PHP 클래스 Zephir\CompilerFile

This class represents every file compiled in a project Every file may contain a class or an interface
파일 보기 프로젝트 열기: phalcon/zephir 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_aliasManager zephir\AliasManager
$_classDefinition ClassDefinition
$_className
$_compiledFile
$_config zephir\Config
$_external
$_filePath
$_functionDefinitions zephir\FunctionDefinition[]
$_headerCBlocks array
$_ir Original internal representation (IR) of the file
$_logger zephir\Logger
$_namespace Namespace of the
$_originalNode

공개 메소드들

메소드 설명
__construct ( string $className, string $filePath, zephir\Config $config, zephir\Logger $logger ) CompilerFile constructor
addFunction ( Compiler $compiler, zephir\FunctionDefinition $func, array $statement = null ) Adds a function to the function definitions
applyClassHeaders ( zephir\CompilationContext $compilationContext )
checkDependencies ( Compiler $compiler ) Check dependencies
compile ( Compiler $compiler, zephir\StringsManager $stringsManager ) Compiles the file
compileClass ( zephir\CompilationContext $compilationContext, string $namespace, array $classStatement ) Compiles the class/interface contained in the file
compileComment ( zephir\CompilationContext $compilationContext, array $topStatement ) Compiles a comment as a top-level statement
compileFunction ( zephir\CompilationContext $compilationContext, zephir\FunctionDefinition $functionDefinition ) Compiles a function
genIR ( Compiler $compiler ) : array Compiles the file generating a JSON intermediate representation
getClassDefinition ( ) : ClassDefinition
getCompiledFile ( ) : string Returns the path to the compiled file
getFilePath ( ) : string Returns the path to the source file
getFunctionDefinitions ( )
isExternal ( ) : boolean
preCompile ( Compiler $compiler ) Pre-compiles a Zephir file. Generates the IR and perform basic validations
preCompileClass ( zephir\CompilationContext $compilationContext, string $namespace, array $topStatement, array $docblock ) Creates a definition for a class
preCompileInterface ( string $namespace, array $topStatement, array $docblock ) Creates a definition for an interface
setIsExternal ( boolean $external ) Sets if the class belongs to an external dependency or not

보호된 메소드들

메소드 설명
_processShorcuts ( array $property, ClassDefinition $classDefinition ) Creates the property shortcuts
createReturnsType ( array $types ) : array | null
getFullName ( string $name ) : string Transform class/interface name to FQN format

메소드 상세

__construct() 공개 메소드

CompilerFile constructor
public __construct ( string $className, string $filePath, zephir\Config $config, zephir\Logger $logger )
$className string
$filePath string
$config zephir\Config
$logger zephir\Logger

_processShorcuts() 보호된 메소드

Creates the property shortcuts
protected _processShorcuts ( array $property, ClassDefinition $classDefinition )
$property array
$classDefinition ClassDefinition

addFunction() 공개 메소드

Adds a function to the function definitions
public addFunction ( Compiler $compiler, zephir\FunctionDefinition $func, array $statement = null )
$compiler Compiler
$func zephir\FunctionDefinition
$statement array

applyClassHeaders() 공개 메소드

public applyClassHeaders ( zephir\CompilationContext $compilationContext )
$compilationContext zephir\CompilationContext

checkDependencies() 공개 메소드

Check dependencies
public checkDependencies ( Compiler $compiler )
$compiler Compiler

compile() 공개 메소드

Compiles the file
public compile ( Compiler $compiler, zephir\StringsManager $stringsManager )
$compiler Compiler
$stringsManager zephir\StringsManager

compileClass() 공개 메소드

Compiles the class/interface contained in the file
public compileClass ( zephir\CompilationContext $compilationContext, string $namespace, array $classStatement )
$compilationContext zephir\CompilationContext
$namespace string
$classStatement array

compileComment() 공개 메소드

Compiles a comment as a top-level statement
public compileComment ( zephir\CompilationContext $compilationContext, array $topStatement )
$compilationContext zephir\CompilationContext
$topStatement array

compileFunction() 공개 메소드

Compiles a function
public compileFunction ( zephir\CompilationContext $compilationContext, zephir\FunctionDefinition $functionDefinition )
$compilationContext zephir\CompilationContext
$functionDefinition zephir\FunctionDefinition

createReturnsType() 보호된 메소드

protected createReturnsType ( array $types ) : array | null
$types array
리턴 array | null

genIR() 공개 메소드

Compiles the file generating a JSON intermediate representation
public genIR ( Compiler $compiler ) : array
$compiler Compiler
리턴 array

getClassDefinition() 공개 메소드

public getClassDefinition ( ) : ClassDefinition
리턴 ClassDefinition

getCompiledFile() 공개 메소드

Returns the path to the compiled file
public getCompiledFile ( ) : string
리턴 string

getFilePath() 공개 메소드

Returns the path to the source file
public getFilePath ( ) : string
리턴 string

getFullName() 보호된 메소드

Transform class/interface name to FQN format
protected getFullName ( string $name ) : string
$name string
리턴 string

getFunctionDefinitions() 공개 메소드

isExternal() 공개 메소드

public isExternal ( ) : boolean
리턴 boolean

preCompile() 공개 메소드

Pre-compiles a Zephir file. Generates the IR and perform basic validations
public preCompile ( Compiler $compiler )
$compiler Compiler

preCompileClass() 공개 메소드

Creates a definition for a class
public preCompileClass ( zephir\CompilationContext $compilationContext, string $namespace, array $topStatement, array $docblock )
$compilationContext zephir\CompilationContext
$namespace string
$topStatement array
$docblock array

preCompileInterface() 공개 메소드

Creates a definition for an interface
public preCompileInterface ( string $namespace, array $topStatement, array $docblock )
$namespace string
$topStatement array
$docblock array

setIsExternal() 공개 메소드

Sets if the class belongs to an external dependency or not
public setIsExternal ( boolean $external )
$external boolean

프로퍼티 상세

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

protected AliasManager,zephir $_aliasManager
리턴 zephir\AliasManager

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

protected ClassDefinition,zephir $_classDefinition
리턴 ClassDefinition

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

protected $_className

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

protected $_compiledFile

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

protected Config,zephir $_config
리턴 zephir\Config

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

protected $_external

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

protected $_filePath

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

protected FunctionDefinition[],zephir $_functionDefinitions
리턴 zephir\FunctionDefinition[]

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

protected array $_headerCBlocks
리턴 array

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

Original internal representation (IR) of the file
protected $_ir

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

protected Logger,zephir $_logger
리턴 zephir\Logger

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

Namespace of the
protected $_namespace

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

protected $_originalNode