Changeset View
Changeset View
Standalone View
Standalone View
support/xhpast/parser.y
Show First 20 Lines • Show All 217 Lines • ▼ Show 20 Lines | top_statement_list { | ||||
*root = NNEW(n_PROGRAM)->appendChild($1); | *root = NNEW(n_PROGRAM)->appendChild($1); | ||||
} | } | ||||
; | ; | ||||
top_statement_list: | top_statement_list: | ||||
top_statement_list top_statement { | top_statement_list top_statement { | ||||
$$ = $1->appendChild($2); | $$ = $1->appendChild($2); | ||||
} | } | ||||
| /* empty */ { | | %empty { | ||||
$$ = NNEW(n_STATEMENT_LIST); | $$ = NNEW(n_STATEMENT_LIST); | ||||
} | } | ||||
; | ; | ||||
namespace_name: | namespace_name: | ||||
T_STRING { | T_STRING { | ||||
$$ = NTYPE($1, n_SYMBOL_NAME); | $$ = NTYPE($1, n_SYMBOL_NAME); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 97 Lines • ▼ Show 20 Lines | $$->appendChild( | ||||
->appendChild($4)); | ->appendChild($4)); | ||||
} | } | ||||
; | ; | ||||
inner_statement_list: | inner_statement_list: | ||||
inner_statement_list inner_statement { | inner_statement_list inner_statement { | ||||
$$ = $1->appendChild($2); | $$ = $1->appendChild($2); | ||||
} | } | ||||
| /* empty */ { | | %empty { | ||||
$$ = NNEW(n_STATEMENT_LIST); | $$ = NNEW(n_STATEMENT_LIST); | ||||
} | } | ||||
; | ; | ||||
inner_statement: | inner_statement: | ||||
statement | statement | ||||
| function_declaration_statement | | function_declaration_statement | ||||
| class_declaration_statement | | class_declaration_statement | ||||
▲ Show 20 Lines • Show All 271 Lines • ▼ Show 20 Lines | | T_GOTO T_STRING ';' { | ||||
$$ = NNEW(n_STATEMENT)->appendChild($1); | $$ = NNEW(n_STATEMENT)->appendChild($1); | ||||
NMORE($$, $3); | NMORE($$, $3); | ||||
} | } | ||||
; | ; | ||||
additional_catches: | additional_catches: | ||||
non_empty_additional_catches | non_empty_additional_catches | ||||
| /* empty */ { | | %empty { | ||||
$$ = NNEW(n_EMPTY); | $$ = NNEW(n_EMPTY); | ||||
} | } | ||||
; | ; | ||||
finally_statement: | finally_statement: | ||||
/* empty */ { | %empty { | ||||
$$ = NNEW(n_EMPTY); | $$ = NNEW(n_EMPTY); | ||||
} | } | ||||
| T_FINALLY '{' inner_statement_list '}' { | | T_FINALLY '{' inner_statement_list '}' { | ||||
NTYPE($1, n_FINALLY); | NTYPE($1, n_FINALLY); | ||||
$1->appendChild($3); | $1->appendChild($3); | ||||
NMORE($1, $4); | NMORE($1, $4); | ||||
$$ = $1; | $$ = $1; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | function_declaration_statement: | ||||
unticked_function_declaration_statement | unticked_function_declaration_statement | ||||
; | ; | ||||
class_declaration_statement: | class_declaration_statement: | ||||
unticked_class_declaration_statement | unticked_class_declaration_statement | ||||
; | ; | ||||
is_reference: | is_reference: | ||||
/* empty */ { | %empty { | ||||
$$ = NNEW(n_EMPTY); | $$ = NNEW(n_EMPTY); | ||||
} | } | ||||
| '&' { | | '&' { | ||||
$$ = NTYPE($1, n_REFERENCE); | $$ = NTYPE($1, n_REFERENCE); | ||||
} | } | ||||
; | ; | ||||
unticked_function_declaration_statement: | unticked_function_declaration_statement: | ||||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | | T_FINAL T_CLASS { | ||||
} | } | ||||
| T_TRAIT { | | T_TRAIT { | ||||
$$ = NNEW(n_CLASS_ATTRIBUTES); | $$ = NNEW(n_CLASS_ATTRIBUTES); | ||||
$$->appendChild(NTYPE($1, n_STRING)); | $$->appendChild(NTYPE($1, n_STRING)); | ||||
} | } | ||||
; | ; | ||||
extends_from: | extends_from: | ||||
/* empty */ { | %empty { | ||||
$$ = NNEW(n_EMPTY); | $$ = NNEW(n_EMPTY); | ||||
} | } | ||||
| T_EXTENDS fully_qualified_class_name { | | T_EXTENDS fully_qualified_class_name { | ||||
$$ = NTYPE($1, n_EXTENDS_LIST)->appendChild($2); | $$ = NTYPE($1, n_EXTENDS_LIST)->appendChild($2); | ||||
} | } | ||||
; | ; | ||||
interface_entry: | interface_entry: | ||||
T_INTERFACE | T_INTERFACE | ||||
; | ; | ||||
interface_extends_list: | interface_extends_list: | ||||
/* empty */ { | %empty { | ||||
$$ = NNEW(n_EMPTY); | $$ = NNEW(n_EMPTY); | ||||
} | } | ||||
| T_EXTENDS interface_list { | | T_EXTENDS interface_list { | ||||
NTYPE($1, n_EXTENDS_LIST); | NTYPE($1, n_EXTENDS_LIST); | ||||
$1->appendChildren($2); | $1->appendChildren($2); | ||||
$$ = $1; | $$ = $1; | ||||
} | } | ||||
; | ; | ||||
implements_list: | implements_list: | ||||
/* empty */ { | %empty { | ||||
$$ = NNEW(n_EMPTY); | $$ = NNEW(n_EMPTY); | ||||
} | } | ||||
| T_IMPLEMENTS interface_list { | | T_IMPLEMENTS interface_list { | ||||
NTYPE($1, n_IMPLEMENTS_LIST); | NTYPE($1, n_IMPLEMENTS_LIST); | ||||
$1->appendChildren($2); | $1->appendChildren($2); | ||||
$$ = $1; | $$ = $1; | ||||
} | } | ||||
; | ; | ||||
interface_list: | interface_list: | ||||
fully_qualified_class_name { | fully_qualified_class_name { | ||||
$$ = NNEW(n_IMPLEMENTS_LIST)->appendChild($1); | $$ = NNEW(n_IMPLEMENTS_LIST)->appendChild($1); | ||||
} | } | ||||
| interface_list ',' fully_qualified_class_name { | | interface_list ',' fully_qualified_class_name { | ||||
$$ = $1->appendChild($3); | $$ = $1->appendChild($3); | ||||
} | } | ||||
; | ; | ||||
foreach_optional_arg: | foreach_optional_arg: | ||||
/* empty */ { | %empty { | ||||
$$ = NNEW(n_EMPTY); | $$ = NNEW(n_EMPTY); | ||||
} | } | ||||
| T_DOUBLE_ARROW foreach_variable { | | T_DOUBLE_ARROW foreach_variable { | ||||
$$ = $2; | $$ = $2; | ||||
} | } | ||||
; | ; | ||||
foreach_variable: | foreach_variable: | ||||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | | ':' ';' case_list T_ENDSWITCH ';' { | ||||
$$ = NNEW(n_STATEMENT_LIST)->appendChild($2); | $$ = NNEW(n_STATEMENT_LIST)->appendChild($2); | ||||
$$->appendChildren($3); | $$->appendChildren($3); | ||||
NMORE($$, $5); | NMORE($$, $5); | ||||
NMORE($$, $1); | NMORE($$, $1); | ||||
} | } | ||||
; | ; | ||||
case_list: | case_list: | ||||
/* empty */ { | %empty { | ||||
$$ = NNEW(n_STATEMENT_LIST); | $$ = NNEW(n_STATEMENT_LIST); | ||||
} | } | ||||
| case_list T_CASE expr case_separator inner_statement_list { | | case_list T_CASE expr case_separator inner_statement_list { | ||||
NTYPE($2, n_CASE); | NTYPE($2, n_CASE); | ||||
$2->appendChild($3); | $2->appendChild($3); | ||||
$2->appendChild($5); | $2->appendChild($5); | ||||
$1->appendChild($2); | $1->appendChild($2); | ||||
Show All 18 Lines | |||||
| ':' inner_statement_list T_ENDWHILE ';' { | | ':' inner_statement_list T_ENDWHILE ';' { | ||||
NMORE($2, $4); | NMORE($2, $4); | ||||
NMORE($2, $1); | NMORE($2, $1); | ||||
$$ = $2; | $$ = $2; | ||||
} | } | ||||
; | ; | ||||
elseif_list: | elseif_list: | ||||
/* empty */ { | %empty { | ||||
$$ = NNEW(n_CONDITION_LIST); | $$ = NNEW(n_CONDITION_LIST); | ||||
} | } | ||||
| elseif_list T_ELSEIF '(' expr ')' statement { | | elseif_list T_ELSEIF '(' expr ')' statement { | ||||
NTYPE($2, n_ELSEIF); | NTYPE($2, n_ELSEIF); | ||||
$2->appendChild(NSPAN($3, n_CONTROL_CONDITION, $5)->appendChild($4)); | $2->appendChild(NSPAN($3, n_CONTROL_CONDITION, $5)->appendChild($4)); | ||||
$2->appendChild($6); | $2->appendChild($6); | ||||
$$ = $1->appendChild($2); | $$ = $1->appendChild($2); | ||||
} | } | ||||
; | ; | ||||
new_elseif_list: | new_elseif_list: | ||||
/* empty */ { | %empty { | ||||
$$ = NNEW(n_CONDITION_LIST); | $$ = NNEW(n_CONDITION_LIST); | ||||
} | } | ||||
| new_elseif_list T_ELSEIF '(' expr ')' ':' inner_statement_list { | | new_elseif_list T_ELSEIF '(' expr ')' ':' inner_statement_list { | ||||
NTYPE($2, n_ELSEIF); | NTYPE($2, n_ELSEIF); | ||||
$2->appendChild($4); | $2->appendChild($4); | ||||
$2->appendChild($7); | $2->appendChild($7); | ||||
$$ = $1->appendChild($2); | $$ = $1->appendChild($2); | ||||
} | } | ||||
; | ; | ||||
else_single: | else_single: | ||||
/* empty */ { | %empty { | ||||
$$ = NNEW(n_EMPTY); | $$ = NNEW(n_EMPTY); | ||||
} | } | ||||
| T_ELSE statement { | | T_ELSE statement { | ||||
NTYPE($1, n_ELSE); | NTYPE($1, n_ELSE); | ||||
$1->appendChild($2); | $1->appendChild($2); | ||||
$$ = $1; | $$ = $1; | ||||
} | } | ||||
; | ; | ||||
new_else_single: | new_else_single: | ||||
/* empty */ { | %empty { | ||||
$$ = NNEW(n_EMPTY); | $$ = NNEW(n_EMPTY); | ||||
} | } | ||||
| T_ELSE ':' inner_statement_list { | | T_ELSE ':' inner_statement_list { | ||||
NTYPE($1, n_ELSE); | NTYPE($1, n_ELSE); | ||||
$1->appendChild($3); | $1->appendChild($3); | ||||
$$ = $1; | $$ = $1; | ||||
} | } | ||||
; | ; | ||||
parameter_list: | parameter_list: | ||||
non_empty_parameter_list | non_empty_parameter_list | ||||
| /* empty */ { | | %empty { | ||||
$$ = NNEW(n_DECLARATION_PARAMETER_LIST); | $$ = NNEW(n_DECLARATION_PARAMETER_LIST); | ||||
} | } | ||||
; | ; | ||||
non_empty_parameter_list: | non_empty_parameter_list: | ||||
optional_class_type T_VARIABLE { | optional_class_type T_VARIABLE { | ||||
$$ = NNEW(n_DECLARATION_PARAMETER); | $$ = NNEW(n_DECLARATION_PARAMETER); | ||||
$$->appendChild($1); | $$->appendChild($1); | ||||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | T_VARIABLE '=' static_scalar { | ||||
$$->appendChild(NTYPE($4, n_VARIABLE)); | $$->appendChild(NTYPE($4, n_VARIABLE)); | ||||
$$->appendChild($6); | $$->appendChild($6); | ||||
$$ = $1->appendChild($$); | $$ = $1->appendChild($$); | ||||
} | } | ||||
; | ; | ||||
optional_class_type: | optional_class_type: | ||||
/* empty */ { | %empty { | ||||
$$ = NNEW(n_EMPTY); | $$ = NNEW(n_EMPTY); | ||||
} | } | ||||
| fully_qualified_class_name { | | fully_qualified_class_name { | ||||
$$ = $1; | $$ = $1; | ||||
} | } | ||||
| T_ARRAY { | | T_ARRAY { | ||||
$$ = NTYPE($1, n_TYPE_NAME); | $$ = NTYPE($1, n_TYPE_NAME); | ||||
} | } | ||||
| T_CALLABLE { | | T_CALLABLE { | ||||
$$ = NTYPE($1, n_TYPE_NAME); | $$ = NTYPE($1, n_TYPE_NAME); | ||||
} | } | ||||
; | ; | ||||
function_call_parameter_list: | function_call_parameter_list: | ||||
non_empty_function_call_parameter_list | non_empty_function_call_parameter_list | ||||
| /* empty */ { | | %empty { | ||||
$$ = NNEW(n_CALL_PARAMETER_LIST); | $$ = NNEW(n_CALL_PARAMETER_LIST); | ||||
} | } | ||||
; | ; | ||||
non_empty_function_call_parameter_list: | non_empty_function_call_parameter_list: | ||||
expr_without_variable { | expr_without_variable { | ||||
$$ = NNEW(n_CALL_PARAMETER_LIST)->appendChild($1); | $$ = NNEW(n_CALL_PARAMETER_LIST)->appendChild($1); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | | T_VARIABLE '=' static_scalar { | ||||
$$ = NNEW(n_STATIC_DECLARATION_LIST)->appendChild($$); | $$ = NNEW(n_STATIC_DECLARATION_LIST)->appendChild($$); | ||||
} | } | ||||
; | ; | ||||
class_statement_list: | class_statement_list: | ||||
class_statement_list class_statement { | class_statement_list class_statement { | ||||
$$ = $1->appendChild($2); | $$ = $1->appendChild($2); | ||||
} | } | ||||
| /* empty */ { | | %empty { | ||||
$$ = NNEW(n_STATEMENT_LIST); | $$ = NNEW(n_STATEMENT_LIST); | ||||
} | } | ||||
; | ; | ||||
class_statement: | class_statement: | ||||
variable_modifiers class_variable_declaration ';' { | variable_modifiers class_variable_declaration ';' { | ||||
$$ = NNEW(n_CLASS_MEMBER_DECLARATION_LIST); | $$ = NNEW(n_CLASS_MEMBER_DECLARATION_LIST); | ||||
$$->appendChild($1); | $$->appendChild($1); | ||||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | ';' { | ||||
$$ = NNEW(n_EMPTY); | $$ = NNEW(n_EMPTY); | ||||
} | } | ||||
| '{' trait_adaptation_list '}' { | | '{' trait_adaptation_list '}' { | ||||
$$ = NEXPAND($1, $2, $3); | $$ = NEXPAND($1, $2, $3); | ||||
} | } | ||||
; | ; | ||||
trait_adaptation_list: | trait_adaptation_list: | ||||
/* empty */ { | %empty { | ||||
$$ = NNEW(n_TRAIT_ADAPTATION_LIST); | $$ = NNEW(n_TRAIT_ADAPTATION_LIST); | ||||
} | } | ||||
| non_empty_trait_adaptation_list { | | non_empty_trait_adaptation_list { | ||||
$$ = $1; | $$ = $1; | ||||
} | } | ||||
; | ; | ||||
non_empty_trait_adaptation_list: | non_empty_trait_adaptation_list: | ||||
▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | | trait_method_reference T_AS member_modifier { | ||||
$$ = NNEW(n_TRAIT_AS); | $$ = NNEW(n_TRAIT_AS); | ||||
$$->appendChild($1); | $$->appendChild($1); | ||||
$$->appendChild($3); | $$->appendChild($3); | ||||
$$->appendChild(NNEW(n_EMPTY)); | $$->appendChild(NNEW(n_EMPTY)); | ||||
} | } | ||||
; | ; | ||||
trait_modifiers: | trait_modifiers: | ||||
/* empty */ { | %empty { | ||||
$$ = NNEW(n_EMPTY); | $$ = NNEW(n_EMPTY); | ||||
} | } | ||||
| member_modifier { | | member_modifier { | ||||
$$ = NNEW(n_METHOD_MODIFIER_LIST); | $$ = NNEW(n_METHOD_MODIFIER_LIST); | ||||
$$->appendChild(NTYPE($1, n_STRING)); | $$->appendChild(NTYPE($1, n_STRING)); | ||||
} | } | ||||
; | ; | ||||
Show All 11 Lines | variable_modifiers: | ||||
non_empty_member_modifiers | non_empty_member_modifiers | ||||
| T_VAR { | | T_VAR { | ||||
$$ = NNEW(n_CLASS_MEMBER_MODIFIER_LIST); | $$ = NNEW(n_CLASS_MEMBER_MODIFIER_LIST); | ||||
$$->appendChild(NTYPE($1, n_STRING)); | $$->appendChild(NTYPE($1, n_STRING)); | ||||
} | } | ||||
; | ; | ||||
method_modifiers: | method_modifiers: | ||||
/* empty */ { | %empty { | ||||
$$ = NNEW(n_METHOD_MODIFIER_LIST); | $$ = NNEW(n_METHOD_MODIFIER_LIST); | ||||
} | } | ||||
| non_empty_member_modifiers { | | non_empty_member_modifiers { | ||||
NTYPE($1, n_METHOD_MODIFIER_LIST); | NTYPE($1, n_METHOD_MODIFIER_LIST); | ||||
$$ = $1; | $$ = $1; | ||||
} | } | ||||
; | ; | ||||
▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | echo_expr_list: | ||||
} | } | ||||
| expr { | | expr { | ||||
$$ = NNEW(n_ECHO_LIST); | $$ = NNEW(n_ECHO_LIST); | ||||
$$->appendChild($1); | $$->appendChild($1); | ||||
} | } | ||||
; | ; | ||||
for_expr: | for_expr: | ||||
/* empty */ { | %empty { | ||||
$$ = NNEW(n_EMPTY); | $$ = NNEW(n_EMPTY); | ||||
} | } | ||||
| non_empty_for_expr | | non_empty_for_expr | ||||
; | ; | ||||
non_empty_for_expr: | non_empty_for_expr: | ||||
non_empty_for_expr ',' expr { | non_empty_for_expr ',' expr { | ||||
▲ Show 20 Lines • Show All 466 Lines • ▼ Show 20 Lines | | T_YIELD expr T_DOUBLE_ARROW variable { | ||||
} | } | ||||
; | ; | ||||
function: | function: | ||||
T_FUNCTION | T_FUNCTION | ||||
; | ; | ||||
lexical_vars: | lexical_vars: | ||||
/* empty */ { | %empty { | ||||
$$ = NNEW(n_EMPTY); | $$ = NNEW(n_EMPTY); | ||||
} | } | ||||
| T_USE '(' lexical_var_list ')' { | | T_USE '(' lexical_var_list ')' { | ||||
NTYPE($1, n_LEXICAL_VARIABLE_LIST); | NTYPE($1, n_LEXICAL_VARIABLE_LIST); | ||||
$1->appendChildren($3); | $1->appendChildren($3); | ||||
$$ = $1; | $$ = $1; | ||||
} | } | ||||
; | ; | ||||
▲ Show 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | dynamic_class_name_reference: | ||||
} | } | ||||
| base_variable | | base_variable | ||||
; | ; | ||||
dynamic_class_name_variable_properties: | dynamic_class_name_variable_properties: | ||||
dynamic_class_name_variable_properties dynamic_class_name_variable_property { | dynamic_class_name_variable_properties dynamic_class_name_variable_property { | ||||
$$ = $1->appendChild($2); | $$ = $1->appendChild($2); | ||||
} | } | ||||
| /* empty */ { | | %empty { | ||||
$$ = NNEW(n_EMPTY); | $$ = NNEW(n_EMPTY); | ||||
} | } | ||||
; | ; | ||||
dynamic_class_name_variable_property: | dynamic_class_name_variable_property: | ||||
T_OBJECT_OPERATOR object_property { | T_OBJECT_OPERATOR object_property { | ||||
$$ = $2; | $$ = $2; | ||||
} | } | ||||
; | ; | ||||
exit_expr: | exit_expr: | ||||
/* empty */ { | %empty { | ||||
$$ = NNEW(n_EMPTY); | $$ = NNEW(n_EMPTY); | ||||
} | } | ||||
| '(' ')' { | | '(' ')' { | ||||
NSPAN($1, n_EMPTY, $2); | NSPAN($1, n_EMPTY, $2); | ||||
$$ = $1; | $$ = $1; | ||||
} | } | ||||
| '(' expr ')' { | | '(' expr ')' { | ||||
NSPAN($1, n_PARENTHETICAL_EXPRESSION, $3); | NSPAN($1, n_PARENTHETICAL_EXPRESSION, $3); | ||||
$1->appendChild($2); | $1->appendChild($2); | ||||
$$ = $1; | $$ = $1; | ||||
} | } | ||||
; | ; | ||||
ctor_arguments: | ctor_arguments: | ||||
/* empty */ { | %empty { | ||||
$$ = NNEW(n_EMPTY); | $$ = NNEW(n_EMPTY); | ||||
} | } | ||||
| '(' function_call_parameter_list ')' { | | '(' function_call_parameter_list ')' { | ||||
$$ = NEXPAND($1, $2, $3); | $$ = NEXPAND($1, $2, $3); | ||||
} | } | ||||
; | ; | ||||
common_scalar: | common_scalar: | ||||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | | T_NAMESPACE T_NS_SEPARATOR namespace_name { | ||||
} | } | ||||
| T_NS_SEPARATOR namespace_name { | | T_NS_SEPARATOR namespace_name { | ||||
$$ = NMORE($2, $1); | $$ = NMORE($2, $1); | ||||
} | } | ||||
| common_scalar | | common_scalar | ||||
; | ; | ||||
static_array_pair_list: | static_array_pair_list: | ||||
/* empty */ { | %empty { | ||||
$$ = NNEW(n_ARRAY_VALUE_LIST); | $$ = NNEW(n_ARRAY_VALUE_LIST); | ||||
} | } | ||||
| non_empty_static_array_pair_list possible_comma { | | non_empty_static_array_pair_list possible_comma { | ||||
$$ = NMORE($1, $2); | $$ = NMORE($1, $2); | ||||
} | } | ||||
; | ; | ||||
possible_comma: | possible_comma: | ||||
/* empty */ { | %empty { | ||||
$$ = NNEW(n_EMPTY); | $$ = NNEW(n_EMPTY); | ||||
} | } | ||||
| ',' | | ',' | ||||
; | ; | ||||
non_empty_static_array_pair_list: | non_empty_static_array_pair_list: | ||||
non_empty_static_array_pair_list | non_empty_static_array_pair_list | ||||
',' | ',' | ||||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | variable: | ||||
} | } | ||||
| base_variable_with_function_calls | | base_variable_with_function_calls | ||||
; | ; | ||||
variable_properties: | variable_properties: | ||||
variable_properties variable_property { | variable_properties variable_property { | ||||
$$ = $1->appendChildren($2); | $$ = $1->appendChildren($2); | ||||
} | } | ||||
| /* empty */ { | | %empty { | ||||
$$ = NNEW(n_EMPTY); | $$ = NNEW(n_EMPTY); | ||||
} | } | ||||
; | ; | ||||
variable_property: | variable_property: | ||||
T_OBJECT_OPERATOR object_property method_or_not { | T_OBJECT_OPERATOR object_property method_or_not { | ||||
$$ = NNEW(n_EMPTY); | $$ = NNEW(n_EMPTY); | ||||
$$->appendChild($2); | $$->appendChild($2); | ||||
Show All 22 Lines | method: | ||||
'(' function_call_parameter_list ')' { | '(' function_call_parameter_list ')' { | ||||
$$ = NEXPAND($1, $2, $3); | $$ = NEXPAND($1, $2, $3); | ||||
} | } | ||||
; | ; | ||||
method_or_not: | method_or_not: | ||||
method | method | ||||
| array_method_dereference | | array_method_dereference | ||||
| /* empty */ { | | %empty { | ||||
$$ = NNEW(n_EMPTY); | $$ = NNEW(n_EMPTY); | ||||
} | } | ||||
; | ; | ||||
variable_without_objects: | variable_without_objects: | ||||
reference_variable | reference_variable | ||||
| simple_indirect_reference reference_variable { | | simple_indirect_reference reference_variable { | ||||
xhpast::Node *last = $1; | xhpast::Node *last = $1; | ||||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | |||||
| '$' '{' expr '}' { | | '$' '{' expr '}' { | ||||
NSPAN($1, n_VARIABLE_EXPRESSION, $4); | NSPAN($1, n_VARIABLE_EXPRESSION, $4); | ||||
$1->appendChild($3); | $1->appendChild($3); | ||||
$$ = $1; | $$ = $1; | ||||
} | } | ||||
; | ; | ||||
dim_offset: | dim_offset: | ||||
/* empty */ { | %empty { | ||||
$$ = NNEW(n_EMPTY); | $$ = NNEW(n_EMPTY); | ||||
} | } | ||||
| expr { | | expr { | ||||
$$ = $1; | $$ = $1; | ||||
} | } | ||||
; | ; | ||||
object_property: | object_property: | ||||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | |||||
; | ; | ||||
assignment_list_element: | assignment_list_element: | ||||
variable | variable | ||||
| T_LIST '(' assignment_list ')' { | | T_LIST '(' assignment_list ')' { | ||||
$$ = NNEW(n_LIST); | $$ = NNEW(n_LIST); | ||||
$$->appendChild(NEXPAND($2, $3, $4)); | $$->appendChild(NEXPAND($2, $3, $4)); | ||||
} | } | ||||
| /* empty */ { | | %empty { | ||||
$$ = NNEW(n_EMPTY); | $$ = NNEW(n_EMPTY); | ||||
} | } | ||||
; | ; | ||||
array_pair_list: | array_pair_list: | ||||
/* empty */ { | %empty { | ||||
$$ = NNEW(n_ARRAY_VALUE_LIST); | $$ = NNEW(n_ARRAY_VALUE_LIST); | ||||
} | } | ||||
| non_empty_array_pair_list possible_comma { | | non_empty_array_pair_list possible_comma { | ||||
$$ = NMORE($1, $2); | $$ = NMORE($1, $2); | ||||
} | } | ||||
; | ; | ||||
non_empty_array_pair_list: | non_empty_array_pair_list: | ||||
▲ Show 20 Lines • Show All 188 Lines • Show Last 20 Lines |