[antlr-interest] customize the AST

Mr Torsten Curdt tcurdt at yahoo.com
Fri Jun 18 08:11:07 PDT 2004


I have the following rule and want to create
a customized AST

instruction!
  : k:LITERAL COLON! v:(LITERAL|QLITERAL) NEWLINE!
  | kk:LITERAL COLON! k1:(LITERAL|QLITERAL) ASSIGN!
v1:(LITERAL|QLITERAL) (SEMICOLON!
k2:(LITERAL|QLITERAL) (ASSIGN!
v2:(LITERAL|QLITERAL))?)* NEWLINE!  
  ;

The first match should become

  instruction --> k --> v

And the second match

  instruction --> kk --> k1 -> v1
                     --> k2 -> v2
                     ...

I had a look into http://www.antlr.org/doc/trees.html
but still don't understand how to do it.

Any help appreciated!

cheers
--
Torsten


		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 


 
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