[antlr-interest] Ad hoc simplisticity (was: Translators Should Use Tree Grammars)

John D. Mitchell johnm-antlr at non.net
Mon Nov 22 09:42:10 PST 2004


>>>>> "atripp54321" == atripp54321  <atripp at comcast.net> writes:
>>>>>> <johnm-antlr at n...> wrote:
>>>>>>> "atripp54321" == atripp54321 <atripp at c...> writes:
[...]

>>> Yea, I suppose a treewalker is fine when the output is so very close to
>>> just a printing of the inorder traversal of the AST.  But I'm still not
>>> convinced that a treewalker is the best for very complex AST-to-AST
>>> transformations.

>> I'm confused.  Are you talking about source output or tree manipulations
>> (or both)?

> I'm saying that a treewalker may be ok for source output, but I still
> don't think it's good for tree manipulations.

Okay, well, sigh... Since you haven't done your homework and don't seem to
understand tree grammars and don't seem to be acknowledging that need, this
will be my last post in this thread.

>> For emitting source, a tree walker which builds up attributes on the way
>> down and emits (using e.g., StringTemplates) when coming back up is
>> pretty slick.

> Isn't the only thing it needs to "build up" the level if indentation?

Hmm... Aren't you the one who was complaining about the need to be able to
emit things in whatever order you want?  Geez.


If I may be so bold, it seems rather clear to me that you're suffering from
the all too common malady of confusing simplistic for simple (and
simplicity for simplisticity).  Ad hoc approaches are often justified based
upon their local, so-called "simplicity" but, alas, that's just another
garden path.  I.e., it's not just that you can't see the forest for the
trees but that you're missing the trees by looking only at some bark.

Take care,
	John


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 





More information about the antlr-interest mailing list