This isn't really isn't the list for the topic of whether or not C++ should/shouldn't support ___. I'm saying this primarily because it's a grinding point for various people and sure to lead to harsh feelings (expressed in replies or not). For the sake of creating an ANTLR target (I think that's the real goal?), you have a few options. If you simply want to disallow finally code in the grammar when the C++ target is used, make the template for finally code spit out the following if the finally code is not blank.
#error The C++ target does not support 'finally' blocks in grammars. Use RAII instead. Sam -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Rick Mann Sent: Monday, January 19, 2009 2:13 PM To: Sohail Somani Cc: [email protected] Subject: Re: [antlr-interest] Handling 'finally' in language target thatdoesn't have 'finally' On Jan 19, 2009, at 11:50:54, Sohail Somani wrote: > I'm pretty sure you've got it backwards. Languages that /require/ > finally are stupid. > > For everything else, there's ScopeGuard/RAII. I'm not suggesting that C++ should drop support for RAII. I'm saying it's stupid that it doesn't also support finally. C++ is about making it easier to write complex code. It can be argued that it's syntactic sugar (as is any language). Not supporting finally means often times forcing the user to write more code, not less, to accomplish a thing. I also love Java, and wish it supported RAII (but not at the expense of finally). There's no reason not to have both. -- Rick List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~---
