开发者

visual description for data structure

开发者 https://www.devze.com 2022-12-24 02:16 出处:网络
i have a data structure for my compiler (such as ast) , and i need a method to print it (like ms visio) and verifyits contents (i need to verify the contents of the a开发者_JAVA技巧st nodes)

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消