00001 #ifndef _BOXES_
00002 #define _BOXES_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #include "tlib.hh"
00043 #include "signals.hh"
00044
00045 struct Automaton;
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 Tree boxIdent(const char* name);
00061 bool isBoxIdent(Tree t);
00062 bool isBoxIdent(Tree t, const char** name);
00063
00064
00065
00066
00067
00068
00069 Tree boxInt(int n);
00070 Tree boxReal(float n);
00071
00072 bool isBoxInt(Tree t);
00073 bool isBoxReal(Tree t);
00074
00075 bool isBoxInt(Tree t, int* i);
00076 bool isBoxReal(Tree t, float* r);
00077
00078
00079
00080
00081
00082
00083 Tree boxWire();
00084 Tree boxCut();
00085
00086 bool isBoxWire(Tree t);
00087 bool isBoxCut(Tree t);
00088
00089
00090
00091
00092
00093
00094 Tree boxSlot(int id);
00095 Tree boxSymbolic(Tree slot, Tree body);
00096
00097 bool isBoxSlot(Tree t);
00098 bool isBoxSymbolic(Tree t);
00099
00100 bool isBoxSlot(Tree t, int* id);
00101 bool isBoxSymbolic(Tree t, Tree& slot, Tree& body);
00102
00103
00104
00105
00106
00107
00108 Tree boxSeq (Tree x, Tree y);
00109 Tree boxPar (Tree x, Tree y);
00110 Tree boxRec (Tree x, Tree y);
00111 Tree boxSplit (Tree x, Tree y);
00112 Tree boxMerge (Tree x, Tree y);
00113
00114 bool isBoxSeq (Tree t, Tree& x, Tree& y);
00115 bool isBoxPar (Tree t, Tree& x, Tree& y);
00116 bool isBoxRec (Tree t, Tree& x, Tree& y);
00117 bool isBoxSplit (Tree t, Tree& x, Tree& y);
00118 bool isBoxMerge (Tree t, Tree& x, Tree& y);
00119
00120
00121
00122
00123
00124 Tree boxIPar(Tree x, Tree y, Tree z);
00125 Tree boxISeq(Tree x, Tree y, Tree z);
00126 Tree boxISum(Tree x, Tree y, Tree z);
00127 Tree boxIProd(Tree x, Tree y, Tree z);
00128
00129 bool isBoxIPar(Tree t, Tree& x, Tree& y, Tree& z);
00130 bool isBoxISeq(Tree t, Tree& x, Tree& y, Tree& z);
00131 bool isBoxISum(Tree t, Tree& x, Tree& y, Tree& z);
00132 bool isBoxIProd(Tree t, Tree& x, Tree& y, Tree& z);
00133
00134
00135
00136
00137
00138
00139 Tree buildBoxAbstr (Tree x, Tree y);
00140 Tree buildBoxAppl (Tree x, Tree y);
00141
00142 Tree boxAbstr (Tree x, Tree y);
00143 Tree boxAppl (Tree x, Tree y);
00144
00145 bool isBoxAbstr (Tree t);
00146 bool isBoxAppl (Tree t);
00147
00148 bool isBoxAbstr (Tree t, Tree& x, Tree& y);
00149 bool isBoxAppl (Tree t, Tree& x, Tree& y);
00150
00151 Tree closure (Tree abstr, Tree genv, Tree vis, Tree lenv);
00152
00153 bool isClosure (Tree t, Tree& abstr, Tree& genv, Tree& vis, Tree& lenv);
00154
00155
00156 Tree boxAccess (Tree exp, Tree id);
00157 bool isBoxAccess(Tree t, Tree& exp, Tree& id);
00158
00159
00160
00161
00162
00163
00164 Tree boxWithLocalDef (Tree body, Tree ldef);
00165 bool isBoxWithLocalDef (Tree t, Tree& body, Tree& ldef);
00166
00167
00168
00169
00170
00171
00172 Tree boxError();
00173 bool isBoxError(Tree t);
00174
00175
00176
00177
00178
00179 typedef Tree (*prim0)();
00180 typedef Tree (*prim1)(Tree x);
00181 typedef Tree (*prim2)(Tree x, Tree y);
00182 typedef Tree (*prim3)(Tree x, Tree y, Tree z);
00183 typedef Tree (*prim4)(Tree w, Tree x, Tree y, Tree z);
00184 typedef Tree (*prim5)(Tree v, Tree w, Tree x, Tree y, Tree z);
00185
00186 Tree boxPrim0 (prim0 foo);
00187 Tree boxPrim1 (prim1 foo);
00188 Tree boxPrim2 (prim2 foo);
00189 Tree boxPrim3 (prim3 foo);
00190 Tree boxPrim4 (prim4 foo);
00191 Tree boxPrim5 (prim5 foo);
00192
00193 bool isBoxPrim0 (Tree s);
00194 bool isBoxPrim1 (Tree s);
00195 bool isBoxPrim2 (Tree s);
00196 bool isBoxPrim3 (Tree s);
00197 bool isBoxPrim4 (Tree s);
00198 bool isBoxPrim5 (Tree s);
00199
00200 bool isBoxPrim0 (Tree s, prim0* p);
00201 bool isBoxPrim1 (Tree s, prim1* p);
00202 bool isBoxPrim2 (Tree s, prim2* p);
00203 bool isBoxPrim3 (Tree s, prim3* p);
00204 bool isBoxPrim4 (Tree s, prim4* p);
00205 bool isBoxPrim5 (Tree s, prim5* p);
00206
00207
00208
00209
00210
00211
00212 Tree boxFFun (Tree ff);
00213 bool isBoxFFun (Tree s);
00214 bool isBoxFFun (Tree s, Tree& ff);
00215
00216
00217 Tree boxFConst (Tree type, Tree name, Tree file);
00218 bool isBoxFConst (Tree s);
00219 bool isBoxFConst (Tree s, Tree& type, Tree& name, Tree& file);
00220
00221
00222 Tree boxFVar (Tree type, Tree name, Tree file);
00223 bool isBoxFVar (Tree s);
00224 bool isBoxFVar (Tree s, Tree& type, Tree& name, Tree& file);
00225
00226
00227
00228
00229
00230
00231 Tree boxComponent (Tree filename);
00232 bool isBoxComponent (Tree s, Tree& filename);
00233
00234 Tree importFile(Tree filename);
00235 bool isImportFile(Tree s, Tree& filename);
00236
00237
00238
00239
00240
00241
00242 Tree boxButton (Tree label);
00243 bool isBoxButton (Tree s);
00244 bool isBoxButton (Tree s, Tree& label);
00245
00246 Tree boxCheckbox (Tree label);
00247 bool isBoxCheckbox (Tree s);
00248 bool isBoxCheckbox (Tree s, Tree& label);
00249
00250 Tree boxVSlider (Tree label, Tree cur, Tree min, Tree max, Tree step);
00251 bool isBoxVSlider (Tree s);
00252 bool isBoxVSlider (Tree s, Tree& label, Tree& cur, Tree& min, Tree& max, Tree& step);
00253
00254 Tree boxHSlider (Tree label, Tree cur, Tree min, Tree max, Tree step);
00255 bool isBoxHSlider (Tree s);
00256 bool isBoxHSlider (Tree s, Tree& label, Tree& cur, Tree& min, Tree& max, Tree& step);
00257
00258 Tree boxNumEntry (Tree label, Tree cur, Tree min, Tree max, Tree step);
00259 bool isBoxNumEntry (Tree s);
00260 bool isBoxNumEntry (Tree s, Tree& label, Tree& cur, Tree& min, Tree& max, Tree& step);
00261
00262 Tree boxVGroup (Tree label, Tree x);
00263 bool isBoxVGroup (Tree s);
00264 bool isBoxVGroup (Tree s, Tree& label, Tree& x);
00265
00266 Tree boxHGroup (Tree label, Tree x);
00267 bool isBoxHGroup (Tree s);
00268 bool isBoxHGroup (Tree s, Tree& label, Tree& x);
00269
00270 Tree boxTGroup (Tree label, Tree x);
00271 bool isBoxTGroup (Tree s);
00272 bool isBoxTGroup (Tree s, Tree& label, Tree& x);
00273
00274
00275 Tree boxVBargraph (Tree label, Tree min, Tree max);
00276 bool isBoxVBargraph (Tree s);
00277 bool isBoxVBargraph (Tree s, Tree& label, Tree& min, Tree& max);
00278
00279 Tree boxHBargraph (Tree label, Tree min, Tree max);
00280 bool isBoxHBargraph (Tree s);
00281 bool isBoxHBargraph (Tree s, Tree& label, Tree& min, Tree& max);
00282
00283
00284
00285
00286
00287 Tree boxCase (Tree rules);
00288 bool isBoxCase (Tree s);
00289 bool isBoxCase (Tree s, Tree& rules);
00290
00291 Tree boxPatternMatcher (Automaton* a, int state, Tree env, Tree origRules, Tree revParamList);
00292 bool isBoxPatternMatcher (Tree s);
00293 bool isBoxPatternMatcher (Tree s, Automaton*& a, int& state, Tree& env, Tree& origRules, Tree& revParamList);
00294
00295
00296 Tree boxPatternVar (Tree id);
00297 bool isBoxPatternVar(Tree s, Tree& id);
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309 bool getBoxType (Tree box, int* inum, int* onum);
00310
00311
00312 #endif