1 /* YACC parser for C syntax and for Objective C. -*-c-*-
2 Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996,
3 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 /* This file defines the grammar of C and that of Objective C.
23 ifobjc ... end ifobjc conditionals contain code for Objective C only.
24 ifc ... end ifc conditionals contain code for C only.
25 Sed commands in Makefile.in are used to convert this file into
26 c-parse.y and into objc-parse.y. */
28 /* To whomever it may concern: I have heard that such a thing was once
29 written by AT&T, but I have never seen it. */
32 %expect 10 /* shift/reduce conflicts, and no reduce/reduce conflicts. */
38 #include "coretypes.h"
45 #include "c-pragma.h" /* For YYDEBUG definition, and parse_in. */
53 #ifdef MULTIBYTE_CHARS
61 /* Like YYERROR but do call yyerror. */
62 #define YYERROR1 { yyerror ("syntax error"); YYERROR; }
64 /* Like the default stack expander, except (1) use realloc when possible,
65 (2) impose no hard maxiumum on stack size, (3) REALLY do not use alloca.
67 Irritatingly, YYSTYPE is defined after this %{ %} block, so we cannot
68 give malloced_yyvs its proper type. This is ok since all we need from
69 it is to be able to free it. */
71 static short *malloced_yyss;
72 static void *malloced_yyvs;
74 #define yyoverflow(MSG, SS, SSSIZE, VS, VSSIZE, YYSSZ) \
79 newsize = *(YYSSZ) *= 2; \
83 really_call_realloc (*(SS), newsize * sizeof (short)); \
85 really_call_realloc (*(VS), newsize * sizeof (YYSTYPE)); \
89 newss = (short *) really_call_malloc (newsize * sizeof (short)); \
90 newvs = (YYSTYPE *) really_call_malloc (newsize * sizeof (YYSTYPE)); \
92 memcpy (newss, *(SS), (SSSIZE)); \
94 memcpy (newvs, *(VS), (VSSIZE)); \
96 if (!newss || !newvs) \
103 malloced_yyss = newss; \
104 malloced_yyvs = (void *) newvs; \
110 %union {long itype; tree ttype; enum tree_code code;
111 location_t location; }
113 /* All identifiers that are not reserved words
114 and are not declared typedefs in the current block */
117 /* All identifiers that are declared typedefs in the current block.
118 In some contexts, they are treated just like IDENTIFIER,
119 but they can also serve as typespecs in declarations. */
122 /* Reserved words that specify storage class.
123 yylval contains an IDENTIFIER_NODE which indicates which one. */
124 %token SCSPEC /* Storage class other than static. */
125 %token STATIC /* Static storage class. */
127 /* Reserved words that specify type.
128 yylval contains an IDENTIFIER_NODE which indicates which one. */
131 /* Reserved words that qualify type: "const", "volatile", or "restrict".
132 yylval contains an IDENTIFIER_NODE which indicates which one. */
135 /* Character or numeric constants.
136 yylval is the node for the constant. */
139 /* String constants in raw form.
140 yylval is a STRING_CST node. */
144 /* "...", used for functions with variable arglists. */
147 /* the reserved words */
148 /* SCO include files test "ASM", so use something else. */
149 %token SIZEOF ENUM STRUCT UNION IF ELSE WHILE DO FOR SWITCH CASE DEFAULT
150 %token BREAK CONTINUE RETURN GOTO ASM_KEYWORD TYPEOF ALIGNOF
151 %token ATTRIBUTE EXTENSION LABEL
152 %token REALPART IMAGPART VA_ARG CHOOSE_EXPR TYPES_COMPATIBLE_P
153 %token PTR_VALUE PTR_BASE PTR_EXTENT
155 /* function name can be a string const or a var decl. */
156 %token STRING_FUNC_NAME VAR_FUNC_NAME
158 /* Add precedence rules to solve dangling else s/r conflict */
162 /* Define the operator tokens and their precedences.
163 The value is an integer because, if used, it is the tree code
164 to use in the expression made from the operator. */
166 %right <code> ASSIGN '='
167 %right <code> '?' ':'
173 %left <code> EQCOMPARE
174 %left <code> ARITHCOMPARE
175 %left <code> LSHIFT RSHIFT
177 %left <code> '*' '/' '%'
178 %right <code> UNARY PLUSPLUS MINUSMINUS
180 %left <code> POINTSAT '.' '(' '['
182 /* The Objective-C keywords. These are included in C and in
183 Objective C, so that the token codes are the same in both. */
184 %token INTERFACE IMPLEMENTATION END SELECTOR DEFS ENCODE
185 %token CLASSNAME PUBLIC PRIVATE PROTECTED PROTOCOL OBJECTNAME CLASS ALIAS
188 %type <ttype> ENUM STRUCT UNION IF ELSE WHILE DO FOR SWITCH CASE DEFAULT
189 %type <ttype> BREAK CONTINUE RETURN GOTO ASM_KEYWORD SIZEOF TYPEOF ALIGNOF
191 %type <ttype> identifier IDENTIFIER TYPENAME CONSTANT expr nonnull_exprlist exprlist
192 %type <ttype> expr_no_commas cast_expr unary_expr primary STRING
193 %type <ttype> declspecs_nosc_nots_nosa_noea declspecs_nosc_nots_nosa_ea
194 %type <ttype> declspecs_nosc_nots_sa_noea declspecs_nosc_nots_sa_ea
195 %type <ttype> declspecs_nosc_ts_nosa_noea declspecs_nosc_ts_nosa_ea
196 %type <ttype> declspecs_nosc_ts_sa_noea declspecs_nosc_ts_sa_ea
197 %type <ttype> declspecs_sc_nots_nosa_noea declspecs_sc_nots_nosa_ea
198 %type <ttype> declspecs_sc_nots_sa_noea declspecs_sc_nots_sa_ea
199 %type <ttype> declspecs_sc_ts_nosa_noea declspecs_sc_ts_nosa_ea
200 %type <ttype> declspecs_sc_ts_sa_noea declspecs_sc_ts_sa_ea
201 %type <ttype> declspecs_ts declspecs_nots
202 %type <ttype> declspecs_ts_nosa declspecs_nots_nosa
203 %type <ttype> declspecs_nosc_ts declspecs_nosc_nots declspecs_nosc declspecs
204 %type <ttype> maybe_type_quals_attrs typespec_nonattr typespec_attr
205 %type <ttype> typespec_reserved_nonattr typespec_reserved_attr
206 %type <ttype> typespec_nonreserved_nonattr
208 %type <ttype> scspec SCSPEC STATIC TYPESPEC TYPE_QUAL maybe_type_qual
209 %type <ttype> initdecls notype_initdecls initdcl notype_initdcl
210 %type <ttype> init maybeasm
211 %type <ttype> asm_operands nonnull_asm_operands asm_operand asm_clobbers
212 %type <ttype> maybe_attribute attributes attribute attribute_list attrib
213 %type <ttype> any_word extension
215 %type <ttype> compstmt compstmt_start compstmt_nostart compstmt_primary_start
216 %type <ttype> do_stmt_start poplevel stmt label
218 %type <ttype> c99_block_start c99_block_end
219 %type <ttype> declarator
220 %type <ttype> notype_declarator after_type_declarator
221 %type <ttype> parm_declarator
222 %type <ttype> parm_declarator_starttypename parm_declarator_nostarttypename
223 %type <ttype> array_declarator
225 %type <ttype> structsp_attr structsp_nonattr
226 %type <ttype> component_decl_list component_decl_list2
227 %type <ttype> component_decl components components_notype component_declarator
228 %type <ttype> component_notype_declarator
229 %type <ttype> enumlist enumerator
230 %type <ttype> struct_head union_head enum_head
231 %type <ttype> typename absdcl absdcl1 absdcl1_ea absdcl1_noea
232 %type <ttype> direct_absdcl1 absdcl_maybe_attribute
233 %type <ttype> xexpr parms parm firstparm identifiers
235 %type <ttype> parmlist parmlist_1 parmlist_2
236 %type <ttype> parmlist_or_identifiers parmlist_or_identifiers_1
237 %type <ttype> identifiers_or_typenames
239 %type <itype> setspecs setspecs_fp
241 %type <location> save_location
244 /* the Objective-C nonterminals */
246 %type <ttype> ivar_decl_list ivar_decls ivar_decl ivars ivar_declarator
247 %type <ttype> methoddecl unaryselector keywordselector selector
248 %type <ttype> keyworddecl receiver objcmessageexpr messageargs
249 %type <ttype> keywordexpr keywordarglist keywordarg
250 %type <ttype> myparms myparm optparmlist reservedwords objcselectorexpr
251 %type <ttype> selectorarg keywordnamelist keywordname objcencodeexpr
252 %type <ttype> objc_string non_empty_protocolrefs protocolrefs identifier_list objcprotocolexpr
254 %type <ttype> CLASSNAME OBJECTNAME
258 /* Number of statements (loosely speaking) and compound statements
260 static int stmt_count;
261 static int compstmt_count;
263 /* Input location of the end of the body of last simple_if;
264 used by the stmt-rule immediately after simple_if returns. */
265 static location_t if_stmt_locus;
268 /* List of types and structure classes of the current declaration. */
269 static GTY(()) tree current_declspecs;
270 static GTY(()) tree prefix_attributes;
272 /* List of all the attributes applying to the identifier currently being
273 declared; includes prefix_attributes and possibly some more attributes
274 just after a comma. */
275 static GTY(()) tree all_prefix_attributes;
277 /* Stack of saved values of current_declspecs, prefix_attributes and
278 all_prefix_attributes. */
279 static GTY(()) tree declspec_stack;
281 /* PUSH_DECLSPEC_STACK is called from setspecs; POP_DECLSPEC_STACK
282 should be called from the productions making use of setspecs. */
283 #define PUSH_DECLSPEC_STACK \
285 declspec_stack = tree_cons (build_tree_list (prefix_attributes, \
286 all_prefix_attributes), \
291 #define POP_DECLSPEC_STACK \
293 current_declspecs = TREE_VALUE (declspec_stack); \
294 prefix_attributes = TREE_PURPOSE (TREE_PURPOSE (declspec_stack)); \
295 all_prefix_attributes = TREE_VALUE (TREE_PURPOSE (declspec_stack)); \
296 declspec_stack = TREE_CHAIN (declspec_stack); \
299 /* For __extension__, save/restore the warning flags which are
300 controlled by __extension__. */
301 #define SAVE_EXT_FLAGS() \
303 | (warn_pointer_arith << 1) \
304 | (warn_traditional << 2) \
307 #define RESTORE_EXT_FLAGS(tval) \
309 int val = tree_low_cst (tval, 0); \
310 pedantic = val & 1; \
311 warn_pointer_arith = (val >> 1) & 1; \
312 warn_traditional = (val >> 2) & 1; \
313 flag_iso = (val >> 3) & 1; \
317 /* Objective-C specific parser/lexer information */
319 static enum tree_code objc_inherit_code;
320 static int objc_pq_context = 0, objc_public_flag = 0;
322 /* The following flag is needed to contextualize ObjC lexical analysis.
323 In some cases (e.g., 'int NSObject;'), it is undesirable to bind
324 an identifier to an ObjC class, even if a class with that name
326 static int objc_need_raw_identifier;
327 #define OBJC_NEED_RAW_IDENTIFIER(VAL) objc_need_raw_identifier = VAL
331 #define OBJC_NEED_RAW_IDENTIFIER(VAL) /* nothing */
334 static bool parsing_iso_function_signature;
336 /* Tell yyparse how to print a token's value, if yydebug is set. */
338 #define YYPRINT(FILE,YYCHAR,YYLVAL) yyprint(FILE,YYCHAR,YYLVAL)
340 static void yyprint PARAMS ((FILE *, int, YYSTYPE));
341 static void yyerror PARAMS ((const char *));
342 static int yylexname PARAMS ((void));
343 static int yylexstring PARAMS ((void));
344 static inline int _yylex PARAMS ((void));
345 static int yylex PARAMS ((void));
346 static void init_reswords PARAMS ((void));
348 /* Initialisation routine for this file. */
360 pedwarn ("ISO C forbids an empty source file");
365 /* In case there were missing closebraces,
366 get us back to the global binding level. */
367 while (! global_bindings_p ())
369 /* __FUNCTION__ is defined at file scope (""). This
370 call may not be necessary as my tests indicate it
371 still works without it. */
372 finish_fname_decls ();
377 /* the reason for the strange actions in this rule
378 is so that notype_initdecls when reached via datadef
379 can find a valid list of type and sc specs in $0. */
382 {$<ttype>$ = NULL_TREE; } extdef
383 | extdefs {$<ttype>$ = NULL_TREE; ggc_collect(); } extdef
388 { parsing_iso_function_signature = false; } /* Reset after any external definition. */
397 | ASM_KEYWORD '(' expr ')' ';'
399 if ((TREE_CODE ($3) == ADDR_EXPR
400 && TREE_CODE (TREE_OPERAND ($3, 0)) == STRING_CST)
401 || TREE_CODE ($3) == STRING_CST)
404 error ("argument of `asm' is not a constant string"); }
406 { RESTORE_EXT_FLAGS ($1); }
410 setspecs notype_initdecls ';'
412 error ("ISO C forbids data definition with no type or storage class");
414 warning ("data definition has no type or storage class");
416 POP_DECLSPEC_STACK; }
417 | declspecs_nots setspecs notype_initdecls ';'
418 { POP_DECLSPEC_STACK; }
419 | declspecs_ts setspecs initdecls ';'
420 { POP_DECLSPEC_STACK; }
427 pedwarn ("ISO C does not allow extra `;' outside of a function"); }
431 declspecs_ts setspecs declarator
432 { if (! start_function (current_declspecs, $3,
433 all_prefix_attributes))
436 old_style_parm_decls save_location
437 { DECL_SOURCE_LOCATION (current_function_decl) = $6;
438 store_parm_decls (); }
440 { finish_function (0, 1);
441 POP_DECLSPEC_STACK; }
442 | declspecs_ts setspecs declarator error
443 { POP_DECLSPEC_STACK; }
444 | declspecs_nots setspecs notype_declarator
445 { if (! start_function (current_declspecs, $3,
446 all_prefix_attributes))
449 old_style_parm_decls save_location
450 { DECL_SOURCE_LOCATION (current_function_decl) = $6;
451 store_parm_decls (); }
453 { finish_function (0, 1);
454 POP_DECLSPEC_STACK; }
455 | declspecs_nots setspecs notype_declarator error
456 { POP_DECLSPEC_STACK; }
457 | setspecs notype_declarator
458 { if (! start_function (NULL_TREE, $2,
459 all_prefix_attributes))
462 old_style_parm_decls save_location
463 { DECL_SOURCE_LOCATION (current_function_decl) = $5;
464 store_parm_decls (); }
466 { finish_function (0, 1);
467 POP_DECLSPEC_STACK; }
468 | setspecs notype_declarator error
469 { POP_DECLSPEC_STACK; }
484 { $$ = NEGATE_EXPR; }
488 if (warn_traditional && !in_system_header)
489 warning ("traditional C rejects the unary plus operator");
493 { $$ = PREINCREMENT_EXPR; }
495 { $$ = PREDECREMENT_EXPR; }
497 { $$ = BIT_NOT_EXPR; }
499 { $$ = TRUTH_NOT_EXPR; }
502 expr: nonnull_exprlist
503 { $$ = build_compound_expr ($1); }
514 { $$ = build_tree_list (NULL_TREE, $1); }
515 | nonnull_exprlist ',' expr_no_commas
516 { chainon ($1, build_tree_list (NULL_TREE, $3)); }
521 | '*' cast_expr %prec UNARY
522 { $$ = build_indirect_ref ($2, "unary *"); }
523 /* __extension__ turns off -pedantic for following primary. */
524 | extension cast_expr %prec UNARY
526 RESTORE_EXT_FLAGS ($1); }
527 | unop cast_expr %prec UNARY
528 { $$ = build_unary_op ($1, $2, 0);
529 overflow_warning ($$); }
530 /* Refer to the address of a label as a pointer. */
532 { $$ = finish_label_address_expr ($2); }
533 | sizeof unary_expr %prec UNARY
535 if (TREE_CODE ($2) == COMPONENT_REF
536 && DECL_C_BIT_FIELD (TREE_OPERAND ($2, 1)))
537 error ("`sizeof' applied to a bit-field");
538 $$ = c_sizeof (TREE_TYPE ($2)); }
539 | sizeof '(' typename ')' %prec HYPERUNARY
541 $$ = c_sizeof (groktypename ($3)); }
542 | alignof unary_expr %prec UNARY
544 $$ = c_alignof_expr ($2); }
545 | alignof '(' typename ')' %prec HYPERUNARY
547 $$ = c_alignof (groktypename ($3)); }
548 | REALPART cast_expr %prec UNARY
549 { $$ = build_unary_op (REALPART_EXPR, $2, 0); }
550 | IMAGPART cast_expr %prec UNARY
551 { $$ = build_unary_op (IMAGPART_EXPR, $2, 0); }
555 SIZEOF { skip_evaluation++; }
559 ALIGNOF { skip_evaluation++; }
563 TYPEOF { skip_evaluation++; }
568 | '(' typename ')' cast_expr %prec UNARY
569 { $$ = c_cast_expr ($2, $4); }
574 | expr_no_commas '+' expr_no_commas
575 { $$ = parser_build_binary_op ($2, $1, $3); }
576 | expr_no_commas '-' expr_no_commas
577 { $$ = parser_build_binary_op ($2, $1, $3); }
578 | expr_no_commas '*' expr_no_commas
579 { $$ = parser_build_binary_op ($2, $1, $3); }
580 | expr_no_commas '/' expr_no_commas
581 { $$ = parser_build_binary_op ($2, $1, $3); }
582 | expr_no_commas '%' expr_no_commas
583 { $$ = parser_build_binary_op ($2, $1, $3); }
584 | expr_no_commas LSHIFT expr_no_commas
585 { $$ = parser_build_binary_op ($2, $1, $3); }
586 | expr_no_commas RSHIFT expr_no_commas
587 { $$ = parser_build_binary_op ($2, $1, $3); }
588 | expr_no_commas ARITHCOMPARE expr_no_commas
589 { $$ = parser_build_binary_op ($2, $1, $3); }
590 | expr_no_commas EQCOMPARE expr_no_commas
591 { $$ = parser_build_binary_op ($2, $1, $3); }
592 | expr_no_commas '&' expr_no_commas
593 { $$ = parser_build_binary_op ($2, $1, $3); }
594 | expr_no_commas '|' expr_no_commas
595 { $$ = parser_build_binary_op ($2, $1, $3); }
596 | expr_no_commas '^' expr_no_commas
597 { $$ = parser_build_binary_op ($2, $1, $3); }
598 | expr_no_commas ANDAND
599 { $1 = c_common_truthvalue_conversion
600 (default_conversion ($1));
601 skip_evaluation += $1 == boolean_false_node; }
603 { skip_evaluation -= $1 == boolean_false_node;
604 $$ = parser_build_binary_op (TRUTH_ANDIF_EXPR, $1, $4); }
605 | expr_no_commas OROR
606 { $1 = c_common_truthvalue_conversion
607 (default_conversion ($1));
608 skip_evaluation += $1 == boolean_true_node; }
610 { skip_evaluation -= $1 == boolean_true_node;
611 $$ = parser_build_binary_op (TRUTH_ORIF_EXPR, $1, $4); }
613 { $1 = c_common_truthvalue_conversion
614 (default_conversion ($1));
615 skip_evaluation += $1 == boolean_false_node; }
617 { skip_evaluation += (($1 == boolean_true_node)
618 - ($1 == boolean_false_node)); }
620 { skip_evaluation -= $1 == boolean_true_node;
621 $$ = build_conditional_expr ($1, $4, $7); }
624 pedwarn ("ISO C forbids omitting the middle term of a ?: expression");
625 /* Make sure first operand is calculated only once. */
626 $<ttype>2 = save_expr ($1);
627 $1 = c_common_truthvalue_conversion
628 (default_conversion ($<ttype>2));
629 skip_evaluation += $1 == boolean_true_node; }
631 { skip_evaluation -= $1 == boolean_true_node;
632 $$ = build_conditional_expr ($1, $<ttype>2, $5); }
633 | expr_no_commas '=' expr_no_commas
635 $$ = build_modify_expr ($1, NOP_EXPR, $3);
636 class = TREE_CODE_CLASS (TREE_CODE ($$));
637 if (IS_EXPR_CODE_CLASS (class))
638 C_SET_EXP_ORIGINAL_CODE ($$, MODIFY_EXPR);
640 | expr_no_commas ASSIGN expr_no_commas
642 $$ = build_modify_expr ($1, $2, $3);
643 /* This inhibits warnings in
644 c_common_truthvalue_conversion. */
645 class = TREE_CODE_CLASS (TREE_CODE ($$));
646 if (IS_EXPR_CODE_CLASS (class))
647 C_SET_EXP_ORIGINAL_CODE ($$, ERROR_MARK);
654 if (yychar == YYEMPTY)
656 $$ = build_external_ref ($1, yychar == '(');
660 { $$ = fix_string_type ($$); }
662 { $$ = fname_decl (C_RID_CODE ($$), $$); }
663 | '(' typename ')' '{'
664 { start_init (NULL_TREE, NULL, 0);
665 $2 = groktypename ($2);
666 really_start_incremental_init ($2); }
667 initlist_maybe_comma '}' %prec UNARY
668 { tree constructor = pop_init_level (0);
672 if (pedantic && ! flag_isoc99)
673 pedwarn ("ISO C89 forbids compound literals");
674 $$ = build_compound_literal (type, constructor);
677 { char class = TREE_CODE_CLASS (TREE_CODE ($2));
678 if (IS_EXPR_CODE_CLASS (class))
679 C_SET_EXP_ORIGINAL_CODE ($2, ERROR_MARK);
682 { $$ = error_mark_node; }
683 | compstmt_primary_start compstmt_nostart ')'
684 { tree saved_last_tree;
687 pedwarn ("ISO C forbids braced-groups within expressions");
690 saved_last_tree = COMPOUND_BODY ($1);
691 RECHAIN_STMTS ($1, COMPOUND_BODY ($1));
692 last_tree = saved_last_tree;
693 TREE_CHAIN (last_tree) = NULL_TREE;
695 last_expr_type = void_type_node;
696 $$ = build1 (STMT_EXPR, last_expr_type, $1);
697 TREE_SIDE_EFFECTS ($$) = 1;
699 | compstmt_primary_start error ')'
702 last_tree = COMPOUND_BODY ($1);
703 TREE_CHAIN (last_tree) = NULL_TREE;
704 $$ = error_mark_node;
706 | primary '(' exprlist ')' %prec '.'
707 { $$ = build_function_call ($1, $3); }
708 | VA_ARG '(' expr_no_commas ',' typename ')'
709 { $$ = build_va_arg ($3, groktypename ($5)); }
711 | CHOOSE_EXPR '(' expr_no_commas ',' expr_no_commas ',' expr_no_commas ')'
717 if (TREE_CODE (c) != INTEGER_CST)
718 error ("first argument to __builtin_choose_expr not a constant");
719 $$ = integer_zerop (c) ? $7 : $5;
721 | TYPES_COMPATIBLE_P '(' typename ',' typename ')'
725 e1 = TYPE_MAIN_VARIANT (groktypename ($3));
726 e2 = TYPE_MAIN_VARIANT (groktypename ($5));
728 $$ = comptypes (e1, e2)
729 ? build_int_2 (1, 0) : build_int_2 (0, 0);
731 | primary '[' expr ']' %prec '.'
732 { $$ = build_array_ref ($1, $3); }
733 | primary '.' identifier
736 if (!is_public ($1, $3))
737 $$ = error_mark_node;
740 $$ = build_component_ref ($1, $3);
742 | primary POINTSAT identifier
744 tree expr = build_indirect_ref ($1, "->");
747 if (!is_public (expr, $3))
748 $$ = error_mark_node;
751 $$ = build_component_ref (expr, $3);
754 { $$ = build_unary_op (POSTINCREMENT_EXPR, $1, 0); }
756 { $$ = build_unary_op (POSTDECREMENT_EXPR, $1, 0); }
759 { $$ = build_message_expr ($1); }
761 { $$ = build_selector_expr ($1); }
763 { $$ = build_protocol_expr ($1); }
765 { $$ = build_encode_expr ($1); }
767 { $$ = build_objc_string_object ($1); }
772 /* Produces an STRING_CST with perhaps more STRING_CSTs chained
773 onto it, which is to be read as an ObjC string object. */
777 | objc_string '@' STRING
778 { $$ = chainon ($1, $3); }
782 old_style_parm_decls:
783 old_style_parm_decls_1
785 parsing_iso_function_signature = false; /* Reset after decls. */
789 old_style_parm_decls_1:
792 if (warn_traditional && !in_system_header
793 && parsing_iso_function_signature)
794 warning ("traditional C rejects ISO C style function definitions");
795 parsing_iso_function_signature = false; /* Reset after warning. */
800 /* The following are analogous to lineno_decl, decls and decl
801 except that they do not allow nested functions.
802 They are used for old-style parm decls. */
804 save_location datadecl
811 | datadecls lineno_datadecl
812 | lineno_datadecl errstmt
815 /* We don't allow prefix attributes here because they cause reduce/reduce
816 conflicts: we can't know whether we're parsing a function decl with
817 attribute suffix, or function defn with attribute prefix on first old
820 declspecs_ts_nosa setspecs initdecls ';'
821 { POP_DECLSPEC_STACK; }
822 | declspecs_nots_nosa setspecs notype_initdecls ';'
823 { POP_DECLSPEC_STACK; }
824 | declspecs_ts_nosa ';'
825 { shadow_tag_warned ($1, 1);
826 pedwarn ("empty declaration"); }
827 | declspecs_nots_nosa ';'
828 { pedwarn ("empty declaration"); }
831 /* This combination which saves a lineno before a decl
832 is the normal thing to use, rather than decl itself.
833 This is to avoid shift/reduce conflicts in contexts
834 where statement labels are allowed. */
840 /* records the type and storage class specs to use for processing
841 the declarators that follow.
842 Maintains a stack of outer-level values of current_declspecs,
843 for the sake of parm declarations nested in function declarators. */
844 setspecs: /* empty */
845 { pending_xref_error ();
847 split_specs_attrs ($<ttype>0,
848 ¤t_declspecs, &prefix_attributes);
849 all_prefix_attributes = prefix_attributes; }
852 /* Possibly attributes after a comma, which should reset all_prefix_attributes
853 to prefix_attributes with these ones chained on the front. */
856 { all_prefix_attributes = chainon ($1, prefix_attributes); }
860 declspecs_ts setspecs initdecls ';'
861 { POP_DECLSPEC_STACK; }
862 | declspecs_nots setspecs notype_initdecls ';'
863 { POP_DECLSPEC_STACK; }
864 | declspecs_ts setspecs nested_function
865 { POP_DECLSPEC_STACK; }
866 | declspecs_nots setspecs notype_nested_function
867 { POP_DECLSPEC_STACK; }
871 { RESTORE_EXT_FLAGS ($1); }
874 /* A list of declaration specifiers. These are:
876 - Storage class specifiers (scspec), which for GCC currently includes
877 function specifiers ("inline").
879 - Type specifiers (typespec_*).
881 - Type qualifiers (TYPE_QUAL).
883 - Attribute specifier lists (attributes).
885 These are stored as a TREE_LIST; the head of the list is the last
886 item in the specifier list. Each entry in the list has either a
887 TREE_PURPOSE that is an attribute specifier list, or a TREE_VALUE that
888 is a single other specifier or qualifier; and a TREE_CHAIN that is the
889 rest of the list. TREE_STATIC is set on the list if something other
890 than a storage class specifier or attribute has been seen; this is used
891 to warn for the obsolescent usage of storage class specifiers other than
892 at the start of the list. (Doing this properly would require function
893 specifiers to be handled separately from storage class specifiers.)
895 The various cases below are classified according to:
897 (a) Whether a storage class specifier is included or not; some
898 places in the grammar disallow storage class specifiers (_sc or _nosc).
900 (b) Whether a type specifier has been seen; after a type specifier,
901 a typedef name is an identifier to redeclare (_ts or _nots).
903 (c) Whether the list starts with an attribute; in certain places,
904 the grammar requires specifiers that don't start with an attribute
907 (d) Whether the list ends with an attribute (or a specifier such that
908 any following attribute would have been parsed as part of that specifier);
909 this avoids shift-reduce conflicts in the parsing of attributes
914 (i) Distinguish between function specifiers and storage class specifiers,
915 at least for the purpose of warnings about obsolescent usage.
917 (ii) Halve the number of productions here by eliminating the _sc/_nosc
918 distinction and instead checking where required that storage class
919 specifiers aren't present. */
921 /* Declspecs which contain at least one type specifier or typedef name.
922 (Just `const' or `volatile' is not enough.)
923 A typedef'd name following these is taken as a name to be declared.
924 Declspecs have a non-NULL TREE_VALUE, attributes do not. */
926 declspecs_nosc_nots_nosa_noea:
928 { $$ = tree_cons (NULL_TREE, $1, NULL_TREE);
929 TREE_STATIC ($$) = 1; }
930 | declspecs_nosc_nots_nosa_noea TYPE_QUAL
931 { $$ = tree_cons (NULL_TREE, $2, $1);
932 TREE_STATIC ($$) = 1; }
933 | declspecs_nosc_nots_nosa_ea TYPE_QUAL
934 { $$ = tree_cons (NULL_TREE, $2, $1);
935 TREE_STATIC ($$) = 1; }
938 declspecs_nosc_nots_nosa_ea:
939 declspecs_nosc_nots_nosa_noea attributes
940 { $$ = tree_cons ($2, NULL_TREE, $1);
941 TREE_STATIC ($$) = TREE_STATIC ($1); }
944 declspecs_nosc_nots_sa_noea:
945 declspecs_nosc_nots_sa_noea TYPE_QUAL
946 { $$ = tree_cons (NULL_TREE, $2, $1);
947 TREE_STATIC ($$) = 1; }
948 | declspecs_nosc_nots_sa_ea TYPE_QUAL
949 { $$ = tree_cons (NULL_TREE, $2, $1);
950 TREE_STATIC ($$) = 1; }
953 declspecs_nosc_nots_sa_ea:
955 { $$ = tree_cons ($1, NULL_TREE, NULL_TREE);
956 TREE_STATIC ($$) = 0; }
957 | declspecs_nosc_nots_sa_noea attributes
958 { $$ = tree_cons ($2, NULL_TREE, $1);
959 TREE_STATIC ($$) = TREE_STATIC ($1); }
962 declspecs_nosc_ts_nosa_noea:
964 { $$ = tree_cons (NULL_TREE, $1, NULL_TREE);
965 TREE_STATIC ($$) = 1; }
966 | declspecs_nosc_ts_nosa_noea TYPE_QUAL
967 { $$ = tree_cons (NULL_TREE, $2, $1);
968 TREE_STATIC ($$) = 1; }
969 | declspecs_nosc_ts_nosa_ea TYPE_QUAL
970 { $$ = tree_cons (NULL_TREE, $2, $1);
971 TREE_STATIC ($$) = 1; }
972 | declspecs_nosc_ts_nosa_noea typespec_reserved_nonattr
973 { $$ = tree_cons (NULL_TREE, $2, $1);
974 TREE_STATIC ($$) = 1; }
975 | declspecs_nosc_ts_nosa_ea typespec_reserved_nonattr
976 { $$ = tree_cons (NULL_TREE, $2, $1);
977 TREE_STATIC ($$) = 1; }
978 | declspecs_nosc_nots_nosa_noea typespec_nonattr
979 { $$ = tree_cons (NULL_TREE, $2, $1);
980 TREE_STATIC ($$) = 1; }
981 | declspecs_nosc_nots_nosa_ea typespec_nonattr
982 { $$ = tree_cons (NULL_TREE, $2, $1);
983 TREE_STATIC ($$) = 1; }
986 declspecs_nosc_ts_nosa_ea:
988 { $$ = tree_cons (NULL_TREE, $1, NULL_TREE);
989 TREE_STATIC ($$) = 1; }
990 | declspecs_nosc_ts_nosa_noea attributes
991 { $$ = tree_cons ($2, NULL_TREE, $1);
992 TREE_STATIC ($$) = TREE_STATIC ($1); }
993 | declspecs_nosc_ts_nosa_noea typespec_reserved_attr
994 { $$ = tree_cons (NULL_TREE, $2, $1);
995 TREE_STATIC ($$) = 1; }
996 | declspecs_nosc_ts_nosa_ea typespec_reserved_attr
997 { $$ = tree_cons (NULL_TREE, $2, $1);
998 TREE_STATIC ($$) = 1; }
999 | declspecs_nosc_nots_nosa_noea typespec_attr
1000 { $$ = tree_cons (NULL_TREE, $2, $1);
1001 TREE_STATIC ($$) = 1; }
1002 | declspecs_nosc_nots_nosa_ea typespec_attr
1003 { $$ = tree_cons (NULL_TREE, $2, $1);
1004 TREE_STATIC ($$) = 1; }
1007 declspecs_nosc_ts_sa_noea:
1008 declspecs_nosc_ts_sa_noea TYPE_QUAL
1009 { $$ = tree_cons (NULL_TREE, $2, $1);
1010 TREE_STATIC ($$) = 1; }
1011 | declspecs_nosc_ts_sa_ea TYPE_QUAL
1012 { $$ = tree_cons (NULL_TREE, $2, $1);
1013 TREE_STATIC ($$) = 1; }
1014 | declspecs_nosc_ts_sa_noea typespec_reserved_nonattr
1015 { $$ = tree_cons (NULL_TREE, $2, $1);
1016 TREE_STATIC ($$) = 1; }
1017 | declspecs_nosc_ts_sa_ea typespec_reserved_nonattr
1018 { $$ = tree_cons (NULL_TREE, $2, $1);
1019 TREE_STATIC ($$) = 1; }
1020 | declspecs_nosc_nots_sa_noea typespec_nonattr
1021 { $$ = tree_cons (NULL_TREE, $2, $1);
1022 TREE_STATIC ($$) = 1; }
1023 | declspecs_nosc_nots_sa_ea typespec_nonattr
1024 { $$ = tree_cons (NULL_TREE, $2, $1);
1025 TREE_STATIC ($$) = 1; }
1028 declspecs_nosc_ts_sa_ea:
1029 declspecs_nosc_ts_sa_noea attributes
1030 { $$ = tree_cons ($2, NULL_TREE, $1);
1031 TREE_STATIC ($$) = TREE_STATIC ($1); }
1032 | declspecs_nosc_ts_sa_noea typespec_reserved_attr
1033 { $$ = tree_cons (NULL_TREE, $2, $1);
1034 TREE_STATIC ($$) = 1; }
1035 | declspecs_nosc_ts_sa_ea typespec_reserved_attr
1036 { $$ = tree_cons (NULL_TREE, $2, $1);
1037 TREE_STATIC ($$) = 1; }
1038 | declspecs_nosc_nots_sa_noea typespec_attr
1039 { $$ = tree_cons (NULL_TREE, $2, $1);
1040 TREE_STATIC ($$) = 1; }
1041 | declspecs_nosc_nots_sa_ea typespec_attr
1042 { $$ = tree_cons (NULL_TREE, $2, $1);
1043 TREE_STATIC ($$) = 1; }
1046 declspecs_sc_nots_nosa_noea:
1048 { $$ = tree_cons (NULL_TREE, $1, NULL_TREE);
1049 TREE_STATIC ($$) = 0; }
1050 | declspecs_sc_nots_nosa_noea TYPE_QUAL
1051 { $$ = tree_cons (NULL_TREE, $2, $1);
1052 TREE_STATIC ($$) = 1; }
1053 | declspecs_sc_nots_nosa_ea TYPE_QUAL
1054 { $$ = tree_cons (NULL_TREE, $2, $1);
1055 TREE_STATIC ($$) = 1; }
1056 | declspecs_nosc_nots_nosa_noea scspec
1057 { if (extra_warnings && TREE_STATIC ($1))
1058 warning ("`%s' is not at beginning of declaration",
1059 IDENTIFIER_POINTER ($2));
1060 $$ = tree_cons (NULL_TREE, $2, $1);
1061 TREE_STATIC ($$) = TREE_STATIC ($1); }
1062 | declspecs_nosc_nots_nosa_ea scspec
1063 { if (extra_warnings && TREE_STATIC ($1))
1064 warning ("`%s' is not at beginning of declaration",
1065 IDENTIFIER_POINTER ($2));
1066 $$ = tree_cons (NULL_TREE, $2, $1);
1067 TREE_STATIC ($$) = TREE_STATIC ($1); }
1068 | declspecs_sc_nots_nosa_noea scspec
1069 { if (extra_warnings && TREE_STATIC ($1))
1070 warning ("`%s' is not at beginning of declaration",
1071 IDENTIFIER_POINTER ($2));
1072 $$ = tree_cons (NULL_TREE, $2, $1);
1073 TREE_STATIC ($$) = TREE_STATIC ($1); }
1074 | declspecs_sc_nots_nosa_ea scspec
1075 { if (extra_warnings && TREE_STATIC ($1))
1076 warning ("`%s' is not at beginning of declaration",
1077 IDENTIFIER_POINTER ($2));
1078 $$ = tree_cons (NULL_TREE, $2, $1);
1079 TREE_STATIC ($$) = TREE_STATIC ($1); }
1082 declspecs_sc_nots_nosa_ea:
1083 declspecs_sc_nots_nosa_noea attributes
1084 { $$ = tree_cons ($2, NULL_TREE, $1);
1085 TREE_STATIC ($$) = TREE_STATIC ($1); }
1088 declspecs_sc_nots_sa_noea:
1089 declspecs_sc_nots_sa_noea TYPE_QUAL
1090 { $$ = tree_cons (NULL_TREE, $2, $1);
1091 TREE_STATIC ($$) = 1; }
1092 | declspecs_sc_nots_sa_ea TYPE_QUAL
1093 { $$ = tree_cons (NULL_TREE, $2, $1);
1094 TREE_STATIC ($$) = 1; }
1095 | declspecs_nosc_nots_sa_noea scspec
1096 { if (extra_warnings && TREE_STATIC ($1))
1097 warning ("`%s' is not at beginning of declaration",
1098 IDENTIFIER_POINTER ($2));
1099 $$ = tree_cons (NULL_TREE, $2, $1);
1100 TREE_STATIC ($$) = TREE_STATIC ($1); }
1101 | declspecs_nosc_nots_sa_ea scspec
1102 { if (extra_warnings && TREE_STATIC ($1))
1103 warning ("`%s' is not at beginning of declaration",
1104 IDENTIFIER_POINTER ($2));
1105 $$ = tree_cons (NULL_TREE, $2, $1);
1106 TREE_STATIC ($$) = TREE_STATIC ($1); }
1107 | declspecs_sc_nots_sa_noea scspec
1108 { if (extra_warnings && TREE_STATIC ($1))
1109 warning ("`%s' is not at beginning of declaration",
1110 IDENTIFIER_POINTER ($2));
1111 $$ = tree_cons (NULL_TREE, $2, $1);
1112 TREE_STATIC ($$) = TREE_STATIC ($1); }
1113 | declspecs_sc_nots_sa_ea scspec
1114 { if (extra_warnings && TREE_STATIC ($1))
1115 warning ("`%s' is not at beginning of declaration",
1116 IDENTIFIER_POINTER ($2));
1117 $$ = tree_cons (NULL_TREE, $2, $1);
1118 TREE_STATIC ($$) = TREE_STATIC ($1); }
1121 declspecs_sc_nots_sa_ea:
1122 declspecs_sc_nots_sa_noea attributes
1123 { $$ = tree_cons ($2, NULL_TREE, $1);
1124 TREE_STATIC ($$) = TREE_STATIC ($1); }
1127 declspecs_sc_ts_nosa_noea:
1128 declspecs_sc_ts_nosa_noea TYPE_QUAL
1129 { $$ = tree_cons (NULL_TREE, $2, $1);
1130 TREE_STATIC ($$) = 1; }
1131 | declspecs_sc_ts_nosa_ea TYPE_QUAL
1132 { $$ = tree_cons (NULL_TREE, $2, $1);
1133 TREE_STATIC ($$) = 1; }
1134 | declspecs_sc_ts_nosa_noea typespec_reserved_nonattr
1135 { $$ = tree_cons (NULL_TREE, $2, $1);
1136 TREE_STATIC ($$) = 1; }
1137 | declspecs_sc_ts_nosa_ea typespec_reserved_nonattr
1138 { $$ = tree_cons (NULL_TREE, $2, $1);
1139 TREE_STATIC ($$) = 1; }
1140 | declspecs_sc_nots_nosa_noea typespec_nonattr
1141 { $$ = tree_cons (NULL_TREE, $2, $1);
1142 TREE_STATIC ($$) = 1; }
1143 | declspecs_sc_nots_nosa_ea typespec_nonattr
1144 { $$ = tree_cons (NULL_TREE, $2, $1);
1145 TREE_STATIC ($$) = 1; }
1146 | declspecs_nosc_ts_nosa_noea scspec
1147 { if (extra_warnings && TREE_STATIC ($1))
1148 warning ("`%s' is not at beginning of declaration",
1149 IDENTIFIER_POINTER ($2));
1150 $$ = tree_cons (NULL_TREE, $2, $1);
1151 TREE_STATIC ($$) = TREE_STATIC ($1); }
1152 | declspecs_nosc_ts_nosa_ea scspec
1153 { if (extra_warnings && TREE_STATIC ($1))
1154 warning ("`%s' is not at beginning of declaration",
1155 IDENTIFIER_POINTER ($2));
1156 $$ = tree_cons (NULL_TREE, $2, $1);
1157 TREE_STATIC ($$) = TREE_STATIC ($1); }
1158 | declspecs_sc_ts_nosa_noea scspec
1159 { if (extra_warnings && TREE_STATIC ($1))
1160 warning ("`%s' is not at beginning of declaration",
1161 IDENTIFIER_POINTER ($2));
1162 $$ = tree_cons (NULL_TREE, $2, $1);
1163 TREE_STATIC ($$) = TREE_STATIC ($1); }
1164 | declspecs_sc_ts_nosa_ea scspec
1165 { if (extra_warnings && TREE_STATIC ($1))
1166 warning ("`%s' is not at beginning of declaration",
1167 IDENTIFIER_POINTER ($2));
1168 $$ = tree_cons (NULL_TREE, $2, $1);
1169 TREE_STATIC ($$) = TREE_STATIC ($1); }
1172 declspecs_sc_ts_nosa_ea:
1173 declspecs_sc_ts_nosa_noea attributes
1174 { $$ = tree_cons ($2, NULL_TREE, $1);
1175 TREE_STATIC ($$) = TREE_STATIC ($1); }
1176 | declspecs_sc_ts_nosa_noea typespec_reserved_attr
1177 { $$ = tree_cons (NULL_TREE, $2, $1);
1178 TREE_STATIC ($$) = 1; }
1179 | declspecs_sc_ts_nosa_ea typespec_reserved_attr
1180 { $$ = tree_cons (NULL_TREE, $2, $1);
1181 TREE_STATIC ($$) = 1; }
1182 | declspecs_sc_nots_nosa_noea typespec_attr
1183 { $$ = tree_cons (NULL_TREE, $2, $1);
1184 TREE_STATIC ($$) = 1; }
1185 | declspecs_sc_nots_nosa_ea typespec_attr
1186 { $$ = tree_cons (NULL_TREE, $2, $1);
1187 TREE_STATIC ($$) = 1; }
1190 declspecs_sc_ts_sa_noea:
1191 declspecs_sc_ts_sa_noea TYPE_QUAL
1192 { $$ = tree_cons (NULL_TREE, $2, $1);
1193 TREE_STATIC ($$) = 1; }
1194 | declspecs_sc_ts_sa_ea TYPE_QUAL
1195 { $$ = tree_cons (NULL_TREE, $2, $1);
1196 TREE_STATIC ($$) = 1; }
1197 | declspecs_sc_ts_sa_noea typespec_reserved_nonattr
1198 { $$ = tree_cons (NULL_TREE, $2, $1);
1199 TREE_STATIC ($$) = 1; }
1200 | declspecs_sc_ts_sa_ea typespec_reserved_nonattr
1201 { $$ = tree_cons (NULL_TREE, $2, $1);
1202 TREE_STATIC ($$) = 1; }
1203 | declspecs_sc_nots_sa_noea typespec_nonattr
1204 { $$ = tree_cons (NULL_TREE, $2, $1);
1205 TREE_STATIC ($$) = 1; }
1206 | declspecs_sc_nots_sa_ea typespec_nonattr
1207 { $$ = tree_cons (NULL_TREE, $2, $1);
1208 TREE_STATIC ($$) = 1; }
1209 | declspecs_nosc_ts_sa_noea scspec
1210 { if (extra_warnings && TREE_STATIC ($1))
1211 warning ("`%s' is not at beginning of declaration",
1212 IDENTIFIER_POINTER ($2));
1213 $$ = tree_cons (NULL_TREE, $2, $1);
1214 TREE_STATIC ($$) = TREE_STATIC ($1); }
1215 | declspecs_nosc_ts_sa_ea scspec
1216 { if (extra_warnings && TREE_STATIC ($1))
1217 warning ("`%s' is not at beginning of declaration",
1218 IDENTIFIER_POINTER ($2));
1219 $$ = tree_cons (NULL_TREE, $2, $1);
1220 TREE_STATIC ($$) = TREE_STATIC ($1); }
1221 | declspecs_sc_ts_sa_noea scspec
1222 { if (extra_warnings && TREE_STATIC ($1))
1223 warning ("`%s' is not at beginning of declaration",
1224 IDENTIFIER_POINTER ($2));
1225 $$ = tree_cons (NULL_TREE, $2, $1);
1226 TREE_STATIC ($$) = TREE_STATIC ($1); }
1227 | declspecs_sc_ts_sa_ea scspec
1228 { if (extra_warnings && TREE_STATIC ($1))
1229 warning ("`%s' is not at beginning of declaration",
1230 IDENTIFIER_POINTER ($2));
1231 $$ = tree_cons (NULL_TREE, $2, $1);
1232 TREE_STATIC ($$) = TREE_STATIC ($1); }
1235 declspecs_sc_ts_sa_ea:
1236 declspecs_sc_ts_sa_noea attributes
1237 { $$ = tree_cons ($2, NULL_TREE, $1);
1238 TREE_STATIC ($$) = TREE_STATIC ($1); }
1239 | declspecs_sc_ts_sa_noea typespec_reserved_attr
1240 { $$ = tree_cons (NULL_TREE, $2, $1);
1241 TREE_STATIC ($$) = 1; }
1242 | declspecs_sc_ts_sa_ea typespec_reserved_attr
1243 { $$ = tree_cons (NULL_TREE, $2, $1);
1244 TREE_STATIC ($$) = 1; }
1245 | declspecs_sc_nots_sa_noea typespec_attr
1246 { $$ = tree_cons (NULL_TREE, $2, $1);
1247 TREE_STATIC ($$) = 1; }
1248 | declspecs_sc_nots_sa_ea typespec_attr
1249 { $$ = tree_cons (NULL_TREE, $2, $1);
1250 TREE_STATIC ($$) = 1; }
1253 /* Particular useful classes of declspecs. */
1255 declspecs_nosc_ts_nosa_noea
1256 | declspecs_nosc_ts_nosa_ea
1257 | declspecs_nosc_ts_sa_noea
1258 | declspecs_nosc_ts_sa_ea
1259 | declspecs_sc_ts_nosa_noea
1260 | declspecs_sc_ts_nosa_ea
1261 | declspecs_sc_ts_sa_noea
1262 | declspecs_sc_ts_sa_ea
1266 declspecs_nosc_nots_nosa_noea
1267 | declspecs_nosc_nots_nosa_ea
1268 | declspecs_nosc_nots_sa_noea
1269 | declspecs_nosc_nots_sa_ea
1270 | declspecs_sc_nots_nosa_noea
1271 | declspecs_sc_nots_nosa_ea
1272 | declspecs_sc_nots_sa_noea
1273 | declspecs_sc_nots_sa_ea
1277 declspecs_nosc_ts_nosa_noea
1278 | declspecs_nosc_ts_nosa_ea
1279 | declspecs_sc_ts_nosa_noea
1280 | declspecs_sc_ts_nosa_ea
1283 declspecs_nots_nosa:
1284 declspecs_nosc_nots_nosa_noea
1285 | declspecs_nosc_nots_nosa_ea
1286 | declspecs_sc_nots_nosa_noea
1287 | declspecs_sc_nots_nosa_ea
1291 declspecs_nosc_ts_nosa_noea
1292 | declspecs_nosc_ts_nosa_ea
1293 | declspecs_nosc_ts_sa_noea
1294 | declspecs_nosc_ts_sa_ea
1297 declspecs_nosc_nots:
1298 declspecs_nosc_nots_nosa_noea
1299 | declspecs_nosc_nots_nosa_ea
1300 | declspecs_nosc_nots_sa_noea
1301 | declspecs_nosc_nots_sa_ea
1305 declspecs_nosc_ts_nosa_noea
1306 | declspecs_nosc_ts_nosa_ea
1307 | declspecs_nosc_ts_sa_noea
1308 | declspecs_nosc_ts_sa_ea
1309 | declspecs_nosc_nots_nosa_noea
1310 | declspecs_nosc_nots_nosa_ea
1311 | declspecs_nosc_nots_sa_noea
1312 | declspecs_nosc_nots_sa_ea
1316 declspecs_nosc_nots_nosa_noea
1317 | declspecs_nosc_nots_nosa_ea
1318 | declspecs_nosc_nots_sa_noea
1319 | declspecs_nosc_nots_sa_ea
1320 | declspecs_nosc_ts_nosa_noea
1321 | declspecs_nosc_ts_nosa_ea
1322 | declspecs_nosc_ts_sa_noea
1323 | declspecs_nosc_ts_sa_ea
1324 | declspecs_sc_nots_nosa_noea
1325 | declspecs_sc_nots_nosa_ea
1326 | declspecs_sc_nots_sa_noea
1327 | declspecs_sc_nots_sa_ea
1328 | declspecs_sc_ts_nosa_noea
1329 | declspecs_sc_ts_nosa_ea
1330 | declspecs_sc_ts_sa_noea
1331 | declspecs_sc_ts_sa_ea
1334 /* A (possibly empty) sequence of type qualifiers and attributes. */
1335 maybe_type_quals_attrs:
1338 | declspecs_nosc_nots
1342 /* A type specifier (but not a type qualifier).
1343 Once we have seen one of these in a declaration,
1344 if a typedef name appears then it is being redeclared.
1346 The _reserved versions start with a reserved word and may appear anywhere
1347 in the declaration specifiers; the _nonreserved versions may only
1348 appear before any other type specifiers, and after that are (if names)
1351 FIXME: should the _nonreserved version be restricted to names being
1352 redeclared only? The other entries there relate only the GNU extensions
1353 and Objective C, and are historically parsed thus, and don't make sense
1354 after other type specifiers, but it might be cleaner to count them as
1357 _attr means: specifiers that either end with attributes,
1358 or are such that any following attributes would
1359 be parsed as part of the specifier.
1361 _nonattr: specifiers. */
1364 typespec_reserved_nonattr
1365 | typespec_nonreserved_nonattr
1369 typespec_reserved_attr
1372 typespec_reserved_nonattr:
1374 { OBJC_NEED_RAW_IDENTIFIER (1); }
1378 typespec_reserved_attr:
1382 typespec_nonreserved_nonattr:
1384 { /* For a typedef name, record the meaning, not the name.
1385 In case of `foo foo, bar;'. */
1386 $$ = lookup_name ($1); }
1388 | CLASSNAME protocolrefs
1389 { $$ = get_static_reference ($1, $2); }
1390 | OBJECTNAME protocolrefs
1391 { $$ = get_object_reference ($2); }
1393 /* Make "<SomeProtocol>" equivalent to "id <SomeProtocol>"
1394 - nisse@lysator.liu.se */
1395 | non_empty_protocolrefs
1396 { $$ = get_object_reference ($1); }
1398 | typeof '(' expr ')'
1399 { skip_evaluation--; $$ = TREE_TYPE ($3); }
1400 | typeof '(' typename ')'
1401 { skip_evaluation--; $$ = groktypename ($3); }
1404 /* typespec_nonreserved_attr does not exist. */
1408 | initdecls ',' maybe_resetattrs initdcl
1413 | notype_initdecls ',' maybe_resetattrs notype_initdcl
1419 | ASM_KEYWORD '(' STRING ')'
1424 declarator maybeasm maybe_attribute '='
1425 { $<ttype>$ = start_decl ($1, current_declspecs, 1,
1426 chainon ($3, all_prefix_attributes));
1427 start_init ($<ttype>$, $2, global_bindings_p ()); }
1429 /* Note how the declaration of the variable is in effect while its init is parsed! */
1431 finish_decl ($<ttype>5, $6, $2); }
1432 | declarator maybeasm maybe_attribute
1433 { tree d = start_decl ($1, current_declspecs, 0,
1434 chainon ($3, all_prefix_attributes));
1435 finish_decl (d, NULL_TREE, $2);
1440 notype_declarator maybeasm maybe_attribute '='
1441 { $<ttype>$ = start_decl ($1, current_declspecs, 1,
1442 chainon ($3, all_prefix_attributes));
1443 start_init ($<ttype>$, $2, global_bindings_p ()); }
1445 /* Note how the declaration of the variable is in effect while its init is parsed! */
1447 finish_decl ($<ttype>5, $6, $2); }
1448 | notype_declarator maybeasm maybe_attribute
1449 { tree d = start_decl ($1, current_declspecs, 0,
1450 chainon ($3, all_prefix_attributes));
1451 finish_decl (d, NULL_TREE, $2); }
1453 /* the * rules are dummies to accept the Apollo extended syntax
1454 so that the header files compile. */
1465 | attributes attribute
1466 { $$ = chainon ($1, $2); }
1470 ATTRIBUTE '(' '(' attribute_list ')' ')'
1477 | attribute_list ',' attrib
1478 { $$ = chainon ($1, $3); }
1485 { $$ = build_tree_list ($1, NULL_TREE); }
1486 | any_word '(' IDENTIFIER ')'
1487 { $$ = build_tree_list ($1, build_tree_list (NULL_TREE, $3)); }
1488 | any_word '(' IDENTIFIER ',' nonnull_exprlist ')'
1489 { $$ = build_tree_list ($1, tree_cons (NULL_TREE, $3, $5)); }
1490 | any_word '(' exprlist ')'
1491 { $$ = build_tree_list ($1, $3); }
1494 /* This still leaves out most reserved keywords,
1495 shouldn't we include them? */
1509 /* Initializers. `init' is the entry point. */
1514 { really_start_incremental_init (NULL_TREE); }
1515 initlist_maybe_comma '}'
1516 { $$ = pop_init_level (0); }
1518 { $$ = error_mark_node; }
1521 /* `initlist_maybe_comma' is the guts of an initializer in braces. */
1522 initlist_maybe_comma:
1525 pedwarn ("ISO C forbids empty initializer braces"); }
1526 | initlist1 maybecomma
1531 | initlist1 ',' initelt
1534 /* `initelt' is a single element of an initializer.
1535 It may use braces. */
1537 designator_list '=' initval
1538 { if (pedantic && ! flag_isoc99)
1539 pedwarn ("ISO C89 forbids specifying subobject to initialize"); }
1540 | designator initval
1542 pedwarn ("obsolete use of designated initializer without `='"); }
1544 { set_init_label ($1);
1546 pedwarn ("obsolete use of designated initializer with `:'"); }
1554 { push_init_level (0); }
1555 initlist_maybe_comma '}'
1556 { process_init_element (pop_init_level (0)); }
1558 { process_init_element ($1); }
1564 | designator_list designator
1569 { set_init_label ($2); }
1570 | '[' expr_no_commas ELLIPSIS expr_no_commas ']'
1571 { set_init_index ($2, $4);
1573 pedwarn ("ISO C forbids specifying range of elements to initialize"); }
1574 | '[' expr_no_commas ']'
1575 { set_init_index ($2, NULL_TREE); }
1581 pedwarn ("ISO C forbids nested functions");
1583 push_function_context ();
1584 if (! start_function (current_declspecs, $1,
1585 all_prefix_attributes))
1587 pop_function_context ();
1590 parsing_iso_function_signature = false; /* Don't warn about nested functions. */
1592 old_style_parm_decls save_location
1593 { tree decl = current_function_decl;
1594 DECL_SOURCE_LOCATION (decl) = $4;
1595 store_parm_decls (); }
1596 /* This used to use compstmt_or_error.
1597 That caused a bug with input `f(g) int g {}',
1598 where the use of YYERROR1 above caused an error
1599 which then was handled by compstmt_or_error.
1600 There followed a repeated execution of that same rule,
1601 which called YYERROR1 again, and so on. */
1603 { tree decl = current_function_decl;
1604 finish_function (1, 1);
1605 pop_function_context ();
1606 add_decl_stmt (decl); }
1609 notype_nested_function:
1612 pedwarn ("ISO C forbids nested functions");
1614 push_function_context ();
1615 if (! start_function (current_declspecs, $1,
1616 all_prefix_attributes))
1618 pop_function_context ();
1621 parsing_iso_function_signature = false; /* Don't warn about nested functions. */
1623 old_style_parm_decls save_location
1624 { tree decl = current_function_decl;
1625 DECL_SOURCE_LOCATION (decl) = $4;
1626 store_parm_decls (); }
1627 /* This used to use compstmt_or_error.
1628 That caused a bug with input `f(g) int g {}',
1629 where the use of YYERROR1 above caused an error
1630 which then was handled by compstmt_or_error.
1631 There followed a repeated execution of that same rule,
1632 which called YYERROR1 again, and so on. */
1634 { tree decl = current_function_decl;
1635 finish_function (1, 1);
1636 pop_function_context ();
1637 add_decl_stmt (decl); }
1640 /* Any kind of declarator (thus, all declarators allowed
1641 after an explicit typespec). */
1644 after_type_declarator
1648 /* A declarator that is allowed only after an explicit typespec. */
1650 after_type_declarator:
1651 '(' maybe_attribute after_type_declarator ')'
1652 { $$ = $2 ? tree_cons ($2, $3, NULL_TREE) : $3; }
1653 | after_type_declarator '(' parmlist_or_identifiers %prec '.'
1654 { $$ = build_nt (CALL_EXPR, $1, $3, NULL_TREE); }
1655 /* | after_type_declarator '(' error ')' %prec '.'
1656 { $$ = build_nt (CALL_EXPR, $1, NULL_TREE, NULL_TREE);
1657 poplevel (0, 0, 0); } */
1658 | after_type_declarator array_declarator %prec '.'
1659 { $$ = set_array_declarator_type ($2, $1, 0); }
1660 | '*' maybe_type_quals_attrs after_type_declarator %prec UNARY
1661 { $$ = make_pointer_declarator ($2, $3); }
1668 /* Kinds of declarator that can appear in a parameter list
1669 in addition to notype_declarator. This is like after_type_declarator
1670 but does not allow a typedef name in parentheses as an identifier
1671 (because it would conflict with a function with that typedef as arg). */
1673 parm_declarator_starttypename
1674 | parm_declarator_nostarttypename
1677 parm_declarator_starttypename:
1678 parm_declarator_starttypename '(' parmlist_or_identifiers %prec '.'
1679 { $$ = build_nt (CALL_EXPR, $1, $3, NULL_TREE); }
1680 /* | parm_declarator_starttypename '(' error ')' %prec '.'
1681 { $$ = build_nt (CALL_EXPR, $1, NULL_TREE, NULL_TREE);
1682 poplevel (0, 0, 0); } */
1683 | parm_declarator_starttypename array_declarator %prec '.'
1684 { $$ = set_array_declarator_type ($2, $1, 0); }
1691 parm_declarator_nostarttypename:
1692 parm_declarator_nostarttypename '(' parmlist_or_identifiers %prec '.'
1693 { $$ = build_nt (CALL_EXPR, $1, $3, NULL_TREE); }
1694 /* | parm_declarator_nostarttypename '(' error ')' %prec '.'
1695 { $$ = build_nt (CALL_EXPR, $1, NULL_TREE, NULL_TREE);
1696 poplevel (0, 0, 0); } */
1697 | parm_declarator_nostarttypename array_declarator %prec '.'
1698 { $$ = set_array_declarator_type ($2, $1, 0); }
1699 | '*' maybe_type_quals_attrs parm_declarator_starttypename %prec UNARY
1700 { $$ = make_pointer_declarator ($2, $3); }
1701 | '*' maybe_type_quals_attrs parm_declarator_nostarttypename %prec UNARY
1702 { $$ = make_pointer_declarator ($2, $3); }
1703 | '(' maybe_attribute parm_declarator_nostarttypename ')'
1704 { $$ = $2 ? tree_cons ($2, $3, NULL_TREE) : $3; }
1707 /* A declarator allowed whether or not there has been
1708 an explicit typespec. These cannot redeclare a typedef-name. */
1711 notype_declarator '(' parmlist_or_identifiers %prec '.'
1712 { $$ = build_nt (CALL_EXPR, $1, $3, NULL_TREE); }
1713 /* | notype_declarator '(' error ')' %prec '.'
1714 { $$ = build_nt (CALL_EXPR, $1, NULL_TREE, NULL_TREE);
1715 poplevel (0, 0, 0); } */
1716 | '(' maybe_attribute notype_declarator ')'
1717 { $$ = $2 ? tree_cons ($2, $3, NULL_TREE) : $3; }
1718 | '*' maybe_type_quals_attrs notype_declarator %prec UNARY
1719 { $$ = make_pointer_declarator ($2, $3); }
1720 | notype_declarator array_declarator %prec '.'
1721 { $$ = set_array_declarator_type ($2, $1, 0); }
1746 /* structsp_attr: struct/union/enum specifiers that either
1747 end with attributes, or are such that any following attributes would
1748 be parsed as part of the struct/union/enum specifier.
1750 structsp_nonattr: other struct/union/enum specifiers. */
1753 struct_head identifier '{'
1754 { $$ = start_struct (RECORD_TYPE, $2);
1755 /* Start scope of tag before parsing components. */
1757 component_decl_list '}' maybe_attribute
1758 { $$ = finish_struct ($<ttype>4, nreverse ($5),
1759 chainon ($1, $7)); }
1760 | struct_head '{' component_decl_list '}' maybe_attribute
1761 { $$ = finish_struct (start_struct (RECORD_TYPE, NULL_TREE),
1762 nreverse ($3), chainon ($1, $5));
1764 | union_head identifier '{'
1765 { $$ = start_struct (UNION_TYPE, $2); }
1766 component_decl_list '}' maybe_attribute
1767 { $$ = finish_struct ($<ttype>4, nreverse ($5),
1768 chainon ($1, $7)); }
1769 | union_head '{' component_decl_list '}' maybe_attribute
1770 { $$ = finish_struct (start_struct (UNION_TYPE, NULL_TREE),
1771 nreverse ($3), chainon ($1, $5));
1773 | enum_head identifier '{'
1774 { $$ = start_enum ($2); }
1775 enumlist maybecomma_warn '}' maybe_attribute
1776 { $$ = finish_enum ($<ttype>4, nreverse ($5),
1777 chainon ($1, $8)); }
1779 { $$ = start_enum (NULL_TREE); }
1780 enumlist maybecomma_warn '}' maybe_attribute
1781 { $$ = finish_enum ($<ttype>3, nreverse ($4),
1782 chainon ($1, $7)); }
1786 struct_head identifier
1787 { $$ = xref_tag (RECORD_TYPE, $2); }
1788 | union_head identifier
1789 { $$ = xref_tag (UNION_TYPE, $2); }
1790 | enum_head identifier
1791 { $$ = xref_tag (ENUMERAL_TYPE, $2);
1792 /* In ISO C, enumerated types can be referred to
1793 only if already defined. */
1794 if (pedantic && !COMPLETE_TYPE_P ($$))
1795 pedwarn ("ISO C forbids forward references to `enum' types"); }
1806 { if (pedantic && ! flag_isoc99)
1807 pedwarn ("comma at end of enumerator list"); }
1810 /* We chain the components in reverse order. They are put in forward
1811 order in structsp_attr.
1813 Note that component_declarator returns single decls, so components
1814 and components_notype can use TREE_CHAIN directly, wheras components
1815 and components_notype return lists (of comma separated decls), so
1816 component_decl_list and component_decl_list2 must use chainon.
1818 The theory behind all this is that there will be more semicolon
1819 separated fields than comma separated fields, and so we'll be
1820 minimizing the number of node traversals required by chainon. */
1822 component_decl_list:
1823 component_decl_list2
1825 | component_decl_list2 component_decl
1826 { $$ = chainon ($2, $1);
1827 pedwarn ("no semicolon at end of struct or union"); }
1830 component_decl_list2: /* empty */
1832 | component_decl_list2 component_decl ';'
1833 { $$ = chainon ($2, $1); }
1834 | component_decl_list2 ';'
1836 pedwarn ("extra semicolon in struct or union specified"); }
1838 /* foo(sizeof(struct{ @defs(ClassName)})); */
1839 | DEFS '(' CLASSNAME ')'
1841 tree interface = lookup_interface ($3);
1844 $$ = nreverse (get_class_ivars (interface));
1847 error ("cannot find interface declaration for `%s'",
1848 IDENTIFIER_POINTER ($3));
1856 declspecs_nosc_ts setspecs components
1858 POP_DECLSPEC_STACK; }
1859 | declspecs_nosc_ts setspecs
1861 /* Support for unnamed structs or unions as members of
1862 structs or unions (which is [a] useful and [b] supports
1865 pedwarn ("ISO C doesn't support unnamed structs/unions");
1867 $$ = grokfield(NULL, current_declspecs, NULL_TREE);
1868 POP_DECLSPEC_STACK; }
1869 | declspecs_nosc_nots setspecs components_notype
1871 POP_DECLSPEC_STACK; }
1872 | declspecs_nosc_nots
1874 pedwarn ("ISO C forbids member declarations with no members");
1879 | extension component_decl
1881 RESTORE_EXT_FLAGS ($1); }
1885 component_declarator
1886 | components ',' maybe_resetattrs component_declarator
1887 { TREE_CHAIN ($4) = $1; $$ = $4; }
1891 component_notype_declarator
1892 | components_notype ',' maybe_resetattrs component_notype_declarator
1893 { TREE_CHAIN ($4) = $1; $$ = $4; }
1896 component_declarator:
1897 declarator maybe_attribute
1898 { $$ = grokfield ($1, current_declspecs, NULL_TREE);
1899 decl_attributes (&$$,
1900 chainon ($2, all_prefix_attributes), 0); }
1901 | declarator ':' expr_no_commas maybe_attribute
1902 { $$ = grokfield ($1, current_declspecs, $3);
1903 decl_attributes (&$$,
1904 chainon ($4, all_prefix_attributes), 0); }
1905 | ':' expr_no_commas maybe_attribute
1906 { $$ = grokfield (NULL_TREE, current_declspecs, $2);
1907 decl_attributes (&$$,
1908 chainon ($3, all_prefix_attributes), 0); }
1911 component_notype_declarator:
1912 notype_declarator maybe_attribute
1913 { $$ = grokfield ($1, current_declspecs, NULL_TREE);
1914 decl_attributes (&$$,
1915 chainon ($2, all_prefix_attributes), 0); }
1916 | notype_declarator ':' expr_no_commas maybe_attribute
1917 { $$ = grokfield ($1, current_declspecs, $3);
1918 decl_attributes (&$$,
1919 chainon ($4, all_prefix_attributes), 0); }
1920 | ':' expr_no_commas maybe_attribute
1921 { $$ = grokfield (NULL_TREE, current_declspecs, $2);
1922 decl_attributes (&$$,
1923 chainon ($3, all_prefix_attributes), 0); }
1926 /* We chain the enumerators in reverse order.
1927 They are put in forward order in structsp_attr. */
1931 | enumlist ',' enumerator
1932 { if ($1 == error_mark_node)
1935 TREE_CHAIN ($3) = $1, $$ = $3; }
1937 { $$ = error_mark_node; }
1943 { $$ = build_enumerator ($1, NULL_TREE); }
1944 | identifier '=' expr_no_commas
1945 { $$ = build_enumerator ($1, $3); }
1950 { pending_xref_error ();
1953 { $$ = build_tree_list ($<ttype>2, $3); }
1956 absdcl: /* an absolute declarator */
1962 absdcl_maybe_attribute: /* absdcl maybe_attribute, but not just attributes */
1964 { $$ = build_tree_list (build_tree_list (current_declspecs,
1966 all_prefix_attributes); }
1968 { $$ = build_tree_list (build_tree_list (current_declspecs,
1970 all_prefix_attributes); }
1971 | absdcl1_noea attributes
1972 { $$ = build_tree_list (build_tree_list (current_declspecs,
1974 chainon ($2, all_prefix_attributes)); }
1977 absdcl1: /* a nonempty absolute declarator */
1984 | '*' maybe_type_quals_attrs absdcl1_noea
1985 { $$ = make_pointer_declarator ($2, $3); }
1989 '*' maybe_type_quals_attrs
1990 { $$ = make_pointer_declarator ($2, NULL_TREE); }
1991 | '*' maybe_type_quals_attrs absdcl1_ea
1992 { $$ = make_pointer_declarator ($2, $3); }
1996 '(' maybe_attribute absdcl1 ')'
1997 { $$ = $2 ? tree_cons ($2, $3, NULL_TREE) : $3; }
1998 | direct_absdcl1 '(' parmlist
1999 { $$ = build_nt (CALL_EXPR, $1, $3, NULL_TREE); }
2000 | direct_absdcl1 array_declarator
2001 { $$ = set_array_declarator_type ($2, $1, 1); }
2003 { $$ = build_nt (CALL_EXPR, NULL_TREE, $2, NULL_TREE); }
2005 { $$ = set_array_declarator_type ($1, NULL_TREE, 1); }
2008 /* The [...] part of a declarator for an array type. */
2011 '[' maybe_type_quals_attrs expr ']'
2012 { $$ = build_array_declarator ($3, $2, 0, 0); }
2013 | '[' maybe_type_quals_attrs ']'
2014 { $$ = build_array_declarator (NULL_TREE, $2, 0, 0); }
2015 | '[' maybe_type_quals_attrs '*' ']'
2016 { $$ = build_array_declarator (NULL_TREE, $2, 0, 1); }
2017 | '[' STATIC maybe_type_quals_attrs expr ']'
2018 { $$ = build_array_declarator ($4, $3, 1, 0); }
2019 /* declspecs_nosc_nots is a synonym for type_quals_attrs. */
2020 | '[' declspecs_nosc_nots STATIC expr ']'
2021 { $$ = build_array_declarator ($4, $2, 1, 0); }
2024 /* A nonempty series of declarations and statements (possibly followed by
2025 some labels) that can form the body of a compound statement.
2026 NOTE: we don't allow labels on declarations; this might seem like a
2027 natural extension, but there would be a conflict between attributes
2028 on the label and prefix attributes on the declaration. */
2031 lineno_stmt_decl_or_labels_ending_stmt
2032 | lineno_stmt_decl_or_labels_ending_decl
2033 | lineno_stmt_decl_or_labels_ending_label
2035 pedwarn ("deprecated use of label at end of compound statement");
2037 | lineno_stmt_decl_or_labels_ending_error
2040 lineno_stmt_decl_or_labels_ending_stmt:
2042 | lineno_stmt_decl_or_labels_ending_stmt lineno_stmt
2043 | lineno_stmt_decl_or_labels_ending_decl lineno_stmt
2044 | lineno_stmt_decl_or_labels_ending_label lineno_stmt
2045 | lineno_stmt_decl_or_labels_ending_error lineno_stmt
2048 lineno_stmt_decl_or_labels_ending_decl:
2050 | lineno_stmt_decl_or_labels_ending_stmt lineno_decl
2051 { if (pedantic && !flag_isoc99)
2052 pedwarn ("ISO C89 forbids mixed declarations and code"); }
2053 | lineno_stmt_decl_or_labels_ending_decl lineno_decl
2054 | lineno_stmt_decl_or_labels_ending_error lineno_decl
2057 lineno_stmt_decl_or_labels_ending_label:
2059 | lineno_stmt_decl_or_labels_ending_stmt lineno_label
2060 | lineno_stmt_decl_or_labels_ending_decl lineno_label
2061 | lineno_stmt_decl_or_labels_ending_label lineno_label
2062 | lineno_stmt_decl_or_labels_ending_error lineno_label
2065 lineno_stmt_decl_or_labels_ending_error:
2067 | lineno_stmt_decl_or_labels errstmt
2070 lineno_stmt_decl_or_labels:
2071 lineno_stmt_decl_or_labels_ending_stmt
2072 | lineno_stmt_decl_or_labels_ending_decl
2073 | lineno_stmt_decl_or_labels_ending_label
2074 | lineno_stmt_decl_or_labels_ending_error
2080 pushlevel: /* empty */
2083 add_scope_stmt (/*begin_p=*/1, /*partial_p=*/0);
2085 if (objc_method_context)
2091 poplevel: /* empty */
2092 { $$ = add_scope_stmt (/*begin_p=*/0, /*partial_p=*/0); }
2095 /* Start and end blocks created for the new scopes of C99. */
2096 c99_block_start: /* empty */
2099 $$ = c_begin_compound_stmt ();
2102 add_scope_stmt (/*begin_p=*/1, /*partial_p=*/0);
2104 if (objc_method_context)
2113 /* Productions using c99_block_start and c99_block_end will need to do what's
2114 in compstmt: RECHAIN_STMTS ($1, COMPOUND_BODY ($1)); $$ = $2; where
2115 $1 is the value of c99_block_start and $2 of c99_block_end. */
2116 c99_block_end: /* empty */
2119 tree scope_stmt = add_scope_stmt (/*begin_p=*/0, /*partial_p=*/0);
2120 $$ = poplevel (kept_level_p (), 0, 0);
2121 SCOPE_STMT_BLOCK (TREE_PURPOSE (scope_stmt))
2122 = SCOPE_STMT_BLOCK (TREE_VALUE (scope_stmt))
2129 /* Read zero or more forward-declarations for labels
2130 that nested functions can jump to. */
2135 pedwarn ("ISO C forbids label declarations"); }
2140 | label_decls label_decl
2144 LABEL identifiers_or_typenames ';'
2146 for (link = $2; link; link = TREE_CHAIN (link))
2148 tree label = shadow_label (TREE_VALUE (link));
2149 C_DECLARED_LABEL_FLAG (label) = 1;
2150 add_decl_stmt (label);
2155 /* This is the body of a function definition.
2156 It causes syntax errors to ignore to the next openbrace. */
2163 compstmt_start: '{' { compstmt_count++;
2164 $$ = c_begin_compound_stmt (); }
2167 compstmt_nostart: '}'
2168 { $$ = convert (void_type_node, integer_zero_node); }
2169 | pushlevel maybe_label_decls compstmt_contents_nonempty '}' poplevel
2170 { $$ = poplevel (kept_level_p (), 1, 0);
2171 SCOPE_STMT_BLOCK (TREE_PURPOSE ($5))
2172 = SCOPE_STMT_BLOCK (TREE_VALUE ($5))
2176 compstmt_contents_nonempty:
2181 compstmt_primary_start:
2183 { if (current_function_decl == 0)
2185 error ("braced-group within expression allowed only inside a function");
2188 /* We must force a BLOCK for this level
2189 so that, if it is not expanded later,
2190 there is a way to turn off the entire subtree of blocks
2191 that are contained in it. */
2193 push_label_level ();
2195 $$ = add_stmt (build_stmt (COMPOUND_STMT, last_tree));
2199 compstmt: compstmt_start compstmt_nostart
2200 { RECHAIN_STMTS ($1, COMPOUND_BODY ($1));
2201 last_expr_type = NULL_TREE;
2205 /* Value is number of statements counted as of the closeparen. */
2207 if_prefix c99_block_lineno_labeled_stmt
2208 { c_finish_then (); }
2209 /* Make sure c_expand_end_cond is run once
2210 for each call to c_expand_start_cond.
2211 Otherwise a crash is likely. */
2216 /* We must build the IF_STMT node before parsing its
2217 condition so that STMT_LINENO refers to the line
2218 containing the "if", and not the line containing
2219 the close-parenthesis.
2221 c_begin_if_stmt returns the IF_STMT node, which
2222 we later pass to c_expand_start_cond to fill
2223 in the condition and other tidbits. */
2225 { $<ttype>$ = c_begin_if_stmt (); }
2227 { c_expand_start_cond (c_common_truthvalue_conversion ($4),
2228 compstmt_count,$<ttype>2);
2229 $<itype>$ = stmt_count;
2230 if_stmt_locus = $<location>-1; }
2233 /* This is a subroutine of stmt.
2234 It is used twice, once for valid DO statements
2235 and once for catching errors in parsing the end test. */
2241 = add_stmt (build_stmt (DO_STMT, NULL_TREE,
2243 /* In the event that a parse error prevents
2244 parsing the complete do-statement, set the
2245 condition now. Otherwise, we can get crashes at
2246 RTL-generation time. */
2247 DO_COND ($<ttype>$) = error_mark_node; }
2248 c99_block_lineno_labeled_stmt WHILE
2250 RECHAIN_STMTS ($$, DO_BODY ($$)); }
2253 /* The forced readahead in here is because we might be at the end of a
2254 line, and the line and file won't be bumped until yylex absorbs the
2255 first token on the next line. */
2258 { if (yychar == YYEMPTY)
2260 $$ = input_location; }
2263 lineno_labeled_stmt:
2265 | lineno_label lineno_labeled_stmt
2268 /* Like lineno_labeled_stmt, but a block in C99. */
2269 c99_block_lineno_labeled_stmt:
2270 c99_block_start lineno_labeled_stmt c99_block_end
2272 RECHAIN_STMTS ($1, COMPOUND_BODY ($1)); }
2279 STMT_LINENO ($2) = $1.line;
2280 /* ??? We currently have no way of recording
2281 the filename for a statement. This probably
2282 matters little in practice at the moment,
2283 but I suspect that problems will occur when
2284 doing inlining at the tree level. */
2293 STMT_LINENO ($2) = $1.line;
2298 select_or_iter_stmt:
2300 { c_expand_start_else ();
2301 $<itype>1 = stmt_count; }
2302 c99_block_lineno_labeled_stmt
2304 c_expand_end_cond ();
2305 if (extra_warnings && stmt_count == $<itype>1)
2306 warning ("empty body in an else-statement"); }
2307 | simple_if %prec IF
2308 { c_expand_end_cond ();
2309 /* This warning is here instead of in simple_if, because we
2310 do not want a warning if an empty if is followed by an
2311 else statement. Increment stmt_count so we don't
2312 give a second error if this is a nested `if'. */
2313 if (extra_warnings && stmt_count++ == $<itype>1)
2314 warning ("%Hempty body in an if-statement",
2316 /* Make sure c_expand_end_cond is run once
2317 for each call to c_expand_start_cond.
2318 Otherwise a crash is likely. */
2319 | simple_if ELSE error
2320 { c_expand_end_cond (); }
2321 /* We must build the WHILE_STMT node before parsing its
2322 condition so that STMT_LINENO refers to the line
2323 containing the "while", and not the line containing
2324 the close-parenthesis.
2326 c_begin_while_stmt returns the WHILE_STMT node, which
2327 we later pass to c_finish_while_stmt_cond to fill
2328 in the condition and other tidbits. */
2331 $<ttype>$ = c_begin_while_stmt (); }
2333 { $4 = c_common_truthvalue_conversion ($4);
2334 c_finish_while_stmt_cond
2335 (c_common_truthvalue_conversion ($4), $<ttype>2);
2336 $<ttype>$ = add_stmt ($<ttype>2); }
2337 c99_block_lineno_labeled_stmt
2338 { RECHAIN_STMTS ($<ttype>6, WHILE_BODY ($<ttype>6)); }
2341 { DO_COND ($1) = c_common_truthvalue_conversion ($3); }
2342 | do_stmt_start error
2345 { $<ttype>$ = build_stmt (FOR_STMT, NULL_TREE, NULL_TREE,
2346 NULL_TREE, NULL_TREE);
2347 add_stmt ($<ttype>$); }
2350 RECHAIN_STMTS ($<ttype>2, FOR_INIT_STMT ($<ttype>2)); }
2353 FOR_COND ($<ttype>2)
2354 = c_common_truthvalue_conversion ($6); }
2356 { FOR_EXPR ($<ttype>2) = $9; }
2357 c99_block_lineno_labeled_stmt
2358 { RECHAIN_STMTS ($<ttype>2, FOR_BODY ($<ttype>2)); }
2359 | SWITCH '(' expr ')'
2361 $<ttype>$ = c_start_case ($3); }
2362 c99_block_lineno_labeled_stmt
2363 { c_finish_case (); }
2368 { add_stmt (build_stmt (EXPR_STMT, $1)); }
2370 { check_for_loop_decls (); }
2373 /* Parse a single real statement, not including any labels. */
2376 { stmt_count++; $$ = $1; }
2379 $$ = c_expand_expr_stmt ($1); }
2380 | c99_block_start select_or_iter_stmt c99_block_end
2382 RECHAIN_STMTS ($1, COMPOUND_BODY ($1));
2386 $$ = add_stmt (build_break_stmt ()); }
2389 $$ = add_stmt (build_continue_stmt ()); }
2392 $$ = c_expand_return (NULL_TREE); }
2395 $$ = c_expand_return ($2); }
2396 | ASM_KEYWORD maybe_type_qual '(' expr ')' ';'
2398 $$ = simple_asm_stmt ($4); }
2399 /* This is the case with just output operands. */
2400 | ASM_KEYWORD maybe_type_qual '(' expr ':' asm_operands ')' ';'
2402 $$ = build_asm_stmt ($2, $4, $6, NULL_TREE, NULL_TREE); }
2403 /* This is the case with input operands as well. */
2404 | ASM_KEYWORD maybe_type_qual '(' expr ':' asm_operands ':'
2405 asm_operands ')' ';'
2407 $$ = build_asm_stmt ($2, $4, $6, $8, NULL_TREE); }
2408 /* This is the case with clobbered registers as well. */
2409 | ASM_KEYWORD maybe_type_qual '(' expr ':' asm_operands ':'
2410 asm_operands ':' asm_clobbers ')' ';'
2412 $$ = build_asm_stmt ($2, $4, $6, $8, $10); }
2413 | GOTO identifier ';'
2416 decl = lookup_label ($2);
2419 TREE_USED (decl) = 1;
2420 $$ = add_stmt (build_stmt (GOTO_STMT, decl));
2427 pedwarn ("ISO C forbids `goto *expr;'");
2429 $3 = convert (ptr_type_node, $3);
2430 $$ = add_stmt (build_stmt (GOTO_STMT, $3)); }
2435 /* Any kind of label, including jump labels and case labels.
2436 ANSI C accepts labels only before statements, but we allow them
2437 also at the end of a compound statement. */
2439 label: CASE expr_no_commas ':'
2441 $$ = do_case ($2, NULL_TREE); }
2442 | CASE expr_no_commas ELLIPSIS expr_no_commas ':'
2444 $$ = do_case ($2, $4); }
2447 $$ = do_case (NULL_TREE, NULL_TREE); }
2448 | identifier save_location ':' maybe_attribute
2449 { tree label = define_label ($2.file, $2.line, $1);
2453 decl_attributes (&label, $4, 0);
2454 $$ = add_stmt (build_stmt (LABEL_STMT, label));
2461 /* Either a type-qualifier or nothing. First thing in an `asm' statement. */
2465 { emit_line_note (input_filename, input_line);
2468 { emit_line_note (input_filename, input_line); }
2477 /* These are the operands other than the first string and colon
2478 in asm ("addextend %2,%1": "=dm" (x), "0" (y), "g" (*x)) */
2479 asm_operands: /* empty */
2481 | nonnull_asm_operands
2484 nonnull_asm_operands:
2486 | nonnull_asm_operands ',' asm_operand
2487 { $$ = chainon ($1, $3); }
2492 { $$ = build_tree_list (build_tree_list (NULL_TREE, $1), $3); }
2493 | '[' identifier ']' STRING '(' expr ')'
2494 { $2 = build_string (IDENTIFIER_LENGTH ($2),
2495 IDENTIFIER_POINTER ($2));
2496 $$ = build_tree_list (build_tree_list ($2, $4), $6); }
2501 { $$ = tree_cons (NULL_TREE, $1, NULL_TREE); }
2502 | asm_clobbers ',' STRING
2503 { $$ = tree_cons (NULL_TREE, $3, $1); }
2506 /* This is what appears inside the parens in a function declarator.
2507 Its value is a list of ..._TYPE nodes. Attributes must appear here
2508 to avoid a conflict with their appearance after an open parenthesis
2509 in an abstract declarator, as in
2510 "void bar (int (__attribute__((__mode__(SI))) int foo));". */
2514 clear_parm_order ();
2515 declare_parm_level (0); }
2518 parmlist_tags_warning ();
2519 poplevel (0, 0, 0); }
2527 pedwarn ("ISO C forbids forward parameter declarations");
2528 /* Mark the forward decls as such. */
2529 for (parm = getdecls (); parm; parm = TREE_CHAIN (parm))
2530 TREE_ASM_WRITTEN (parm) = 1;
2531 clear_parm_order (); }
2533 { /* Dummy action so attributes are in known place
2534 on parser stack. */ }
2538 { $$ = tree_cons (NULL_TREE, NULL_TREE, NULL_TREE); }
2541 /* This is what appears inside the parens in a function declarator.
2542 Is value is represented in the format that grokdeclarator expects. */
2543 parmlist_2: /* empty */
2544 { $$ = get_parm_info (0); }
2546 { $$ = get_parm_info (0);
2547 /* Gcc used to allow this as an extension. However, it does
2548 not work for all targets, and thus has been disabled.
2549 Also, since func (...) and func () are indistinguishable,
2550 it caused problems with the code in expand_builtin which
2551 tries to verify that BUILT_IN_NEXT_ARG is being used
2553 error ("ISO C requires a named argument before `...'");
2556 { $$ = get_parm_info (1);
2557 parsing_iso_function_signature = true;
2559 | parms ',' ELLIPSIS
2560 { $$ = get_parm_info (0); }
2565 { push_parm_decl ($1); }
2567 { push_parm_decl ($3); }
2570 /* A single parameter declaration or parameter type name,
2571 as found in a parmlist. */
2573 declspecs_ts setspecs parm_declarator maybe_attribute
2574 { $$ = build_tree_list (build_tree_list (current_declspecs,
2576 chainon ($4, all_prefix_attributes));
2577 POP_DECLSPEC_STACK; }
2578 | declspecs_ts setspecs notype_declarator maybe_attribute
2579 { $$ = build_tree_list (build_tree_list (current_declspecs,
2581 chainon ($4, all_prefix_attributes));
2582 POP_DECLSPEC_STACK; }
2583 | declspecs_ts setspecs absdcl_maybe_attribute
2585 POP_DECLSPEC_STACK; }
2586 | declspecs_nots setspecs notype_declarator maybe_attribute
2587 { $$ = build_tree_list (build_tree_list (current_declspecs,
2589 chainon ($4, all_prefix_attributes));
2590 POP_DECLSPEC_STACK; }
2592 | declspecs_nots setspecs absdcl_maybe_attribute
2594 POP_DECLSPEC_STACK; }
2597 /* The first parm, which must suck attributes from off the top of the parser
2600 declspecs_ts_nosa setspecs_fp parm_declarator maybe_attribute
2601 { $$ = build_tree_list (build_tree_list (current_declspecs,
2603 chainon ($4, all_prefix_attributes));
2604 POP_DECLSPEC_STACK; }
2605 | declspecs_ts_nosa setspecs_fp notype_declarator maybe_attribute
2606 { $$ = build_tree_list (build_tree_list (current_declspecs,
2608 chainon ($4, all_prefix_attributes));
2609 POP_DECLSPEC_STACK; }
2610 | declspecs_ts_nosa setspecs_fp absdcl_maybe_attribute
2612 POP_DECLSPEC_STACK; }
2613 | declspecs_nots_nosa setspecs_fp notype_declarator maybe_attribute
2614 { $$ = build_tree_list (build_tree_list (current_declspecs,
2616 chainon ($4, all_prefix_attributes));
2617 POP_DECLSPEC_STACK; }
2619 | declspecs_nots_nosa setspecs_fp absdcl_maybe_attribute
2621 POP_DECLSPEC_STACK; }
2626 { prefix_attributes = chainon (prefix_attributes, $<ttype>-2);
2627 all_prefix_attributes = prefix_attributes; }
2630 /* This is used in a function definition
2631 where either a parmlist or an identifier list is ok.
2632 Its value is a list of ..._TYPE nodes or a list of identifiers. */
2633 parmlist_or_identifiers:
2636 clear_parm_order ();
2637 declare_parm_level (1); }
2638 parmlist_or_identifiers_1
2640 parmlist_tags_warning ();
2641 poplevel (0, 0, 0); }
2644 parmlist_or_identifiers_1:
2648 for (t = $1; t; t = TREE_CHAIN (t))
2649 if (TREE_VALUE (t) == NULL_TREE)
2650 error ("`...' in old-style identifier list");
2651 $$ = tree_cons (NULL_TREE, NULL_TREE, $1);
2653 /* Make sure we have a parmlist after attributes. */
2655 && (TREE_CODE ($$) != TREE_LIST
2656 || TREE_PURPOSE ($$) == 0
2657 || TREE_CODE (TREE_PURPOSE ($$)) != PARM_DECL))
2662 /* A nonempty list of identifiers. */
2665 { $$ = build_tree_list (NULL_TREE, $1); }
2666 | identifiers ',' IDENTIFIER
2667 { $$ = chainon ($1, build_tree_list (NULL_TREE, $3)); }
2670 /* A nonempty list of identifiers, including typenames. */
2671 identifiers_or_typenames:
2673 { $$ = build_tree_list (NULL_TREE, $1); }
2674 | identifiers_or_typenames ',' identifier
2675 { $$ = chainon ($1, build_tree_list (NULL_TREE, $3)); }
2680 { $$ = SAVE_EXT_FLAGS();
2682 warn_pointer_arith = 0;
2683 warn_traditional = 0;
2688 /* Objective-C productions. */
2698 if (objc_implementation_context)
2700 finish_class (objc_implementation_context);
2701 objc_ivar_chain = NULL_TREE;
2702 objc_implementation_context = NULL_TREE;
2705 warning ("`@end' must appear in an implementation context");
2709 /* A nonempty list of identifiers. */
2712 { $$ = build_tree_list (NULL_TREE, $1); }
2713 | identifier_list ',' identifier
2714 { $$ = chainon ($1, build_tree_list (NULL_TREE, $3)); }
2718 CLASS identifier_list ';'
2720 objc_declare_class ($2);
2725 ALIAS identifier identifier ';'
2727 objc_declare_alias ($2, $3);
2732 INTERFACE identifier protocolrefs '{'
2734 objc_interface_context = objc_ivar_context
2735 = start_class (CLASS_INTERFACE_TYPE, $2, NULL_TREE, $3);
2736 objc_public_flag = 0;
2740 continue_class (objc_interface_context);
2745 finish_class (objc_interface_context);
2746 objc_interface_context = NULL_TREE;
2749 | INTERFACE identifier protocolrefs
2751 objc_interface_context
2752 = start_class (CLASS_INTERFACE_TYPE, $2, NULL_TREE, $3);
2753 continue_class (objc_interface_context);
2758 finish_class (objc_interface_context);
2759 objc_interface_context = NULL_TREE;
2762 | INTERFACE identifier ':' identifier protocolrefs '{'
2764 objc_interface_context = objc_ivar_context
2765 = start_class (CLASS_INTERFACE_TYPE, $2, $4, $5);
2766 objc_public_flag = 0;
2770 continue_class (objc_interface_context);
2775 finish_class (objc_interface_context);
2776 objc_interface_context = NULL_TREE;
2779 | INTERFACE identifier ':' identifier protocolrefs
2781 objc_interface_context
2782 = start_class (CLASS_INTERFACE_TYPE, $2, $4, $5);
2783 continue_class (objc_interface_context);
2788 finish_class (objc_interface_context);
2789 objc_interface_context = NULL_TREE;
2792 | IMPLEMENTATION identifier '{'
2794 objc_implementation_context = objc_ivar_context
2795 = start_class (CLASS_IMPLEMENTATION_TYPE, $2, NULL_TREE, NULL_TREE);
2796 objc_public_flag = 0;
2801 = continue_class (objc_implementation_context);
2804 | IMPLEMENTATION identifier
2806 objc_implementation_context
2807 = start_class (CLASS_IMPLEMENTATION_TYPE, $2, NULL_TREE, NULL_TREE);
2809 = continue_class (objc_implementation_context);
2812 | IMPLEMENTATION identifier ':' identifier '{'
2814 objc_implementation_context = objc_ivar_context
2815 = start_class (CLASS_IMPLEMENTATION_TYPE, $2, $4, NULL_TREE);
2816 objc_public_flag = 0;
2821 = continue_class (objc_implementation_context);
2824 | IMPLEMENTATION identifier ':' identifier
2826 objc_implementation_context
2827 = start_class (CLASS_IMPLEMENTATION_TYPE, $2, $4, NULL_TREE);
2829 = continue_class (objc_implementation_context);
2832 | INTERFACE identifier '(' identifier ')' protocolrefs
2834 objc_interface_context
2835 = start_class (CATEGORY_INTERFACE_TYPE, $2, $4, $6);
2836 continue_class (objc_interface_context);
2841 finish_class (objc_interface_context);
2842 objc_interface_context = NULL_TREE;
2845 | IMPLEMENTATION identifier '(' identifier ')'
2847 objc_implementation_context
2848 = start_class (CATEGORY_IMPLEMENTATION_TYPE, $2, $4, NULL_TREE);
2850 = continue_class (objc_implementation_context);
2855 PROTOCOL identifier protocolrefs
2857 objc_pq_context = 1;
2858 objc_interface_context
2859 = start_protocol(PROTOCOL_INTERFACE_TYPE, $2, $3);
2863 objc_pq_context = 0;
2864 finish_protocol(objc_interface_context);
2865 objc_interface_context = NULL_TREE;
2867 /* The @protocol forward-declaration production introduces a
2868 reduce/reduce conflict on ';', which should be resolved in
2869 favor of the production 'identifier_list -> identifier'. */
2870 | PROTOCOL identifier_list ';'
2872 objc_declare_protocols ($2);
2881 | non_empty_protocolrefs
2884 non_empty_protocolrefs:
2885 ARITHCOMPARE identifier_list ARITHCOMPARE
2887 if ($1 == LT_EXPR && $3 == GT_EXPR)
2895 ivar_decl_list visibility_spec ivar_decls
2900 PRIVATE { objc_public_flag = 2; }
2901 | PROTECTED { objc_public_flag = 0; }
2902 | PUBLIC { objc_public_flag = 1; }
2910 | ivar_decls ivar_decl ';'
2914 pedwarn ("extra semicolon in struct or union specified");
2919 /* There is a shift-reduce conflict here, because `components' may
2920 start with a `typename'. It happens that shifting (the default resolution)
2921 does the right thing, because it treats the `typename' as part of
2922 a `typed_typespecs'.
2924 It is possible that this same technique would allow the distinction
2925 between `notype_initdecls' and `initdecls' to be eliminated.
2926 But I am being cautious and not trying it. */
2929 declspecs_nosc_ts setspecs ivars
2931 POP_DECLSPEC_STACK; }
2932 | declspecs_nosc_nots setspecs ivars
2934 POP_DECLSPEC_STACK; }
2943 | ivars ',' maybe_resetattrs ivar_declarator
2949 $$ = add_instance_variable (objc_ivar_context,
2951 $1, current_declspecs,
2954 | declarator ':' expr_no_commas
2956 $$ = add_instance_variable (objc_ivar_context,
2958 $1, current_declspecs, $3);
2960 | ':' expr_no_commas
2962 $$ = add_instance_variable (objc_ivar_context,
2965 current_declspecs, $2);
2971 { objc_inherit_code = CLASS_METHOD_DECL; }
2973 { objc_inherit_code = INSTANCE_METHOD_DECL; }
2979 objc_pq_context = 1;
2980 if (!objc_implementation_context)
2981 fatal_error ("method definition not in class context");
2985 objc_pq_context = 0;
2986 if (objc_inherit_code == CLASS_METHOD_DECL)
2987 add_class_method (objc_implementation_context, $3);
2989 add_instance_method (objc_implementation_context, $3);
2990 start_method_def ($3);
2994 continue_method_def ();
2998 finish_method_def ();
3002 /* the reason for the strange actions in this rule
3003 is so that notype_initdecls when reached via datadef
3004 can find a valid list of type and sc specs in $0. */
3008 | {$<ttype>$ = NULL_TREE; } methodprotolist2
3011 methodprotolist2: /* eliminates a shift/reduce conflict */
3014 | methodprotolist2 methodproto
3015 | methodprotolist2 {$<ttype>$ = NULL_TREE; } datadef
3026 /* Remember protocol qualifiers in prototypes. */
3027 objc_pq_context = 1;
3031 /* Forget protocol qualifiers here. */
3032 objc_pq_context = 0;
3033 if (objc_inherit_code == CLASS_METHOD_DECL)
3034 add_class_method (objc_interface_context, $3);
3036 add_instance_method (objc_interface_context, $3);
3042 '(' typename ')' unaryselector
3044 $$ = build_method_decl (objc_inherit_code, $2, $4, NULL_TREE);
3049 $$ = build_method_decl (objc_inherit_code, NULL_TREE, $1, NULL_TREE);
3052 | '(' typename ')' keywordselector optparmlist
3054 $$ = build_method_decl (objc_inherit_code, $2, $4, $5);
3057 | keywordselector optparmlist
3059 $$ = build_method_decl (objc_inherit_code, NULL_TREE, $1, $2);
3063 /* "optarglist" assumes that start_method_def has already been called...
3064 if it is not, the "xdecls" will not be placed in the proper scope */
3071 /* to get around the following situation: "int foo (int a) int b; {}" that
3072 is synthesized when parsing "- a:a b:b; id c; id d; { ... }" */
3087 declspecs_ts setspecs myparms ';'
3088 { POP_DECLSPEC_STACK; }
3090 { shadow_tag ($1); }
3091 | declspecs_nots ';'
3092 { pedwarn ("empty declaration"); }
3097 { push_parm_decl ($1); }
3098 | myparms ',' myparm
3099 { push_parm_decl ($3); }
3102 /* A single parameter declaration or parameter type name,
3103 as found in a parmlist. DOES NOT ALLOW AN INITIALIZER OR ASMSPEC */
3106 parm_declarator maybe_attribute
3107 { $$ = build_tree_list (build_tree_list (current_declspecs,
3109 chainon ($2, all_prefix_attributes)); }
3110 | notype_declarator maybe_attribute
3111 { $$ = build_tree_list (build_tree_list (current_declspecs,
3113 chainon ($2, all_prefix_attributes)); }
3114 | absdcl_maybe_attribute
3125 /* oh what a kludge! */
3126 $$ = objc_ellipsis_node;
3134 /* returns a tree list node generated by get_parm_info */
3147 | keywordselector keyworddecl
3149 $$ = chainon ($1, $2);
3162 ENUM | STRUCT | UNION | IF | ELSE | WHILE | DO | FOR
3163 | SWITCH | CASE | DEFAULT | BREAK | CONTINUE | RETURN
3164 | GOTO | ASM_KEYWORD | SIZEOF | TYPEOF | ALIGNOF
3165 | TYPESPEC | TYPE_QUAL
3169 selector ':' '(' typename ')' identifier
3171 $$ = build_keyword_decl ($1, $4, $6);
3174 | selector ':' identifier
3176 $$ = build_keyword_decl ($1, NULL_TREE, $3);
3179 | ':' '(' typename ')' identifier
3181 $$ = build_keyword_decl (NULL_TREE, $3, $5);
3186 $$ = build_keyword_decl (NULL_TREE, NULL_TREE, $2);
3197 | keywordarglist keywordarg
3199 $$ = chainon ($1, $2);
3207 if (TREE_CHAIN ($1) == NULL_TREE)
3208 /* just return the expr., remove a level of indirection */
3209 $$ = TREE_VALUE ($1);
3211 /* we have a comma expr., we will collapse later */
3217 selector ':' keywordexpr
3219 $$ = build_tree_list ($1, $3);
3223 $$ = build_tree_list (NULL_TREE, $2);
3231 $$ = get_class_reference ($1);
3236 '[' receiver messageargs ']'
3237 { $$ = build_tree_list ($2, $3); }
3247 | keywordnamelist keywordname
3249 $$ = chainon ($1, $2);
3256 $$ = build_tree_list ($1, NULL_TREE);
3260 $$ = build_tree_list (NULL_TREE, NULL_TREE);
3265 SELECTOR '(' selectorarg ')'
3272 PROTOCOL '(' identifier ')'
3278 /* extension to support C-structures in the archiver */
3281 ENCODE '(' typename ')'
3283 $$ = groktypename ($3);
3290 /* yylex() is a thin wrapper around c_lex(), all it does is translate
3291 cpplib.h's token codes into yacc's token codes. */
3293 static enum cpp_ttype last_token;
3295 /* The reserved keyword table. */
3299 ENUM_BITFIELD(rid) rid : 16;
3300 unsigned int disable : 16;
3303 /* Disable mask. Keywords are disabled if (reswords[i].disable & mask) is
3305 #define D_C89 0x01 /* not in C89 */
3306 #define D_EXT 0x02 /* GCC extension */
3307 #define D_EXT89 0x04 /* GCC extension incorporated in C99 */
3308 #define D_OBJC 0x08 /* Objective C only */
3310 static const struct resword reswords[] =
3312 { "_Bool", RID_BOOL, 0 },
3313 { "_Complex", RID_COMPLEX, 0 },
3314 { "__FUNCTION__", RID_FUNCTION_NAME, 0 },
3315 { "__PRETTY_FUNCTION__", RID_PRETTY_FUNCTION_NAME, 0 },
3316 { "__alignof", RID_ALIGNOF, 0 },
3317 { "__alignof__", RID_ALIGNOF, 0 },
3318 { "__asm", RID_ASM, 0 },
3319 { "__asm__", RID_ASM, 0 },
3320 { "__attribute", RID_ATTRIBUTE, 0 },
3321 { "__attribute__", RID_ATTRIBUTE, 0 },
3322 { "__builtin_choose_expr", RID_CHOOSE_EXPR, 0 },
3323 { "__builtin_types_compatible_p", RID_TYPES_COMPATIBLE_P, 0 },
3324 { "__builtin_va_arg", RID_VA_ARG, 0 },
3325 { "__complex", RID_COMPLEX, 0 },
3326 { "__complex__", RID_COMPLEX, 0 },
3327 { "__const", RID_CONST, 0 },
3328 { "__const__", RID_CONST, 0 },
3329 { "__extension__", RID_EXTENSION, 0 },
3330 { "__func__", RID_C99_FUNCTION_NAME, 0 },
3331 { "__imag", RID_IMAGPART, 0 },
3332 { "__imag__", RID_IMAGPART, 0 },
3333 { "__inline", RID_INLINE, 0 },
3334 { "__inline__", RID_INLINE, 0 },
3335 { "__label__", RID_LABEL, 0 },
3336 { "__ptrbase", RID_PTRBASE, 0 },
3337 { "__ptrbase__", RID_PTRBASE, 0 },
3338 { "__ptrextent", RID_PTREXTENT, 0 },
3339 { "__ptrextent__", RID_PTREXTENT, 0 },
3340 { "__ptrvalue", RID_PTRVALUE, 0 },
3341 { "__ptrvalue__", RID_PTRVALUE, 0 },
3342 { "__real", RID_REALPART, 0 },
3343 { "__real__", RID_REALPART, 0 },
3344 { "__restrict", RID_RESTRICT, 0 },
3345 { "__restrict__", RID_RESTRICT, 0 },
3346 { "__signed", RID_SIGNED, 0 },
3347 { "__signed__", RID_SIGNED, 0 },
3348 { "__thread", RID_THREAD, 0 },
3349 { "__typeof", RID_TYPEOF, 0 },
3350 { "__typeof__", RID_TYPEOF, 0 },
3351 { "__volatile", RID_VOLATILE, 0 },
3352 { "__volatile__", RID_VOLATILE, 0 },
3353 { "asm", RID_ASM, D_EXT },
3354 { "auto", RID_AUTO, 0 },
3355 { "break", RID_BREAK, 0 },
3356 { "case", RID_CASE, 0 },
3357 { "char", RID_CHAR, 0 },
3358 { "const", RID_CONST, 0 },
3359 { "continue", RID_CONTINUE, 0 },
3360 { "default", RID_DEFAULT, 0 },
3361 { "do", RID_DO, 0 },
3362 { "double", RID_DOUBLE, 0 },
3363 { "else", RID_ELSE, 0 },
3364 { "enum", RID_ENUM, 0 },
3365 { "extern", RID_EXTERN, 0 },
3366 { "float", RID_FLOAT, 0 },
3367 { "for", RID_FOR, 0 },
3368 { "goto", RID_GOTO, 0 },
3369 { "if", RID_IF, 0 },
3370 { "inline", RID_INLINE, D_EXT89 },
3371 { "int", RID_INT, 0 },
3372 { "long", RID_LONG, 0 },
3373 { "register", RID_REGISTER, 0 },
3374 { "restrict", RID_RESTRICT, D_C89 },
3375 { "return", RID_RETURN, 0 },
3376 { "short", RID_SHORT, 0 },
3377 { "signed", RID_SIGNED, 0 },
3378 { "sizeof", RID_SIZEOF, 0 },
3379 { "static", RID_STATIC, 0 },
3380 { "struct", RID_STRUCT, 0 },
3381 { "switch", RID_SWITCH, 0 },
3382 { "typedef", RID_TYPEDEF, 0 },
3383 { "typeof", RID_TYPEOF, D_EXT },
3384 { "union", RID_UNION, 0 },
3385 { "unsigned", RID_UNSIGNED, 0 },
3386 { "void", RID_VOID, 0 },
3387 { "volatile", RID_VOLATILE, 0 },
3388 { "while", RID_WHILE, 0 },
3390 { "id", RID_ID, D_OBJC },
3392 /* These objc keywords are recognized only immediately after
3394 { "class", RID_AT_CLASS, D_OBJC },
3395 { "compatibility_alias", RID_AT_ALIAS, D_OBJC },
3396 { "defs", RID_AT_DEFS, D_OBJC },
3397 { "encode", RID_AT_ENCODE, D_OBJC },
3398 { "end", RID_AT_END, D_OBJC },
3399 { "implementation", RID_AT_IMPLEMENTATION, D_OBJC },
3400 { "interface", RID_AT_INTERFACE, D_OBJC },
3401 { "private", RID_AT_PRIVATE, D_OBJC },
3402 { "protected", RID_AT_PROTECTED, D_OBJC },
3403 { "protocol", RID_AT_PROTOCOL, D_OBJC },
3404 { "public", RID_AT_PUBLIC, D_OBJC },
3405 { "selector", RID_AT_SELECTOR, D_OBJC },
3407 /* These are recognized only in protocol-qualifier context
3409 { "bycopy", RID_BYCOPY, D_OBJC },
3410 { "byref", RID_BYREF, D_OBJC },
3411 { "in", RID_IN, D_OBJC },
3412 { "inout", RID_INOUT, D_OBJC },
3413 { "oneway", RID_ONEWAY, D_OBJC },
3414 { "out", RID_OUT, D_OBJC },
3417 #define N_reswords (sizeof reswords / sizeof (struct resword))
3419 /* Table mapping from RID_* constants to yacc token numbers.
3420 Unfortunately we have to have entries for all the keywords in all
3422 static const short rid_to_yy[RID_MAX] =
3424 /* RID_STATIC */ STATIC,
3425 /* RID_UNSIGNED */ TYPESPEC,
3426 /* RID_LONG */ TYPESPEC,
3427 /* RID_CONST */ TYPE_QUAL,
3428 /* RID_EXTERN */ SCSPEC,
3429 /* RID_REGISTER */ SCSPEC,
3430 /* RID_TYPEDEF */ SCSPEC,
3431 /* RID_SHORT */ TYPESPEC,
3432 /* RID_INLINE */ SCSPEC,
3433 /* RID_VOLATILE */ TYPE_QUAL,
3434 /* RID_SIGNED */ TYPESPEC,
3435 /* RID_AUTO */ SCSPEC,
3436 /* RID_RESTRICT */ TYPE_QUAL,
3439 /* RID_COMPLEX */ TYPESPEC,
3440 /* RID_THREAD */ SCSPEC,
3444 /* RID_VIRTUAL */ 0,
3445 /* RID_EXPLICIT */ 0,
3447 /* RID_MUTABLE */ 0,
3450 /* RID_IN */ TYPE_QUAL,
3451 /* RID_OUT */ TYPE_QUAL,
3452 /* RID_INOUT */ TYPE_QUAL,
3453 /* RID_BYCOPY */ TYPE_QUAL,
3454 /* RID_BYREF */ TYPE_QUAL,
3455 /* RID_ONEWAY */ TYPE_QUAL,
3458 /* RID_INT */ TYPESPEC,
3459 /* RID_CHAR */ TYPESPEC,
3460 /* RID_FLOAT */ TYPESPEC,
3461 /* RID_DOUBLE */ TYPESPEC,
3462 /* RID_VOID */ TYPESPEC,
3463 /* RID_ENUM */ ENUM,
3464 /* RID_STRUCT */ STRUCT,
3465 /* RID_UNION */ UNION,
3467 /* RID_ELSE */ ELSE,
3468 /* RID_WHILE */ WHILE,
3471 /* RID_SWITCH */ SWITCH,
3472 /* RID_CASE */ CASE,
3473 /* RID_DEFAULT */ DEFAULT,
3474 /* RID_BREAK */ BREAK,
3475 /* RID_CONTINUE */ CONTINUE,
3476 /* RID_RETURN */ RETURN,
3477 /* RID_GOTO */ GOTO,
3478 /* RID_SIZEOF */ SIZEOF,
3481 /* RID_ASM */ ASM_KEYWORD,
3482 /* RID_TYPEOF */ TYPEOF,
3483 /* RID_ALIGNOF */ ALIGNOF,
3484 /* RID_ATTRIBUTE */ ATTRIBUTE,
3485 /* RID_VA_ARG */ VA_ARG,
3486 /* RID_EXTENSION */ EXTENSION,
3487 /* RID_IMAGPART */ IMAGPART,
3488 /* RID_REALPART */ REALPART,
3489 /* RID_LABEL */ LABEL,
3490 /* RID_PTRBASE */ PTR_BASE,
3491 /* RID_PTREXTENT */ PTR_EXTENT,
3492 /* RID_PTRVALUE */ PTR_VALUE,
3494 /* RID_CHOOSE_EXPR */ CHOOSE_EXPR,
3495 /* RID_TYPES_COMPATIBLE_P */ TYPES_COMPATIBLE_P,
3497 /* RID_FUNCTION_NAME */ STRING_FUNC_NAME,
3498 /* RID_PRETTY_FUNCTION_NAME */ STRING_FUNC_NAME,
3499 /* RID_C99_FUNCTION_NAME */ VAR_FUNC_NAME,
3502 /* RID_BOOL */ TYPESPEC,
3506 /* RID_PRIVATE */ 0,
3507 /* RID_PROTECTED */ 0,
3508 /* RID_TEMPLATE */ 0,
3513 /* RID_NAMESPACE */ 0,
3515 /* RID_OPERATOR */ 0,
3520 /* RID_TYPENAME */ 0,
3525 /* RID_CONSTCAST */ 0,
3526 /* RID_DYNCAST */ 0,
3527 /* RID_REINTCAST */ 0,
3528 /* RID_STATCAST */ 0,
3531 /* RID_ID */ OBJECTNAME,
3532 /* RID_AT_ENCODE */ ENCODE,
3533 /* RID_AT_END */ END,
3534 /* RID_AT_CLASS */ CLASS,
3535 /* RID_AT_ALIAS */ ALIAS,
3536 /* RID_AT_DEFS */ DEFS,
3537 /* RID_AT_PRIVATE */ PRIVATE,
3538 /* RID_AT_PROTECTED */ PROTECTED,
3539 /* RID_AT_PUBLIC */ PUBLIC,
3540 /* RID_AT_PROTOCOL */ PROTOCOL,
3541 /* RID_AT_SELECTOR */ SELECTOR,
3542 /* RID_AT_INTERFACE */ INTERFACE,
3543 /* RID_AT_IMPLEMENTATION */ IMPLEMENTATION
3551 int mask = (flag_isoc99 ? 0 : D_C89)
3552 | (flag_no_asm ? (flag_isoc99 ? D_EXT : D_EXT|D_EXT89) : 0);
3557 ridpointers = (tree *) ggc_calloc ((int) RID_MAX, sizeof (tree));
3558 for (i = 0; i < N_reswords; i++)
3560 /* If a keyword is disabled, do not enter it into the table
3561 and so create a canonical spelling that isn't a keyword. */
3562 if (reswords[i].disable & mask)
3565 id = get_identifier (reswords[i].word);
3566 C_RID_CODE (id) = reswords[i].rid;
3567 C_IS_RESERVED_WORD (id) = 1;
3568 ridpointers [(int) reswords[i].rid] = id;
3572 #define NAME(type) cpp_type2name (type)
3578 const char *string = _(msgid);
3580 if (last_token == CPP_EOF)
3581 error ("%s at end of input", string);
3582 else if (last_token == CPP_CHAR || last_token == CPP_WCHAR)
3584 unsigned int val = TREE_INT_CST_LOW (yylval.ttype);
3585 const char *const ell = (last_token == CPP_CHAR) ? "" : "L";
3586 if (val <= UCHAR_MAX && ISGRAPH (val))
3587 error ("%s before %s'%c'", string, ell, val);
3589 error ("%s before %s'\\x%x'", string, ell, val);
3591 else if (last_token == CPP_STRING
3592 || last_token == CPP_WSTRING)
3593 error ("%s before string constant", string);
3594 else if (last_token == CPP_NUMBER)
3595 error ("%s before numeric constant", string);
3596 else if (last_token == CPP_NAME)
3597 error ("%s before \"%s\"", string, IDENTIFIER_POINTER (yylval.ttype));
3599 error ("%s before '%s' token", string, NAME(last_token));
3608 int objc_force_identifier = objc_need_raw_identifier;
3609 OBJC_NEED_RAW_IDENTIFIER (0);
3612 if (C_IS_RESERVED_WORD (yylval.ttype))
3614 enum rid rid_code = C_RID_CODE (yylval.ttype);
3617 /* Turn non-typedefed refs to "id" into plain identifiers; this
3618 allows constructs like "void foo(id id);" to work. */
3619 if (rid_code == RID_ID)
3621 decl = lookup_name (yylval.ttype);
3622 if (decl == NULL_TREE || TREE_CODE (decl) != TYPE_DECL)
3626 if (!OBJC_IS_AT_KEYWORD (rid_code)
3627 && (!OBJC_IS_PQ_KEYWORD (rid_code) || objc_pq_context))
3630 int yycode = rid_to_yy[(int) rid_code];
3631 if (yycode == STRING_FUNC_NAME)
3633 /* __FUNCTION__ and __PRETTY_FUNCTION__ get converted
3634 to string constants. */
3635 const char *name = fname_string (rid_code);
3637 yylval.ttype = build_string (strlen (name) + 1, name);
3638 C_ARTIFICIAL_STRING_P (yylval.ttype) = 1;
3639 last_token = CPP_STRING; /* so yyerror won't choke */
3643 /* Return the canonical spelling for this keyword. */
3644 yylval.ttype = ridpointers[(int) rid_code];
3649 decl = lookup_name (yylval.ttype);
3652 if (TREE_CODE (decl) == TYPE_DECL)
3658 tree objc_interface_decl = is_class_name (yylval.ttype);
3659 /* ObjC class names are in the same namespace as variables and
3660 typedefs, and hence are shadowed by local declarations. */
3661 if (objc_interface_decl
3662 && (global_bindings_p ()
3663 || (!objc_force_identifier && !decl)))
3665 yylval.ttype = objc_interface_decl;
3674 /* Concatenate strings before returning them to the parser. This isn't quite
3675 as good as having it done in the lexer, but it's better than nothing. */
3680 enum cpp_ttype next_type;
3681 tree orig = yylval.ttype;
3683 next_type = c_lex (&yylval.ttype);
3684 if (next_type == CPP_STRING
3685 || next_type == CPP_WSTRING
3686 || (next_type == CPP_NAME && yylexname () == STRING))
3688 varray_type strings;
3691 static location_t last_location;
3692 if (warn_traditional && !in_system_header
3693 && (input_location.line != last_location.line
3694 || !last_location.file ||
3695 strcmp (last_location.file, input_location.file)))
3697 warning ("traditional C rejects string concatenation");
3698 last_location = input_location;
3702 VARRAY_TREE_INIT (strings, 32, "strings");
3703 VARRAY_PUSH_TREE (strings, orig);
3707 VARRAY_PUSH_TREE (strings, yylval.ttype);
3708 next_type = c_lex (&yylval.ttype);
3710 while (next_type == CPP_STRING
3711 || next_type == CPP_WSTRING
3712 || (next_type == CPP_NAME && yylexname () == STRING));
3714 yylval.ttype = combine_strings (strings);
3717 yylval.ttype = orig;
3719 /* We will have always read one token too many. */
3720 _cpp_backup_tokens (parse_in, 1);
3729 last_token = c_lex (&yylval.ttype);
3732 case CPP_EQ: return '=';
3733 case CPP_NOT: return '!';
3734 case CPP_GREATER: yylval.code = GT_EXPR; return ARITHCOMPARE;
3735 case CPP_LESS: yylval.code = LT_EXPR; return ARITHCOMPARE;
3736 case CPP_PLUS: yylval.code = PLUS_EXPR; return '+';
3737 case CPP_MINUS: yylval.code = MINUS_EXPR; return '-';
3738 case CPP_MULT: yylval.code = MULT_EXPR; return '*';
3739 case CPP_DIV: yylval.code = TRUNC_DIV_EXPR; return '/';
3740 case CPP_MOD: yylval.code = TRUNC_MOD_EXPR; return '%';
3741 case CPP_AND: yylval.code = BIT_AND_EXPR; return '&';
3742 case CPP_OR: yylval.code = BIT_IOR_EXPR; return '|';
3743 case CPP_XOR: yylval.code = BIT_XOR_EXPR; return '^';
3744 case CPP_RSHIFT: yylval.code = RSHIFT_EXPR; return RSHIFT;
3745 case CPP_LSHIFT: yylval.code = LSHIFT_EXPR; return LSHIFT;
3747 case CPP_COMPL: return '~';
3748 case CPP_AND_AND: return ANDAND;
3749 case CPP_OR_OR: return OROR;
3750 case CPP_QUERY: return '?';
3751 case CPP_OPEN_PAREN: return '(';
3752 case CPP_EQ_EQ: yylval.code = EQ_EXPR; return EQCOMPARE;
3753 case CPP_NOT_EQ: yylval.code = NE_EXPR; return EQCOMPARE;
3754 case CPP_GREATER_EQ:yylval.code = GE_EXPR; return ARITHCOMPARE;
3755 case CPP_LESS_EQ: yylval.code = LE_EXPR; return ARITHCOMPARE;
3757 case CPP_PLUS_EQ: yylval.code = PLUS_EXPR; return ASSIGN;
3758 case CPP_MINUS_EQ: yylval.code = MINUS_EXPR; return ASSIGN;
3759 case CPP_MULT_EQ: yylval.code = MULT_EXPR; return ASSIGN;
3760 case CPP_DIV_EQ: yylval.code = TRUNC_DIV_EXPR; return ASSIGN;
3761 case CPP_MOD_EQ: yylval.code = TRUNC_MOD_EXPR; return ASSIGN;
3762 case CPP_AND_EQ: yylval.code = BIT_AND_EXPR; return ASSIGN;
3763 case CPP_OR_EQ: yylval.code = BIT_IOR_EXPR; return ASSIGN;
3764 case CPP_XOR_EQ: yylval.code = BIT_XOR_EXPR; return ASSIGN;
3765 case CPP_RSHIFT_EQ: yylval.code = RSHIFT_EXPR; return ASSIGN;
3766 case CPP_LSHIFT_EQ: yylval.code = LSHIFT_EXPR; return ASSIGN;
3768 case CPP_OPEN_SQUARE: return '[';
3769 case CPP_CLOSE_SQUARE: return ']';
3770 case CPP_OPEN_BRACE: return '{';
3771 case CPP_CLOSE_BRACE: return '}';
3772 case CPP_ELLIPSIS: return ELLIPSIS;
3774 case CPP_PLUS_PLUS: return PLUSPLUS;
3775 case CPP_MINUS_MINUS: return MINUSMINUS;
3776 case CPP_DEREF: return POINTSAT;
3777 case CPP_DOT: return '.';
3779 /* The following tokens may affect the interpretation of any
3780 identifiers following, if doing Objective-C. */
3781 case CPP_COLON: OBJC_NEED_RAW_IDENTIFIER (0); return ':';
3782 case CPP_COMMA: OBJC_NEED_RAW_IDENTIFIER (0); return ',';
3783 case CPP_CLOSE_PAREN: OBJC_NEED_RAW_IDENTIFIER (0); return ')';
3784 case CPP_SEMICOLON: OBJC_NEED_RAW_IDENTIFIER (0); return ';';
3791 int ret = yylexname ();
3793 return yylexstring ();
3805 return yylexstring ();
3807 /* This token is Objective-C specific. It gives the next token
3808 special significance. */
3813 enum cpp_ttype after_at_type;
3815 after_at_type = c_lex (&after_at);
3817 if (after_at_type == CPP_NAME
3818 && C_IS_RESERVED_WORD (after_at)
3819 && OBJC_IS_AT_KEYWORD (C_RID_CODE (after_at)))
3821 yylval.ttype = after_at;
3822 last_token = after_at_type;
3823 return rid_to_yy [(int) C_RID_CODE (after_at)];
3825 _cpp_backup_tokens (parse_in, 1);
3830 /* These tokens are C++ specific (and will not be generated
3831 in C mode, but let's be cautious). */
3833 case CPP_DEREF_STAR:
3839 /* These tokens should not survive translation phase 4. */
3842 error ("syntax error at '%s' token", NAME(last_token));
3855 timevar_push (TV_LEX);
3857 timevar_pop (TV_LEX);
3861 /* Function used when yydebug is set, to print a token in more detail. */
3864 yyprint (file, yychar, yyl)
3871 fprintf (file, " [%s]", NAME(last_token));
3882 if (IDENTIFIER_POINTER (t))
3883 fprintf (file, " `%s'", IDENTIFIER_POINTER (t));
3887 fprintf (file, " %s", GET_MODE_NAME (TYPE_MODE (TREE_TYPE (t))));
3888 if (TREE_CODE (t) == INTEGER_CST)
3891 fprintf (file, HOST_WIDE_INT_PRINT_DOUBLE_HEX,
3892 TREE_INT_CST_HIGH (t), TREE_INT_CST_LOW (t));
3898 /* This is not the ideal place to put these, but we have to get them out
3899 of c-lex.c because cp/lex.c has its own versions. */
3901 /* Free malloced parser stacks if necessary. */
3904 free_parser_stacks ()
3908 free (malloced_yyss);
3909 free (malloced_yyvs);
3913 #include "gt-c-parse.h"