visual description for data structure
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 a开发者_JAVA技巧st nodes)
note : i dont want to print it to the console , i am using c++ & qt
thanks
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.
精彩评论