[antlr-interest] Handling 'finally' in language target that doesn't have 'finally'

Sohail Somani sohail at worklogassistant.com
Mon Jan 19 11:50:54 PST 2009


Rick Mann wrote:
> In a language like C++, which stupidly doesn't support "finally",  
> what's the right way to write a grammar? To just not use "finally" in  
> it, and use init & after? Is there a way to signal to ANTLR (from the  
> back-end implementation) that finally should not be allowed?

I'm pretty sure you've got it backwards. Languages that /require/
finally are stupid.

For everything else, there's ScopeGuard/RAII.

-- 
Sohail Somani
Hassle-free time tracking for JIRA

Website: http://worklogassistant.com
Blog   : http://blog.worklogassistant.com
Twitter: http://twitter.com/somanisoftware



More information about the antlr-interest mailing list