views:

14

answers:

1

i have a data structure for my compiler (such as ast) , and i need a method to print it (like ms visio) and verify its contents (i need to verify the contents of the ast nodes)

note : i dont want to print it to the console , i am using c++ & qt

thanks

+1  A: 

It sounds like you could use graphviz - www.graphviz.org. It's a software package that takes a graph (such as your AST, or probably any other interesting compiler data structure) and produces coordinates for each graph node so that you can draw the graph at that coordinate and it will look reasonably good.

You can use this to implement your own drawing routines (In Qt Canvas, I assume) or use graphviz's own programs.

Noah Lavine