X-Git-Url: https://scm.cri.ensmp.fr/git/Faustine.git/blobdiff_plain/c7f552fd8888da2f0d8cfb228fe0f28d3df3a12c..b4b6f2ea75b9f0f3ca918f5b84016610bf7a4d4f:/interpretor/preprocessor/faust-0.9.47mr3/compiler/documentator/lateq.hh diff --git a/interpretor/preprocessor/faust-0.9.47mr3/compiler/documentator/lateq.hh b/interpretor/preprocessor/faust-0.9.47mr3/compiler/documentator/lateq.hh new file mode 100644 index 0000000..3fc80f7 --- /dev/null +++ b/interpretor/preprocessor/faust-0.9.47mr3/compiler/documentator/lateq.hh @@ -0,0 +1,125 @@ +/************************************************************************ + ************************************************************************ + FAUST compiler + Copyright (C) 2003-2004 GRAME, Centre National de Creation Musicale + --------------------------------------------------------------------- + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ************************************************************************ + ************************************************************************/ + + + +#ifndef _LATEQ_H +#define _LATEQ_H + +/********************************************************************** + - lateq.hh : the Lateq class definition (FAUST project) - + - for automatic generation of documentation - + - "lateq" stands for "LaTeX equations" - + - Several containers store LaTeX formulas by type of signals - + - Formulas usually are signal definitions, + except for input signals (only names). - + + + Historique : + ----------- + 17-10-2001 : (klass.hh) implementation initiale (yo) + 18-10-2001 : (klass.hh) Ajout de getFreshID (yo) + 02-11-2001 : (klass.hh) Ajout de sous classes (yo) + 16-08-2009 : (lateq.hh) Création de lateq depuis klass.hh (kb) + 08-09-2009 : (lateq.hh) Grand nettoyage par le vide (yo & kb) + 23-09-2009 : (lateq.hh) Poursuite du nettoyage (kb) + 2009-11-23 : (lateq.hh) End of cleaning (kb) + +***********************************************************************/ + +using namespace std; + +#include +#include +#include +#include + + +class Lateq { + +public: + + Lateq (const int& numInputs, const int& numOutputs) + : fNumInputs(numInputs), fNumOutputs(numOutputs) + {} + + ~Lateq() {} + + /** Add a line of a latex equation code corresponding to a signal. */ + void addInputSigFormula (const string& str) { fInputSigsFormulas.push_back(str); } + void addConstSigFormula (const string& str) { fConstSigsFormulas.push_back(str); } + void addParamSigFormula (const string& str) { fParamSigsFormulas.push_back(str); } + void addStoreSigFormula (const string& str) { fStoreSigsFormulas.push_back(str); } + void addRecurSigFormula (const string& str) { fRecurSigsFormulas.push_back(str); } + void addRDTblSigFormula (const string& str) { fRDTblSigsFormulas.push_back(str); } + void addRWTblSigFormula (const string& str) { fRWTblSigsFormulas.push_back(str); } + void addSelectSigFormula (const string& str) { fSelectSigsFormulas.push_back(str); } + void addPrefixSigFormula (const string& str) { fPrefixSigsFormulas.push_back(str); } + void addOutputSigFormula (const string& str) { fOutputSigsFormulas.push_back(str); } + void addUISigFormula (const string& path, const string& str) { fUISigsFormulas.insert(make_pair(path, str)); }; + + /** Top-level method to print a whole set of compiled LaTeX formulas. */ + void println(ostream& docout); + + int inputs() const { return fNumInputs; } + int outputs() const { return fNumOutputs; } + + +private: + + const int fNumInputs; + const int fNumOutputs; + + /** LaTeX formulas to print. */ + list fInputSigsFormulas; + list fConstSigsFormulas; + list fParamSigsFormulas; + list fStoreSigsFormulas; + list fRecurSigsFormulas; + list fRDTblSigsFormulas; + list fRWTblSigsFormulas; + list fSelectSigsFormulas; + list fPrefixSigsFormulas; + list fOutputSigsFormulas; + multimap fUISigsFormulas; + + string makeItemTitle(const unsigned int formulasListSize, const string& titleName); + string makeSignamesList(const list& formulasList, const string& ending); + string makeSignamesList(const vector >& formulasListsVector, const string& ending); ///< For all "internal" signals. + string getSigName(const string& s); + string makeSigDomain(const list& formulasList); + string getUISigName(const string& s); + char getUISigType(const string& s); + vector > makeUISignamesVector(const multimap& field); + + void printOneLine (const string& section, ostream& docout); + void printHierarchy (const string& section, multimap& field, ostream& docout); + void printDGroup (const string& section, list& field, ostream& docout); + void printMath (const string& section, list& field, ostream& docout); + + bool hasNotOnlyEmptyKeys(multimap& mm); + void tab(int n, ostream& docout) const; +}; + +void initDocMath(); + + +#endif