Radi
Radi

Reputation: 6584

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 ast nodes)

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

thanks

Upvotes: 0

Views: 202

Answers (1)

Noah Lavine
Noah Lavine

Reputation: 793

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.

Upvotes: 1

Related Questions