views:

291

answers:

1

hi , i have a compiler project and i want to print the ast after the compile complete

so can i print this ast to qt (on c++) panel using graphviz ?

note : i dont know if there is a binding between qt or c++ and graphviz , so if it doesnt work please help me to find the alternative .

thanks .

+1  A: 

i did this once. gcc has a flag to generate a .dot file of the AST. this file can then be displayed by graphviz. but be warned the AST is huge and is of limited use for all but the smallest functions.

see:

http://digitocero.com/en/blog/exporting-and-visualizing-gccs-abstract-syntax-tree-ast

grapho