From: neil Date: Wed, 16 May 2001 06:34:34 +0000 (+0000) Subject: * c-parse.in (methodtype): New production. X-Git-Tag: upstream/4.9.2~94423 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a1f4c3f0721504499a74e44daa2b55d17d8d673d;p=platform%2Fupstream%2Flinaro-gcc.git * c-parse.in (methodtype): New production. (methoddef, methodproto): Collapse separate '-' and '+' handlers into 1. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42133 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b44b60a..7056109 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2001-05-16 Neil Booth + + * c-parse.in (methodtype): New production. + (methoddef, methodproto): Collapse separate '-' and '+' + handlers into 1. + 2001-05-16 Neil Booth * c-common.h (RID_FIRST_PQ): New. diff --git a/gcc/c-parse.in b/gcc/c-parse.in index cee2637..3eda45c 100644 --- a/gcc/c-parse.in +++ b/gcc/c-parse.in @@ -2947,44 +2947,27 @@ ivar_declarator: } ; -methoddef: +methodtype: '+' - { - objc_pq_context = 1; - if (objc_implementation_context) - objc_inherit_code = CLASS_METHOD_DECL; - else - fatal_error ("method definition not in class context"); - } - methoddecl - { - objc_pq_context = 0; - add_class_method (objc_implementation_context, $3); - start_method_def ($3); - objc_method_context = $3; - } - optarglist - { - continue_method_def (); - } - compstmt_or_error - { - finish_method_def (); - objc_method_context = NULL_TREE; - } - + { objc_inherit_code = CLASS_METHOD_DECL; } | '-' + { objc_inherit_code = INSTANCE_METHOD_DECL; } + ; + +methoddef: + methodtype { objc_pq_context = 1; - if (objc_implementation_context) - objc_inherit_code = INSTANCE_METHOD_DECL; - else + if (!objc_implementation_context) fatal_error ("method definition not in class context"); } methoddecl { objc_pq_context = 0; - add_instance_method (objc_implementation_context, $3); + if (objc_inherit_code == CLASS_METHOD_DECL) + add_class_method (objc_implementation_context, $3); + else + add_instance_method (objc_implementation_context, $3); start_method_def ($3); objc_method_context = $3; } @@ -3021,31 +3004,19 @@ semi_or_error: ; methodproto: - '+' + methodtype { /* Remember protocol qualifiers in prototypes. */ objc_pq_context = 1; - objc_inherit_code = CLASS_METHOD_DECL; } methoddecl { /* Forget protocol qualifiers here. */ objc_pq_context = 0; - add_class_method (objc_interface_context, $3); - } - semi_or_error - - | '-' - { - /* Remember protocol qualifiers in prototypes. */ - objc_pq_context = 1; - objc_inherit_code = INSTANCE_METHOD_DECL; - } - methoddecl - { - /* Forget protocol qualifiers here. */ - objc_pq_context = 0; - add_instance_method (objc_interface_context, $3); + if (objc_inherit_code == CLASS_METHOD_DECL) + add_class_method (objc_interface_context, $3); + else + add_instance_method (objc_interface_context, $3); } semi_or_error ;