[antlr-interest] Re: Antlr v3 & Trees

John D. Mitchell johnm-antlr at non.net
Thu Apr 22 22:37:59 PDT 2004


>>>>> "Monty" == Monty Zukowski <monty at codetransform.com> writes:
[...]

> Well, my select statement is multiple optional things in a row:

>> selectStatement : queryExpression (computeClause)?  (forClause)?
>> (optionClause)?
>> ;

> And I'm arguing that it's ok in this case because the grammar is not
> ambiguous.  So is the rule "when you have multiple optional things in a
> row and it is ambiguous?"  Or are there other considerations too?

Do you do any non-local, manual tree exploration (such as find a particular
child of an ancestor) or manipulation?  Having to deal with optional stuff
sucks in those cases.

The rationale for this really does follow the Null Object pattern.


Another facet that I think people discount too much is the fact that they
have complete control over their trees.  So, why not create something that
is as clear, regular, powerful, etc. as you can?  Yes, I understand that
creating a really good initial tree in the parser can sometimes be very
difficult (given the wackiness needed in the parser to parse some
languages) but it's quite possible to do all we can do in a basic way in
the parser and then write a tree transform pass which cleans things up for
the later stages.

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