# Tweak zendparse to be exported through ZEND_API. This has to be revisited once
# bison supports foreign skeletons and that bison version is used. Read
# https://git.savannah.gnu.org/cgit/bison.git/tree/data/README.md for more.
- @$(YACC) -p zend -v -d $(srcdir)/zend_language_parser.y -o $@
+ @$(YACC) $(YFLAGS) -p zend -v -d $(srcdir)/zend_language_parser.y -o $@
@$(SED) -e 's,^int zendparse\(.*\),ZEND_API int zendparse\1,g' < $@ \
> $@.tmp && \
mv $@.tmp $@
$(srcdir)/zend_ini_parser.h: $(srcdir)/zend_ini_parser.c
$(srcdir)/zend_ini_parser.c: $(srcdir)/zend_ini_parser.y
- @$(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o $@
+ @$(YACC) $(YFLAGS) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o $@
$(srcdir)/zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l
@(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt Zend/zend_ini_scanner_defs.h -oZend/zend_ini_scanner.c Zend/zend_ini_scanner.l)
top_statement_list:
top_statement_list top_statement { $$ = zend_ast_list_add($1, $2); }
- | /* empty */ { $$ = zend_ast_create_list(0, ZEND_AST_STMT_LIST); }
+ | %empty { $$ = zend_ast_create_list(0, ZEND_AST_STMT_LIST); }
;
namespace_name:
;
possible_comma:
- /* empty */
+ %empty
| ','
;
inner_statement_list:
inner_statement_list inner_statement
{ $$ = zend_ast_list_add($1, $2); }
- | /* empty */
+ | %empty
{ $$ = zend_ast_create_list(0, ZEND_AST_STMT_LIST); }
;
;
catch_list:
- /* empty */
+ %empty
{ $$ = zend_ast_create_list(0, ZEND_AST_CATCH_LIST); }
| catch_list T_CATCH '(' catch_name_list T_VARIABLE ')' '{' inner_statement_list '}'
{ $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_CATCH, $4, $5, $8)); }
;
finally_statement:
- /* empty */ { $$ = NULL; }
+ %empty { $$ = NULL; }
| T_FINALLY '{' inner_statement_list '}' { $$ = $3; }
;
;
is_reference:
- /* empty */ { $$ = 0; }
+ %empty { $$ = 0; }
| '&' { $$ = ZEND_PARAM_REF; }
;
is_variadic:
- /* empty */ { $$ = 0; }
+ %empty { $$ = 0; }
| T_ELLIPSIS { $$ = ZEND_PARAM_VARIADIC; }
;
;
extends_from:
- /* empty */ { $$ = NULL; }
+ %empty { $$ = NULL; }
| T_EXTENDS class_name { $$ = $2; }
;
interface_extends_list:
- /* empty */ { $$ = NULL; }
+ %empty { $$ = NULL; }
| T_EXTENDS class_name_list { $$ = $2; }
;
implements_list:
- /* empty */ { $$ = NULL; }
+ %empty { $$ = NULL; }
| T_IMPLEMENTS class_name_list { $$ = $2; }
;
;
case_list:
- /* empty */ { $$ = zend_ast_create_list(0, ZEND_AST_SWITCH_LIST); }
+ %empty { $$ = zend_ast_create_list(0, ZEND_AST_SWITCH_LIST); }
| case_list T_CASE expr case_separator inner_statement_list
{ $$ = zend_ast_list_add($1, zend_ast_create(ZEND_AST_SWITCH_CASE, $3, $5)); }
| case_list T_DEFAULT case_separator inner_statement_list
parameter_list:
non_empty_parameter_list { $$ = $1; }
- | /* empty */ { $$ = zend_ast_create_list(0, ZEND_AST_PARAM_LIST); }
+ | %empty { $$ = zend_ast_create_list(0, ZEND_AST_PARAM_LIST); }
;
optional_type:
- /* empty */ { $$ = NULL; }
+ %empty { $$ = NULL; }
| type_expr { $$ = $1; }
;
;
return_type:
- /* empty */ { $$ = NULL; }
+ %empty { $$ = NULL; }
| ':' type_expr { $$ = $2; }
;
class_statement_list:
class_statement_list class_statement
{ $$ = zend_ast_list_add($1, $2); }
- | /* empty */
+ | %empty
{ $$ = zend_ast_create_list(0, ZEND_AST_STMT_LIST); }
;
;
method_modifiers:
- /* empty */ { $$ = ZEND_ACC_PUBLIC; }
+ %empty { $$ = ZEND_ACC_PUBLIC; }
| non_empty_member_modifiers
{ $$ = $1; if (!($$ & ZEND_ACC_PPP_MASK)) { $$ |= ZEND_ACC_PUBLIC; } }
;
;
for_exprs:
- /* empty */ { $$ = NULL; }
+ %empty { $$ = NULL; }
| non_empty_for_exprs { $$ = $1; }
;
;
backup_doc_comment:
- /* empty */ { $$ = CG(doc_comment); CG(doc_comment) = NULL; }
+ %empty { $$ = CG(doc_comment); CG(doc_comment) = NULL; }
;
backup_fn_flags:
- %prec PREC_ARROW_FUNCTION /* empty */ { $$ = CG(extra_fn_flags); CG(extra_fn_flags) = 0; }
+ %prec PREC_ARROW_FUNCTION %empty { $$ = CG(extra_fn_flags); CG(extra_fn_flags) = 0; }
;
backup_lex_pos:
- /* empty */ { $$ = LANG_SCNG(yy_text); }
+ %empty { $$ = LANG_SCNG(yy_text); }
;
returns_ref:
- /* empty */ { $$ = 0; }
+ %empty { $$ = 0; }
| '&' { $$ = ZEND_ACC_RETURN_REFERENCE; }
;
lexical_vars:
- /* empty */ { $$ = NULL; }
+ %empty { $$ = NULL; }
| T_USE '(' lexical_var_list ')' { $$ = $3; }
;
;
exit_expr:
- /* empty */ { $$ = NULL; }
+ %empty { $$ = NULL; }
| '(' optional_expr ')' { $$ = $2; }
;
backticks_expr:
- /* empty */
+ %empty
{ $$ = zend_ast_create_zval_from_str(ZSTR_EMPTY_ALLOC()); }
| T_ENCAPSED_AND_WHITESPACE { $$ = $1; }
| encaps_list { $$ = $1; }
ctor_arguments:
- /* empty */ { $$ = zend_ast_create_list(0, ZEND_AST_ARG_LIST); }
+ %empty { $$ = zend_ast_create_list(0, ZEND_AST_ARG_LIST); }
| argument_list { $$ = $1; }
;
;
optional_expr:
- /* empty */ { $$ = NULL; }
+ %empty { $$ = NULL; }
| expr { $$ = $1; }
;
;
possible_array_pair:
- /* empty */ { $$ = NULL; }
+ %empty { $$ = NULL; }
| array_pair { $$ = $1; }
;