[antlr-interest] AST construction from rule
Anakreon
anakreonmejdi at yahoo.gr
Mon Sep 27 09:29:34 PDT 2004
I have a problem with the AST constructed from a rule in my TreeParser.
The rule returns a list of AST nodes.
The rule without action code is:
rule
:
rule1
| rule 2
|!#(DIM (decl:s_decl )+)
......
each decl is added to a List and in the end the result of the rule is
created from the elements of that list.
This is the code of AST generations:
## = makeFromList(dimArrays, null);
makeFromList is a method i have implemented
and if I call ##.toStringList for input:
dim a(12), b()
I get
( EXPR ( = a array ) ) ( EXPR ( = b array ) )
which is fine.
The problem is that from the 2 nodes, only the first one is kept.
Any idea how to fix this?
Anakreon
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