<!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: compile.hh 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 Page</span></a></li> <li><a href="pages.html"><span>Related 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 List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <h1>compile.hh</h1><a href="compile_8hh.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>00021 <a name="l00022"></a>00022 <a name="l00023"></a>00023 <a name="l00024"></a>00024 <span class="preprocessor">#ifndef _COMPILE_</span> <a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#define _COMPILE_</span> <a name="l00026"></a>00026 <span class="preprocessor"></span> <a name="l00027"></a>00027 <a name="l00028"></a>00028 <span class="preprocessor">#include "<a class="code" href="signals_8hh.html">signals.hh</a>"</span> <a name="l00029"></a>00029 <span class="preprocessor">#include "<a class="code" href="klass_8hh.html">klass.hh</a>"</span> <a name="l00030"></a>00030 <span class="preprocessor">#include "<a class="code" href="Text_8hh.html">Text.hh</a>"</span> <a name="l00031"></a>00031 <span class="preprocessor">#include "<a class="code" href="uitree_8hh.html">uitree.hh</a>"</span> <a name="l00032"></a>00032 <span class="preprocessor">#include <string></span> <a name="l00033"></a>00033 <span class="preprocessor">#include <list></span> <a name="l00034"></a>00034 <span class="preprocessor">#include <stack></span> <a name="l00035"></a>00035 <span class="preprocessor">#include <map></span> <a name="l00036"></a>00036 <a name="l00037"></a>00037 <span class="preprocessor">#include "<a class="code" href="description_8hh.html">description.hh</a>"</span> <a name="l00038"></a>00038 <a name="l00040"></a>00040 <a name="l00045"></a>00045 <a name="l00046"></a>00046 <a name="l00047"></a><a class="code" href="compile_8hh.html#a1f03951f58888cdbca58ae3896c1f9f2">00047</a> <span class="preprocessor">#define kMaxHeight 1024</span> <a name="l00048"></a>00048 <span class="preprocessor"></span> <a name="l00049"></a>00049 <a name="l00050"></a><a class="code" href="classCompiler.html">00050</a> <span class="keyword">class </span><a class="code" href="classCompiler.html">Compiler</a> <a name="l00051"></a>00051 { <a name="l00052"></a>00052 <span class="keyword">protected</span>: <a name="l00053"></a><a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">00053</a> <a class="code" href="classKlass.html">Klass</a>* <a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>; <a name="l00054"></a><a class="code" href="classCompiler.html#a2a8d69c98d96b9015d861617a6faadcc">00054</a> <span class="keywordtype">bool</span> <a class="code" href="classCompiler.html#a2a8d69c98d96b9015d861617a6faadcc">fNeedToDeleteClass</a>; <a name="l00055"></a><a class="code" href="classCompiler.html#a2b8004ea1fd5b86ded1a093e7c5eb70d">00055</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="classCompiler.html#a2b8004ea1fd5b86ded1a093e7c5eb70d">fUIRoot</a>; <a name="l00056"></a><a class="code" href="classCompiler.html#a8a23c67dd7d72d5aa6353d29de84b711">00056</a> <a class="code" href="classDescription.html">Description</a>* <a class="code" href="classCompiler.html#a8a23c67dd7d72d5aa6353d29de84b711">fDescription</a>; <a name="l00057"></a>00057 <a name="l00058"></a>00058 <span class="keyword">public</span>: <a name="l00059"></a>00059 <a class="code" href="classCompiler.html#a3ec4b139d880a9dd56656f072ba04687">Compiler</a> (<span class="keyword">const</span> <span class="keywordtype">string</span>& <a class="code" href="symbol_8hh.html#a8243134fbbd9d924ebbb3f833922e310" title="Returns the name of a symbol.">name</a>, <span class="keyword">const</span> <span class="keywordtype">string</span>& super, <span class="keywordtype">int</span> numInputs, <span class="keywordtype">int</span> numOutputs, <span class="keywordtype">bool</span> vec); <a name="l00060"></a>00060 <a class="code" href="classCompiler.html#a3ec4b139d880a9dd56656f072ba04687">Compiler</a> (<a class="code" href="classKlass.html">Klass</a>* k); <a name="l00061"></a>00061 <a name="l00062"></a>00062 <span class="keyword">virtual</span> <a class="code" href="classCompiler.html#ac06e6b6aa74c6da15efa3f0416df53b2">~Compiler</a>(); <a name="l00063"></a>00063 <a name="l00064"></a>00064 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCompiler.html#ad090565a1a134ba2d9ccab6fccfb6acc">compileMultiSignal</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> lsig) = 0; <a name="l00065"></a>00065 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCompiler.html#a0a282f00285b51971d41a6b7e3bd5f7c">compileSingleSignal</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> lsig) = 0; <a name="l00066"></a>00066 <a name="l00067"></a><a class="code" href="classCompiler.html#acbc0eb4c3a063b96a0fe2c38014ee131">00067</a> <a class="code" href="classKlass.html">Klass</a>* <a class="code" href="classCompiler.html#acbc0eb4c3a063b96a0fe2c38014ee131">getClass</a>() { <span class="keywordflow">return</span> (<a class="code" href="classKlass.html">Klass</a>*)<a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>; } <a name="l00068"></a>00068 <a name="l00069"></a><a class="code" href="classCompiler.html#a5c7a151a77ef3d9c22ba11b52017d6c5">00069</a> <span class="keywordtype">void</span> <a class="code" href="classCompiler.html#a5c7a151a77ef3d9c22ba11b52017d6c5">setDescription</a>(<a class="code" href="classDescription.html">Description</a>* descr) { <a class="code" href="classCompiler.html#a8a23c67dd7d72d5aa6353d29de84b711">fDescription</a>= descr; } <a name="l00070"></a><a class="code" href="classCompiler.html#a495eb177be64e12faf4c24cd7239d0e9">00070</a> <a class="code" href="classDescription.html">Description</a>* <a class="code" href="classCompiler.html#a495eb177be64e12faf4c24cd7239d0e9">getDescription</a>() { <span class="keywordflow">return</span> <a class="code" href="classCompiler.html#a8a23c67dd7d72d5aa6353d29de84b711">fDescription</a>; } <a name="l00071"></a>00071 <a name="l00072"></a>00072 <span class="keyword">protected</span>: <a name="l00073"></a>00073 <span class="keyword">virtual</span> <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> <a class="code" href="classCompiler.html#a825249700edc26eac7eaa52790186f70">prepare</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> L0) = 0; <a name="l00074"></a>00074 <span class="keyword">virtual</span> <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> <a class="code" href="classCompiler.html#a07c227f3f0e6751545c3c0af3b299d5d">prepare2</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> L0) = 0; <a name="l00075"></a>00075 <a name="l00076"></a>00076 <span class="comment">// gestion des includes et librairies</span> <a name="l00077"></a><a class="code" href="classCompiler.html#a7682294288c38e7d56ef262052213779">00077</a> <span class="keywordtype">void</span> <a class="code" href="classCompiler.html#a7682294288c38e7d56ef262052213779">addIncludeFile</a> (<span class="keyword">const</span> <span class="keywordtype">string</span>& str) { <a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>-><a class="code" href="classKlass.html#a84e4e28d9af7ec06773f66f2a1ce218f">addIncludeFile</a>(str); } <a name="l00078"></a><a class="code" href="classCompiler.html#a5a2cfd7e795a98e66b31543e2b5225b5">00078</a> <span class="keywordtype">void</span> <a class="code" href="classCompiler.html#a5a2cfd7e795a98e66b31543e2b5225b5">addLibrary</a> (<span class="keyword">const</span> <span class="keywordtype">string</span>& str) { <a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>-><a class="code" href="classKlass.html#afff14e4a4d2d46dda0259e1423636539">addLibrary</a>(str); } <a name="l00079"></a>00079 <a name="l00080"></a>00080 <span class="comment">// gestion de la description arborescente de l'IU</span> <a name="l00081"></a>00081 <span class="keywordtype">void</span> <a class="code" href="classCompiler.html#a4532f2ccb5ae6b5bcef23029a01a86c2" title="Add a widget with a certain path to the user interface tree.">addUIWidget</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> path, <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> widget); <a name="l00082"></a>00082 <span class="keywordtype">void</span> <a class="code" href="classCompiler.html#a04e71115fb646ad756b60a3169267863" title="Generate buildUserInterface C++ lines of code corresponding to user interface widget...">generateWidgetCode</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> fulllabel, <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> varname, <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> sig); <a name="l00083"></a>00083 <span class="keywordtype">void</span> <a class="code" href="classCompiler.html#ae994f402a26a38796eab173a1028804e" title="Generate buildUserInterface C++ lines of code corresponding to user interface element...">generateUserInterfaceTree</a>(<a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> t); <a name="l00084"></a>00084 <span class="keywordtype">void</span> <a class="code" href="classCompiler.html#a990c992c382168071403c21f31c117ee" title="Iterate generateUserInterfaceTree on a list of user interface elements.">generateUserInterfaceElements</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> elements); <a name="l00085"></a>00085 <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="classCompiler.html#a4e6876486af1cf65dc633fd3b99aba85" title="Remove fake root folder if not needed (that is if the UI is completely enclosed in...">prepareUserInterfaceTree</a>(<a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> t); <a name="l00086"></a>00086 <a name="l00087"></a>00087 <span class="keywordtype">void</span> <a class="code" href="classCompiler.html#a83bb12b7d930bd1b574e35202f5d3da6" title="Generate user interface macros corresponding to user interface element t.">generateMacroInterfaceTree</a>(<span class="keyword">const</span> <span class="keywordtype">string</span>& pathname, <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> t); <a name="l00088"></a>00088 <span class="keywordtype">void</span> <a class="code" href="classCompiler.html#a4904be552402fc21847bd5026cc23a62" title="Iterate generateMacroInterfaceTree on a list of user interface elements.">generateMacroInterfaceElements</a>(<span class="keyword">const</span> <span class="keywordtype">string</span>& pathname, <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> elements); <a name="l00089"></a>00089 <span class="keywordtype">void</span> <a class="code" href="classCompiler.html#abafd4cec7ee4807031766e86f889e5d5" title="Generate user interface macros corresponding to a user interface widget.">generateWidgetMacro</a>(<span class="keyword">const</span> <span class="keywordtype">string</span>& pathname, <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> fulllabel, <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> varname, <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> sig); <a name="l00090"></a>00090 <a name="l00091"></a>00091 <a name="l00092"></a>00092 }; <a name="l00093"></a><a class="code" href="compile_8hh.html#adbd65c7d17008ef814815c22eff0c8d2">00093</a> <span class="preprocessor">#define generateEquivRecGroup generateRecGroup</span> <a name="l00094"></a>00094 <span class="preprocessor"></span> <a name="l00095"></a>00095 <a name="l00096"></a>00096 <span class="keywordtype">void</span> <a class="code" href="compile_8hh.html#a28bfd55f456966960d731380bec6e920">compileSignals</a> (<span class="keyword">const</span> <span class="keywordtype">string</span>& <a class="code" href="symbol_8hh.html#a8243134fbbd9d924ebbb3f833922e310" title="Returns the name of a symbol.">name</a>, <span class="keyword">const</span> <span class="keywordtype">string</span>& super, <span class="keywordtype">int</span> numInputs, <span class="keywordtype">int</span> numOutputs, <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> lsig); <a name="l00097"></a>00097 <a name="l00098"></a>00098 <span class="preprocessor">#endif</span> </pre></div></div> <hr class="footer"/><address style="text-align: right;"><small>Generated on Wed Apr 28 23:59:58 2010 for FAUST compiler by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address> </body> </html>