PHP 클래스 Haanga_Generator_PHP

This class takes the generated AST structure (arrays), and generated the PHP represantion.
파일 보기 프로젝트 열기: crodas/haanga

보호된 프로퍼티들

프로퍼티 타입 설명
$ident
$scopeVariableName
$tab

공개 메소드들

메소드 설명
getCode ( array $op_code, $scope ) : string Transform the AST generated by the Haanga_Compiler class and return the equivalent PHP code.
php_comment ( $op ) : string Return code for "comments"
php_function ( $op ) : string Return the function declaration of the class, for now it has fixed params, this should change soon to generate any sort of functions
php_global ( $op ) php_global($op) {{{

보호된 메소드들

메소드 설명
ident ( ) : string Get the string for the current tabulation
php_append_var ( $op ) : string Return code to append something to a variable
php_declare ( $op, $assign = ' =' ) : string Return a variable declaration
php_else ( ) : string Return code for "else"
php_end_block ( ) : string Finish the current block (if, for, function, etc), return the final "}", and decrease $this->ident
php_end_for ( ) : string Return code to end a for
php_end_foreach ( ) : string Return code to end a foreach
php_end_function ( ) : string Return code to end a function
php_end_if ( ) : string Return code to end a if
php_exec ( $op ) : string Return code for a function calling.
php_expr ( $op ) : string Return a stand-alone statement
php_for ( $op )
php_foreach ( $op ) : string Return the declaration of a "foreach" statement.
php_generate_expr ( $expr ) : string Return an expression
php_generate_list ( $array ) : string Return a list of expressions for parameters of a function
php_generate_stmt ( $op, $concat = '.' ) : string Return the representation of a statement
php_get_varname ( mixed $var ) : string Return a variable
php_if ( $op ) : string Return the "if" declaration and increase $this->ident
php_inc ( $op ) : string Return increment a variable ($var++)
php_print ( $op ) : string Return an echo of an stmt
php_return ( $op ) : string Return "return"

메소드 상세

getCode() 최종 공개 메소드

@param array $op_code
final public getCode ( array $op_code, $scope ) : string
$op_code array
리턴 string

ident() 보호된 메소드

@return string
protected ident ( ) : string
리턴 string

php_append_var() 보호된 메소드

@return string
protected php_append_var ( $op ) : string
리턴 string

php_comment() 공개 메소드

@return string
public php_comment ( $op ) : string
리턴 string

php_declare() 보호된 메소드

@return string
protected php_declare ( $op, $assign = ' =' ) : string
리턴 string

php_else() 보호된 메소드

@return string
protected php_else ( ) : string
리턴 string

php_end_block() 보호된 메소드

@return string
protected php_end_block ( ) : string
리턴 string

php_end_for() 보호된 메소드

@return string
protected php_end_for ( ) : string
리턴 string

php_end_foreach() 보호된 메소드

@return string
protected php_end_foreach ( ) : string
리턴 string

php_end_function() 보호된 메소드

@return string
protected php_end_function ( ) : string
리턴 string

php_end_if() 보호된 메소드

@return string
protected php_end_if ( ) : string
리턴 string

php_exec() 보호된 메소드

@return string
protected php_exec ( $op ) : string
리턴 string

php_expr() 보호된 메소드

@return string
protected php_expr ( $op ) : string
리턴 string

php_for() 보호된 메소드

protected php_for ( $op )

php_foreach() 보호된 메소드

@return string
protected php_foreach ( $op ) : string
리턴 string

php_function() 공개 메소드

@return string
public php_function ( $op ) : string
리턴 string

php_generate_expr() 보호된 메소드

@return string
protected php_generate_expr ( $expr ) : string
리턴 string

php_generate_list() 보호된 메소드

@return string
protected php_generate_list ( $array ) : string
리턴 string

php_generate_stmt() 보호된 메소드

@return string
protected php_generate_stmt ( $op, $concat = '.' ) : string
리턴 string

php_get_varname() 보호된 메소드

@param mixed $var
protected php_get_varname ( mixed $var ) : string
$var mixed
리턴 string

php_global() 공개 메소드

php_global($op) {{{
public php_global ( $op )

php_if() 보호된 메소드

@return string
protected php_if ( $op ) : string
리턴 string

php_inc() 보호된 메소드

@return string
protected php_inc ( $op ) : string
리턴 string

php_print() 보호된 메소드

@return string
protected php_print ( $op ) : string
리턴 string

php_return() 보호된 메소드

@return string
protected php_return ( $op ) : string
리턴 string

프로퍼티 상세

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

protected $ident

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

protected $scopeVariableName

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

protected $tab