FAUST compiler  0.9.9.6b8
Functions
doc.hh File Reference
#include "tlib.hh"
#include "eval.hh"
Include dependency graph for doc.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

Tree docTxt (const char *)
Tree docEqn (Tree x)
Tree docDgm (Tree x)
Tree docNtc ()
Tree docLst ()
Tree docMtd (Tree x)
bool isDocTxt (Tree t)
bool isDocTxt (Tree t, const char **)
bool isDocEqn (Tree t, Tree &x)
bool isDocDgm (Tree t, Tree &x)
bool isDocNtc (Tree t)
bool isDocLst (Tree t)
bool isDocMtd (Tree t)
void printDoc (const char *projname, const char *docdev, const char *faustversion)
 The entry point to generate faust doc files.

Function Documentation

Tree docDgm ( Tree  x)

Definition at line 194 of file doc.cpp.

References DOCDGM, and tree().

Referenced by declareAutoDoc(), and yyparse().

{ return tree(DOCDGM, x);       }

Here is the call graph for this function:

Here is the caller graph for this function:

Tree docEqn ( Tree  x)

Definition at line 190 of file doc.cpp.

References DOCEQN, and tree().

Referenced by declareAutoDoc(), and yyparse().

{ return tree(DOCEQN, x);       }

Here is the call graph for this function:

Here is the caller graph for this function:

Tree docLst ( )

Definition at line 202 of file doc.cpp.

References DOCLST, and tree().

Referenced by declareAutoDoc(), and yyparse().

{ return tree(DOCLST);          }

Here is the call graph for this function:

Here is the caller graph for this function:

Tree docMtd ( Tree  x)

Definition at line 206 of file doc.cpp.

References DOCMTD, and tree().

Referenced by declareAutoDoc(), and yyparse().

{ return tree(DOCMTD, x);       }

Here is the call graph for this function:

Here is the caller graph for this function:

Tree docNtc ( )

Definition at line 198 of file doc.cpp.

References DOCNTC, and tree().

Referenced by declareAutoDoc(), and yyparse().

{ return tree(DOCNTC);          }

Here is the call graph for this function:

Here is the caller graph for this function:

Tree docTxt ( const char *  )

Definition at line 176 of file doc.cpp.

References DOCTXT, symbol(), and tree().

Referenced by declareAutoDoc(), and yyparse().

{ return tree( DOCTXT, tree(symbol(name)) ); }

Here is the call graph for this function:

Here is the caller graph for this function:

bool isDocDgm ( Tree  t,
Tree x 
)

Definition at line 195 of file doc.cpp.

References DOCDGM, and isTree().

Referenced by printdoccontent().

{ return isTree(t, DOCDGM, x);  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool isDocEqn ( Tree  t,
Tree x 
)

Definition at line 191 of file doc.cpp.

References DOCEQN, and isTree().

Referenced by collectDocEqns(), and printdoccontent().

{ return isTree(t, DOCEQN, x);  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool isDocLst ( Tree  t)

Definition at line 203 of file doc.cpp.

References DOCLST, and isTree().

Referenced by printdoccontent().

{ return isTree(t, DOCLST);     }

Here is the call graph for this function:

Here is the caller graph for this function:

bool isDocMtd ( Tree  t)
bool isDocNtc ( Tree  t)

Definition at line 199 of file doc.cpp.

References DOCNTC, and isTree().

Referenced by printdoccontent().

{ return isTree(t, DOCNTC);     }

Here is the call graph for this function:

Here is the caller graph for this function:

bool isDocTxt ( Tree  t)

Definition at line 177 of file doc.cpp.

References DOCTXT, and CTree::node().

Referenced by printdoccontent().

{ return t->node() == Node(DOCTXT); }

Here is the call graph for this function:

Here is the caller graph for this function:

bool isDocTxt ( Tree  t,
const char **   
)

Definition at line 178 of file doc.cpp.

References DOCTXT, isSym(), isTree(), name(), and CTree::node().

{
    Tree t1; Sym s;
    if ( isTree(t0, DOCTXT, t1) && isSym(t1->node(), &s) ) {
        *str = name(s);
        return true;
    } else {
        return false;
    }
}

Here is the call graph for this function:

void printDoc ( const char *  projname,
const char *  docdev,
const char *  faustversion 
)

The entry point to generate faust doc files.

The entry point to generate the output LaTeX file, stored in the directory "<projname>-math/". This file eventually references images for diagrams, generated in SVG subdirectories. The device system was adapted from drawSchema's device system.

Parameters:
[in]projnameBasename of the new doc directory ("*-math").
[in]docdevThe doc device; only ".tex" is supported for the moment.
[in]faustversionThe current version of this Faust compiler.

File stuff : create doc directories and a tex file.

Create THE mathdoc tex file.

Init and load translation file.

Simulate a default doc if no <mdoc> tag detected.

Printing stuff : in the '.tex' ouptut file, eventually including SVG files.

< Faust version and compilation date (comment).

< Static LaTeX header (packages and setup).

< Generate math contents (main stuff!).

< Static LaTeX footer.

Definition at line 229 of file doc.cpp.

References cholddir(), copyFaustSources(), declareAutoDoc(), gDocDevSuffix, gDocLang, gDocName, gDocVector, gLatexheaderfilename, gReader, SourceReader::listSrcFiles(), loadTranslationFile(), makedir(), mkchdir(), openArchFile(), printdoccontent(), printfaustdocstamp(), printlatexfooter(), printlatexheader(), and subst().

Referenced by main().

{
    gDocDevSuffix = docdev;
    
    //cerr << "Documentator : printDoc : gFaustDirectory = '" << gFaustDirectory << "'" << endl;
    //cerr << "Documentator : printDoc : gFaustSuperDirectory = '" << gFaustSuperDirectory << "'" << endl;
    //cerr << "Documentator : printDoc : gFaustSuperSuperDirectory = '" << gFaustSuperSuperDirectory << "'" << endl;
    //cerr << "Documentator : printDoc : gCurrentDir = '" << gCurrentDir << "'" << endl;
    
    makedir(projname);          // create a top directory to store files
    
    string svgTopDir = subst("$0/svg", projname);
    makedir(svgTopDir.c_str()); // create a directory to store svg-* subdirectories.
    
    string cppdir = subst("$0/cpp", projname);
    makedir(cppdir.c_str());    // create a cpp directory.
    
    string pdfdir = subst("$0/pdf", projname);
    makedir(pdfdir.c_str());    // create a pdf directory.
    
    /* Copy all Faust source files into an 'src' sub-directory. */
    vector<string> pathnames = gReader.listSrcFiles();
    copyFaustSources(projname, pathnames);
    
    string texdir = subst("$0/tex", projname);
    mkchdir(texdir.c_str());    // create a directory and move into.

    ofstream docout(subst("$0.$1", gDocName, docdev).c_str());
    cholddir();                 // return to current directory
    
    loadTranslationFile(gDocLang);
    
    if (gDocVector.empty()) { declareAutoDoc(); }   
    
    printfaustdocstamp(faustversion, docout);                       
    istream* latexheader = openArchFile(gLatexheaderfilename);
    printlatexheader(*latexheader, faustversion, docout);                       
    printdoccontent(svgTopDir.c_str(), gDocVector, faustversion, docout);       
    printlatexfooter(docout);                                       
}

Here is the call graph for this function:

Here is the caller graph for this function: