FAUST compiler  0.9.9.6b8
Functions
sigToGraph.hh File Reference
#include "signals.hh"
#include <string>
#include <iostream>
#include <fstream>
Include dependency graph for sigToGraph.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void sigToGraph (Tree sig, ofstream &fout)
 Draw a list of signals L as a directed graph using graphviz's dot language. More...
 

Function Documentation

void sigToGraph ( Tree  L,
ofstream &  fout 
)

Draw a list of signals L as a directed graph using graphviz's dot language.

Draw a list of signals L as a directed graph using graphviz's dot language.

Definition at line 50 of file sigToGraph.cpp.

References edgeattr(), getCertifiedSigType(), hd(), isList(), recdraw(), and tl().

Referenced by ScalarCompiler::prepare().

51 {
52  set<Tree> alreadyDrawn;
53 
54  fout << "strict digraph loopgraph {\n"
55  << " rankdir=LR; node [fontsize=10];"
56  << endl;
57  int out = 0;
58  while (isList(L)) {
59  recdraw(hd(L), alreadyDrawn, fout);
60 
61  fout << "OUTPUT_" << out << "[color=\"red2\" style=\"filled\" fillcolor=\"pink\"];" << endl;
62  fout << 'S' << hd(L) << " -> " << "OUTPUT_" << out++ << "[" << edgeattr(getCertifiedSigType(hd(L))) << "];" << endl;
63  L = tl(L);
64  }
65 
66  fout << "}" << endl;
67 }
Tree hd(Tree l)
Definition: list.hh:133
static string edgeattr(Type t)
Convert a signal type into edge attributes.
Definition: sigToGraph.cpp:131
static void recdraw(Tree sig, set< Tree > &drawn, ofstream &fout)
Draw recursively a signal.
Definition: sigToGraph.cpp:76
bool isList(Tree l)
Definition: list.hh:138
Type getCertifiedSigType(Tree sig)
Retrieve the type of sig and check it exists.
Tree tl(Tree l)
Definition: list.hh:134

Here is the call graph for this function:

Here is the caller graph for this function: