sigtyperules.hh File Reference

#include "signals.hh"
#include "sigtype.hh"
Include dependency graph for sigtyperules.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

Tree addEnv (Tree var, Type tp, Tree env)
 add a new binding to a type environment
Type searchEnv (Tree env, Tree var)
 search for the type associated to a variable
Type getSigType (Tree term)
 retrieve the type annotation of sig
void typeAnnotation (Tree term)
 fully annotate every subtree of term with type information

Variables

Tree NULLENV
 The empty type environment (also property key for closed term type).
bool gVectorSwitch

Function Documentation

Tree addEnv ( Tree  var,
Type  tp,
Tree  env 
)

add a new binding to a type environment

Parameters:
var the variable
type the type of the variable
env the type environment
Returns:
a new environment : [(var,type):env]

Definition at line 117 of file sigtyperules.cpp.

References cons(), and tree().

Referenced by infereRecType().

00118 {
00119     Tree r = cons(cons(var,tree((AudioType*)tp)),env);
00120     return r;
00121 }

Here is the call graph for this function:

Here is the caller graph for this function:

Type getSigType ( Tree  sig  ) 

retrieve the type annotation of sig

Parameters:
sig the signal we want to know the type

Definition at line 82 of file sigtyperules.cpp.

References CTree::getType().

Referenced by DocCompiler::generateBinOp(), DocCompiler::generateCacheCode(), VectorCompiler::generateCacheCode(), ScalarCompiler::generateCacheCode(), DocCompiler::generateDelayVec(), ScalarCompiler::generateDelayVec(), DocCompiler::generateDocConstantTbl(), DocCompiler::generateDocWriteTbl(), DocCompiler::generateFConst(), ScalarCompiler::generateFConst(), DocCompiler::generateFVar(), DocCompiler::generateHBargraph(), ScalarCompiler::generateHBargraph(), DocCompiler::generateNumber(), ScalarCompiler::generateNumber(), ScalarCompiler::generatePrefix(), DocCompiler::generateRec(), ScalarCompiler::generateRec(), ScalarCompiler::generateStaticTable(), ScalarCompiler::generateTable(), DocCompiler::generateVariableStore(), VectorCompiler::generateVariableStore(), ScalarCompiler::generateVariableStore(), DocCompiler::generateVBargraph(), ScalarCompiler::generateVBargraph(), DocCompiler::generateXtended(), ScalarCompiler::generateXtended(), OccMarkup::incOcc(), VectorCompiler::needSeparateLoop(), ScalarCompiler::sharingAnnotation(), DocCompiler::sharingAnnotation(), and signal2klass().

00083 {
00084     AudioType* t = (AudioType*) sig->getType();
00085     if (t==0) {
00086         cerr << "ERROR in getSigType : no type information available for signal :" << *sig << endl;
00087         exit(1);
00088     }
00089     return t;   
00090 }

Here is the call graph for this function:

Here is the caller graph for this function:

Type searchEnv ( Tree  env,
Tree  var 
)

search for the type associated to a variable

Parameters:
env the type environment
var the variable to search
Returns:
the type associated to var in env

Definition at line 130 of file sigtyperules.cpp.

References hd(), print(), tl(), and tree2ptr().

Referenced by propagate(), and sigMapRename().

00131 {
00132     while ( (env != NULLENV) && (hd(hd(env)) != var) ) { env = tl(env); }
00133     if (env == NULLENV) {
00134         cerr << "Problem in searchEnv "; print(var, stderr);
00135         cerr << " was not found" << endl;
00136         assert(env != NULLENV); // we should have found the data
00137     }
00138 
00139     return Type((AudioType*)tree2ptr(tl(hd(env))));
00140 }

Here is the call graph for this function:

Here is the caller graph for this function:

void typeAnnotation ( Tree  sig  ) 

fully annotate every subtree of term with type information

Parameters:
sig the signal term tree to annotate

Definition at line 171 of file sigtyperules.cpp.

References getInferredType().

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

00172 {
00173     getInferredType(sig, NULLENV);
00174 }

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 136 of file main.cpp.

The empty type environment (also property key for closed term type).

Definition at line 106 of file sigtyperules.cpp.

Referenced by docTableConvertion().

Generated on Tue Aug 10 08:04:18 2010 for FAUST compiler by  doxygen 1.6.3