FAUST compiler  0.9.9.6b8
Functions | Variables
doc_notice.cpp File Reference
#include <iostream>
#include <fstream>
#include <set>
#include <time.h>
#include <cstdlib>
#include <errno.h>
#include "doc_notice.hh"
#include "doc_lang.hh"
#include "enrobage.hh"
#include "compatibility.hh"
Include dependency graph for doc_notice.cpp:

Go to the source code of this file.

Functions

static void initDocNoticeKeySet ()
 Initialize gDocNoticeKeySet, a set containing all the keywords. More...
 
static void initDocNoticeFlagMap ()
 Initialize gDocNoticeFlagMap, a map containing all the flags. More...
 
void printDocNotice (const string &faustversion, ostream &docout)
 Print the content of the notice (a string map), as LaTeX items inside an itemize environment. More...
 
void initDocNotice ()
 Dispatch initialization of notice containers, after default notice file loading. More...
 

Variables

map< string, bool > gDocNoticeFlagMap
 gDocNoticeFlagMap is public to let others turn to "true" flags that one want to print. More...
 
map< string, string > gDocNoticeStringMap
 
set< string > gDocNoticeKeySet
 
map< string, string > gDocAutodocStringMap
 
string gMasterName
 

Function Documentation

void initDocNotice ( )

Dispatch initialization of notice containers, after default notice file loading.

Remarks
The default (english) notice is already loaded at this stage to ensure that all keywords will receive a definition.

Definition at line 134 of file doc_notice.cpp.

References initDocNoticeFlagMap(), and initDocNoticeKeySet().

Referenced by loadTranslationFile().

135 {
138 }
static void initDocNoticeFlagMap()
Initialize gDocNoticeFlagMap, a map containing all the flags.
Definition: doc_notice.cpp:178
static void initDocNoticeKeySet()
Initialize gDocNoticeKeySet, a set containing all the keywords.
Definition: doc_notice.cpp:151

Here is the call graph for this function:

Here is the caller graph for this function:

static void initDocNoticeFlagMap ( )
static

Initialize gDocNoticeFlagMap, a map containing all the flags.

Definition at line 178 of file doc_notice.cpp.

References gDocNoticeFlagMap, and gDocNoticeKeySet.

Referenced by initDocNotice().

178  {
179 
180  for (set<string>::iterator it=gDocNoticeKeySet.begin(); it != gDocNoticeKeySet.end() ; ++it ) {
181  gDocNoticeFlagMap[*it] = false;
182  }
183  gDocNoticeFlagMap["faustpresentation"] = true;
184  gDocNoticeFlagMap["faustapply"] = true;
185  gDocNoticeFlagMap["faustdocdir"] = true;
186  gDocNoticeFlagMap["causality"] = true;
187  gDocNoticeFlagMap["blockdiagrams"] = true;
188 }
map< string, bool > gDocNoticeFlagMap
gDocNoticeFlagMap is public to let others turn to "true" flags that one want to print.
Definition: doc_notice.cpp:36
set< string > gDocNoticeKeySet
Definition: doc_notice.cpp:39

Here is the caller graph for this function:

static void initDocNoticeKeySet ( )
static

Initialize gDocNoticeKeySet, a set containing all the keywords.

Definition at line 151 of file doc_notice.cpp.

References gDocNoticeKeySet.

Referenced by initDocNotice().

151  {
152 
153  gDocNoticeKeySet.insert("faustpresentation");
154  gDocNoticeKeySet.insert("faustapply");
155  gDocNoticeKeySet.insert("faustdocdir");
156  gDocNoticeKeySet.insert("causality");
157  gDocNoticeKeySet.insert("blockdiagrams");
158 
159  gDocNoticeKeySet.insert("foreignfun");
160  gDocNoticeKeySet.insert("intcast");
161 
162  gDocNoticeKeySet.insert("operators");
163  gDocNoticeKeySet.insert("optabtitle");
164  gDocNoticeKeySet.insert("integerops");
165  gDocNoticeKeySet.insert("intplus");
166  gDocNoticeKeySet.insert("intminus");
167  gDocNoticeKeySet.insert("intmult");
168  gDocNoticeKeySet.insert("intdiv");
169  gDocNoticeKeySet.insert("intand");
170  gDocNoticeKeySet.insert("intor");
171  gDocNoticeKeySet.insert("intxor");
172 }
set< string > gDocNoticeKeySet
Definition: doc_notice.cpp:39

Here is the caller graph for this function:

void printDocNotice ( const string &  faustversion,
ostream &  docout 
)

Print the content of the notice (a string map), as LaTeX items inside an itemize environment.

Remarks
This function is meant to make it easier to reorder the notice printing by gathering all the items.
Parameters
[in]noticeThe set containing the strings to print as items.
[in]faustversionThe current version of this Faust compiler.
[out]docoutThe LaTeX output file to print into.

Definition at line 66 of file doc_notice.cpp.

References gDocAutodocStringMap, gDocNoticeFlagMap, and gDocNoticeStringMap.

Referenced by printdoccontent().

66  {
67 
68  if (! gDocNoticeStringMap.empty() ) {
69 
70  //cerr << "Documentator : printDocNotice : printing..." << endl;
71 
72  docout << endl << "\\begin{itemize}" << endl;
73 
74  /* Presentations. */
75  docout << "\t\\item " << gDocAutodocStringMap["autontctext"] << endl;
76  if(gDocNoticeFlagMap["faustapply"]) docout << "\t\\item " << gDocNoticeStringMap["faustapply"] << endl;
77  if(gDocNoticeFlagMap["faustpresentation"]) docout << "\t\\item " << gDocNoticeStringMap["faustpresentation"] << endl;
78  if(gDocNoticeFlagMap["causality"]) docout << "\t\\item " << gDocNoticeStringMap["causality"] << endl;
79  if(gDocNoticeFlagMap["blockdiagrams"]) docout << "\t\\item " << gDocNoticeStringMap["blockdiagrams"] << endl;
80 
81  /* Naming conventions of variables and functions. */
82  if(gDocNoticeFlagMap["foreignfun"]) docout << "\t\\item " << gDocNoticeStringMap["foreignfun"] << endl;
83  if(gDocNoticeFlagMap["intcast"]) docout << "\t\\item " << gDocNoticeStringMap["intcast"] << endl;
84 
85  /* Integer arithmetic into a tabular environment. */
86  if(gDocNoticeFlagMap["intplus"] ||
87  gDocNoticeFlagMap["intminus"] ||
88  gDocNoticeFlagMap["intmult"] ||
89  gDocNoticeFlagMap["intdiv"] ||
90  gDocNoticeFlagMap["intand"] ||
91  gDocNoticeFlagMap["intor"] ||
92  gDocNoticeFlagMap["intxor"])
93  {
94  gDocNoticeFlagMap["operators"] = true;
95  gDocNoticeFlagMap["optabtitle"] = true;
96  gDocNoticeFlagMap["integerops"] = true;
97 
98  docout << "\t\\item " << endl;
99  docout << "\t\t" << gDocNoticeStringMap["operators"] << endl;
100  docout << "\t\\begin{center}" << endl;
101  docout << "\t\\begin{tabular}{|c|l|l|} " << endl;
102  docout << "\t\t\\hline " << endl;
103  docout << "\t\t" << gDocNoticeStringMap["optabtitle"] << endl;
104  docout << "\t\t\\hline " << endl;
105  if(gDocNoticeFlagMap["intplus"]) docout << "\t\t" << gDocNoticeStringMap["intplus"] << endl;
106  if(gDocNoticeFlagMap["intminus"]) docout << "\t\t" << gDocNoticeStringMap["intminus"] << endl;
107  if(gDocNoticeFlagMap["intmult"]) docout << "\t\t" << gDocNoticeStringMap["intmult"] << endl;
108  if(gDocNoticeFlagMap["intdiv"]) docout << "\t\t" << gDocNoticeStringMap["intdiv"] << endl;
109  if(gDocNoticeFlagMap["intand"]) docout << "\t\t" << gDocNoticeStringMap["intand"] << endl;
110  if(gDocNoticeFlagMap["intor"]) docout << "\t\t" << gDocNoticeStringMap["intor"] << endl;
111  if(gDocNoticeFlagMap["intxor"]) docout << "\t\t" << gDocNoticeStringMap["intxor"] << endl;
112  docout << "\t\t\\hline " << endl;
113  docout << "\t\\end{tabular} " << endl;
114  docout << "\t\\end{center}" << endl;
115  docout << "\t\t" << gDocNoticeStringMap["integerops"] << endl;
116  }
117 
118  if(gDocNoticeFlagMap["faustdocdir"]) docout << "\t\\item " << gDocNoticeStringMap["faustdocdir"] << endl;
119 
120  docout << "\\end{itemize}" << endl << endl;
121  }
122  //cerr << " ... Documentator : printDocNotice : end of printing." << endl;
123 }
map< string, string > gDocNoticeStringMap
Definition: doc_notice.cpp:38
map< string, bool > gDocNoticeFlagMap
gDocNoticeFlagMap is public to let others turn to "true" flags that one want to print.
Definition: doc_notice.cpp:36
map< string, string > gDocAutodocStringMap
Definition: doc_autodoc.cpp:40

Here is the caller graph for this function:

Variable Documentation

map<string, string> gDocAutodocStringMap

Definition at line 40 of file doc_autodoc.cpp.

Referenced by declareAutoDoc(), printDocAutodocStringMapContent(), and printDocNotice().

map<string, bool> gDocNoticeFlagMap
set<string> gDocNoticeKeySet

Definition at line 39 of file doc_notice.cpp.

Referenced by initDocNoticeFlagMap(), initDocNoticeKeySet(), and storePair().

map<string, string> gDocNoticeStringMap

Definition at line 38 of file doc_notice.cpp.

Referenced by importDocStrings(), printDocNotice(), and storePair().

string gMasterName

Definition at line 106 of file main.cpp.