[antlr-interest] postmortem
Johannes Luber
jaluber at gmx.de
Wed Mar 12 11:36:22 PDT 2008
Jim Idle schrieb:
>
>> -----Original Message-----
>> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
>> bounces at antlr.org] On Behalf Of Andy Tripp
>> Sent: Wednesday, March 12, 2008 9:50 AM
>> To: antlr-interest
>>
>> * The original poster, having invested a few minutes to vent the
>> frustrations of himself
>> and certainly at least a few others who didn't bother, goes on his
>> merry way. No
>> ANTLR documentation has changed.
>
>> No warning message from ANTLR
>> saying
>> "you don't have any ^ characters in your grammar, so you'll get a
>> flat AST, see the
>> section on building ASTs in the book".
>
> And just how is the tool supposed to know that that isn't what you want?
> Deus Ex Machina? :-) I see a lot of suggestions for warnings and errors
> and so on that surely seem reasonable to the requester, but in fact are
> specific to their particular situation. If you start spitting out
warnings
> saying "You don't have any ^ characters", all you are going to do is
> annoy those who know about that, and confuse those that don't. Further,
> other than giving a link to a precise article on tree construction, there
> isn't much information you can give out in a line or two of warnings.
> Further still, at what point does this warning go away? When there
are two
> ^ characters? 7? One on every production? Perhaps you were trying to
> illustrate a point, but the example isn't a good one.
>
Theoretically one could introduce options to suppress certain warnings
entirely. I suppose that one could categorize the warnings and say "I'm
not trying to do A, so warnings for not doing A are senseless to me.".
Noting down an explicit opt-out would be also self-documenting. On the
other side, it would result in having to think a bit about the actual
goals, but that's not a bad thing. But I don't know enough about ANTLR
and languages to tell if my idea is actually feasible.
Johannes
More information about the antlr-interest
mailing list