%token BREAK CONTINUE RETURN GOTO ASM_KEYWORD TYPEOF ALIGNOF
%token ATTRIBUTE EXTENSION LABEL
%token REALPART IMAGPART VA_ARG CHOOSE_EXPR TYPES_COMPATIBLE_P
-%token PTR_VALUE PTR_BASE PTR_EXTENT
%token FUNC_NAME OFFSETOF
/* Add precedence rules to solve dangling else s/r conflict */
Objective C, so that the token codes are the same in both. */
%token AT_INTERFACE AT_IMPLEMENTATION AT_END AT_SELECTOR AT_DEFS AT_ENCODE
%token CLASSNAME AT_PUBLIC AT_PRIVATE AT_PROTECTED AT_PROTOCOL
-%token OBJECTNAME AT_CLASS AT_ALIAS
+%token AT_CLASS AT_ALIAS
%token AT_THROW AT_TRY AT_CATCH AT_FINALLY AT_SYNCHRONIZED
%token OBJC_STRING
%type <ttype> selectorarg keywordnamelist keywordname objcencodeexpr
%type <ttype> non_empty_protocolrefs protocolrefs identifier_list objcprotocolexpr
-%type <ttype> CLASSNAME OBJECTNAME OBJC_STRING OBJC_TYPE_QUAL
+%type <ttype> CLASSNAME OBJC_STRING OBJC_TYPE_QUAL
%type <ttype> superclass objc_quals objc_qual objc_typename
%type <itype> objc_try_catch_stmt optellipsis
datadef:
setspecs notype_initdecls ';'
- { if (pedantic)
- error ("ISO C forbids data definition with no type or storage class");
- else
- warning ("data definition has no type or storage class");
-
+ { pedwarn ("data definition has no type or storage class");
POP_DECLSPEC_STACK; }
| declspecs_nots setspecs notype_initdecls ';'
{ POP_DECLSPEC_STACK; }
IDENTIFIER
| TYPENAME
@@ifobjc
- | OBJECTNAME
| CLASSNAME
@@end_ifobjc
;
c = fold ($3.value);
STRIP_NOPS (c);
if (TREE_CODE (c) != INTEGER_CST)
- error ("first argument to __builtin_choose_expr not"
+ error ("first argument to %<__builtin_choose_expr%> not"
" a constant");
$$ = integer_zerop (c) ? $7 : $5;
}
| CLASSNAME protocolrefs
{ $$.kind = ctsk_objc;
$$.spec = objc_get_protocol_qualified_type ($1, $2); }
- | OBJECTNAME protocolrefs
+ | TYPENAME non_empty_protocolrefs
{ $$.kind = ctsk_objc;
$$.spec = objc_get_protocol_qualified_type ($1, $2); }
designator_list '=' initval
{ if (pedantic && !flag_isoc99)
pedwarn ("ISO C90 forbids specifying subobject to initialize"); }
- | designator initval
+ | array_designator initval
{ if (pedantic)
pedwarn ("obsolete use of designated initializer without %<=%>"); }
| identifier ':'
designator:
'.' identifier
{ set_init_label ($2); }
- | '[' expr_no_commas ELLIPSIS expr_no_commas ']'
+ | array_designator
+ ;
+
+array_designator:
+ '[' expr_no_commas ELLIPSIS expr_no_commas ']'
{ set_init_index ($2.value, $4.value);
if (pedantic)
pedwarn ("ISO C forbids specifying range of elements to initialize"); }
{ $$ = make_pointer_declarator ($2, $3); }
| TYPENAME
{ $$ = build_id_declarator ($1); }
-@@ifobjc
- | OBJECTNAME
- { $$ = build_id_declarator ($1); }
-@@end_ifobjc
;
/* Kinds of declarator that can appear in a parameter list
{ $$ = set_array_declarator_inner ($2, $1, false); }
| TYPENAME
{ $$ = build_id_declarator ($1); }
-@@ifobjc
- | OBJECTNAME
- { $$ = build_id_declarator ($1); }
-@@end_ifobjc
;
parm_declarator_nostarttypename:
IDENTIFIER
| TYPENAME
| CLASSNAME
- | OBJECTNAME
| reservedwords
;
ENUM | STRUCT | UNION | IF | ELSE | WHILE | DO | FOR
| SWITCH | CASE | DEFAULT | BREAK | CONTINUE | RETURN
| GOTO | ASM_KEYWORD | SIZEOF | TYPEOF | ALIGNOF
- | TYPESPEC | TYPE_QUAL
+ | TYPESPEC | TYPE_QUAL | OBJC_TYPE_QUAL
;
objc_qual:
{ "__inline", RID_INLINE, 0 },
{ "__inline__", RID_INLINE, 0 },
{ "__label__", RID_LABEL, 0 },
- { "__ptrbase", RID_PTRBASE, 0 },
- { "__ptrbase__", RID_PTRBASE, 0 },
- { "__ptrextent", RID_PTREXTENT, 0 },
- { "__ptrextent__", RID_PTREXTENT, 0 },
- { "__ptrvalue", RID_PTRVALUE, 0 },
- { "__ptrvalue__", RID_PTRVALUE, 0 },
{ "__real", RID_REALPART, 0 },
{ "__real__", RID_REALPART, 0 },
{ "__restrict", RID_RESTRICT, 0 },
{ "while", RID_WHILE, 0 },
@@ifobjc
- { "id", RID_ID, D_OBJC },
/* These objc keywords are recognized only immediately after
an '@'. */
/* RID_IMAGPART */ IMAGPART,
/* RID_REALPART */ REALPART,
/* RID_LABEL */ LABEL,
- /* RID_PTRBASE */ PTR_BASE,
- /* RID_PTREXTENT */ PTR_EXTENT,
- /* RID_PTRVALUE */ PTR_VALUE,
/* RID_CHOOSE_EXPR */ CHOOSE_EXPR,
/* RID_TYPES_COMPATIBLE_P */ TYPES_COMPATIBLE_P,
/* RID_STATCAST */ 0,
/* Objective C */
- /* RID_ID */ OBJECTNAME,
/* RID_AT_ENCODE */ AT_ENCODE,
/* RID_AT_END */ AT_END,
/* RID_AT_CLASS */ AT_CLASS,
enum rid rid_code = C_RID_CODE (yylval.ttype);
@@ifobjc
- /* Turn non-typedefed refs to "id" into plain identifiers; this
- allows constructs like "void foo(id id);" to work. */
- if (rid_code == RID_ID)
- {
- decl = lookup_name (yylval.ttype);
- if (decl == NULL_TREE || TREE_CODE (decl) != TYPE_DECL)
- return IDENTIFIER;
- }
-
if (!OBJC_IS_AT_KEYWORD (rid_code)
&& (!OBJC_IS_PQ_KEYWORD (rid_code) || objc_pq_context))
@@end_ifobjc
{
case IDENTIFIER:
case TYPENAME:
- case OBJECTNAME:
case TYPESPEC:
case TYPE_QUAL:
case SCSPEC: