#include "symbol.hh"
#include "tree.hh"
#include <stdio.h>
Go to the source code of this file.
Definition at line 272 of file list.cpp.
References addElement(), cons(), hd(), isList(), and tl().
Referenced by addElement(), evalIdDef(), list2set(), and ppsig::printrec().
00273 { 00274 if (isList(l)) { 00275 if (e < hd(l)) { 00276 return cons(e,l); 00277 } else if (e == hd(l)) { 00278 return l; 00279 } else { 00280 return cons(hd(l), addElement(e,tl(l))); 00281 } 00282 } else { 00283 return cons(e,nil); 00284 } 00285 }
Definition at line 216 of file list.cpp.
References rconcat(), and reverse().
Referenced by applyList(), and sigCartesianProd().
Definition at line 124 of file list.hh.
References tree().
Referenced by addElement(), addEnv(), addKey(), annotate(), applyList(), collectEqSigs(), concatPath(), declareAutoDoc(), encodeName(), eval(), evalIdDef(), evalPatternList(), evalRule(), evalRuleList(), SourceReader::expandrec(), formatDefinitions(), getBoxType(), label2path(), list1(), list2(), list3(), list4(), listConvert(), listn(), lrange(), main(), makeDefinition(), normalizeLabel(), nwires(), propagate(), pushEnv(), rconcat(), real_a2sb(), remElement(), removeKey(), replace(), reverse(), revEvalList(), rmap(), setDefProp(), setDifference(), setIntersection(), setUnion(), updateKey(), vec2list(), and yyparse().
Definition at line 423 of file list.cpp.
References CTree::getProperty().
Referenced by addLayerDef(), annotate(), evalIdDef(), getBoxType(), getColorProperty(), Occurrences::getCount(), getDefFileProp(), getDefLineProp(), getDefNameProperty(), getEvalProperty(), getInferredType(), getNumericProperty(), getPMProperty(), getRecursivness(), ScalarCompiler::getSharingCount(), DocCompiler::getSharingCount(), getSigNickname(), getSigOrder(), privatisation(), searchIdDef(), shcount(), sigMap(), sigMapRename(), subst(), and tmap().
00424 { 00425 CTree* pl = t->getProperty(key); 00426 if (pl) { 00427 val = pl; 00428 return true; 00429 } else { 00430 return false; 00431 } 00432 }
Definition at line 133 of file list.hh.
References CTree::branch().
Referenced by addElement(), Description::addGroup(), addKey(), applyList(), boxlistOutputs(), buildBoxAbstr(), checkRulelist(), collectDocEqns(), DocCompiler::compileLateq(), VectorCompiler::compileMultiSignal(), SchedulerCompiler::compileMultiSignal(), ScalarCompiler::compileMultiSignal(), concatPath(), copyEnvReplaceDefs(), eval2double(), eval2int(), evalPatternList(), evalRuleList(), SourceReader::expandrec(), ffrestype(), findKey(), formatDefinitions(), ScalarCompiler::generateButton(), ScalarCompiler::generateCheckbox(), ScalarCompiler::generateHBargraph(), ScalarCompiler::generateHSlider(), Compiler::generateMacroInterfaceElements(), ScalarCompiler::generateNumEntry(), Compiler::generateUserInterfaceElements(), ScalarCompiler::generateVBargraph(), ScalarCompiler::generateVSlider(), getBoxType(), getDefFileProp(), getSubSignals(), DocCompiler::getUIDir(), DocCompiler::getUIDocInfos(), infereFFType(), infereSigOrder(), infereSigType(), initialRecType(), isBoxNumeric(), isCons(), isElement(), isInEnv(), larg2par(), list2set(), list2vec(), makeDefinition(), makeSubFolderChain(), OccMarkup::mark(), normalizePath(), nth(), position(), Compiler::prepareUserInterfaceTree(), envpp::print(), boxpp::print(), printdoccontent(), ppsig::printlabel(), ppsig::printlist(), printlist(), printRule(), printSignal(), pushMultiClosureDefs(), putSubFolder(), rconcat(), remElement(), removeKey(), replace(), replaceBoxNumeric(), reverse(), revEvalList(), rmap(), searchEnv(), setDifference(), setIntersection(), setSigListNickName(), setUnion(), ScalarCompiler::sharingAnalysis(), DocCompiler::sharingAnalysis(), standardArgList(), updateKey(), and fullvisitor::visitList().
00133 { return l->branch(0); }
bool isList | ( | Tree | l | ) | [inline] |
Definition at line 138 of file list.hh.
References CTree::arity(), and CTree::node().
Referenced by addElement(), collectDocEqns(), DocCompiler::compileLateq(), VectorCompiler::compileMultiSignal(), SchedulerCompiler::compileMultiSignal(), ScalarCompiler::compileMultiSignal(), concatPath(), getSubSignals(), infereFFType(), infereSigOrder(), infereSigType(), initialRecType(), isBefore(), isCons(), isElement(), len(), list2set(), OccMarkup::mark(), normalizeLabel(), nth(), Compiler::prepareUserInterfaceTree(), ppsig::print(), envpp::print(), boxpp::print(), printdoccontent(), printlist(), printSignal(), rconcat(), remElement(), replaceBoxNumeric(), reverse(), reverseall(), rmap(), searchEnv(), setSigListNickName(), ScalarCompiler::sharingAnalysis(), DocCompiler::sharingAnalysis(), standardArgList(), and sigvisitor::visit().
bool isNil | ( | Tree | l | ) | [inline] |
Definition at line 137 of file list.hh.
References CTree::arity(), and CTree::node().
Referenced by Description::addGroup(), addKey(), applyList(), boxlistOutputs(), buildBoxAbstr(), buildBoxAppl(), checkRulelist(), concatPath(), copyEnvReplaceDefs(), evalIdDef(), evalPatternList(), evalRuleList(), SourceReader::expandrec(), findKey(), formatDefinitions(), Compiler::generateMacroInterfaceElements(), Compiler::generateUserInterfaceElements(), getBoxType(), getSubSignals(), DocCompiler::getUIDir(), infereSigOrder(), larg2par(), list2vec(), makeDefinition(), makeSubFolderChain(), normalizePath(), position(), Compiler::prepareUserInterfaceTree(), boxpp::print(), ppsig::printlabel(), ppsig::printlist(), printlist(), printRule(), privatisation(), pushMultiClosureDefs(), putSubFolder(), removeKey(), revEvalList(), searchIdDef(), setDifference(), setIntersection(), setSigListNickName(), setUnion(), sigMap(), sigMapRename(), subst(), tmap(), updateKey(), and fullvisitor::visitList().
Definition at line 170 of file list.hh.
References CTree::branch().
Referenced by Description::addGroup(), addKey(), evalRule(), findKey(), Compiler::generateUserInterfaceTree(), printRule(), removeKey(), and updateKey().
00170 { return t->branch(0); }
int len | ( | Tree | l | ) |
Definition at line 198 of file list.cpp.
References isList(), and tl().
Referenced by checkRulelist(), evalCase(), ffarity(), DocCompiler::generateRec(), ScalarCompiler::generateRec(), make_pattern_matcher(), makeDefinition(), and Symbol::Symbol().
Tree list0 | ( | ) | [inline] |
Definition at line 127 of file list.hh.
References cons(), and list0().
Referenced by list2(), sigCartesianProd(), and singleton().
Definition at line 130 of file list.hh.
References cons(), and list3().
Referenced by boxHSlider(), boxNumEntry(), boxVSlider(), sigHSlider(), sigNumEntry(), and sigVSlider().
Definition at line 182 of file list.cpp.
References hd(), isList(), and tl().
Referenced by ffargtype(), ffname(), DocCompiler::generateFFun(), ScalarCompiler::generateFFun(), DocCompiler::generateRec(), ScalarCompiler::generateRec(), isBoxHSlider(), isBoxNumEntry(), isBoxVSlider(), isSigHSlider(), isSigNumEntry(), isSigVSlider(), and lrange().
00183 { 00184 while (isList(l)) { 00185 if (i == 0) return hd(l); 00186 l = tl(l); 00187 i--; 00188 } 00189 return nil; 00190 }
void print | ( | Tree | t, | |
FILE * | out = stdout | |||
) |
Definition at line 154 of file list.cpp.
References CTree::arity(), CTree::branch(), isDouble(), isInt(), isPointer(), isSym(), name(), CTree::node(), print(), and printlist().
Referenced by addLayerDef(), evalerror(), evalremark(), evalwarning(), ScalarCompiler::generateCode(), generateInsideSchema(), infereSigOrder(), infereSigType(), print(), printlist(), printSignal(), and searchEnv().
00155 { 00156 int i; double f; Sym s; void* p; 00157 00158 if (printlist(t, out)) return; 00159 00160 Node n = t->node(); 00161 if (isInt(n, &i)) fprintf (out, "%d", i); 00162 else if (isDouble(n, &f)) fprintf (out, "%f", f); 00163 else if (isSym(n, &s)) fprintf (out, "%s", name(s)); 00164 else if (isPointer(n, &p)) fprintf (out, "#%p", p); 00165 00166 int k = t->arity(); 00167 if (k > 0) { 00168 char sep = '['; 00169 for (int i=0; i<k; i++) { 00170 fputc(sep, out); sep = ','; 00171 print(t->branch(i), out); 00172 } 00173 fputc(']', out); 00174 } 00175 }
Definition at line 351 of file list.cpp.
References cons().
Referenced by propagate(), and sigMapRename().
Definition at line 287 of file list.cpp.
References cons(), hd(), isList(), remElement(), and tl().
Referenced by remElement().
00288 { 00289 if (isList(l)) { 00290 if (e < hd(l)) { 00291 return l; 00292 } else if (e == hd(l)) { 00293 return tl(l); 00294 } else { 00295 return cons(hd(l), remElement(e,tl(l))); 00296 } 00297 } else { 00298 return nil; 00299 } 00300 }
Definition at line 240 of file list.cpp.
References cons(), hd(), isList(), and tl().
Referenced by applyList(), collectDocEqns(), concat(), ScalarCompiler::generateButton(), ScalarCompiler::generateCheckbox(), ScalarCompiler::generateHBargraph(), ScalarCompiler::generateHSlider(), ScalarCompiler::generateNumEntry(), ScalarCompiler::generateVBargraph(), ScalarCompiler::generateVSlider(), DocCompiler::getUIDir(), lmap(), make_pattern_matcher(), printdoccontent(), and printPatternError().
00241 { 00242 Tree r = nil; 00243 while (isList(l)) { r = cons(hd(l),r); l = tl(l); } 00244 return r; 00245 }
Definition at line 252 of file list.cpp.
References isList(), reverseall(), and rmap().
Referenced by reverseall().
00253 { 00254 return isList(l) ? rmap(reverseall, l) : l; 00255 }
Definition at line 171 of file list.hh.
References CTree::branch().
Referenced by Description::addGroup(), evalRule(), findKey(), Compiler::generateMacroInterfaceElements(), Compiler::generateMacroInterfaceTree(), Compiler::generateUserInterfaceElements(), Compiler::generateUserInterfaceTree(), Compiler::prepareUserInterfaceTree(), and printRule().
00171 { return t->branch(1); }
Definition at line 336 of file list.cpp.
References cons(), hd(), isNil(), setDifference(), and tl().
Referenced by setDifference().
00337 { 00338 if (isNil(A)) return A; 00339 if (isNil(B)) return A; 00340 if (hd(A) == hd(B)) return setDifference(tl(A),tl(B)); 00341 if (hd(A) < hd(B)) return cons(hd(A), setDifference(tl(A),B)); 00342 /* (hd(A) > hd(B)*/ return setDifference(A,tl(B)); 00343 }
Definition at line 327 of file list.cpp.
References cons(), hd(), isNil(), setIntersection(), and tl().
Referenced by setIntersection().
00328 { 00329 if (isNil(A)) return A; 00330 if (isNil(B)) return B; 00331 if (hd(A) == hd(B)) return cons(hd(A), setIntersection(tl(A),tl(B))); 00332 if (hd(A) < hd(B)) return setIntersection(tl(A),B); 00333 /* (hd(A) > hd(B)*/ return setIntersection(A,tl(B)); 00334 }
Definition at line 418 of file list.cpp.
References CTree::setProperty().
Referenced by addLayerDef(), annotate(), computePrivatisation(), copyEnvReplaceDefs(), getBoxType(), getInferredType(), getSigOrder(), infereRecType(), privatisation(), setColorProperty(), Occurrences::setCount(), setDefNameProperty(), setDefProp(), setEvalProperty(), setNumericProperty(), setPMProperty(), ScalarCompiler::setSharingCount(), DocCompiler::setSharingCount(), setSigNickname(), sigMap(), sigMapRename(), subst(), and tmap().
00419 { 00420 t->setProperty(key, val); 00421 }
Definition at line 317 of file list.cpp.
References cons(), hd(), isNil(), setUnion(), and tl().
Referenced by realeval(), and setUnion().
00318 { 00319 if (isNil(A)) return B; 00320 if (isNil(B)) return A; 00321 00322 if (hd(A) == hd(B)) return cons(hd(A), setUnion(tl(A),tl(B))); 00323 if (hd(A) < hd(B)) return cons(hd(A), setUnion(tl(A),B)); 00324 /* hd(A) > hd(B) */ return cons(hd(B), setUnion(A,tl(B))); 00325 }
Definition at line 559 of file list.cpp.
References subst(), and substkey().
Referenced by calcDeBruijn2Sym(), and calcsubstitute().
Definition at line 134 of file list.hh.
References CTree::branch().
Referenced by addElement(), Description::addGroup(), addKey(), applyList(), boxlistOutputs(), buildBoxAbstr(), checkRulelist(), collectDocEqns(), DocCompiler::compileLateq(), VectorCompiler::compileMultiSignal(), SchedulerCompiler::compileMultiSignal(), ScalarCompiler::compileMultiSignal(), concatPath(), copyEnvReplaceDefs(), VectorCompiler::CS(), decorateSchema::draw(), evalPatternList(), evalRuleList(), SourceReader::expandrec(), findKey(), formatDefinitions(), ScalarCompiler::generateButton(), ScalarCompiler::generateCheckbox(), ScalarCompiler::generateHBargraph(), ScalarCompiler::generateHSlider(), Compiler::generateMacroInterfaceElements(), ScalarCompiler::generateNumEntry(), Compiler::generateUserInterfaceElements(), ScalarCompiler::generateVBargraph(), ScalarCompiler::generateVSlider(), getBoxType(), getDefLineProp(), getSubSignals(), DocCompiler::getUIDir(), infereFFType(), infereSigOrder(), infereSigType(), initialRecType(), isBefore(), isCons(), isElement(), isInEnv(), larg2par(), len(), list2set(), list2vec(), makeDefinition(), makeSubFolderChain(), OccMarkup::mark(), normalizePath(), nth(), position(), Compiler::prepareUserInterfaceTree(), envpp::print(), boxpp::print(), printdoccontent(), ppsig::printlabel(), ppsig::printlist(), printlist(), printRule(), printSignal(), pushMultiClosureDefs(), putSubFolder(), rconcat(), remElement(), removeKey(), replace(), reverse(), revEvalList(), rmap(), searchEnv(), setDifference(), setIntersection(), setSigListNickName(), setUnion(), ScalarCompiler::sharingAnalysis(), DocCompiler::sharingAnalysis(), standardArgList(), updateKey(), and fullvisitor::visitList().
00134 { return l->branch(1); }
Definition at line 445 of file list.cpp.
References CTree::arity(), CTree::branch(), getProperty(), isNil(), CTree::node(), setProperty(), tmap(), and tree().
Referenced by tmap().
00446 { 00447 //printf("start tmap\n"); 00448 Tree p; 00449 00450 if (getProperty(t, key, p)) { 00451 00452 return (isNil(p)) ? t : p; // truc pour eviter les boucles 00453 00454 } else { 00455 00456 Tree r1=nil; 00457 switch (t->arity()) { 00458 00459 case 0 : 00460 r1 = t; 00461 break; 00462 case 1 : 00463 r1 = tree(t->node(), tmap(key,f,t->branch(0))); 00464 break; 00465 case 2 : 00466 r1 = tree(t->node(), tmap(key,f,t->branch(0)), tmap(key,f,t->branch(1))); 00467 break; 00468 case 3 : 00469 r1 = tree(t->node(), tmap(key,f,t->branch(0)), tmap(key,f,t->branch(1)), 00470 tmap(key,f,t->branch(2))); 00471 break; 00472 case 4 : 00473 r1 = tree(t->node(), tmap(key,f,t->branch(0)), tmap(key,f,t->branch(1)), 00474 tmap(key,f,t->branch(2)), tmap(key,f,t->branch(3))); 00475 break; 00476 } 00477 Tree r2 = f(r1); 00478 if (r2 == t) { 00479 setProperty(t, key, nil); 00480 } else { 00481 setProperty(t, key, r2); 00482 } 00483 return r2; 00484 } 00485 }
Definition at line 116 of file list.cpp.
Referenced by addKey(), apply_pattern_matcher(), applyList(), boxPropagateSig(), collectEqSigs(), computePrivatisation(), concatPath(), copyEnvReplaceDefs(), declareAutoDoc(), eval2double(), eval2int(), evalCase(), evaldocexpr(), evalIdDef(), evalPattern(), evalPatternList(), evalprocess(), evalRuleList(), SourceReader::expandlist(), formatDefinitions(), getBoxType(), getFolder(), isBoxNumeric(), label2path(), listConvert(), listn(), main(), make_pattern_matcher(), makeDefinition(), mapPrepareEqSig(), OccMarkup::mark(), nwires(), privatisation(), pushMultiClosureDefs(), real_a2sb(), realeval(), recursivnessAnnotation(), replaceBoxNumeric(), revEvalList(), sigMap(), sigMapRename(), sigReadOnlyTable(), sigWriteReadTable(), updateKey(), vec2list(), and yyparse().