FAUST compiler  0.9.9.6b8
lateq.hh
Go to the documentation of this file.
00001 /************************************************************************
00002  ************************************************************************
00003     FAUST compiler
00004     Copyright (C) 2003-2004 GRAME, Centre National de Creation Musicale
00005     ---------------------------------------------------------------------
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  ************************************************************************
00020  ************************************************************************/
00021 
00022 
00023 
00024 #ifndef _LATEQ_H
00025 #define _LATEQ_H
00026 
00027 /**********************************************************************
00028         - lateq.hh : the Lateq class definition (FAUST project) -
00029         - for automatic generation of documentation -
00030         - "lateq" stands for "LaTeX equations" -
00031         - Several containers store LaTeX formulas by type of signals -
00032         - Formulas usually are signal definitions, 
00033             except for input signals (only names). -
00034 
00035 
00036         Historique :
00037         -----------
00038         17-10-2001 : (klass.hh) implementation initiale (yo)
00039         18-10-2001 : (klass.hh) Ajout de getFreshID (yo)
00040         02-11-2001 : (klass.hh) Ajout de sous classes (yo)
00041         16-08-2009 : (lateq.hh) Création de lateq depuis klass.hh (kb)
00042         08-09-2009 : (lateq.hh) Grand nettoyage par le vide (yo & kb)
00043         23-09-2009 : (lateq.hh) Poursuite du nettoyage (kb)
00044         2009-11-23 : (lateq.hh) End of cleaning (kb)
00045 
00046 ***********************************************************************/
00047 
00048 using namespace std;
00049 
00050 #include <string>
00051 #include <list>
00052 #include <vector>
00053 #include <map>
00054 
00055 
00056 class Lateq {
00057     
00058 public:
00059     
00060     Lateq (const int& numInputs, const int& numOutputs)
00061     :   fNumInputs(numInputs), fNumOutputs(numOutputs)
00062     {}
00063     
00064     ~Lateq() {}
00065     
00067     void addInputSigFormula (const string& str)     { fInputSigsFormulas.push_back(str); }
00068     void addConstSigFormula (const string& str)     { fConstSigsFormulas.push_back(str); }
00069     void addParamSigFormula (const string& str)     { fParamSigsFormulas.push_back(str); }
00070     void addStoreSigFormula (const string& str)     { fStoreSigsFormulas.push_back(str); }
00071     void addRecurSigFormula (const string& str)     { fRecurSigsFormulas.push_back(str); }
00072     void addRDTblSigFormula (const string& str)     { fRDTblSigsFormulas.push_back(str); }
00073     void addRWTblSigFormula (const string& str)     { fRWTblSigsFormulas.push_back(str); }
00074     void addSelectSigFormula (const string& str)    { fSelectSigsFormulas.push_back(str); }
00075     void addPrefixSigFormula (const string& str)    { fPrefixSigsFormulas.push_back(str); }
00076     void addOutputSigFormula (const string& str)    { fOutputSigsFormulas.push_back(str); }
00077     void addUISigFormula (const string& path, const string& str)    { fUISigsFormulas.insert(make_pair(path, str)); };
00078     
00080     void println(ostream& docout);
00081     
00082     int inputs()  const     { return fNumInputs; }
00083     int outputs() const     { return fNumOutputs; }
00084     
00085     
00086 private:
00087     
00088     const int   fNumInputs;
00089     const int   fNumOutputs;
00090     
00092     list<string>            fInputSigsFormulas;
00093     list<string>            fConstSigsFormulas;
00094     list<string>            fParamSigsFormulas;
00095     list<string>            fStoreSigsFormulas;
00096     list<string>            fRecurSigsFormulas;
00097     list<string>            fRDTblSigsFormulas;
00098     list<string>            fRWTblSigsFormulas;
00099     list<string>            fSelectSigsFormulas;
00100     list<string>            fPrefixSigsFormulas;
00101     list<string>            fOutputSigsFormulas;
00102     multimap<string,string> fUISigsFormulas;
00103     
00104     string makeItemTitle(const unsigned int formulasListSize, const string& titleName);
00105     string makeSignamesList(const list<string>& formulasList, const string& ending);
00106     string makeSignamesList(const vector<list<string> >& formulasListsVector, const string& ending); 
00107     string getSigName(const string& s);
00108     string makeSigDomain(const list<string>& formulasList);
00109     string getUISigName(const string& s);
00110     char   getUISigType(const string& s);
00111     vector<list<string> > makeUISignamesVector(const multimap<string,string>& field);
00112     
00113     void printOneLine   (const string& section, ostream& docout);
00114     void printHierarchy     (const string& section, multimap<string,string>& field, ostream& docout);
00115     void printDGroup        (const string& section, list<string>& field, ostream& docout);
00116     void printMath      (const string& section, list<string>& field, ostream& docout);
00117     
00118     bool hasNotOnlyEmptyKeys(multimap<string,string>& mm);
00119     void tab(int n, ostream& docout) const;
00120 };
00121 
00122 void initDocMath();
00123 
00124 
00125 #endif