Hi,
on trying to implement control flow , in an AST walker grammar
following this example :
http://www.antlr.org/wiki/display/CS652/Tree-based+interpreters

ifstat
    :   ^('if' c=expr s=. e=.?) // ^('if' expr stat stat?)


in the C target the problem is that in the generated code , variables e,s
are not defined! (yet they are assigned values )
and the compiler complains about that , when i do define them by hand (under
the definition of variable c  )
the code compiles fine
so is this really a bug or i'm misusing ? any applicable workarounds ?
----
i have another question regarding control flow in c target
to get the index of say c in above example i write
c.tree->getToken(c)->index ,, right ? i can then SEEK to thins index , and i
can save
it in a symbol table , and it will be valid across different tree walks
(walk filling symbol table and
the walk that really interprets code )  ,, right ?

Thanks,
Mohamed Yousef

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

Reply via email to