summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1996-04-20 23:55:24 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1996-04-20 23:55:24 +0000
commit81dc5ae7e2388dffccdcecf16d985b6d05ad449d (patch)
tree198a96479afb96182b45b3be127c4890eba9ec25
parent810e20be40767fd5b0cc2b36dc882fbbdad1c3e2 (diff)
downloadppe42-gcc-81dc5ae7e2388dffccdcecf16d985b6d05ad449d.tar.gz
ppe42-gcc-81dc5ae7e2388dffccdcecf16d985b6d05ad449d.zip
(typespec): Made <SomeProtocol> equivalent to (id <SomeProtocol>).
(non_empty_protocolrefs): New nonterminal. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@11858 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/c-parse.in14
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/c-parse.in b/gcc/c-parse.in
index 41fb8aaf6ae..a5223cd25a1 100644
--- a/gcc/c-parse.in
+++ b/gcc/c-parse.in
@@ -224,7 +224,8 @@ ifobjc
%type <ttype> keywordexpr keywordarglist keywordarg
%type <ttype> myparms myparm optparmlist reservedwords objcselectorexpr
%type <ttype> selectorarg keywordnamelist keywordname objcencodeexpr
-%type <ttype> objc_string protocolrefs identifier_list objcprotocolexpr
+%type <ttype> objc_string non_empty_protocolrefs protocolrefs identifier_list objcprotocolexpr
+
%type <ttype> CLASSNAME OBJC_STRING OBJECTNAME
end ifobjc
@@ -1041,6 +1042,11 @@ ifobjc
{ $$ = get_static_reference ($1, $2); }
| OBJECTNAME protocolrefs
{ $$ = get_object_reference ($2); }
+
+/* Make "<SomeProtocol>" equivalent to "id <SomeProtocol>"
+ - nisse@lysator.liu.se */
+ | non_empty_protocolrefs
+ { $$ = get_object_reference ($1); }
end ifobjc
| TYPEOF '(' expr ')'
{ $$ = TREE_TYPE ($3); }
@@ -2440,7 +2446,11 @@ protocolrefs:
{
$$ = NULL_TREE;
}
- | ARITHCOMPARE identifier_list ARITHCOMPARE
+ | non_empty_protocolrefs
+ ;
+
+non_empty_protocolrefs:
+ ARITHCOMPARE identifier_list ARITHCOMPARE
{
if ($1 == LT_EXPR && $3 == GT_EXPR)
$$ = $2;
OpenPOWER on IntegriCloud