97 vector<list<string> > internalSigsFormulasList;
111 docout <<
"\\begin{enumerate}" << endl << endl;
119 if( internalSigsCount > 0 ) {
120 docout << sInternals;
133 docout <<
"\\end{enumerate}" << endl << endl;
145 string item =
"\\item ";
157 string sigDomain =
"";
159 if (formulasList.size() > 0) {
160 string firstEq = *(formulasList.begin());
163 if(formulasList.size() > 1) {
166 if(signame ==
"x" || signame ==
"y") {
167 sigDomain =
" $" + signame +
"$";
169 sigDomain =
" $" + signame +
"_1$";
181 if (formulasList.size() > 0) {
191 if (formulasListsVector.size() > 0) {
192 vector<list<string> >::const_iterator it;
193 string signames =
"";
195 for (it = formulasListsVector.begin(); it != formulasListsVector.end(); ++it) {
197 (it != (formulasListsVector.end() - 2)) ? sep =
", " : sep =
" " +
gDocMathStringMap[
"and"] +
" ";
199 return signames +
" " + ending;
211 found = s.find(
" =");
212 if (found != string::npos) {
213 signame = s.substr (0, found);
215 found = s.find(
"(t)");
216 if (found != string::npos) {
217 signame = s.substr (0, found);
219 found = signame.find(
"[t]");
220 if (found != string::npos) {
221 signame = s.substr (0, found);
223 found = signame.find_last_of(
"_");
224 if (found != string::npos) {
225 signame = signame.substr (0, found);
234 map<char,unsigned int> uiTypesMap;
235 vector<list<string> > uiSignamesVector;
236 unsigned int vIndex = 0;
238 multimap<string,string>::const_iterator it;
240 for (it = field.begin(); it != field.end(); ++it) {
244 map<char,unsigned int>::iterator uiTypesIt;
245 uiTypesIt = uiTypesMap.find(type);
246 if( uiTypesIt != uiTypesMap.end()) {
247 uiSignamesVector[uiTypesMap[uiTypesIt->second]].push_back(signame);
250 uiTypesMap.insert(pair<char,unsigned int>(type, vIndex));
251 list<string>* tmpList =
new(list<string>);
252 tmpList->push_back(signame);
253 uiSignamesVector.push_back(*tmpList);
257 return uiSignamesVector;
266 found = s.find(
"${u_");
267 if (found != string::npos) {
268 signame = s.substr (found+1, 12);
280 found = s.find(
"${u_");
281 if (found != string::npos) {
282 sigtype = s.at (found+4);
304 docout << section << endl << endl;
321 if (field.size() > 0) {
322 docout << section << endl;
323 tab(1,docout); docout <<
"\\begin{dgroup*}" << endl;
324 list<string>::const_iterator s;
325 for (s = field.begin(); s != field.end(); ++s) {
326 tab(2,docout); docout <<
"\\begin{" <<
"dmath*" <<
"}" << endl;
327 tab(3,docout); docout <<
"\t" << *s << endl;
328 tab(2,docout); docout <<
"\\end{" <<
"dmath*" <<
"}" << endl;
330 tab(1,docout); docout <<
"\\end{dgroup*}" << endl;
361 if (field.size() > 0) {
362 docout << section << endl;
368 tab(0,docout); docout <<
"\\begin{itemize}" << endl;
374 multimap<string,string>::iterator it;
375 string uidir =
"improbable_starting_dirname";
376 bool startFlag =
true;
378 for (it = field.begin(); it != field.end(); ++it) {
380 if (it->first != uidir) {
382 tab(n+2,docout); docout <<
"\\end{supertabular}" << endl;
383 tab(n+1,docout); docout <<
"\\end{center}" << endl;
389 if (it->first !=
"") {
390 tab(n+0,docout); docout <<
"\\item \\textsf{" << it->first <<
"}" << endl;
395 tab(n+1,docout); docout <<
"\\begin{center}" << endl;
396 tab(n+2,docout); docout <<
"\\begin{supertabular}{lll}" << endl;
399 tab(n+3,docout); docout << it->second << endl;
402 tab(n+2,docout); docout <<
"\\end{supertabular}" << endl;
403 tab(n+1,docout); docout <<
"\\end{center}" << endl;
405 tab(n+0,docout); docout <<
"\\end{itemize}" << endl;
425 if (field.size() > 0) {
427 docout <<
"\\begin{displaymath}" << endl;
428 list<string>::iterator s;
429 for (s = field.begin(); s != field.end(); ++s) {
430 docout << *s << endl;
432 docout <<
"\\end{displaymath}" << endl;
441 while (n--) docout <<
'\t';
456 typedef multimap<string,string>::iterator MMIT;
457 pair<MMIT,MMIT> range;
458 range = mm.equal_range(
"");
459 bool hasOnlyEmptyPaths = (range.first == mm.begin()) && (range.second == mm.end());
460 return !hasOnlyEmptyPaths;
503 if (p1==string::npos) {
504 cerr <<
"Error : getLateqIndex found no \"{_\" substring.\n";
508 p2 = s.find(
"}", p1);
509 if (p2==string::npos) {
510 cerr <<
"Error : getLateqIndex found no \"}\" substring\n.";
514 sIndex = s.substr (p1, p2);
516 return atoi(sIndex.c_str());
list< string > fParamSigsFormulas
string makeSigDomain(const list< string > &formulasList)
void printMath(const string §ion, list< string > &field, ostream &docout)
Print formulas for select2, select3 and prefix signals.
list< string > fRWTblSigsFormulas
list< string > fInputSigsFormulas
LaTeX formulas to print.
multimap< string, string > fUISigsFormulas
void tab(int n, ostream &docout) const
Simple handling of indentation.
string makeSignamesList(const list< string > &formulasList, const string &ending)
string makeItemTitle(const unsigned int formulasListSize, const string &titleName)
static bool compLateqIndexes(const string &s1, const string &s2)
Compare indexes of two LaTeX strings, for the sort() method applied on list fields...
void printOneLine(const string §ion, ostream &docout)
Print a sorted list of input signals names ("x_i"), on a single line, separated by commas...
list< string > fStoreSigsFormulas
map< string, string > gDocMathStringMap
string getSigName(const string &s)
vector< list< string > > makeUISignamesVector(const multimap< string, string > &field)
bool hasNotOnlyEmptyKeys(multimap< string, string > &mm)
Find out whether all keys of the multimap are empty or not.
void printDGroup(const string §ion, list< string > &field, ostream &docout)
Print a dgroup environment to auto-break long formulas.
list< string > fRDTblSigsFormulas
static int getLateqIndex(const string &s)
Find out the index of signals in LaTeX signal definition strings, between the first "_{" and "}" patt...
void printHierarchy(const string §ion, multimap< string, string > &field, ostream &docout)
Print formulas for user interface signals.
void println(ostream &docout)
Top-level method to print a whole set of compiled LaTeX formulas.
std::string to_string(const T &t)
list< string > fConstSigsFormulas
string getUISigName(const string &s)
list< string > fRecurSigsFormulas
list< string > fPrefixSigsFormulas
void initDocMath()
Dispatch initialization of autodoc container.
list< string > fSelectSigsFormulas
char getUISigType(const string &s)
set< string > gDocMathKeySet
list< string > fOutputSigsFormulas
static void initDocMathKeySet()
Initialize gDocMathKeySet, a set containing all the keywords.