This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [objc-improvements-branch]: FYI: Yet another round of ObjC++ work committed


Hey David,

Thanks for your patch. I'm currently fixing ObjC++ on i686-pc-linux-gnu, and after that I'll take a look at what you have.

But my next patch will remove the keyword and replace the:
OBJECTNAME protocolrefs
with
TYPENAME protocolrefs
and therefor I will reintroduce some of the removed diagnostics about type mismatch when applicable. Do you see a problem with that approach?

No, I don't; this is the right thing to do. In general, the ObjC grammar should see 'TYPENAME protocolrefs' wherever the corresponding C grammar sees just 'TYPENAME' (perhaps you can invent a new nonterminal for this purpose), e.g.,


type_name:
%ifc
	TYPENAME
%end_ifc
%ifobjc
	TYPENAME protocolrefs
		{
			if (objc_is_id($1) || objc_is_class_name (TYPE_NAME($1))
			  $$ == objc_get_protocol_qualified_type ($1, $2);
			else if ($2)
			  error ("protocol qualifiers specified for non-ObjC type");
		}
%end_ifobjc
	;

Something along those lines, analogously to what I did in cp/parser.c; you get the idea. :-)

--Zem


--------------------------------------------------------------
Ziemowit Laski                 1 Infinite Loop, MS 301-2K
Mac OS X Compiler Group        Cupertino, CA USA  95014-2083
Apple Computer, Inc.           +1.408.974.6229  Fax .5477


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]