|
FAUST compiler
0.9.9.6b8
|
Implementation of block diagram expressions. Boxes are created using five main connection operations : sequential (:), parallel (,), split (<:), merge (:>), and recursive (~). More...
#include <stdio.h>#include <string.h>#include "boxes.hh"#include "ppbox.hh"#include "prim2.hh"#include "xtended.hh"
Go to the source code of this file.
Implementation of block diagram expressions. Boxes are created using five main connection operations : sequential (:), parallel (,), split (<:), merge (:>), and recursive (~).
Definition in file boxes.cpp.
Definition at line 172 of file boxes.cpp.
References tree().
Referenced by buildBoxAppl(), and preparePattern().


Definition at line 581 of file boxes.cpp.
References boxCaseInternal(), and prepareRules().
Referenced by applyList(), makeDefinition(), and yyparse().
{ return boxCaseInternal(prepareRules(rules)); }


| Tree boxCaseInternal | ( | Tree | rules | ) |
| Tree boxCheckbox | ( | Tree | lbl | ) |
Definition at line 342 of file boxes.cpp.
References tree().
Referenced by realeval(), and yyparse().
{ return tree(BOXCHECKBOX, lbl); }


| Tree boxComponent | ( | Tree | filename | ) |
| Tree boxEnvironment | ( | ) |
Definition at line 255 of file boxes.cpp.
References tree().
Referenced by realeval(), and yyparse().
{ return tree(BOXENVIRONMENT); }


Definition at line 215 of file boxes.cpp.
References tree().
Referenced by apply_pattern_matcher(), and applyList().


| Tree boxHBargraph | ( | Tree | lbl, |
| Tree | min, | ||
| Tree | max | ||
| ) |
Definition at line 425 of file boxes.cpp.
References tree().
Referenced by realeval(), and yyparse().
{ return tree(BOXHBARGRAPH, lbl, min, max); }


Definition at line 407 of file boxes.cpp.
References tree().
Referenced by insideBoxSimplification(), preparePattern(), realeval(), and yyparse().


Definition at line 348 of file boxes.cpp.
References list4(), and tree().
Referenced by realeval(), and yyparse().
{ return tree(BOXHSLIDER, lbl, list4(cur,min,max,step)); }


Definition at line 57 of file boxes.cpp.
References symbol(), and tree().
Referenced by declareAutoDoc(), evalprocess(), realeval(), writeIdentValue(), and yyparse().


Definition at line 75 of file boxes.cpp.
References tree().
Referenced by isBoxNumeric(), isInverter(), numericBoxSimplification(), and yyparse().
{ return tree(n); }


| Tree boxLibrary | ( | Tree | filename | ) |
Definition at line 137 of file boxes.cpp.
References tree().
Referenced by insideBoxSimplification(), preparePattern(), realeval(), and yyparse().


| Tree boxModifLocalDef | ( | Tree | body, |
| Tree | ldef | ||
| ) |
Definition at line 387 of file boxes.cpp.
References list4(), and tree().
Referenced by realeval(), and yyparse().
{ return tree(BOXNUMENTRY, lbl, list4(cur,min,max,step)); }


Definition at line 125 of file boxes.cpp.
References tree().
Referenced by insideBoxSimplification(), isInverter(), iteratePar(), iterateProd(), iterateSum(), larg2par(), preparePattern(), realeval(), and yyparse().


Definition at line 591 of file boxes.cpp.
References tree().
Referenced by applyList(), and evalCase().
{
return tree(BOXPATMATCHER, tree((void*)a), tree(state), env, origRules, revParamList);
}


| Tree boxPatternVar | ( | Tree | id | ) |
Definition at line 290 of file boxes.cpp.
References tree().
Referenced by isInverter(), iterateProd(), iterateSum(), and yyparse().


Definition at line 76 of file boxes.cpp.
References tree().
Referenced by isBoxNumeric(), isInverter(), numericBoxSimplification(), and yyparse().
{ return tree(n); }


Definition at line 129 of file boxes.cpp.
References tree().
Referenced by insideBoxSimplification(), preparePattern(), realeval(), and yyparse().


Definition at line 121 of file boxes.cpp.
References tree().
Referenced by applyList(), insideBoxSimplification(), isInverter(), iterateProd(), iterateSeq(), iterateSum(), preparePattern(), realeval(), and yyparse().


Definition at line 133 of file boxes.cpp.
References tree().
Referenced by insideBoxSimplification(), preparePattern(), realeval(), and yyparse().


| Tree boxSymbolic | ( | Tree | slot, |
| Tree | body | ||
| ) |
Definition at line 111 of file boxes.cpp.
References tree().
Referenced by insideBoxSimplification(), and real_a2sb().
{ return tree(BOXSYMBOLIC,slot, body); }


Definition at line 419 of file boxes.cpp.
References tree().
Referenced by insideBoxSimplification(), preparePattern(), realeval(), and yyparse().


| Tree boxVBargraph | ( | Tree | lbl, |
| Tree | min, | ||
| Tree | max | ||
| ) |
Definition at line 431 of file boxes.cpp.
References tree().
Referenced by realeval(), and yyparse().
{ return tree(BOXVBARGRAPH, lbl, min, max); }


Definition at line 413 of file boxes.cpp.
References tree().
Referenced by insideBoxSimplification(), preparePattern(), realeval(), and yyparse().


Definition at line 368 of file boxes.cpp.
References list4(), and tree().
Referenced by realeval(), and yyparse().
{ return tree(BOXVSLIDER, lbl, list4(cur,min,max,step)); }


| Tree boxWithLocalDef | ( | Tree | body, |
| Tree | ldef | ||
| ) |
Definition at line 235 of file boxes.cpp.
References tree().
Referenced by preparePattern(), and yyparse().
{ return tree(BOXWITHLOCALDEF, body, ldef); }


| Tree buildBoxAbstr | ( | Tree | largs, |
| Tree | body | ||
| ) |
Definition at line 180 of file boxes.cpp.
References boxAbstr(), buildBoxAbstr(), hd(), isNil(), and tl().
Referenced by buildBoxAbstr(), makeDefinition(), and yyparse().
{
if (isNil(largs)) {
return body;
} else {
return buildBoxAbstr(tl(largs), boxAbstr(hd(largs), body));
}
}


| Tree buildBoxAppl | ( | Tree | fun, |
| Tree | revarglist | ||
| ) |
Definition at line 205 of file boxes.cpp.
References tree().
Referenced by apply_pattern_matcher(), copyEnvReplaceDefs(), pushMultiClosureDefs(), realeval(), and updateClosures().


| Tree importFile | ( | Tree | filename | ) |
| bool isBoxAbstr | ( | Tree | t | ) |
Definition at line 174 of file boxes.cpp.
References CTree::node().
Referenced by applyList(), preparePattern(), boxpp::print(), real_a2sb(), and realeval().


| bool isBoxAbstr | ( | Tree | t, |
| Tree & | x, | ||
| Tree & | y | ||
| ) |
| bool isBoxAccess | ( | Tree | t, |
| Tree & | exp, | ||
| Tree & | id | ||
| ) |
Definition at line 227 of file boxes.cpp.
References isTree().
Referenced by preparePattern(), boxpp::print(), and realeval().


Definition at line 175 of file boxes.cpp.
References CTree::node().
Referenced by preparePattern(), boxpp::print(), and realeval().


| bool isBoxButton | ( | Tree | s | ) |
Definition at line 337 of file boxes.cpp.
References isTree().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), preparePattern(), boxpp::print(), propagate(), realeval(), and UserInterfaceDescription().


| bool isBoxButton | ( | Tree | s, |
| Tree & | lbl | ||
| ) |
Definition at line 583 of file boxes.cpp.
References isTree().
Referenced by copyEnvReplaceDefs(), preparePattern(), boxpp::print(), pushMultiClosureDefs(), and realeval().


| bool isBoxCheckbox | ( | Tree | s | ) |
Definition at line 343 of file boxes.cpp.
References isTree().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), preparePattern(), boxpp::print(), propagate(), realeval(), and UserInterfaceDescription().
{ Tree lbl; return isTree(s, BOXCHECKBOX, lbl); }


| bool isBoxCheckbox | ( | Tree | s, |
| Tree & | lbl | ||
| ) |
Definition at line 344 of file boxes.cpp.
References isTree().
{ return isTree(s, BOXCHECKBOX, lbl); }

| bool isBoxComponent | ( | Tree | s, |
| Tree & | filename | ||
| ) |
Definition at line 261 of file boxes.cpp.
References isTree().
Referenced by preparePattern(), boxpp::print(), and realeval().
{ return isTree(s, BOXCOMPONENT, filename); }


Definition at line 91 of file boxes.cpp.
References isTree().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), isPureRouting(), preparePattern(), boxpp::print(), propagate(), and realeval().


| bool isBoxEnvironment | ( | Tree | s | ) |
Definition at line 256 of file boxes.cpp.
References isTree().
Referenced by applyList(), infereBoxType(), preparePattern(), boxpp::print(), real_a2sb(), and realeval().
{ return isTree(s, BOXENVIRONMENT); }


| bool isBoxError | ( | Tree | t | ) |
Definition at line 220 of file boxes.cpp.
References isTree().
Referenced by apply_pattern_matcher(), applyList(), make_pattern_matcher(), and boxpp::print().


| bool isBoxFConst | ( | Tree | s | ) |
Definition at line 321 of file boxes.cpp.
References isTree().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), preparePattern(), boxpp::print(), propagate(), and realeval().


| bool isBoxFConst | ( | Tree | s, |
| Tree & | type, | ||
| Tree & | name, | ||
| Tree & | file | ||
| ) |
Definition at line 315 of file boxes.cpp.
References isTree().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), preparePattern(), boxpp::print(), propagate(), and realeval().


Definition at line 327 of file boxes.cpp.
References isTree().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), preparePattern(), boxpp::print(), propagate(), and realeval().


| bool isBoxHBargraph | ( | Tree | s | ) |
Definition at line 426 of file boxes.cpp.
References isTree(), max(), and min().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), preparePattern(), boxpp::print(), propagate(), realeval(), and UserInterfaceDescription().
{ Tree lbl, min, max; return isTree(s, BOXHBARGRAPH, lbl, min, max); }


| bool isBoxHBargraph | ( | Tree | s, |
| Tree & | lbl, | ||
| Tree & | min, | ||
| Tree & | max | ||
| ) |
Definition at line 427 of file boxes.cpp.
References isTree().
{ return isTree(s, BOXHBARGRAPH, lbl, min, max); }

| bool isBoxHGroup | ( | Tree | s | ) |
Definition at line 408 of file boxes.cpp.
References isTree().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), isBoxPatternOp(), preparePattern(), boxpp::print(), propagate(), realeval(), and UserInterfaceDescription().


| bool isBoxHGroup | ( | Tree | s, |
| Tree & | lbl, | ||
| Tree & | x | ||
| ) |
| bool isBoxHSlider | ( | Tree | s | ) |
Definition at line 350 of file boxes.cpp.
References isTree().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), preparePattern(), boxpp::print(), propagate(), realeval(), and UserInterfaceDescription().
{ Tree lbl, params; return isTree(s, BOXHSLIDER, lbl, params); }


Definition at line 352 of file boxes.cpp.
References isTree(), and nth().
{
Tree params;
if (isTree(s, BOXHSLIDER, lbl, params)) {
cur = nth(params, 0);
min = nth(params, 1);
max = nth(params, 2);
step= nth(params, 3);
return true;
} else {
return false;
}
}

| bool isBoxIdent | ( | Tree | t | ) |
Definition at line 58 of file boxes.cpp.
References CTree::node().
Referenced by preparePattern(), boxpp::print(), real_a2sb(), realeval(), and standardArgList().


| bool isBoxIdent | ( | Tree | t0, |
| const char ** | str | ||
| ) |
Definition at line 78 of file boxes.cpp.
References isInt(), and CTree::node().
Referenced by Automaton::build(), computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), isBoxNumeric(), numericBoxSimplification(), preparePattern(), boxpp::print(), propagate(), and realeval().


Definition at line 155 of file boxes.cpp.
References isTree().
Referenced by preparePattern(), boxpp::print(), and realeval().


| bool isBoxIProd | ( | Tree | t, |
| Tree & | x, | ||
| Tree & | y, | ||
| Tree & | z | ||
| ) |
Definition at line 158 of file boxes.cpp.
References isTree().
Referenced by preparePattern(), boxpp::print(), and realeval().


Definition at line 156 of file boxes.cpp.
References isTree().
Referenced by preparePattern(), boxpp::print(), and realeval().


Definition at line 157 of file boxes.cpp.
References isTree().
Referenced by preparePattern(), boxpp::print(), and realeval().


| bool isBoxLibrary | ( | Tree | s, |
| Tree & | filename | ||
| ) |
Definition at line 266 of file boxes.cpp.
References isTree().
Referenced by realeval().
{ return isTree(s, BOXLIBRARY, filename); }


| bool isBoxMerge | ( | Tree | t, |
| Tree & | x, | ||
| Tree & | y | ||
| ) |
Definition at line 138 of file boxes.cpp.
References isTree().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), isBoxPatternOp(), isPureRouting(), preparePattern(), boxpp::print(), propagate(), and realeval().


| bool isBoxModifLocalDef | ( | Tree | t, |
| Tree & | body, | ||
| Tree & | ldef | ||
| ) |
Definition at line 246 of file boxes.cpp.
References isTree().
Referenced by realeval().
{ return isTree(t, BOXMODIFLOCALDEF, body, ldef); }


| bool isBoxNumEntry | ( | Tree | s | ) |
Definition at line 389 of file boxes.cpp.
References isTree().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), preparePattern(), boxpp::print(), propagate(), realeval(), and UserInterfaceDescription().
{ Tree lbl, params; return isTree(s, BOXNUMENTRY, lbl, params); }


Definition at line 391 of file boxes.cpp.
References isTree(), and nth().
{
Tree params;
if (isTree(s, BOXNUMENTRY, lbl, params)) {
cur = nth(params, 0);
min = nth(params, 1);
max = nth(params, 2);
step= nth(params, 3);
return true;
} else {
return false;
}
}

Definition at line 126 of file boxes.cpp.
References isTree().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), isBoxPatternOp(), isPureRouting(), preparePattern(), boxpp::print(), propagate(), and realeval().


| bool isBoxPatternMatcher | ( | Tree | s | ) |
Definition at line 596 of file boxes.cpp.
References isTree().
Referenced by applyList(), boxpp::print(), real_a2sb(), and realeval().
{
Tree ta, ts, env, orig, rpl;
return isTree(s, BOXPATMATCHER, ta, ts, env, orig, rpl);
}


| bool isBoxPatternMatcher | ( | Tree | s, |
| Automaton *& | a, | ||
| int & | state, | ||
| Tree & | env, | ||
| Tree & | origRules, | ||
| Tree & | revParamList | ||
| ) |
Definition at line 602 of file boxes.cpp.
References isTree(), tree2int(), and tree2ptr().
{
Tree ta, ts;
if (isTree(s, BOXPATMATCHER, ta, ts, env, origRules, revParamList)) {
a = (Automaton*)tree2ptr(ta);
state = tree2int(ts);
return true;
} else {
return false;
}
}

| bool isBoxPatternVar | ( | Tree | s, |
| Tree & | id | ||
| ) |
Definition at line 588 of file boxes.cpp.
References isTree().
Referenced by infereBoxType(), make_state(), preparePattern(), boxpp::print(), and realeval().


| bool isBoxPrim0 | ( | Tree | s | ) |
Definition at line 281 of file boxes.cpp.
References isTree().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), preparePattern(), boxpp::print(), propagate(), and realeval().


| bool isBoxPrim0 | ( | Tree | s, |
| prim0 * | p | ||
| ) |
Definition at line 282 of file boxes.cpp.
References isPointer(), isTree(), and CTree::node().

| bool isBoxPrim1 | ( | Tree | s | ) |
Definition at line 286 of file boxes.cpp.
References isTree().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), preparePattern(), boxpp::print(), propagate(), and realeval().


| bool isBoxPrim1 | ( | Tree | s, |
| prim1 * | p | ||
| ) |
Definition at line 287 of file boxes.cpp.
References isPointer(), isTree(), and CTree::node().

| bool isBoxPrim2 | ( | Tree | s | ) |
Definition at line 291 of file boxes.cpp.
References isTree().
Referenced by applyList(), computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), preparePattern(), boxpp::print(), propagate(), and realeval().


| bool isBoxPrim2 | ( | Tree | s, |
| prim2 * | p | ||
| ) |
Definition at line 292 of file boxes.cpp.
References isPointer(), isTree(), and CTree::node().

| bool isBoxPrim3 | ( | Tree | s | ) |
Definition at line 296 of file boxes.cpp.
References isTree().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), preparePattern(), boxpp::print(), propagate(), and realeval().


| bool isBoxPrim3 | ( | Tree | s, |
| prim3 * | p | ||
| ) |
Definition at line 297 of file boxes.cpp.
References isPointer(), isTree(), and CTree::node().

| bool isBoxPrim4 | ( | Tree | s | ) |
Definition at line 301 of file boxes.cpp.
References isTree().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), preparePattern(), boxpp::print(), propagate(), and realeval().


| bool isBoxPrim4 | ( | Tree | s, |
| prim4 * | p | ||
| ) |
Definition at line 302 of file boxes.cpp.
References isPointer(), isTree(), and CTree::node().

| bool isBoxPrim5 | ( | Tree | s | ) |
Definition at line 306 of file boxes.cpp.
References isTree().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), preparePattern(), boxpp::print(), propagate(), and realeval().


| bool isBoxPrim5 | ( | Tree | s, |
| prim5 * | p | ||
| ) |
Definition at line 307 of file boxes.cpp.
References isPointer(), isTree(), and CTree::node().

Definition at line 79 of file boxes.cpp.
References isDouble(), and CTree::node().
Referenced by Automaton::build(), computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), isBoxNumeric(), numericBoxSimplification(), preparePattern(), boxpp::print(), propagate(), and realeval().


Definition at line 82 of file boxes.cpp.
References isDouble(), and CTree::node().

Definition at line 130 of file boxes.cpp.
References isTree().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), isBoxPatternOp(), preparePattern(), boxpp::print(), propagate(), and realeval().


Definition at line 122 of file boxes.cpp.
References isTree().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), isBoxPatternOp(), isPureRouting(), preparePattern(), boxpp::print(), propagate(), and realeval().


Definition at line 105 of file boxes.cpp.
References isTree().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), isPureRouting(), preparePattern(), boxpp::print(), propagate(), and realeval().


| bool isBoxSplit | ( | Tree | t, |
| Tree & | x, | ||
| Tree & | y | ||
| ) |
Definition at line 134 of file boxes.cpp.
References isTree().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), isBoxPatternOp(), isPureRouting(), preparePattern(), boxpp::print(), propagate(), and realeval().


| bool isBoxSymbolic | ( | Tree | t | ) |
Definition at line 112 of file boxes.cpp.
References isTree().
Referenced by computeBoxComplexity(), generateAbstractionSchema(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), preparePattern(), boxpp::print(), propagate(), and realeval().
{ Tree slot, body; return isTree(t, BOXSYMBOLIC, slot, body); }


| bool isBoxSymbolic | ( | Tree | t, |
| Tree & | slot, | ||
| Tree & | body | ||
| ) |
Definition at line 113 of file boxes.cpp.
References isTree().
{ return isTree(t, BOXSYMBOLIC, slot, body); }

| bool isBoxTGroup | ( | Tree | s | ) |
Definition at line 420 of file boxes.cpp.
References isTree().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), isBoxPatternOp(), preparePattern(), boxpp::print(), propagate(), realeval(), and UserInterfaceDescription().


| bool isBoxTGroup | ( | Tree | s, |
| Tree & | lbl, | ||
| Tree & | x | ||
| ) |
| bool isBoxVBargraph | ( | Tree | s | ) |
Definition at line 432 of file boxes.cpp.
References isTree(), max(), and min().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), preparePattern(), boxpp::print(), propagate(), realeval(), and UserInterfaceDescription().
{ Tree lbl, min, max; return isTree(s, BOXVBARGRAPH, lbl, min, max); }


| bool isBoxVBargraph | ( | Tree | s, |
| Tree & | lbl, | ||
| Tree & | min, | ||
| Tree & | max | ||
| ) |
Definition at line 433 of file boxes.cpp.
References isTree().
{ return isTree(s, BOXVBARGRAPH, lbl, min, max); }

| bool isBoxVGroup | ( | Tree | s | ) |
Definition at line 414 of file boxes.cpp.
References isTree().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), isBoxPatternOp(), preparePattern(), boxpp::print(), propagate(), realeval(), and UserInterfaceDescription().


| bool isBoxVGroup | ( | Tree | s, |
| Tree & | lbl, | ||
| Tree & | x | ||
| ) |
| bool isBoxVSlider | ( | Tree | s | ) |
Definition at line 370 of file boxes.cpp.
References isTree().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), preparePattern(), boxpp::print(), propagate(), realeval(), and UserInterfaceDescription().
{ Tree lbl, params; return isTree(s, BOXVSLIDER, lbl, params); }


Definition at line 372 of file boxes.cpp.
References isTree(), and nth().
{
Tree params;
if (isTree(s, BOXVSLIDER, lbl, params)) {
cur = nth(params, 0);
min = nth(params, 1);
max = nth(params, 2);
step= nth(params, 3);
return true;
} else {
return false;
}
}

Definition at line 95 of file boxes.cpp.
References isTree().
Referenced by computeBoxComplexity(), generateInsideSchema(), infereBoxType(), insideBoxSimplification(), isPureRouting(), preparePattern(), boxpp::print(), propagate(), and realeval().


| bool isBoxWithLocalDef | ( | Tree | t, |
| Tree & | body, | ||
| Tree & | ldef | ||
| ) |
Definition at line 236 of file boxes.cpp.
References isTree().
Referenced by preparePattern(), boxpp::print(), and realeval().
{ return isTree(t, BOXWITHLOCALDEF, body, ldef); }


Definition at line 210 of file boxes.cpp.
References isTree().
Referenced by applyList(), boxpp::print(), real_a2sb(), realeval(), and updateClosures().


| bool isImportFile | ( | Tree | s, |
| Tree & | filename | ||
| ) |
Definition at line 272 of file boxes.cpp.
References isTree().
Referenced by SourceReader::expandrec(), formatDefinitions(), and boxpp::print().
{ return isTree(s, IMPORTFILE, filename); }


| static Tree preparePattern | ( | Tree | box | ) | [static] |
Prepare a "pattern" by replacing variables x by special pattern variables ?x.
P[x] -> ?x P[x(e)] -> x(P[e]) P[e(f)] -> P[e](P[f]) P[e:f] -> P[e]:P[f] etc.
Definition at line 454 of file boxes.cpp.
References boxAppl(), boxHGroup(), boxIPar(), boxIProd(), boxISeq(), boxISum(), boxMerge(), boxPar(), boxPatternVar(), boxRec(), boxSeq(), boxSplit(), boxTGroup(), boxVGroup(), boxWithLocalDef(), getUserData(), isBoxAbstr(), isBoxAccess(), isBoxAppl(), isBoxButton(), isBoxCase(), isBoxCheckbox(), isBoxComponent(), isBoxCut(), isBoxEnvironment(), isBoxFConst(), isBoxFFun(), isBoxFVar(), isBoxHBargraph(), isBoxHGroup(), isBoxHSlider(), isBoxIdent(), isBoxInt(), isBoxIPar(), isBoxIProd(), isBoxISeq(), isBoxISum(), isBoxMerge(), isBoxNumEntry(), isBoxPar(), isBoxPatternVar(), isBoxPrim0(), isBoxPrim1(), isBoxPrim2(), isBoxPrim3(), isBoxPrim4(), isBoxPrim5(), isBoxReal(), isBoxRec(), isBoxSeq(), isBoxSlot(), isBoxSplit(), isBoxSymbolic(), isBoxTGroup(), isBoxVBargraph(), isBoxVGroup(), isBoxVSlider(), isBoxWire(), isBoxWithLocalDef(), isList(), isNil(), lmap(), max(), min(), and name().
Referenced by prepareRule().
{
// cerr << "preparePattern(" << boxpp(box) << ")" << endl;
int id;
double r;
prim0 p0;
prim1 p1;
prim2 p2;
prim3 p3;
prim4 p4;
prim5 p5;
Tree t1, t2, t3, ff, label, cur, min, max, step, type, name, file, arg,
body, fun, args, ldef, slot,
ident, rules;
xtended* xt = (xtended*) getUserData(box);
// primitive elements
if (xt) return box;
else if (isBoxIdent(box)) return boxPatternVar(box);
else if (isBoxAppl(box, fun, args)) {
if (isBoxIdent(fun)) return boxAppl( fun, lmap(preparePattern,args));
else return boxAppl( preparePattern(fun), lmap(preparePattern,args));
}
else if (isBoxAbstr(box,arg,body)) return box;
else if (isBoxInt(box)) return box;
else if (isBoxReal(box, &r)) return box;
else if (isBoxCut(box)) return box;
else if (isBoxWire(box)) return box;
else if (isBoxPrim0(box, &p0)) return box;
else if (isBoxPrim1(box, &p1)) return box;
else if (isBoxPrim2(box, &p2)) return box;
else if (isBoxPrim3(box, &p3)) return box;
else if (isBoxPrim4(box, &p4)) return box;
else if (isBoxPrim5(box, &p5)) return box;
else if (isBoxWithLocalDef(box, body, ldef)) return boxWithLocalDef(preparePattern(body), ldef);
// foreign elements
else if (isBoxFFun(box, ff)) return box;
else if (isBoxFConst(box, type, name, file))
return box;
else if (isBoxFVar(box, type, name, file))
return box;
// block diagram binary operator
else if (isBoxSeq(box, t1, t2)) return boxSeq( preparePattern(t1), preparePattern(t2) );
else if (isBoxSplit(box, t1, t2)) return boxSplit( preparePattern(t1), preparePattern(t2) );
else if (isBoxMerge(box, t1, t2)) return boxMerge( preparePattern(t1), preparePattern(t2) );
else if (isBoxPar(box, t1, t2)) return boxPar( preparePattern(t1), preparePattern(t2) );
else if (isBoxRec(box, t1, t2)) return boxRec( preparePattern(t1), preparePattern(t2) );
// iterative block diagram construction
else if (isBoxIPar(box, t1, t2, t3)) return boxIPar ( t1, t2, preparePattern(t3) );
else if (isBoxISeq(box, t1, t2, t3)) return boxISeq ( t1, t2, preparePattern(t3) );
else if (isBoxISum(box, t1, t2, t3)) return boxISum ( t1, t2, preparePattern(t3) );
else if (isBoxIProd(box, t1, t2, t3)) return boxIProd( t1, t2, preparePattern(t3) );
// user interface
else if (isBoxButton(box, label)) return box;
else if (isBoxCheckbox(box, label)) return box;
else if (isBoxVSlider(box, label, cur, min, max, step)) return box;
else if (isBoxHSlider(box, label, cur, min, max, step)) return box;
else if (isBoxVGroup(box, label, t1)) return boxVGroup(label, preparePattern(t1));
else if (isBoxHGroup(box, label, t1)) return boxHGroup(label, preparePattern(t1));
else if (isBoxTGroup(box, label, t1)) return boxTGroup(label, preparePattern(t1));
else if (isBoxHBargraph(box, label, min, max)) return box;
else if (isBoxVBargraph(box, label, min, max)) return box;
else if (isBoxNumEntry(box, label, cur, min, max, step)) return box;
else if (isNil(box)) return box;
else if (isList(box)) return lmap(preparePattern, box);
else if (isBoxEnvironment(box)) return box;
/* not expected
else if (isClosure(box, abstr, genv, vis, lenv)) {
fout << "closure[" << boxpp(abstr)
<< ", genv = " << envpp(genv)
<< ", lenv = " << envpp(lenv)
<< "]";
}
*/
else if (isBoxComponent(box, label)) return box;
else if (isBoxAccess(box, t1, t2)) return box;
/* not expected
else if (isImportFile(box, label)) {
fout << "import("
<< tree2str(label) << ')';
}
*/
else if (isBoxSlot(box, &id)) return box;
else if (isBoxSymbolic(box, slot, body)) return box;
// Pattern Matching Extensions
else if (isBoxCase(box, rules)) return box;
else if (isBoxPatternVar(box, ident)) return box;
// None of the previous tests succeded, then it is not a valid box
else {
cerr << "Error in preparePattern() : " << *box << " is not a valid box" << endl;
exit(1);
}
return box;
}

| static Tree prepareRule | ( | Tree | rule | ) | [static] |
Definition at line 571 of file boxes.cpp.
References cons(), hd(), lmap(), preparePattern(), and tl().
Referenced by prepareRules().
{
return cons (lmap(preparePattern,hd(rule)), tl(rule));
}


| static Tree prepareRules | ( | Tree | rules | ) | [static] |
Definition at line 576 of file boxes.cpp.
References lmap(), and prepareRule().
Referenced by boxCase().
{
return lmap(prepareRule, rules);
}


| Sym BOXCHECKBOX = symbol ("BoxCheckbox") |
| Sym BOXCOMPONENT = symbol ("BoxComponent") |
| Sym BOXENVIRONMENT = symbol ("BoxEnvironment") |
| Sym BOXHBARGRAPH = symbol ("BoxHBargraph") |
| Sym BOXHSLIDER = symbol ("BoxHSlider") |
| Sym BOXLIBRARY = symbol ("BoxLibrary") |
| Sym BOXMODIFLOCALDEF = symbol ("BoxModifLocalDef") |
| Sym BOXNUMENTRY = symbol ("BoxNumEntry") |
| Sym BOXPATMATCHER = symbol ("BoxPatMatcher") |
| Sym BOXSYMBOLIC = symbol ("BoxSymbolic") |
| Sym BOXVBARGRAPH = symbol ("BoxVBargraph") |
| Sym BOXVSLIDER = symbol ("BoxVSlider") |
| Sym BOXWITHLOCALDEF = symbol ("BoxWithLocalDef") |
| Sym IMPORTFILE = symbol ("ImportFile") |
1.8.0