4

Is there a tool that helps you visualise how a C expression is parsed. In other words can someone see the expression tree

shreyasva
  • 13,126
  • 25
  • 78
  • 101
  • Are you looking for a C expression parser *in C* or will any language do? – Matti Virkkunen Jul 29 '11 at 08:33
  • 1
    Any language would do, although a GUI showing the expression tree would be fantastic. – shreyasva Jul 29 '11 at 08:34
  • 1
    possible duplicate of [AST from C code](http://stackoverflow.com/questions/239722/ast-from-c-code) – Aaron Digulla Jul 29 '11 at 08:34
  • 2
    I doubt that this is a duplicate of [AST From C Code](http://stackoverflow.com/questions/239722/ast-from-c-code). This question explicitly asks about **visualization** (of the AST), the other does not. The OP might want to indicate this by adjusting the question's title. – Christian.K Aug 08 '11 at 08:11

2 Answers2

2

You can give ANTLR a try, it has a nice front-end(ANTLRWorks) for visualization and there is a c99 for it avialable from the same site.

It will probably take a little work to visual things as you want them, but all the tools are already there.

Necrolis
  • 25,836
  • 3
  • 63
  • 101
0

Take a look at ROSE. I have found that making it work was a bit cumbersome -- not the easiest piece of software to build from sources, and I doubt they have a binary release. There are a set of tools and library support for making pdf/graphviz dump of the AST. And then there's a tool called roseQt which you might find useful.

sajith
  • 59
  • 1
  • 4