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(double 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, double* 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 boxModifLocalDef (Tree body, Tree ldef);
00173 bool isBoxModifLocalDef (Tree t, Tree& body, Tree& ldef);
00174
00175
00176
00177
00178
00179
00180 Tree boxError();
00181 bool isBoxError(Tree t);
00182
00183
00184
00185
00186
00187 typedef Tree (*prim0)();
00188 typedef Tree (*prim1)(Tree x);
00189 typedef Tree (*prim2)(Tree x, Tree y);
00190 typedef Tree (*prim3)(Tree x, Tree y, Tree z);
00191 typedef Tree (*prim4)(Tree w, Tree x, Tree y, Tree z);
00192 typedef Tree (*prim5)(Tree v, Tree w, Tree x, Tree y, Tree z);
00193
00194 Tree boxPrim0 (prim0 foo);
00195 Tree boxPrim1 (prim1 foo);
00196 Tree boxPrim2 (prim2 foo);
00197 Tree boxPrim3 (prim3 foo);
00198 Tree boxPrim4 (prim4 foo);
00199 Tree boxPrim5 (prim5 foo);
00200
00201 bool isBoxPrim0 (Tree s);
00202 bool isBoxPrim1 (Tree s);
00203 bool isBoxPrim2 (Tree s);
00204 bool isBoxPrim3 (Tree s);
00205 bool isBoxPrim4 (Tree s);
00206 bool isBoxPrim5 (Tree s);
00207
00208 bool isBoxPrim0 (Tree s, prim0* p);
00209 bool isBoxPrim1 (Tree s, prim1* p);
00210 bool isBoxPrim2 (Tree s, prim2* p);
00211 bool isBoxPrim3 (Tree s, prim3* p);
00212 bool isBoxPrim4 (Tree s, prim4* p);
00213 bool isBoxPrim5 (Tree s, prim5* p);
00214
00215
00216
00217
00218
00219
00220 Tree boxFFun (Tree ff);
00221 bool isBoxFFun (Tree s);
00222 bool isBoxFFun (Tree s, Tree& ff);
00223
00224
00225 Tree boxFConst (Tree type, Tree name, Tree file);
00226 bool isBoxFConst (Tree s);
00227 bool isBoxFConst (Tree s, Tree& type, Tree& name, Tree& file);
00228
00229
00230 Tree boxFVar (Tree type, Tree name, Tree file);
00231 bool isBoxFVar (Tree s);
00232 bool isBoxFVar (Tree s, Tree& type, Tree& name, Tree& file);
00233
00234
00235
00236
00237
00238
00239 Tree boxEnvironment();
00240 bool isBoxEnvironment (Tree s);
00241
00242 Tree boxComponent (Tree filename);
00243 bool isBoxComponent (Tree s, Tree& filename);
00244
00245 Tree boxLibrary (Tree filename);
00246 bool isBoxLibrary (Tree s, Tree& filename);
00247
00248 Tree importFile(Tree filename);
00249 bool isImportFile(Tree s, Tree& filename);
00250
00251
00252
00253
00254
00255
00256 Tree boxButton (Tree label);
00257 bool isBoxButton (Tree s);
00258 bool isBoxButton (Tree s, Tree& label);
00259
00260 Tree boxCheckbox (Tree label);
00261 bool isBoxCheckbox (Tree s);
00262 bool isBoxCheckbox (Tree s, Tree& label);
00263
00264 Tree boxVSlider (Tree label, Tree cur, Tree min, Tree max, Tree step);
00265 bool isBoxVSlider (Tree s);
00266 bool isBoxVSlider (Tree s, Tree& label, Tree& cur, Tree& min, Tree& max, Tree& step);
00267
00268 Tree boxHSlider (Tree label, Tree cur, Tree min, Tree max, Tree step);
00269 bool isBoxHSlider (Tree s);
00270 bool isBoxHSlider (Tree s, Tree& label, Tree& cur, Tree& min, Tree& max, Tree& step);
00271
00272 Tree boxNumEntry (Tree label, Tree cur, Tree min, Tree max, Tree step);
00273 bool isBoxNumEntry (Tree s);
00274 bool isBoxNumEntry (Tree s, Tree& label, Tree& cur, Tree& min, Tree& max, Tree& step);
00275
00276 Tree boxVGroup (Tree label, Tree x);
00277 bool isBoxVGroup (Tree s);
00278 bool isBoxVGroup (Tree s, Tree& label, Tree& x);
00279
00280 Tree boxHGroup (Tree label, Tree x);
00281 bool isBoxHGroup (Tree s);
00282 bool isBoxHGroup (Tree s, Tree& label, Tree& x);
00283
00284 Tree boxTGroup (Tree label, Tree x);
00285 bool isBoxTGroup (Tree s);
00286 bool isBoxTGroup (Tree s, Tree& label, Tree& x);
00287
00288
00289 Tree boxVBargraph (Tree label, Tree min, Tree max);
00290 bool isBoxVBargraph (Tree s);
00291 bool isBoxVBargraph (Tree s, Tree& label, Tree& min, Tree& max);
00292
00293 Tree boxHBargraph (Tree label, Tree min, Tree max);
00294 bool isBoxHBargraph (Tree s);
00295 bool isBoxHBargraph (Tree s, Tree& label, Tree& min, Tree& max);
00296
00297
00298
00299
00300
00301 Tree boxCase (Tree rules);
00302 bool isBoxCase (Tree s);
00303 bool isBoxCase (Tree s, Tree& rules);
00304
00305 Tree boxPatternMatcher (Automaton* a, int state, Tree env, Tree origRules, Tree revParamList);
00306 bool isBoxPatternMatcher (Tree s);
00307 bool isBoxPatternMatcher (Tree s, Automaton*& a, int& state, Tree& env, Tree& origRules, Tree& revParamList);
00308
00309
00310 Tree boxPatternVar (Tree id);
00311 bool isBoxPatternVar(Tree s, Tree& id);
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323 bool getBoxType (Tree box, int* inum, int* onum);
00324
00325
00326 #endif