94 return tree(BOXWAVEFORM, br);
220 if (
isNil(revarglist)) {
229 if (
isNil (revarglist)) exit(1);
230 return boxAppl(fun, revarglist);
236 return tree(CLOSURE, abstr, genv, vis, lenv);
241 return isTree(t, CLOSURE, abstr, genv, vis, lenv);
246 return tree(BOXERROR);
251 return isTree(t, BOXERROR);
378 {
return tree(BOXHSLIDER, lbl,
list4(cur,min,max,step)); }
384 if (
isTree(s, BOXHSLIDER, lbl, params)) {
385 cur =
nth(params, 0);
386 min =
nth(params, 1);
387 max =
nth(params, 2);
388 step=
nth(params, 3);
398 {
return tree(BOXVSLIDER, lbl,
list4(cur,min,max,step)); }
404 if (
isTree(s, BOXVSLIDER, lbl, params)) {
405 cur =
nth(params, 0);
406 min =
nth(params, 1);
407 max =
nth(params, 2);
408 step=
nth(params, 3);
417 {
return tree(BOXNUMENTRY, lbl,
list4(cur,min,max,step)); }
423 if (
isTree(s, BOXNUMENTRY, lbl, params)) {
424 cur =
nth(params, 0);
425 min =
nth(params, 1);
426 max =
nth(params, 2);
427 step=
nth(params, 3);
496 Tree t1, t2, t3, ff, label, cur,
min,
max, step, type,
name, file, arg,
497 body, fun, args, ldef, slot,
510 else if (
isBoxAbstr(box,arg,body))
return box;
530 else if (
isBoxFVar(box, type, name, file))
554 else if (
isBoxVSlider(box, label, cur, min, max, step))
return box;
555 else if (
isBoxHSlider(box, label, cur, min, max, step))
return box;
563 else if (
isBoxNumEntry(box, label, cur, min, max, step))
return box;
565 else if (
isNil(box))
return box;
587 else if (
isBoxSlot(box, &
id))
return box;
591 else if (
isBoxCase(box, rules))
return box;
597 cerr <<
"Error in preparePattern() : " << *box <<
" is not a valid box" << endl;
627 return tree(BOXPATMATCHER,
tree((
void*)a),
tree(state), env, origRules, revParamList);
632 Tree ta, ts, env, orig, rpl;
633 return isTree(s, BOXPATMATCHER, ta, ts, env, orig, rpl);
639 if (
isTree(s, BOXPATMATCHER, ta, ts, env, origRules, revParamList)) {
Tree(* prim2)(Tree x, Tree y)
bool isBoxIPar(Tree t, Tree &x, Tree &y, Tree &z)
Tree boxFVar(Tree type, Tree name, Tree file)
bool isImportFile(Tree s, Tree &filename)
Tree boxSymbolic(Tree slot, Tree body)
bool isBoxSeq(Tree t, Tree &x, Tree &y)
bool isBoxWithLocalDef(Tree t, Tree &body, Tree &ldef)
Class Node = (type x (int + double + Sym + void*))
Tree boxCheckbox(Tree lbl)
Tree boxHBargraph(Tree lbl, Tree min, Tree max)
bool isBoxOutputs(Tree t, Tree &x)
Tree cons(Tree a, Tree b)
bool isBoxIProd(Tree t, Tree &x, Tree &y, Tree &z)
bool isBoxPatternMatcher(Tree s)
int tree2int(Tree t)
if t has a node of type int, return it otherwise error
Tree boxRec(Tree x, Tree y)
bool isBoxSplit(Tree t, Tree &x, Tree &y)
Tree boxNumEntry(Tree lbl, Tree cur, Tree min, Tree max, Tree step)
bool isBoxComponent(Tree s, Tree &filename)
Tree boxISeq(Tree x, Tree y, Tree z)
static Tree prepareRules(Tree rules)
Tree(* prim4)(Tree w, Tree x, Tree y, Tree z)
Tree lmap(tfun f, Tree l)
Tree boxISum(Tree x, Tree y, Tree z)
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
Tree boxVSlider(Tree lbl, Tree cur, Tree min, Tree max, Tree step)
Tree boxIdent(const char *name)
bool isBoxAccess(Tree t, Tree &exp, Tree &id)
const Node & node() const
return the content of the tree
Tree list4(Tree a, Tree b, Tree c, Tree d)
bool isBoxHBargraph(Tree s)
Tree boxHSlider(Tree lbl, Tree cur, Tree min, Tree max, Tree step)
Tree boxCaseInternal(Tree rules)
bool isBoxRec(Tree t, Tree &x, Tree &y)
double max(double x, double y)
Tree(* prim3)(Tree x, Tree y, Tree z)
Tree(* prim5)(Tree v, Tree w, Tree x, Tree y, Tree z)
Tree boxVBargraph(Tree lbl, Tree min, Tree max)
Tree boxPatternMatcher(Automaton *a, int state, Tree env, Tree origRules, Tree revParamList)
bool isBoxModifLocalDef(Tree t, Tree &body, Tree &ldef)
bool isBoxSymbolic(Tree t)
static Tree preparePattern(Tree box)
Prepare a "pattern" by replacing variables x by special pattern variables ?x.
bool isBoxISum(Tree t, Tree &x, Tree &y, Tree &z)
bool isBoxEnvironment(Tree s)
Tree boxWithLocalDef(Tree body, Tree ldef)
Tree boxPatternVar(Tree id)
bool isBoxPar(Tree t, Tree &x, Tree &y)
bool isBoxHSlider(Tree s)
Tree boxMerge(Tree x, Tree y)
bool isDouble(const Node &n)
Tree boxAppl(Tree x, Tree y)
bool isBoxVBargraph(Tree s)
bool isBoxWaveform(Tree s)
Tree importFile(Tree filename)
bool isClosure(Tree t, Tree &abstr, Tree &genv, Tree &vis, Tree &lenv)
bool isSym(const Node &n)
bool isBoxCheckbox(Tree s)
Tree boxWaveform(const tvec &br)
Tree boxAccess(Tree exp, Tree id)
Tree boxLibrary(Tree filename)
Tree boxAbstr(Tree x, Tree y)
Tree boxSeq(Tree x, Tree y)
const char * name(Symbol *sym)
Returns the name of a symbol.
Tree boxFConst(Tree type, Tree name, Tree file)
Tree closure(Tree abstr, Tree genv, Tree vis, Tree lenv)
void * tree2ptr(Tree t)
if t has a node of type ptr, return it otherwise error
bool isBoxVSlider(Tree s)
Tree boxIPar(Tree x, Tree y, Tree z)
Tree boxHGroup(Tree lbl, Tree x)
Symbols are unique objects with a name stored in a hash table.
bool isTree(const Tree &t, const Node &n)
bool isBoxNumEntry(Tree s)
Tree boxTGroup(Tree lbl, Tree x)
Tree boxPar(Tree x, Tree y)
bool isBoxInputs(Tree t, Tree &x)
void * getUserData(Symbol *sym)
Returns user data.
static Tree prepareRule(Tree rule)
bool isBoxISeq(Tree t, Tree &x, Tree &y, Tree &z)
bool isBoxPatternVar(Tree s, Tree &id)
Symbol * symbol(const char *str)
Returns (and creates if new) the symbol of name str.
bool isBoxLibrary(Tree s, Tree &filename)
bool isPointer(const Node &n)
Tree boxModifLocalDef(Tree body, Tree ldef)
Tree buildBoxAbstr(Tree largs, Tree body)
bool isBoxMerge(Tree t, Tree &x, Tree &y)
bool isInt(const Node &n)
Tree boxComponent(Tree filename)
double min(double x, double y)
Tree boxSplit(Tree x, Tree y)
Tree boxVGroup(Tree lbl, Tree x)
Tree buildBoxAppl(Tree fun, Tree revarglist)
Tree boxIProd(Tree x, Tree y, Tree z)