[antlr-interest] Print the actual code after building AST.
atripp at comcast.net
Thu Mar 31 20:35:07 PST 2005
>I have built a tree parser for a sample code.Thanks for your suggestions Bryan ,I have corrected the mistakes.I want to print the code after adding actions to it.
>As shown in my parser class ,I am indenting the 'map statements' .Now I want to print the resultant code.
>How do i do it?I saw the java.g ...but it does not print the whole inputstream after parsing.
Under the "file sharing" section on antlr.org, see the JavaEmitter by
Terence for a treewalker that pretty-prints a Java AST.
Of, if you prefer, see my JavaEmitter which does the same thing, but
walks the tree "by hand", rather than
using an ANTLR-generated treewalker.
More information about the antlr-interest