doc_autodoc.hh File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void initDocAutodoc ()
 Dispatch initialization of autodoc container.
void declareAutoDoc ()
 Declare an automatic documentation.

Function Documentation

void declareAutoDoc (  ) 

Declare an automatic documentation.

This function simulates a default documentation : if no <mdoc> tag was found in the input faust file, and yet the '-mdoc' option was called, then print a complete 'process' doc.

Autodoc's "head", with title, author, date, and metadatas.

The latex title macro is bound to the metadata "name" if it exists, (corresponding to "declare name") or else just to the file name.

The latex author macro is bound to the metadata "author" if it exists, (corresponding to "declare author") or else no author item is printed.

The latex date macro is bound to the metadata "date" if it exists, (corresponding to "declare date") or else to the today latex macro.

The latex maketitle macro.

Insert all declared metadatas in a latex tabular environment.

Autodoc's "body", with equation and diagram of process, and notice and listing.

Definition at line 61 of file doc_autodoc.cpp.

References boxIdent(), cons(), declareDoc(), docDgm(), docEqn(), docLst(), docMtd(), docNtc(), docTxt(), gDocAutodocStringMap, gDocMetadatasStringMap, gDocName, gMetaDataSet, SourceReader::listSrcFiles(), nil, tree(), and tree2str().

Referenced by printDoc().

00062 {
00063     Tree autodoc = nil;
00064     Tree process = boxIdent("process");
00065     
00070     autodoc = cons(docTxt("\\title{"), autodoc);
00071     if (gMetaDataSet.count(tree("name"))) {
00072         autodoc = cons(docMtd(tree("name")), autodoc);
00073     } else {
00074         autodoc = cons(docTxt(gDocName.c_str()), autodoc);
00075     }
00076     autodoc = cons(docTxt("}\n"), autodoc);
00077     
00080     if (gMetaDataSet.count(tree("author"))) {
00081         autodoc = cons(docTxt("\\author{"), autodoc);
00082         autodoc = cons(docMtd(tree("author")), autodoc);
00083         autodoc = cons(docTxt("}\n"), autodoc);
00084     }
00085     
00088     autodoc = cons(docTxt("\\date{"), autodoc);
00089     if (gMetaDataSet.count(tree("date"))) {
00090         autodoc = cons(docMtd(tree("date")), autodoc);
00091     } else {
00092         autodoc = cons(docTxt("\\today"), autodoc);
00093     }
00094     autodoc = cons(docTxt("}\n"), autodoc);
00095     
00097     autodoc = cons(docTxt("\\maketitle\n"), autodoc);
00098 
00099     
00101     if (! gMetaDataSet.empty()) {
00102         autodoc = cons(docTxt("\\begin{tabular}{ll}\n"), autodoc);
00103         autodoc = cons(docTxt("\t\\hline\n"), autodoc);
00104         for (map<Tree, set<Tree> >::iterator i = gMetaDataSet.begin(); i != gMetaDataSet.end(); i++) {
00105             string mtdkey = tree2str(i->first);
00106             string mtdTranslatedKey = gDocMetadatasStringMap[mtdkey];
00107             if (mtdTranslatedKey.empty()) {
00108                 mtdTranslatedKey = mtdkey;
00109             }
00110             autodoc = cons(docTxt("\t\\textbf{"), autodoc);
00111             autodoc = cons(docTxt(mtdTranslatedKey.c_str()), autodoc);
00112             autodoc = cons(docTxt("} & "), autodoc);
00113             autodoc = cons(docMtd(tree(mtdkey.c_str())), autodoc);
00114             autodoc = cons(docTxt(" \\\\\n"), autodoc);
00115         }
00116         autodoc = cons(docTxt("\t\\hline\n"), autodoc);
00117         autodoc = cons(docTxt("\\end{tabular}\n"), autodoc);
00118         autodoc = cons(docTxt("\\bigskip\n"), autodoc);
00119     }
00120 
00121 
00124     string autoPresentationTxt = "\n\\bigskip\n" + gDocAutodocStringMap["thisdoc"] + "\n\n";
00125     autodoc = cons(docTxt(autoPresentationTxt.c_str()), autodoc);
00126     
00127     string autoEquationTxt = "\n" + gDocAutodocStringMap["autoeqntitle"] + "\n\n";
00128     autoEquationTxt += gDocAutodocStringMap["autoeqntext"] + "\n";
00129     autodoc = cons(docTxt(autoEquationTxt.c_str()), autodoc);
00130     autodoc = cons(docEqn(process), autodoc);
00131     
00132     string autoDiagramTxt = "\n" + gDocAutodocStringMap["autodgmtitle"] + "\n\n";
00133     autoDiagramTxt += gDocAutodocStringMap["autodgmtext"] + "\n";
00134     autodoc = cons(docTxt(autoDiagramTxt.c_str()), autodoc);
00135     autodoc = cons(docDgm(process), autodoc);   
00136     
00137     string autoNoticeTxt = "\n" + gDocAutodocStringMap["autontctitle"] + "\n\n";
00138 //  autoNoticeTxt += gDocAutodocStringMap["autontctext"] + "\n";
00139     autodoc = cons(docTxt(autoNoticeTxt.c_str()), autodoc);
00140     autodoc = cons(docNtc(), autodoc);
00141     
00142     string autoListingTxt;
00143     vector<string> pathnames = gReader.listSrcFiles();
00144     if(pathnames.size() > 1) {
00145         autoListingTxt = "\n" + gDocAutodocStringMap["autolsttitle2"] + "\n\n";
00146         autoListingTxt += gDocAutodocStringMap["autolsttext2"] + "\n";
00147     } else {
00148         autoListingTxt = "\n" + gDocAutodocStringMap["autolsttitle1"] + "\n\n";
00149         autoListingTxt += gDocAutodocStringMap["autolsttext1"] + "\n";
00150     }
00151     autodoc = cons(docTxt(autoListingTxt.c_str()), autodoc);
00152     autodoc = cons(docLst(), autodoc);
00153     
00154     declareDoc(autodoc);
00155 }

Here is the call graph for this function:

Here is the caller graph for this function:

void initDocAutodoc (  ) 

Dispatch initialization of autodoc container.

Definition at line 161 of file doc_autodoc.cpp.

References initDocAutodocKeySet().

Referenced by loadTranslationFile().

00162 {
00163     initDocAutodocKeySet();
00164 }

Here is the call graph for this function:

Here is the caller graph for this function:

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