Sophie

Sophie

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

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: main.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>main.cpp</h1><a href="main_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) 2003-2004 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><a class="code" href="main_8cpp.html#ab2518c0a1e64ec42eae9a7fee0e716b0">00021</a> <span class="preprocessor">#define FAUSTVERSION &quot;0.9.10&quot;</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;string.h&gt;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;assert.h&gt;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;sys/time.h&gt;</span>
<a name="l00027"></a>00027 
<a name="l00028"></a>00028 <span class="preprocessor">#include &quot;libgen.h&quot;</span>
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 <span class="preprocessor">#include &quot;<a class="code" href="compatibility_8hh.html">compatibility.hh</a>&quot;</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &quot;<a class="code" href="signals_8hh.html">signals.hh</a>&quot;</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include &quot;<a class="code" href="sigtype_8hh.html">sigtype.hh</a>&quot;</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include &quot;<a class="code" href="sigtyperules_8hh.html">sigtyperules.hh</a>&quot;</span>
<a name="l00034"></a>00034 <span class="preprocessor">#include &quot;<a class="code" href="sigprint_8hh.html">sigprint.hh</a>&quot;</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include &quot;<a class="code" href="simplify_8hh.html">simplify.hh</a>&quot;</span>
<a name="l00036"></a>00036 <span class="preprocessor">#include &quot;<a class="code" href="privatise_8hh.html">privatise.hh</a>&quot;</span>
<a name="l00037"></a>00037 
<a name="l00038"></a>00038 <span class="preprocessor">#include &quot;<a class="code" href="compile__scal_8hh.html">compile_scal.hh</a>&quot;</span>
<a name="l00039"></a>00039 <span class="preprocessor">#include &quot;<a class="code" href="compile__vect_8hh.html">compile_vect.hh</a>&quot;</span>
<a name="l00040"></a>00040 <span class="preprocessor">#include &quot;<a class="code" href="propagate_8hh.html">propagate.hh</a>&quot;</span>
<a name="l00041"></a>00041 <span class="preprocessor">#include &quot;<a class="code" href="errormsg_8hh.html">errormsg.hh</a>&quot;</span>
<a name="l00042"></a>00042 <span class="preprocessor">#include &quot;<a class="code" href="ppbox_8hh.html">ppbox.hh</a>&quot;</span>
<a name="l00043"></a>00043 <span class="preprocessor">#include &quot;<a class="code" href="enrobage_8hh.html">enrobage.hh</a>&quot;</span>
<a name="l00044"></a>00044 <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="l00045"></a>00045 <span class="preprocessor">#include &quot;<a class="code" href="description_8hh.html">description.hh</a>&quot;</span>
<a name="l00046"></a>00046 <span class="preprocessor">#include &quot;<a class="code" href="floats_8hh.html">floats.hh</a>&quot;</span>
<a name="l00047"></a>00047 <span class="preprocessor">#include &quot;<a class="code" href="doc_8hh.html">doc.hh</a>&quot;</span>
<a name="l00048"></a>00048 
<a name="l00049"></a>00049 <span class="preprocessor">#include &lt;map&gt;</span>
<a name="l00050"></a>00050 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00051"></a>00051 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00052"></a>00052 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00053"></a>00053 <span class="preprocessor">#include &lt;fstream&gt;</span>
<a name="l00054"></a>00054 <span class="preprocessor">#include &lt;sstream&gt;</span>
<a name="l00055"></a>00055 
<a name="l00056"></a>00056 <span class="preprocessor">#ifndef WIN32</span>
<a name="l00057"></a>00057 <span class="preprocessor"></span><span class="preprocessor">#include &lt;unistd.h&gt;</span>
<a name="l00058"></a>00058 <span class="preprocessor">#endif</span>
<a name="l00059"></a>00059 <span class="preprocessor"></span>
<a name="l00060"></a>00060 <span class="preprocessor">#include &quot;<a class="code" href="sourcereader_8hh.html">sourcereader.hh</a>&quot;</span>
<a name="l00061"></a>00061 
<a name="l00062"></a>00062 
<a name="l00063"></a>00063 <span class="comment">// construction des representations graphiques</span>
<a name="l00064"></a>00064 
<a name="l00065"></a>00065 <span class="preprocessor">#include &quot;<a class="code" href="schema_8h.html">schema.h</a>&quot;</span>
<a name="l00066"></a>00066 <span class="preprocessor">#include &quot;<a class="code" href="drawschema_8hh.html">drawschema.hh</a>&quot;</span>
<a name="l00067"></a>00067 <span class="preprocessor">#include &quot;<a class="code" href="timing_8hh.html">timing.hh</a>&quot;</span>
<a name="l00068"></a>00068 
<a name="l00069"></a>00069 <span class="keyword">using namespace </span>std ;
<a name="l00070"></a>00070 
<a name="l00071"></a>00071 
<a name="l00072"></a>00072 <span class="comment">/****************************************************************</span>
<a name="l00073"></a>00073 <span class="comment">                        Parser variables</span>
<a name="l00074"></a>00074 <span class="comment">*****************************************************************/</span>
<a name="l00075"></a>00075 
<a name="l00076"></a>00076 
<a name="l00077"></a>00077 <span class="keywordtype">int</span> <a class="code" href="main_8cpp.html#acd8617a8f2ac0de8bc1cc032cf449e19">yyparse</a>();
<a name="l00078"></a>00078 
<a name="l00079"></a><a class="code" href="sourcereader_8cpp.html#a22b78670f95f7470a7b16ec70f68c918">00079</a> <span class="keywordtype">int</span>             <a class="code" href="main_8cpp.html#a22b78670f95f7470a7b16ec70f68c918">yyerr</a>;
<a name="l00080"></a>00080 <span class="keyword">extern</span> <span class="keywordtype">int</span>      <a class="code" href="main_8cpp.html#ab138aa8e11f58bcdcc7134adf240ea8c">yydebug</a>;
<a name="l00081"></a>00081 <span class="keyword">extern</span> FILE*    <a class="code" href="main_8cpp.html#a87a127afa8f6c307fbfba10390675406">yyin</a>;
<a name="l00082"></a><a class="code" href="sourcereader_8cpp.html#ae03dedba3e2f093ff36261c5c37b576c">00082</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="main_8cpp.html#ae03dedba3e2f093ff36261c5c37b576c">gResult</a>;
<a name="l00083"></a><a class="code" href="sourcereader_8cpp.html#ac9117773cdede043e83f4b32404999b0">00083</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="main_8cpp.html#ac9117773cdede043e83f4b32404999b0">gResult2</a>;
<a name="l00084"></a>00084 
<a name="l00085"></a><a class="code" href="main_8cpp.html#af59bae68e0652dd8c1ecbf661cbe8373">00085</a> <a class="code" href="classSourceReader.html">SourceReader</a>    <a class="code" href="doc_8cpp.html#af59bae68e0652dd8c1ecbf661cbe8373">gReader</a>;
<a name="l00086"></a>00086 
<a name="l00087"></a><a class="code" href="sourcereader_8cpp.html#aaf647729deae314d35817ccb36f088e4">00087</a> map&lt;Tree, set&lt;Tree&gt; &gt; <a class="code" href="doc_8cpp.html#aaf647729deae314d35817ccb36f088e4">gMetaDataSet</a>;
<a name="l00088"></a>00088 <span class="keyword">extern</span> 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="l00089"></a>00089 <span class="keyword">extern</span> <span class="keywordtype">string</span> <a class="code" href="doc_8cpp.html#ac83dd0bfbc11705a903a395da7bc0f7c">gDocLang</a>;
<a name="l00090"></a>00090 
<a name="l00091"></a>00091 
<a name="l00092"></a>00092 <span class="comment">/****************************************************************</span>
<a name="l00093"></a>00093 <span class="comment">                Command line tools and arguments</span>
<a name="l00094"></a>00094 <span class="comment">*****************************************************************/</span>
<a name="l00095"></a>00095 
<a name="l00096"></a>00096 <span class="comment">//-- globals</span>
<a name="l00097"></a><a class="code" href="enrobage_8cpp.html#a09fc40a224a32f929decbac5a21140ef">00097</a> <span class="keywordtype">string</span>          <a class="code" href="doc_8cpp.html#a09fc40a224a32f929decbac5a21140ef">gFaustSuperSuperDirectory</a>;
<a name="l00098"></a><a class="code" href="enrobage_8cpp.html#a2529dab7cac84bd8f69c14ee8a3cbfe2">00098</a> <span class="keywordtype">string</span>          <a class="code" href="doc_8cpp.html#a2529dab7cac84bd8f69c14ee8a3cbfe2">gFaustSuperDirectory</a>;
<a name="l00099"></a><a class="code" href="enrobage_8cpp.html#a320fc936026f318a3fc46f47ef379713">00099</a> <span class="keywordtype">string</span>          <a class="code" href="doc_8cpp.html#a320fc936026f318a3fc46f47ef379713">gFaustDirectory</a>;
<a name="l00100"></a><a class="code" href="sourcereader_8cpp.html#a1c0fac9c77fcd7f4e21daf398e9830de">00100</a> <span class="keywordtype">string</span>          <a class="code" href="doc_8cpp.html#a1c0fac9c77fcd7f4e21daf398e9830de">gMasterDocument</a>;
<a name="l00101"></a><a class="code" href="enrobage_8cpp.html#aea493812dd4a239a7c0d354d5a07e191">00101</a> <span class="keywordtype">string</span>          <a class="code" href="main_8cpp.html#aea493812dd4a239a7c0d354d5a07e191">gMasterDirectory</a>;
<a name="l00102"></a><a class="code" href="main_8cpp.html#ac8a7f14cf003853871e19ebab4cfaaf3">00102</a> <span class="keywordtype">string</span>          <a class="code" href="compile_8cpp.html#ac8a7f14cf003853871e19ebab4cfaaf3">gMasterName</a>;
<a name="l00103"></a><a class="code" href="main_8cpp.html#a90baf99fd6ffa7248d895c7d33e0a8cf">00103</a> <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="main_8cpp.html#a52086e1c3e02821c4ce3f5a0626c2662">00104</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#a52086e1c3e02821c4ce3f5a0626c2662">gExpandedDefList</a>;
<a name="l00105"></a>00105 
<a name="l00106"></a>00106 <span class="comment">//-- command line arguments</span>
<a name="l00107"></a>00107 
<a name="l00108"></a><a class="code" href="main_8cpp.html#ae7413fae6c13f3d34e3d1020a9897b5c">00108</a> <span class="keywordtype">bool</span>            <a class="code" href="main_8cpp.html#ae7413fae6c13f3d34e3d1020a9897b5c">gHelpSwitch</a>     = <span class="keyword">false</span>;
<a name="l00109"></a><a class="code" href="main_8cpp.html#a52169162f1a48c61e3a49eb5a9f6444c">00109</a> <span class="keywordtype">bool</span>            <a class="code" href="main_8cpp.html#a52169162f1a48c61e3a49eb5a9f6444c">gVersionSwitch</a>  = <span class="keyword">false</span>;
<a name="l00110"></a><a class="code" href="main_8cpp.html#a4741733b16ad8f554a8b5c0ca5045d14">00110</a> <span class="keywordtype">bool</span>            <a class="code" href="doc_8cpp.html#a4741733b16ad8f554a8b5c0ca5045d14">gDetailsSwitch</a>  = <span class="keyword">false</span>;
<a name="l00111"></a><a class="code" href="main_8cpp.html#a595b1bcec2a76e15debe16ac5ab703d4">00111</a> <span class="keywordtype">bool</span>            <a class="code" href="SVGDev_8cpp.html#a595b1bcec2a76e15debe16ac5ab703d4">gShadowBlur</a>     = <span class="keyword">false</span>;
<a name="l00112"></a><a class="code" href="main_8cpp.html#a4d67cde178e71e63a2105ee41d8d0ecf">00112</a> <span class="keywordtype">bool</span>            <a class="code" href="main_8cpp.html#a4d67cde178e71e63a2105ee41d8d0ecf">gDrawPSSwitch</a>   = <span class="keyword">false</span>;
<a name="l00113"></a><a class="code" href="main_8cpp.html#a7d66485c9ad80b79c55997ac2acc24f3">00113</a> <span class="keywordtype">bool</span>            <a class="code" href="main_8cpp.html#a7d66485c9ad80b79c55997ac2acc24f3">gDrawSVGSwitch</a>  = <span class="keyword">false</span>;
<a name="l00114"></a><a class="code" href="main_8cpp.html#aa9bf768c06070d9ba7d953ce5158e577">00114</a> <span class="keywordtype">bool</span>            <a class="code" href="main_8cpp.html#aa9bf768c06070d9ba7d953ce5158e577">gPrintXMLSwitch</a> = <span class="keyword">false</span>;
<a name="l00115"></a><a class="code" href="main_8cpp.html#a2779bb51324faa59c44edeba85ba6681">00115</a> <span class="keywordtype">bool</span>            <a class="code" href="main_8cpp.html#a2779bb51324faa59c44edeba85ba6681">gPrintDocSwitch</a> = <span class="keyword">false</span>;
<a name="l00116"></a><a class="code" href="sourcereader_8cpp.html#a232019c7c8d19c2297386944419f66d2">00116</a> <span class="keywordtype">bool</span>            <a class="code" href="main_8cpp.html#a232019c7c8d19c2297386944419f66d2">gLatexDocSwitch</a> = <span class="keyword">true</span>;     <span class="comment">// Only LaTeX outformat is handled for the moment.</span>
<a name="l00117"></a><a class="code" href="main_8cpp.html#a88af9e6ad20008837e470be54b69437c">00117</a> <span class="keywordtype">bool</span>            <a class="code" href="doc_8cpp.html#a88af9e6ad20008837e470be54b69437c">gStripDocSwitch</a> = <span class="keyword">false</span>;    <span class="comment">// Strip &lt;mdoc&gt; content from doc listings.</span>
<a name="l00118"></a><a class="code" href="main_8cpp.html#a23bdae40822fc1293a9bfb0fd04b2f28">00118</a> <span class="keywordtype">int</span>             <a class="code" href="main_8cpp.html#a23bdae40822fc1293a9bfb0fd04b2f28">gBalancedSwitch</a> = 0;
<a name="l00119"></a><a class="code" href="main_8cpp.html#aa93530f1aaab4d34e88d4eb1e719a435">00119</a> <span class="keywordtype">int</span>             <a class="code" href="drawschema_8cpp.html#aa93530f1aaab4d34e88d4eb1e719a435">gFoldThreshold</a>  = 25;
<a name="l00120"></a><a class="code" href="names_8cpp.html#a5cc4e35ec800bd5a558fb4aeb93a592c">00120</a> <span class="keywordtype">int</span>             <a class="code" href="eval_8cpp.html#a5cc4e35ec800bd5a558fb4aeb93a592c">gMaxNameSize</a>    = 40;
<a name="l00121"></a><a class="code" href="main_8cpp.html#a80b87fb400c892e011350f61b4033589">00121</a> <span class="keywordtype">bool</span>            <a class="code" href="eval_8cpp.html#a80b87fb400c892e011350f61b4033589">gSimpleNames</a>    = <span class="keyword">false</span>;
<a name="l00122"></a><a class="code" href="main_8cpp.html#a094486d102488d0dcefd4b040a70b51c">00122</a> <span class="keywordtype">bool</span>            <a class="code" href="eval_8cpp.html#a094486d102488d0dcefd4b040a70b51c">gSimplifyDiagrams</a> = <span class="keyword">false</span>;
<a name="l00123"></a><a class="code" href="main_8cpp.html#a5f97ede46bd9fd364fc69fd7bc04e5ae">00123</a> <span class="keywordtype">bool</span>            <a class="code" href="doc__compile_8cpp.html#a5f97ede46bd9fd364fc69fd7bc04e5ae">gLessTempSwitch</a> = <span class="keyword">false</span>;
<a name="l00124"></a><a class="code" href="delayline_8cpp.html#a278e0cda879c0108aff047853ab0214c">00124</a> <span class="keywordtype">int</span>             <a class="code" href="doc__compile_8cpp.html#a278e0cda879c0108aff047853ab0214c">gMaxCopyDelay</a>   = 16;
<a name="l00125"></a><a class="code" href="main_8cpp.html#a9dd5fe0ed04b1c9a973ee315fabe2b7b">00125</a> <span class="keywordtype">string</span>          <a class="code" href="main_8cpp.html#a9dd5fe0ed04b1c9a973ee315fabe2b7b">gArchFile</a>;
<a name="l00126"></a><a class="code" href="main_8cpp.html#a7934d48a2d5906a3de7f45d903789a8d">00126</a> <span class="keywordtype">string</span>          <a class="code" href="main_8cpp.html#a7934d48a2d5906a3de7f45d903789a8d">gOutputFile</a>;
<a name="l00127"></a><a class="code" href="main_8cpp.html#aec80b2f06cbf683d71233d3317a83e00">00127</a> list&lt;string&gt;    <a class="code" href="main_8cpp.html#aec80b2f06cbf683d71233d3317a83e00">gInputFiles</a>;
<a name="l00128"></a>00128 
<a name="l00129"></a><a class="code" href="main_8cpp.html#a66d9e4214550a34a76936a4ccecea387">00129</a> <span class="keywordtype">bool</span>            <a class="code" href="eval_8cpp.html#a66d9e4214550a34a76936a4ccecea387">gPatternEvalMode</a> = <span class="keyword">false</span>;
<a name="l00130"></a>00130 
<a name="l00131"></a><a class="code" href="sigtyperules_8hh.html#a44285cbe41b6d58a00854fead2999187">00131</a> <span class="keywordtype">bool</span>            <a class="code" href="klass_8cpp.html#a44285cbe41b6d58a00854fead2999187">gVectorSwitch</a>   = <span class="keyword">false</span>;
<a name="l00132"></a><a class="code" href="main_8cpp.html#afef3420cdcee4f66a23bfaed2f9d9647">00132</a> <span class="keywordtype">bool</span>            <a class="code" href="klass_8cpp.html#afef3420cdcee4f66a23bfaed2f9d9647">gDeepFirstSwitch</a>= <span class="keyword">false</span>;
<a name="l00133"></a><a class="code" href="delayline_8cpp.html#a6913f43c820ecbf6076c31d40598b7ee">00133</a> <span class="keywordtype">int</span>             <a class="code" href="compile__vect_8cpp.html#a6913f43c820ecbf6076c31d40598b7ee">gVecSize</a>        = 32;
<a name="l00134"></a><a class="code" href="main_8cpp.html#afc8541b52b32a942648daf968114789c">00134</a> <span class="keywordtype">int</span>             <a class="code" href="klass_8cpp.html#afc8541b52b32a942648daf968114789c">gVectorLoopVariant</a> = 0;
<a name="l00135"></a>00135 
<a name="l00136"></a><a class="code" href="main_8cpp.html#a11096523c7bafc4f81b51a38c19e03e8">00136</a> <span class="keywordtype">bool</span>            <a class="code" href="klass_8cpp.html#a11096523c7bafc4f81b51a38c19e03e8">gOpenMPSwitch</a>   = <span class="keyword">false</span>;
<a name="l00137"></a><a class="code" href="delayline_8cpp.html#a9dcf8d0143248403c712fafbaa0ecc25">00137</a> <span class="keywordtype">bool</span>            <a class="code" href="compile__scal_8cpp.html#aed8da6f8f23ca426bf3ea6564e0bd6f2">gSchedulerSwitch</a>   = <span class="keyword">false</span>;
<a name="l00138"></a><a class="code" href="main_8cpp.html#a023d989e0ba581d81873a04bf696450c">00138</a> <span class="keywordtype">bool</span>            <a class="code" href="klass_8cpp.html#a023d989e0ba581d81873a04bf696450c">gGroupTaskSwitch</a>= <span class="keyword">false</span>;
<a name="l00139"></a>00139 
<a name="l00140"></a><a class="code" href="main_8cpp.html#a1ba979dbee201fae63feca5bafc8f394">00140</a> <span class="keywordtype">bool</span>            <a class="code" href="klass_8cpp.html#a1ba979dbee201fae63feca5bafc8f394">gUIMacroSwitch</a>  = <span class="keyword">false</span>;
<a name="l00141"></a>00141 
<a name="l00142"></a><a class="code" href="main_8cpp.html#a42d5980dbeebdd2b951a40a821d456a4">00142</a> <span class="keywordtype">int</span>             <a class="code" href="main_8cpp.html#a42d5980dbeebdd2b951a40a821d456a4">gTimeout</a>        = 0;            <span class="comment">// time out to abort compiler</span>
<a name="l00143"></a>00143 
<a name="l00144"></a><a class="code" href="main_8cpp.html#a6c4a2e13fce2ec057b1659c8785a4141">00144</a> <span class="keywordtype">int</span>             <a class="code" href="floats_8cpp.html#a6c4a2e13fce2ec057b1659c8785a4141">gFloatSize</a> = 1;
<a name="l00145"></a>00145 
<a name="l00146"></a><a class="code" href="main_8cpp.html#a7bd08d103dd526c9e66325a94454fccd">00146</a> <span class="keywordtype">bool</span>            <a class="code" href="main_8cpp.html#a7bd08d103dd526c9e66325a94454fccd">gPrintFileListSwitch</a> = <span class="keyword">false</span>;
<a name="l00147"></a>00147 
<a name="l00148"></a>00148 <span class="comment">//-- command line tools</span>
<a name="l00149"></a>00149 
<a name="l00150"></a><a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">00150</a> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* cmd, <span class="keyword">const</span> <span class="keywordtype">char</span>* kw1)
<a name="l00151"></a>00151 {
<a name="l00152"></a>00152     <span class="keywordflow">return</span>  (strcmp(cmd, kw1) == 0);
<a name="l00153"></a>00153 }
<a name="l00154"></a>00154 
<a name="l00155"></a><a class="code" href="main_8cpp.html#a8b552bba94557c4c7f90095d2bc6e77f">00155</a> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* cmd, <span class="keyword">const</span> <span class="keywordtype">char</span>* kw1, <span class="keyword">const</span> <span class="keywordtype">char</span>* kw2)
<a name="l00156"></a>00156 {
<a name="l00157"></a>00157     <span class="keywordflow">return</span>  (strcmp(cmd, kw1) == 0) || (strcmp(cmd, kw2) == 0);
<a name="l00158"></a>00158 }
<a name="l00159"></a>00159 
<a name="l00160"></a><a class="code" href="main_8cpp.html#a373208bfbdb7b40915b0b10d1fe5bd8c">00160</a> <span class="keywordtype">bool</span> <a class="code" href="main_8cpp.html#a373208bfbdb7b40915b0b10d1fe5bd8c">process_cmdline</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>* argv[])
<a name="l00161"></a>00161 {
<a name="l00162"></a>00162     <span class="keywordtype">int</span> i=1; <span class="keywordtype">int</span> err=0;
<a name="l00163"></a>00163 
<a name="l00164"></a>00164     <span class="keywordflow">while</span> (i&lt;argc) {
<a name="l00165"></a>00165 
<a name="l00166"></a>00166         <span class="keywordflow">if</span>        (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-h&quot;</span>, <span class="stringliteral">&quot;--help&quot;</span>)) {
<a name="l00167"></a>00167             <a class="code" href="main_8cpp.html#ae7413fae6c13f3d34e3d1020a9897b5c">gHelpSwitch</a> = <span class="keyword">true</span>;
<a name="l00168"></a>00168             i += 1;
<a name="l00169"></a>00169 
<a name="l00170"></a>00170         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-v&quot;</span>, <span class="stringliteral">&quot;--version&quot;</span>)) {
<a name="l00171"></a>00171             <a class="code" href="main_8cpp.html#a52169162f1a48c61e3a49eb5a9f6444c">gVersionSwitch</a> = <span class="keyword">true</span>;
<a name="l00172"></a>00172             i += 1;
<a name="l00173"></a>00173 
<a name="l00174"></a>00174         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-d&quot;</span>, <span class="stringliteral">&quot;--details&quot;</span>)) {
<a name="l00175"></a>00175             <a class="code" href="doc_8cpp.html#a4741733b16ad8f554a8b5c0ca5045d14">gDetailsSwitch</a> = <span class="keyword">true</span>;
<a name="l00176"></a>00176             i += 1;
<a name="l00177"></a>00177 
<a name="l00178"></a>00178         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-a&quot;</span>, <span class="stringliteral">&quot;--architecture&quot;</span>)) {
<a name="l00179"></a>00179             <a class="code" href="main_8cpp.html#a9dd5fe0ed04b1c9a973ee315fabe2b7b">gArchFile</a> = argv[i+1];
<a name="l00180"></a>00180             i += 2;
<a name="l00181"></a>00181 
<a name="l00182"></a>00182         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-o&quot;</span>)) {
<a name="l00183"></a>00183             <a class="code" href="main_8cpp.html#a7934d48a2d5906a3de7f45d903789a8d">gOutputFile</a> = argv[i+1];
<a name="l00184"></a>00184             i += 2;
<a name="l00185"></a>00185 
<a name="l00186"></a>00186         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-ps&quot;</span>, <span class="stringliteral">&quot;--postscript&quot;</span>)) {
<a name="l00187"></a>00187             <a class="code" href="main_8cpp.html#a4d67cde178e71e63a2105ee41d8d0ecf">gDrawPSSwitch</a> = <span class="keyword">true</span>;
<a name="l00188"></a>00188             i += 1;
<a name="l00189"></a>00189 
<a name="l00190"></a>00190         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-xml&quot;</span>, <span class="stringliteral">&quot;--xml&quot;</span>)) {
<a name="l00191"></a>00191             <a class="code" href="main_8cpp.html#aa9bf768c06070d9ba7d953ce5158e577">gPrintXMLSwitch</a> = <span class="keyword">true</span>;
<a name="l00192"></a>00192             i += 1;
<a name="l00193"></a>00193 
<a name="l00194"></a>00194         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-blur&quot;</span>, <span class="stringliteral">&quot;--shadow-blur&quot;</span>)) {
<a name="l00195"></a>00195             <a class="code" href="SVGDev_8cpp.html#a595b1bcec2a76e15debe16ac5ab703d4">gShadowBlur</a> = <span class="keyword">true</span>;
<a name="l00196"></a>00196             i += 1;
<a name="l00197"></a>00197 
<a name="l00198"></a>00198         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-svg&quot;</span>, <span class="stringliteral">&quot;--svg&quot;</span>)) {
<a name="l00199"></a>00199             <a class="code" href="main_8cpp.html#a7d66485c9ad80b79c55997ac2acc24f3">gDrawSVGSwitch</a> = <span class="keyword">true</span>;
<a name="l00200"></a>00200             i += 1;
<a name="l00201"></a>00201 
<a name="l00202"></a>00202         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-f&quot;</span>, <span class="stringliteral">&quot;--fold&quot;</span>)) {
<a name="l00203"></a>00203             <a class="code" href="drawschema_8cpp.html#aa93530f1aaab4d34e88d4eb1e719a435">gFoldThreshold</a> = atoi(argv[i+1]);
<a name="l00204"></a>00204             i += 2;
<a name="l00205"></a>00205 
<a name="l00206"></a>00206         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-mns&quot;</span>, <span class="stringliteral">&quot;--max-name-size&quot;</span>)) {
<a name="l00207"></a>00207             <a class="code" href="eval_8cpp.html#a5cc4e35ec800bd5a558fb4aeb93a592c">gMaxNameSize</a> = atoi(argv[i+1]);
<a name="l00208"></a>00208             i += 2;
<a name="l00209"></a>00209 
<a name="l00210"></a>00210         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-sn&quot;</span>, <span class="stringliteral">&quot;--simple-names&quot;</span>)) {
<a name="l00211"></a>00211             <a class="code" href="eval_8cpp.html#a80b87fb400c892e011350f61b4033589">gSimpleNames</a> = <span class="keyword">true</span>;
<a name="l00212"></a>00212             i += 1;
<a name="l00213"></a>00213 
<a name="l00214"></a>00214         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-lb&quot;</span>, <span class="stringliteral">&quot;--left-balanced&quot;</span>)) {
<a name="l00215"></a>00215             <a class="code" href="main_8cpp.html#a23bdae40822fc1293a9bfb0fd04b2f28">gBalancedSwitch</a> = 0;
<a name="l00216"></a>00216             i += 1;
<a name="l00217"></a>00217 
<a name="l00218"></a>00218         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-mb&quot;</span>, <span class="stringliteral">&quot;--mid-balanced&quot;</span>)) {
<a name="l00219"></a>00219             <a class="code" href="main_8cpp.html#a23bdae40822fc1293a9bfb0fd04b2f28">gBalancedSwitch</a> = 1;
<a name="l00220"></a>00220             i += 1;
<a name="l00221"></a>00221 
<a name="l00222"></a>00222         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-rb&quot;</span>, <span class="stringliteral">&quot;--right-balanced&quot;</span>)) {
<a name="l00223"></a>00223             <a class="code" href="main_8cpp.html#a23bdae40822fc1293a9bfb0fd04b2f28">gBalancedSwitch</a> = 2;
<a name="l00224"></a>00224             i += 1;
<a name="l00225"></a>00225 
<a name="l00226"></a>00226         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-lt&quot;</span>, <span class="stringliteral">&quot;--less-temporaries&quot;</span>)) {
<a name="l00227"></a>00227             <a class="code" href="doc__compile_8cpp.html#a5f97ede46bd9fd364fc69fd7bc04e5ae">gLessTempSwitch</a> = <span class="keyword">true</span>;
<a name="l00228"></a>00228             i += 1;
<a name="l00229"></a>00229 
<a name="l00230"></a>00230         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-mcd&quot;</span>, <span class="stringliteral">&quot;--max-copy-delay&quot;</span>)) {
<a name="l00231"></a>00231             <a class="code" href="doc__compile_8cpp.html#a278e0cda879c0108aff047853ab0214c">gMaxCopyDelay</a> = atoi(argv[i+1]);
<a name="l00232"></a>00232             i += 2;
<a name="l00233"></a>00233 
<a name="l00234"></a>00234         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-sd&quot;</span>, <span class="stringliteral">&quot;--simplify-diagrams&quot;</span>)) {
<a name="l00235"></a>00235             <a class="code" href="eval_8cpp.html#a094486d102488d0dcefd4b040a70b51c">gSimplifyDiagrams</a> = <span class="keyword">true</span>;
<a name="l00236"></a>00236             i += 1;
<a name="l00237"></a>00237 
<a name="l00238"></a>00238         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-vec&quot;</span>, <span class="stringliteral">&quot;--vectorize&quot;</span>)) {
<a name="l00239"></a>00239             <a class="code" href="klass_8cpp.html#a44285cbe41b6d58a00854fead2999187">gVectorSwitch</a> = <span class="keyword">true</span>;
<a name="l00240"></a>00240             i += 1;
<a name="l00241"></a>00241 
<a name="l00242"></a>00242         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-dfs&quot;</span>, <span class="stringliteral">&quot;--deepFirstScheduling&quot;</span>)) {
<a name="l00243"></a>00243             <a class="code" href="klass_8cpp.html#afef3420cdcee4f66a23bfaed2f9d9647">gDeepFirstSwitch</a> = <span class="keyword">true</span>;
<a name="l00244"></a>00244             i += 1;
<a name="l00245"></a>00245 
<a name="l00246"></a>00246         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-vs&quot;</span>, <span class="stringliteral">&quot;--vec-size&quot;</span>)) {
<a name="l00247"></a>00247             <a class="code" href="compile__vect_8cpp.html#a6913f43c820ecbf6076c31d40598b7ee">gVecSize</a> = atoi(argv[i+1]);
<a name="l00248"></a>00248             i += 2;
<a name="l00249"></a>00249 
<a name="l00250"></a>00250         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-lv&quot;</span>, <span class="stringliteral">&quot;--loop-variant&quot;</span>)) {
<a name="l00251"></a>00251             <a class="code" href="klass_8cpp.html#afc8541b52b32a942648daf968114789c">gVectorLoopVariant</a> = atoi(argv[i+1]);
<a name="l00252"></a>00252             i += 2;
<a name="l00253"></a>00253 
<a name="l00254"></a>00254         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-omp&quot;</span>, <span class="stringliteral">&quot;--openMP&quot;</span>)) {
<a name="l00255"></a>00255             <a class="code" href="klass_8cpp.html#a11096523c7bafc4f81b51a38c19e03e8">gOpenMPSwitch</a> = <span class="keyword">true</span>;
<a name="l00256"></a>00256             i += 1;
<a name="l00257"></a>00257 
<a name="l00258"></a>00258         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-sch&quot;</span>, <span class="stringliteral">&quot;--scheduler&quot;</span>)) {
<a name="l00259"></a>00259             <a class="code" href="compile__scal_8cpp.html#aed8da6f8f23ca426bf3ea6564e0bd6f2">gSchedulerSwitch</a> = <span class="keyword">true</span>;
<a name="l00260"></a>00260             i += 1;
<a name="l00261"></a>00261 
<a name="l00262"></a>00262         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-g&quot;</span>, <span class="stringliteral">&quot;--groupTasks&quot;</span>)) {
<a name="l00263"></a>00263             <a class="code" href="klass_8cpp.html#a023d989e0ba581d81873a04bf696450c">gGroupTaskSwitch</a> = <span class="keyword">true</span>;
<a name="l00264"></a>00264             i += 1;
<a name="l00265"></a>00265 
<a name="l00266"></a>00266         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-uim&quot;</span>, <span class="stringliteral">&quot;--user-interface-macros&quot;</span>)) {
<a name="l00267"></a>00267             <a class="code" href="klass_8cpp.html#a1ba979dbee201fae63feca5bafc8f394">gUIMacroSwitch</a> = <span class="keyword">true</span>;
<a name="l00268"></a>00268             i += 1;
<a name="l00269"></a>00269 
<a name="l00270"></a>00270         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-t&quot;</span>, <span class="stringliteral">&quot;--timeout&quot;</span>)) {
<a name="l00271"></a>00271             <a class="code" href="main_8cpp.html#a42d5980dbeebdd2b951a40a821d456a4">gTimeout</a> = atoi(argv[i+1]);
<a name="l00272"></a>00272             i += 2;
<a name="l00273"></a>00273 
<a name="l00274"></a>00274         <span class="comment">// double float options</span>
<a name="l00275"></a>00275         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-single&quot;</span>, <span class="stringliteral">&quot;--single-precision-floats&quot;</span>)) {
<a name="l00276"></a>00276             <a class="code" href="floats_8cpp.html#a6c4a2e13fce2ec057b1659c8785a4141">gFloatSize</a> = 1;
<a name="l00277"></a>00277             i += 1;
<a name="l00278"></a>00278 
<a name="l00279"></a>00279         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-double&quot;</span>, <span class="stringliteral">&quot;--double-precision-floats&quot;</span>)) {
<a name="l00280"></a>00280             <a class="code" href="floats_8cpp.html#a6c4a2e13fce2ec057b1659c8785a4141">gFloatSize</a> = 2;
<a name="l00281"></a>00281             i += 1;
<a name="l00282"></a>00282 
<a name="l00283"></a>00283         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-quad&quot;</span>, <span class="stringliteral">&quot;--quad-precision-floats&quot;</span>)) {
<a name="l00284"></a>00284             <a class="code" href="floats_8cpp.html#a6c4a2e13fce2ec057b1659c8785a4141">gFloatSize</a> = 3;
<a name="l00285"></a>00285             i += 1;
<a name="l00286"></a>00286             
<a name="l00287"></a>00287         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-mdoc&quot;</span>, <span class="stringliteral">&quot;--mathdoc&quot;</span>)) {
<a name="l00288"></a>00288             <a class="code" href="main_8cpp.html#a2779bb51324faa59c44edeba85ba6681">gPrintDocSwitch</a> = <span class="keyword">true</span>;
<a name="l00289"></a>00289             i += 1;
<a name="l00290"></a>00290             
<a name="l00291"></a>00291         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-mdlang&quot;</span>, <span class="stringliteral">&quot;--mathdoc-lang&quot;</span>)) {
<a name="l00292"></a>00292             <a class="code" href="doc_8cpp.html#ac83dd0bfbc11705a903a395da7bc0f7c">gDocLang</a> = argv[i+1];
<a name="l00293"></a>00293             i += 2;
<a name="l00294"></a>00294             
<a name="l00295"></a>00295         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-stripmdoc&quot;</span>, <span class="stringliteral">&quot;--strip-mdoc-tags&quot;</span>)) {
<a name="l00296"></a>00296             <a class="code" href="doc_8cpp.html#a88af9e6ad20008837e470be54b69437c">gStripDocSwitch</a> = <span class="keyword">true</span>;
<a name="l00297"></a>00297             i += 1;
<a name="l00298"></a>00298             
<a name="l00299"></a>00299         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#afa544084186caf9cfe7e6ef5a49ea23e">isCmd</a>(argv[i], <span class="stringliteral">&quot;-flist&quot;</span>, <span class="stringliteral">&quot;--file-list&quot;</span>)) {
<a name="l00300"></a>00300             <a class="code" href="main_8cpp.html#a7bd08d103dd526c9e66325a94454fccd">gPrintFileListSwitch</a> = <span class="keyword">true</span>;
<a name="l00301"></a>00301             i += 1;
<a name="l00302"></a>00302             
<a name="l00303"></a>00303         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (argv[i][0] != <span class="charliteral">&#39;-&#39;</span>) {
<a name="l00304"></a>00304             <span class="keywordflow">if</span> (<a class="code" href="enrobage_8cpp.html#af611c72db7e5426b9cab1268d3f5869b" title="Check if a file exists.">check_file</a>(argv[i])) {
<a name="l00305"></a>00305                 <a class="code" href="main_8cpp.html#aec80b2f06cbf683d71233d3317a83e00">gInputFiles</a>.push_back(argv[i]);
<a name="l00306"></a>00306             }
<a name="l00307"></a>00307             i++;
<a name="l00308"></a>00308 
<a name="l00309"></a>00309         } <span class="keywordflow">else</span> {
<a name="l00310"></a>00310             cerr &lt;&lt; <span class="stringliteral">&quot;faust: unrecognized option \&quot;&quot;</span> &lt;&lt; argv[i] &lt;&lt;<span class="stringliteral">&quot;\&quot;&quot;</span> &lt;&lt; endl;
<a name="l00311"></a>00311             i++;
<a name="l00312"></a>00312             err++;
<a name="l00313"></a>00313         }
<a name="l00314"></a>00314     }
<a name="l00315"></a>00315 
<a name="l00316"></a>00316     <span class="comment">// adjust related options</span>
<a name="l00317"></a>00317     <span class="keywordflow">if</span> (<a class="code" href="klass_8cpp.html#a11096523c7bafc4f81b51a38c19e03e8">gOpenMPSwitch</a> || <a class="code" href="compile__scal_8cpp.html#aed8da6f8f23ca426bf3ea6564e0bd6f2">gSchedulerSwitch</a>) <a class="code" href="klass_8cpp.html#a44285cbe41b6d58a00854fead2999187">gVectorSwitch</a> = <span class="keyword">true</span>;
<a name="l00318"></a>00318 
<a name="l00319"></a>00319     <span class="keywordflow">return</span> err == 0;
<a name="l00320"></a>00320 }
<a name="l00321"></a>00321 
<a name="l00322"></a>00322 
<a name="l00323"></a>00323 
<a name="l00324"></a>00324 <span class="comment">/****************************************************************</span>
<a name="l00325"></a>00325 <span class="comment">                     Help and Version information</span>
<a name="l00326"></a>00326 <span class="comment">*****************************************************************/</span>
<a name="l00327"></a>00327 
<a name="l00328"></a>00328 
<a name="l00329"></a>00329 
<a name="l00330"></a><a class="code" href="main_8cpp.html#a246ce0006add3670842eac6712fb40b1">00330</a> <span class="keywordtype">void</span> <a class="code" href="main_8cpp.html#a246ce0006add3670842eac6712fb40b1">printversion</a>()
<a name="l00331"></a>00331 {
<a name="l00332"></a>00332     cout &lt;&lt; <span class="stringliteral">&quot;FAUST, DSP to C++ compiler, Version &quot;</span> &lt;&lt; <a class="code" href="main_8cpp.html#ab2518c0a1e64ec42eae9a7fee0e716b0">FAUSTVERSION</a> &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;
<a name="l00333"></a>00333     cout &lt;&lt; <span class="stringliteral">&quot;Copyright (C) 2002-2010, GRAME - Centre National de Creation Musicale. All rights reserved. \n\n&quot;</span>;
<a name="l00334"></a>00334 }
<a name="l00335"></a>00335 
<a name="l00336"></a>00336 
<a name="l00337"></a><a class="code" href="main_8cpp.html#ae11683d4f44426c27f006bdb1e7db95f">00337</a> <span class="keywordtype">void</span> <a class="code" href="main_8cpp.html#ae11683d4f44426c27f006bdb1e7db95f">printhelp</a>()
<a name="l00338"></a>00338 {
<a name="l00339"></a>00339     <a class="code" href="main_8cpp.html#a246ce0006add3670842eac6712fb40b1">printversion</a>();
<a name="l00340"></a>00340     cout &lt;&lt; <span class="stringliteral">&quot;usage: faust [options] file1 [file2 ...]\n&quot;</span>;
<a name="l00341"></a>00341     cout &lt;&lt; <span class="stringliteral">&quot;\twhere options represent zero or more compiler options \n\tand fileN represents a faust source file (.dsp extension).\n&quot;</span>;
<a name="l00342"></a>00342 
<a name="l00343"></a>00343     cout &lt;&lt; <span class="stringliteral">&quot;\noptions :\n&quot;</span>;
<a name="l00344"></a>00344     cout &lt;&lt; <span class="stringliteral">&quot;---------\n&quot;</span>;
<a name="l00345"></a>00345 
<a name="l00346"></a>00346     cout &lt;&lt; <span class="stringliteral">&quot;-h \t\tprint this --help message\n&quot;</span>;
<a name="l00347"></a>00347     cout &lt;&lt; <span class="stringliteral">&quot;-v \t\tprint compiler --version information\n&quot;</span>;
<a name="l00348"></a>00348     cout &lt;&lt; <span class="stringliteral">&quot;-d \t\tprint compilation --details\n&quot;</span>;
<a name="l00349"></a>00349     cout &lt;&lt; <span class="stringliteral">&quot;-ps \t\tprint block-diagram --postscript file\n&quot;</span>;
<a name="l00350"></a>00350     cout &lt;&lt; <span class="stringliteral">&quot;-svg \tprint block-diagram --svg file\n&quot;</span>;
<a name="l00351"></a>00351     cout &lt;&lt; <span class="stringliteral">&quot;-mdoc \tprint --mathdoc of a Faust program in LaTeX format in a -mdoc directory\n&quot;</span>;
<a name="l00352"></a>00352     cout &lt;&lt; <span class="stringliteral">&quot;-mdlang &lt;l&gt;\t\tload --mathdoc-lang &lt;l&gt; if translation file exists (&lt;l&gt; = en, fr, ...)\n&quot;</span>;
<a name="l00353"></a>00353     cout &lt;&lt; <span class="stringliteral">&quot;-stripdoc \t\tapply --strip-mdoc-tags when printing Faust -mdoc listings\n&quot;</span>;
<a name="l00354"></a>00354     cout &lt;&lt; <span class="stringliteral">&quot;-sd \t\ttry to further --simplify-diagrams before drawing them\n&quot;</span>;
<a name="l00355"></a>00355     cout &lt;&lt; <span class="stringliteral">&quot;-f &lt;n&gt; \t\t--fold &lt;n&gt; threshold during block-diagram generation (default 25 elements) \n&quot;</span>;
<a name="l00356"></a>00356     cout &lt;&lt; <span class="stringliteral">&quot;-mns &lt;n&gt; \t--max-name-size &lt;n&gt; threshold during block-diagram generation (default 40 char)\n&quot;</span>;
<a name="l00357"></a>00357     cout &lt;&lt; <span class="stringliteral">&quot;-sn \t\tuse --simple-names (without arguments) during block-diagram generation\n&quot;</span>;
<a name="l00358"></a>00358     cout &lt;&lt; <span class="stringliteral">&quot;-xml \t\tgenerate an --xml description file\n&quot;</span>;
<a name="l00359"></a>00359     cout &lt;&lt; <span class="stringliteral">&quot;-blur \t\tadd a --shadow-blur to SVG boxes\n&quot;</span>;
<a name="l00360"></a>00360     cout &lt;&lt; <span class="stringliteral">&quot;-lb \t\tgenerate --left-balanced expressions\n&quot;</span>;
<a name="l00361"></a>00361     cout &lt;&lt; <span class="stringliteral">&quot;-mb \t\tgenerate --mid-balanced expressions (default)\n&quot;</span>;
<a name="l00362"></a>00362     cout &lt;&lt; <span class="stringliteral">&quot;-rb \t\tgenerate --right-balanced expressions\n&quot;</span>;
<a name="l00363"></a>00363     cout &lt;&lt; <span class="stringliteral">&quot;-lt \t\tgenerate --less-temporaries in compiling delays\n&quot;</span>;
<a name="l00364"></a>00364     cout &lt;&lt; <span class="stringliteral">&quot;-mcd &lt;n&gt; \t--max-copy-delay &lt;n&gt; threshold between copy and ring buffer implementation (default 16 samples)\n&quot;</span>;
<a name="l00365"></a>00365     cout &lt;&lt; <span class="stringliteral">&quot;-a &lt;file&gt; \tC++ architecture file\n&quot;</span>;
<a name="l00366"></a>00366     cout &lt;&lt; <span class="stringliteral">&quot;-o &lt;file&gt; \tC++ output file\n&quot;</span>;
<a name="l00367"></a>00367     cout &lt;&lt; <span class="stringliteral">&quot;-vec    \t--vectorize generate easier to vectorize code\n&quot;</span>;
<a name="l00368"></a>00368     cout &lt;&lt; <span class="stringliteral">&quot;-vs &lt;n&gt; \t--vec-size &lt;n&gt; size of the vector (default 32 samples)\n&quot;</span>;
<a name="l00369"></a>00369     cout &lt;&lt; <span class="stringliteral">&quot;-lv &lt;n&gt; \t--loop-variant [0:fastest (default), 1:simple] \n&quot;</span>;
<a name="l00370"></a>00370     cout &lt;&lt; <span class="stringliteral">&quot;-omp    \t--openMP generate OpenMP pragmas, activates --vectorize option\n&quot;</span>;
<a name="l00371"></a>00371     cout &lt;&lt; <span class="stringliteral">&quot;-sch    \t--scheduler generate tasks and used Thread pool based scheduler, activates --vectorize option\n&quot;</span>;
<a name="l00372"></a>00372     cout &lt;&lt; <span class="stringliteral">&quot;-dfs    \t--deepFirstScheduling schedule vector loops in deep first order\n&quot;</span>;
<a name="l00373"></a>00373     cout &lt;&lt; <span class="stringliteral">&quot;-g    \t\t--groupTasks group single-threaded sequential tasks together when -omp or -sch is used\n&quot;</span>;
<a name="l00374"></a>00374     cout &lt;&lt; <span class="stringliteral">&quot;-uim    \t--user-interface-macros add user interface macro definitions in the C++ code\n&quot;</span>;
<a name="l00375"></a>00375     cout &lt;&lt; <span class="stringliteral">&quot;-single \tuse --single-precision-floats for internal computations (default)\n&quot;</span>;
<a name="l00376"></a>00376     cout &lt;&lt; <span class="stringliteral">&quot;-double \tuse --double-precision-floats for internal computations\n&quot;</span>;
<a name="l00377"></a>00377     cout &lt;&lt; <span class="stringliteral">&quot;-quad \t\tuse --quad-precision-floats for internal computations\n&quot;</span>;
<a name="l00378"></a>00378     cout &lt;&lt; <span class="stringliteral">&quot;-flist \t\tuse --file-list used to eval process\n&quot;</span>;
<a name="l00379"></a>00379 
<a name="l00380"></a>00380     cout &lt;&lt; <span class="stringliteral">&quot;\nexample :\n&quot;</span>;
<a name="l00381"></a>00381     cout &lt;&lt; <span class="stringliteral">&quot;---------\n&quot;</span>;
<a name="l00382"></a>00382 
<a name="l00383"></a>00383     cout &lt;&lt; <span class="stringliteral">&quot;faust -a jack-gtk.cpp -o myfx.cpp myfx.dsp\n&quot;</span>;
<a name="l00384"></a>00384 }
<a name="l00385"></a>00385 
<a name="l00386"></a>00386 
<a name="l00387"></a><a class="code" href="main_8cpp.html#a1df7d4f6274676035f8d9467a99e2fca">00387</a> <span class="keywordtype">void</span> <a class="code" href="main_8cpp.html#a1df7d4f6274676035f8d9467a99e2fca">printheader</a>(ostream&amp; dst)
<a name="l00388"></a>00388 {
<a name="l00389"></a>00389     <span class="comment">// defines the metadata we want to print as comments at the begin of in the C++ file</span>
<a name="l00390"></a>00390     set&lt;Tree&gt; selectedKeys;
<a name="l00391"></a>00391     selectedKeys.insert(<a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(<span class="stringliteral">&quot;name&quot;</span>));
<a name="l00392"></a>00392     selectedKeys.insert(<a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(<span class="stringliteral">&quot;author&quot;</span>));
<a name="l00393"></a>00393     selectedKeys.insert(<a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(<span class="stringliteral">&quot;copyright&quot;</span>));
<a name="l00394"></a>00394     selectedKeys.insert(<a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(<span class="stringliteral">&quot;license&quot;</span>));
<a name="l00395"></a>00395     selectedKeys.insert(<a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(<span class="stringliteral">&quot;version&quot;</span>));
<a name="l00396"></a>00396 
<a name="l00397"></a>00397     dst &lt;&lt; <span class="stringliteral">&quot;//-----------------------------------------------------&quot;</span> &lt;&lt; endl;
<a name="l00398"></a>00398     <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="l00399"></a>00399         <span class="keywordflow">if</span> (selectedKeys.count(i-&gt;first)) {
<a name="l00400"></a>00400             dst &lt;&lt; <span class="stringliteral">&quot;// &quot;</span> &lt;&lt; *(i-&gt;first);
<a name="l00401"></a>00401             <span class="keyword">const</span> <span class="keywordtype">char</span>* sep = <span class="stringliteral">&quot;: &quot;</span>;
<a name="l00402"></a>00402             <span class="keywordflow">for</span> (set&lt;Tree&gt;::iterator j = i-&gt;second.begin(); j != i-&gt;second.end(); ++j) {
<a name="l00403"></a>00403                 dst &lt;&lt; sep &lt;&lt; **j;
<a name="l00404"></a>00404                 sep = <span class="stringliteral">&quot;, &quot;</span>;
<a name="l00405"></a>00405             }
<a name="l00406"></a>00406             dst &lt;&lt; endl;
<a name="l00407"></a>00407         }
<a name="l00408"></a>00408     }
<a name="l00409"></a>00409 
<a name="l00410"></a>00410     dst &lt;&lt; <span class="stringliteral">&quot;//&quot;</span> &lt;&lt; endl;
<a name="l00411"></a>00411     dst &lt;&lt; <span class="stringliteral">&quot;// Code generated with Faust &quot;</span> &lt;&lt; <a class="code" href="main_8cpp.html#ab2518c0a1e64ec42eae9a7fee0e716b0">FAUSTVERSION</a> &lt;&lt; <span class="stringliteral">&quot; (http://faust.grame.fr)&quot;</span> &lt;&lt; endl;
<a name="l00412"></a>00412     dst &lt;&lt; <span class="stringliteral">&quot;//-----------------------------------------------------&quot;</span> &lt;&lt; endl;
<a name="l00413"></a>00413 }
<a name="l00414"></a>00414 
<a name="l00415"></a>00415 
<a name="l00416"></a>00416 
<a name="l00417"></a>00417 
<a name="l00418"></a>00418 <span class="comment">/****************************************************************</span>
<a name="l00419"></a>00419 <span class="comment">                                MAIN</span>
<a name="l00420"></a>00420 <span class="comment">*****************************************************************/</span>
<a name="l00421"></a>00421 
<a name="l00422"></a>00422 
<a name="l00423"></a><a class="code" href="main_8cpp.html#a678e1ef3077e128e543805a7381066f9">00423</a> <span class="keyword">static</span> <span class="keywordtype">string</span> <a class="code" href="main_8cpp.html#a678e1ef3077e128e543805a7381066f9">dirname</a>(<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; path)
<a name="l00424"></a>00424 {
<a name="l00425"></a>00425     <span class="keywordtype">char</span> s[1024];
<a name="l00426"></a>00426     strncpy(s, path.c_str(), 1024);
<a name="l00427"></a>00427     <span class="keywordflow">return</span> string(<a class="code" href="main_8cpp.html#a678e1ef3077e128e543805a7381066f9">dirname</a>(s));
<a name="l00428"></a>00428 }
<a name="l00429"></a>00429 
<a name="l00434"></a><a class="code" href="main_8cpp.html#a2c3bc79e01807b22059473f7684f0f75">00434</a> <span class="keyword">static</span> <span class="keywordtype">string</span> <a class="code" href="main_8cpp.html#a2c3bc79e01807b22059473f7684f0f75" title="transform a filename &amp;quot;faust/example/noise.dsp&amp;quot; into the corresponding fx...">fxname</a>(<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; filename)
<a name="l00435"></a>00435 {
<a name="l00436"></a>00436     <span class="comment">// determine position right after the last &#39;/&#39; or 0</span>
<a name="l00437"></a>00437     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> p1 = 0;
<a name="l00438"></a>00438     <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i&lt;filename.size(); i++) {
<a name="l00439"></a>00439         <span class="keywordflow">if</span> (filename[i] == <span class="charliteral">&#39;/&#39;</span>)  { p1 = i+1; }
<a name="l00440"></a>00440     }
<a name="l00441"></a>00441     
<a name="l00442"></a>00442     <span class="comment">// determine position of the last &#39;.&#39;</span>
<a name="l00443"></a>00443     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> p2 = filename.size();
<a name="l00444"></a>00444     <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=p1; i&lt;filename.size(); i++) {
<a name="l00445"></a>00445         <span class="keywordflow">if</span> (filename[i] == <span class="charliteral">&#39;.&#39;</span>)  { p2 = i; }
<a name="l00446"></a>00446     }
<a name="l00447"></a>00447 
<a name="l00448"></a>00448     <span class="keywordflow">return</span> filename.substr(p1, p2-p1);
<a name="l00449"></a>00449 }
<a name="l00450"></a>00450 
<a name="l00451"></a>00451 
<a name="l00452"></a><a class="code" href="main_8cpp.html#acaa80091726e284fa45a172d8c64854d">00452</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="main_8cpp.html#acaa80091726e284fa45a172d8c64854d">initFaustDirectories</a>()
<a name="l00453"></a>00453 {
<a name="l00454"></a>00454     <span class="keywordtype">char</span> s[1024];
<a name="l00455"></a>00455     <a class="code" href="compatibility_8cpp.html#a7217df0a48496637c377abb7f366d0ee">getFaustPathname</a>(s, 1024);
<a name="l00456"></a>00456     <a class="code" href="main_8cpp.html#a678e1ef3077e128e543805a7381066f9">dirname</a>(s);
<a name="l00457"></a>00457     <a class="code" href="doc_8cpp.html#a320fc936026f318a3fc46f47ef379713">gFaustDirectory</a> = s;
<a name="l00458"></a>00458     <a class="code" href="doc_8cpp.html#a2529dab7cac84bd8f69c14ee8a3cbfe2">gFaustSuperDirectory</a> = <a class="code" href="main_8cpp.html#a678e1ef3077e128e543805a7381066f9">dirname</a>(<a class="code" href="doc_8cpp.html#a320fc936026f318a3fc46f47ef379713">gFaustDirectory</a>);
<a name="l00459"></a>00459     <a class="code" href="doc_8cpp.html#a09fc40a224a32f929decbac5a21140ef">gFaustSuperSuperDirectory</a> = <a class="code" href="main_8cpp.html#a678e1ef3077e128e543805a7381066f9">dirname</a>(<a class="code" href="doc_8cpp.html#a2529dab7cac84bd8f69c14ee8a3cbfe2">gFaustSuperDirectory</a>);
<a name="l00460"></a>00460     <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#aec80b2f06cbf683d71233d3317a83e00">gInputFiles</a>.empty()) {
<a name="l00461"></a>00461         <a class="code" href="doc_8cpp.html#a1c0fac9c77fcd7f4e21daf398e9830de">gMasterDocument</a> = <span class="stringliteral">&quot;Unknown&quot;</span>;
<a name="l00462"></a>00462         <a class="code" href="main_8cpp.html#aea493812dd4a239a7c0d354d5a07e191">gMasterDirectory</a> = <span class="stringliteral">&quot;.&quot;</span>;
<a name="l00463"></a>00463         <a class="code" href="compile_8cpp.html#ac8a7f14cf003853871e19ebab4cfaaf3">gMasterName</a> = <span class="stringliteral">&quot;faustfx&quot;</span>;
<a name="l00464"></a>00464         <a class="code" href="doc_8cpp.html#a90baf99fd6ffa7248d895c7d33e0a8cf" title="Contains the filename for out documentation.">gDocName</a> = <span class="stringliteral">&quot;faustdoc&quot;</span>;
<a name="l00465"></a>00465     } <span class="keywordflow">else</span> {
<a name="l00466"></a>00466         <a class="code" href="doc_8cpp.html#a1c0fac9c77fcd7f4e21daf398e9830de">gMasterDocument</a> = *<a class="code" href="main_8cpp.html#aec80b2f06cbf683d71233d3317a83e00">gInputFiles</a>.begin();
<a name="l00467"></a>00467         <a class="code" href="main_8cpp.html#aea493812dd4a239a7c0d354d5a07e191">gMasterDirectory</a> = <a class="code" href="main_8cpp.html#a678e1ef3077e128e543805a7381066f9">dirname</a>(<a class="code" href="doc_8cpp.html#a1c0fac9c77fcd7f4e21daf398e9830de">gMasterDocument</a>);
<a name="l00468"></a>00468         <a class="code" href="compile_8cpp.html#ac8a7f14cf003853871e19ebab4cfaaf3">gMasterName</a> = <a class="code" href="main_8cpp.html#a2c3bc79e01807b22059473f7684f0f75" title="transform a filename &amp;quot;faust/example/noise.dsp&amp;quot; into the corresponding fx...">fxname</a>(<a class="code" href="doc_8cpp.html#a1c0fac9c77fcd7f4e21daf398e9830de">gMasterDocument</a>);
<a name="l00469"></a>00469         <a class="code" href="doc_8cpp.html#a90baf99fd6ffa7248d895c7d33e0a8cf" title="Contains the filename for out documentation.">gDocName</a> = <a class="code" href="main_8cpp.html#a2c3bc79e01807b22059473f7684f0f75" title="transform a filename &amp;quot;faust/example/noise.dsp&amp;quot; into the corresponding fx...">fxname</a>(<a class="code" href="doc_8cpp.html#a1c0fac9c77fcd7f4e21daf398e9830de">gMasterDocument</a>);
<a name="l00470"></a>00470     }
<a name="l00471"></a>00471 }
<a name="l00472"></a>00472 
<a name="l00473"></a>00473 
<a name="l00474"></a>00474 
<a name="l00475"></a><a class="code" href="main_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97">00475</a> <span class="keywordtype">int</span> <a class="code" href="main_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97">main</a> (<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>* argv[])
<a name="l00476"></a>00476 {
<a name="l00477"></a>00477 
<a name="l00478"></a>00478     <span class="comment">/****************************************************************</span>
<a name="l00479"></a>00479 <span class="comment">     1 - process command line</span>
<a name="l00480"></a>00480 <span class="comment">    *****************************************************************/</span>
<a name="l00481"></a>00481 
<a name="l00482"></a>00482     <a class="code" href="main_8cpp.html#a373208bfbdb7b40915b0b10d1fe5bd8c">process_cmdline</a>(argc, argv);
<a name="l00483"></a>00483 
<a name="l00484"></a>00484     <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#ae7413fae6c13f3d34e3d1020a9897b5c">gHelpSwitch</a>)        { <a class="code" href="main_8cpp.html#ae11683d4f44426c27f006bdb1e7db95f">printhelp</a>(); exit(0); }
<a name="l00485"></a>00485     <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#a52169162f1a48c61e3a49eb5a9f6444c">gVersionSwitch</a>)     { <a class="code" href="main_8cpp.html#a246ce0006add3670842eac6712fb40b1">printversion</a>(); exit(0); }
<a name="l00486"></a>00486 
<a name="l00487"></a>00487     <a class="code" href="main_8cpp.html#acaa80091726e284fa45a172d8c64854d">initFaustDirectories</a>();
<a name="l00488"></a>00488 <span class="preprocessor">#ifndef WIN32</span>
<a name="l00489"></a>00489 <span class="preprocessor"></span>    alarm(<a class="code" href="main_8cpp.html#a42d5980dbeebdd2b951a40a821d456a4">gTimeout</a>);
<a name="l00490"></a>00490 <span class="preprocessor">#endif</span>
<a name="l00491"></a>00491 <span class="preprocessor"></span>
<a name="l00492"></a>00492 
<a name="l00493"></a>00493     <span class="comment">/****************************************************************</span>
<a name="l00494"></a>00494 <span class="comment">     2 - parse source files</span>
<a name="l00495"></a>00495 <span class="comment">    *****************************************************************/</span>
<a name="l00496"></a>00496 
<a name="l00497"></a>00497     <a class="code" href="timing_8cpp.html#a8b3ae592fe54580b95171a2bdabb2641">startTiming</a>(<span class="stringliteral">&quot;parser&quot;</span>);
<a name="l00498"></a>00498 
<a name="l00499"></a>00499     
<a name="l00500"></a>00500     list&lt;string&gt;::iterator s;
<a name="l00501"></a>00501     gResult2 = <a class="code" href="list_8cpp.html#a538b704dd07794b7237108f1917c471e">nil</a>;
<a name="l00502"></a>00502     <a class="code" href="main_8cpp.html#a22b78670f95f7470a7b16ec70f68c918">yyerr</a> = 0;
<a name="l00503"></a>00503 
<a name="l00504"></a>00504     <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#aec80b2f06cbf683d71233d3317a83e00">gInputFiles</a>.begin() == <a class="code" href="main_8cpp.html#aec80b2f06cbf683d71233d3317a83e00">gInputFiles</a>.end()) {
<a name="l00505"></a>00505         cerr &lt;&lt; <span class="stringliteral">&quot;ERROR: no files specified; for help type \&quot;faust --help\&quot;&quot;</span> &lt;&lt; endl;
<a name="l00506"></a>00506         exit(1);
<a name="l00507"></a>00507     }
<a name="l00508"></a>00508     <span class="keywordflow">for</span> (s = <a class="code" href="main_8cpp.html#aec80b2f06cbf683d71233d3317a83e00">gInputFiles</a>.begin(); s != <a class="code" href="main_8cpp.html#aec80b2f06cbf683d71233d3317a83e00">gInputFiles</a>.end(); s++) {
<a name="l00509"></a>00509         <span class="keywordflow">if</span> (s == <a class="code" href="main_8cpp.html#aec80b2f06cbf683d71233d3317a83e00">gInputFiles</a>.begin()) <a class="code" href="doc_8cpp.html#a1c0fac9c77fcd7f4e21daf398e9830de">gMasterDocument</a> = *s;
<a name="l00510"></a>00510         gResult2 = <a class="code" href="list_8hh.html#ae1ed153946fcfc025009c6d9c9c40bee">cons</a>(<a class="code" href="boxes_8cpp.html#a34a145266d5098db2ea93d82b6040704">importFile</a>(<a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(s-&gt;c_str())), gResult2);
<a name="l00511"></a>00511     }
<a name="l00512"></a>00512     <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#a22b78670f95f7470a7b16ec70f68c918">yyerr</a> &gt; 0) {
<a name="l00513"></a>00513         <span class="comment">//fprintf(stderr, &quot;Erreur de parsing 2, count = %d \n&quot;, yyerr);</span>
<a name="l00514"></a>00514         exit(1);
<a name="l00515"></a>00515     }
<a name="l00516"></a>00516     gExpandedDefList = gReader.<a class="code" href="classSourceReader.html#a5c9ca766c1efb427ffdd419517775f44" title="Return the list of definitions where all imports have been expanded.">expandlist</a>(gResult2);
<a name="l00517"></a>00517 
<a name="l00518"></a>00518     <a class="code" href="timing_8cpp.html#ac5c8a9d488cf5c7d786c833565e093e9">endTiming</a>(<span class="stringliteral">&quot;parser&quot;</span>);
<a name="l00519"></a>00519     
<a name="l00520"></a>00520     <span class="comment">/****************************************************************</span>
<a name="l00521"></a>00521 <span class="comment">     3 - evaluate &#39;process&#39; definition</span>
<a name="l00522"></a>00522 <span class="comment">    *****************************************************************/</span>
<a name="l00523"></a>00523     
<a name="l00524"></a>00524     <a class="code" href="timing_8cpp.html#a8b3ae592fe54580b95171a2bdabb2641">startTiming</a>(<span class="stringliteral">&quot;evaluation&quot;</span>);
<a name="l00525"></a>00525 
<a name="l00526"></a>00526 
<a name="l00527"></a>00527     <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> process = <a class="code" href="eval_8cpp.html#a11fbac16c4eda5f687d7aa92551039c9" title="Eval &amp;quot;process&amp;quot; from a list of definitions.">evalprocess</a>(gExpandedDefList);
<a name="l00528"></a>00528     <span class="keywordflow">if</span> (<a class="code" href="errormsg_8cpp.html#a446dbef8a744dce9d99bab7cf8c7d6d0">gErrorCount</a> &gt; 0) {
<a name="l00529"></a>00529        <span class="comment">// cerr &lt;&lt; &quot;Total of &quot; &lt;&lt; gErrorCount &lt;&lt; &quot; errors during evaluation of : process = &quot; &lt;&lt; boxpp(process) &lt;&lt; &quot;;\n&quot;;</span>
<a name="l00530"></a>00530         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 the compilation of  &quot;</span> &lt;&lt; <a class="code" href="doc_8cpp.html#a1c0fac9c77fcd7f4e21daf398e9830de">gMasterDocument</a> &lt;&lt; <span class="stringliteral">&quot;;\n&quot;</span>;
<a name="l00531"></a>00531         exit(1);
<a name="l00532"></a>00532     }
<a name="l00533"></a>00533 
<a name="l00534"></a>00534 
<a name="l00535"></a>00535     <span class="keywordflow">if</span> (<a class="code" href="doc_8cpp.html#a4741733b16ad8f554a8b5c0ca5045d14">gDetailsSwitch</a>) { cerr &lt;&lt; <span class="stringliteral">&quot;process = &quot;</span> &lt;&lt; <a class="code" href="classboxpp.html">boxpp</a>(process) &lt;&lt; <span class="stringliteral">&quot;;\n&quot;</span>; }
<a name="l00536"></a>00536 
<a name="l00537"></a>00537     <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#a4d67cde178e71e63a2105ee41d8d0ecf">gDrawPSSwitch</a> or <a class="code" href="main_8cpp.html#a7d66485c9ad80b79c55997ac2acc24f3">gDrawSVGSwitch</a>) {
<a name="l00538"></a>00538         <span class="keywordtype">string</span> projname = <a class="code" href="doc_8cpp.html#a1c0fac9c77fcd7f4e21daf398e9830de">gMasterDocument</a>;
<a name="l00539"></a>00539         <span class="keywordflow">if</span>( <a class="code" href="doc_8cpp.html#a1c0fac9c77fcd7f4e21daf398e9830de">gMasterDocument</a>.substr(<a class="code" href="doc_8cpp.html#a1c0fac9c77fcd7f4e21daf398e9830de">gMasterDocument</a>.length()-4) == <span class="stringliteral">&quot;.dsp&quot;</span> ) {
<a name="l00540"></a>00540             projname = <a class="code" href="doc_8cpp.html#a1c0fac9c77fcd7f4e21daf398e9830de">gMasterDocument</a>.substr(0, <a class="code" href="doc_8cpp.html#a1c0fac9c77fcd7f4e21daf398e9830de">gMasterDocument</a>.length()-4); 
<a name="l00541"></a>00541         }
<a name="l00542"></a>00542         <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#a4d67cde178e71e63a2105ee41d8d0ecf">gDrawPSSwitch</a>)  { <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>( process, <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$0-ps&quot;</span>,  projname).c_str(), <span class="stringliteral">&quot;ps&quot;</span> ); }
<a name="l00543"></a>00543         <span class="keywordflow">if</span> (gDrawSVGSwitch) { <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>( process, <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$0-svg&quot;</span>, projname).c_str(), <span class="stringliteral">&quot;svg&quot;</span> ); }
<a name="l00544"></a>00544     }
<a name="l00545"></a>00545 
<a name="l00546"></a>00546     <span class="keywordtype">int</span> numInputs, numOutputs;
<a name="l00547"></a>00547     <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>(process, &amp;numInputs, &amp;numOutputs)) {
<a name="l00548"></a>00548         cerr &lt;&lt; <span class="stringliteral">&quot;ERROR during the evaluation of  process : &quot;</span>
<a name="l00549"></a>00549              &lt;&lt; <a class="code" href="classboxpp.html">boxpp</a>(process) &lt;&lt; endl;
<a name="l00550"></a>00550         exit(1);
<a name="l00551"></a>00551     }
<a name="l00552"></a>00552 
<a name="l00553"></a>00553     <span class="keywordflow">if</span> (<a class="code" href="doc_8cpp.html#a4741733b16ad8f554a8b5c0ca5045d14">gDetailsSwitch</a>) {
<a name="l00554"></a>00554         cerr &lt;&lt;<span class="stringliteral">&quot;process has &quot;</span> &lt;&lt; numInputs &lt;&lt;<span class="stringliteral">&quot; inputs, and &quot;</span> &lt;&lt; numOutputs &lt;&lt;<span class="stringliteral">&quot; outputs&quot;</span> &lt;&lt; endl;
<a name="l00555"></a>00555     }
<a name="l00556"></a>00556     
<a name="l00557"></a>00557     <a class="code" href="timing_8cpp.html#ac5c8a9d488cf5c7d786c833565e093e9">endTiming</a>(<span class="stringliteral">&quot;evaluation&quot;</span>);
<a name="l00558"></a>00558 
<a name="l00559"></a>00559 
<a name="l00560"></a>00560     <span class="comment">/****************************************************************</span>
<a name="l00561"></a>00561 <span class="comment">     3.5 - output file list is needed</span>
<a name="l00562"></a>00562 <span class="comment">    *****************************************************************/</span>
<a name="l00563"></a>00563     <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#a7bd08d103dd526c9e66325a94454fccd">gPrintFileListSwitch</a>) {
<a name="l00564"></a>00564         cout &lt;&lt; <span class="stringliteral">&quot;******* &quot;</span>;
<a name="l00565"></a>00565         <span class="comment">// print the pathnames of the files used to evaluate process</span>
<a name="l00566"></a>00566         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="l00567"></a>00567         <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i&lt; pathnames.size(); i++) cout &lt;&lt; pathnames[i] &lt;&lt; <span class="charliteral">&#39; &#39;</span>;
<a name="l00568"></a>00568         cout &lt;&lt; endl;
<a name="l00569"></a>00569 
<a name="l00570"></a>00570     }
<a name="l00571"></a>00571     
<a name="l00572"></a>00572 
<a name="l00573"></a>00573     <span class="comment">/****************************************************************</span>
<a name="l00574"></a>00574 <span class="comment">     4 - compute output signals of &#39;process&#39;</span>
<a name="l00575"></a>00575 <span class="comment">    *****************************************************************/</span>
<a name="l00576"></a>00576     
<a name="l00577"></a>00577     <a class="code" href="timing_8cpp.html#a8b3ae592fe54580b95171a2bdabb2641">startTiming</a>(<span class="stringliteral">&quot;propagation&quot;</span>);
<a name="l00578"></a>00578 
<a name="l00579"></a>00579 
<a name="l00580"></a>00580     <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> lsignals = <a class="code" href="propagate_8cpp.html#a2c94521fac4766648f41758d1be4b089">boxPropagateSig</a>(<a class="code" href="list_8cpp.html#a538b704dd07794b7237108f1917c471e">nil</a>, process , <a class="code" href="propagate_8cpp.html#a06328b74db9d4726b9144cf9da9a3a17" title="Fabrique une liste de n entrées.">makeSigInputList</a>(numInputs) );
<a name="l00581"></a>00581     <span class="keywordflow">if</span> (<a class="code" href="doc_8cpp.html#a4741733b16ad8f554a8b5c0ca5045d14">gDetailsSwitch</a>) { cerr &lt;&lt; <span class="stringliteral">&quot;output signals are : &quot;</span> &lt;&lt; endl;  <a class="code" href="sigprint_8cpp.html#ac996689aaeee388feb18661ff38abe01">printSignal</a>(lsignals, stderr); }
<a name="l00582"></a>00582 
<a name="l00583"></a>00583     <a class="code" href="timing_8cpp.html#ac5c8a9d488cf5c7d786c833565e093e9">endTiming</a>(<span class="stringliteral">&quot;propagation&quot;</span>);
<a name="l00584"></a>00584 
<a name="l00585"></a>00585 
<a name="l00586"></a>00586     <span class="comment">/****************************************************************</span>
<a name="l00587"></a>00587 <span class="comment">     5 - translate output signals into C++ code</span>
<a name="l00588"></a>00588 <span class="comment">    *****************************************************************/</span>
<a name="l00589"></a>00589 
<a name="l00590"></a>00590     <a class="code" href="timing_8cpp.html#a8b3ae592fe54580b95171a2bdabb2641">startTiming</a>(<span class="stringliteral">&quot;compilation&quot;</span>);
<a name="l00591"></a>00591 
<a name="l00592"></a>00592     <a class="code" href="classCompiler.html">Compiler</a>* C;
<a name="l00593"></a>00593     <span class="keywordflow">if</span> (<a class="code" href="klass_8cpp.html#a44285cbe41b6d58a00854fead2999187">gVectorSwitch</a>)  C = <span class="keyword">new</span> <a class="code" href="classVectorCompiler.html" title="Compile a list of FAUST signals into a vector C++ class.">VectorCompiler</a>(<span class="stringliteral">&quot;mydsp&quot;</span>, <span class="stringliteral">&quot;dsp&quot;</span>, numInputs, numOutputs);
<a name="l00594"></a>00594     <span class="keywordflow">else</span>                C = <span class="keyword">new</span> <a class="code" href="classScalarCompiler.html" title="Compile a list of FAUST signals into a scalar C++ class.">ScalarCompiler</a>(<span class="stringliteral">&quot;mydsp&quot;</span>, <span class="stringliteral">&quot;dsp&quot;</span>, numInputs, numOutputs);
<a name="l00595"></a>00595 
<a name="l00596"></a>00596     <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#aa9bf768c06070d9ba7d953ce5158e577">gPrintXMLSwitch</a>) C-&gt;<a class="code" href="classCompiler.html#a5c7a151a77ef3d9c22ba11b52017d6c5">setDescription</a>(<span class="keyword">new</span> <a class="code" href="classDescription.html">Description</a>());
<a name="l00597"></a>00597     <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#a2779bb51324faa59c44edeba85ba6681">gPrintDocSwitch</a>) C-&gt;<a class="code" href="classCompiler.html#a5c7a151a77ef3d9c22ba11b52017d6c5">setDescription</a>(<span class="keyword">new</span> <a class="code" href="classDescription.html">Description</a>());
<a name="l00598"></a>00598 
<a name="l00599"></a>00599     C-&gt;<a class="code" href="classCompiler.html#ad090565a1a134ba2d9ccab6fccfb6acc">compileMultiSignal</a>(lsignals);
<a name="l00600"></a>00600 
<a name="l00601"></a>00601     <a class="code" href="timing_8cpp.html#ac5c8a9d488cf5c7d786c833565e093e9">endTiming</a>(<span class="stringliteral">&quot;compilation&quot;</span>);
<a name="l00602"></a>00602 
<a name="l00603"></a>00603     <span class="comment">/****************************************************************</span>
<a name="l00604"></a>00604 <span class="comment">     6 - generate XML description (if required)</span>
<a name="l00605"></a>00605 <span class="comment">    *****************************************************************/</span>
<a name="l00606"></a>00606 
<a name="l00607"></a>00607     <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#aa9bf768c06070d9ba7d953ce5158e577">gPrintXMLSwitch</a>) {
<a name="l00608"></a>00608         <a class="code" href="classDescription.html">Description</a>*    D = C-&gt;<a class="code" href="classCompiler.html#a495eb177be64e12faf4c24cd7239d0e9">getDescription</a>(); assert(D);
<a name="l00609"></a>00609         <span class="comment">//ostream*      xout = new ofstream(subst(&quot;$0.xml&quot;, gMasterDocument).c_str());</span>
<a name="l00610"></a>00610         ofstream        xout(<a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$0.xml&quot;</span>, <a class="code" href="doc_8cpp.html#a1c0fac9c77fcd7f4e21daf398e9830de">gMasterDocument</a>).c_str());
<a name="l00611"></a>00611 
<a name="l00612"></a>00612         <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>))&gt;0)          D-&gt;<a class="code" href="classDescription.html#ab1cbe1d3a525aaf1e3b8d3e74f114465">name</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="l00613"></a>00613         <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>))&gt;0)        D-&gt;<a class="code" href="classDescription.html#a56303e0baff68010f1e3253093a33f99">author</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="l00614"></a>00614         <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;copyright&quot;</span>))&gt;0)     D-&gt;<a class="code" href="classDescription.html#a0531d390c3c0c3c62381134d2204dfee">copyright</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;copyright&quot;</span>)].begin())));
<a name="l00615"></a>00615         <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;license&quot;</span>))&gt;0)       D-&gt;<a class="code" href="classDescription.html#a3c0915fecdabcd4fab783a14bce77aa3">license</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;license&quot;</span>)].begin())));
<a name="l00616"></a>00616         <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;version&quot;</span>))&gt;0)       D-&gt;<a class="code" href="classDescription.html#a5f97f665a605d0e4945acf465face89f">version</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;version&quot;</span>)].begin())));
<a name="l00617"></a>00617 
<a name="l00618"></a>00618         D-&gt;<a class="code" href="classDescription.html#ae32f3bad5a9a38abce91f4da38143d4e">inputs</a>(C-&gt;<a class="code" href="classCompiler.html#acbc0eb4c3a063b96a0fe2c38014ee131">getClass</a>()-&gt;<a class="code" href="classKlass.html#ae4a8930e2604b74416905dc1830c2bb1">inputs</a>());
<a name="l00619"></a>00619         D-&gt;<a class="code" href="classDescription.html#a6a5f194a6220a979241195530e0e4437">outputs</a>(C-&gt;<a class="code" href="classCompiler.html#acbc0eb4c3a063b96a0fe2c38014ee131">getClass</a>()-&gt;<a class="code" href="classKlass.html#a7050eb78afb74764622f1b6140297dd4">outputs</a>());
<a name="l00620"></a>00620 
<a name="l00621"></a>00621         D-&gt;<a class="code" href="classDescription.html#a6c11e0cfae5c43a8ecd1d89b5046e27c">print</a>(0, xout);
<a name="l00622"></a>00622     }
<a name="l00623"></a>00623 
<a name="l00624"></a>00624 
<a name="l00625"></a>00625     <span class="comment">/****************************************************************</span>
<a name="l00626"></a>00626 <span class="comment">     7 - generate documentation from Faust comments (if required)</span>
<a name="l00627"></a>00627 <span class="comment">    *****************************************************************/</span>
<a name="l00628"></a>00628 
<a name="l00629"></a>00629 
<a name="l00630"></a>00630     <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#a2779bb51324faa59c44edeba85ba6681">gPrintDocSwitch</a>) {
<a name="l00631"></a>00631         <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#a232019c7c8d19c2297386944419f66d2">gLatexDocSwitch</a>) {
<a name="l00632"></a>00632             <span class="keywordtype">string</span> projname = <a class="code" href="doc_8cpp.html#a1c0fac9c77fcd7f4e21daf398e9830de">gMasterDocument</a>;
<a name="l00633"></a>00633             <span class="keywordflow">if</span>( <a class="code" href="doc_8cpp.html#a1c0fac9c77fcd7f4e21daf398e9830de">gMasterDocument</a>.substr(<a class="code" href="doc_8cpp.html#a1c0fac9c77fcd7f4e21daf398e9830de">gMasterDocument</a>.length()-4) == <span class="stringliteral">&quot;.dsp&quot;</span> ) {
<a name="l00634"></a>00634                 projname = <a class="code" href="doc_8cpp.html#a1c0fac9c77fcd7f4e21daf398e9830de">gMasterDocument</a>.substr(0, <a class="code" href="doc_8cpp.html#a1c0fac9c77fcd7f4e21daf398e9830de">gMasterDocument</a>.length()-4); }
<a name="l00635"></a>00635             <a class="code" href="doc_8cpp.html#a8c5b3a35aaf051de7ed2a8e480a010f4" title="The entry point to generate faust doc files.">printDoc</a>( <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$0-mdoc&quot;</span>, projname).c_str(), <span class="stringliteral">&quot;tex&quot;</span>, <a class="code" href="main_8cpp.html#ab2518c0a1e64ec42eae9a7fee0e716b0">FAUSTVERSION</a> );
<a name="l00636"></a>00636         }
<a name="l00637"></a>00637     }
<a name="l00638"></a>00638 
<a name="l00639"></a>00639 
<a name="l00640"></a>00640 
<a name="l00641"></a>00641 
<a name="l00642"></a>00642     <span class="comment">/****************************************************************</span>
<a name="l00643"></a>00643 <span class="comment">     8 - generate output file</span>
<a name="l00644"></a>00644 <span class="comment">    *****************************************************************/</span>
<a name="l00645"></a>00645 
<a name="l00646"></a>00646     ostream* dst;
<a name="l00647"></a>00647     istream* enrobage;
<a name="l00648"></a>00648     <span class="comment">//istream* intrinsic;</span>
<a name="l00649"></a>00649 
<a name="l00650"></a>00650     <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#a7934d48a2d5906a3de7f45d903789a8d">gOutputFile</a> != <span class="stringliteral">&quot;&quot;</span>) {
<a name="l00651"></a>00651         dst = <span class="keyword">new</span> ofstream(<a class="code" href="main_8cpp.html#a7934d48a2d5906a3de7f45d903789a8d">gOutputFile</a>.c_str());
<a name="l00652"></a>00652     } <span class="keywordflow">else</span> {
<a name="l00653"></a>00653         dst = &amp;cout;
<a name="l00654"></a>00654     }
<a name="l00655"></a>00655 
<a name="l00656"></a>00656     <span class="keywordflow">if</span> (<a class="code" href="main_8cpp.html#a9dd5fe0ed04b1c9a973ee315fabe2b7b">gArchFile</a> != <span class="stringliteral">&quot;&quot;</span>) {
<a name="l00657"></a>00657         <span class="keywordflow">if</span> ( (enrobage = <a class="code" href="enrobage_8cpp.html#a901a730cc8136f70a2073da23fafa61e" title="Try to open an architecture file searching in various directories.">open_arch_stream</a>(<a class="code" href="main_8cpp.html#a9dd5fe0ed04b1c9a973ee315fabe2b7b">gArchFile</a>.c_str())) ) {
<a name="l00658"></a>00658             <a class="code" href="main_8cpp.html#a1df7d4f6274676035f8d9467a99e2fca">printheader</a>(*dst);
<a name="l00659"></a>00659             C-&gt;<a class="code" href="classCompiler.html#acbc0eb4c3a063b96a0fe2c38014ee131">getClass</a>()-&gt;<a class="code" href="classKlass.html#af497466e4d139514e45088917d208142" title="Print the required C++ libraries as comments in source code.">printLibrary</a>(*dst);
<a name="l00660"></a>00660             C-&gt;<a class="code" href="classCompiler.html#acbc0eb4c3a063b96a0fe2c38014ee131">getClass</a>()-&gt;<a class="code" href="classKlass.html#abd4216fcfc280a3f180421c95c17737e" title="Print the required include files.">printIncludeFile</a>(*dst);
<a name="l00661"></a>00661 
<a name="l00662"></a>00662             <a class="code" href="enrobage_8cpp.html#a5f5bd14f70f4edf37e76608dab1a6bd2" title="Copy src to dst until specific line.">streamCopyUntil</a>(*enrobage, *dst, <span class="stringliteral">&quot;&lt;&lt;includeIntrinsic&gt;&gt;&quot;</span>);
<a name="l00663"></a>00663             
<a name="l00664"></a>00664 <span class="comment">//          if ( gVectorSwitch &amp;&amp; (intrinsic = open_arch_stream(&quot;intrinsic.hh&quot;)) ) {</span>
<a name="l00665"></a>00665 <span class="comment">//              streamCopyUntilEnd(*intrinsic, *dst);</span>
<a name="l00666"></a>00666 <span class="comment">//          }</span>
<a name="l00667"></a>00667             
<a name="l00668"></a>00668             <span class="keywordflow">if</span> (<a class="code" href="compile__scal_8cpp.html#aed8da6f8f23ca426bf3ea6564e0bd6f2">gSchedulerSwitch</a>) {
<a name="l00669"></a>00669                 istream* scheduler_include = <a class="code" href="enrobage_8cpp.html#a901a730cc8136f70a2073da23fafa61e" title="Try to open an architecture file searching in various directories.">open_arch_stream</a>(<span class="stringliteral">&quot;scheduler.h&quot;</span>);
<a name="l00670"></a>00670                 <span class="keywordflow">if</span> (scheduler_include) {
<a name="l00671"></a>00671                     <a class="code" href="enrobage_8cpp.html#aeea853d479ea9c4fbf204795c0334e9d" title="Copy src to dst.">streamCopy</a>(*scheduler_include, *dst);
<a name="l00672"></a>00672                 }
<a name="l00673"></a>00673             }
<a name="l00674"></a>00674             
<a name="l00675"></a>00675             <a class="code" href="enrobage_8cpp.html#a5f5bd14f70f4edf37e76608dab1a6bd2" title="Copy src to dst until specific line.">streamCopyUntil</a>(*enrobage, *dst, <span class="stringliteral">&quot;&lt;&lt;includeclass&gt;&gt;&quot;</span>);
<a name="l00676"></a>00676             <a class="code" href="floats_8cpp.html#ab86f66f2ff1b80e5283c8619216477f1">printfloatdef</a>(*dst);
<a name="l00677"></a>00677             
<a name="l00678"></a>00678             C-&gt;<a class="code" href="classCompiler.html#acbc0eb4c3a063b96a0fe2c38014ee131">getClass</a>()-&gt;<a class="code" href="classKlass.html#a73bd9f5dc4fdcb63901d5188d696b58f" title="Print a full C++ class corresponding to a Faust dsp.">println</a>(0,*dst);
<a name="l00679"></a>00679             <a class="code" href="enrobage_8cpp.html#af1ac810ee8c704632447ef8650c8dc20" title="Copy src to dst until end.">streamCopyUntilEnd</a>(*enrobage, *dst);
<a name="l00680"></a>00680         } <span class="keywordflow">else</span> {
<a name="l00681"></a>00681             cerr &lt;&lt; <span class="stringliteral">&quot;ERROR : can&#39;t open architecture file &quot;</span> &lt;&lt; <a class="code" href="main_8cpp.html#a9dd5fe0ed04b1c9a973ee315fabe2b7b">gArchFile</a> &lt;&lt; endl;
<a name="l00682"></a>00682             <span class="keywordflow">return</span> 1;
<a name="l00683"></a>00683         }
<a name="l00684"></a>00684     } <span class="keywordflow">else</span> {
<a name="l00685"></a>00685         <a class="code" href="main_8cpp.html#a1df7d4f6274676035f8d9467a99e2fca">printheader</a>(*dst);
<a name="l00686"></a>00686         <a class="code" href="floats_8cpp.html#ab86f66f2ff1b80e5283c8619216477f1">printfloatdef</a>(*dst);
<a name="l00687"></a>00687         C-&gt;<a class="code" href="classCompiler.html#acbc0eb4c3a063b96a0fe2c38014ee131">getClass</a>()-&gt;<a class="code" href="classKlass.html#af497466e4d139514e45088917d208142" title="Print the required C++ libraries as comments in source code.">printLibrary</a>(*dst);
<a name="l00688"></a>00688         C-&gt;<a class="code" href="classCompiler.html#acbc0eb4c3a063b96a0fe2c38014ee131">getClass</a>()-&gt;<a class="code" href="classKlass.html#abd4216fcfc280a3f180421c95c17737e" title="Print the required include files.">printIncludeFile</a>(*dst);
<a name="l00689"></a>00689         C-&gt;<a class="code" href="classCompiler.html#acbc0eb4c3a063b96a0fe2c38014ee131">getClass</a>()-&gt;<a class="code" href="classKlass.html#a73bd9f5dc4fdcb63901d5188d696b58f" title="Print a full C++ class corresponding to a Faust dsp.">println</a>(0,*dst);
<a name="l00690"></a>00690     }
<a name="l00691"></a>00691     
<a name="l00692"></a>00692     <span class="keyword">delete</span> C;
<a name="l00693"></a>00693     <span class="keywordflow">return</span> 0;
<a name="l00694"></a>00694 }
</pre></div></div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Wed Apr 28 23:59:59 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>