Commit 0b1cdaf2 by Neil Booth Committed by Neil Booth

c-parse.in (methodtype): New production.

	* c-parse.in (methodtype): New production.
	(methoddef, methodproto): Collapse separate '-' and '+'
	handlers into 1.

From-SVN: r42133
parent 4c521bad
2001-05-16 Neil Booth <neil@daikokuya.demon.co.uk>
* c-parse.in (methodtype): New production.
(methoddef, methodproto): Collapse separate '-' and '+'
handlers into 1.
2001-05-16 Neil Booth <neil@cat.daikokuya.demon.co.uk> 2001-05-16 Neil Booth <neil@cat.daikokuya.demon.co.uk>
* c-common.h (RID_FIRST_PQ): New. * c-common.h (RID_FIRST_PQ): New.
......
...@@ -2947,44 +2947,27 @@ ivar_declarator: ...@@ -2947,44 +2947,27 @@ ivar_declarator:
} }
; ;
methoddef: methodtype:
'+' '+'
{ { objc_inherit_code = CLASS_METHOD_DECL; }
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 = INSTANCE_METHOD_DECL; }
;
methoddef:
methodtype
{ {
objc_pq_context = 1; objc_pq_context = 1;
if (objc_implementation_context) if (!objc_implementation_context)
objc_inherit_code = INSTANCE_METHOD_DECL;
else
fatal_error ("method definition not in class context"); fatal_error ("method definition not in class context");
} }
methoddecl methoddecl
{ {
objc_pq_context = 0; 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); start_method_def ($3);
objc_method_context = $3; objc_method_context = $3;
} }
...@@ -3021,31 +3004,19 @@ semi_or_error: ...@@ -3021,31 +3004,19 @@ semi_or_error:
; ;
methodproto: methodproto:
'+' methodtype
{ {
/* Remember protocol qualifiers in prototypes. */ /* Remember protocol qualifiers in prototypes. */
objc_pq_context = 1; objc_pq_context = 1;
objc_inherit_code = CLASS_METHOD_DECL;
} }
methoddecl methoddecl
{ {
/* Forget protocol qualifiers here. */ /* Forget protocol qualifiers here. */
objc_pq_context = 0; objc_pq_context = 0;
add_class_method (objc_interface_context, $3); if (objc_inherit_code == CLASS_METHOD_DECL)
} add_class_method (objc_interface_context, $3);
semi_or_error else
add_instance_method (objc_interface_context, $3);
| '-'
{
/* 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);
} }
semi_or_error semi_or_error
; ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment