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

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

                                   {
    
    for (set<string>::iterator it=gDocNoticeKeySet.begin(); it != gDocNoticeKeySet.end() ; ++it ) {
        gDocNoticeFlagMap[*it] = false;
    }
    gDocNoticeFlagMap["faustpresentation"]  = true;
    gDocNoticeFlagMap["faustapply"]         = true;
    gDocNoticeFlagMap["faustdocdir"]        = true;
    gDocNoticeFlagMap["causality"]          = true;
    gDocNoticeFlagMap["blockdiagrams"]      = true;
}

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

                                  {
    
    gDocNoticeKeySet.insert("faustpresentation");
    gDocNoticeKeySet.insert("faustapply");
    gDocNoticeKeySet.insert("faustdocdir");
    gDocNoticeKeySet.insert("causality");
    gDocNoticeKeySet.insert("blockdiagrams");
    
    gDocNoticeKeySet.insert("foreignfun");
    gDocNoticeKeySet.insert("intcast");
    
    gDocNoticeKeySet.insert("operators");
    gDocNoticeKeySet.insert("optabtitle");
    gDocNoticeKeySet.insert("integerops");
    gDocNoticeKeySet.insert("intplus");
    gDocNoticeKeySet.insert("intminus");
    gDocNoticeKeySet.insert("intmult");
    gDocNoticeKeySet.insert("intdiv");
    gDocNoticeKeySet.insert("intand");
    gDocNoticeKeySet.insert("intor");
    gDocNoticeKeySet.insert("intxor");
}

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

                                                                 {
    
    if (! gDocNoticeStringMap.empty() ) {
        
        //cerr << "Documentator : printDocNotice : printing..." << endl;
        
        docout << endl << "\\begin{itemize}" << endl;
        
        /* Presentations. */
        docout << "\t\\item " << gDocAutodocStringMap["autontctext"]    << endl;
        if(gDocNoticeFlagMap["faustapply"])         docout << "\t\\item " << gDocNoticeStringMap["faustapply"]  << endl;
        if(gDocNoticeFlagMap["faustpresentation"])  docout << "\t\\item " << gDocNoticeStringMap["faustpresentation"]   << endl;
        if(gDocNoticeFlagMap["causality"])          docout << "\t\\item " << gDocNoticeStringMap["causality"]   << endl;
        if(gDocNoticeFlagMap["blockdiagrams"])      docout << "\t\\item " << gDocNoticeStringMap["blockdiagrams"]   << endl;
        
        /* Naming conventions of variables and functions. */
        if(gDocNoticeFlagMap["foreignfun"])     docout << "\t\\item " << gDocNoticeStringMap["foreignfun"]  << endl;
        if(gDocNoticeFlagMap["intcast"])        docout << "\t\\item " << gDocNoticeStringMap["intcast"] << endl;
        
        /* Integer arithmetic into a tabular environment. */
        if(gDocNoticeFlagMap["intplus"] || 
           gDocNoticeFlagMap["intminus"] || 
           gDocNoticeFlagMap["intmult"] || 
           gDocNoticeFlagMap["intdiv"] || 
           gDocNoticeFlagMap["intand"] || 
           gDocNoticeFlagMap["intor"] || 
           gDocNoticeFlagMap["intxor"])
        {
            gDocNoticeFlagMap["operators"]      = true;
            gDocNoticeFlagMap["optabtitle"]     = true;
            gDocNoticeFlagMap["integerops"]     = true;
            
            docout << "\t\\item " << endl;
            docout << "\t\t" << gDocNoticeStringMap["operators"] << endl;
            docout << "\t\\begin{center}" << endl;
            docout << "\t\\begin{tabular}{|c|l|l|} " << endl;
            docout << "\t\t\\hline " << endl;
            docout << "\t\t" << gDocNoticeStringMap["optabtitle"]   << endl;
            docout << "\t\t\\hline " << endl;
            if(gDocNoticeFlagMap["intplus"])    docout << "\t\t" << gDocNoticeStringMap["intplus"]  << endl;
            if(gDocNoticeFlagMap["intminus"])   docout << "\t\t" << gDocNoticeStringMap["intminus"] << endl;
            if(gDocNoticeFlagMap["intmult"])    docout << "\t\t" << gDocNoticeStringMap["intmult"]  << endl;
            if(gDocNoticeFlagMap["intdiv"])     docout << "\t\t" << gDocNoticeStringMap["intdiv"]   << endl;
            if(gDocNoticeFlagMap["intand"])     docout << "\t\t" << gDocNoticeStringMap["intand"]   << endl;
            if(gDocNoticeFlagMap["intor"])      docout << "\t\t" << gDocNoticeStringMap["intor"]    << endl;
            if(gDocNoticeFlagMap["intxor"])     docout << "\t\t" << gDocNoticeStringMap["intxor"]   << endl;
            docout << "\t\t\\hline " << endl;
            docout << "\t\\end{tabular} " << endl;
            docout << "\t\\end{center}" << endl;
            docout << "\t\t" << gDocNoticeStringMap["integerops"]   << endl;
        }

        if(gDocNoticeFlagMap["faustdocdir"])        docout << "\t\\item " << gDocNoticeStringMap["faustdocdir"] << endl;

        docout << "\\end{itemize}" << endl << endl;
    }
    //cerr << "  ... Documentator : printDocNotice : end of printing." << endl;
}

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.