[antlr-interest] action syntax proposal for v3

Martin Probst mail at martin-probst.com
Sun Nov 6 03:38:52 PST 2005


Hi,

> I think adding some conditional generation would be nice too.
> Something like:
> 
> @define(niceexceptions)
> @if(niceexceptions) {
>     @rule.exception { }
> }

Do I smell the C pre-processor and his macros-of-doom? I would be very 
careful to enable a macro-ish language aspect.

I would vote to rather provide specific options like this as runtime 
flags, e.g. "Parser.setContinueAfterErrors(true)". You really don't need 
a full blown macro compile-time language to provide such a small feature.

> It would also give the grammars a slight aspect-oriented touch.

Everytime I ask someone for an example for the use of Aspect Oriented 
Programming the only thing they can come up with is logging...

Martin


More information about the antlr-interest mailing list