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

Go to the source code of this file.

Functions

void recursivnessAnnotation (Tree sig)
 Annotate a signal with recursivness. More...
 
int getRecursivness (Tree t)
 Return the recursivness of a previously annotated signal. More...
 
Tree symlist (Tree sig)
 

Function Documentation

int getRecursivness ( Tree  sig)

Return the recursivness of a previously annotated signal.

An error is generated if the signal has no recursivness property

Parameters
sigsignal
Returns
recursivness of the signal

Definition at line 72 of file recursivness.cpp.

References getProperty(), RECURSIVNESS, and tree2int().

Referenced by OccMarkup::incOcc().

73 {
74  Tree tr;
75  if ( ! getProperty(sig, RECURSIVNESS, tr)) {
76  cerr << "Error in getRecursivness of " << *sig << endl;
77  exit(1);
78  }
79  return tree2int(tr);
80 }
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 RECURSIVNESS
bool getProperty(Tree t, Tree key, Tree &val)
Definition: list.cpp:423

Here is the call graph for this function:

Here is the caller graph for this function:

void recursivnessAnnotation ( Tree  sig)

Annotate a signal with recursivness.

Should be used before calling getRecursivness

Parameters
sigsignal to annotate

Definition at line 59 of file recursivness.cpp.

References annotate(), and nil.

Referenced by DocCompiler::annotate(), ScalarCompiler::prepare(), and ScalarCompiler::prepare2().

60 {
61  annotate(nil, sig);
62 }
static int annotate(Tree env, Tree sig)
Annotate a signal with recursivness.
Tree nil
Definition: list.cpp:116

Here is the call graph for this function:

Here is the caller graph for this function:

Tree symlist ( Tree  sig)

Definition at line 174 of file recursivness.cpp.

References property< Tree >::get(), property< Tree >::set(), SymListProp, and symlistVisit().

Referenced by Klass::closeLoop(), and typeAnnotation().

175 {
176  Tree S;
177  if (!SymListProp.get(sig, S)) {
178  set<Tree> visited;
179  S = symlistVisit(sig, visited);
180  SymListProp.set(sig, S);
181  }
182  //cerr << "SYMLIST " << *S << " OF " << ppsig(sig) << endl;
183  return S;
184 }
Tree symlistVisit(Tree sig, set< Tree > &visited)
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
Definition: tree.hh:109
bool get(Tree t, Tree &data)
Definition: property.hh:67
property< Tree > SymListProp
return the set of recursive symbols appearing in a signal.
void set(Tree t, Tree data)
Definition: property.hh:62

Here is the call graph for this function:

Here is the caller graph for this function: