[antlr-interest] C++ exceptions in the ANTLR3 C target

Richard Thrippleton richard.thrippleton at progress.com
Thu Jan 15 08:20:16 PST 2009


Now that the C target can be built by a C++ compiler, I've been trying 
to throw C++-style exceptions (as opposed to the exception system 
internal to ANTLR's C target) from within embedded actions.

My grammars build successfully, and the exceptions seem to behave as I'd 
expect at runtime. However, I suspect I'm leaving myself open to 
undefined behaviour; are C++ exceptions within the C output actually 
supported, or is it merely co-incidence that nothing horrendous has 
happened?

My main fear would be memory leaks, but I'm not 100% sure if this is 
happening or not.

Thanks,
Richard


More information about the antlr-interest mailing list