Visualizing an AST created with ANTLR (in a .Net environment)

Posted by Benjamin Podszun on Stack Overflow See other posts from Stack Overflow or by Benjamin Podszun
Published on 2010-05-18T11:08:36Z Indexed on 2010/05/18 11:10 UTC
Read the original article Hit count: 406

Filed under:
|
|

Hi there.

For a pet project I started to fiddle with ANTLR. After following some tutorials I'm now trying to create the grammar for my very own language and to generate an AST.

For now I'm messing around in ANTLRWorks mostly, but now that I have validated that the parse tree seems to be fine I'd like to (iteratively, because I'm still learning and still need to make some decisions regarding the final structure of the tree) create the AST. It seems that antlrworks won't visualize it (or at least not using the "Interpreter" feature, Debug's not working on any of my machines).

Bottom line: Is the only way to visualize the AST the manual way, traversing/showing it or printing the tree in string representation to a console?

What I'm looking for is a simple way to go from input, grammar -> visual AST representation a la the "Interpreter" feature of ANTLRWorks. Any ideas?

© Stack Overflow or respective owner

Related posts about antlr

Related posts about c#