[antlr-interest] Changing AST order in a complex rule

Ney, Richard richard.ney at aspect.com
Wed Mar 12 15:10:08 PST 2003


I have a simple SQL grammar that has the top rule of:

 

select_statement 

      :     (select_clause table_reference_list (whereClause)?
(group_clause)? (order_clause)?)

      ;

 

Now this creates a basic AST with the elements as the root nodes. Now I want
to change the order of the AST so me tree parser hits the
table_reference_list as its first element. How would I change this rule to
make the AST outcome?

 

-Richard

 

----------------------------------------------------------------------------
------------------------

Richard Ney                                                    Aspect
Communications

Principal Software Engineer

< <http://www.aspect.com/> http://www.aspect.com>
Main:  408.325.2200

< <mailto:richard.ney at aspect.com> mailto:richard.ney at aspect.com>
SJ Office: 408.325.2464

 
Home Office: 916.797.9602

----------------------------------------------------------------------------
------------------------

 

The Three Laws of Infernal Dynamics:
1. An object in motion will always be headed in the wrong direction.
2. An object at rest will always be in the wrong place.
3. The energy required to change either of these states will always be more
than you wish to expend, but never so much as to make the task appear
prospectively impossible.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20030312/eb598d67/attachment.html


More information about the antlr-interest mailing list