[antlr-interest] A postmortem of my use of antler

Darien Hager darien.hager at etelos-inc.com
Tue Mar 11 15:31:02 PDT 2008


On 3/11/08, Guntis Ozols <guntiso at latnet.lv> wrote:
>
> > >> how could ANTLR *possibly* know the structure of the AST to build
> > >> except for, perhaps, expressions? parse tree, yes. AST, no.
> > > How about have the AST just match the parse tree by default?
>
> > Because then you add one ^ or -> rewrite and what should it do?  Give
> > you a hybrid?  That just wouldn't be useful.  If you want a parse tree
> > use it.
>
> How about enabling ^ on the left side?
> ^rule : stuff;
> could be very nice shortcut for
> tokens {
>   RULE;
> }
>

Is the shortcut worth it? Clarity is arguably more important than brevity
when it comes to grammars.

It might make more sense to deal with this on a "tools" level.  E.g. a
right-click option in ANTLRWorks to "generate rewrite rule for block" which
would default to an AST resembling the parse tree.

-- 
Darien Hager
Developer
Etelos, Inc.
darien at etelos.com

http://www.etelos.com
"Revolutionizing the way applications are developed, distributed and
consumed."

This e-mail message, including attachments, may contain confidential
information for the sole use of the intended recipient(s). If you are not
the intended recipient, then this is notice that any use, disclosure,
dissemination, distribution or copying is strictly prohibited. If you have
received this message in error please contact the sender by reply mail and
destroy all copies of the original message.

This e-mail message, including attachments, may contain confidential information 
for the sole use of the intended recipient(s). If you are not the intended recipient,
then this is notice that any use, disclosure, dissemination, distribution or copying is 
strictly prohibited.  If you have received this message in error please contact the 
sender by reply mail and destroy all copies of the original message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080311/d5bf8ad4/attachment.html 


More information about the antlr-interest mailing list