#include "signals.hh"#include "sigtype.hh"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 |
add a new binding to a type environment
| var | the variable | |
| type | the type of the variable | |
| env | the type environment |
Definition at line 117 of file sigtyperules.cpp.
References cons(), and tree().
Referenced by infereRecType().
retrieve the type annotation of sig
| 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(), ScalarCompiler::generateFVar(), DocCompiler::generateHBargraph(), ScalarCompiler::generateHBargraph(), DocCompiler::generateNumber(), ScalarCompiler::generateNumber(), ScalarCompiler::generatePrefix(), DocCompiler::generateRec(), ScalarCompiler::generateRec(), ScalarCompiler::generateSelect2(), ScalarCompiler::generateSelect3(), 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 }
search for the type associated to a variable
| env | the type environment | |
| var | the variable to search |
Definition at line 130 of file sigtyperules.cpp.
References hd(), print(), tl(), and tree2ptr().
Referenced by propagate().
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 }
| void typeAnnotation | ( | Tree | sig | ) |
fully annotate every subtree of term with type information
| 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 }
| bool gVectorSwitch |
The empty type environment (also property key for closed term type).
Definition at line 106 of file sigtyperules.cpp.
1.6.3