* [RFA] c-parse.in unify ObjC tokens
@ 2004-06-11 20:30 David Ayers
0 siblings, 0 replies; only message in thread
From: David Ayers @ 2004-06-11 20:30 UTC (permalink / raw)
To: GCC Patch List
[-- Attachment #1: Type: text/plain, Size: 395 bytes --]
Hello,
this is fallout from an upcoming ObjC feature patch. It's purely
mechanical in that it adds the AT_ prefix to rest of the ObjC tokens
which have this prefix (i.e. @interface, @implementation, ...) There is
no functional change, but it may make reading the file for newcomers
a bit easier.
Please apply if approved.
Bootstrapped and tested on i686-pc-linux-gnu.
Cheers,
David Ayers
[-- Attachment #2: objc.patch --]
[-- Type: text/plain, Size: 5620 bytes --]
2004-06-10 David Ayers <d.ayers@inode.at>
* c-parse.in: Unify Objective-C token names.
Index: c-parse.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-parse.in,v
retrieving revision 1.207
diff -u -r1.207 c-parse.in
--- c-parse.in 7 Jun 2004 19:49:28 -0000 1.207
+++ c-parse.in 10 Jun 2004 16:31:52 -0000
@@ -174,8 +174,9 @@
/* The Objective-C keywords. These are included in C and in
Objective C, so that the token codes are the same in both. */
-%token INTERFACE IMPLEMENTATION END SELECTOR DEFS ENCODE
-%token CLASSNAME PUBLIC PRIVATE PROTECTED PROTOCOL OBJECTNAME CLASS ALIAS
+%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_THROW AT_TRY AT_CATCH AT_FINALLY AT_SYNCHRONIZED
%token OBJC_STRING
@@ -1777,7 +1778,7 @@
pedwarn ("extra semicolon in struct or union specified"); }
@@ifobjc
/* foo(sizeof(struct{ @defs(ClassName)})); */
- | DEFS '(' CLASSNAME ')'
+ | AT_DEFS '(' CLASSNAME ')'
{ $$ = nreverse (get_class_ivars_from_name ($3)); }
@@end_ifobjc
;
@@ -2727,7 +2728,7 @@
| aliasdecl
| protocoldef
| methoddef
- | END
+ | AT_END
{
if (objc_implementation_context)
{
@@ -2749,14 +2750,14 @@
;
classdecl:
- CLASS identifier_list ';'
+ AT_CLASS identifier_list ';'
{
objc_declare_class ($2);
}
;
aliasdecl:
- ALIAS identifier identifier ';'
+ AT_ALIAS identifier identifier ';'
{
objc_declare_alias ($2, $3);
}
@@ -2773,7 +2774,7 @@
;
classdef:
- INTERFACE identifier superclass protocolrefs
+ AT_INTERFACE identifier superclass protocolrefs
{
objc_interface_context = objc_ivar_context
= start_class (CLASS_INTERFACE_TYPE, $2, $3, $4);
@@ -2783,13 +2784,13 @@
{
continue_class (objc_interface_context);
}
- methodprotolist END
+ methodprotolist AT_END
{
finish_class (objc_interface_context);
objc_interface_context = NULL_TREE;
}
- | IMPLEMENTATION identifier superclass
+ | AT_IMPLEMENTATION identifier superclass
{
objc_implementation_context = objc_ivar_context
= start_class (CLASS_IMPLEMENTATION_TYPE, $2, $3, NULL_TREE);
@@ -2801,19 +2802,19 @@
= continue_class (objc_implementation_context);
}
- | INTERFACE identifier '(' identifier ')' protocolrefs
+ | AT_INTERFACE identifier '(' identifier ')' protocolrefs
{
objc_interface_context
= start_class (CATEGORY_INTERFACE_TYPE, $2, $4, $6);
continue_class (objc_interface_context);
}
- methodprotolist END
+ methodprotolist AT_END
{
finish_class (objc_interface_context);
objc_interface_context = NULL_TREE;
}
- | IMPLEMENTATION identifier '(' identifier ')'
+ | AT_IMPLEMENTATION identifier '(' identifier ')'
{
objc_implementation_context
= start_class (CATEGORY_IMPLEMENTATION_TYPE, $2, $4, NULL_TREE);
@@ -2823,13 +2824,13 @@
;
protocoldef:
- PROTOCOL identifier protocolrefs
+ AT_PROTOCOL identifier protocolrefs
{
objc_pq_context = 1;
objc_interface_context
= start_protocol(PROTOCOL_INTERFACE_TYPE, $2, $3);
}
- methodprotolist END
+ methodprotolist AT_END
{
objc_pq_context = 0;
finish_protocol(objc_interface_context);
@@ -2838,7 +2839,7 @@
/* The @protocol forward-declaration production introduces a
reduce/reduce conflict on ';', which should be resolved in
favor of the production 'identifier_list -> identifier'. */
- | PROTOCOL identifier_list ';'
+ | AT_PROTOCOL identifier_list ';'
{
objc_declare_protocols ($2);
}
@@ -2868,9 +2869,9 @@
;
visibility_spec:
- PRIVATE { objc_public_flag = 2; }
- | PROTECTED { objc_public_flag = 0; }
- | PUBLIC { objc_public_flag = 1; }
+ AT_PRIVATE { objc_public_flag = 2; }
+ | AT_PROTECTED { objc_public_flag = 0; }
+ | AT_PUBLIC { objc_public_flag = 1; }
;
ivar_decls:
@@ -3229,14 +3230,14 @@
;
objcselectorexpr:
- SELECTOR '(' selectorarg ')'
+ AT_SELECTOR '(' selectorarg ')'
{
$$ = $3;
}
;
objcprotocolexpr:
- PROTOCOL '(' identifier ')'
+ AT_PROTOCOL '(' identifier ')'
{
$$ = $3;
}
@@ -3245,7 +3246,7 @@
/* extension to support C-structures in the archiver */
objcencodeexpr:
- ENCODE '(' typename ')'
+ AT_ENCODE '(' typename ')'
{
$$ = groktypename ($3);
}
@@ -3502,23 +3503,23 @@
/* Objective C */
/* RID_ID */ OBJECTNAME,
- /* RID_AT_ENCODE */ ENCODE,
- /* RID_AT_END */ END,
- /* RID_AT_CLASS */ CLASS,
- /* RID_AT_ALIAS */ ALIAS,
- /* RID_AT_DEFS */ DEFS,
- /* RID_AT_PRIVATE */ PRIVATE,
- /* RID_AT_PROTECTED */ PROTECTED,
- /* RID_AT_PUBLIC */ PUBLIC,
- /* RID_AT_PROTOCOL */ PROTOCOL,
- /* RID_AT_SELECTOR */ SELECTOR,
+ /* RID_AT_ENCODE */ AT_ENCODE,
+ /* RID_AT_END */ AT_END,
+ /* RID_AT_CLASS */ AT_CLASS,
+ /* RID_AT_ALIAS */ AT_ALIAS,
+ /* RID_AT_DEFS */ AT_DEFS,
+ /* RID_AT_PRIVATE */ AT_PRIVATE,
+ /* RID_AT_PROTECTED */ AT_PROTECTED,
+ /* RID_AT_PUBLIC */ AT_PUBLIC,
+ /* RID_AT_PROTOCOL */ AT_PROTOCOL,
+ /* RID_AT_SELECTOR */ AT_SELECTOR,
/* RID_AT_THROW */ AT_THROW,
/* RID_AT_TRY */ AT_TRY,
/* RID_AT_CATCH */ AT_CATCH,
/* RID_AT_FINALLY */ AT_FINALLY,
/* RID_AT_SYNCHRONIZED */ AT_SYNCHRONIZED,
- /* RID_AT_INTERFACE */ INTERFACE,
- /* RID_AT_IMPLEMENTATION */ IMPLEMENTATION
+ /* RID_AT_INTERFACE */ AT_INTERFACE,
+ /* RID_AT_IMPLEMENTATION */ AT_IMPLEMENTATION
};
static void
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-06-11 19:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-11 20:30 [RFA] c-parse.in unify ObjC tokens David Ayers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).