[antlr-interest] advice for grammar modification

Daniel Zuberbuehler dzubi at users.sourceforge.net
Thu Aug 11 12:21:30 PDT 2005


> > Thanks for your answer!
> > You're right, the readability is better in the variant with the boolean.
> > I'll take that in account for my future work.
>
> Readability is subjective, certainly, but it seems that the ANTLR-only
> version is clearer because it's using ANTLR to control flow, rather
> than requiring action blocks to do something that is built into the
> ANTLR language - something that you must already know if using
> ANTLR....
>
> But that's just me :-)

You have a good point! It was quite a bit work to convert the grammar from c 
to java (at least for one like me who knows no antlr nor c). That should 
teach me to keep the grammar as language independent as possible. Maybe the 
best alternative would be using only antlr constructs if possible, and if the 
readability is not that good, just write an explanation in a comment 

Daniel


More information about the antlr-interest mailing list