FAUST compiler  0.9.9.6b8
Functions | Variables
ppbox.cpp File Reference
#include "list.hh"
#include "boxes.hh"
#include "ppbox.hh"
#include "signals.hh"
#include "prim2.hh"
#include "xtended.hh"
#include "Text.hh"
Include dependency graph for ppbox.cpp:

Go to the source code of this file.

Functions

const char * prim0name (CTree *(*ptr)())
 
const char * prim1name (CTree *(*ptr)(CTree *))
 
const char * prim2name (CTree *(*ptr)(CTree *, CTree *))
 
const char * prim3name (CTree *(*ptr)(CTree *, CTree *, CTree *))
 
const char * prim4name (CTree *(*ptr)(CTree *, CTree *, CTree *, CTree *))
 
const char * prim5name (CTree *(*ptr)(CTree *, CTree *, CTree *, CTree *, CTree *))
 
static void streambinop (ostream &fout, Tree t1, const char *op, Tree t2, int curPriority, int upPriority)
 
static void printRule (ostream &fout, Tree rule)
 
static string tree2quotedstr (Tree t)
 
static string type2str (int type)
 

Variables

int gFloatSize
 

Function Documentation

const char* prim0name ( CTree *(*)()  ptr)

Definition at line 34 of file ppbox.cpp.

Referenced by generateInsideSchema(), and boxpp::print().

35 {
36  return "prim0???";
37 }

Here is the caller graph for this function:

const char* prim1name ( CTree *(*)(CTree *)  ptr)

Definition at line 39 of file ppbox.cpp.

References sigDelay1(), sigFloatCast(), and sigIntCast().

Referenced by generateInsideSchema(), and boxpp::print().

40 {
41  if (ptr == sigDelay1) return "mem";
42  if (ptr == sigIntCast) return "int";
43  if (ptr == sigFloatCast) return "float";
44  return "prim1???";
45 }
Tree sigIntCast(Tree t)
Definition: signals.cpp:159
Tree sigFloatCast(Tree t)
Definition: signals.cpp:170
Tree sigDelay1(Tree t0)
Definition: signals.cpp:57

Here is the call graph for this function:

Here is the caller graph for this function:

const char* prim2name ( CTree *(*)(CTree *, CTree *)  ptr)

Definition at line 47 of file ppbox.cpp.

References sigAdd(), sigAND(), sigAttach(), sigDiv(), sigEQ(), sigFixDelay(), sigGE(), sigGT(), sigLE(), sigLeftShift(), sigLT(), sigMul(), sigNE(), sigOR(), sigPrefix(), sigRem(), sigRightShift(), sigSub(), and sigXOR().

Referenced by generateInsideSchema(), and boxpp::print().

48 {
49  if (ptr == sigAdd) return "+";
50  if (ptr == sigSub) return "-";
51  if (ptr == sigMul) return "*";
52  if (ptr == sigDiv) return "/";
53  if (ptr == sigRem) return "%";
54 
55  if (ptr == sigAND) return "&";
56  if (ptr == sigOR ) return "|";
57  if (ptr == sigXOR) return "^";
58 
59  if (ptr == sigLeftShift ) return "<<";
60  if (ptr == sigRightShift) return ">>";
61 
62  if (ptr == sigLT) return "<";
63  if (ptr == sigLE) return "<=";
64  if (ptr == sigGT) return ">";
65  if (ptr == sigGE) return ">=";
66  if (ptr == sigEQ) return "==";
67  if (ptr == sigNE) return "!=";
68 
69  if (ptr == sigFixDelay) return "@";
70  if (ptr == sigPrefix) return "prefix";
71  if (ptr == sigAttach) return "attach";
72 
73  return "prim2???";
74 }
Tree sigAND(Tree x, Tree y)
Definition: signals.hh:158
Tree sigEQ(Tree x, Tree y)
Definition: signals.hh:169
Tree sigXOR(Tree x, Tree y)
Definition: signals.hh:160
Tree sigGT(Tree x, Tree y)
Definition: signals.hh:165
Tree sigGE(Tree x, Tree y)
Definition: signals.hh:167
Tree sigPrefix(Tree t0, Tree t1)
Definition: signals.cpp:65
Tree sigSub(Tree x, Tree y)
Definition: signals.hh:153
Tree sigLeftShift(Tree x, Tree y)
Definition: signals.hh:162
Tree sigRightShift(Tree x, Tree y)
Definition: signals.hh:163
Tree sigNE(Tree x, Tree y)
Definition: signals.hh:170
Tree sigAdd(Tree x, Tree y)
Definition: signals.hh:152
Tree sigAttach(Tree t0, Tree t1)
Definition: signals.cpp:290
Tree sigLE(Tree x, Tree y)
Definition: signals.hh:168
Tree sigFixDelay(Tree t0, Tree t1)
Definition: signals.cpp:61
Tree sigLT(Tree x, Tree y)
Definition: signals.hh:166
Tree sigRem(Tree x, Tree y)
Definition: signals.hh:156
Tree sigMul(Tree x, Tree y)
Definition: signals.hh:154
Tree sigOR(Tree x, Tree y)
Definition: signals.hh:159
Tree sigDiv(Tree x, Tree y)
Definition: signals.hh:155

Here is the call graph for this function:

Here is the caller graph for this function:

const char* prim3name ( CTree *(*)(CTree *, CTree *, CTree *)  ptr)

Definition at line 76 of file ppbox.cpp.

References sigReadOnlyTable(), and sigSelect2().

Referenced by generateInsideSchema(), and boxpp::print().

77 {
78  if (ptr == sigReadOnlyTable) return "rdtable";
79  if (ptr == sigSelect2) return "select2";
80  return "prim3???";
81 }
Tree sigSelect2(Tree selector, Tree s1, Tree s2)
Definition: signals.cpp:115
Tree sigReadOnlyTable(Tree n, Tree init, Tree ridx)
Definition: signals.hh:104

Here is the call graph for this function:

Here is the caller graph for this function:

const char* prim4name ( CTree *(*)(CTree *, CTree *, CTree *, CTree *)  ptr)

Definition at line 83 of file ppbox.cpp.

References sigSelect3().

Referenced by generateInsideSchema(), and boxpp::print().

84 {
85  if (ptr == sigSelect3) return "select3";
86  return "prim4???";
87 }
Tree sigSelect3(Tree selector, Tree s1, Tree s2, Tree s3)
Definition: signals.cpp:118

Here is the call graph for this function:

Here is the caller graph for this function:

const char* prim5name ( CTree *(*)(CTree *, CTree *, CTree *, CTree *, CTree *)  ptr)

Definition at line 89 of file ppbox.cpp.

References sigWriteReadTable().

Referenced by generateInsideSchema(), and boxpp::print().

90 {
91  if (ptr == sigWriteReadTable) return "rwtable";
92  return "prim5???";
93 }
Tree sigWriteReadTable(Tree n, Tree init, Tree widx, Tree wsig, Tree ridx)
Definition: signals.hh:99

Here is the call graph for this function:

Here is the caller graph for this function:

static void printRule ( ostream &  fout,
Tree  rule 
)
static

Definition at line 103 of file ppbox.cpp.

References hd(), isNil(), left(), right(), and tl().

Referenced by boxpp::print().

104 {
105  Tree lhs = left(rule);
106  Tree rhs = right(rule);
107  char sep = '(';
108  while (!isNil(lhs)) {
109  fout << sep << boxpp(hd(lhs));
110  sep=',';
111  lhs=tl(lhs);
112  }
113  fout << ") => " << boxpp(rhs) << "; ";
114 }
Tree left(Tree t)
Definition: list.hh:170
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
Definition: tree.hh:109
Tree hd(Tree l)
Definition: list.hh:133
Tree right(Tree t)
Definition: list.hh:171
bool isNil(Tree l)
Definition: list.hh:137
Definition: ppbox.hh:58
Tree tl(Tree l)
Definition: list.hh:134

Here is the call graph for this function:

Here is the caller graph for this function:

static void streambinop ( ostream &  fout,
Tree  t1,
const char *  op,
Tree  t2,
int  curPriority,
int  upPriority 
)
static

Definition at line 96 of file ppbox.cpp.

Referenced by boxpp::print().

97 {
98  if (upPriority > curPriority) fout << '(';
99  fout << boxpp(t1,curPriority) << op << boxpp(t2,curPriority);
100  if (upPriority > curPriority) fout << ')';
101 }
Definition: ppbox.hh:58

Here is the caller graph for this function:

static string tree2quotedstr ( Tree  t)
static

Definition at line 121 of file ppbox.cpp.

References tree2str().

Referenced by boxpp::print().

122 {
123  return "\"" + string(tree2str(t)) + "\"";
124 }
const char * tree2str(Tree t)
if t has a node of type symbol, return its name otherwise error
Definition: tree.cpp:278

Here is the call graph for this function:

Here is the caller graph for this function:

static string type2str ( int  type)
static

Definition at line 126 of file ppbox.cpp.

Referenced by boxpp::print().

127 {
128  switch (type) {
129 
130  case 0:
131  return "int";
132 
133  case 1:
134  return "float";
135 
136  default:
137  return "";
138 
139  }
140 }

Here is the caller graph for this function:

Variable Documentation

int gFloatSize

Definition at line 153 of file main.cpp.

Referenced by boxpp::print().