Changeset View
Changeset View
Standalone View
Standalone View
support/xhpast/parser.y
| Show First 20 Lines • Show All 1,061 Lines • ▼ Show 20 Lines | | T_VARIABLE { | ||||
| } | } | ||||
| ; | ; | ||||
| optional_type: | optional_type: | ||||
| %empty { | %empty { | ||||
| $$ = NNEW(n_EMPTY); | $$ = NNEW(n_EMPTY); | ||||
| } | } | ||||
| | type | | type | ||||
| | '?' type { | |||||
| $$ = NNEW(n_NULLABLE_TYPE); | |||||
| $$->appendChild($2); | |||||
| } | |||||
| ; | ; | ||||
| type: | type: | ||||
| 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); | ||||
| } | } | ||||
| ; | ; | ||||
| return_type: | return_type: | ||||
| %empty { | %empty { | ||||
| $$ = NNEW(n_EMPTY); | $$ = NNEW(n_EMPTY); | ||||
| } | } | ||||
| | ':' '?' type { | | ':' optional_type { | ||||
| $$ = NNEW(n_DECLARATION_RETURN); | $$ = NNEW(n_DECLARATION_RETURN); | ||||
| $$->appendChild(NTYPE($2, n_STRING)); | |||||
| $$->appendChild($3); | |||||
| } | |||||
| | ':' type { | |||||
| $$ = NNEW(n_DECLARATION_RETURN); | |||||
| $$->appendChild(NNEW(n_EMPTY)); | |||||
| $$->appendChild($2); | $$->appendChild($2); | ||||
| } | } | ||||
| ; | ; | ||||
| 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); | ||||
| ▲ Show 20 Lines • Show All 1,670 Lines • Show Last 20 Lines | |||||