|
FAUST compiler
0.9.9.6b8
|
#include <stdio.h>#include <iostream>#include <sstream>#include <vector>#include <math.h>#include "doc_compile.hh"#include "sigtype.hh"#include "floats.hh"#include "sigprint.hh"#include "sigtyperules.hh"#include "recursivness.hh"#include "simplify.hh"#include "privatise.hh"#include "prim2.hh"#include "xtended.hh"#include "compatibility.hh"#include "ppsig.hh"#include "names.hh"#include "doc.hh"#include "tlib.hh"#include "doc_notice.hh"
Go to the source code of this file.
Functions | |
| bool | getSigListNickName (Tree t, Tree &id) |
| static bool | associative (int opcode) |
| Generate binary operations, managing priority parenthesis. | |
| static bool | isVerySimpleFormula (Tree sig) |
| Test if exp is very simple that is it can't be considered a real component. | |
| static bool | isSeparator (char c) |
| tests if a charactere is a word separator | |
| static string | replaceTimeBy (const string &src, char r) |
| Replaces the occurences of 't' in a formula with another character. | |
Variables | |
| bool | gLessTempSwitch |
| int | gMaxCopyDelay |
| map< string, string > | gDocMathStringMap |
| static const unsigned int | MAX_RIGHT_MEMBER = 20 |
| static const unsigned int | MAX_SUB_EXPR = 10 |
| static bool associative | ( | int | opcode | ) | [static] |
Generate binary operations, managing priority parenthesis.
((a*b)+c) can be written (a*b+c) if priority(*) > priority(+) ((a*b)*c) can be writteb (a*b*c) if * is associative Associative operation should have a distinc priority from other operations. Non associative operations can share the same priority.
| sig | The signal expression to treat. |
| opcode | The operation code, as described in gBinOpLateqTable. |
| arg1 | The first operand. |
| arg2 | The second operand. |
| priority | The priority of the environment of the expression. |
associative operations are + * | & xor
Definition at line 401 of file doc_compile.cpp.
References kAdd, kAND, kMul, kOR, and kXOR.
Referenced by DocCompiler::generateBinOp().
{
return (opcode == kAdd) || (opcode == kMul) || (opcode == kAND) || (opcode == kOR) || (opcode == kXOR);
}

| bool getSigListNickName | ( | Tree | t, |
| Tree & | id | ||
| ) |
| static bool isSeparator | ( | char | c | ) | [static] |
tests if a charactere is a word separator
Definition at line 788 of file doc_compile.cpp.
Referenced by replaceTimeBy().
{
bool w = ( ((c >= 'a') && (c <='z'))
|| ((c >= 'A') && (c <='Z'))
|| ((c >= '0') && (c <='9'))
);
return ! w;
}

| static bool isVerySimpleFormula | ( | Tree | sig | ) | [static] |
Test if exp is very simple that is it can't be considered a real component.
| exp | the signal we want to test |
Definition at line 511 of file doc_compile.cpp.
References isSigButton(), isSigCheckbox(), isSigFConst(), isSigHSlider(), isSigInput(), isSigInt(), isSigNumEntry(), isSigReal(), isSigVSlider(), and name().
Referenced by DocCompiler::generateCacheCode().
{
int i;
double r;
Tree type, name, file, label, c, x, y, z;
return isSigInt(sig, &i)
|| isSigReal(sig, &r)
|| isSigInput(sig, &i)
|| isSigFConst(sig, type, name, file)
|| isSigButton(sig, label)
|| isSigCheckbox(sig, label)
|| isSigVSlider(sig, label,c,x,y,z)
|| isSigHSlider(sig, label,c,x,y,z)
|| isSigNumEntry(sig, label,c,x,y,z)
;
}


| static string replaceTimeBy | ( | const string & | src, |
| char | r | ||
| ) | [static] |
Replaces the occurences of 't' in a formula with another character.
Definition at line 802 of file doc_compile.cpp.
References isSeparator().
Referenced by DocCompiler::generateDocWriteTbl().
{
string dst;
char pre = 0;
for (size_t i=0; i < src.size(); i++)
{
char x = src[i];
if ((x=='t') && isSeparator(pre) && ((i == src.size()-1) || isSeparator(src[i+1]))) {
dst.push_back(r);
} else {
dst.push_back(x);
}
pre = x;
}
return dst;
}


| map<string, string> gDocMathStringMap |
| bool gLessTempSwitch |
Definition at line 129 of file main.cpp.
Referenced by process_cmdline().
| int gMaxCopyDelay |
Definition at line 130 of file main.cpp.
Referenced by SchedulerCompiler::dlineLoop(), VectorCompiler::dlineLoop(), VectorCompiler::generateCacheCode(), ScalarCompiler::generateDelayLine(), ScalarCompiler::generateDelayVecNoTemp(), VectorCompiler::generateFixDelay(), ScalarCompiler::generateFixDelay(), and process_cmdline().
const unsigned int MAX_RIGHT_MEMBER = 20 [static] |
Definition at line 62 of file doc_compile.cpp.
const unsigned int MAX_SUB_EXPR = 10 [static] |
Definition at line 63 of file doc_compile.cpp.
1.8.0