1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-11-26 20:04:48 +01:00

Add specialized constructors for all expression nodes apart from lambda

This commit is contained in:
nikic 2011-08-11 10:25:51 +02:00
parent f412b3915f
commit e0fe21287d
35 changed files with 677 additions and 216 deletions

View File

@ -351,12 +351,12 @@ function_call_argument_list:
;
non_empty_function_call_argument_list:
expr { init(Expr_FuncCallArg[value: $1, byRef: false]); }
| '&' variable { init(Expr_FuncCallArg[value: $2, byRef: true]); }
expr { init(Expr_FuncCallArg[$1, false]); }
| '&' variable { init(Expr_FuncCallArg[$2, true]); }
| non_empty_function_call_argument_list ',' expr
{ push($1, Expr_FuncCallArg[value: $3, byRef: false]); }
{ push($1, Expr_FuncCallArg[$3, false]); }
| non_empty_function_call_argument_list ',' '&' variable
{ push($1, Expr_FuncCallArg[value: $4, byRef: true]); }
{ push($1, Expr_FuncCallArg[$4, true]); }
;
global_var_list:
@ -447,14 +447,14 @@ for_expr:
expr:
variable { $$ = $1; }
| T_LIST '(' assignment_list ')' '=' expr { $$ = Expr_List[assignList: $3, expr: $6]; }
| T_LIST '(' assignment_list ')' '=' expr { $$ = Expr_List[$3, $6]; }
| variable '=' expr { $$ = Expr_Assign[$1, $3]; }
| variable '=' '&' variable { $$ = Expr_AssignRef[$1, $4]; }
| variable '=' '&' T_NEW class_name_reference ctor_arguments
{ $$ = Expr_Assign[$1, Expr_New[class: $5, args: $6]]; }
{ $$ = Expr_Assign[$1, Expr_New[$5, $6]]; }
/* reference dropped intentially */
| T_NEW class_name_reference ctor_arguments { $$ = Expr_New[class: $2, args: $3]; }
| T_CLONE expr { $$ = Expr_Clone[expr: $2]; }
| T_NEW class_name_reference ctor_arguments { $$ = Expr_New[$2, $3]; }
| T_CLONE expr { $$ = Expr_Clone[$2]; }
| variable T_PLUS_EQUAL expr { $$ = Expr_AssignPlus [$1, $3]; }
| variable T_MINUS_EQUAL expr { $$ = Expr_AssignMinus [$1, $3]; }
| variable T_MUL_EQUAL expr { $$ = Expr_AssignMul [$1, $3]; }
@ -466,10 +466,10 @@ expr:
| variable T_XOR_EQUAL expr { $$ = Expr_AssignBitwiseXor[$1, $3]; }
| variable T_SL_EQUAL expr { $$ = Expr_AssignShiftLeft [$1, $3]; }
| variable T_SR_EQUAL expr { $$ = Expr_AssignShiftRight[$1, $3]; }
| variable T_INC { $$ = Expr_PostInc[var: $1]; }
| T_INC variable { $$ = Expr_PreInc[var: $2]; }
| variable T_DEC { $$ = Expr_PostDec[var: $1]; }
| T_DEC variable { $$ = Expr_PreDec[var: $2]; }
| variable T_INC { $$ = Expr_PostInc[$1]; }
| T_INC variable { $$ = Expr_PreInc [$2]; }
| variable T_DEC { $$ = Expr_PostDec[$1]; }
| T_DEC variable { $$ = Expr_PreDec [$2]; }
| expr T_BOOLEAN_OR expr { $$ = Expr_BooleanOr [$1, $3]; }
| expr T_BOOLEAN_AND expr { $$ = Expr_BooleanAnd[$1, $3]; }
| expr T_LOGICAL_OR expr { $$ = Expr_LogicalOr [$1, $3]; }
@ -486,10 +486,10 @@ expr:
| expr '%' expr { $$ = Expr_Mod [$1, $3]; }
| expr T_SL expr { $$ = Expr_ShiftLeft [$1, $3]; }
| expr T_SR expr { $$ = Expr_ShiftRight[$1, $3]; }
| '+' expr %prec T_INC { $$ = Expr_UnaryPlus[expr: $2]; }
| '-' expr %prec T_INC { $$ = Expr_UnaryMinus[expr: $2]; }
| '!' expr { $$ = Expr_BooleanNot[expr: $2]; }
| '~' expr { $$ = Expr_BitwiseNot[expr: $2]; }
| '+' expr %prec T_INC { $$ = Expr_UnaryPlus [$2]; }
| '-' expr %prec T_INC { $$ = Expr_UnaryMinus[$2]; }
| '!' expr { $$ = Expr_BooleanNot[$2]; }
| '~' expr { $$ = Expr_BitwiseNot[$2]; }
| expr T_IS_IDENTICAL expr { $$ = Expr_Identical [$1, $3]; }
| expr T_IS_NOT_IDENTICAL expr { $$ = Expr_NotIdentical [$1, $3]; }
| expr T_IS_EQUAL expr { $$ = Expr_Equal [$1, $3]; }
@ -500,28 +500,28 @@ expr:
| expr T_IS_GREATER_OR_EQUAL expr { $$ = Expr_GreaterOrEqual[$1, $3]; }
| expr T_INSTANCEOF class_name_reference { $$ = Expr_Instanceof [$1, $3]; }
| '(' expr ')' { $$ = $2; }
| expr '?' expr ':' expr { $$ = Expr_Ternary[cond: $1, if: $3, else: $5]; }
| expr '?' ':' expr { $$ = Expr_Ternary[cond: $1, if: null, else: $4]; }
| T_ISSET '(' variables_list ')' { $$ = Expr_Isset[vars: $3]; }
| T_EMPTY '(' variable ')' { $$ = Expr_Empty[var: $3]; }
| T_INCLUDE expr { $$ = Expr_Include[expr: $2, type: Expr_Include::TYPE_INCLUDE]; }
| T_INCLUDE_ONCE expr { $$ = Expr_Include[expr: $2, type: Expr_Include::TYPE_INCLUDE_ONCE]; }
| T_EVAL '(' expr ')' { $$ = Expr_Eval[expr: $3]; }
| T_REQUIRE expr { $$ = Expr_Include[expr: $2, type: Expr_Include::TYPE_REQUIRE]; }
| T_REQUIRE_ONCE expr { $$ = Expr_Include[expr: $2, type: Expr_Include::TYPE_REQUIRE_ONCE]; }
| T_INT_CAST expr { $$ = Expr_Cast_Int [$2]; }
| T_DOUBLE_CAST expr { $$ = Expr_Cast_Double[$2]; }
| T_STRING_CAST expr { $$ = Expr_Cast_String[$2]; }
| T_ARRAY_CAST expr { $$ = Expr_Cast_Array [$2]; }
| T_OBJECT_CAST expr { $$ = Expr_Cast_Object[$2]; }
| T_BOOL_CAST expr { $$ = Expr_Cast_Bool [$2]; }
| T_UNSET_CAST expr { $$ = Expr_Cast_Unset [$2]; }
| T_EXIT exit_expr { $$ = Expr_Exit[expr: $2]; }
| '@' expr { $$ = Expr_ErrorSuppress[expr: $2]; }
| expr '?' expr ':' expr { $$ = Expr_Ternary[$1, $3, $5]; }
| expr '?' ':' expr { $$ = Expr_Ternary[$1, null, $4]; }
| T_ISSET '(' variables_list ')' { $$ = Expr_Isset[$3]; }
| T_EMPTY '(' variable ')' { $$ = Expr_Empty[$3]; }
| T_INCLUDE expr { $$ = Expr_Include[$2, Expr_Include::TYPE_INCLUDE]; }
| T_INCLUDE_ONCE expr { $$ = Expr_Include[$2, Expr_Include::TYPE_INCLUDE_ONCE]; }
| T_EVAL '(' expr ')' { $$ = Expr_Eval[$3]; }
| T_REQUIRE expr { $$ = Expr_Include[$2, Expr_Include::TYPE_REQUIRE]; }
| T_REQUIRE_ONCE expr { $$ = Expr_Include[$2, Expr_Include::TYPE_REQUIRE_ONCE]; }
| T_INT_CAST expr { $$ = Expr_Cast_Int [$2]; }
| T_DOUBLE_CAST expr { $$ = Expr_Cast_Double [$2]; }
| T_STRING_CAST expr { $$ = Expr_Cast_String [$2]; }
| T_ARRAY_CAST expr { $$ = Expr_Cast_Array [$2]; }
| T_OBJECT_CAST expr { $$ = Expr_Cast_Object [$2]; }
| T_BOOL_CAST expr { $$ = Expr_Cast_Bool [$2]; }
| T_UNSET_CAST expr { $$ = Expr_Cast_Unset [$2]; }
| T_EXIT exit_expr { $$ = Expr_Exit [$2]; }
| '@' expr { $$ = Expr_ErrorSuppress[$2]; }
| scalar { $$ = $1; }
| T_ARRAY '(' array_pair_list ')' { $$ = Expr_Array[$3]; }
| '`' backticks_expr '`' { $$ = Expr_ShellExec[parts: $2]; }
| T_PRINT expr { $$ = Expr_Print[expr: $2]; }
| '`' backticks_expr '`' { $$ = Expr_ShellExec[$2]; }
| T_PRINT expr { $$ = Expr_Print[$2]; }
| T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars '{' inner_statement_list '}'
{ $$ = Expr_LambdaFunc[byRef: $2, params: $4, useVars: $6, stmts: $8]; }
;
@ -533,34 +533,34 @@ lexical_vars:
lexical_var_list:
lexical_var_list ',' optional_ref T_VARIABLE
{ push($1, Expr_LambdaFuncUse[var: parseVar($4), byRef: $3]); }
{ push($1, Expr_LambdaFuncUse[parseVar($4), $3]); }
| optional_ref T_VARIABLE
{ init(Expr_LambdaFuncUse[var: parseVar($2), byRef: $1]); }
{ init(Expr_LambdaFuncUse[parseVar($2), $1]); }
;
function_call:
name '(' function_call_argument_list ')' { $$ = Expr_FuncCall[func: $1, args: $3]; }
name '(' function_call_argument_list ')' { $$ = Expr_FuncCall[$1, $3]; }
| class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING '(' function_call_argument_list ')'
{ $$ = Expr_StaticCall[class: $1, func: $3, args: $5]; }
{ $$ = Expr_StaticCall[$1, $3, $5]; }
| reference_variable T_PAAMAYIM_NEKUDOTAYIM T_STRING '(' function_call_argument_list ')'
{ $$ = Expr_StaticCall[class: $1, func: $3, args: $5]; }
{ $$ = Expr_StaticCall[$1, $3, $5]; }
| static_property_with_arrays '(' function_call_argument_list ')' {
if ($1 instanceof PHPParser_Node_Expr_StaticPropertyFetch) {
$$ = Expr_StaticCall[class: $1->class, func: $1->name, args: $3];
$$ = Expr_StaticCall[$1->class, $1->name, $3];
} elseif ($1 instanceof PHPParser_Node_Expr_ArrayDimFetch) {
$tmp = $1;
while ($tmp->var instanceof PHPParser_Node_Expr_ArrayDimFetch) {
$tmp = $tmp->var;
}
$$ = Expr_StaticCall[class: $tmp->var->class, func: $1, args: $3];
$$ = Expr_StaticCall[$tmp->var->class, $1, $3];
$tmp->var = Variable[$tmp->var->name];
} else {
throw new Exception;
}
}
| variable_without_objects '(' function_call_argument_list ')'
{ $$ = Expr_FuncCall[func: $1, args: $3]; }
{ $$ = Expr_FuncCall[$1, $3]; }
;
class_name:
@ -586,9 +586,9 @@ dynamic_class_name_reference:
object_access_for_dcnr:
| base_variable T_OBJECT_OPERATOR object_property
{ $$ = Expr_PropertyFetch[var: $1, name: $3]; }
{ $$ = Expr_PropertyFetch[$1, $3]; }
| object_access_for_dcnr T_OBJECT_OPERATOR object_property
{ $$ = Expr_PropertyFetch[var: $1, name: $3]; }
{ $$ = Expr_PropertyFetch[$1, $3]; }
| object_access_for_dcnr '[' dim_offset ']' { $$ = Expr_ArrayDimFetch[$1, $3]; }
| object_access_for_dcnr '{' expr '}' { $$ = Expr_ArrayDimFetch[$1, $3]; }
;
@ -629,17 +629,17 @@ common_scalar:
static_scalar: /* compile-time evaluated scalars */
common_scalar { $$ = $1; }
| name { $$ = Expr_ConstFetch[name: $1]; }
| '+' static_scalar { $$ = Expr_UnaryPlus[expr: $2]; }
| '-' static_scalar { $$ = Expr_UnaryMinus[expr: $2]; }
| name { $$ = Expr_ConstFetch[$1]; }
| '+' static_scalar { $$ = Expr_UnaryPlus[$2]; }
| '-' static_scalar { $$ = Expr_UnaryMinus[$2]; }
| T_ARRAY '(' static_array_pair_list ')' { $$ = Expr_Array[$3]; }
| class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { $$ = Expr_ClassConstFetch[class: $1, name: $3]; }
| class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { $$ = Expr_ClassConstFetch[$1, $3]; }
;
scalar:
T_STRING_VARNAME { $$ = Scalar_String[$1]; }
| class_constant { $$ = $1; }
| name { $$ = Expr_ConstFetch[name: $1]; }
| name { $$ = Expr_ConstFetch[$1]; }
| common_scalar { $$ = $1; }
| '"' encaps_list '"' { $$ = Scalar_Encapsed[$2]; }
| T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = Scalar_Encapsed[$2]; }
@ -674,14 +674,13 @@ variable:
object_access:
object_access_arrayable { $$ = $1; }
| object_access_arrayable '(' function_call_argument_list ')'
{ $$ = Expr_FuncCall[func: $1, args: $3]; }
{ $$ = Expr_FuncCall[$1, $3]; }
| variable T_OBJECT_OPERATOR object_property '(' function_call_argument_list ')'
{ $$ = Expr_MethodCall[var: $1, name: $3, args: $5]; }
{ $$ = Expr_MethodCall[$1, $3, $5]; }
;
object_access_arrayable:
variable T_OBJECT_OPERATOR object_property
{ $$ = Expr_PropertyFetch[var: $1, name: $3]; }
variable T_OBJECT_OPERATOR object_property { $$ = Expr_PropertyFetch[$1, $3]; }
| object_access_arrayable '[' dim_offset ']' { $$ = Expr_ArrayDimFetch[$1, $3]; }
| object_access_arrayable '{' expr '}' { $$ = Expr_ArrayDimFetch[$1, $3]; }
;
@ -694,21 +693,21 @@ variable_without_objects:
base_variable:
variable_without_objects { $$ = $1; }
| class_name T_PAAMAYIM_NEKUDOTAYIM '$' reference_variable
{ $$ = Expr_StaticPropertyFetch[class: $1, name: $4]; }
{ $$ = Expr_StaticPropertyFetch[$1, $4]; }
| reference_variable T_PAAMAYIM_NEKUDOTAYIM '$' reference_variable
{ $$ = Expr_StaticPropertyFetch[class: $1, name: $4]; }
{ $$ = Expr_StaticPropertyFetch[$1, $4]; }
| static_property_with_arrays { $$ = $1; }
;
static_property_with_arrays:
class_name T_PAAMAYIM_NEKUDOTAYIM T_VARIABLE
{ $$ = Expr_StaticPropertyFetch[class: $1, name: parseVar($3)]; }
{ $$ = Expr_StaticPropertyFetch[$1, parseVar($3)]; }
| reference_variable T_PAAMAYIM_NEKUDOTAYIM T_VARIABLE
{ $$ = Expr_StaticPropertyFetch[class: $1, name: parseVar($3)]; }
{ $$ = Expr_StaticPropertyFetch[$1, parseVar($3)]; }
| class_name T_PAAMAYIM_NEKUDOTAYIM '$' '{' expr '}'
{ $$ = Expr_StaticPropertyFetch[class: $1, name: $5]; }
{ $$ = Expr_StaticPropertyFetch[$1, $5]; }
| reference_variable T_PAAMAYIM_NEKUDOTAYIM '$' '{' expr '}'
{ $$ = Expr_StaticPropertyFetch[class: $1, name: $5]; }
{ $$ = Expr_StaticPropertyFetch[$1, $5]; }
| static_property_with_arrays '[' dim_offset ']' { $$ = Expr_ArrayDimFetch[$1, $3]; }
| static_property_with_arrays '{' expr '}' { $$ = Expr_ArrayDimFetch[$1, $3]; }
;
@ -769,7 +768,7 @@ encaps_list:
encaps_var:
T_VARIABLE { $$ = Variable[parseVar($1)]; }
| T_VARIABLE '[' encaps_var_offset ']' { $$ = Expr_ArrayDimFetch[Variable[parseVar($1)], $3]; }
| T_VARIABLE T_OBJECT_OPERATOR T_STRING { $$ = Expr_PropertyFetch[var: Variable[parseVar($1)], name: $3]; }
| T_VARIABLE T_OBJECT_OPERATOR T_STRING { $$ = Expr_PropertyFetch[Variable[parseVar($1)], $3]; }
| T_DOLLAR_OPEN_CURLY_BRACES expr '}' { $$ = Variable[$2]; }
| T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}'
{ $$ = Expr_ArrayDimFetch[Variable[$2], $4]; }
@ -783,8 +782,8 @@ encaps_var_offset:
;
class_constant:
class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { $$ = Expr_ClassConstFetch[class: $1, name: $3]; }
| reference_variable T_PAAMAYIM_NEKUDOTAYIM T_STRING { $$ = Expr_ClassConstFetch[class: $1, name: $3]; }
class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { $$ = Expr_ClassConstFetch[$1, $3]; }
| reference_variable T_PAAMAYIM_NEKUDOTAYIM T_STRING { $$ = Expr_ClassConstFetch[$1, $3]; }
;
%%

View File

@ -5,4 +5,19 @@
*/
class PHPParser_Node_Expr_BitwiseNot extends PHPParser_Node_Expr
{
/**
* Constructs a bitwise not node.
*
* @param PHPParser_Node_Expr $expr Expression
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct(PHPParser_Node_Expr $expr, $line = -1, $docComment = null) {
parent::__construct(
array(
'expr' => $expr
),
$line, $docComment
);
}
}

View File

@ -5,4 +5,19 @@
*/
class PHPParser_Node_Expr_BooleanNot extends PHPParser_Node_Expr
{
/**
* Constructs a boolean not node.
*
* @param PHPParser_Node_Expr $expr Expression
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct(PHPParser_Node_Expr $expr, $line = -1, $docComment = null) {
parent::__construct(
array(
'expr' => $expr
),
$line, $docComment
);
}
}

View File

@ -1,9 +1,26 @@
<?php
/**
* @property string|Expr_Name $class class
* @property string $name Name of constant
* @property string|PHPParser_Expr_Name $class Class name
* @property string $name Constant name
*/
class PHPParser_Node_Expr_ClassConstFetch extends PHPParser_Node_Expr
{
/**
* Constructs a class const fetch node.
*
* @param string|PHPParser_Expr_Name $class Class name
* @param string $name Constant name
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct($class, $name, $line = -1, $docComment = null) {
parent::__construct(
array(
'class' => $class,
'name' => $name
),
$line, $docComment
);
}
}

View File

@ -5,4 +5,19 @@
*/
class PHPParser_Node_Expr_Clone extends PHPParser_Node_Expr
{
/**
* Constructs a clone node.
*
* @param PHPParser_Node_Expr $expr Expression
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct(PHPParser_Node_Expr $expr, $line = -1, $docComment = null) {
parent::__construct(
array(
'expr' => $expr
),
$line, $docComment
);
}
}

View File

@ -1,8 +1,23 @@
<?php
/**
* @property PHPParser_Node_Name $name Name of constant
* @property PHPParser_Node_Name $name Constant name
*/
class PHPParser_Node_Expr_ConstFetch extends PHPParser_Node_Expr
{
/**
* Constructs a const fetch node.
*
* @param PHPParser_Node_Name $name Constant name
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct(PHPParser_Node_Name $name, $line = -1, $docComment = null) {
parent::__construct(
array(
'name' => $name
),
$line, $docComment
);
}
}

View File

@ -1,8 +1,23 @@
<?php
/**
* @property PHPParser_Node_Variable $var Variable
* @property PHPParser_Node_Expr $var Variable
*/
class PHPParser_Node_Expr_Empty extends PHPParser_Node_Expr
{
/**
* Constructs an empty() node.
*
* @param PHPParser_Node_Expr $var Variable
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct(PHPParser_Node_Expr $var, $line = -1, $docComment = null) {
parent::__construct(
array(
'var' => $var
),
$line, $docComment
);
}
}

View File

@ -5,4 +5,19 @@
*/
class PHPParser_Node_Expr_ErrorSuppress extends PHPParser_Node_Expr
{
/**
* Constructs an error suppress node.
*
* @param PHPParser_Node_Expr $expr Expression
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct(PHPParser_Node_Expr $expr, $line = -1, $docComment = null) {
parent::__construct(
array(
'expr' => $expr
),
$line, $docComment
);
}
}

View File

@ -5,4 +5,19 @@
*/
class PHPParser_Node_Expr_Eval extends PHPParser_Node_Expr
{
/**
* Constructs an eval() node.
*
* @param PHPParser_Node_Expr $expr Expression
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct(PHPParser_Node_Expr $expr, $line = -1, $docComment = null) {
parent::__construct(
array(
'expr' => $expr
),
$line, $docComment
);
}
}

View File

@ -5,4 +5,19 @@
*/
class PHPParser_Node_Expr_Exit extends PHPParser_Node_Expr
{
/**
* Constructs an exit() node.
*
* @param null|PHPParser_Node_Expr $expr Expression
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct($expr = null, $line = -1, $docComment = null) {
parent::__construct(
array(
'expr' => $expr
),
$line, $docComment
);
}
}

View File

@ -1,9 +1,26 @@
<?php
/**
* @property PHPParser_Node_Name $func Name of function
* @property array $args Arguments
* @property PHPParser_Node_Name|PHPParser_Node_Expr $name Function name
* @property PHPParser_Node_Expr_FuncCallArg[] $args Arguments
*/
class PHPParser_Node_Expr_FuncCall extends PHPParser_Node_Expr
{
/**
* Constructs a function call node.
*
* @param PHPParser_Node_Name|PHPParser_Node_Expr $name Function name
* @param PHPParser_Node_Expr_FuncCallArg[] $args Arguments
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct($name, array $args = array(), $line = -1, $docComment = null) {
parent::__construct(
array(
'name' => $name,
'args' => $args
),
$line, $docComment
);
}
}

View File

@ -2,8 +2,25 @@
/**
* @property PHPParser_Node_Expr $value Value to pass
* @property bool $byRef Whether to pass by ref
* @property bool $byRef Whether to pass by ref
*/
class PHPParser_Node_Expr_FuncCallArg extends PHPParser_Node_Expr
{
/**
* Constructs a function call argument node.
*
* @param PHPParser_Node_Expr $value Value to pass
* @param bool $byRef Whether to pass by ref
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct(PHPParser_Node_Expr $value, $byRef = false, $line = -1, $docComment = null) {
parent::__construct(
array(
'value' => $value,
'byRef' => $byRef
),
$line, $docComment
);
}
}

View File

@ -2,7 +2,7 @@
/**
* @property PHPParser_Node_Expr $expr Expression
* @property int $type Type of include
* @property int $type Type of include
*/
class PHPParser_Node_Expr_Include extends PHPParser_Node_Expr
{
@ -10,4 +10,22 @@ class PHPParser_Node_Expr_Include extends PHPParser_Node_Expr
const TYPE_INCLUDE_ONCE = 2;
const TYPE_REQUIRE = 3;
const TYPE_REQUIRE_ONCE = 4;
/**
* Constructs an include node.
*
* @param PHPParser_Node_Expr $expr Expression
* @param int $type Type of include
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct(PHPParser_Node_Expr $expr, $type, $line = -1, $docComment = null) {
parent::__construct(
array(
'expr' => $expr,
'type' => $type
),
$line, $docComment
);
}
}

View File

@ -1,8 +1,23 @@
<?php
/**
* @property array $vars Variables
* @property PHPParser_Node_Expr[] $vars Variables
*/
class PHPParser_Node_Expr_Isset extends PHPParser_Node_Expr
{
/**
* Constructs an array node.
*
* @param PHPParser_Node_Expr[] $vars Variables
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct(array $vars, $line = -1, $docComment = null) {
parent::__construct(
array(
'vars' => $vars
),
$line, $docComment
);
}
}

View File

@ -6,4 +6,21 @@
*/
class PHPParser_Node_Expr_LambdaFuncUse extends PHPParser_Node_Expr
{
/**
* Constructs a closure use node.
*
* @param string $var Name of variable
* @param bool $byRef Whether to use by reference
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct($var, $byRef = false, $line = -1, $docComment = null) {
parent::__construct(
array(
'var' => $var,
'byRef' => $byRef
),
$line, $docComment
);
}
}

View File

@ -1,9 +1,26 @@
<?php
/**
* @property array $assignList List of variables to assign to
* @property array $assignList List of variables to assign to
* @property PHPParser_Node_Expr $expr Expression
*/
class PHPParser_Node_Expr_List extends PHPParser_Node_Expr
{
/**
* Constructs a list() assignment node.
*
* @param array $assignList List of variables to assign to
* @param PHPParser_Node_Expr $expr Expression
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct(array $assignList, PHPParser_Node_Expr $expr, $line = -1, $docComment = null) {
parent::__construct(
array(
'assignList' => $assignList,
'expr' => $expr
),
$line, $docComment
);
}
}

View File

@ -1,10 +1,29 @@
<?php
/**
* @property PHPParser_Node_Variable $var Variable holding object
* @property string|PHPParser_Node_Expr $name Name
* @property array $args Arguments
* @property PHPParser_Node_Expr $var Variable holding object
* @property string|PHPParser_Node_Expr $name Method name
* @property PHPParser_Node_Expr_FuncCallArg[] $args Arguments
*/
class PHPParser_Node_Expr_MethodCall extends PHPParser_Node_Expr
{
/**
* Constructs a function call node.
*
* @param PHPParser_Node_Expr $var Variable holding object
* @param string|PHPParser_Node_Name $name Method name
* @param PHPParser_Node_Expr_FuncCallArg[] $args Arguments
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct(PHPParser_Node_Expr $var, $name, array $args = array(), $line = -1, $docComment = null) {
parent::__construct(
array(
'var' => $var,
'name' => $name,
'args' => $args
),
$line, $docComment
);
}
}

View File

@ -1,9 +1,26 @@
<?php
/**
* @property PHPParser_Node_Name $class Class
* @property array $args Arguments
* @property string|PHPParser_Node_Name $class Class name
* @property PHPParser_Node_Expr_FuncCallArg[] $args Arguments
*/
class PHPParser_Node_Expr_New extends PHPParser_Node_Expr
{
/**
* Constructs a function call node.
*
* @param string|PHPParser_Node_Name $class Class name
* @param PHPParser_Node_Expr_FuncCallArg[] $args Arguments
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct($class, array $args = array(), $line = -1, $docComment = null) {
parent::__construct(
array(
'class' => $class,
'args' => $args
),
$line, $docComment
);
}
}

View File

@ -5,4 +5,19 @@
*/
class PHPParser_Node_Expr_PostDec extends PHPParser_Node_Expr
{
/**
* Constructs a post decrement node.
*
* @param PHPParser_Node_Expr $var Variable
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct(PHPParser_Node_Expr $var, $line = -1, $docComment = null) {
parent::__construct(
array(
'var' => $var
),
$line, $docComment
);
}
}

View File

@ -5,4 +5,19 @@
*/
class PHPParser_Node_Expr_PostInc extends PHPParser_Node_Expr
{
/**
* Constructs a post increment node.
*
* @param PHPParser_Node_Expr $var Variable
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct(PHPParser_Node_Expr $var, $line = -1, $docComment = null) {
parent::__construct(
array(
'var' => $var
),
$line, $docComment
);
}
}

View File

@ -5,4 +5,19 @@
*/
class PHPParser_Node_Expr_PreDec extends PHPParser_Node_Expr
{
/**
* Constructs a pre decrement node.
*
* @param PHPParser_Node_Expr $var Variable
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct(PHPParser_Node_Expr $var, $line = -1, $docComment = null) {
parent::__construct(
array(
'var' => $var
),
$line, $docComment
);
}
}

View File

@ -5,4 +5,19 @@
*/
class PHPParser_Node_Expr_PreInc extends PHPParser_Node_Expr
{
/**
* Constructs a pre increment node.
*
* @param PHPParser_Node_Expr $var Variable
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct(PHPParser_Node_Expr $var, $line = -1, $docComment = null) {
parent::__construct(
array(
'var' => $var
),
$line, $docComment
);
}
}

View File

@ -5,4 +5,19 @@
*/
class PHPParser_Node_Expr_Print extends PHPParser_Node_Expr
{
/**
* Constructs an print() node.
*
* @param PHPParser_Node_Expr $expr Expression
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct(PHPParser_Node_Expr $expr, $line = -1, $docComment = null) {
parent::__construct(
array(
'expr' => $expr
),
$line, $docComment
);
}
}

View File

@ -1,9 +1,26 @@
<?php
/**
* @property PHPParser_Node_Variable $var Variable holding object
* @property string|PHPParser_Node_Expr|PHPParser_Node_Variable $name Name
* @property PHPParser_Node_Expr $var Variable holding object
* @property string|PHPParser_Node_Expr $name Property Name
*/
class PHPParser_Node_Expr_PropertyFetch extends PHPParser_Node_Expr
{
/**
* Constructs a function call node.
*
* @param PHPParser_Node_Expr $var Variable holding object
* @param string|PHPParser_Node_Expr $name Property name
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct(PHPParser_Node_Expr $var, $name, $line = -1, $docComment = null) {
parent::__construct(
array(
'var' => $var,
'name' => $name
),
$line, $docComment
);
}
}

View File

@ -5,4 +5,19 @@
*/
class PHPParser_Node_Expr_ShellExec extends PHPParser_Node_Expr
{
/**
* Constructs a shell exec (backtick) node.
*
* @param array $parts Encapsed string array
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct($parts, $line = -1, $docComment = null) {
parent::__construct(
array(
'parts' => $parts
),
$line, $docComment
);
}
}

View File

@ -1,10 +1,29 @@
<?php
/**
* @property PHPParser_Node_Name|PHPParser_Node_Variable $class Class name
* @property string|PHPParser_Node_Variable $func Method name
* @property array $args Arguments
* @property PHPParser_Node_Name|PHPParser_Node_Expr $class Class name
* @property string|PHPParser_Node_Expr $name Method name
* @property PHPParser_Node_Expr_FuncCallArg[] $args Arguments
*/
class PHPParser_Node_Expr_StaticCall extends PHPParser_Node_Expr
{
/**
* Constructs a static method call node.
*
* @param PHPParser_Node_Name|PHPParser_Node_Expr $class Class name
* @param string|PHPParser_Node_Name $name Method name
* @param PHPParser_Node_Expr_FuncCallArg[] $args Arguments
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct($class, $name, array $args = array(), $line = -1, $docComment = null) {
parent::__construct(
array(
'class' => $class,
'name' => $name,
'args' => $args
),
$line, $docComment
);
}
}

View File

@ -1,9 +1,26 @@
<?php
/**
* @property PHPParser_Node_Expr $class Class name
* @property string|PHPParser_Node_Expr $name Name
* @property PHPParser_Node_Name|PHPParser_Node_Expr $class Class name
* @property string|PHPParser_Node_Expr $name Property name
*/
class PHPParser_Node_Expr_StaticPropertyFetch extends PHPParser_Node_Expr
{
/**
* Constructs a static property fetch node.
*
* @param PHPParser_Node_Name|PHPParser_Node_Expr $class Class name
* @param string|PHPParser_Node_Name $name Property name
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct($class, $name, $line = -1, $docComment = null) {
parent::__construct(
array(
'class' => $class,
'name' => $name
),
$line, $docComment
);
}
}

View File

@ -7,4 +7,23 @@
*/
class PHPParser_Node_Expr_Ternary extends PHPParser_Node_Expr
{
/**
* Constructs a ternary operator node.
*
* @param PHPParser_Node_Expr $cond Condition
* @param null|PHPParser_Node_Expr $if Expression for true
* @param PHPParser_Node_Expr $else Expression for false
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct(PHPParser_Node_Expr $cond, $if, PHPParser_Node_Expr $else, $line = -1, $docComment = null) {
parent::__construct(
array(
'cond' => $cond,
'if' => $if,
'else' => $else
),
$line, $docComment
);
}
}

View File

@ -5,4 +5,19 @@
*/
class PHPParser_Node_Expr_UnaryMinus extends PHPParser_Node_Expr
{
/**
* Constructs a unary minus node.
*
* @param PHPParser_Node_Expr $expr Expression
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct(PHPParser_Node_Expr $expr, $line = -1, $docComment = null) {
parent::__construct(
array(
'expr' => $expr
),
$line, $docComment
);
}
}

View File

@ -5,4 +5,19 @@
*/
class PHPParser_Node_Expr_UnaryPlus extends PHPParser_Node_Expr
{
/**
* Constructs a unary plus node.
*
* @param PHPParser_Node_Expr $expr Expression
* @param int $line Line
* @param null|string $docComment Nearest doc comment
*/
public function __construct(PHPParser_Node_Expr $expr, $line = -1, $docComment = null) {
parent::__construct(
array(
'expr' => $expr
),
$line, $docComment
);
}
}

View File

@ -1451,19 +1451,19 @@ class PHPParser_Parser
}
private function yyn117($line, $docComment) {
$this->yyval = array(new PHPParser_Node_Expr_FuncCallArg(array('value' => $this->yyastk[$this->yysp-(1-1)], 'byRef' => false), $line, $docComment));
$this->yyval = array(new PHPParser_Node_Expr_FuncCallArg($this->yyastk[$this->yysp-(1-1)], false, $line, $docComment));
}
private function yyn118($line, $docComment) {
$this->yyval = array(new PHPParser_Node_Expr_FuncCallArg(array('value' => $this->yyastk[$this->yysp-(2-2)], 'byRef' => true), $line, $docComment));
$this->yyval = array(new PHPParser_Node_Expr_FuncCallArg($this->yyastk[$this->yysp-(2-2)], true, $line, $docComment));
}
private function yyn119($line, $docComment) {
$this->yyastk[$this->yysp-(3-1)][] = new PHPParser_Node_Expr_FuncCallArg(array('value' => $this->yyastk[$this->yysp-(3-3)], 'byRef' => false), $line, $docComment); $this->yyval = $this->yyastk[$this->yysp-(3-1)];
$this->yyastk[$this->yysp-(3-1)][] = new PHPParser_Node_Expr_FuncCallArg($this->yyastk[$this->yysp-(3-3)], false, $line, $docComment); $this->yyval = $this->yyastk[$this->yysp-(3-1)];
}
private function yyn120($line, $docComment) {
$this->yyastk[$this->yysp-(4-1)][] = new PHPParser_Node_Expr_FuncCallArg(array('value' => $this->yyastk[$this->yysp-(4-4)], 'byRef' => true), $line, $docComment); $this->yyval = $this->yyastk[$this->yysp-(4-1)];
$this->yyastk[$this->yysp-(4-1)][] = new PHPParser_Node_Expr_FuncCallArg($this->yyastk[$this->yysp-(4-4)], true, $line, $docComment); $this->yyval = $this->yyastk[$this->yysp-(4-1)];
}
private function yyn121($line, $docComment) {
@ -1623,7 +1623,7 @@ class PHPParser_Parser
}
private function yyn160($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_List(array('assignList' => $this->yyastk[$this->yysp-(6-3)], 'expr' => $this->yyastk[$this->yysp-(6-6)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_List($this->yyastk[$this->yysp-(6-3)], $this->yyastk[$this->yysp-(6-6)], $line, $docComment);
}
private function yyn161($line, $docComment) {
@ -1635,15 +1635,15 @@ class PHPParser_Parser
}
private function yyn163($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Assign($this->yyastk[$this->yysp-(6-1)], new PHPParser_Node_Expr_New(array('class' => $this->yyastk[$this->yysp-(6-5)], 'args' => $this->yyastk[$this->yysp-(6-6)]), $line, $docComment), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Assign($this->yyastk[$this->yysp-(6-1)], new PHPParser_Node_Expr_New($this->yyastk[$this->yysp-(6-5)], $this->yyastk[$this->yysp-(6-6)], $line, $docComment), $line, $docComment);
}
private function yyn164($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_New(array('class' => $this->yyastk[$this->yysp-(3-2)], 'args' => $this->yyastk[$this->yysp-(3-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_New($this->yyastk[$this->yysp-(3-2)], $this->yyastk[$this->yysp-(3-3)], $line, $docComment);
}
private function yyn165($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Clone(array('expr' => $this->yyastk[$this->yysp-(2-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Clone($this->yyastk[$this->yysp-(2-2)], $line, $docComment);
}
private function yyn166($line, $docComment) {
@ -1691,19 +1691,19 @@ class PHPParser_Parser
}
private function yyn177($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_PostInc(array('var' => $this->yyastk[$this->yysp-(2-1)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_PostInc($this->yyastk[$this->yysp-(2-1)], $line, $docComment);
}
private function yyn178($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_PreInc(array('var' => $this->yyastk[$this->yysp-(2-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_PreInc($this->yyastk[$this->yysp-(2-2)], $line, $docComment);
}
private function yyn179($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_PostDec(array('var' => $this->yyastk[$this->yysp-(2-1)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_PostDec($this->yyastk[$this->yysp-(2-1)], $line, $docComment);
}
private function yyn180($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_PreDec(array('var' => $this->yyastk[$this->yysp-(2-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_PreDec($this->yyastk[$this->yysp-(2-2)], $line, $docComment);
}
private function yyn181($line, $docComment) {
@ -1771,19 +1771,19 @@ class PHPParser_Parser
}
private function yyn197($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_UnaryPlus(array('expr' => $this->yyastk[$this->yysp-(2-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_UnaryPlus($this->yyastk[$this->yysp-(2-2)], $line, $docComment);
}
private function yyn198($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_UnaryMinus(array('expr' => $this->yyastk[$this->yysp-(2-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_UnaryMinus($this->yyastk[$this->yysp-(2-2)], $line, $docComment);
}
private function yyn199($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_BooleanNot(array('expr' => $this->yyastk[$this->yysp-(2-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_BooleanNot($this->yyastk[$this->yysp-(2-2)], $line, $docComment);
}
private function yyn200($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_BitwiseNot(array('expr' => $this->yyastk[$this->yysp-(2-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_BitwiseNot($this->yyastk[$this->yysp-(2-2)], $line, $docComment);
}
private function yyn201($line, $docComment) {
@ -1827,39 +1827,39 @@ class PHPParser_Parser
}
private function yyn211($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Ternary(array('cond' => $this->yyastk[$this->yysp-(5-1)], 'if' => $this->yyastk[$this->yysp-(5-3)], 'else' => $this->yyastk[$this->yysp-(5-5)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Ternary($this->yyastk[$this->yysp-(5-1)], $this->yyastk[$this->yysp-(5-3)], $this->yyastk[$this->yysp-(5-5)], $line, $docComment);
}
private function yyn212($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Ternary(array('cond' => $this->yyastk[$this->yysp-(4-1)], 'if' => null, 'else' => $this->yyastk[$this->yysp-(4-4)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Ternary($this->yyastk[$this->yysp-(4-1)], null, $this->yyastk[$this->yysp-(4-4)], $line, $docComment);
}
private function yyn213($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Isset(array('vars' => $this->yyastk[$this->yysp-(4-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Isset($this->yyastk[$this->yysp-(4-3)], $line, $docComment);
}
private function yyn214($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Empty(array('var' => $this->yyastk[$this->yysp-(4-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Empty($this->yyastk[$this->yysp-(4-3)], $line, $docComment);
}
private function yyn215($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Include(array('expr' => $this->yyastk[$this->yysp-(2-2)], 'type' => PHPParser_Node_Expr_Include::TYPE_INCLUDE), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Include($this->yyastk[$this->yysp-(2-2)], PHPParser_Node_Expr_Include::TYPE_INCLUDE, $line, $docComment);
}
private function yyn216($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Include(array('expr' => $this->yyastk[$this->yysp-(2-2)], 'type' => PHPParser_Node_Expr_Include::TYPE_INCLUDE_ONCE), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Include($this->yyastk[$this->yysp-(2-2)], PHPParser_Node_Expr_Include::TYPE_INCLUDE_ONCE, $line, $docComment);
}
private function yyn217($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Eval(array('expr' => $this->yyastk[$this->yysp-(4-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Eval($this->yyastk[$this->yysp-(4-3)], $line, $docComment);
}
private function yyn218($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Include(array('expr' => $this->yyastk[$this->yysp-(2-2)], 'type' => PHPParser_Node_Expr_Include::TYPE_REQUIRE), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Include($this->yyastk[$this->yysp-(2-2)], PHPParser_Node_Expr_Include::TYPE_REQUIRE, $line, $docComment);
}
private function yyn219($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Include(array('expr' => $this->yyastk[$this->yysp-(2-2)], 'type' => PHPParser_Node_Expr_Include::TYPE_REQUIRE_ONCE), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Include($this->yyastk[$this->yysp-(2-2)], PHPParser_Node_Expr_Include::TYPE_REQUIRE_ONCE, $line, $docComment);
}
private function yyn220($line, $docComment) {
@ -1891,11 +1891,11 @@ class PHPParser_Parser
}
private function yyn227($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Exit(array('expr' => $this->yyastk[$this->yysp-(2-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Exit($this->yyastk[$this->yysp-(2-2)], $line, $docComment);
}
private function yyn228($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_ErrorSuppress(array('expr' => $this->yyastk[$this->yysp-(2-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_ErrorSuppress($this->yyastk[$this->yysp-(2-2)], $line, $docComment);
}
private function yyn229($line, $docComment) {
@ -1907,11 +1907,11 @@ class PHPParser_Parser
}
private function yyn231($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_ShellExec(array('parts' => $this->yyastk[$this->yysp-(3-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_ShellExec($this->yyastk[$this->yysp-(3-2)], $line, $docComment);
}
private function yyn232($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Print(array('expr' => $this->yyastk[$this->yysp-(2-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Print($this->yyastk[$this->yysp-(2-2)], $line, $docComment);
}
private function yyn233($line, $docComment) {
@ -1927,36 +1927,36 @@ class PHPParser_Parser
}
private function yyn236($line, $docComment) {
$this->yyastk[$this->yysp-(4-1)][] = new PHPParser_Node_Expr_LambdaFuncUse(array('var' => substr($this->yyastk[$this->yysp-(4-4)], 1), 'byRef' => $this->yyastk[$this->yysp-(4-3)]), $line, $docComment); $this->yyval = $this->yyastk[$this->yysp-(4-1)];
$this->yyastk[$this->yysp-(4-1)][] = new PHPParser_Node_Expr_LambdaFuncUse(substr($this->yyastk[$this->yysp-(4-4)], 1), $this->yyastk[$this->yysp-(4-3)], $line, $docComment); $this->yyval = $this->yyastk[$this->yysp-(4-1)];
}
private function yyn237($line, $docComment) {
$this->yyval = array(new PHPParser_Node_Expr_LambdaFuncUse(array('var' => substr($this->yyastk[$this->yysp-(2-2)], 1), 'byRef' => $this->yyastk[$this->yysp-(2-1)]), $line, $docComment));
$this->yyval = array(new PHPParser_Node_Expr_LambdaFuncUse(substr($this->yyastk[$this->yysp-(2-2)], 1), $this->yyastk[$this->yysp-(2-1)], $line, $docComment));
}
private function yyn238($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_FuncCall(array('func' => $this->yyastk[$this->yysp-(4-1)], 'args' => $this->yyastk[$this->yysp-(4-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_FuncCall($this->yyastk[$this->yysp-(4-1)], $this->yyastk[$this->yysp-(4-3)], $line, $docComment);
}
private function yyn239($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_StaticCall(array('class' => $this->yyastk[$this->yysp-(6-1)], 'func' => $this->yyastk[$this->yysp-(6-3)], 'args' => $this->yyastk[$this->yysp-(6-5)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_StaticCall($this->yyastk[$this->yysp-(6-1)], $this->yyastk[$this->yysp-(6-3)], $this->yyastk[$this->yysp-(6-5)], $line, $docComment);
}
private function yyn240($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_StaticCall(array('class' => $this->yyastk[$this->yysp-(6-1)], 'func' => $this->yyastk[$this->yysp-(6-3)], 'args' => $this->yyastk[$this->yysp-(6-5)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_StaticCall($this->yyastk[$this->yysp-(6-1)], $this->yyastk[$this->yysp-(6-3)], $this->yyastk[$this->yysp-(6-5)], $line, $docComment);
}
private function yyn241($line, $docComment) {
if ($this->yyastk[$this->yysp-(4-1)] instanceof PHPParser_Node_Expr_StaticPropertyFetch) {
$this->yyval = new PHPParser_Node_Expr_StaticCall(array('class' => $this->yyastk[$this->yysp-(4-1)]->class, 'func' => $this->yyastk[$this->yysp-(4-1)]->name, 'args' => $this->yyastk[$this->yysp-(4-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_StaticCall($this->yyastk[$this->yysp-(4-1)]->class, $this->yyastk[$this->yysp-(4-1)]->name, $this->yyastk[$this->yysp-(4-3)], $line, $docComment);
} elseif ($this->yyastk[$this->yysp-(4-1)] instanceof PHPParser_Node_Expr_ArrayDimFetch) {
$tmp = $this->yyastk[$this->yysp-(4-1)];
while ($tmp->var instanceof PHPParser_Node_Expr_ArrayDimFetch) {
$tmp = $tmp->var;
}
$this->yyval = new PHPParser_Node_Expr_StaticCall(array('class' => $tmp->var->class, 'func' => $this->yyastk[$this->yysp-(4-1)], 'args' => $this->yyastk[$this->yysp-(4-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_StaticCall($tmp->var->class, $this->yyastk[$this->yysp-(4-1)], $this->yyastk[$this->yysp-(4-3)], $line, $docComment);
$tmp->var = new PHPParser_Node_Variable($tmp->var->name, $line, $docComment);
} else {
throw new Exception;
@ -1965,7 +1965,7 @@ class PHPParser_Parser
}
private function yyn242($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_FuncCall(array('func' => $this->yyastk[$this->yysp-(4-1)], 'args' => $this->yyastk[$this->yysp-(4-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_FuncCall($this->yyastk[$this->yysp-(4-1)], $this->yyastk[$this->yysp-(4-3)], $line, $docComment);
}
private function yyn243($line, $docComment) {
@ -2009,11 +2009,11 @@ class PHPParser_Parser
}
private function yyn253($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_PropertyFetch(array('var' => $this->yyastk[$this->yysp-(3-1)], 'name' => $this->yyastk[$this->yysp-(3-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_PropertyFetch($this->yyastk[$this->yysp-(3-1)], $this->yyastk[$this->yysp-(3-3)], $line, $docComment);
}
private function yyn254($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_PropertyFetch(array('var' => $this->yyastk[$this->yysp-(3-1)], 'name' => $this->yyastk[$this->yysp-(3-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_PropertyFetch($this->yyastk[$this->yysp-(3-1)], $this->yyastk[$this->yysp-(3-3)], $line, $docComment);
}
private function yyn255($line, $docComment) {
@ -2109,15 +2109,15 @@ class PHPParser_Parser
}
private function yyn278($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_ConstFetch(array('name' => $this->yyastk[$this->yysp-(1-1)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_ConstFetch($this->yyastk[$this->yysp-(1-1)], $line, $docComment);
}
private function yyn279($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_UnaryPlus(array('expr' => $this->yyastk[$this->yysp-(2-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_UnaryPlus($this->yyastk[$this->yysp-(2-2)], $line, $docComment);
}
private function yyn280($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_UnaryMinus(array('expr' => $this->yyastk[$this->yysp-(2-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_UnaryMinus($this->yyastk[$this->yysp-(2-2)], $line, $docComment);
}
private function yyn281($line, $docComment) {
@ -2125,7 +2125,7 @@ class PHPParser_Parser
}
private function yyn282($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_ClassConstFetch(array('class' => $this->yyastk[$this->yysp-(3-1)], 'name' => $this->yyastk[$this->yysp-(3-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_ClassConstFetch($this->yyastk[$this->yysp-(3-1)], $this->yyastk[$this->yysp-(3-3)], $line, $docComment);
}
private function yyn283($line, $docComment) {
@ -2137,7 +2137,7 @@ class PHPParser_Parser
}
private function yyn285($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_ConstFetch(array('name' => $this->yyastk[$this->yysp-(1-1)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_ConstFetch($this->yyastk[$this->yysp-(1-1)], $line, $docComment);
}
private function yyn286($line, $docComment) {
@ -2201,15 +2201,15 @@ class PHPParser_Parser
}
private function yyn301($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_FuncCall(array('func' => $this->yyastk[$this->yysp-(4-1)], 'args' => $this->yyastk[$this->yysp-(4-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_FuncCall($this->yyastk[$this->yysp-(4-1)], $this->yyastk[$this->yysp-(4-3)], $line, $docComment);
}
private function yyn302($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_MethodCall(array('var' => $this->yyastk[$this->yysp-(6-1)], 'name' => $this->yyastk[$this->yysp-(6-3)], 'args' => $this->yyastk[$this->yysp-(6-5)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_MethodCall($this->yyastk[$this->yysp-(6-1)], $this->yyastk[$this->yysp-(6-3)], $this->yyastk[$this->yysp-(6-5)], $line, $docComment);
}
private function yyn303($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_PropertyFetch(array('var' => $this->yyastk[$this->yysp-(3-1)], 'name' => $this->yyastk[$this->yysp-(3-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_PropertyFetch($this->yyastk[$this->yysp-(3-1)], $this->yyastk[$this->yysp-(3-3)], $line, $docComment);
}
private function yyn304($line, $docComment) {
@ -2233,11 +2233,11 @@ class PHPParser_Parser
}
private function yyn309($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch(array('class' => $this->yyastk[$this->yysp-(4-1)], 'name' => $this->yyastk[$this->yysp-(4-4)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch($this->yyastk[$this->yysp-(4-1)], $this->yyastk[$this->yysp-(4-4)], $line, $docComment);
}
private function yyn310($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch(array('class' => $this->yyastk[$this->yysp-(4-1)], 'name' => $this->yyastk[$this->yysp-(4-4)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch($this->yyastk[$this->yysp-(4-1)], $this->yyastk[$this->yysp-(4-4)], $line, $docComment);
}
private function yyn311($line, $docComment) {
@ -2245,19 +2245,19 @@ class PHPParser_Parser
}
private function yyn312($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch(array('class' => $this->yyastk[$this->yysp-(3-1)], 'name' => substr($this->yyastk[$this->yysp-(3-3)], 1)), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch($this->yyastk[$this->yysp-(3-1)], substr($this->yyastk[$this->yysp-(3-3)], 1), $line, $docComment);
}
private function yyn313($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch(array('class' => $this->yyastk[$this->yysp-(3-1)], 'name' => substr($this->yyastk[$this->yysp-(3-3)], 1)), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch($this->yyastk[$this->yysp-(3-1)], substr($this->yyastk[$this->yysp-(3-3)], 1), $line, $docComment);
}
private function yyn314($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch(array('class' => $this->yyastk[$this->yysp-(6-1)], 'name' => $this->yyastk[$this->yysp-(6-5)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch($this->yyastk[$this->yysp-(6-1)], $this->yyastk[$this->yysp-(6-5)], $line, $docComment);
}
private function yyn315($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch(array('class' => $this->yyastk[$this->yysp-(6-1)], 'name' => $this->yyastk[$this->yysp-(6-5)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch($this->yyastk[$this->yysp-(6-1)], $this->yyastk[$this->yysp-(6-5)], $line, $docComment);
}
private function yyn316($line, $docComment) {
@ -2381,7 +2381,7 @@ class PHPParser_Parser
}
private function yyn346($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_PropertyFetch(array('var' => new PHPParser_Node_Variable(substr($this->yyastk[$this->yysp-(3-1)], 1), $line, $docComment), 'name' => $this->yyastk[$this->yysp-(3-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_PropertyFetch(new PHPParser_Node_Variable(substr($this->yyastk[$this->yysp-(3-1)], 1), $line, $docComment), $this->yyastk[$this->yysp-(3-3)], $line, $docComment);
}
private function yyn347($line, $docComment) {
@ -2409,10 +2409,10 @@ class PHPParser_Parser
}
private function yyn353($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_ClassConstFetch(array('class' => $this->yyastk[$this->yysp-(3-1)], 'name' => $this->yyastk[$this->yysp-(3-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_ClassConstFetch($this->yyastk[$this->yysp-(3-1)], $this->yyastk[$this->yysp-(3-3)], $line, $docComment);
}
private function yyn354($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_ClassConstFetch(array('class' => $this->yyastk[$this->yysp-(3-1)], 'name' => $this->yyastk[$this->yysp-(3-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_ClassConstFetch($this->yyastk[$this->yysp-(3-1)], $this->yyastk[$this->yysp-(3-3)], $line, $docComment);
}
}

View File

@ -1848,19 +1848,19 @@ class PHPParser_ParserDebug
}
private function yyn117($line, $docComment) {
$this->yyval = array(new PHPParser_Node_Expr_FuncCallArg(array('value' => $this->yyastk[$this->yysp-(1-1)], 'byRef' => false), $line, $docComment));
$this->yyval = array(new PHPParser_Node_Expr_FuncCallArg($this->yyastk[$this->yysp-(1-1)], false, $line, $docComment));
}
private function yyn118($line, $docComment) {
$this->yyval = array(new PHPParser_Node_Expr_FuncCallArg(array('value' => $this->yyastk[$this->yysp-(2-2)], 'byRef' => true), $line, $docComment));
$this->yyval = array(new PHPParser_Node_Expr_FuncCallArg($this->yyastk[$this->yysp-(2-2)], true, $line, $docComment));
}
private function yyn119($line, $docComment) {
$this->yyastk[$this->yysp-(3-1)][] = new PHPParser_Node_Expr_FuncCallArg(array('value' => $this->yyastk[$this->yysp-(3-3)], 'byRef' => false), $line, $docComment); $this->yyval = $this->yyastk[$this->yysp-(3-1)];
$this->yyastk[$this->yysp-(3-1)][] = new PHPParser_Node_Expr_FuncCallArg($this->yyastk[$this->yysp-(3-3)], false, $line, $docComment); $this->yyval = $this->yyastk[$this->yysp-(3-1)];
}
private function yyn120($line, $docComment) {
$this->yyastk[$this->yysp-(4-1)][] = new PHPParser_Node_Expr_FuncCallArg(array('value' => $this->yyastk[$this->yysp-(4-4)], 'byRef' => true), $line, $docComment); $this->yyval = $this->yyastk[$this->yysp-(4-1)];
$this->yyastk[$this->yysp-(4-1)][] = new PHPParser_Node_Expr_FuncCallArg($this->yyastk[$this->yysp-(4-4)], true, $line, $docComment); $this->yyval = $this->yyastk[$this->yysp-(4-1)];
}
private function yyn121($line, $docComment) {
@ -2020,7 +2020,7 @@ class PHPParser_ParserDebug
}
private function yyn160($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_List(array('assignList' => $this->yyastk[$this->yysp-(6-3)], 'expr' => $this->yyastk[$this->yysp-(6-6)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_List($this->yyastk[$this->yysp-(6-3)], $this->yyastk[$this->yysp-(6-6)], $line, $docComment);
}
private function yyn161($line, $docComment) {
@ -2032,15 +2032,15 @@ class PHPParser_ParserDebug
}
private function yyn163($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Assign($this->yyastk[$this->yysp-(6-1)], new PHPParser_Node_Expr_New(array('class' => $this->yyastk[$this->yysp-(6-5)], 'args' => $this->yyastk[$this->yysp-(6-6)]), $line, $docComment), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Assign($this->yyastk[$this->yysp-(6-1)], new PHPParser_Node_Expr_New($this->yyastk[$this->yysp-(6-5)], $this->yyastk[$this->yysp-(6-6)], $line, $docComment), $line, $docComment);
}
private function yyn164($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_New(array('class' => $this->yyastk[$this->yysp-(3-2)], 'args' => $this->yyastk[$this->yysp-(3-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_New($this->yyastk[$this->yysp-(3-2)], $this->yyastk[$this->yysp-(3-3)], $line, $docComment);
}
private function yyn165($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Clone(array('expr' => $this->yyastk[$this->yysp-(2-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Clone($this->yyastk[$this->yysp-(2-2)], $line, $docComment);
}
private function yyn166($line, $docComment) {
@ -2088,19 +2088,19 @@ class PHPParser_ParserDebug
}
private function yyn177($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_PostInc(array('var' => $this->yyastk[$this->yysp-(2-1)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_PostInc($this->yyastk[$this->yysp-(2-1)], $line, $docComment);
}
private function yyn178($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_PreInc(array('var' => $this->yyastk[$this->yysp-(2-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_PreInc($this->yyastk[$this->yysp-(2-2)], $line, $docComment);
}
private function yyn179($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_PostDec(array('var' => $this->yyastk[$this->yysp-(2-1)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_PostDec($this->yyastk[$this->yysp-(2-1)], $line, $docComment);
}
private function yyn180($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_PreDec(array('var' => $this->yyastk[$this->yysp-(2-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_PreDec($this->yyastk[$this->yysp-(2-2)], $line, $docComment);
}
private function yyn181($line, $docComment) {
@ -2168,19 +2168,19 @@ class PHPParser_ParserDebug
}
private function yyn197($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_UnaryPlus(array('expr' => $this->yyastk[$this->yysp-(2-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_UnaryPlus($this->yyastk[$this->yysp-(2-2)], $line, $docComment);
}
private function yyn198($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_UnaryMinus(array('expr' => $this->yyastk[$this->yysp-(2-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_UnaryMinus($this->yyastk[$this->yysp-(2-2)], $line, $docComment);
}
private function yyn199($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_BooleanNot(array('expr' => $this->yyastk[$this->yysp-(2-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_BooleanNot($this->yyastk[$this->yysp-(2-2)], $line, $docComment);
}
private function yyn200($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_BitwiseNot(array('expr' => $this->yyastk[$this->yysp-(2-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_BitwiseNot($this->yyastk[$this->yysp-(2-2)], $line, $docComment);
}
private function yyn201($line, $docComment) {
@ -2224,39 +2224,39 @@ class PHPParser_ParserDebug
}
private function yyn211($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Ternary(array('cond' => $this->yyastk[$this->yysp-(5-1)], 'if' => $this->yyastk[$this->yysp-(5-3)], 'else' => $this->yyastk[$this->yysp-(5-5)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Ternary($this->yyastk[$this->yysp-(5-1)], $this->yyastk[$this->yysp-(5-3)], $this->yyastk[$this->yysp-(5-5)], $line, $docComment);
}
private function yyn212($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Ternary(array('cond' => $this->yyastk[$this->yysp-(4-1)], 'if' => null, 'else' => $this->yyastk[$this->yysp-(4-4)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Ternary($this->yyastk[$this->yysp-(4-1)], null, $this->yyastk[$this->yysp-(4-4)], $line, $docComment);
}
private function yyn213($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Isset(array('vars' => $this->yyastk[$this->yysp-(4-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Isset($this->yyastk[$this->yysp-(4-3)], $line, $docComment);
}
private function yyn214($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Empty(array('var' => $this->yyastk[$this->yysp-(4-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Empty($this->yyastk[$this->yysp-(4-3)], $line, $docComment);
}
private function yyn215($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Include(array('expr' => $this->yyastk[$this->yysp-(2-2)], 'type' => PHPParser_Node_Expr_Include::TYPE_INCLUDE), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Include($this->yyastk[$this->yysp-(2-2)], PHPParser_Node_Expr_Include::TYPE_INCLUDE, $line, $docComment);
}
private function yyn216($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Include(array('expr' => $this->yyastk[$this->yysp-(2-2)], 'type' => PHPParser_Node_Expr_Include::TYPE_INCLUDE_ONCE), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Include($this->yyastk[$this->yysp-(2-2)], PHPParser_Node_Expr_Include::TYPE_INCLUDE_ONCE, $line, $docComment);
}
private function yyn217($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Eval(array('expr' => $this->yyastk[$this->yysp-(4-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Eval($this->yyastk[$this->yysp-(4-3)], $line, $docComment);
}
private function yyn218($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Include(array('expr' => $this->yyastk[$this->yysp-(2-2)], 'type' => PHPParser_Node_Expr_Include::TYPE_REQUIRE), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Include($this->yyastk[$this->yysp-(2-2)], PHPParser_Node_Expr_Include::TYPE_REQUIRE, $line, $docComment);
}
private function yyn219($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Include(array('expr' => $this->yyastk[$this->yysp-(2-2)], 'type' => PHPParser_Node_Expr_Include::TYPE_REQUIRE_ONCE), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Include($this->yyastk[$this->yysp-(2-2)], PHPParser_Node_Expr_Include::TYPE_REQUIRE_ONCE, $line, $docComment);
}
private function yyn220($line, $docComment) {
@ -2288,11 +2288,11 @@ class PHPParser_ParserDebug
}
private function yyn227($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Exit(array('expr' => $this->yyastk[$this->yysp-(2-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Exit($this->yyastk[$this->yysp-(2-2)], $line, $docComment);
}
private function yyn228($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_ErrorSuppress(array('expr' => $this->yyastk[$this->yysp-(2-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_ErrorSuppress($this->yyastk[$this->yysp-(2-2)], $line, $docComment);
}
private function yyn229($line, $docComment) {
@ -2304,11 +2304,11 @@ class PHPParser_ParserDebug
}
private function yyn231($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_ShellExec(array('parts' => $this->yyastk[$this->yysp-(3-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_ShellExec($this->yyastk[$this->yysp-(3-2)], $line, $docComment);
}
private function yyn232($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_Print(array('expr' => $this->yyastk[$this->yysp-(2-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_Print($this->yyastk[$this->yysp-(2-2)], $line, $docComment);
}
private function yyn233($line, $docComment) {
@ -2324,36 +2324,36 @@ class PHPParser_ParserDebug
}
private function yyn236($line, $docComment) {
$this->yyastk[$this->yysp-(4-1)][] = new PHPParser_Node_Expr_LambdaFuncUse(array('var' => substr($this->yyastk[$this->yysp-(4-4)], 1), 'byRef' => $this->yyastk[$this->yysp-(4-3)]), $line, $docComment); $this->yyval = $this->yyastk[$this->yysp-(4-1)];
$this->yyastk[$this->yysp-(4-1)][] = new PHPParser_Node_Expr_LambdaFuncUse(substr($this->yyastk[$this->yysp-(4-4)], 1), $this->yyastk[$this->yysp-(4-3)], $line, $docComment); $this->yyval = $this->yyastk[$this->yysp-(4-1)];
}
private function yyn237($line, $docComment) {
$this->yyval = array(new PHPParser_Node_Expr_LambdaFuncUse(array('var' => substr($this->yyastk[$this->yysp-(2-2)], 1), 'byRef' => $this->yyastk[$this->yysp-(2-1)]), $line, $docComment));
$this->yyval = array(new PHPParser_Node_Expr_LambdaFuncUse(substr($this->yyastk[$this->yysp-(2-2)], 1), $this->yyastk[$this->yysp-(2-1)], $line, $docComment));
}
private function yyn238($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_FuncCall(array('func' => $this->yyastk[$this->yysp-(4-1)], 'args' => $this->yyastk[$this->yysp-(4-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_FuncCall($this->yyastk[$this->yysp-(4-1)], $this->yyastk[$this->yysp-(4-3)], $line, $docComment);
}
private function yyn239($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_StaticCall(array('class' => $this->yyastk[$this->yysp-(6-1)], 'func' => $this->yyastk[$this->yysp-(6-3)], 'args' => $this->yyastk[$this->yysp-(6-5)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_StaticCall($this->yyastk[$this->yysp-(6-1)], $this->yyastk[$this->yysp-(6-3)], $this->yyastk[$this->yysp-(6-5)], $line, $docComment);
}
private function yyn240($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_StaticCall(array('class' => $this->yyastk[$this->yysp-(6-1)], 'func' => $this->yyastk[$this->yysp-(6-3)], 'args' => $this->yyastk[$this->yysp-(6-5)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_StaticCall($this->yyastk[$this->yysp-(6-1)], $this->yyastk[$this->yysp-(6-3)], $this->yyastk[$this->yysp-(6-5)], $line, $docComment);
}
private function yyn241($line, $docComment) {
if ($this->yyastk[$this->yysp-(4-1)] instanceof PHPParser_Node_Expr_StaticPropertyFetch) {
$this->yyval = new PHPParser_Node_Expr_StaticCall(array('class' => $this->yyastk[$this->yysp-(4-1)]->class, 'func' => $this->yyastk[$this->yysp-(4-1)]->name, 'args' => $this->yyastk[$this->yysp-(4-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_StaticCall($this->yyastk[$this->yysp-(4-1)]->class, $this->yyastk[$this->yysp-(4-1)]->name, $this->yyastk[$this->yysp-(4-3)], $line, $docComment);
} elseif ($this->yyastk[$this->yysp-(4-1)] instanceof PHPParser_Node_Expr_ArrayDimFetch) {
$tmp = $this->yyastk[$this->yysp-(4-1)];
while ($tmp->var instanceof PHPParser_Node_Expr_ArrayDimFetch) {
$tmp = $tmp->var;
}
$this->yyval = new PHPParser_Node_Expr_StaticCall(array('class' => $tmp->var->class, 'func' => $this->yyastk[$this->yysp-(4-1)], 'args' => $this->yyastk[$this->yysp-(4-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_StaticCall($tmp->var->class, $this->yyastk[$this->yysp-(4-1)], $this->yyastk[$this->yysp-(4-3)], $line, $docComment);
$tmp->var = new PHPParser_Node_Variable($tmp->var->name, $line, $docComment);
} else {
throw new Exception;
@ -2362,7 +2362,7 @@ class PHPParser_ParserDebug
}
private function yyn242($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_FuncCall(array('func' => $this->yyastk[$this->yysp-(4-1)], 'args' => $this->yyastk[$this->yysp-(4-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_FuncCall($this->yyastk[$this->yysp-(4-1)], $this->yyastk[$this->yysp-(4-3)], $line, $docComment);
}
private function yyn243($line, $docComment) {
@ -2406,11 +2406,11 @@ class PHPParser_ParserDebug
}
private function yyn253($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_PropertyFetch(array('var' => $this->yyastk[$this->yysp-(3-1)], 'name' => $this->yyastk[$this->yysp-(3-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_PropertyFetch($this->yyastk[$this->yysp-(3-1)], $this->yyastk[$this->yysp-(3-3)], $line, $docComment);
}
private function yyn254($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_PropertyFetch(array('var' => $this->yyastk[$this->yysp-(3-1)], 'name' => $this->yyastk[$this->yysp-(3-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_PropertyFetch($this->yyastk[$this->yysp-(3-1)], $this->yyastk[$this->yysp-(3-3)], $line, $docComment);
}
private function yyn255($line, $docComment) {
@ -2506,15 +2506,15 @@ class PHPParser_ParserDebug
}
private function yyn278($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_ConstFetch(array('name' => $this->yyastk[$this->yysp-(1-1)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_ConstFetch($this->yyastk[$this->yysp-(1-1)], $line, $docComment);
}
private function yyn279($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_UnaryPlus(array('expr' => $this->yyastk[$this->yysp-(2-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_UnaryPlus($this->yyastk[$this->yysp-(2-2)], $line, $docComment);
}
private function yyn280($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_UnaryMinus(array('expr' => $this->yyastk[$this->yysp-(2-2)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_UnaryMinus($this->yyastk[$this->yysp-(2-2)], $line, $docComment);
}
private function yyn281($line, $docComment) {
@ -2522,7 +2522,7 @@ class PHPParser_ParserDebug
}
private function yyn282($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_ClassConstFetch(array('class' => $this->yyastk[$this->yysp-(3-1)], 'name' => $this->yyastk[$this->yysp-(3-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_ClassConstFetch($this->yyastk[$this->yysp-(3-1)], $this->yyastk[$this->yysp-(3-3)], $line, $docComment);
}
private function yyn283($line, $docComment) {
@ -2534,7 +2534,7 @@ class PHPParser_ParserDebug
}
private function yyn285($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_ConstFetch(array('name' => $this->yyastk[$this->yysp-(1-1)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_ConstFetch($this->yyastk[$this->yysp-(1-1)], $line, $docComment);
}
private function yyn286($line, $docComment) {
@ -2598,15 +2598,15 @@ class PHPParser_ParserDebug
}
private function yyn301($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_FuncCall(array('func' => $this->yyastk[$this->yysp-(4-1)], 'args' => $this->yyastk[$this->yysp-(4-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_FuncCall($this->yyastk[$this->yysp-(4-1)], $this->yyastk[$this->yysp-(4-3)], $line, $docComment);
}
private function yyn302($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_MethodCall(array('var' => $this->yyastk[$this->yysp-(6-1)], 'name' => $this->yyastk[$this->yysp-(6-3)], 'args' => $this->yyastk[$this->yysp-(6-5)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_MethodCall($this->yyastk[$this->yysp-(6-1)], $this->yyastk[$this->yysp-(6-3)], $this->yyastk[$this->yysp-(6-5)], $line, $docComment);
}
private function yyn303($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_PropertyFetch(array('var' => $this->yyastk[$this->yysp-(3-1)], 'name' => $this->yyastk[$this->yysp-(3-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_PropertyFetch($this->yyastk[$this->yysp-(3-1)], $this->yyastk[$this->yysp-(3-3)], $line, $docComment);
}
private function yyn304($line, $docComment) {
@ -2630,11 +2630,11 @@ class PHPParser_ParserDebug
}
private function yyn309($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch(array('class' => $this->yyastk[$this->yysp-(4-1)], 'name' => $this->yyastk[$this->yysp-(4-4)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch($this->yyastk[$this->yysp-(4-1)], $this->yyastk[$this->yysp-(4-4)], $line, $docComment);
}
private function yyn310($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch(array('class' => $this->yyastk[$this->yysp-(4-1)], 'name' => $this->yyastk[$this->yysp-(4-4)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch($this->yyastk[$this->yysp-(4-1)], $this->yyastk[$this->yysp-(4-4)], $line, $docComment);
}
private function yyn311($line, $docComment) {
@ -2642,19 +2642,19 @@ class PHPParser_ParserDebug
}
private function yyn312($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch(array('class' => $this->yyastk[$this->yysp-(3-1)], 'name' => substr($this->yyastk[$this->yysp-(3-3)], 1)), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch($this->yyastk[$this->yysp-(3-1)], substr($this->yyastk[$this->yysp-(3-3)], 1), $line, $docComment);
}
private function yyn313($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch(array('class' => $this->yyastk[$this->yysp-(3-1)], 'name' => substr($this->yyastk[$this->yysp-(3-3)], 1)), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch($this->yyastk[$this->yysp-(3-1)], substr($this->yyastk[$this->yysp-(3-3)], 1), $line, $docComment);
}
private function yyn314($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch(array('class' => $this->yyastk[$this->yysp-(6-1)], 'name' => $this->yyastk[$this->yysp-(6-5)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch($this->yyastk[$this->yysp-(6-1)], $this->yyastk[$this->yysp-(6-5)], $line, $docComment);
}
private function yyn315($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch(array('class' => $this->yyastk[$this->yysp-(6-1)], 'name' => $this->yyastk[$this->yysp-(6-5)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch($this->yyastk[$this->yysp-(6-1)], $this->yyastk[$this->yysp-(6-5)], $line, $docComment);
}
private function yyn316($line, $docComment) {
@ -2778,7 +2778,7 @@ class PHPParser_ParserDebug
}
private function yyn346($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_PropertyFetch(array('var' => new PHPParser_Node_Variable(substr($this->yyastk[$this->yysp-(3-1)], 1), $line, $docComment), 'name' => $this->yyastk[$this->yysp-(3-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_PropertyFetch(new PHPParser_Node_Variable(substr($this->yyastk[$this->yysp-(3-1)], 1), $line, $docComment), $this->yyastk[$this->yysp-(3-3)], $line, $docComment);
}
private function yyn347($line, $docComment) {
@ -2806,10 +2806,10 @@ class PHPParser_ParserDebug
}
private function yyn353($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_ClassConstFetch(array('class' => $this->yyastk[$this->yysp-(3-1)], 'name' => $this->yyastk[$this->yysp-(3-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_ClassConstFetch($this->yyastk[$this->yysp-(3-1)], $this->yyastk[$this->yysp-(3-3)], $line, $docComment);
}
private function yyn354($line, $docComment) {
$this->yyval = new PHPParser_Node_Expr_ClassConstFetch(array('class' => $this->yyastk[$this->yysp-(3-1)], 'name' => $this->yyastk[$this->yysp-(3-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Expr_ClassConstFetch($this->yyastk[$this->yysp-(3-1)], $this->yyastk[$this->yysp-(3-3)], $line, $docComment);
}
}

View File

@ -309,7 +309,7 @@ class PHPParser_PrettyPrinter_Zend extends PHPParser_PrettyPrinterAbstract
// Function calls and similar constructs
public function pExpr_FuncCall(PHPParser_Node_Expr_FuncCall $node) {
return $this->p($node->func) . '(' . $this->pCommaSeparated($node->args) . ')';
return $this->p($node->name) . '(' . $this->pCommaSeparated($node->args) . ')';
}
public function pExpr_FuncCallArg(PHPParser_Node_Expr_FuncCallArg $node) {
@ -323,7 +323,7 @@ class PHPParser_PrettyPrinter_Zend extends PHPParser_PrettyPrinterAbstract
public function pExpr_StaticCall(PHPParser_Node_Expr_StaticCall $node) {
return $this->pClassName($node->class) . '::'
. ($node->func instanceof PHPParser_Node_Expr ? $this->p($node->func) : $node->func)
. ($node->name instanceof PHPParser_Node_Expr ? $this->p($node->name) : $node->name)
. '(' . $this->pCommaSeparated($node->args) . ')';
}

View File

@ -10,13 +10,13 @@ abstract class PHPParser_PrettyPrinterAbstract
'Expr_PostDec' => 1,
'Expr_UnaryPlus' => 1,
'Expr_UnaryMinus' => 1,
'Expr_IntCast' => 1,
'Expr_DoubleCast' => 1,
'Expr_StringCast' => 1,
'Expr_ArrayCast' => 1,
'Expr_ObjectCast' => 1,
'Expr_BoolCast' => 1,
'Expr_UnsetCast' => 1,
'Expr_Cast_Int' => 1,
'Expr_Cast_Double' => 1,
'Expr_Cast_String' => 1,
'Expr_Cast_Array' => 1,
'Expr_Cast_Object' => 1,
'Expr_Cast_Bool' => 1,
'Expr_Cast_Unset' => 1,
'Expr_ErrorSuppress' => 1,
'Expr_Instanceof' => 2,
'Expr_BooleanNot' => 3,

View File

@ -8,13 +8,11 @@ class PHPParser_Tests_NodeTraverserTest extends PHPUnit_Framework_TestCase
'name' => new PHPParser_Node_Name(array('Foo', 'Bar')),
'stmts' => array(
new PHPParser_Node_Stmt_Echo(array(
'exprs' => array(
new PHPParser_Node_Scalar_String('Hallo World')
)
)),
new PHPParser_Node_Expr_Print(array(
'expr' => new PHPParser_Node_Scalar_String('Hallo World, again!')
new PHPParser_Node_Scalar_String('Hallo World')
)),
new PHPParser_Node_Expr_Print(
new PHPParser_Node_Scalar_String('Hallo World, again!')
),
)
)),
);
@ -70,9 +68,7 @@ class PHPParser_Tests_NodeTraverserTest extends PHPUnit_Framework_TestCase
$this->assertEquals(
array(
new PHPParser_Node_Stmt_Echo(array(
'exprs' => array(
new PHPParser_Node_Scalar_String('Foo Bar')
)
new PHPParser_Node_Scalar_String('Foo Bar')
)),
),
$node