FAUST compiler  0.9.9.6b8
lateq.hh
Go to the documentation of this file.
1 /************************************************************************
2  ************************************************************************
3  FAUST compiler
4  Copyright (C) 2003-2004 GRAME, Centre National de Creation Musicale
5  ---------------------------------------------------------------------
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  ************************************************************************
20  ************************************************************************/
21 
22 
23 
24 #ifndef _LATEQ_H
25 #define _LATEQ_H
26 
27 /**********************************************************************
28  - lateq.hh : the Lateq class definition (FAUST project) -
29  - for automatic generation of documentation -
30  - "lateq" stands for "LaTeX equations" -
31  - Several containers store LaTeX formulas by type of signals -
32  - Formulas usually are signal definitions,
33  except for input signals (only names). -
34 
35 
36  Historique :
37  -----------
38  17-10-2001 : (klass.hh) implementation initiale (yo)
39  18-10-2001 : (klass.hh) Ajout de getFreshID (yo)
40  02-11-2001 : (klass.hh) Ajout de sous classes (yo)
41  16-08-2009 : (lateq.hh) Création de lateq depuis klass.hh (kb)
42  08-09-2009 : (lateq.hh) Grand nettoyage par le vide (yo & kb)
43  23-09-2009 : (lateq.hh) Poursuite du nettoyage (kb)
44  2009-11-23 : (lateq.hh) End of cleaning (kb)
45 
46 ***********************************************************************/
47 
48 using namespace std;
49 
50 #include <string>
51 #include <list>
52 #include <vector>
53 #include <map>
54 
55 
56 class Lateq {
57 
58 public:
59 
60  Lateq (const int& numInputs, const int& numOutputs)
61  : fNumInputs(numInputs), fNumOutputs(numOutputs)
62  {}
63 
64  ~Lateq() {}
65 
67  void addInputSigFormula (const string& str) { fInputSigsFormulas.push_back(str); }
68  void addConstSigFormula (const string& str) { fConstSigsFormulas.push_back(str); }
69  void addParamSigFormula (const string& str) { fParamSigsFormulas.push_back(str); }
70  void addStoreSigFormula (const string& str) { fStoreSigsFormulas.push_back(str); }
71  void addRecurSigFormula (const string& str) { fRecurSigsFormulas.push_back(str); }
72  void addRDTblSigFormula (const string& str) { fRDTblSigsFormulas.push_back(str); }
73  void addRWTblSigFormula (const string& str) { fRWTblSigsFormulas.push_back(str); }
74  void addSelectSigFormula (const string& str) { fSelectSigsFormulas.push_back(str); }
75  void addPrefixSigFormula (const string& str) { fPrefixSigsFormulas.push_back(str); }
76  void addOutputSigFormula (const string& str) { fOutputSigsFormulas.push_back(str); }
77  void addUISigFormula (const string& path, const string& str) { fUISigsFormulas.insert(make_pair(path, str)); };
78 
80  void println(ostream& docout);
81 
82  int inputs() const { return fNumInputs; }
83  int outputs() const { return fNumOutputs; }
84 
85 
86 private:
87 
88  const int fNumInputs;
89  const int fNumOutputs;
90 
92  list<string> fInputSigsFormulas;
93  list<string> fConstSigsFormulas;
94  list<string> fParamSigsFormulas;
95  list<string> fStoreSigsFormulas;
96  list<string> fRecurSigsFormulas;
97  list<string> fRDTblSigsFormulas;
98  list<string> fRWTblSigsFormulas;
99  list<string> fSelectSigsFormulas;
100  list<string> fPrefixSigsFormulas;
101  list<string> fOutputSigsFormulas;
102  multimap<string,string> fUISigsFormulas;
103 
104  string makeItemTitle(const unsigned int formulasListSize, const string& titleName);
105  string makeSignamesList(const list<string>& formulasList, const string& ending);
106  string makeSignamesList(const vector<list<string> >& formulasListsVector, const string& ending);
107  string getSigName(const string& s);
108  string makeSigDomain(const list<string>& formulasList);
109  string getUISigName(const string& s);
110  char getUISigType(const string& s);
111  vector<list<string> > makeUISignamesVector(const multimap<string,string>& field);
112 
113  void printOneLine (const string& section, ostream& docout);
114  void printHierarchy (const string& section, multimap<string,string>& field, ostream& docout);
115  void printDGroup (const string& section, list<string>& field, ostream& docout);
116  void printMath (const string& section, list<string>& field, ostream& docout);
117 
118  bool hasNotOnlyEmptyKeys(multimap<string,string>& mm);
119  void tab(int n, ostream& docout) const;
120 };
121 
122 void initDocMath();
123 
124 
125 #endif
list< string > fParamSigsFormulas
Definition: lateq.hh:94
list< string > fRWTblSigsFormulas
Definition: lateq.hh:98
~Lateq()
Definition: lateq.hh:64
void tab(int n, ostream &fout)
Definition: klass.cpp:68
list< string > fInputSigsFormulas
LaTeX formulas to print.
Definition: lateq.hh:92
const int fNumOutputs
Definition: lateq.hh:89
void addPrefixSigFormula(const string &str)
Definition: lateq.hh:75
void addRWTblSigFormula(const string &str)
Definition: lateq.hh:73
multimap< string, string > fUISigsFormulas
Definition: lateq.hh:102
void addUISigFormula(const string &path, const string &str)
Definition: lateq.hh:77
void addConstSigFormula(const string &str)
Definition: lateq.hh:68
Definition: lateq.hh:56
list< string > fStoreSigsFormulas
Definition: lateq.hh:95
const int fNumInputs
Definition: lateq.hh:88
void addStoreSigFormula(const string &str)
Definition: lateq.hh:70
void initDocMath()
Dispatch initialization of autodoc container.
Definition: lateq.cpp:468
void addRecurSigFormula(const string &str)
Definition: lateq.hh:71
int outputs() const
Definition: lateq.hh:83
list< string > fRDTblSigsFormulas
Definition: lateq.hh:97
void addSelectSigFormula(const string &str)
Definition: lateq.hh:74
void addRDTblSigFormula(const string &str)
Definition: lateq.hh:72
void addOutputSigFormula(const string &str)
Definition: lateq.hh:76
list< string > fConstSigsFormulas
Definition: lateq.hh:93
void addInputSigFormula(const string &str)
Add a line of a latex equation code corresponding to a signal.
Definition: lateq.hh:67
int inputs() const
Definition: lateq.hh:82
list< string > fRecurSigsFormulas
Definition: lateq.hh:96
list< string > fPrefixSigsFormulas
Definition: lateq.hh:100
Lateq(const int &numInputs, const int &numOutputs)
Definition: lateq.hh:60
list< string > fSelectSigsFormulas
Definition: lateq.hh:99
void addParamSigFormula(const string &str)
Definition: lateq.hh:69
list< string > fOutputSigsFormulas
Definition: lateq.hh:101