Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > by-pkgid > aaf33964de706a538481c929c1da6a44 > files > 3263

faust-doc-0.9.10-5mdv2010.1.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>FAUST compiler: doc.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<h1>doc.cpp</h1><a href="doc_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/************************************************************************</span>
<a name="l00002"></a>00002 <span class="comment"> ************************************************************************</span>
<a name="l00003"></a>00003 <span class="comment"> FAUST compiler</span>
<a name="l00004"></a>00004 <span class="comment"> Copyright (C) 2009 GRAME, Centre National de Creation Musicale</span>
<a name="l00005"></a>00005 <span class="comment"> ---------------------------------------------------------------------</span>
<a name="l00006"></a>00006 <span class="comment"> This program is free software; you can redistribute it and/or modify</span>
<a name="l00007"></a>00007 <span class="comment"> it under the terms of the GNU General Public License as published by</span>
<a name="l00008"></a>00008 <span class="comment"> the Free Software Foundation; either version 2 of the License, or</span>
<a name="l00009"></a>00009 <span class="comment"> (at your option) any later version.</span>
<a name="l00010"></a>00010 <span class="comment"> </span>
<a name="l00011"></a>00011 <span class="comment"> This program is distributed in the hope that it will be useful,</span>
<a name="l00012"></a>00012 <span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00013"></a>00013 <span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00014"></a>00014 <span class="comment"> GNU General Public License for more details.</span>
<a name="l00015"></a>00015 <span class="comment"> </span>
<a name="l00016"></a>00016 <span class="comment"> You should have received a copy of the GNU General Public License</span>
<a name="l00017"></a>00017 <span class="comment"> along with this program; if not, write to the Free Software</span>
<a name="l00018"></a>00018 <span class="comment"> Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</span>
<a name="l00019"></a>00019 <span class="comment"> ************************************************************************</span>
<a name="l00020"></a>00020 <span class="comment"> ************************************************************************/</span>
<a name="l00021"></a>00021 
<a name="l00022"></a>00022 
<a name="l00023"></a>00023 
<a name="l00024"></a>00024 <span class="comment">/*****************************************************************************</span>
<a name="l00025"></a>00025 <span class="comment"> ******************************************************************************</span>
<a name="l00026"></a>00026 <span class="comment"> </span>
<a name="l00027"></a>00027 <span class="comment"> </span>
<a name="l00028"></a>00028 <span class="comment">                        The Documentator Language</span>
<a name="l00029"></a>00029 <span class="comment"> </span>
<a name="l00030"></a>00030 <span class="comment"> </span>
<a name="l00031"></a>00031 <span class="comment"> ******************************************************************************</span>
<a name="l00032"></a>00032 <span class="comment"> *****************************************************************************/</span>
<a name="l00033"></a>00033 
<a name="l00034"></a>00034 
<a name="l00043"></a>00043 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
<a name="l00044"></a>00044 <span class="preprocessor">#include &lt;string.h&gt;</span>
<a name="l00045"></a>00045 <span class="preprocessor">#include &lt;errno.h&gt;</span>
<a name="l00046"></a>00046 <span class="preprocessor">#include &lt;sys/stat.h&gt;</span>
<a name="l00047"></a>00047 <span class="preprocessor">#include &lt;time.h&gt;</span>
<a name="l00048"></a>00048 <span class="preprocessor">#include &lt;algorithm&gt;</span>
<a name="l00049"></a>00049 <span class="preprocessor">#include &lt;functional&gt;</span>
<a name="l00050"></a>00050 
<a name="l00051"></a>00051 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00052"></a>00052 <span class="preprocessor">#include &lt;fstream&gt;</span>
<a name="l00053"></a>00053 <span class="preprocessor">#include &lt;sstream&gt;</span>
<a name="l00054"></a>00054 
<a name="l00055"></a>00055 <span class="preprocessor">#include &lt;map&gt;</span>
<a name="l00056"></a>00056 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00057"></a>00057 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00058"></a>00058 
<a name="l00059"></a>00059 <span class="preprocessor">#include &quot;<a class="code" href="ppbox_8hh.html">ppbox.hh</a>&quot;</span>
<a name="l00060"></a>00060 <span class="preprocessor">#include &quot;<a class="code" href="prim2_8hh.html">prim2.hh</a>&quot;</span>
<a name="l00061"></a>00061 <span class="preprocessor">#include &quot;<a class="code" href="doc_8hh.html">doc.hh</a>&quot;</span>
<a name="l00062"></a>00062 <span class="preprocessor">#include &quot;<a class="code" href="eval_8hh.html" title="Interface of the block diagram evaluator.">eval.hh</a>&quot;</span>
<a name="l00063"></a>00063 <span class="preprocessor">#include &quot;<a class="code" href="errormsg_8hh.html">errormsg.hh</a>&quot;</span>
<a name="l00064"></a>00064 <span class="preprocessor">#include &quot;<a class="code" href="doc__Text_8hh.html">doc_Text.hh</a>&quot;</span>
<a name="l00065"></a>00065 <span class="preprocessor">#include &quot;<a class="code" href="sigprint_8hh.html">sigprint.hh</a>&quot;</span>
<a name="l00066"></a>00066 <span class="preprocessor">#include &quot;<a class="code" href="propagate_8hh.html">propagate.hh</a>&quot;</span>
<a name="l00067"></a>00067 <span class="preprocessor">#include &quot;<a class="code" href="enrobage_8hh.html">enrobage.hh</a>&quot;</span>
<a name="l00068"></a>00068 <span class="preprocessor">#include &quot;<a class="code" href="drawschema_8hh.html">drawschema.hh</a>&quot;</span>
<a name="l00069"></a>00069 <span class="preprocessor">#include &quot;<a class="code" href="names_8hh.html" title="Interface for names management.">names.hh</a>&quot;</span>
<a name="l00070"></a>00070 <span class="preprocessor">#include &quot;<a class="code" href="simplify_8hh.html">simplify.hh</a>&quot;</span>
<a name="l00071"></a>00071 <span class="preprocessor">#include &quot;<a class="code" href="privatise_8hh.html">privatise.hh</a>&quot;</span>
<a name="l00072"></a>00072 <span class="preprocessor">#include &quot;<a class="code" href="recursivness_8hh.html">recursivness.hh</a>&quot;</span>
<a name="l00073"></a>00073 <span class="preprocessor">#include &quot;<a class="code" href="sourcereader_8hh.html">sourcereader.hh</a>&quot;</span>
<a name="l00074"></a>00074 <span class="preprocessor">#include &quot;<a class="code" href="lateq_8hh.html">lateq.hh</a>&quot;</span>
<a name="l00075"></a>00075 <span class="preprocessor">#include &quot;<a class="code" href="doc__compile_8hh.html">doc_compile.hh</a>&quot;</span>
<a name="l00076"></a>00076 <span class="preprocessor">#include &quot;<a class="code" href="doc__lang_8hh.html">doc_lang.hh</a>&quot;</span>
<a name="l00077"></a>00077 <span class="preprocessor">#include &quot;<a class="code" href="doc__notice_8hh.html">doc_notice.hh</a>&quot;</span>
<a name="l00078"></a>00078 <span class="preprocessor">#include &quot;<a class="code" href="doc__autodoc_8hh.html">doc_autodoc.hh</a>&quot;</span>
<a name="l00079"></a>00079 <span class="preprocessor">#include &quot;<a class="code" href="compatibility_8hh.html">compatibility.hh</a>&quot;</span>
<a name="l00080"></a>00080 
<a name="l00081"></a>00081 
<a name="l00082"></a>00082 
<a name="l00083"></a><a class="code" href="doc_8cpp.html#a55ee21aeba68dbe17ffd10e4fd626690">00083</a> <span class="preprocessor">#define MAXIDCHARS 5                ///&lt; max numbers (characters) to represent ids (e.g. for directories).</span>
<a name="l00084"></a>00084 <span class="preprocessor"></span>
<a name="l00085"></a>00085 <span class="keyword">using namespace </span>std ;
<a name="l00086"></a>00086 
<a name="l00087"></a>00087 
<a name="l00088"></a>00088 <span class="comment">/*****************************************************************************</span>
<a name="l00089"></a>00089 <span class="comment">                        Globals and prototyping</span>
<a name="l00090"></a>00090 <span class="comment"> *****************************************************************************/</span>
<a name="l00091"></a>00091 
<a name="l00092"></a>00092 <span class="keyword">extern</span> <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a>                     <a class="code" href="doc_8cpp.html#a52086e1c3e02821c4ce3f5a0626c2662">gExpandedDefList</a>;
<a name="l00093"></a>00093 <span class="keyword">extern</span> map&lt;Tree, set&lt;Tree&gt; &gt;    <a class="code" href="doc_8cpp.html#aaf647729deae314d35817ccb36f088e4">gMetaDataSet</a>;
<a name="l00094"></a>00094 <span class="keyword">extern</span> map&lt;string, string&gt;      <a class="code" href="doc_8cpp.html#aa19e3a2853a131a2165ddead4a0e565d">gDocMetadatasStringMap</a>;
<a name="l00095"></a>00095 <span class="keyword">extern</span> <span class="keywordtype">bool</span>                     <a class="code" href="doc_8cpp.html#a4741733b16ad8f554a8b5c0ca5045d14">gDetailsSwitch</a>;
<a name="l00096"></a>00096 <span class="keyword">extern</span> <span class="keywordtype">bool</span>                     <a class="code" href="doc_8cpp.html#a88af9e6ad20008837e470be54b69437c">gStripDocSwitch</a>;
<a name="l00097"></a>00097 <span class="keyword">extern</span> <span class="keywordtype">string</span>                   <a class="code" href="doc_8cpp.html#a320fc936026f318a3fc46f47ef379713">gFaustDirectory</a>;
<a name="l00098"></a>00098 <span class="keyword">extern</span> <span class="keywordtype">string</span>                   <a class="code" href="doc_8cpp.html#a2529dab7cac84bd8f69c14ee8a3cbfe2">gFaustSuperDirectory</a>;
<a name="l00099"></a>00099 <span class="keyword">extern</span> <span class="keywordtype">string</span>                   <a class="code" href="doc_8cpp.html#a09fc40a224a32f929decbac5a21140ef">gFaustSuperSuperDirectory</a>;
<a name="l00100"></a>00100 <span class="keyword">extern</span> <span class="keywordtype">string</span>                   <a class="code" href="doc_8cpp.html#a1c0fac9c77fcd7f4e21daf398e9830de">gMasterDocument</a>;
<a name="l00101"></a>00101 <span class="keyword">extern</span> <a class="code" href="classSourceReader.html">SourceReader</a>             <a class="code" href="doc_8cpp.html#af59bae68e0652dd8c1ecbf661cbe8373">gReader</a>;
<a name="l00102"></a>00102 
<a name="l00103"></a>00103 <span class="keyword">extern</span> <span class="keywordtype">string</span>                   <a class="code" href="doc_8cpp.html#a90baf99fd6ffa7248d895c7d33e0a8cf" title="Contains the filename for out documentation.">gDocName</a>;               
<a name="l00104"></a><a class="code" href="doc_8cpp.html#a1023cd82d29af98e7692cd9b7784e94e">00104</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>*              <a class="code" href="doc_8cpp.html#a1023cd82d29af98e7692cd9b7784e94e" title="&amp;quot;.tex&amp;quot; (or .??? - used to choose output device).">gDocDevSuffix</a>;          
<a name="l00105"></a><a class="code" href="doc_8cpp.html#a0c91ed41a90a100a2570f4d993c6e16a">00105</a> <span class="keyword">static</span> <span class="keywordtype">string</span>                   <a class="code" href="doc_8cpp.html#a0c91ed41a90a100a2570f4d993c6e16a" title="Room to save current directory name.">gCurrentDir</a>;            
<a name="l00106"></a><a class="code" href="doc_8cpp.html#ac656ad6ba04fe2497fce8da01ae10a73">00106</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">string</span>             <a class="code" href="doc_8cpp.html#ac656ad6ba04fe2497fce8da01ae10a73">gLatexheaderfilename</a> = <span class="stringliteral">&quot;latexheader.tex&quot;</span>;
<a name="l00107"></a>00107 
<a name="l00108"></a><a class="code" href="sourcereader_8cpp.html#a7c306e8c82617863fda51d2c1158f5ab">00108</a> vector&lt;Tree&gt;                    <a class="code" href="doc_8cpp.html#a7c306e8c82617863fda51d2c1158f5ab" title="Contains &amp;lt;mdoc&amp;gt; parsed trees: DOCTXT, DOCEQN, DOCDGM.">gDocVector</a>;             
<a name="l00109"></a>00109 
<a name="l00110"></a><a class="code" href="doc_8cpp.html#ae57fb3f71c6b5070eaf01b4c6837ff1b">00110</a> <span class="keyword">static</span> <span class="keyword">struct </span>tm                <a class="code" href="doc_8cpp.html#ae57fb3f71c6b5070eaf01b4c6837ff1b">gCompilationDate</a>;
<a name="l00111"></a>00111 
<a name="l00112"></a><a class="code" href="doc_8cpp.html#a06fc87d81c62e9abb8790b6e5713c55ba9dfea5c4f4879fd1e8ea0656f442cc59">00112</a> <span class="keyword">enum</span> { <a class="code" href="doc_8cpp.html#a06fc87d81c62e9abb8790b6e5713c55bacd4a5f05b5182f1dd17c1dff36320e76">langEN</a>, <a class="code" href="doc_8cpp.html#a06fc87d81c62e9abb8790b6e5713c55ba351b19daff41efb007e9e538a6729a5c">langFR</a>, <a class="code" href="doc_8cpp.html#a06fc87d81c62e9abb8790b6e5713c55ba9dfea5c4f4879fd1e8ea0656f442cc59">langIT</a> };
<a name="l00113"></a><a class="code" href="main_8cpp.html#ac83dd0bfbc11705a903a395da7bc0f7c">00113</a> <span class="keywordtype">string</span>              <a class="code" href="doc_8cpp.html#ac83dd0bfbc11705a903a395da7bc0f7c">gDocLang</a>;
<a name="l00114"></a>00114 
<a name="l00115"></a>00115 <span class="comment">/* Printing functions */</span>
<a name="l00116"></a>00116 <span class="keyword">static</span> <span class="keywordtype">void</span>     <a class="code" href="doc_8cpp.html#a2ca219c50890ea7db162df03fcc9b799" title="Print the dynamic visible header, in a LaTeX &amp;quot;tabular&amp;quot; environment.">printdocheader</a>(ostream&amp; docout);
<a name="l00117"></a>00117 <span class="keyword">static</span> <span class="keywordtype">void</span>     <a class="code" href="doc_8cpp.html#a06e9e0c3a7caa845483c8ced3afccf4d" title="Print a static LaTeX header.">printlatexheader</a>(istream&amp; latexheader, ostream&amp; docout);
<a name="l00118"></a>00118 <span class="keyword">static</span> <span class="keywordtype">void</span>     <a class="code" href="doc_8cpp.html#a9ca06818fbc5569e6ba2beeb8c4ca38a" title="Print listings of each Faust code &amp;quot;.dsp&amp;quot; files, calling the &amp;#39;printfaustlisting&amp;#39;...">printfaustlistings</a>(ostream&amp; docout);
<a name="l00119"></a>00119 <span class="keyword">static</span> <span class="keywordtype">void</span>     <a class="code" href="doc_8cpp.html#a9b7ec85e7bc000dc74a58a44b893a82d" title="Print a listing of the Faust code, in a LaTeX &amp;quot;listing&amp;quot; environment.">printfaustlisting</a>(<span class="keywordtype">string</span>&amp; path, ostream&amp; docout);
<a name="l00120"></a>00120 <span class="keyword">static</span> <span class="keywordtype">void</span>     <a class="code" href="doc_8cpp.html#aca5cd842cbf22e8d931752073744be45" title="Print the static LaTeX footer.">printlatexfooter</a>(ostream&amp; docout);
<a name="l00121"></a>00121 <span class="keyword">static</span> <span class="keywordtype">void</span>     <a class="code" href="doc_8cpp.html#abda5dcd1f0ce42df1ebd6896188db07c" title="Main documentator loop.">printdoccontent</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* svgTopDir, <span class="keyword">const</span> vector&lt;Tree&gt;&amp; docVector, <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; faustversion, ostream&amp; docout);
<a name="l00122"></a>00122 <span class="keyword">static</span> <span class="keywordtype">void</span>     <a class="code" href="doc_8cpp.html#aa8c8181fc55b942a887b1a7ad1bc8426" title="Print a &amp;quot;doc stamp&amp;quot; in the LaTeX document :the Faust version,the date of...">printfaustdocstamp</a>(<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; faustversion, ostream&amp; docout);
<a name="l00123"></a>00123 <span class="keyword">static</span> <span class="keywordtype">void</span>     <a class="code" href="doc_8cpp.html#a9c0f85706b52c4c57bfe6f54875c3813" title="Print doc equations, following the Lateq::println method.">printDocEqn</a>(<a class="code" href="classLateq.html">Lateq</a>* ltq, ostream&amp; docout);
<a name="l00124"></a>00124 <span class="keyword">static</span> <span class="keywordtype">void</span>     <a class="code" href="doc_8cpp.html#a90774f58d14494c245c5003211c98a00" title="Doc diagrams handling.">printDocDgm</a>(<span class="keyword">const</span> <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> expr, <span class="keyword">const</span> <span class="keywordtype">char</span>* svgTopDir, ostream&amp; docout, <span class="keywordtype">int</span> i);
<a name="l00125"></a>00125 
<a name="l00126"></a>00126 <span class="comment">/* Primary sub-functions for &lt;equation&gt; handling */</span>
<a name="l00127"></a>00127 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#afa7596184f452ff056cbd6d0290b9dca" title="Caller function.">prepareDocEqns</a>( <span class="keyword">const</span> vector&lt;Tree&gt;&amp; docBoxes, vector&lt;Lateq*&gt;&amp; docCompiledEqnsVector );      
<a name="l00128"></a>00128 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a8f96b34e1e673115ba649660bbf214eb" title="step 0. Feed doceqnInfosVector.">collectDocEqns</a>( <span class="keyword">const</span> vector&lt;Tree&gt;&amp; docBoxes, vector&lt;Tree&gt;&amp; eqBoxes );                      
<a name="l00129"></a>00129 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a5682d0a758c84ec80d20145b83c6ce2f" title="step 1. Evaluate boxes.">mapEvalDocEqn</a>( <span class="keyword">const</span> vector&lt;Tree&gt;&amp; eqBoxes, <span class="keyword">const</span> <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a>&amp; env, vector&lt;Tree&gt;&amp; evalEqBoxes );   
<a name="l00130"></a>00130 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a47ecfaa24354f79ef7b9b37c3ea0744d" title="step 2. Get boxes name.">mapGetEqName</a>( <span class="keyword">const</span> vector&lt;Tree&gt;&amp; evalEqBoxes, vector&lt;string&gt;&amp; eqNames );                   
<a name="l00131"></a>00131 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a2b66e4aa1fc586d461378d44dce359de" title="step 3. Calculate nicknames.">calcEqnsNicknames</a>( <span class="keyword">const</span> vector&lt;string&gt;&amp; eqNames, vector&lt;string&gt;&amp; eqNicknames );            
<a name="l00132"></a>00132 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#ad9ae7b77b222a446be950f6668e177a0" title="step 4&amp;amp;5. Propagate and prepare signals.">mapPrepareEqSig</a>( <span class="keyword">const</span> vector&lt;Tree&gt;&amp; evalEqBoxes, vector&lt;int&gt;&amp; eqInputs, vector&lt;int&gt;&amp; eqOutputs, vector&lt;Tree&gt;&amp; eqSigs );    
<a name="l00133"></a>00133 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a84c0256c7510f01e97886d9174f05ff0" title="step 6. Set signals nicknames.">mapSetSigNickname</a>( <span class="keyword">const</span> vector&lt;string&gt;&amp; eqNicknames, <span class="keyword">const</span> vector&lt;int&gt;&amp; eqInputs, <span class="keyword">const</span> vector&lt;Tree&gt;&amp; eqSigs );    
<a name="l00134"></a>00134 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a3e31ebbced12828da219b955542cdc27" title="step 7. Collect all signals in a superlist.">collectEqSigs</a>( <span class="keyword">const</span> vector&lt;Tree&gt;&amp; eqSigs, <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a>&amp; superEqList );                             
<a name="l00135"></a>00135 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a22864a1de755e55e1745d94835f4693e" title="step 8. Annotate superlist.">annotateSuperList</a>( <a class="code" href="classDocCompiler.html" title="Compile a list of FAUST signals into a list of LaTeX formulas.">DocCompiler</a>* DC, <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> superEqList );                             
<a name="l00136"></a>00136 <span class="comment">//static void   calcAndSetLtqNames( Tree superEqList );     ///&lt; step 9. </span>
<a name="l00137"></a>00137 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a8ea0ae61d941bbbebcd46d210d30356a" title="step 10. Compile equations.">mapCompileDocEqnSigs</a>( <span class="keyword">const</span> vector&lt;Tree&gt;&amp; eqSigs, <span class="keyword">const</span> vector&lt;int&gt;&amp; eqInputs, <span class="keyword">const</span> vector&lt;int&gt;&amp; eqOutputs, <a class="code" href="classDocCompiler.html" title="Compile a list of FAUST signals into a list of LaTeX formulas.">DocCompiler</a>* DC, vector&lt;Lateq*&gt;&amp; docCompiledEqnsVector );  
<a name="l00138"></a>00138 
<a name="l00139"></a>00139 <span class="comment">/* Secondary sub-functions for &lt;equation&gt; handling */</span>
<a name="l00140"></a>00140 <span class="keyword">static</span> <span class="keywordtype">string</span>   <a class="code" href="doc_8cpp.html#a7347482365f605a414da25751bf1946f" title="Simply concat a string with a number in a &amp;quot;%03d&amp;quot; format.">calcNumberedName</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* base, <span class="keywordtype">int</span> i);
<a name="l00141"></a>00141 <span class="keyword">static</span> <span class="keywordtype">void</span>     <a class="code" href="doc_8cpp.html#a5ea5adac1568a1c91ea6f674a5eccef9" title="Just get the number of inputs and the number of outputs of a box.">getBoxInputsAndOutputs</a>(<span class="keyword">const</span> <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> t, <span class="keywordtype">int</span>&amp; numInputs, <span class="keywordtype">int</span>&amp; numOutputs);
<a name="l00142"></a>00142 <span class="keyword">static</span> <span class="keywordtype">string</span>   <a class="code" href="doc_8cpp.html#abe0d6d1a67c5c2bd4e5cac7f6d021ca8" title="Calculate an appropriate nickname for equations, from previous names.">calcDocEqnInitial</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> s);
<a name="l00143"></a>00143 
<a name="l00144"></a>00144 <span class="comment">/* Notice related functions */</span>
<a name="l00145"></a>00145 <span class="keyword">static</span> <span class="keywordtype">void</span>     <a class="code" href="doc_8cpp.html#a3fb97c3dc5609c5e01797548c69ff295">initCompilationDate</a>();
<a name="l00146"></a>00146 <span class="keyword">static</span> <span class="keyword">struct </span>tm* <a class="code" href="doc_8cpp.html#a0a871f44fa7d57075fcc6e7f835ba913">getCompilationDate</a>();
<a name="l00147"></a>00147 
<a name="l00148"></a>00148 <span class="comment">/* Files functions */</span>
<a name="l00149"></a>00149 <span class="keyword">static</span> <span class="keywordtype">int</span>      <a class="code" href="doc_8cpp.html#aa993eaaab62326b7ec82db3ac19d420c" title="Switch back to the previously stored current directory.">cholddir</a> ();
<a name="l00150"></a>00150 <span class="keyword">static</span> <span class="keywordtype">int</span>      <a class="code" href="doc_8cpp.html#a4ba32ce8ec678ffbdf068a4483543239" title="Create a new directory in the current one, then &amp;#39;cd&amp;#39; into this new directory...">mkchdir</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="main_8cpp.html#a678e1ef3077e128e543805a7381066f9">dirname</a>);
<a name="l00151"></a>00151 <span class="keyword">static</span> <span class="keywordtype">int</span>      <a class="code" href="doc_8cpp.html#a39b3d8237212f926fd704b35fcb7becd" title="Create a new directory in the current one.">makedir</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="main_8cpp.html#a678e1ef3077e128e543805a7381066f9">dirname</a>);
<a name="l00152"></a>00152 <span class="keyword">static</span> <span class="keywordtype">void</span>     <a class="code" href="doc_8cpp.html#a93f175441540044bcefdcd1a8736d43b" title="Get current directory and store it in gCurrentDir.">getCurrentDir</a>();
<a name="l00153"></a>00153 <span class="keyword">static</span> istream* <a class="code" href="doc_8cpp.html#a56d99634f77c578d4704e016bfe61331" title="Open architecture file.">openArchFile</a> (<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; filename);
<a name="l00154"></a>00154 <span class="keyword">static</span> <span class="keywordtype">char</span>*    <a class="code" href="doc_8cpp.html#a6fa98093fdea396358b0ea4e20e3821d" title="Transform the definition name property of tree &amp;lt;t&amp;gt; into a legal file name.">legalFileName</a>(<span class="keyword">const</span> <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> t, <span class="keywordtype">int</span> n, <span class="keywordtype">char</span>* dst);
<a name="l00155"></a>00155 <span class="keyword">static</span> <span class="keywordtype">string</span>   <a class="code" href="doc_8cpp.html#a016b1cbb37d2aee62272c6c955e4e078" title="Remove the leading and trailing double quotes of a string (but not those in the middle...">rmExternalDoubleQuotes</a>(<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; s);
<a name="l00156"></a>00156 <span class="keyword">static</span> <span class="keywordtype">void</span>     <a class="code" href="doc_8cpp.html#a375460f577b0036b379b7fbba6c328ae" title="Copy all Faust source files into an &amp;#39;src&amp;#39; subdirectory.">copyFaustSources</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* projname, <span class="keyword">const</span> vector&lt;string&gt;&amp; pathnames);
<a name="l00157"></a>00157 <span class="comment">//static void       declareAutoDoc();</span>
<a name="l00158"></a>00158 
<a name="l00159"></a>00159 
<a name="l00160"></a>00160 
<a name="l00161"></a>00161 <span class="comment">/*****************************************************************************</span>
<a name="l00162"></a>00162 <span class="comment">                    Types of Documentation Elements</span>
<a name="l00163"></a>00163 <span class="comment"> *****************************************************************************/</span>
<a name="l00164"></a>00164 
<a name="l00165"></a><a class="code" href="doc_8cpp.html#a3ce37f9c0c4f9e071cc70dcf1f82e1f5">00165</a> <a class="code" href="classSymbol.html" title="Symbols are unique objects with a name stored in a hash table.">Sym</a> <a class="code" href="doc_8cpp.html#a3ce37f9c0c4f9e071cc70dcf1f82e1f5">DOCTXT</a> = <a class="code" href="symbol_8hh.html#aaa87083235b70d1042e59ae25e0800d8" title="Returns (and creates if new) the symbol of name str.">symbol</a> (<span class="stringliteral">&quot;DocTxt&quot;</span>);
<a name="l00166"></a><a class="code" href="doc_8hh.html#a5f8dc6249f173985d8067995e6d8450a">00166</a> <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> <a class="code" href="doc_8cpp.html#a3ef69c2f85a3c6ae95968d7563b4aff2">docTxt</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="symbol_8hh.html#a8243134fbbd9d924ebbb3f833922e310" title="Returns the name of a symbol.">name</a>)       { <span class="keywordflow">return</span> <a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>( DOCTXT, <a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(<a class="code" href="symbol_8hh.html#aaa87083235b70d1042e59ae25e0800d8" title="Returns (and creates if new) the symbol of name str.">symbol</a>(name)) ); }
<a name="l00167"></a><a class="code" href="doc_8hh.html#ad0b394e474b1e452e44de4b7e7dbb106">00167</a> <span class="keywordtype">bool</span> <a class="code" href="doc_8cpp.html#ad0b394e474b1e452e44de4b7e7dbb106">isDocTxt</a>(<a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> t)               { <span class="keywordflow">return</span> t-&gt;<a class="code" href="classCTree.html#a8de786fec095c8304b9ffa7c1c316237" title="return the content of the tree">node</a>() == <a class="code" href="classNode.html" title="Class Node = (type x (int + double + Sym + void*)).">Node</a>(DOCTXT); }
<a name="l00168"></a><a class="code" href="doc_8hh.html#aa881e9aaddabd05ef454610927901eee">00168</a> <span class="keywordtype">bool</span> <a class="code" href="doc_8cpp.html#ad0b394e474b1e452e44de4b7e7dbb106">isDocTxt</a>(<a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> t0, <span class="keyword">const</span> <span class="keywordtype">char</span>** str)
<a name="l00169"></a>00169 {
<a name="l00170"></a>00170     <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> t1; <a class="code" href="classSymbol.html" title="Symbols are unique objects with a name stored in a hash table.">Sym</a> s;
<a name="l00171"></a>00171     <span class="keywordflow">if</span> ( <a class="code" href="tree_8cpp.html#a06be972e0437c7c09e8a1274586fe176">isTree</a>(t0, DOCTXT, t1) &amp;&amp; <a class="code" href="node_8hh.html#ab714e75c43d570297ff54578dc7e9ce3">isSym</a>(t1-&gt;<a class="code" href="classCTree.html#a8de786fec095c8304b9ffa7c1c316237" title="return the content of the tree">node</a>(), &amp;s) ) {
<a name="l00172"></a>00172         *str = <a class="code" href="symbol_8hh.html#a8243134fbbd9d924ebbb3f833922e310" title="Returns the name of a symbol.">name</a>(s);
<a name="l00173"></a>00173         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00174"></a>00174     } <span class="keywordflow">else</span> {
<a name="l00175"></a>00175         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00176"></a>00176     }
<a name="l00177"></a>00177 }
<a name="l00178"></a>00178 
<a name="l00179"></a><a class="code" href="doc_8cpp.html#a4d2c444fea45c353d1efc09220d6d903">00179</a> <a class="code" href="classSymbol.html" title="Symbols are unique objects with a name stored in a hash table.">Sym</a> <a class="code" href="doc_8cpp.html#a4d2c444fea45c353d1efc09220d6d903">DOCEQN</a> = <a class="code" href="symbol_8hh.html#aaa87083235b70d1042e59ae25e0800d8" title="Returns (and creates if new) the symbol of name str.">symbol</a> (<span class="stringliteral">&quot;DocEqn&quot;</span>);
<a name="l00180"></a><a class="code" href="doc_8hh.html#a74f8c842c37fd8d9e01b397d79abe117">00180</a> <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> <a class="code" href="doc_8cpp.html#a74f8c842c37fd8d9e01b397d79abe117">docEqn</a>(<a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> x)                 { <span class="keywordflow">return</span> <a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(DOCEQN, x);       }
<a name="l00181"></a><a class="code" href="doc_8hh.html#a8f5e00372043167fc1d7fe12532a020e">00181</a> <span class="keywordtype">bool</span> <a class="code" href="doc_8cpp.html#a8f5e00372043167fc1d7fe12532a020e">isDocEqn</a>(<a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> t, <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a>&amp; x)      { <span class="keywordflow">return</span> <a class="code" href="tree_8cpp.html#a06be972e0437c7c09e8a1274586fe176">isTree</a>(t, DOCEQN, x);  }
<a name="l00182"></a>00182 
<a name="l00183"></a><a class="code" href="doc_8cpp.html#a7114bcd8618d179b0ad442ea7d2a9b8b">00183</a> <a class="code" href="classSymbol.html" title="Symbols are unique objects with a name stored in a hash table.">Sym</a> <a class="code" href="doc_8cpp.html#a7114bcd8618d179b0ad442ea7d2a9b8b">DOCDGM</a> = <a class="code" href="symbol_8hh.html#aaa87083235b70d1042e59ae25e0800d8" title="Returns (and creates if new) the symbol of name str.">symbol</a> (<span class="stringliteral">&quot;DocDgm&quot;</span>);
<a name="l00184"></a><a class="code" href="doc_8hh.html#aa454efefb0dc22ade70352eee0fdb9ff">00184</a> <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> <a class="code" href="doc_8cpp.html#aa454efefb0dc22ade70352eee0fdb9ff">docDgm</a>(<a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> x)                 { <span class="keywordflow">return</span> <a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(DOCDGM, x);       }
<a name="l00185"></a><a class="code" href="doc_8hh.html#adb0333bf59f0c1891e28e6b21b3060a1">00185</a> <span class="keywordtype">bool</span> <a class="code" href="doc_8cpp.html#adb0333bf59f0c1891e28e6b21b3060a1">isDocDgm</a>(<a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> t, <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a>&amp; x)      { <span class="keywordflow">return</span> <a class="code" href="tree_8cpp.html#a06be972e0437c7c09e8a1274586fe176">isTree</a>(t, DOCDGM, x);  }
<a name="l00186"></a>00186 
<a name="l00187"></a><a class="code" href="doc_8cpp.html#a46fd57f16ddd4d6b43b5a289cfa97339">00187</a> <a class="code" href="classSymbol.html" title="Symbols are unique objects with a name stored in a hash table.">Sym</a> <a class="code" href="doc_8cpp.html#a46fd57f16ddd4d6b43b5a289cfa97339">DOCNTC</a> = <a class="code" href="symbol_8hh.html#aaa87083235b70d1042e59ae25e0800d8" title="Returns (and creates if new) the symbol of name str.">symbol</a> (<span class="stringliteral">&quot;DocNtc&quot;</span>);
<a name="l00188"></a><a class="code" href="doc_8hh.html#a8d813459bc7fcb5ceba9c07ca205d1f1">00188</a> <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> <a class="code" href="doc_8cpp.html#a8d813459bc7fcb5ceba9c07ca205d1f1">docNtc</a>()                       { <span class="keywordflow">return</span> <a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(DOCNTC);          }
<a name="l00189"></a><a class="code" href="doc_8hh.html#ac6cfa5258d1a4a0c52d636615be62a50">00189</a> <span class="keywordtype">bool</span> <a class="code" href="doc_8cpp.html#ac6cfa5258d1a4a0c52d636615be62a50">isDocNtc</a>(<a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> t)               { <span class="keywordflow">return</span> <a class="code" href="tree_8cpp.html#a06be972e0437c7c09e8a1274586fe176">isTree</a>(t, DOCNTC);     }
<a name="l00190"></a>00190 
<a name="l00191"></a><a class="code" href="doc_8cpp.html#a5224d7cd7a847f4bc17652432c50fac0">00191</a> <a class="code" href="classSymbol.html" title="Symbols are unique objects with a name stored in a hash table.">Sym</a> <a class="code" href="doc_8cpp.html#a5224d7cd7a847f4bc17652432c50fac0">DOCLST</a> = <a class="code" href="symbol_8hh.html#aaa87083235b70d1042e59ae25e0800d8" title="Returns (and creates if new) the symbol of name str.">symbol</a> (<span class="stringliteral">&quot;DocLst&quot;</span>);
<a name="l00192"></a><a class="code" href="doc_8hh.html#a6710f31a71806f69ac8cf5c7933c4fa6">00192</a> <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> <a class="code" href="doc_8cpp.html#a6710f31a71806f69ac8cf5c7933c4fa6">docLst</a>()                       { <span class="keywordflow">return</span> <a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(DOCLST);          }
<a name="l00193"></a><a class="code" href="doc_8hh.html#ae3a40683ffbfc5c9a8af59be69241d40">00193</a> <span class="keywordtype">bool</span> <a class="code" href="doc_8cpp.html#ae3a40683ffbfc5c9a8af59be69241d40">isDocLst</a>(<a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> t)               { <span class="keywordflow">return</span> <a class="code" href="tree_8cpp.html#a06be972e0437c7c09e8a1274586fe176">isTree</a>(t, DOCLST);     }
<a name="l00194"></a>00194 
<a name="l00195"></a>00195 
<a name="l00196"></a>00196 <span class="comment">//string getDocTxt(Tree t)          { return hd(t)-&gt;branch(0); }</span>
<a name="l00197"></a>00197 
<a name="l00198"></a>00198 
<a name="l00199"></a>00199 
<a name="l00200"></a>00200 <span class="comment">/*****************************************************************************</span>
<a name="l00201"></a>00201 <span class="comment">                Main Printing Function for the Documentation</span>
<a name="l00202"></a>00202 <span class="comment"> *****************************************************************************/</span>
<a name="l00203"></a>00203 
<a name="l00204"></a>00204 
<a name="l00216"></a><a class="code" href="doc_8hh.html#a8c5b3a35aaf051de7ed2a8e480a010f4">00216</a> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a8c5b3a35aaf051de7ed2a8e480a010f4" title="The entry point to generate faust doc files.">printDoc</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* projname, <span class="keyword">const</span> <span class="keywordtype">char</span>* docdev, <span class="keyword">const</span> <span class="keywordtype">char</span>* faustversion)
<a name="l00217"></a>00217 {
<a name="l00218"></a>00218     <a class="code" href="doc_8cpp.html#a1023cd82d29af98e7692cd9b7784e94e" title="&amp;quot;.tex&amp;quot; (or .??? - used to choose output device).">gDocDevSuffix</a> = docdev;
<a name="l00219"></a>00219     
<a name="l00221"></a>00221     <span class="comment">//cerr &lt;&lt; &quot;Documentator : printDoc : gFaustDirectory = &#39;&quot; &lt;&lt; gFaustDirectory &lt;&lt; &quot;&#39;&quot; &lt;&lt; endl;</span>
<a name="l00222"></a>00222     <span class="comment">//cerr &lt;&lt; &quot;Documentator : printDoc : gFaustSuperDirectory = &#39;&quot; &lt;&lt; gFaustSuperDirectory &lt;&lt; &quot;&#39;&quot; &lt;&lt; endl;</span>
<a name="l00223"></a>00223     <span class="comment">//cerr &lt;&lt; &quot;Documentator : printDoc : gFaustSuperSuperDirectory = &#39;&quot; &lt;&lt; gFaustSuperSuperDirectory &lt;&lt; &quot;&#39;&quot; &lt;&lt; endl;</span>
<a name="l00224"></a>00224     <span class="comment">//cerr &lt;&lt; &quot;Documentator : printDoc : gCurrentDir = &#39;&quot; &lt;&lt; gCurrentDir &lt;&lt; &quot;&#39;&quot; &lt;&lt; endl;</span>
<a name="l00225"></a>00225     
<a name="l00226"></a>00226     <a class="code" href="doc_8cpp.html#a39b3d8237212f926fd704b35fcb7becd" title="Create a new directory in the current one.">makedir</a>(projname);          <span class="comment">// create a top directory to store files</span>
<a name="l00227"></a>00227     
<a name="l00228"></a>00228     <span class="keywordtype">string</span> svgTopDir = <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$0/svg&quot;</span>, projname);
<a name="l00229"></a>00229     <a class="code" href="doc_8cpp.html#a39b3d8237212f926fd704b35fcb7becd" title="Create a new directory in the current one.">makedir</a>(svgTopDir.c_str()); <span class="comment">// create a directory to store svg-* subdirectories.</span>
<a name="l00230"></a>00230     
<a name="l00231"></a>00231     <span class="keywordtype">string</span> cppdir = <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$0/cpp&quot;</span>, projname);
<a name="l00232"></a>00232     <a class="code" href="doc_8cpp.html#a39b3d8237212f926fd704b35fcb7becd" title="Create a new directory in the current one.">makedir</a>(cppdir.c_str());    <span class="comment">// create a cpp directory.</span>
<a name="l00233"></a>00233     
<a name="l00234"></a>00234     <span class="keywordtype">string</span> pdfdir = <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$0/pdf&quot;</span>, projname);
<a name="l00235"></a>00235     <a class="code" href="doc_8cpp.html#a39b3d8237212f926fd704b35fcb7becd" title="Create a new directory in the current one.">makedir</a>(pdfdir.c_str());    <span class="comment">// create a pdf directory.</span>
<a name="l00236"></a>00236     
<a name="l00237"></a>00237     <span class="comment">/* Copy all Faust source files into an &#39;src&#39; sub-directory. */</span>
<a name="l00238"></a>00238     vector&lt;string&gt; pathnames = gReader.<a class="code" href="classSourceReader.html#a02d4fe696337e6e327b14620ed76b626" title="Return a vector of pathnames representing the list of all the source files that have...">listSrcFiles</a>();
<a name="l00239"></a>00239     <a class="code" href="doc_8cpp.html#a375460f577b0036b379b7fbba6c328ae" title="Copy all Faust source files into an &amp;#39;src&amp;#39; subdirectory.">copyFaustSources</a>(projname, pathnames);
<a name="l00240"></a>00240     
<a name="l00241"></a>00241     <span class="keywordtype">string</span> texdir = <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$0/tex&quot;</span>, projname);
<a name="l00242"></a>00242     <a class="code" href="doc_8cpp.html#a4ba32ce8ec678ffbdf068a4483543239" title="Create a new directory in the current one, then &amp;#39;cd&amp;#39; into this new directory...">mkchdir</a>(texdir.c_str());    <span class="comment">// create a directory and move into.</span>
<a name="l00243"></a>00243 
<a name="l00245"></a>00245     ofstream docout(<a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$0.$1&quot;</span>, <a class="code" href="doc_8cpp.html#a90baf99fd6ffa7248d895c7d33e0a8cf" title="Contains the filename for out documentation.">gDocName</a>, docdev).c_str());
<a name="l00246"></a>00246     <a class="code" href="doc_8cpp.html#aa993eaaab62326b7ec82db3ac19d420c" title="Switch back to the previously stored current directory.">cholddir</a>();                 <span class="comment">// return to current directory</span>
<a name="l00247"></a>00247     
<a name="l00249"></a>00249     <a class="code" href="doc__lang_8cpp.html#abc3498b3fe2b5d2aed70c4ace6f4b7a5">loadTranslationFile</a>(<a class="code" href="doc_8cpp.html#ac83dd0bfbc11705a903a395da7bc0f7c">gDocLang</a>);
<a name="l00250"></a>00250     
<a name="l00252"></a>00252     <span class="keywordflow">if</span> (<a class="code" href="doc_8cpp.html#a7c306e8c82617863fda51d2c1158f5ab" title="Contains &amp;lt;mdoc&amp;gt; parsed trees: DOCTXT, DOCEQN, DOCDGM.">gDocVector</a>.empty()) { <a class="code" href="doc__autodoc_8cpp.html#a397f3918046c844eb8a0d69a852547c7" title="Declare an automatic documentation.">declareAutoDoc</a>(); }   
<a name="l00253"></a>00253     
<a name="l00255"></a>00255     <a class="code" href="doc_8cpp.html#aa8c8181fc55b942a887b1a7ad1bc8426" title="Print a &amp;quot;doc stamp&amp;quot; in the LaTeX document :the Faust version,the date of...">printfaustdocstamp</a>(faustversion, docout);                       
<a name="l00256"></a>00256     istream* latexheader = <a class="code" href="doc_8cpp.html#a56d99634f77c578d4704e016bfe61331" title="Open architecture file.">openArchFile</a>(<a class="code" href="doc_8cpp.html#ac656ad6ba04fe2497fce8da01ae10a73">gLatexheaderfilename</a>);
<a name="l00257"></a>00257     <a class="code" href="doc_8cpp.html#a06e9e0c3a7caa845483c8ced3afccf4d" title="Print a static LaTeX header.">printlatexheader</a>(*latexheader, docout);                         
<a name="l00258"></a>00258     <a class="code" href="doc_8cpp.html#a2ca219c50890ea7db162df03fcc9b799" title="Print the dynamic visible header, in a LaTeX &amp;quot;tabular&amp;quot; environment.">printdocheader</a>(docout);                                         
<a name="l00259"></a>00259     <a class="code" href="doc_8cpp.html#abda5dcd1f0ce42df1ebd6896188db07c" title="Main documentator loop.">printdoccontent</a>(svgTopDir.c_str(), <a class="code" href="doc_8cpp.html#a7c306e8c82617863fda51d2c1158f5ab" title="Contains &amp;lt;mdoc&amp;gt; parsed trees: DOCTXT, DOCEQN, DOCDGM.">gDocVector</a>, faustversion, docout);       
<a name="l00260"></a>00260     <a class="code" href="doc_8cpp.html#aca5cd842cbf22e8d931752073744be45" title="Print the static LaTeX footer.">printlatexfooter</a>(docout);                                       
<a name="l00261"></a>00261     
<a name="l00262"></a>00262 }
<a name="l00263"></a>00263 
<a name="l00264"></a>00264 
<a name="l00265"></a>00265 
<a name="l00266"></a>00266 <span class="comment">/*****************************************************************************</span>
<a name="l00267"></a>00267 <span class="comment">            LaTeX basic printing functions of the Documentation</span>
<a name="l00268"></a>00268 <span class="comment"> *****************************************************************************/</span>
<a name="l00269"></a>00269 
<a name="l00276"></a><a class="code" href="doc_8cpp.html#a06e9e0c3a7caa845483c8ced3afccf4d">00276</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a06e9e0c3a7caa845483c8ced3afccf4d" title="Print a static LaTeX header.">printlatexheader</a>(istream&amp; latexheader, ostream&amp; docout)
<a name="l00277"></a>00277 {   
<a name="l00278"></a>00278     <span class="keywordtype">string</span>  s;
<a name="l00279"></a>00279     <span class="keywordflow">while</span>(getline(latexheader, s)) docout &lt;&lt; s &lt;&lt; endl;
<a name="l00280"></a>00280 }
<a name="l00281"></a>00281 
<a name="l00287"></a><a class="code" href="doc_8cpp.html#a2ca219c50890ea7db162df03fcc9b799">00287</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a2ca219c50890ea7db162df03fcc9b799" title="Print the dynamic visible header, in a LaTeX &amp;quot;tabular&amp;quot; environment.">printdocheader</a>(ostream&amp; docout)
<a name="l00288"></a>00288 {
<a name="l00289"></a>00289     <span class="comment">/* Defines the metadata we want to print as comments at the begin of the LaTeX file. */</span>
<a name="l00290"></a>00290     set&lt;Tree&gt; selectedKeys;
<a name="l00291"></a>00291     selectedKeys.insert(<a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(<span class="stringliteral">&quot;name&quot;</span>));
<a name="l00292"></a>00292     selectedKeys.insert(<a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(<span class="stringliteral">&quot;author&quot;</span>));
<a name="l00293"></a>00293     selectedKeys.insert(<a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(<span class="stringliteral">&quot;copyright&quot;</span>));
<a name="l00294"></a>00294     selectedKeys.insert(<a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(<span class="stringliteral">&quot;license&quot;</span>));
<a name="l00295"></a>00295     selectedKeys.insert(<a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(<span class="stringliteral">&quot;version&quot;</span>));
<a name="l00296"></a>00296     
<a name="l00297"></a>00297     <span class="keywordtype">string</span> title = <span class="stringliteral">&quot;Documentation&quot;</span>; 
<a name="l00298"></a>00298     <span class="keywordflow">if</span> (<a class="code" href="doc_8cpp.html#aaf647729deae314d35817ccb36f088e4">gMetaDataSet</a>.count(<a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(<span class="stringliteral">&quot;name&quot;</span>))) {
<a name="l00299"></a>00299         title = <a class="code" href="Text_8cpp.html#a43603e937810ca498bdad7f930938491" title="remove quotes from a string">unquote</a>( <a class="code" href="tree_8cpp.html#ac753d60778175e30a86cba647db017ad" title="if t has a node of type symbol, return its name otherwise error">tree2str</a>(*(<a class="code" href="doc_8cpp.html#aaf647729deae314d35817ccb36f088e4">gMetaDataSet</a>[<a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(<span class="stringliteral">&quot;name&quot;</span>)].begin())) ); 
<a name="l00300"></a>00300     }
<a name="l00301"></a>00301     docout &lt;&lt; <span class="stringliteral">&quot;\\title{&quot;</span> &lt;&lt; title &lt;&lt; <span class="stringliteral">&quot;}&quot;</span> &lt;&lt; endl;
<a name="l00302"></a>00302     
<a name="l00303"></a>00303     <span class="keywordtype">string</span> author = <span class="stringliteral">&quot;(anonymous)&quot;</span>; 
<a name="l00304"></a>00304     <span class="keywordflow">if</span> (<a class="code" href="doc_8cpp.html#aaf647729deae314d35817ccb36f088e4">gMetaDataSet</a>.count(<a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(<span class="stringliteral">&quot;author&quot;</span>))) {
<a name="l00305"></a>00305         author = <a class="code" href="Text_8cpp.html#a43603e937810ca498bdad7f930938491" title="remove quotes from a string">unquote</a>( <a class="code" href="tree_8cpp.html#ac753d60778175e30a86cba647db017ad" title="if t has a node of type symbol, return its name otherwise error">tree2str</a>(*(<a class="code" href="doc_8cpp.html#aaf647729deae314d35817ccb36f088e4">gMetaDataSet</a>[<a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(<span class="stringliteral">&quot;author&quot;</span>)].begin())) ); 
<a name="l00306"></a>00306         docout &lt;&lt; <span class="stringliteral">&quot;\\author{&quot;</span> &lt;&lt; author &lt;&lt; <span class="stringliteral">&quot;}&quot;</span> &lt;&lt; endl;
<a name="l00307"></a>00307     }
<a name="l00308"></a>00308     
<a name="l00309"></a>00309     docout &lt;&lt; <span class="stringliteral">&quot;\\date{\\today}&quot;</span> &lt;&lt; endl &lt;&lt; endl;
<a name="l00310"></a>00310     docout &lt;&lt; <span class="stringliteral">&quot;\\maketitle&quot;</span> &lt;&lt; endl &lt;&lt; endl;
<a name="l00311"></a>00311     
<a name="l00312"></a>00312     
<a name="l00313"></a>00313     <span class="keywordflow">if</span> (! <a class="code" href="doc_8cpp.html#aaf647729deae314d35817ccb36f088e4">gMetaDataSet</a>.empty()) {
<a name="l00314"></a>00314         docout &lt;&lt; <span class="stringliteral">&quot;\\begin{tabular}{ll}&quot;</span> &lt;&lt; endl;
<a name="l00315"></a>00315         docout &lt;&lt; <span class="stringliteral">&quot;\t\\hline&quot;</span> &lt;&lt; endl;
<a name="l00316"></a>00316         <span class="keywordflow">for</span> (map&lt;<a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a>, set&lt;Tree&gt; &gt;::iterator i = <a class="code" href="doc_8cpp.html#aaf647729deae314d35817ccb36f088e4">gMetaDataSet</a>.begin(); i != <a class="code" href="doc_8cpp.html#aaf647729deae314d35817ccb36f088e4">gMetaDataSet</a>.end(); i++) {
<a name="l00317"></a>00317             <span class="keywordflow">if</span> (selectedKeys.count(i-&gt;first)) {
<a name="l00318"></a>00318                 <span class="comment">//docout &lt;&lt; &quot;\t\\textbf{&quot; &lt;&lt; *(i-&gt;first);</span>
<a name="l00319"></a>00319                 docout &lt;&lt; <span class="stringliteral">&quot;\t\\textbf{&quot;</span> &lt;&lt; <a class="code" href="doc_8cpp.html#aa19e3a2853a131a2165ddead4a0e565d">gDocMetadatasStringMap</a>[<a class="code" href="tree_8cpp.html#ac753d60778175e30a86cba647db017ad" title="if t has a node of type symbol, return its name otherwise error">tree2str</a>(i-&gt;first)];
<a name="l00320"></a>00320                 <span class="keyword">const</span> <span class="keywordtype">char</span>* sep = <span class="stringliteral">&quot;} &amp; &quot;</span>;
<a name="l00321"></a>00321                 <span class="keywordflow">for</span> (set&lt;Tree&gt;::iterator j = i-&gt;second.begin(); j != i-&gt;second.end(); j++) {
<a name="l00322"></a>00322                     docout &lt;&lt; sep &lt;&lt; <a class="code" href="doc_8cpp.html#a016b1cbb37d2aee62272c6c955e4e078" title="Remove the leading and trailing double quotes of a string (but not those in the middle...">rmExternalDoubleQuotes</a>(<a class="code" href="tree_8cpp.html#ac753d60778175e30a86cba647db017ad" title="if t has a node of type symbol, return its name otherwise error">tree2str</a>(*j));
<a name="l00323"></a>00323                     sep = <span class="stringliteral">&quot;, &quot;</span>;
<a name="l00324"></a>00324                 }
<a name="l00325"></a>00325                 <span class="keyword">const</span> <span class="keywordtype">char</span>* sep2 = <span class="stringliteral">&quot;\\\\&quot;</span>;
<a name="l00326"></a>00326                 docout &lt;&lt; sep2 &lt;&lt; endl;
<a name="l00327"></a>00327             }
<a name="l00328"></a>00328         }
<a name="l00329"></a>00329         docout &lt;&lt; <span class="stringliteral">&quot;\t\\hline\\\\&quot;</span> &lt;&lt; endl;
<a name="l00330"></a>00330         docout &lt;&lt; <span class="stringliteral">&quot;\\end{tabular}&quot;</span> &lt;&lt; endl;
<a name="l00331"></a>00331         docout &lt;&lt; <span class="stringliteral">&quot;\\bigskip&quot;</span> &lt;&lt; endl &lt;&lt; endl;
<a name="l00332"></a>00332     }
<a name="l00333"></a>00333 }
<a name="l00334"></a>00334 
<a name="l00335"></a>00335 
<a name="l00342"></a><a class="code" href="doc_8cpp.html#a9ca06818fbc5569e6ba2beeb8c4ca38a">00342</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a9ca06818fbc5569e6ba2beeb8c4ca38a" title="Print listings of each Faust code &amp;quot;.dsp&amp;quot; files, calling the &amp;#39;printfaustlisting&amp;#39;...">printfaustlistings</a>(ostream&amp; docout)
<a name="l00343"></a>00343 {   
<a name="l00344"></a>00344     vector&lt;string&gt; pathnames = gReader.<a class="code" href="classSourceReader.html#a02d4fe696337e6e327b14620ed76b626" title="Return a vector of pathnames representing the list of all the source files that have...">listSrcFiles</a>();
<a name="l00345"></a>00345     
<a name="l00346"></a>00346     <span class="comment">/* Listings printing. */</span>
<a name="l00347"></a>00347     <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i&lt; pathnames.size(); i++) {
<a name="l00348"></a>00348         <a class="code" href="doc_8cpp.html#a9b7ec85e7bc000dc74a58a44b893a82d" title="Print a listing of the Faust code, in a LaTeX &amp;quot;listing&amp;quot; environment.">printfaustlisting</a>(pathnames[i], docout);
<a name="l00349"></a>00349     }
<a name="l00350"></a>00350 }
<a name="l00351"></a>00351 
<a name="l00352"></a>00352 
<a name="l00360"></a><a class="code" href="doc_8cpp.html#a9b7ec85e7bc000dc74a58a44b893a82d">00360</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a9b7ec85e7bc000dc74a58a44b893a82d" title="Print a listing of the Faust code, in a LaTeX &amp;quot;listing&amp;quot; environment.">printfaustlisting</a>(<span class="keywordtype">string</span>&amp; faustfile, ostream&amp; docout)
<a name="l00361"></a>00361 {   
<a name="l00362"></a>00362     <span class="keywordtype">string</span>  s;
<a name="l00363"></a>00363     ifstream src;
<a name="l00364"></a>00364     
<a name="l00365"></a>00365     <span class="comment">//cerr &lt;&lt; &quot;Documentator : printfaustlisting : Opening file &#39;&quot; &lt;&lt; faustfile &lt;&lt; &quot;&#39;&quot; &lt;&lt; endl;</span>
<a name="l00366"></a>00366     src.open(faustfile.c_str(), ifstream::in);
<a name="l00367"></a>00367     
<a name="l00368"></a>00368     docout &lt;&lt; endl &lt;&lt; <span class="stringliteral">&quot;\\bigskip\\bigskip&quot;</span> &lt;&lt; endl;
<a name="l00369"></a>00369     docout &lt;&lt; <span class="stringliteral">&quot;\\begin{lstlisting}[caption=\\texttt{&quot;</span> &lt;&lt; <a class="code" href="enrobage_8cpp.html#a73496d20a5f06ebb81a3ce1cc6d39877">filebasename</a>(faustfile.c_str()) &lt;&lt; <span class="stringliteral">&quot;}]&quot;</span> &lt;&lt; endl;
<a name="l00370"></a>00370 
<a name="l00371"></a>00371     <span class="keywordtype">bool</span> isInsideDoc = <span class="keyword">false</span>;
<a name="l00372"></a>00372     
<a name="l00373"></a>00373     <span class="keywordflow">if</span> (faustfile != <span class="stringliteral">&quot;&quot;</span> &amp;&amp; src.good()) {
<a name="l00374"></a>00374         <span class="keywordflow">while</span>(getline(src, s)) { 
<a name="l00375"></a>00375             <span class="keywordtype">size_t</span> foundopendoc  = s.find(<span class="stringliteral">&quot;&lt;mdoc&gt;&quot;</span>);
<a name="l00376"></a>00376             <span class="keywordflow">if</span> (foundopendoc != string::npos &amp;&amp; <a class="code" href="doc_8cpp.html#a88af9e6ad20008837e470be54b69437c">gStripDocSwitch</a>) isInsideDoc = <span class="keyword">true</span>;
<a name="l00377"></a>00377             
<a name="l00378"></a>00378             <span class="keywordflow">if</span> (isInsideDoc == <span class="keyword">false</span>)
<a name="l00379"></a>00379                 docout &lt;&lt; s &lt;&lt; endl;
<a name="l00380"></a>00380             
<a name="l00381"></a>00381             <span class="keywordtype">size_t</span> foundclosedoc = s.find(<span class="stringliteral">&quot;&lt;/mdoc&gt;&quot;</span>);
<a name="l00382"></a>00382             <span class="keywordflow">if</span> (foundclosedoc != string::npos &amp;&amp; <a class="code" href="doc_8cpp.html#a88af9e6ad20008837e470be54b69437c">gStripDocSwitch</a>) isInsideDoc = <span class="keyword">false</span>;
<a name="l00383"></a>00383         }
<a name="l00384"></a>00384     } <span class="keywordflow">else</span> {
<a name="l00385"></a>00385         cerr &lt;&lt; <span class="stringliteral">&quot;ERROR : can&#39;t open faust source file &quot;</span> &lt;&lt; faustfile &lt;&lt; endl;
<a name="l00386"></a>00386         exit(1);
<a name="l00387"></a>00387     }
<a name="l00388"></a>00388     
<a name="l00389"></a>00389     docout &lt;&lt; <span class="stringliteral">&quot;\\end{lstlisting}&quot;</span> &lt;&lt; endl &lt;&lt; endl;
<a name="l00390"></a>00390 }
<a name="l00391"></a>00391 
<a name="l00392"></a>00392 
<a name="l00398"></a><a class="code" href="doc_8cpp.html#aca5cd842cbf22e8d931752073744be45">00398</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#aca5cd842cbf22e8d931752073744be45" title="Print the static LaTeX footer.">printlatexfooter</a>(ostream&amp; docout)
<a name="l00399"></a>00399 {
<a name="l00400"></a>00400     docout &lt;&lt; endl &lt;&lt; <span class="stringliteral">&quot;\\end{document}&quot;</span> &lt;&lt; endl &lt;&lt; endl;
<a name="l00401"></a>00401 }
<a name="l00402"></a>00402 
<a name="l00403"></a>00403 
<a name="l00413"></a><a class="code" href="doc_8cpp.html#aa8c8181fc55b942a887b1a7ad1bc8426">00413</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#aa8c8181fc55b942a887b1a7ad1bc8426" title="Print a &amp;quot;doc stamp&amp;quot; in the LaTeX document :the Faust version,the date of...">printfaustdocstamp</a>(<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; faustversion, ostream&amp; docout)
<a name="l00414"></a>00414 {
<a name="l00415"></a>00415     <span class="keywordtype">char</span> datebuf [150];
<a name="l00416"></a>00416     strftime (datebuf, 150, <span class="stringliteral">&quot;%c&quot;</span>, <a class="code" href="doc_8cpp.html#a0a871f44fa7d57075fcc6e7f835ba913">getCompilationDate</a>());
<a name="l00417"></a>00417     
<a name="l00418"></a>00418     docout &lt;&lt; <span class="stringliteral">&quot;%% This documentation was generated with Faust version &quot;</span> &lt;&lt; faustversion &lt;&lt; endl;
<a name="l00419"></a>00419     docout &lt;&lt; <span class="stringliteral">&quot;%% &quot;</span> &lt;&lt; datebuf &lt;&lt; endl;
<a name="l00420"></a>00420     docout &lt;&lt; <span class="stringliteral">&quot;%% http://faust.grame.fr&quot;</span> &lt;&lt; endl &lt;&lt; endl;
<a name="l00421"></a>00421 }
<a name="l00422"></a>00422 
<a name="l00423"></a>00423 
<a name="l00424"></a>00424 
<a name="l00425"></a>00425 <span class="comment">/*****************************************************************************</span>
<a name="l00426"></a>00426 <span class="comment">            Main loop : launches prepare, evaluate, and print functions</span>
<a name="l00427"></a>00427 <span class="comment"> *****************************************************************************/</span>
<a name="l00428"></a>00428 
<a name="l00445"></a><a class="code" href="doc_8cpp.html#abda5dcd1f0ce42df1ebd6896188db07c">00445</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#abda5dcd1f0ce42df1ebd6896188db07c" title="Main documentator loop.">printdoccontent</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* svgTopDir, <span class="keyword">const</span> vector&lt;Tree&gt;&amp; docVector, <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; faustversion, ostream&amp; docout)
<a name="l00446"></a>00446 {
<a name="l00447"></a>00447     <span class="comment">//cerr &lt;&lt; endl &lt;&lt; &quot;Documentator : printdoccontent : &quot; &lt;&lt; docVector.size() &lt;&lt; &quot; &lt;mdoc&gt; tags read.&quot; &lt;&lt; endl;</span>
<a name="l00448"></a>00448     
<a name="l00450"></a>00450     vector&lt;Lateq*&gt;  docCompiledEqnsVector;
<a name="l00451"></a>00451     <a class="code" href="doc_8cpp.html#afa7596184f452ff056cbd6d0290b9dca" title="Caller function.">prepareDocEqns</a>( docVector, docCompiledEqnsVector ); 
<a name="l00452"></a>00452     
<a name="l00453"></a>00453     vector&lt;Lateq*&gt;::iterator eqn_it = docCompiledEqnsVector.begin();
<a name="l00454"></a>00454     <span class="keywordtype">int</span> i = 1;          
<a name="l00455"></a>00455 
<a name="l00457"></a>00457     <span class="keywordflow">for</span> (vector&lt;Tree&gt;::const_iterator <a class="code" href="faustlexer_8cpp.html#a96015589396b70e34698a0887a19ad0a">doc</a>=docVector.begin(); <a class="code" href="faustlexer_8cpp.html#a96015589396b70e34698a0887a19ad0a">doc</a>&lt;docVector.end(); <a class="code" href="faustlexer_8cpp.html#a96015589396b70e34698a0887a19ad0a">doc</a>++) {
<a name="l00458"></a>00458         
<a name="l00459"></a>00459         <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> L = <a class="code" href="list_8cpp.html#a8e15f8d6fcc6cd319059c2e0544145bb">reverse</a>(*<a class="code" href="faustlexer_8cpp.html#a96015589396b70e34698a0887a19ad0a">doc</a>);
<a name="l00460"></a>00460         <span class="comment">//cerr &lt;&lt; &quot;Entering into &lt;mdoc&gt; parsing...&quot; &lt;&lt; endl; </span>
<a name="l00461"></a>00461         
<a name="l00463"></a>00463         <span class="keywordflow">while</span> (<a class="code" href="list_8hh.html#a8bdd73641276e0c0f999f504348eacc1">isList</a>(L)) {
<a name="l00464"></a>00464             <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> expr;
<a name="l00465"></a>00465             <span class="keywordflow">if</span> ( <a class="code" href="doc_8cpp.html#a8f5e00372043167fc1d7fe12532a020e">isDocEqn</a>(<a class="code" href="list_8hh.html#a067ad6f83087b420a1c44e48e56be389">hd</a>(L), expr) ) { 
<a name="l00466"></a>00466                 <a class="code" href="doc_8cpp.html#a9c0f85706b52c4c57bfe6f54875c3813" title="Print doc equations, following the Lateq::println method.">printDocEqn</a>(*eqn_it++, docout);
<a name="l00467"></a>00467             }
<a name="l00468"></a>00468             <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( <a class="code" href="doc_8cpp.html#adb0333bf59f0c1891e28e6b21b3060a1">isDocDgm</a>(<a class="code" href="list_8hh.html#a067ad6f83087b420a1c44e48e56be389">hd</a>(L), expr) ) { 
<a name="l00469"></a>00469                 <a class="code" href="doc_8cpp.html#a90774f58d14494c245c5003211c98a00" title="Doc diagrams handling.">printDocDgm</a>(expr, svgTopDir, docout, i++);
<a name="l00470"></a>00470             }
<a name="l00471"></a>00471             <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( <a class="code" href="doc_8cpp.html#ad0b394e474b1e452e44de4b7e7dbb106">isDocTxt</a>(<a class="code" href="list_8hh.html#a067ad6f83087b420a1c44e48e56be389">hd</a>(L)) ) { 
<a name="l00472"></a>00472                 docout &lt;&lt; *<a class="code" href="list_8hh.html#a067ad6f83087b420a1c44e48e56be389">hd</a>(L)-&gt;<a class="code" href="classCTree.html#a06c1513b23dc7b0d9da9c930c6dc43c5" title="return the ith branch (subtree) of a tree">branch</a>(0) &lt;&lt; endl; <span class="comment">// Directly print registered doc text.</span>
<a name="l00473"></a>00473             }
<a name="l00474"></a>00474             <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( <a class="code" href="doc_8cpp.html#ac6cfa5258d1a4a0c52d636615be62a50">isDocNtc</a>(<a class="code" href="list_8hh.html#a067ad6f83087b420a1c44e48e56be389">hd</a>(L)) ) { 
<a name="l00475"></a>00475                 <a class="code" href="doc__notice_8cpp.html#a2270b36463f6626b5b2bf8add3f87406" title="Print the content of the notice (a string map), as LaTeX items inside an itemize...">printDocNotice</a>(faustversion, docout);
<a name="l00476"></a>00476             }
<a name="l00477"></a>00477             <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( <a class="code" href="doc_8cpp.html#ae3a40683ffbfc5c9a8af59be69241d40">isDocLst</a>(<a class="code" href="list_8hh.html#a067ad6f83087b420a1c44e48e56be389">hd</a>(L)) ) { 
<a name="l00478"></a>00478                 <a class="code" href="doc_8cpp.html#a9ca06818fbc5569e6ba2beeb8c4ca38a" title="Print listings of each Faust code &amp;quot;.dsp&amp;quot; files, calling the &amp;#39;printfaustlisting&amp;#39;...">printfaustlistings</a>(docout);
<a name="l00479"></a>00479             }
<a name="l00480"></a>00480             <span class="keywordflow">else</span> { 
<a name="l00481"></a>00481                 cerr &lt;&lt; <span class="stringliteral">&quot;ERROR : &quot;</span> &lt;&lt; *<a class="code" href="list_8hh.html#a067ad6f83087b420a1c44e48e56be389">hd</a>(L) &lt;&lt; <span class="stringliteral">&quot; is not a valid documentation type.&quot;</span> &lt;&lt; endl; 
<a name="l00482"></a>00482             }
<a name="l00483"></a>00483             L = <a class="code" href="list_8hh.html#a4075748f5c7156306ec898795313a2e0">tl</a>(L);
<a name="l00484"></a>00484         }
<a name="l00485"></a>00485         <span class="comment">//cerr &lt;&lt; &quot; ...end of &lt;mdoc&gt; parsing.&quot; &lt;&lt; endl; </span>
<a name="l00486"></a>00486     }
<a name="l00487"></a>00487 }
<a name="l00488"></a>00488 
<a name="l00489"></a>00489 
<a name="l00490"></a>00490 
<a name="l00491"></a>00491 <span class="comment">/*****************************************************************************</span>
<a name="l00492"></a>00492 <span class="comment">            Primary sub-functions for &lt;equation&gt; handling</span>
<a name="l00493"></a>00493 <span class="comment"> *****************************************************************************/</span>
<a name="l00494"></a>00494 
<a name="l00505"></a><a class="code" href="doc_8cpp.html#afa7596184f452ff056cbd6d0290b9dca">00505</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#afa7596184f452ff056cbd6d0290b9dca" title="Caller function.">prepareDocEqns</a>(<span class="keyword">const</span> vector&lt;Tree&gt;&amp; docBoxes, vector&lt;Lateq*&gt;&amp; docCompiledEqnsVector)
<a name="l00506"></a>00506 {   
<a name="l00507"></a>00507     vector&lt;Tree&gt;    eqBoxes;        <a class="code" href="doc_8cpp.html#a8f96b34e1e673115ba649660bbf214eb" title="step 0. Feed doceqnInfosVector.">collectDocEqns</a>( docBoxes, eqBoxes );        
<a name="l00508"></a>00508     vector&lt;Tree&gt;    evalEqBoxes;    <a class="code" href="doc_8cpp.html#a5682d0a758c84ec80d20145b83c6ce2f" title="step 1. Evaluate boxes.">mapEvalDocEqn</a>( eqBoxes, gExpandedDefList, evalEqBoxes );    
<a name="l00509"></a>00509     vector&lt;string&gt;  eqNames;        <a class="code" href="doc_8cpp.html#a47ecfaa24354f79ef7b9b37c3ea0744d" title="step 2. Get boxes name.">mapGetEqName</a>( evalEqBoxes, eqNames );       
<a name="l00510"></a>00510     vector&lt;string&gt;  eqNicknames;    <a class="code" href="doc_8cpp.html#a2b66e4aa1fc586d461378d44dce359de" title="step 3. Calculate nicknames.">calcEqnsNicknames</a>( eqNames, eqNicknames );  
<a name="l00511"></a>00511     
<a name="l00512"></a>00512     vector&lt;int&gt;     eqInputs;
<a name="l00513"></a>00513     vector&lt;int&gt;     eqOutputs;
<a name="l00514"></a>00514     vector&lt;Tree&gt;    eqSigs;         <a class="code" href="doc_8cpp.html#ad9ae7b77b222a446be950f6668e177a0" title="step 4&amp;amp;5. Propagate and prepare signals.">mapPrepareEqSig</a>( evalEqBoxes, eqInputs, eqOutputs, eqSigs );    
<a name="l00515"></a>00515     <a class="code" href="doc_8cpp.html#a84c0256c7510f01e97886d9174f05ff0" title="step 6. Set signals nicknames.">mapSetSigNickname</a>( eqNicknames, eqInputs, eqSigs );                                 
<a name="l00516"></a>00516     <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a>            superEqList;    <a class="code" href="doc_8cpp.html#a3e31ebbced12828da219b955542cdc27" title="step 7. Collect all signals in a superlist.">collectEqSigs</a>( eqSigs, superEqList );       
<a name="l00517"></a>00517     
<a name="l00518"></a>00518     <a class="code" href="classDocCompiler.html" title="Compile a list of FAUST signals into a list of LaTeX formulas.">DocCompiler</a>* DC = <span class="keyword">new</span> <a class="code" href="classDocCompiler.html" title="Compile a list of FAUST signals into a list of LaTeX formulas.">DocCompiler</a>(0, 0);
<a name="l00519"></a>00519     <a class="code" href="doc_8cpp.html#a22864a1de755e55e1745d94835f4693e" title="step 8. Annotate superlist.">annotateSuperList</a>( DC, superEqList );                                       
<a name="l00520"></a>00520     <span class="comment">//calcAndSetLtqNames( superEqList );                                        ///&lt; step 9. (directly in 10.)</span>
<a name="l00521"></a>00521     <a class="code" href="doc_8cpp.html#a8ea0ae61d941bbbebcd46d210d30356a" title="step 10. Compile equations.">mapCompileDocEqnSigs</a>( eqSigs, eqInputs, eqOutputs, DC, docCompiledEqnsVector );     
<a name="l00522"></a>00522 }
<a name="l00523"></a>00523 
<a name="l00524"></a>00524 
<a name="l00531"></a><a class="code" href="doc_8cpp.html#a8f96b34e1e673115ba649660bbf214eb">00531</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a8f96b34e1e673115ba649660bbf214eb" title="step 0. Feed doceqnInfosVector.">collectDocEqns</a>(<span class="keyword">const</span> vector&lt;Tree&gt;&amp; docBoxes, vector&lt;Tree&gt;&amp; eqBoxes)
<a name="l00532"></a>00532 {
<a name="l00533"></a>00533     <span class="keywordtype">int</span> nbdoceqn = 0;
<a name="l00534"></a>00534     
<a name="l00535"></a>00535     <span class="keywordflow">for</span> (vector&lt;Tree&gt;::const_iterator <a class="code" href="faustlexer_8cpp.html#a96015589396b70e34698a0887a19ad0a">doc</a>=docBoxes.begin(); <a class="code" href="faustlexer_8cpp.html#a96015589396b70e34698a0887a19ad0a">doc</a>&lt;docBoxes.end(); <a class="code" href="faustlexer_8cpp.html#a96015589396b70e34698a0887a19ad0a">doc</a>++) {
<a name="l00536"></a>00536         <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> L = <a class="code" href="list_8cpp.html#a8e15f8d6fcc6cd319059c2e0544145bb">reverse</a>(*<a class="code" href="faustlexer_8cpp.html#a96015589396b70e34698a0887a19ad0a">doc</a>);
<a name="l00537"></a>00537         <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> expr;
<a name="l00538"></a>00538         <span class="keywordflow">while</span> (<a class="code" href="list_8hh.html#a8bdd73641276e0c0f999f504348eacc1">isList</a>(L)) {
<a name="l00539"></a>00539             <span class="keywordflow">if</span> ( <a class="code" href="doc_8cpp.html#a8f5e00372043167fc1d7fe12532a020e">isDocEqn</a>(<a class="code" href="list_8hh.html#a067ad6f83087b420a1c44e48e56be389">hd</a>(L), expr) ) {
<a name="l00540"></a>00540                 eqBoxes.push_back(expr);
<a name="l00541"></a>00541                 nbdoceqn++;
<a name="l00542"></a>00542             }
<a name="l00543"></a>00543             L = <a class="code" href="list_8hh.html#a4075748f5c7156306ec898795313a2e0">tl</a>(L);
<a name="l00544"></a>00544         }
<a name="l00545"></a>00545     }
<a name="l00546"></a>00546     <span class="comment">//cerr &lt;&lt; &quot;Documentator : collectDocEqns : &quot; &lt;&lt; nbdoceqn &lt;&lt; &quot; &lt;equation&gt; tags found.&quot; &lt;&lt; endl;</span>
<a name="l00547"></a>00547 }
<a name="l00548"></a>00548 
<a name="l00549"></a>00549 
<a name="l00557"></a><a class="code" href="doc_8cpp.html#a5682d0a758c84ec80d20145b83c6ce2f">00557</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a5682d0a758c84ec80d20145b83c6ce2f" title="step 1. Evaluate boxes.">mapEvalDocEqn</a>(<span class="keyword">const</span> vector&lt;Tree&gt;&amp; eqBoxes, <span class="keyword">const</span> <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a>&amp; env, vector&lt;Tree&gt;&amp; evalEqBoxes)
<a name="l00558"></a>00558 {
<a name="l00559"></a>00559     <span class="comment">//cerr &lt;&lt; &quot;###\n# Documentator : mapEvalDocEqn&quot; &lt;&lt; endl;</span>
<a name="l00560"></a>00560     
<a name="l00561"></a>00561     <span class="keywordflow">for</span> ( vector&lt;Tree&gt;::const_iterator eq=eqBoxes.begin(); eq &lt; eqBoxes.end(); eq++)
<a name="l00562"></a>00562     {
<a name="l00563"></a>00563         evalEqBoxes.push_back(<a class="code" href="eval_8cpp.html#a4d1e61c6742d24447d08bddbbe341c1f">evaldocexpr</a>( *eq, env ));
<a name="l00564"></a>00564     }
<a name="l00565"></a>00565     <span class="comment">//cerr &lt;&lt; &quot;Documentator : end of mapEvalDocEqn\n---&quot; &lt;&lt; endl;</span>
<a name="l00566"></a>00566 }
<a name="l00567"></a>00567 
<a name="l00568"></a>00568 
<a name="l00575"></a><a class="code" href="doc_8cpp.html#a47ecfaa24354f79ef7b9b37c3ea0744d">00575</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a47ecfaa24354f79ef7b9b37c3ea0744d" title="step 2. Get boxes name.">mapGetEqName</a>(<span class="keyword">const</span> vector&lt;Tree&gt;&amp; evalEqBoxes, vector&lt;string&gt;&amp; eqNames)
<a name="l00576"></a>00576 {
<a name="l00577"></a>00577     <span class="comment">//cerr &lt;&lt; &quot;###\n# Documentator : mapGetEqName&quot; &lt;&lt; endl;</span>
<a name="l00578"></a>00578     
<a name="l00579"></a>00579     <span class="keywordtype">int</span> i = 1;
<a name="l00580"></a>00580     <span class="keywordflow">for</span>( vector&lt;Tree&gt;::const_iterator eq = evalEqBoxes.begin(); eq &lt; evalEqBoxes.end(); eq++, i++ ) {
<a name="l00581"></a>00581         <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> id;
<a name="l00582"></a>00582         <span class="keywordtype">string</span> s;
<a name="l00583"></a>00583         <span class="keywordtype">int</span> n,m; <a class="code" href="boxes_8hh.html#ac5c10eb592a85ecba6d6990f9f78010d" title="Return the type (number of inputs and outputs) of a box or false if undefined.">getBoxType</a>(*eq, &amp;n, &amp;m); <span class="comment">// eq name only for bd without inputs</span>
<a name="l00584"></a>00584         <span class="keywordflow">if</span> ( n==0 &amp;&amp; <a class="code" href="names_8cpp.html#afa6f89a686c004f84729e2bca7bf2053" title="Indicates the identifier (if any) the expression was a definition of.">getDefNameProperty</a>(*eq, <span class="keywordtype">id</span>) ) {
<a name="l00585"></a>00585             s = <a class="code" href="tree_8cpp.html#ac753d60778175e30a86cba647db017ad" title="if t has a node of type symbol, return its name otherwise error">tree2str</a>(<span class="keywordtype">id</span>);
<a name="l00586"></a>00586         }
<a name="l00587"></a>00587         <span class="keywordflow">else</span> {
<a name="l00588"></a>00588             s = <a class="code" href="doc_8cpp.html#a7347482365f605a414da25751bf1946f" title="Simply concat a string with a number in a &amp;quot;%03d&amp;quot; format.">calcNumberedName</a>(<span class="stringliteral">&quot;doceqn-&quot;</span>, i);
<a name="l00589"></a>00589         }       
<a name="l00590"></a>00590         eqNames.push_back( s ) ;
<a name="l00591"></a>00591     }
<a name="l00592"></a>00592     <span class="comment">//cerr &lt;&lt; &quot;Documentator : end of mapGetEqName\n---&quot; &lt;&lt; endl;</span>
<a name="l00593"></a>00593 }
<a name="l00594"></a>00594 
<a name="l00595"></a>00595 
<a name="l00605"></a><a class="code" href="doc_8cpp.html#a2b66e4aa1fc586d461378d44dce359de">00605</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a2b66e4aa1fc586d461378d44dce359de" title="step 3. Calculate nicknames.">calcEqnsNicknames</a>(<span class="keyword">const</span> vector&lt;string&gt;&amp; eqNames, vector&lt;string&gt;&amp; eqNicknames)
<a name="l00606"></a>00606 {
<a name="l00607"></a>00607     <span class="comment">//cerr &lt;&lt; &quot;###\n# Documentator : calcEqnsNicknames&quot; &lt;&lt; endl;</span>
<a name="l00608"></a>00608     
<a name="l00609"></a>00609     vector&lt;string&gt; v;
<a name="l00610"></a>00610     
<a name="l00611"></a>00611     <span class="keywordflow">for</span>( vector&lt;string&gt;::const_iterator eq = eqNames.begin(); eq &lt; eqNames.end(); eq++ ) {
<a name="l00612"></a>00612         <span class="keywordtype">string</span> init = <a class="code" href="doc_8cpp.html#abe0d6d1a67c5c2bd4e5cac7f6d021ca8" title="Calculate an appropriate nickname for equations, from previous names.">calcDocEqnInitial</a>(*eq);
<a name="l00613"></a>00613         v.push_back(init);
<a name="l00615"></a>00615 <span class="comment">//      for( vector&lt;string&gt;::iterator it = v.begin(); it &lt; v.end()-1; ++it ) {</span>
<a name="l00616"></a>00616 <span class="comment">//          if (init == *it) {</span>
<a name="l00617"></a>00617 <span class="comment">//              //cerr &lt;&lt; &quot;!! Warning Documentator : calcEqnsNicknames : duplicates \&quot;&quot; &lt;&lt; init &lt;&lt; &quot;\&quot;&quot; &lt;&lt; endl;</span>
<a name="l00618"></a>00618 <span class="comment">//          }</span>
<a name="l00619"></a>00619 <span class="comment">//      }</span>
<a name="l00620"></a>00620         eqNicknames.push_back(init);
<a name="l00621"></a>00621     }
<a name="l00622"></a>00622     
<a name="l00623"></a>00623 <span class="comment">//  for( vector&lt;string&gt;::const_iterator eq = eqNames.begin(); eq &lt; eqNames.end(); eq++ ) {</span>
<a name="l00624"></a>00624 <span class="comment">//      int c = 0;</span>
<a name="l00625"></a>00625 <span class="comment">//      c = count_if(eqNames.begin(), eqNames.end(), bind2nd(equal_to&lt;string&gt;(), *eq));</span>
<a name="l00626"></a>00626 <span class="comment">//      if (c &gt; 0) { </span>
<a name="l00627"></a>00627 <span class="comment">//          cerr &lt;&lt; &quot;- Duplicate nickname !! &quot; &lt;&lt; *eq &lt;&lt; endl; </span>
<a name="l00628"></a>00628 <span class="comment">//      } else {</span>
<a name="l00629"></a>00629 <span class="comment">//          cerr &lt;&lt; &quot;(no duplicate) &quot; &lt;&lt; *eq &lt;&lt; endl;</span>
<a name="l00630"></a>00630 <span class="comment">//      }</span>
<a name="l00631"></a>00631 <span class="comment">//  }</span>
<a name="l00632"></a>00632     
<a name="l00633"></a>00633     <span class="comment">//cerr &lt;&lt; &quot;Documentator : end of calcEqnsNicknames\n---&quot; &lt;&lt; endl;</span>
<a name="l00634"></a>00634 }
<a name="l00635"></a>00635 
<a name="l00636"></a>00636 
<a name="l00645"></a><a class="code" href="doc_8cpp.html#ad9ae7b77b222a446be950f6668e177a0">00645</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#ad9ae7b77b222a446be950f6668e177a0" title="step 4&amp;amp;5. Propagate and prepare signals.">mapPrepareEqSig</a>(<span class="keyword">const</span> vector&lt;Tree&gt;&amp; evalEqBoxes, vector&lt;int&gt;&amp; eqInputs, vector&lt;int&gt;&amp; eqOutputs, vector&lt;Tree&gt;&amp; eqSigs)
<a name="l00646"></a>00646 {
<a name="l00647"></a>00647     <span class="comment">//cerr &lt;&lt; &quot;###\n# Documentator : mapPrepareEqSig&quot; &lt;&lt; endl;</span>
<a name="l00648"></a>00648     
<a name="l00649"></a>00649     <span class="keywordflow">for</span>( vector&lt;Tree&gt;::const_iterator eq = evalEqBoxes.begin(); eq &lt; evalEqBoxes.end(); eq++ ) {
<a name="l00650"></a>00650         
<a name="l00651"></a>00651         <span class="keywordtype">int</span> numInputs, numOutputs;
<a name="l00652"></a>00652         <a class="code" href="doc_8cpp.html#a5ea5adac1568a1c91ea6f674a5eccef9" title="Just get the number of inputs and the number of outputs of a box.">getBoxInputsAndOutputs</a>(*eq, numInputs, numOutputs);
<a name="l00653"></a>00653         <span class="comment">//cerr &lt;&lt; numInputs &lt;&lt;&quot; ins and &quot; &lt;&lt; numOutputs &lt;&lt;&quot; outs&quot; &lt;&lt; endl;</span>
<a name="l00654"></a>00654         eqInputs.push_back(numInputs);
<a name="l00655"></a>00655         eqOutputs.push_back(numOutputs);
<a name="l00656"></a>00656         
<a name="l00657"></a>00657         <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> lsig1 = <a class="code" href="propagate_8cpp.html#a2c94521fac4766648f41758d1be4b089">boxPropagateSig</a>( <a class="code" href="list_8cpp.html#a538b704dd07794b7237108f1917c471e">nil</a>, *eq , <a class="code" href="propagate_8cpp.html#a06328b74db9d4726b9144cf9da9a3a17" title="Fabrique une liste de n entrées.">makeSigInputList</a>(numInputs) );
<a name="l00658"></a>00658         <span class="comment">//cerr &lt;&lt; &quot;output signals are : &quot; &lt;&lt; endl;  printSignal(lsig1, stderr);</span>
<a name="l00659"></a>00659         
<a name="l00660"></a>00660         <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> lsig2 = <a class="code" href="recursive-tree_8cpp.html#ab896f65486e6d80d4440721f2f89ff96">deBruijn2Sym</a>(lsig1);   
<a name="l00661"></a>00661         <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> lsig3 = <a class="code" href="simplify_8cpp.html#aa58ab1a209023cba186f077cfdcc5339">simplify</a>(lsig2);       
<a name="l00662"></a>00662         <span class="comment">//Tree lsig4 = privatise(lsig3);        ///&lt; Un-share tables with multiple writers</span>
<a name="l00663"></a>00663         <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> lsig4 = <a class="code" href="simplify_8cpp.html#a6a3298b9c61dc3351c7460dab1c9bbde">docTableConvertion</a>(lsig3);     
<a name="l00664"></a>00664 
<a name="l00665"></a>00665 
<a name="l00666"></a>00666         eqSigs.push_back(lsig4);
<a name="l00667"></a>00667     }
<a name="l00668"></a>00668     <span class="comment">//cerr &lt;&lt; &quot;Documentator : end of mapPrepareEqSig\n---&quot; &lt;&lt; endl;</span>
<a name="l00669"></a>00669 }
<a name="l00670"></a>00670 
<a name="l00671"></a>00671 
<a name="l00679"></a><a class="code" href="doc_8cpp.html#a84c0256c7510f01e97886d9174f05ff0">00679</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a84c0256c7510f01e97886d9174f05ff0" title="step 6. Set signals nicknames.">mapSetSigNickname</a>(<span class="keyword">const</span> vector&lt;string&gt;&amp; eqNicknames, <span class="keyword">const</span> vector&lt;int&gt;&amp; eqInputs, <span class="keyword">const</span> vector&lt;Tree&gt;&amp; eqSigs)
<a name="l00680"></a>00680 {
<a name="l00681"></a>00681     <span class="comment">//cerr &lt;&lt; &quot;###\n# Documentator : mapSetSigNickname&quot; &lt;&lt; endl;</span>
<a name="l00682"></a>00682 
<a name="l00683"></a>00683 <span class="comment">//  Do nothing for the moment...</span>
<a name="l00684"></a>00684 <span class="comment">//  for( unsigned int i=0; i &lt; eqSigs.size(); i++ ) {</span>
<a name="l00685"></a>00685 <span class="comment">//      if (eqInputs[i] == 0) // Only &quot;generators&quot; should be finally named with user equation (nick)name.</span>
<a name="l00686"></a>00686 <span class="comment">//          setSigListNickName(eqSigs[i], eqNicknames[i]);</span>
<a name="l00687"></a>00687 <span class="comment">//  }</span>
<a name="l00688"></a>00688     <span class="comment">//cerr &lt;&lt; &quot;Documentator : end of mapSetSigNickname\n---&quot; &lt;&lt; endl;</span>
<a name="l00689"></a>00689 }
<a name="l00690"></a>00690 
<a name="l00691"></a>00691 
<a name="l00698"></a><a class="code" href="doc_8cpp.html#a3e31ebbced12828da219b955542cdc27">00698</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a3e31ebbced12828da219b955542cdc27" title="step 7. Collect all signals in a superlist.">collectEqSigs</a>(<span class="keyword">const</span> vector&lt;Tree&gt;&amp; eqSigs, <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a>&amp; superEqList)
<a name="l00699"></a>00699 {
<a name="l00700"></a>00700     <span class="comment">//cerr &lt;&lt; &quot;###\n# Documentator : collectEqSigs&quot; &lt;&lt; endl;</span>
<a name="l00701"></a>00701     
<a name="l00702"></a>00702     superEqList = <a class="code" href="list_8cpp.html#a538b704dd07794b7237108f1917c471e">nil</a>;
<a name="l00703"></a>00703     
<a name="l00704"></a>00704     <span class="keywordflow">for</span>( vector&lt;Tree&gt;::const_iterator it = eqSigs.begin(); it &lt; eqSigs.end(); ++it ) {
<a name="l00705"></a>00705         superEqList = <a class="code" href="list_8hh.html#ae1ed153946fcfc025009c6d9c9c40bee">cons</a>( *it, superEqList );
<a name="l00706"></a>00706     }
<a name="l00707"></a>00707     <span class="comment">//printSignal(superEqList, stdout, 0);</span>
<a name="l00708"></a>00708     
<a name="l00709"></a>00709     <span class="comment">//cerr &lt;&lt; endl &lt;&lt; &quot;Documentator : end of collectEqSigs\n---&quot; &lt;&lt; endl;</span>
<a name="l00710"></a>00710 }
<a name="l00711"></a>00711 
<a name="l00712"></a>00712 
<a name="l00719"></a><a class="code" href="doc_8cpp.html#a22864a1de755e55e1745d94835f4693e">00719</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a22864a1de755e55e1745d94835f4693e" title="step 8. Annotate superlist.">annotateSuperList</a>(<a class="code" href="classDocCompiler.html" title="Compile a list of FAUST signals into a list of LaTeX formulas.">DocCompiler</a>* DC, <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> superEqList)
<a name="l00720"></a>00720 {
<a name="l00721"></a>00721     DC-&gt;<a class="code" href="classDocCompiler.html#aca50ec463d1edd5445f51783cb65ae76">annotate</a>(superEqList);
<a name="l00722"></a>00722 }
<a name="l00723"></a>00723 
<a name="l00724"></a>00724 
<a name="l00726"></a>00726 <span class="comment">// * #9. Calculated and set lateq (LaTeX equation) names.</span>
<a name="l00727"></a>00727 <span class="comment">// * Note : Transfered into mapCompileDocEqnSigs (DocCompiler::compileMultiSignal).</span>
<a name="l00728"></a>00728 <span class="comment">// */</span>
<a name="l00729"></a>00729 <span class="comment">//static void   calcAndSetLtqNames(Tree superEqList)</span>
<a name="l00730"></a>00730 <span class="comment">//{</span>
<a name="l00731"></a>00731 <span class="comment">//  </span>
<a name="l00732"></a>00732 <span class="comment">//}</span>
<a name="l00733"></a>00733 
<a name="l00734"></a>00734 
<a name="l00742"></a><a class="code" href="doc_8cpp.html#a8ea0ae61d941bbbebcd46d210d30356a">00742</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a8ea0ae61d941bbbebcd46d210d30356a" title="step 10. Compile equations.">mapCompileDocEqnSigs</a>(<span class="keyword">const</span> vector&lt;Tree&gt;&amp; eqSigs, <span class="keyword">const</span> vector&lt;int&gt;&amp; eqInputs, <span class="keyword">const</span> vector&lt;int&gt;&amp; eqOutputs, <a class="code" href="classDocCompiler.html" title="Compile a list of FAUST signals into a list of LaTeX formulas.">DocCompiler</a>* DC, vector&lt;Lateq*&gt;&amp; docCompiledEqnsVector)
<a name="l00743"></a>00743 {
<a name="l00744"></a>00744     <span class="comment">//cerr &lt;&lt; &quot;###\n# Documentator : mapCompileDocEqnSigs&quot; &lt;&lt; endl;</span>
<a name="l00745"></a>00745     
<a name="l00746"></a>00746     <span class="keywordflow">for</span>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i &lt; eqSigs.size(); i++ ) {
<a name="l00747"></a>00747         
<a name="l00748"></a>00748         <span class="comment">//      docCompiledEqnsVector.push_back( DC-&gt;compileMultiSignal(*it, 0) );</span>
<a name="l00749"></a>00749         docCompiledEqnsVector.push_back( DC-&gt;<a class="code" href="classDocCompiler.html#a951fa6dc2e893e0407cb3b544f3c9a2a">compileLateq</a>(eqSigs[i], <span class="keyword">new</span> <a class="code" href="classLateq.html">Lateq</a>(eqInputs[i], eqOutputs[i])) );
<a name="l00750"></a>00750     }
<a name="l00751"></a>00751     
<a name="l00752"></a>00752     <span class="comment">//cerr &lt;&lt; &quot;Documentator : end of mapCompileDocEqnSigs\n---&quot; &lt;&lt; endl;</span>
<a name="l00753"></a>00753 }
<a name="l00754"></a>00754 
<a name="l00755"></a>00755 
<a name="l00756"></a>00756 
<a name="l00757"></a>00757 <span class="comment">/*****************************************************************************</span>
<a name="l00758"></a>00758 <span class="comment">                Secondary sub-functions for &lt;equation&gt; handling</span>
<a name="l00759"></a>00759 <span class="comment"> *****************************************************************************/</span>
<a name="l00760"></a>00760 
<a name="l00761"></a>00761 
<a name="l00770"></a><a class="code" href="doc_8cpp.html#abe0d6d1a67c5c2bd4e5cac7f6d021ca8">00770</a> <span class="keyword">static</span> <span class="keywordtype">string</span> <a class="code" href="doc_8cpp.html#abe0d6d1a67c5c2bd4e5cac7f6d021ca8" title="Calculate an appropriate nickname for equations, from previous names.">calcDocEqnInitial</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> s)
<a name="l00771"></a>00771 {
<a name="l00772"></a>00772     <span class="keywordtype">string</span> nn;
<a name="l00773"></a>00773     <span class="keywordflow">if</span>(s == <span class="stringliteral">&quot;process&quot;</span>)
<a name="l00774"></a>00774         nn = <span class="stringliteral">&quot;Y&quot;</span>;
<a name="l00775"></a>00775     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (s.substr(0,6) == <span class="stringliteral">&quot;doceqn&quot;</span>)
<a name="l00776"></a>00776         nn = <span class="stringliteral">&quot;Z&quot;</span>;
<a name="l00777"></a>00777     <span class="keywordflow">else</span>
<a name="l00778"></a>00778         nn += toupper(s[0]);
<a name="l00779"></a>00779     <span class="keywordflow">return</span> nn;
<a name="l00780"></a>00780 }
<a name="l00781"></a>00781 
<a name="l00782"></a>00782 
<a name="l00790"></a><a class="code" href="doc_8cpp.html#a5ea5adac1568a1c91ea6f674a5eccef9">00790</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a5ea5adac1568a1c91ea6f674a5eccef9" title="Just get the number of inputs and the number of outputs of a box.">getBoxInputsAndOutputs</a>(<span class="keyword">const</span> <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> t, <span class="keywordtype">int</span>&amp; numInputs, <span class="keywordtype">int</span>&amp; numOutputs)
<a name="l00791"></a>00791 {
<a name="l00792"></a>00792     <span class="keywordflow">if</span> (!<a class="code" href="boxes_8hh.html#ac5c10eb592a85ecba6d6990f9f78010d" title="Return the type (number of inputs and outputs) of a box or false if undefined.">getBoxType</a>(t, &amp;numInputs, &amp;numOutputs)) {
<a name="l00793"></a>00793         cerr &lt;&lt; <span class="stringliteral">&quot;ERROR during the evaluation of t : &quot;</span> &lt;&lt; <a class="code" href="classboxpp.html">boxpp</a>(t) &lt;&lt; endl;
<a name="l00794"></a>00794         exit(1);
<a name="l00795"></a>00795     }
<a name="l00796"></a>00796     <span class="comment">//cerr &lt;&lt; &quot;Documentator : &quot; &lt;&lt; numInputs &lt;&lt;&quot; inputs and &quot; &lt;&lt; numOutputs &lt;&lt;&quot; outputs for box : &quot; &lt;&lt; boxpp(t) &lt;&lt; endl;</span>
<a name="l00797"></a>00797 }
<a name="l00798"></a>00798 
<a name="l00799"></a>00799 
<a name="l00806"></a><a class="code" href="doc_8cpp.html#a9c0f85706b52c4c57bfe6f54875c3813">00806</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a9c0f85706b52c4c57bfe6f54875c3813" title="Print doc equations, following the Lateq::println method.">printDocEqn</a>(<a class="code" href="classLateq.html">Lateq</a>* ltq, ostream&amp; docout) 
<a name="l00807"></a>00807 {
<a name="l00808"></a>00808     ltq-&gt;<a class="code" href="classLateq.html#a21dbc72f648ae58202a45996f5d5527e" title="Top-level method to print a whole set of compiled LaTeX formulas.">println</a>(docout);
<a name="l00809"></a>00809     <span class="comment">//cerr &lt;&lt; &quot;Documentator : printDocEqn : &quot;; ltq-&gt;println(cerr); cerr &lt;&lt; endl;</span>
<a name="l00810"></a>00810 }
<a name="l00811"></a>00811 
<a name="l00812"></a>00812 
<a name="l00813"></a>00813 <span class="comment">/*****************************************************************************</span>
<a name="l00814"></a>00814 <span class="comment">                    Sub-function for &lt;diagram&gt; handling</span>
<a name="l00815"></a>00815 <span class="comment"> *****************************************************************************/</span>
<a name="l00816"></a>00816 
<a name="l00829"></a><a class="code" href="doc_8cpp.html#a90774f58d14494c245c5003211c98a00">00829</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a90774f58d14494c245c5003211c98a00" title="Doc diagrams handling.">printDocDgm</a>(<span class="keyword">const</span> <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> expr, <span class="keyword">const</span> <span class="keywordtype">char</span>* svgTopDir, ostream&amp; docout, <span class="keywordtype">int</span> i)
<a name="l00830"></a>00830 {
<a name="l00832"></a>00832     <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> docdgm = <a class="code" href="eval_8cpp.html#a4d1e61c6742d24447d08bddbbe341c1f">evaldocexpr</a>(expr, gExpandedDefList);
<a name="l00833"></a>00833     <span class="keywordflow">if</span> (<a class="code" href="errormsg_8cpp.html#a446dbef8a744dce9d99bab7cf8c7d6d0">gErrorCount</a> &gt; 0) {
<a name="l00834"></a>00834         cerr &lt;&lt; <span class="stringliteral">&quot;Total of &quot;</span> &lt;&lt; <a class="code" href="errormsg_8cpp.html#a446dbef8a744dce9d99bab7cf8c7d6d0">gErrorCount</a> &lt;&lt; <span class="stringliteral">&quot; errors during evaluation of : diagram docdgm = &quot;</span> &lt;&lt; <a class="code" href="classboxpp.html">boxpp</a>(docdgm) &lt;&lt; <span class="stringliteral">&quot;;\n&quot;</span>;
<a name="l00835"></a>00835         exit(1);
<a name="l00836"></a>00836     }
<a name="l00837"></a>00837     
<a name="l00842"></a>00842     <span class="keywordtype">char</span> dgmid[<a class="code" href="doc_8cpp.html#a55ee21aeba68dbe17ffd10e4fd626690" title="max numbers (characters) to represent ids (e.g. for directories).">MAXIDCHARS</a>+1];
<a name="l00843"></a>00843     sprintf(dgmid, <span class="stringliteral">&quot;%02d&quot;</span>, i);
<a name="l00844"></a>00844     <span class="keywordtype">string</span> thisdgmdir = <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$0/svg-$1&quot;</span>, svgTopDir, dgmid);
<a name="l00845"></a>00845     <span class="comment">//cerr &lt;&lt; &quot;Documentator : printDocDgm : drawSchema in &#39;&quot; &lt;&lt; gCurrentDir &lt;&lt; &quot;/&quot; &lt;&lt; thisdgmdir &lt;&lt; &quot;&#39;&quot; &lt;&lt; endl;</span>
<a name="l00846"></a>00846     
<a name="l00847"></a>00847     <a class="code" href="drawschema_8cpp.html#a3be4e4d89005ef7378ba7e4c609efea2" title="The entry point to generate from a block diagram as a set of svg files stored in...">drawSchema</a>( docdgm, thisdgmdir.c_str(), <span class="stringliteral">&quot;svg&quot;</span> );
<a name="l00848"></a>00848     
<a name="l00850"></a>00850     <span class="keywordtype">char</span> temp[1024];
<a name="l00851"></a>00851     <span class="keyword">const</span> <span class="keywordtype">string</span> dgmfilename = <a class="code" href="doc_8cpp.html#a6fa98093fdea396358b0ea4e20e3821d" title="Transform the definition name property of tree &amp;lt;t&amp;gt; into a legal file name.">legalFileName</a>(docdgm, 1024, temp);
<a name="l00852"></a>00852     <span class="comment">//docout &lt;&lt; &quot;figure \\ref{figure&quot; &lt;&lt; i &lt;&lt; &quot;}&quot;;</span>
<a name="l00853"></a>00853     docout &lt;&lt; <span class="stringliteral">&quot;\\begin{figure}[ht!]&quot;</span> &lt;&lt; endl;
<a name="l00854"></a>00854     docout &lt;&lt; <span class="stringliteral">&quot;\t\\centering&quot;</span> &lt;&lt; endl;
<a name="l00855"></a>00855     docout &lt;&lt; <span class="stringliteral">&quot;\t\\includegraphics[width=\\textwidth]{&quot;</span> &lt;&lt; <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;../svg/svg-$0/&quot;</span>, dgmid) &lt;&lt; dgmfilename &lt;&lt; <span class="stringliteral">&quot;}&quot;</span> &lt;&lt; endl;
<a name="l00856"></a>00856     docout &lt;&lt; <span class="stringliteral">&quot;\t\\caption{block-diagram of \\texttt{&quot;</span> &lt;&lt; dgmfilename &lt;&lt; <span class="stringliteral">&quot;}}&quot;</span> &lt;&lt; endl;
<a name="l00857"></a>00857     docout &lt;&lt; <span class="stringliteral">&quot;\t\\label{figure&quot;</span> &lt;&lt; i &lt;&lt; <span class="stringliteral">&quot;}&quot;</span> &lt;&lt; endl;
<a name="l00858"></a>00858     docout &lt;&lt; <span class="stringliteral">&quot;\\end{figure}&quot;</span> &lt;&lt; endl &lt;&lt; endl;
<a name="l00859"></a>00859     
<a name="l00861"></a>00861     <a class="code" href="doc__notice_8cpp.html#a492e098f4f84d8c67a9060854d23e558" title="gDocNoticeFlagMap is public to let others turn to &amp;quot;true&amp;quot; flags that one...">gDocNoticeFlagMap</a>[<span class="stringliteral">&quot;nameconflicts&quot;</span>] = <span class="keyword">true</span>;
<a name="l00862"></a>00862     <a class="code" href="doc__notice_8cpp.html#a492e098f4f84d8c67a9060854d23e558" title="gDocNoticeFlagMap is public to let others turn to &amp;quot;true&amp;quot; flags that one...">gDocNoticeFlagMap</a>[<span class="stringliteral">&quot;svgdir&quot;</span>] = <span class="keyword">true</span>;
<a name="l00863"></a>00863 }
<a name="l00864"></a>00864 
<a name="l00865"></a>00865 
<a name="l00866"></a>00866 
<a name="l00867"></a>00867 <span class="comment">//------------------------ dealing with files -------------------------</span>
<a name="l00868"></a>00868 
<a name="l00869"></a>00869 
<a name="l00873"></a><a class="code" href="doc_8cpp.html#a39b3d8237212f926fd704b35fcb7becd">00873</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="doc_8cpp.html#a39b3d8237212f926fd704b35fcb7becd" title="Create a new directory in the current one.">makedir</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="main_8cpp.html#a678e1ef3077e128e543805a7381066f9">dirname</a>)
<a name="l00874"></a>00874 {
<a name="l00875"></a>00875     <span class="keywordtype">char</span>    buffer[<a class="code" href="compatibility_8hh.html#a3bf18fd70de2efe183049cb028875fe2">FAUST_PATH_MAX</a>];
<a name="l00876"></a>00876     <a class="code" href="doc_8cpp.html#a0c91ed41a90a100a2570f4d993c6e16a" title="Room to save current directory name.">gCurrentDir</a> = getcwd (buffer, <a class="code" href="compatibility_8hh.html#a3bf18fd70de2efe183049cb028875fe2">FAUST_PATH_MAX</a>);
<a name="l00877"></a>00877     
<a name="l00878"></a>00878     <span class="keywordflow">if</span> ( <a class="code" href="doc_8cpp.html#a0c91ed41a90a100a2570f4d993c6e16a" title="Room to save current directory name.">gCurrentDir</a>.c_str() != 0) {
<a name="l00879"></a>00879         <span class="keywordtype">int</span> status = mkdir(dirname, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
<a name="l00880"></a>00880         <span class="keywordflow">if</span> (status == 0 || errno == EEXIST) {
<a name="l00881"></a>00881             <span class="keywordflow">return</span> 0;
<a name="l00882"></a>00882         }
<a name="l00883"></a>00883     }
<a name="l00884"></a>00884     perror(<span class="stringliteral">&quot;makedir&quot;</span>);
<a name="l00885"></a>00885     exit(errno);
<a name="l00886"></a>00886 }
<a name="l00887"></a>00887 
<a name="l00888"></a>00888 
<a name="l00896"></a><a class="code" href="doc_8cpp.html#a4ba32ce8ec678ffbdf068a4483543239">00896</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="doc_8cpp.html#a4ba32ce8ec678ffbdf068a4483543239" title="Create a new directory in the current one, then &amp;#39;cd&amp;#39; into this new directory...">mkchdir</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="main_8cpp.html#a678e1ef3077e128e543805a7381066f9">dirname</a>)
<a name="l00897"></a>00897 {
<a name="l00898"></a>00898     <span class="keywordtype">char</span>    buffer[<a class="code" href="compatibility_8hh.html#a3bf18fd70de2efe183049cb028875fe2">FAUST_PATH_MAX</a>];
<a name="l00899"></a>00899     <a class="code" href="doc_8cpp.html#a0c91ed41a90a100a2570f4d993c6e16a" title="Room to save current directory name.">gCurrentDir</a> = getcwd (buffer, <a class="code" href="compatibility_8hh.html#a3bf18fd70de2efe183049cb028875fe2">FAUST_PATH_MAX</a>);
<a name="l00900"></a>00900 
<a name="l00901"></a>00901     <span class="keywordflow">if</span> ( <a class="code" href="doc_8cpp.html#a0c91ed41a90a100a2570f4d993c6e16a" title="Room to save current directory name.">gCurrentDir</a>.c_str() != 0) {
<a name="l00902"></a>00902         <span class="keywordtype">int</span> status = mkdir(dirname, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
<a name="l00903"></a>00903         <span class="keywordflow">if</span> (status == 0 || errno == EEXIST) {
<a name="l00904"></a>00904             <span class="keywordflow">if</span> (chdir(dirname) == 0) {
<a name="l00905"></a>00905                 <span class="keywordflow">return</span> 0;
<a name="l00906"></a>00906             }
<a name="l00907"></a>00907         }
<a name="l00908"></a>00908     }
<a name="l00909"></a>00909     perror(<span class="stringliteral">&quot;mkchdir&quot;</span>);
<a name="l00910"></a>00910     exit(errno);
<a name="l00911"></a>00911 }
<a name="l00912"></a>00912 
<a name="l00913"></a>00913 
<a name="l00917"></a><a class="code" href="doc_8cpp.html#aa993eaaab62326b7ec82db3ac19d420c">00917</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="doc_8cpp.html#aa993eaaab62326b7ec82db3ac19d420c" title="Switch back to the previously stored current directory.">cholddir</a> ()
<a name="l00918"></a>00918 {
<a name="l00919"></a>00919     <span class="keywordflow">if</span> (chdir(<a class="code" href="doc_8cpp.html#a0c91ed41a90a100a2570f4d993c6e16a" title="Room to save current directory name.">gCurrentDir</a>.c_str()) == 0) {
<a name="l00920"></a>00920         <span class="keywordflow">return</span> 0;
<a name="l00921"></a>00921     } <span class="keywordflow">else</span> {
<a name="l00922"></a>00922         perror(<span class="stringliteral">&quot;cholddir&quot;</span>);
<a name="l00923"></a>00923         exit(errno);
<a name="l00924"></a>00924     }
<a name="l00925"></a>00925 }
<a name="l00926"></a>00926 
<a name="l00927"></a>00927 
<a name="l00931"></a><a class="code" href="doc_8cpp.html#a93f175441540044bcefdcd1a8736d43b">00931</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a93f175441540044bcefdcd1a8736d43b" title="Get current directory and store it in gCurrentDir.">getCurrentDir</a> ()
<a name="l00932"></a>00932 {
<a name="l00933"></a>00933     <span class="keywordtype">char</span>    buffer[<a class="code" href="compatibility_8hh.html#a3bf18fd70de2efe183049cb028875fe2">FAUST_PATH_MAX</a>];
<a name="l00934"></a>00934     <a class="code" href="doc_8cpp.html#a0c91ed41a90a100a2570f4d993c6e16a" title="Room to save current directory name.">gCurrentDir</a> = getcwd (buffer, <a class="code" href="compatibility_8hh.html#a3bf18fd70de2efe183049cb028875fe2">FAUST_PATH_MAX</a>);
<a name="l00935"></a>00935 }
<a name="l00936"></a>00936 
<a name="l00937"></a>00937 
<a name="l00941"></a><a class="code" href="doc_8cpp.html#a56d99634f77c578d4704e016bfe61331">00941</a> <span class="keyword">static</span> istream* <a class="code" href="doc_8cpp.html#a56d99634f77c578d4704e016bfe61331" title="Open architecture file.">openArchFile</a> (<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; filename)
<a name="l00942"></a>00942 {
<a name="l00943"></a>00943     istream* file;
<a name="l00944"></a>00944     <a class="code" href="doc_8cpp.html#a93f175441540044bcefdcd1a8736d43b" title="Get current directory and store it in gCurrentDir.">getCurrentDir</a>();    <span class="comment">// Save the current directory.</span>
<a name="l00945"></a>00945     <span class="comment">//cerr &lt;&lt; &quot;Documentator : openArchFile : Opening input file  &#39;&quot; &lt;&lt; filename &lt;&lt; &quot;&#39;&quot; &lt;&lt; endl;</span>
<a name="l00946"></a>00946     <span class="keywordflow">if</span> ( (file = <a class="code" href="enrobage_8cpp.html#a901a730cc8136f70a2073da23fafa61e" title="Try to open an architecture file searching in various directories.">open_arch_stream</a>(filename.c_str())) ) {
<a name="l00947"></a>00947         <span class="comment">//cerr &lt;&lt; &quot;Documentator : openArchFile : Opening &#39;&quot; &lt;&lt; filename &lt;&lt; &quot;&#39;&quot; &lt;&lt; endl;</span>
<a name="l00948"></a>00948     } <span class="keywordflow">else</span> {
<a name="l00949"></a>00949         cerr &lt;&lt; <span class="stringliteral">&quot;ERROR : can&#39;t open architecture file &quot;</span> &lt;&lt; filename &lt;&lt; endl;
<a name="l00950"></a>00950         exit(1);
<a name="l00951"></a>00951     }
<a name="l00952"></a>00952     <a class="code" href="doc_8cpp.html#aa993eaaab62326b7ec82db3ac19d420c" title="Switch back to the previously stored current directory.">cholddir</a>();         <span class="comment">// Return to current directory.</span>
<a name="l00953"></a>00953     <span class="keywordflow">return</span> file;
<a name="l00954"></a>00954 }
<a name="l00955"></a>00955 
<a name="l00956"></a>00956 
<a name="l00963"></a><a class="code" href="doc_8cpp.html#a6fa98093fdea396358b0ea4e20e3821d">00963</a> <span class="keyword">static</span> <span class="keywordtype">char</span>* <a class="code" href="doc_8cpp.html#a6fa98093fdea396358b0ea4e20e3821d" title="Transform the definition name property of tree &amp;lt;t&amp;gt; into a legal file name.">legalFileName</a>(<span class="keyword">const</span> <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> t, <span class="keywordtype">int</span> n, <span class="keywordtype">char</span>* dst)
<a name="l00964"></a>00964 {
<a name="l00965"></a>00965     <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a>    id;
<a name="l00966"></a>00966     <span class="keywordtype">int</span>     i=0;
<a name="l00967"></a>00967     <span class="keywordflow">if</span> (<a class="code" href="names_8cpp.html#afa6f89a686c004f84729e2bca7bf2053" title="Indicates the identifier (if any) the expression was a definition of.">getDefNameProperty</a>(t, <span class="keywordtype">id</span>)) {
<a name="l00968"></a>00968         <span class="keyword">const</span> <span class="keywordtype">char</span>*     src = <a class="code" href="tree_8cpp.html#ac753d60778175e30a86cba647db017ad" title="if t has a node of type symbol, return its name otherwise error">tree2str</a>(<span class="keywordtype">id</span>);
<a name="l00969"></a>00969         <span class="keywordflow">for</span> (i=0; isalnum(src[i]) &amp;&amp; i&lt;16; i++) {
<a name="l00970"></a>00970             dst[i] = src[i];
<a name="l00971"></a>00971         }
<a name="l00972"></a>00972     }
<a name="l00973"></a>00973     dst[i] = 0;
<a name="l00974"></a>00974     <span class="keywordflow">if</span> (strcmp(dst, <span class="stringliteral">&quot;process&quot;</span>) != 0) { 
<a name="l00975"></a>00975         <span class="comment">// if it is not process add the hex address to make the name unique</span>
<a name="l00976"></a>00976         snprintf(&amp;dst[i], n-i, <span class="stringliteral">&quot;-%p&quot;</span>, t);
<a name="l00977"></a>00977     }
<a name="l00978"></a>00978     <span class="keywordflow">return</span> dst;
<a name="l00979"></a>00979 }
<a name="l00980"></a>00980 
<a name="l00985"></a><a class="code" href="doc_8cpp.html#a7347482365f605a414da25751bf1946f">00985</a> <span class="keyword">static</span> <span class="keywordtype">string</span> <a class="code" href="doc_8cpp.html#a7347482365f605a414da25751bf1946f" title="Simply concat a string with a number in a &amp;quot;%03d&amp;quot; format.">calcNumberedName</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* base, <span class="keywordtype">int</span> i)
<a name="l00986"></a>00986 {
<a name="l00987"></a>00987     <span class="keywordtype">char</span> nb[<a class="code" href="doc_8cpp.html#a55ee21aeba68dbe17ffd10e4fd626690" title="max numbers (characters) to represent ids (e.g. for directories).">MAXIDCHARS</a>+1];
<a name="l00988"></a>00988     sprintf(nb, <span class="stringliteral">&quot;%03d&quot;</span>, i);
<a name="l00989"></a>00989     <span class="keywordflow">return</span> <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$0$1&quot;</span>, base, nb);
<a name="l00990"></a>00990 }
<a name="l00991"></a>00991 
<a name="l00996"></a><a class="code" href="doc_8cpp.html#a016b1cbb37d2aee62272c6c955e4e078">00996</a> <span class="keyword">static</span> <span class="keywordtype">string</span> <a class="code" href="doc_8cpp.html#a016b1cbb37d2aee62272c6c955e4e078" title="Remove the leading and trailing double quotes of a string (but not those in the middle...">rmExternalDoubleQuotes</a>(<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; s)
<a name="l00997"></a>00997 {
<a name="l00998"></a>00998     <span class="keywordtype">size_t</span> i = s.find_first_not_of(<span class="stringliteral">&quot;\&quot;&quot;</span>);
<a name="l00999"></a>00999     <span class="keywordtype">size_t</span> j = s.find_last_not_of(<span class="stringliteral">&quot;\&quot;&quot;</span>);
<a name="l01000"></a>01000     
<a name="l01001"></a>01001     <span class="keywordflow">if</span> ( (i != string::npos) &amp; (j != string::npos) ) {
<a name="l01002"></a>01002         <span class="keywordflow">return</span> s.substr(i, 1+j-i);
<a name="l01003"></a>01003     } <span class="keywordflow">else</span> {
<a name="l01004"></a>01004         <span class="keywordflow">return</span> <span class="stringliteral">&quot;&quot;</span>;
<a name="l01005"></a>01005     }
<a name="l01006"></a>01006 }
<a name="l01007"></a>01007 
<a name="l01008"></a>01008 
<a name="l01015"></a><a class="code" href="doc_8cpp.html#a375460f577b0036b379b7fbba6c328ae">01015</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a375460f577b0036b379b7fbba6c328ae" title="Copy all Faust source files into an &amp;#39;src&amp;#39; subdirectory.">copyFaustSources</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* projname, <span class="keyword">const</span> vector&lt;string&gt;&amp; pathnames)
<a name="l01016"></a>01016 {
<a name="l01017"></a>01017     <span class="keywordtype">string</span> srcdir = <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$0/src&quot;</span>, projname);
<a name="l01018"></a>01018     <span class="comment">//cerr &lt;&lt; &quot;Documentator : copyFaustSources : Creating directory &#39;&quot; &lt;&lt; srcdir &lt;&lt; &quot;&#39;&quot; &lt;&lt; endl;</span>
<a name="l01019"></a>01019     <a class="code" href="doc_8cpp.html#a39b3d8237212f926fd704b35fcb7becd" title="Create a new directory in the current one.">makedir</a>(srcdir.c_str());    <span class="comment">// create a directory.</span>
<a name="l01020"></a>01020         
<a name="l01021"></a>01021     <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i&lt; pathnames.size(); i++) {
<a name="l01022"></a>01022         ifstream src;
<a name="l01023"></a>01023         ofstream dst;
<a name="l01024"></a>01024         <span class="keywordtype">string</span> faustfile = pathnames[i];
<a name="l01025"></a>01025         <span class="keywordtype">string</span> copy = <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$0/$1&quot;</span>, srcdir, <a class="code" href="enrobage_8cpp.html#a73496d20a5f06ebb81a3ce1cc6d39877">filebasename</a>(faustfile.c_str()));
<a name="l01026"></a>01026         <span class="comment">//cerr &lt;&lt; &quot;Documentator : copyFaustSources : Opening input file  &#39;&quot; &lt;&lt; faustfile &lt;&lt; &quot;&#39;&quot; &lt;&lt; endl;</span>
<a name="l01027"></a>01027         <span class="comment">//cerr &lt;&lt; &quot;Documentator : copyFaustSources : Opening output file &#39;&quot; &lt;&lt; copy &lt;&lt; &quot;&#39;&quot; &lt;&lt; endl;</span>
<a name="l01028"></a>01028         src.open(faustfile.c_str(), ifstream::in);
<a name="l01029"></a>01029         dst.open(copy.c_str(), ofstream::out);
<a name="l01030"></a>01030         <span class="keywordtype">string</span>  s;
<a name="l01031"></a>01031         <span class="keywordflow">while</span> ( getline(src,s) ) dst &lt;&lt; s &lt;&lt; endl;
<a name="l01032"></a>01032     }
<a name="l01033"></a>01033 }
<a name="l01034"></a>01034 
<a name="l01035"></a>01035 
<a name="l01036"></a>01036 <span class="comment">//------------------------ date managment -------------------------</span>
<a name="l01037"></a>01037 
<a name="l01038"></a>01038 
<a name="l01039"></a><a class="code" href="doc_8cpp.html#a3fb97c3dc5609c5e01797548c69ff295">01039</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="doc_8cpp.html#a3fb97c3dc5609c5e01797548c69ff295">initCompilationDate</a>()
<a name="l01040"></a>01040 {
<a name="l01041"></a>01041     time_t now;
<a name="l01042"></a>01042     
<a name="l01043"></a>01043     time(&amp;now);
<a name="l01044"></a>01044     <a class="code" href="doc_8cpp.html#ae57fb3f71c6b5070eaf01b4c6837ff1b">gCompilationDate</a> = *localtime(&amp;now);
<a name="l01045"></a>01045 }
<a name="l01046"></a>01046 
<a name="l01047"></a><a class="code" href="doc_8cpp.html#a0a871f44fa7d57075fcc6e7f835ba913">01047</a> <span class="keyword">static</span> <span class="keyword">struct </span>tm* <a class="code" href="doc_8cpp.html#a0a871f44fa7d57075fcc6e7f835ba913">getCompilationDate</a>()
<a name="l01048"></a>01048 {
<a name="l01049"></a>01049     <a class="code" href="doc_8cpp.html#a3fb97c3dc5609c5e01797548c69ff295">initCompilationDate</a>();
<a name="l01050"></a>01050     <span class="keywordflow">return</span> &amp;<a class="code" href="doc_8cpp.html#ae57fb3f71c6b5070eaf01b4c6837ff1b">gCompilationDate</a>;
<a name="l01051"></a>01051 }
<a name="l01052"></a>01052 
</pre></div></div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Wed Apr 28 23:59:58 2010 for FAUST compiler by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>