FAUST compiler  0.9.9.6b8
Functions
boxcomplexity.h File Reference
#include "boxes.hh"
Include dependency graph for boxcomplexity.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int boxComplexity (Tree box)
 Return the complexity propety of a box expression tree. More...
 

Function Documentation

int boxComplexity ( Tree  box)

Return the complexity propety of a box expression tree.

Return the complexity propety of a box expression tree. If no complexity property exist, it is created an computeBoxComplexity is called do to the job.

Parameters
boxan evaluated box expression tree
Returns
the complexity of box
See also
computeBoxComplexity

Definition at line 56 of file boxcomplexity.cpp.

References BCOMPLEXITY, computeBoxComplexity(), CTree::getProperty(), CTree::setProperty(), tree(), and tree2int().

Referenced by drawSchema(), and generateDiagramSchema().

57 {
58  Tree prop = box->getProperty(BCOMPLEXITY);
59 
60  if (prop) {
61  return tree2int(prop);
62 
63  } else {
64  int v = computeBoxComplexity(box);
65  box->setProperty(BCOMPLEXITY,tree(v));
66  return v;
67  }
68 }
static int computeBoxComplexity(Tree box)
Compute the complexity of a box expression.
int tree2int(Tree t)
if t has a node of type int, return it otherwise error
Definition: tree.cpp:230
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
Definition: tree.hh:109
Tree BCOMPLEXITY
property Key used to store box complexity
void setProperty(Tree key, Tree value)
Definition: tree.hh:167
Tree tree(const Node &n)
Definition: tree.hh:186
Tree getProperty(Tree key)
Definition: tree.hh:173

Here is the call graph for this function:

Here is the caller graph for this function: