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.
static void initDocNoticeFlagMap ()
 Initialize gDocNoticeFlagMap, a map containing all the flags.
void printDocNotice (const string &faustversion, ostream &docout)
 Print the content of the notice (a string map), as LaTeX items inside an itemize environment.
void initDocNotice ()
 Dispatch initialization of notice containers, after default notice file loading.

Variables

map< string, bool > gDocNoticeFlagMap
 gDocNoticeFlagMap is public to let others turn to "true" flags that one want to print.
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().

00135 {
00136     initDocNoticeKeySet();
00137     initDocNoticeFlagMap();
00138 }

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().

00178                                    {
00179     
00180     for (set<string>::iterator it=gDocNoticeKeySet.begin(); it != gDocNoticeKeySet.end() ; ++it ) {
00181         gDocNoticeFlagMap[*it] = false;
00182     }
00183     gDocNoticeFlagMap["faustpresentation"]  = true;
00184     gDocNoticeFlagMap["faustapply"]         = true;
00185     gDocNoticeFlagMap["faustdocdir"]        = true;
00186     gDocNoticeFlagMap["causality"]          = true;
00187     gDocNoticeFlagMap["blockdiagrams"]      = true;
00188 }

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().

00151                                   {
00152     
00153     gDocNoticeKeySet.insert("faustpresentation");
00154     gDocNoticeKeySet.insert("faustapply");
00155     gDocNoticeKeySet.insert("faustdocdir");
00156     gDocNoticeKeySet.insert("causality");
00157     gDocNoticeKeySet.insert("blockdiagrams");
00158     
00159     gDocNoticeKeySet.insert("foreignfun");
00160     gDocNoticeKeySet.insert("intcast");
00161     
00162     gDocNoticeKeySet.insert("operators");
00163     gDocNoticeKeySet.insert("optabtitle");
00164     gDocNoticeKeySet.insert("integerops");
00165     gDocNoticeKeySet.insert("intplus");
00166     gDocNoticeKeySet.insert("intminus");
00167     gDocNoticeKeySet.insert("intmult");
00168     gDocNoticeKeySet.insert("intdiv");
00169     gDocNoticeKeySet.insert("intand");
00170     gDocNoticeKeySet.insert("intor");
00171     gDocNoticeKeySet.insert("intxor");
00172 }

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] notice The set containing the strings to print as items.
[in] faustversion The current version of this Faust compiler.
[out] docout The LaTeX output file to print into.

Definition at line 66 of file doc_notice.cpp.

References gDocAutodocStringMap, gDocNoticeFlagMap, and gDocNoticeStringMap.

Referenced by printdoccontent().

00066                                                                  {
00067     
00068     if (! gDocNoticeStringMap.empty() ) {
00069         
00070         //cerr << "Documentator : printDocNotice : printing..." << endl;
00071         
00072         docout << endl << "\\begin{itemize}" << endl;
00073         
00074         /* Presentations. */
00075         docout << "\t\\item " << gDocAutodocStringMap["autontctext"]    << endl;
00076         if(gDocNoticeFlagMap["faustapply"])         docout << "\t\\item " << gDocNoticeStringMap["faustapply"]  << endl;
00077         if(gDocNoticeFlagMap["faustpresentation"])  docout << "\t\\item " << gDocNoticeStringMap["faustpresentation"]   << endl;
00078         if(gDocNoticeFlagMap["causality"])          docout << "\t\\item " << gDocNoticeStringMap["causality"]   << endl;
00079         if(gDocNoticeFlagMap["blockdiagrams"])      docout << "\t\\item " << gDocNoticeStringMap["blockdiagrams"]   << endl;
00080         
00081         /* Naming conventions of variables and functions. */
00082         if(gDocNoticeFlagMap["foreignfun"])     docout << "\t\\item " << gDocNoticeStringMap["foreignfun"]  << endl;
00083         if(gDocNoticeFlagMap["intcast"])        docout << "\t\\item " << gDocNoticeStringMap["intcast"] << endl;
00084         
00085         /* Integer arithmetic into a tabular environment. */
00086         if(gDocNoticeFlagMap["intplus"] || 
00087            gDocNoticeFlagMap["intminus"] || 
00088            gDocNoticeFlagMap["intmult"] || 
00089            gDocNoticeFlagMap["intdiv"] || 
00090            gDocNoticeFlagMap["intand"] || 
00091            gDocNoticeFlagMap["intor"] || 
00092            gDocNoticeFlagMap["intxor"])
00093         {
00094             gDocNoticeFlagMap["operators"]      = true;
00095             gDocNoticeFlagMap["optabtitle"]     = true;
00096             gDocNoticeFlagMap["integerops"]     = true;
00097             
00098             docout << "\t\\item " << endl;
00099             docout << "\t\t" << gDocNoticeStringMap["operators"] << endl;
00100             docout << "\t\\begin{center}" << endl;
00101             docout << "\t\\begin{tabular}{|c|l|l|} " << endl;
00102             docout << "\t\t\\hline " << endl;
00103             docout << "\t\t" << gDocNoticeStringMap["optabtitle"]   << endl;
00104             docout << "\t\t\\hline " << endl;
00105             if(gDocNoticeFlagMap["intplus"])    docout << "\t\t" << gDocNoticeStringMap["intplus"]  << endl;
00106             if(gDocNoticeFlagMap["intminus"])   docout << "\t\t" << gDocNoticeStringMap["intminus"] << endl;
00107             if(gDocNoticeFlagMap["intmult"])    docout << "\t\t" << gDocNoticeStringMap["intmult"]  << endl;
00108             if(gDocNoticeFlagMap["intdiv"])     docout << "\t\t" << gDocNoticeStringMap["intdiv"]   << endl;
00109             if(gDocNoticeFlagMap["intand"])     docout << "\t\t" << gDocNoticeStringMap["intand"]   << endl;
00110             if(gDocNoticeFlagMap["intor"])      docout << "\t\t" << gDocNoticeStringMap["intor"]    << endl;
00111             if(gDocNoticeFlagMap["intxor"])     docout << "\t\t" << gDocNoticeStringMap["intxor"]   << endl;
00112             docout << "\t\t\\hline " << endl;
00113             docout << "\t\\end{tabular} " << endl;
00114             docout << "\t\\end{center}" << endl;
00115             docout << "\t\t" << gDocNoticeStringMap["integerops"]   << endl;
00116         }
00117 
00118         if(gDocNoticeFlagMap["faustdocdir"])        docout << "\t\\item " << gDocNoticeStringMap["faustdocdir"] << endl;
00119 
00120         docout << "\\end{itemize}" << endl << endl;
00121     }
00122     //cerr << "  ... Documentator : printDocNotice : end of printing." << endl;
00123 }

Here is the caller graph for this function:


Variable Documentation

map<string, string> gDocAutodocStringMap
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.

Generated on Thu Jul 15 15:46:59 2010 for FAUST compiler by  doxygen 1.6.3