[antlr-interest] template generation for dumb rules
Gavin Lambert
antlr at mirality.co.nz
Tue Mar 25 12:26:20 PDT 2008
At 08:07 26/03/2008, Terence Parr wrote:
>Agreed...but what about
>
>d : id (',' id) ';' ;
>
>what should i produce here? In other words, when do I stop doing
>the default behavior and force you to say how it works? Do i
>even put in the literals into the result template? Maybe.
By default, probably yes, that's the most sensible thing to
do. If they don't want the literals in the output, then they can
specify the template they want instead.
In fact, by doing this you're basically saying that the default
output of a template-output ANTLR parser will be the same as its
input; and that will probably help the people who are trying to do
fairly minimal rewrites (and those doing more extensive rewrites
are probably outputting to AST anyway).
Then again, you should probably only take what I say with a grain
of salt, since I've mostly only done "toy" projects with ANTLR at
this point.
More information about the antlr-interest
mailing list