tipc
A TIP to LLVM compiler
|
Constructs a dot graph that can be used to visualize the AST. More...
#include <ASTVisualizer.h>
Public Member Functions | |
ASTVisualizer () | |
ASTVisualizer (std::ostream &os) | |
void | buildGraph (SyntaxTree &tree) |
Construct a dot syntax compliant graph of the AST. More... | |
Constructs a dot graph that can be used to visualize the AST.
The visualizer traverses the AST in a pre-order fashion, connecting, with edges, children to parents. The output adheres to the dot syntax and can be converted to a format suitable for visualization.
For example, if you run the visualizer and write its output to a file called foo.gv, you can build a png from it using the dot command line interface.
|
inline |
|
inline |
void ASTVisualizer::buildGraph | ( | SyntaxTree & | tree | ) |
Construct a dot syntax compliant graph of the AST.
tree | The root of the AST. |