|
FAUST compiler
0.9.9.6b8
|
Compile a list of FAUST signals into a list of LaTeX formulas. More...
#include <doc_compile.hh>

Public Member Functions | |
| DocCompiler (int numInputs, int numOutputs) | |
| DocCompiler (Lateq *k, int priority) | |
| ~DocCompiler () | |
| Lateq * | compileLateq (Tree L, Lateq *compiledEqn) |
| Tree | annotate (Tree L0) |
| Lateq * | getLateq () |
| void | setDescription (Description *descr) |
| Description * | getDescription () |
Protected Member Functions | |
| string | CS (Tree sig, int priority) |
| Compile a signal. More... | |
| string | generateCode (Tree sig, int priority) |
| Main code generator dispatch. More... | |
| string | generateCacheCode (Tree sig, const string &exp) |
| string | generateVariableStore (Tree sig, const string &exp) |
| string | getFreshID (const string &prefix) |
| bool | getCompiledExpression (Tree sig, string &name) |
| Test if a signal is already compiled. More... | |
| string | setCompiledExpression (Tree sig, const string &name) |
| Set the string of a compiled expression is already compiled. More... | |
| void | setVectorNameProperty (Tree sig, const string &vecname) |
| Set the vector name property of a signal, the name of the vector used to store the previous values of the signal to implement a delay. More... | |
| bool | getVectorNameProperty (Tree sig, string &vecname) |
| Get the vector name property of a signal, the name of the vector used to store the previous values of the signal to implement a delay. More... | |
| int | getSharingCount (Tree t) |
| void | setSharingCount (Tree t, int count) |
| void | sharingAnalysis (Tree t) |
| void | sharingAnnotation (int vctxt, Tree t) |
| bool | isShortEnough (string &s, unsigned int max) |
| string | generateXtended (Tree sig, int priority) |
| retrieve the type annotation of sig More... | |
| string | generateFixDelay (Tree sig, Tree arg, Tree size, int priority) |
| Generate code for accessing a delayed signal. More... | |
| string | generatePrefix (Tree sig, Tree x, Tree e, int priority) |
| Generate LaTeX code for "prefix", a 1sample-delay explicitely initialized. More... | |
| string | generateIota (Tree sig, Tree arg) |
| Generate a "iota" time function, n-cyclical. More... | |
| string | generateBinOp (Tree sig, int opcode, Tree arg1, Tree arg2, int priority) |
| string | generateFFun (Tree sig, Tree ff, Tree largs, int priority) |
| string | generateInput (Tree sig, const string &idx) |
| string | generateOutput (Tree sig, const string &idx, const string &arg1) |
| Unused for the moment ! More... | |
| string | generateDocConstantTbl (Tree sig, Tree size, Tree content) |
| Generate the equation of a constant table (its content is time constant). More... | |
| string | generateDocWriteTbl (Tree sig, Tree size, Tree content, Tree widx, Tree wsig) |
| Generate the equation of a write table, which content is time dependent. More... | |
| string | generateDocAccessTbl (Tree sig, Tree tbl, Tree ridx) |
| Generate the equation of a write table, which content is time dependent. More... | |
| string | generateSelect2 (Tree sig, Tree sel, Tree s1, Tree s2, int priority) |
| Generate a select2 code. More... | |
| string | generateSelect3 (Tree sig, Tree sel, Tree s1, Tree s2, Tree s3, int priority) |
| Generate a select3 code. More... | |
| string | generateRecProj (Tree sig, Tree exp, int i, int priority) |
| Generate code for a projection of a group of mutually recursive definitions. More... | |
| void | generateRec (Tree sig, Tree var, Tree le, int priority) |
| Generate code for a group of mutually recursive definitions. More... | |
| string | generateIntCast (Tree sig, Tree x, int priority) |
| string | generateFloatCast (Tree sig, Tree x, int priority) |
| Don't generate float cast ! More... | |
| string | generateButton (Tree sig, Tree label) |
| string | generateCheckbox (Tree sig, Tree label) |
| string | generateVSlider (Tree sig, Tree label, Tree cur, Tree min, Tree max, Tree step) |
| string | generateHSlider (Tree sig, Tree label, Tree cur, Tree min, Tree max, Tree step) |
| string | generateNumEntry (Tree sig, Tree label, Tree cur, Tree min, Tree max, Tree step) |
| string | generateVBargraph (Tree sig, Tree label, Tree min, Tree max, const string &exp) |
| string | generateHBargraph (Tree sig, Tree label, Tree min, Tree max, const string &exp) |
| string | generateAttach (Tree sig, Tree x, Tree y, int priority) |
| string | generateNumber (Tree sig, const string &exp) |
| string | generateFConst (Tree sig, const string &file, const string &name) |
| string | generateFVar (Tree sig, const string &file, const string &name) |
| string | generateDelayVec (Tree sig, const string &exp, const string &ctype, const string &vname, int mxd) |
| Generate code for the delay mecchanism. More... | |
| string | generateDelayVecNoTemp (Tree sig, const string &exp, const string &ctype, const string &vname, int mxd) |
| Generate code for the delay mecchanism without using temporary variables. More... | |
| void | generateDelayLine (const string &ctype, const string &vname, int mxd, const string &exp) |
| Generate code for the delay mecchanism without using temporary variables. More... | |
| void | getTypedNames (Type t, const string &prefix, string &ctype, string &vname) |
| void | printGCCall (Tree sig, const string &calledFunction) |
| Print calling information of generateCode, for debug purposes. More... | |
| void | getUIDocInfos (Tree path, string &label, string &unit) |
| Get information on a user interface element for documentation. More... | |
| string | getUIDir (Tree pathname) |
| Get the directory of a user interface element. More... | |
| string | prepareBinaryUI (const string &name, Tree pathname) |
| Prepare binary user interface elements (button, checkbox). More... | |
| string | prepareIntervallicUI (const string &name, Tree path, Tree tcur, Tree tmin, Tree tmax) |
| Prepare "intervallic" user interface elements (sliders, nentry). More... | |
Protected Attributes | |
| property< string > | fCompileProperty |
| property< string > | fVectorProperty |
| Lateq * | fLateq |
| Description * | fDescription |
| Tree | fSharingKey |
| OccMarkup | fOccMarkup |
| int | fPriority |
| math priority context More... | |
Static Protected Attributes | |
| static map< string, int > | fIDCounters |
Compile a list of FAUST signals into a list of LaTeX formulas.
Definition at line 48 of file doc_compile.hh.
|
inline |
Definition at line 66 of file doc_compile.hh.
|
inline |
Definition at line 73 of file doc_compile.hh.
|
inline |
Definition at line 80 of file doc_compile.hh.
Definition at line 88 of file doc_compile.cpp.
References fOccMarkup, OccMarkup::mark(), recursivnessAnnotation(), sharingAnalysis(), and typeAnnotation().
Referenced by annotateSuperList().


< Dynamic field !
Definition at line 102 of file doc_compile.cpp.
References Lateq::addOutputSigFormula(), CS(), docT(), fLateq, gDocNoticeFlagMap, getFreshID(), getSigNickname(), hd(), isList(), Lateq::outputs(), subst(), tl(), and tree2str().
Referenced by mapCompileDocEqnSigs().


|
protected |
Compile a signal.
| sig | the signal expression to compile. |
Definition at line 165 of file doc_compile.cpp.
References generateCode(), getCompiledExpression(), and setCompiledExpression().
Referenced by compileLateq(), generateAttach(), generateBinOp(), generateCode(), generateDocAccessTbl(), generateDocConstantTbl(), generateDocWriteTbl(), generateFFun(), generateFixDelay(), generateFloatCast(), generateIntCast(), generatePrefix(), generateRec(), generateSelect2(), generateSelect3(), and generateXtended().


Definition at line 730 of file doc_compile.cpp.
References CS(), generateCacheCode(), getVectorNameProperty(), and setVectorNameProperty().
Referenced by generateCode().


|
protected |
Definition at line 405 of file doc_compile.cpp.
References associative(), CS(), BinOp::fName, BinOp::fPriority, gBinOpLateqTable, gDocNoticeFlagMap, generateCacheCode(), getCertifiedSigType(), kAdd, kDiv, kInt, kMul, kSub, and subst().
Referenced by generateCode().


Definition at line 647 of file doc_compile.cpp.
References Lateq::addUISigFormula(), fLateq, gDocNoticeFlagMap, generateCacheCode(), getFreshID(), getUIDir(), and prepareBinaryUI().
Referenced by generateCode().


|
protected |
Definition at line 530 of file doc_compile.cpp.
References fOccMarkup, gDocNoticeFlagMap, generateDelayVec(), generateVariableStore(), getCertifiedSigType(), getCompiledExpression(), Occurences::getMaxDelay(), getSharingCount(), getTypedNames(), getVectorNameProperty(), isVerySimpleFormula(), and OccMarkup::retrieve().
Referenced by generateAttach(), generateBinOp(), generateButton(), generateCheckbox(), generateDocAccessTbl(), generateFloatCast(), generateFVar(), generateHBargraph(), generateHSlider(), generateInput(), generateIntCast(), generateNumEntry(), generatePrefix(), generateVBargraph(), generateVSlider(), and generateXtended().


Definition at line 656 of file doc_compile.cpp.
References Lateq::addUISigFormula(), fLateq, gDocNoticeFlagMap, generateCacheCode(), getFreshID(), getUIDir(), and prepareBinaryUI().
Referenced by generateCode().


|
protected |
Main code generator dispatch.
According to the type of the input signal, generateCode calls the appropriate generator with appropriate arguments.
| sig | The signal expression to compile. |
| priority | The environment priority of the expression. |
Definition at line 193 of file doc_compile.cpp.
References CS(), docT(), generateAttach(), generateBinOp(), generateButton(), generateCheckbox(), generateDocAccessTbl(), generateDocConstantTbl(), generateDocWriteTbl(), generateFConst(), generateFFun(), generateFixDelay(), generateFloatCast(), generateFVar(), generateHSlider(), generateInput(), generateIntCast(), generateIota(), generateNumber(), generateNumEntry(), generateOutput(), generatePrefix(), generateRecProj(), generateSelect2(), generateSelect3(), generateVSlider(), generateXtended(), getUserData(), isProj(), isSigAttach(), isSigBinOp(), isSigButton(), isSigCheckbox(), isSigDocAccessTbl(), isSigDocConstantTbl(), isSigDocWriteTbl(), isSigFConst(), isSigFFun(), isSigFixDelay(), isSigFloatCast(), isSigFVar(), isSigHBargraph(), isSigHSlider(), isSigInput(), isSigInt(), isSigIntCast(), isSigIota(), isSigNumEntry(), isSigOutput(), isSigPrefix(), isSigReal(), isSigSelect2(), isSigSelect3(), isSigVBargraph(), isSigVSlider(), name(), printGCCall(), and tree2str().
Referenced by CS().

|
protected |
Generate code for the delay mecchanism without using temporary variables.
Definition at line 1214 of file doc_compile.cpp.
References Lateq::addRecurSigFormula(), fLateq, and subst().
Referenced by generateRec().


|
protected |
Generate code for the delay mecchanism.
The generated code depend of the maximum delay attached to exp and the "less temporaries" switch
Definition at line 1178 of file doc_compile.cpp.
References generateDelayVecNoTemp(), getCertifiedSigType(), and kSamp.
Referenced by generateCacheCode(), generateFConst(), generateFVar(), and generateNumber().


|
protected |
Generate code for the delay mecchanism without using temporary variables.
Definition at line 1192 of file doc_compile.cpp.
References Lateq::addRecurSigFormula(), fLateq, getVectorNameProperty(), setVectorNameProperty(), and subst().
Referenced by generateDelayVec().


Generate the equation of a write table, which content is time dependent.
It is basically a signal of vectors.
Definition at line 863 of file doc_compile.cpp.
References CS(), generateCacheCode(), and subst().
Referenced by generateCode().


Generate the equation of a constant table (its content is time constant).
Returns the name of the table
Definition at line 758 of file doc_compile.cpp.
References Lateq::addRDTblSigFormula(), CS(), fLateq, gDocNoticeFlagMap, getCertifiedSigType(), getTypedNames(), isSigInt(), subst(), and T().
Referenced by generateCode().


|
protected |
Generate the equation of a write table, which content is time dependent.
It is basically a signal of vectors.
Definition at line 823 of file doc_compile.cpp.
References Lateq::addRWTblSigFormula(), CS(), fLateq, gDocNoticeFlagMap, getCertifiedSigType(), getTypedNames(), isSigInt(), replaceTimeBy(), subst(), and T().
Referenced by generateCode().


|
protected |
Definition at line 295 of file doc_compile.cpp.
References fOccMarkup, gDocNoticeFlagMap, generateDelayVec(), getCertifiedSigType(), Occurences::getMaxDelay(), getTypedNames(), and OccMarkup::retrieve().
Referenced by generateCode().


Definition at line 473 of file doc_compile.cpp.
References CS(), ffarity(), ffname(), gDocNoticeFlagMap, and nth().
Referenced by generateCode().


Generate code for accessing a delayed signal.
The generated code depend of the maximum delay attached to exp and the gLessTempSwitch.
Definition at line 1152 of file doc_compile.cpp.
References CS(), getVectorNameProperty(), isSigInt(), and subst().
Referenced by generateCode().


Don't generate float cast !
It is just a kind of redirection. Calling generateCacheCode ensures to create a new variable name if the input signal expression is shared.
Definition at line 637 of file doc_compile.cpp.
References CS(), generateCacheCode(), and subst().
Referenced by generateCode().


|
protected |
Definition at line 320 of file doc_compile.cpp.
References fOccMarkup, gDocNoticeFlagMap, generateCacheCode(), generateDelayVec(), getCertifiedSigType(), Occurences::getMaxDelay(), getTypedNames(), OccMarkup::retrieve(), and setVectorNameProperty().
Referenced by generateCode().


|
protected |
Definition at line 710 of file doc_compile.cpp.
References generateCacheCode(), getCertifiedSigType(), getFreshID(), kBlock, kKonst, and kSamp.

|
protected |
Definition at line 673 of file doc_compile.cpp.
References Lateq::addUISigFormula(), fLateq, gDocNoticeFlagMap, generateCacheCode(), getFreshID(), getUIDir(), and prepareIntervallicUI().
Referenced by generateCode().


|
protected |
Definition at line 341 of file doc_compile.cpp.
References Lateq::addInputSigFormula(), fLateq, gDocNoticeFlagMap, generateCacheCode(), Lateq::inputs(), setVectorNameProperty(), and subst().
Referenced by generateCode().


Definition at line 622 of file doc_compile.cpp.
References CS(), gDocNoticeFlagMap, generateCacheCode(), and subst().
Referenced by generateCode().


Generate a "iota" time function, n-cyclical.
Definition at line 996 of file doc_compile.cpp.
References docT(), isSigInt(), and subst().
Referenced by generateCode().


|
protected |
Definition at line 275 of file doc_compile.cpp.
References fOccMarkup, gDocNoticeFlagMap, generateDelayVec(), getCertifiedSigType(), Occurences::getMaxDelay(), getTypedNames(), and OccMarkup::retrieve().
Referenced by generateCode().


|
protected |
Definition at line 681 of file doc_compile.cpp.
References Lateq::addUISigFormula(), fLateq, gDocNoticeFlagMap, generateCacheCode(), getFreshID(), getUIDir(), and prepareIntervallicUI().
Referenced by generateCode().


|
protected |
Unused for the moment !
Definition at line 358 of file doc_compile.cpp.
References Lateq::addOutputSigFormula(), fLateq, gDocNoticeFlagMap, Lateq::outputs(), and subst().
Referenced by generateCode().


Generate LaTeX code for "prefix", a 1sample-delay explicitely initialized.
| sig | The signal expression to treat. |
| x | The initial value for the delay line. |
| e | The value for the delay line, after initialization. |
| priority | The priority of the environment of the expression. |
Definition at line 963 of file doc_compile.cpp.
References Lateq::addPrefixSigFormula(), CS(), fLateq, gDocNoticeFlagMap, generateCacheCode(), getFreshID(), getVectorNameProperty(), and subst().
Referenced by generateCode().


Generate code for a group of mutually recursive definitions.
Definition at line 911 of file doc_compile.cpp.
References CS(), fOccMarkup, gDocNoticeFlagMap, generateDelayLine(), getCertifiedSigType(), Occurences::getMaxDelay(), getTypedNames(), len(), nth(), OccMarkup::retrieve(), setVectorNameProperty(), and sigProj().
Referenced by generateRecProj().


Generate code for a projection of a group of mutually recursive definitions.
Definition at line 887 of file doc_compile.cpp.
References generateRec(), getVectorNameProperty(), isRec(), and subst().
Referenced by generateCode().


|
protected |
Generate a select2 code.
Definition at line 1012 of file doc_compile.cpp.
References Lateq::addSelectSigFormula(), CS(), fLateq, gDocNoticeFlagMap, getFreshID(), setVectorNameProperty(), and subst().
Referenced by generateCode().


|
protected |
Generate a select3 code.
Definition at line 1038 of file doc_compile.cpp.
References Lateq::addSelectSigFormula(), CS(), fLateq, gDocNoticeFlagMap, generateVariableStore(), getFreshID(), setVectorNameProperty(), and subst().
Referenced by generateCode().


|
protected |
< "k" for constants.
< "p" for "parameter".
Definition at line 578 of file doc_compile.cpp.
References Lateq::addConstSigFormula(), Lateq::addParamSigFormula(), Lateq::addStoreSigFormula(), fLateq, gDocNoticeFlagMap, getCertifiedSigType(), getTypedNames(), getVectorNameProperty(), kBlock, kKonst, kSamp, setVectorNameProperty(), and subst().
Referenced by generateCacheCode(), and generateSelect3().


|
protected |
Definition at line 690 of file doc_compile.cpp.
References generateCacheCode(), getCertifiedSigType(), getFreshID(), kBlock, kKonst, and kSamp.

|
protected |
Definition at line 665 of file doc_compile.cpp.
References Lateq::addUISigFormula(), fLateq, gDocNoticeFlagMap, generateCacheCode(), getFreshID(), getUIDir(), and prepareIntervallicUI().
Referenced by generateCode().


|
protected |
retrieve the type annotation of sig
| sig | the signal we want to know the type |
Definition at line 1067 of file doc_compile.cpp.
References CTree::arity(), CTree::branch(), CS(), fLateq, generateCacheCode(), xtended::generateLateq(), getCertifiedSigType(), getUserData(), and xtended::needCache().
Referenced by generateCode().


|
protected |
Test if a signal is already compiled.
| sig | the signal expression to compile. |
| name | the string representing the compiled expression. |
Definition at line 141 of file doc_compile.cpp.
References fCompileProperty, and property< P >::get().
Referenced by CS(), and generateCacheCode().


|
inline |
|
protected |
Definition at line 72 of file doc_compile.cpp.
References docT(), fIDCounters, and subst().
Referenced by compileLateq(), generateButton(), generateCheckbox(), generateHBargraph(), generateHSlider(), generateNumEntry(), generatePrefix(), generateSelect2(), generateSelect3(), generateVBargraph(), generateVSlider(), and getTypedNames().


|
inline |
|
protected |
Definition at line 66 of file doc_sharing.cpp.
References fSharingKey, Node::getInt(), getProperty(), and CTree::node().
Referenced by generateCacheCode(), and sharingAnnotation().


|
protected |
Definition at line 495 of file doc_compile.cpp.
References getFreshID(), ifloat(), kInt, and subst().
Referenced by generateCacheCode(), generateDocConstantTbl(), generateDocWriteTbl(), generateFConst(), generateFVar(), generateNumber(), generateRec(), and generateVariableStore().


|
protected |
Get the directory of a user interface element.
Convert the input reversed path tree into a string. The name of the UI is stripped (the head of the path tree), the rest of the tree is a list of pointed pairs, where the names are contained by the tail of these pointed pairs. Metadatas (begining by '[') are stripped.
| [in] | pathname | The path tree to convert. |
Definition at line 1244 of file doc_compile.cpp.
References hd(), isNil(), reverse(), tl(), and tree2str().
Referenced by generateButton(), generateCheckbox(), generateHSlider(), generateNumEntry(), and generateVSlider().


|
protected |
Get information on a user interface element for documentation.
| [in] | path | The UI full pathname to parse. |
| [out] | label | The place to store the UI name. |
| [out] | unit | The place to store the UI unit. |
Definition at line 1328 of file doc_compile.cpp.
References extractMetadata(), hd(), and tree2str().
Referenced by prepareBinaryUI(), and prepareIntervallicUI().


|
protected |
Get the vector name property of a signal, the name of the vector used to store the previous values of the signal to implement a delay.
| sig | the signal expression. |
| vecname | the string where to store the vector name. |
Definition at line 1117 of file doc_compile.cpp.
References fVectorProperty, and property< P >::get().
Referenced by generateAttach(), generateCacheCode(), generateDelayVecNoTemp(), generateFixDelay(), generatePrefix(), generateRecProj(), and generateVariableStore().


|
protected |
Definition at line 872 of file doc_compile.cpp.
References max().

|
protected |
Prepare binary user interface elements (button, checkbox).
| [in] | name | The LaTeX name of the UI signal (eg. "{u_b}_{i}(t)"). |
| [in] | path | The path tree to parse. |
Definition at line 1272 of file doc_compile.cpp.
References gDocMathStringMap, and getUIDocInfos().
Referenced by generateButton(), and generateCheckbox().


|
protected |
Prepare "intervallic" user interface elements (sliders, nentry).
| [in] | name | The LaTeX name of the UI signal (eg. "{u_s}_{i}(t)"). |
| [in] | path | The path tree to parse. |
| [in] | tcur | The current UI value tree to convert. |
| [in] | tmin | The minimum UI value tree to convert. |
| [in] | tmax | The maximum UI value tree to convert. |
Definition at line 1302 of file doc_compile.cpp.
References docT(), gDocMathStringMap, getUIDocInfos(), max(), min(), and tree2float().
Referenced by generateHSlider(), generateNumEntry(), and generateVSlider().


|
protected |
Print calling information of generateCode, for debug purposes.
Definition at line 254 of file doc_compile.cpp.
Referenced by generateCode().

|
protected |
Set the string of a compiled expression is already compiled.
| sig | the signal expression to compile. |
| cexp | the string representing the compiled expression. |
Definition at line 153 of file doc_compile.cpp.
References fCompileProperty, and property< P >::set().
Referenced by CS().


|
inline |
|
protected |
Definition at line 81 of file doc_sharing.cpp.
References fSharingKey, setProperty(), and tree().
Referenced by sharingAnnotation().


|
protected |
Set the vector name property of a signal, the name of the vector used to store the previous values of the signal to implement a delay.
| sig | the signal expression. |
| vecname | the string representing the vector name. |
Definition at line 1103 of file doc_compile.cpp.
References fVectorProperty, and property< P >::set().
Referenced by generateAttach(), generateDelayVecNoTemp(), generateFVar(), generateInput(), generateRec(), generateSelect2(), generateSelect3(), and generateVariableStore().


|
protected |
Definition at line 96 of file doc_sharing.cpp.
References fSharingKey, hd(), isList(), kSamp, sharingAnnotation(), shprkey(), and tl().
Referenced by annotate().


|
protected |
Definition at line 117 of file doc_sharing.cpp.
References getCertifiedSigType(), getSharingCount(), getSubSignals(), isSigGen(), and setSharingCount().
Referenced by sharingAnalysis().


|
protected |
Definition at line 52 of file doc_compile.hh.
Referenced by getCompiledExpression(), and setCompiledExpression().
|
protected |
Definition at line 56 of file doc_compile.hh.
Referenced by getDescription(), and setDescription().
|
staticprotected |
Definition at line 58 of file doc_compile.hh.
Referenced by getFreshID().
|
protected |
Definition at line 55 of file doc_compile.hh.
Referenced by compileLateq(), generateButton(), generateCheckbox(), generateDelayLine(), generateDelayVecNoTemp(), generateDocConstantTbl(), generateDocWriteTbl(), generateHSlider(), generateInput(), generateNumEntry(), generateOutput(), generatePrefix(), generateSelect2(), generateSelect3(), generateVariableStore(), generateVSlider(), generateXtended(), and getLateq().
|
protected |
Definition at line 60 of file doc_compile.hh.
Referenced by annotate(), generateCacheCode(), generateFConst(), generateFVar(), generateNumber(), and generateRec().
|
protected |
math priority context
Definition at line 61 of file doc_compile.hh.
|
protected |
Definition at line 59 of file doc_compile.hh.
Referenced by getSharingCount(), setSharingCount(), and sharingAnalysis().
|
protected |
Definition at line 53 of file doc_compile.hh.
Referenced by getVectorNameProperty(), and setVectorNameProperty().
1.8.7