Sophie

Sophie

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

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: drawschema.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>drawschema.cpp</h1><a href="drawschema_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>00021 
<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &lt;ctype.h&gt;</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;sys/stat.h&gt;</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;sys/types.h&gt;</span>
<a name="l00034"></a>00034 <span class="preprocessor">#include &lt;errno.h&gt;</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include &lt;string.h&gt;</span>
<a name="l00036"></a>00036 
<a name="l00037"></a>00037 <span class="preprocessor">#include &lt;ostream&gt;</span>
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;sstream&gt;</span>
<a name="l00039"></a>00039 <span class="preprocessor">#include &lt;set&gt;</span>
<a name="l00040"></a>00040 <span class="preprocessor">#include &lt;utility&gt;</span>
<a name="l00041"></a>00041 <span class="preprocessor">#include &lt;map&gt;</span>
<a name="l00042"></a>00042 <span class="preprocessor">#include &lt;stack&gt;</span>
<a name="l00043"></a>00043 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00044"></a>00044 
<a name="l00045"></a>00045 <span class="preprocessor">#include &quot;<a class="code" href="boxes_8hh.html">boxes.hh</a>&quot;</span>
<a name="l00046"></a>00046 <span class="preprocessor">#include &quot;<a class="code" href="ppbox_8hh.html">ppbox.hh</a>&quot;</span>
<a name="l00047"></a>00047 <span class="preprocessor">#include &quot;<a class="code" href="prim2_8hh.html">prim2.hh</a>&quot;</span>
<a name="l00048"></a>00048 
<a name="l00049"></a>00049 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00050"></a>00050 <span class="preprocessor">#include &quot;<a class="code" href="devLib_8h.html">devLib.h</a>&quot;</span>
<a name="l00051"></a>00051 <span class="preprocessor">#include &quot;<a class="code" href="ppbox_8hh.html">ppbox.hh</a>&quot;</span>
<a name="l00052"></a>00052 <span class="preprocessor">#include &quot;<a class="code" href="xtended_8hh.html">xtended.hh</a>&quot;</span>
<a name="l00053"></a>00053 <span class="preprocessor">#include &quot;<a class="code" href="occurrences_8hh.html">occurrences.hh</a>&quot;</span>
<a name="l00054"></a>00054 <span class="preprocessor">#include &quot;<a class="code" href="boxcomplexity_8h.html">boxcomplexity.h</a>&quot;</span>
<a name="l00055"></a>00055 
<a name="l00056"></a>00056 <span class="preprocessor">#include &quot;<a class="code" href="schema_8h.html">schema.h</a>&quot;</span>
<a name="l00057"></a>00057 <span class="preprocessor">#include &quot;<a class="code" href="drawschema_8hh.html">drawschema.hh</a>&quot;</span>
<a name="l00058"></a>00058 <span class="preprocessor">#include &quot;<a class="code" href="compatibility_8hh.html">compatibility.hh</a>&quot;</span>
<a name="l00059"></a>00059 <span class="preprocessor">#include &quot;<a class="code" href="names_8hh.html" title="Interface for names management.">names.hh</a>&quot;</span>
<a name="l00060"></a>00060 
<a name="l00061"></a>00061 
<a name="l00062"></a>00062 <span class="preprocessor">#if 0</span>
<a name="l00063"></a>00063 <span class="preprocessor"></span><span class="preprocessor">#define linkcolor &quot;#b3d1dc&quot;</span>
<a name="l00064"></a>00064 <span class="preprocessor"></span><span class="preprocessor">#define normalcolor &quot;#ffeaa2&quot;</span>
<a name="l00065"></a>00065 <span class="preprocessor"></span><span class="preprocessor">#define uicolor &quot;#F1CFA1&quot;</span>
<a name="l00066"></a>00066 <span class="preprocessor"></span><span class="preprocessor">#define slotcolor &quot;#ffffd7&quot;</span>
<a name="l00067"></a>00067 <span class="preprocessor"></span><span class="preprocessor">#define numcolor &quot;#ffffff&quot;</span>
<a name="l00068"></a>00068 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00069"></a>00069 <span class="preprocessor"></span>
<a name="l00070"></a>00070 <span class="preprocessor">#if 0</span>
<a name="l00071"></a>00071 <span class="preprocessor"></span><span class="preprocessor">#define linkcolor &quot;#F57900&quot; </span>
<a name="l00072"></a>00072 <span class="preprocessor"></span><span class="preprocessor">#define normalcolor &quot;#4B71A1&quot;</span>
<a name="l00073"></a>00073 <span class="preprocessor"></span><span class="preprocessor">#define uicolor &quot;#47945E&quot;</span>
<a name="l00074"></a>00074 <span class="preprocessor"></span><span class="preprocessor">#define slotcolor &quot;#EDD400&quot;</span>
<a name="l00075"></a>00075 <span class="preprocessor"></span><span class="preprocessor">#define numcolor &quot;#4B71A1&quot;</span>
<a name="l00076"></a>00076 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00077"></a>00077 <span class="preprocessor"></span>
<a name="l00078"></a>00078 <span class="preprocessor">#if 0</span>
<a name="l00079"></a>00079 <span class="preprocessor"></span><span class="preprocessor">#define linkcolor &quot;#47945E&quot; </span>
<a name="l00080"></a>00080 <span class="preprocessor"></span><span class="preprocessor">#define normalcolor &quot;#4B71A1&quot;</span>
<a name="l00081"></a>00081 <span class="preprocessor"></span><span class="preprocessor">#define uicolor &quot;#f44800&quot;</span>
<a name="l00082"></a>00082 <span class="preprocessor"></span><span class="preprocessor">#define slotcolor &quot;#EDD400&quot;</span>
<a name="l00083"></a>00083 <span class="preprocessor"></span><span class="preprocessor">#define numcolor &quot;#f44800&quot;</span>
<a name="l00084"></a>00084 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00085"></a>00085 <span class="preprocessor"></span>
<a name="l00086"></a>00086 <span class="preprocessor">#if 0</span>
<a name="l00087"></a>00087 <span class="preprocessor"></span><span class="preprocessor">#define linkcolor &quot;#47945E&quot; </span>
<a name="l00088"></a>00088 <span class="preprocessor"></span><span class="preprocessor">#define normalcolor &quot;#4B71A1&quot;</span>
<a name="l00089"></a>00089 <span class="preprocessor"></span><span class="preprocessor">#define uicolor &quot;#816647&quot;</span>
<a name="l00090"></a>00090 <span class="preprocessor"></span><span class="preprocessor">#define slotcolor &quot;#EDD400&quot;</span>
<a name="l00091"></a>00091 <span class="preprocessor"></span><span class="preprocessor">#define numcolor &quot;#f44800&quot;</span>
<a name="l00092"></a>00092 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00093"></a>00093 <span class="preprocessor"></span>
<a name="l00094"></a>00094 <span class="preprocessor">#if 0</span>
<a name="l00095"></a>00095 <span class="preprocessor"></span><span class="preprocessor">#define linkcolor &quot;#003366&quot; </span>
<a name="l00096"></a>00096 <span class="preprocessor"></span><span class="preprocessor">#define normalcolor &quot;#4B71A1&quot;</span>
<a name="l00097"></a>00097 <span class="preprocessor"></span><span class="preprocessor">#define uicolor &quot;#816647&quot;</span>
<a name="l00098"></a>00098 <span class="preprocessor"></span><span class="preprocessor">#define slotcolor &quot;#EDD400&quot;</span>
<a name="l00099"></a>00099 <span class="preprocessor"></span><span class="preprocessor">#define numcolor &quot;#f44800&quot;</span>
<a name="l00100"></a>00100 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00101"></a>00101 <span class="preprocessor"></span>
<a name="l00102"></a>00102 <span class="preprocessor">#if 0</span>
<a name="l00103"></a>00103 <span class="preprocessor"></span><span class="preprocessor">#define linkcolor &quot;#003366&quot; </span>
<a name="l00104"></a>00104 <span class="preprocessor"></span><span class="preprocessor">#define normalcolor &quot;#4B71A1&quot;</span>
<a name="l00105"></a>00105 <span class="preprocessor"></span><span class="preprocessor">#define uicolor &quot;#477881&quot;</span>
<a name="l00106"></a>00106 <span class="preprocessor"></span><span class="preprocessor">#define slotcolor &quot;#816647&quot;</span>
<a name="l00107"></a>00107 <span class="preprocessor"></span><span class="preprocessor">#define numcolor &quot;#f44800&quot;</span>
<a name="l00108"></a>00108 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00109"></a>00109 <span class="preprocessor"></span>
<a name="l00110"></a>00110 
<a name="l00111"></a>00111 <span class="preprocessor">#if 1</span>
<a name="l00112"></a><a class="code" href="drawschema_8cpp.html#a71143cf231cb5d37bc9ec51068804376">00112</a> <span class="preprocessor"></span><span class="preprocessor">#define linkcolor &quot;#003366&quot; </span>
<a name="l00113"></a><a class="code" href="drawschema_8cpp.html#ade87f4d78b3fa1f3558caecec6187d92">00113</a> <span class="preprocessor"></span><span class="preprocessor">#define normalcolor &quot;#4B71A1&quot;</span>
<a name="l00114"></a><a class="code" href="drawschema_8cpp.html#afda0b9886e7b4caa0f7025e1cd9caf5c">00114</a> <span class="preprocessor"></span><span class="preprocessor">#define uicolor &quot;#477881&quot;</span>
<a name="l00115"></a><a class="code" href="drawschema_8cpp.html#a95eb74e9745ce1361c846f3106a4d948">00115</a> <span class="preprocessor"></span><span class="preprocessor">#define slotcolor &quot;#47945E&quot;</span>
<a name="l00116"></a><a class="code" href="drawschema_8cpp.html#a57f1ee6d2a00091a076abd677e1dd9d8">00116</a> <span class="preprocessor"></span><span class="preprocessor">#define numcolor &quot;#f44800&quot;</span>
<a name="l00117"></a>00117 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00118"></a>00118 <span class="preprocessor"></span>
<a name="l00119"></a>00119 <span class="keyword">using namespace </span>std;
<a name="l00120"></a>00120 
<a name="l00121"></a>00121 <span class="comment">// external parameters</span>
<a name="l00122"></a>00122 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="drawschema_8cpp.html#aa93530f1aaab4d34e88d4eb1e719a435">gFoldThreshold</a>;              <span class="comment">// max diagram complexity before folding</span>
<a name="l00123"></a>00123 
<a name="l00124"></a>00124 
<a name="l00125"></a>00125 <span class="comment">// internal state during drawing</span>
<a name="l00126"></a><a class="code" href="drawschema_8cpp.html#a00d330f73b01a5e113d7a8943d4cc3e8">00126</a> <span class="keyword">static</span> <a class="code" href="classOccurrences.html" title="Count subtree occurences Count the number of occurences of each subtree of a root...">Occurrences</a>*     <a class="code" href="drawschema_8cpp.html#a00d330f73b01a5e113d7a8943d4cc3e8">gOccurrences</a>;
<a name="l00127"></a><a class="code" href="drawschema_8cpp.html#adc1837f7fea0faaf627265422a09f424">00127</a> <span class="keyword">static</span> <span class="keywordtype">bool</span>             <a class="code" href="drawschema_8cpp.html#adc1837f7fea0faaf627265422a09f424">sFoldingFlag</a>;       <span class="comment">// true with complex block-diagrams</span>
<a name="l00128"></a><a class="code" href="drawschema_8cpp.html#a5c350ef200e0b2373afe826054ec33eb">00128</a> <span class="keyword">static</span> stack&lt;Tree&gt;      <a class="code" href="drawschema_8cpp.html#a5c350ef200e0b2373afe826054ec33eb">gPendingExp</a>;        <span class="comment">// Expressions that need to be drawn</span>
<a name="l00129"></a><a class="code" href="drawschema_8cpp.html#a8c6e36782f8a047190a19f8f5d61bf30">00129</a> <span class="keyword">static</span> set&lt;Tree&gt;        <a class="code" href="drawschema_8cpp.html#a8c6e36782f8a047190a19f8f5d61bf30">gDrawnExp</a>;          <span class="comment">// Expressions drawn or scheduled so far</span>
<a name="l00130"></a><a class="code" href="drawschema_8cpp.html#acf24453e8b242d6f3843cf4d85a0634a">00130</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>*      <a class="code" href="drawschema_8cpp.html#acf24453e8b242d6f3843cf4d85a0634a">gDevSuffix</a>;         <span class="comment">// .svg or .ps used to choose output device</span>
<a name="l00131"></a><a class="code" href="drawschema_8cpp.html#a7ce3017d02da6ef6554e0406e1a5b767">00131</a> <span class="keyword">static</span> <span class="keywordtype">char</span>             <a class="code" href="drawschema_8cpp.html#a7ce3017d02da6ef6554e0406e1a5b767">gCurrentDir</a>[512];   <span class="comment">// room to save current directory name</span>
<a name="l00132"></a><a class="code" href="drawschema_8cpp.html#acfeaedc1e4b76886425a7fd81bec4cb1">00132</a> <span class="keyword">static</span> <span class="keywordtype">string</span>           <a class="code" href="drawschema_8cpp.html#acfeaedc1e4b76886425a7fd81bec4cb1">gSchemaFileName</a>;    <span class="comment">// name of schema file beeing generated</span>
<a name="l00133"></a><a class="code" href="drawschema_8cpp.html#a3064858adc2c385c01172e6fa0cbf6fd">00133</a> <span class="keyword">static</span> map&lt;Tree,string&gt; <a class="code" href="drawschema_8cpp.html#a3064858adc2c385c01172e6fa0cbf6fd">gBackLink</a>;          <span class="comment">// link to enclosing file for sub schema</span>
<a name="l00134"></a>00134 
<a name="l00135"></a>00135 <span class="comment">// prototypes of internal functions</span>
<a name="l00136"></a>00136 <span class="keyword">static</span> <span class="keywordtype">void</span>     <a class="code" href="drawschema_8cpp.html#a80162904e235e44a5ca75e9141949cf3" title="Write a top level diagram.">writeSchemaFile</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> bd);
<a name="l00137"></a>00137 <span class="keyword">static</span> <a class="code" href="classschema.html" title="An abstract block diagram schema.">schema</a>*  <a class="code" href="drawschema_8cpp.html#aa93fe3ff7b0f90f0b913163058bab892" title="Generate an appropriate schema according to the type of block diagram.">generateDiagramSchema</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> bd);
<a name="l00138"></a>00138 <span class="keyword">static</span> <a class="code" href="classschema.html" title="An abstract block diagram schema.">schema</a>*  <a class="code" href="drawschema_8cpp.html#a5fbef93cc2293f75442f6f3c73cfd173" title="Generate the inside schema of a block diagram according to its type.">generateInsideSchema</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="l00139"></a>00139 <span class="keyword">static</span> <span class="keywordtype">void</span>     <a class="code" href="drawschema_8cpp.html#afe7d8ad1ff5133e12e4155750442a2b0" title="Schedule a makeBlockSchema diagram to be drawn.">scheduleDrawing</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="l00140"></a>00140 <span class="keyword">static</span> <span class="keywordtype">bool</span>     <a class="code" href="drawschema_8cpp.html#ac6c91fb6032807174f609025a4091a90" title="Retrieve next block diagram that must be drawn.">pendingDrawing</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>&amp; t);
<a name="l00141"></a>00141 <span class="keyword">static</span> <a class="code" href="classschema.html" title="An abstract block diagram schema.">schema</a>*  <a class="code" href="drawschema_8cpp.html#ab2d8b239da01cbe94c57ad7d34ef08ad" title="Generate an abstraction schema by placing in sequence the input slots and the body...">generateAbstractionSchema</a>(<a class="code" href="classschema.html" title="An abstract block diagram schema.">schema</a>* x, <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="l00142"></a>00142 <span class="keyword">static</span> <a class="code" href="classschema.html" title="An abstract block diagram schema.">schema</a>*  <a class="code" href="drawschema_8cpp.html#ac0758f1c55f48d5fd97749c5ca0a4d0f" title="Generate a 0-&amp;gt;1 block schema for an output slot.">generateOutputSlotSchema</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);
<a name="l00143"></a>00143 <span class="keyword">static</span> <a class="code" href="classschema.html" title="An abstract block diagram schema.">schema</a>*  <a class="code" href="drawschema_8cpp.html#a8dcc7a4de6c720ee55d6bd423d85a6ae" title="Generate a 1-&amp;gt;0 block schema for an input slot.">generateInputSlotSchema</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);
<a name="l00144"></a>00144 <span class="keyword">static</span> <a class="code" href="classschema.html" title="An abstract block diagram schema.">schema</a>*  <a class="code" href="drawschema_8cpp.html#abfd7187fd2597106ef700922db42e0b6" title="Generate a 1-&amp;gt;1 block schema for a user interface bargraph.">generateBargraphSchema</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="l00145"></a>00145 <span class="keyword">static</span> <a class="code" href="classschema.html" title="An abstract block diagram schema.">schema</a>*  <a class="code" href="drawschema_8cpp.html#a6c2661dcc5e78bf16eb0c9f2b467510b" title="Generate a 0-&amp;gt;1 block schema for a user interface element.">generateUserInterfaceSchema</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="l00146"></a>00146 <span class="keyword">static</span> <span class="keywordtype">char</span>*    <a class="code" href="drawschema_8cpp.html#a03c5eaf62bfd359840eee917ced5814e" title="Transform the definition name property of tree &amp;lt;t&amp;gt; into a legal file name.">legalFileName</a>(<a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> t, <span class="keywordtype">int</span> n, <span class="keywordtype">char</span>* dst);
<a name="l00147"></a>00147 <span class="keyword">static</span> <span class="keywordtype">int</span>      <a class="code" href="drawschema_8cpp.html#aa993eaaab62326b7ec82db3ac19d420c" title="Switch back to the previously stored current directory.">cholddir</a> ();
<a name="l00148"></a>00148 <span class="keyword">static</span> <span class="keywordtype">int</span>      <a class="code" href="drawschema_8cpp.html#a4ba32ce8ec678ffbdf068a4483543239" title="Create a new directory in the current one to store the diagrams.">mkchdir</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="main_8cpp.html#a678e1ef3077e128e543805a7381066f9">dirname</a>);
<a name="l00149"></a>00149 
<a name="l00150"></a>00150 
<a name="l00151"></a>00151 
<a name="l00152"></a>00152 
<a name="l00158"></a><a class="code" href="drawschema_8hh.html#a3be4e4d89005ef7378ba7e4c609efea2">00158</a> <span class="keywordtype">void</span> <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>(<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> bd, <span class="keyword">const</span> <span class="keywordtype">char</span>* projname, <span class="keyword">const</span> <span class="keywordtype">char</span>* dev)
<a name="l00159"></a>00159 {
<a name="l00160"></a>00160     <a class="code" href="drawschema_8cpp.html#acf24453e8b242d6f3843cf4d85a0634a">gDevSuffix</a>      = dev;
<a name="l00161"></a>00161     <a class="code" href="drawschema_8cpp.html#adc1837f7fea0faaf627265422a09f424">sFoldingFlag</a>    = <a class="code" href="boxcomplexity_8cpp.html#af02bacfa671f9f6d8bea6f5f9c22e0af" title="Return the complexity propety of a box expression tree.">boxComplexity</a>(bd) &gt; <a class="code" href="drawschema_8cpp.html#aa93530f1aaab4d34e88d4eb1e719a435">gFoldThreshold</a>;
<a name="l00162"></a>00162 
<a name="l00163"></a>00163     <a class="code" href="drawschema_8cpp.html#a4ba32ce8ec678ffbdf068a4483543239" title="Create a new directory in the current one to store the diagrams.">mkchdir</a>(projname);          <span class="comment">// create a directory to store files</span>
<a name="l00164"></a>00164 
<a name="l00165"></a>00165     <a class="code" href="drawschema_8cpp.html#afe7d8ad1ff5133e12e4155750442a2b0" title="Schedule a makeBlockSchema diagram to be drawn.">scheduleDrawing</a>(bd);        <span class="comment">// schedule the initial drawing</span>
<a name="l00166"></a>00166 
<a name="l00167"></a>00167     <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> t; <span class="keywordflow">while</span> (<a class="code" href="drawschema_8cpp.html#ac6c91fb6032807174f609025a4091a90" title="Retrieve next block diagram that must be drawn.">pendingDrawing</a>(t)) {
<a name="l00168"></a>00168         <a class="code" href="drawschema_8cpp.html#a80162904e235e44a5ca75e9141949cf3" title="Write a top level diagram.">writeSchemaFile</a>(t);     <span class="comment">// generate all the pending drawing</span>
<a name="l00169"></a>00169     }
<a name="l00170"></a>00170 
<a name="l00171"></a>00171     <a class="code" href="drawschema_8cpp.html#aa993eaaab62326b7ec82db3ac19d420c" title="Switch back to the previously stored current directory.">cholddir</a>();                 <span class="comment">// return to current directory</span>
<a name="l00172"></a>00172 }
<a name="l00173"></a>00173 
<a name="l00174"></a>00174 
<a name="l00175"></a>00175 <span class="comment">/************************************************************************</span>
<a name="l00176"></a>00176 <span class="comment"> ************************************************************************</span>
<a name="l00177"></a>00177 <span class="comment">                            IMPLEMENTATION</span>
<a name="l00178"></a>00178 <span class="comment"> ************************************************************************</span>
<a name="l00179"></a>00179 <span class="comment"> ************************************************************************/</span>
<a name="l00180"></a>00180 
<a name="l00181"></a>00181 
<a name="l00182"></a>00182 <span class="comment">//------------------- to schedule and retreive drawing ------------------</span>
<a name="l00183"></a>00183 
<a name="l00187"></a><a class="code" href="drawschema_8cpp.html#afe7d8ad1ff5133e12e4155750442a2b0">00187</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="drawschema_8cpp.html#afe7d8ad1ff5133e12e4155750442a2b0" title="Schedule a makeBlockSchema diagram to be drawn.">scheduleDrawing</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="l00188"></a>00188 {
<a name="l00189"></a>00189     <span class="keywordflow">if</span> (<a class="code" href="drawschema_8cpp.html#a8c6e36782f8a047190a19f8f5d61bf30">gDrawnExp</a>.find(t) == <a class="code" href="drawschema_8cpp.html#a8c6e36782f8a047190a19f8f5d61bf30">gDrawnExp</a>.end()) {
<a name="l00190"></a>00190         <a class="code" href="drawschema_8cpp.html#a8c6e36782f8a047190a19f8f5d61bf30">gDrawnExp</a>.insert(t);
<a name="l00191"></a>00191         <a class="code" href="drawschema_8cpp.html#a3064858adc2c385c01172e6fa0cbf6fd">gBackLink</a>.insert(make_pair(t,<a class="code" href="drawschema_8cpp.html#acfeaedc1e4b76886425a7fd81bec4cb1">gSchemaFileName</a>)); <span class="comment">// remember the enclosing filename</span>
<a name="l00192"></a>00192         <a class="code" href="drawschema_8cpp.html#a5c350ef200e0b2373afe826054ec33eb">gPendingExp</a>.push(t);
<a name="l00193"></a>00193     }
<a name="l00194"></a>00194 }
<a name="l00195"></a>00195 
<a name="l00199"></a><a class="code" href="drawschema_8cpp.html#ac6c91fb6032807174f609025a4091a90">00199</a> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="drawschema_8cpp.html#ac6c91fb6032807174f609025a4091a90" title="Retrieve next block diagram that must be drawn.">pendingDrawing</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>&amp; t)
<a name="l00200"></a>00200 {
<a name="l00201"></a>00201     <span class="keywordflow">if</span> (<a class="code" href="drawschema_8cpp.html#a5c350ef200e0b2373afe826054ec33eb">gPendingExp</a>.empty()) <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00202"></a>00202     t = <a class="code" href="drawschema_8cpp.html#a5c350ef200e0b2373afe826054ec33eb">gPendingExp</a>.top();
<a name="l00203"></a>00203     <a class="code" href="drawschema_8cpp.html#a5c350ef200e0b2373afe826054ec33eb">gPendingExp</a>.pop();
<a name="l00204"></a>00204     <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00205"></a>00205 }
<a name="l00206"></a>00206 
<a name="l00207"></a>00207 
<a name="l00208"></a>00208 
<a name="l00209"></a>00209 <span class="comment">//------------------------ dealing with files -------------------------</span>
<a name="l00210"></a>00210 
<a name="l00216"></a><a class="code" href="drawschema_8cpp.html#a80162904e235e44a5ca75e9141949cf3">00216</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="drawschema_8cpp.html#a80162904e235e44a5ca75e9141949cf3" title="Write a top level diagram.">writeSchemaFile</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> bd)
<a name="l00217"></a>00217 {
<a name="l00218"></a>00218     <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a>            id;
<a name="l00219"></a>00219     <a class="code" href="classschema.html" title="An abstract block diagram schema.">schema</a>*         ts;
<a name="l00220"></a>00220 
<a name="l00221"></a>00221     <span class="keywordtype">char</span>            temp[1024];
<a name="l00222"></a>00222 
<a name="l00223"></a>00223     gOccurrences = <span class="keyword">new</span> <a class="code" href="classOccurrences.html" title="Count subtree occurences Count the number of occurences of each subtree of a root...">Occurrences</a>(bd);
<a name="l00224"></a>00224 
<a name="l00225"></a>00225     <span class="keywordtype">bool</span> hasname = <a class="code" href="names_8cpp.html#afa6f89a686c004f84729e2bca7bf2053" title="Indicates the identifier (if any) the expression was a definition of.">getDefNameProperty</a>(bd, <span class="keywordtype">id</span>); assert(hasname);
<a name="l00226"></a>00226 
<a name="l00227"></a>00227     <span class="comment">// generate legal file name for the schema</span>
<a name="l00228"></a>00228     stringstream s1; s1 &lt;&lt; <a class="code" href="drawschema_8cpp.html#a03c5eaf62bfd359840eee917ced5814e" title="Transform the definition name property of tree &amp;lt;t&amp;gt; into a legal file name.">legalFileName</a>(bd, 1024, temp) &lt;&lt; <span class="stringliteral">&quot;.&quot;</span> &lt;&lt; <a class="code" href="drawschema_8cpp.html#acf24453e8b242d6f3843cf4d85a0634a">gDevSuffix</a>;
<a name="l00229"></a>00229     <a class="code" href="drawschema_8cpp.html#acfeaedc1e4b76886425a7fd81bec4cb1">gSchemaFileName</a> = s1.str();
<a name="l00230"></a>00230 
<a name="l00231"></a>00231     <span class="comment">// generate the label of the schema</span>
<a name="l00232"></a>00232     stringstream s2; s2 &lt;&lt; <a class="code" href="tree_8cpp.html#ac753d60778175e30a86cba647db017ad" title="if t has a node of type symbol, return its name otherwise error">tree2str</a>(<span class="keywordtype">id</span>);
<a name="l00233"></a>00233     <span class="keywordtype">string</span> link = <a class="code" href="drawschema_8cpp.html#a3064858adc2c385c01172e6fa0cbf6fd">gBackLink</a>[bd];
<a name="l00234"></a>00234     ts = <a class="code" href="schema_8h.html#a85e8617377baa0b45432805a8c9a8065" title="Creates a new top schema.">makeTopSchema</a>(<a class="code" href="drawschema_8cpp.html#a5fbef93cc2293f75442f6f3c73cfd173" title="Generate the inside schema of a block diagram according to its type.">generateInsideSchema</a>(bd), 20, s2.str(), link);
<a name="l00235"></a>00235     <span class="comment">// draw to the device defined by gDevSuffix</span>
<a name="l00236"></a>00236     <span class="keywordflow">if</span> (strcmp(gDevSuffix, <span class="stringliteral">&quot;svg&quot;</span>) == 0) {
<a name="l00237"></a>00237         <a class="code" href="classSVGDev.html">SVGDev</a> dev(s1.str().c_str(), ts-&gt;<a class="code" href="classschema.html#aa598f06d50f5cee518892c572453cf67">width</a>(), ts-&gt;<a class="code" href="classschema.html#acd72d5b630acd4eadf3f856aa6176c99">height</a>());
<a name="l00238"></a>00238         ts-&gt;<a class="code" href="classschema.html#aa3ef082636956bead276445f203259a4">place</a>(0,0, <a class="code" href="schema_8h.html#adf764cbdea00d65edcd07bb9953ad2b7ad0e4d4a0baf519fc3f4a41e2d30f4e96">kLeftRight</a>);
<a name="l00239"></a>00239         ts-&gt;<a class="code" href="classschema.html#a6b8ab062669efb5f96e45d4e40f123b0">draw</a>(dev);
<a name="l00240"></a>00240     } <span class="keywordflow">else</span> {
<a name="l00241"></a>00241         <a class="code" href="classPSDev.html">PSDev</a> dev(s1.str().c_str(), ts-&gt;<a class="code" href="classschema.html#aa598f06d50f5cee518892c572453cf67">width</a>(), ts-&gt;<a class="code" href="classschema.html#acd72d5b630acd4eadf3f856aa6176c99">height</a>());
<a name="l00242"></a>00242         ts-&gt;<a class="code" href="classschema.html#aa3ef082636956bead276445f203259a4">place</a>(0,0, <a class="code" href="schema_8h.html#adf764cbdea00d65edcd07bb9953ad2b7ad0e4d4a0baf519fc3f4a41e2d30f4e96">kLeftRight</a>);
<a name="l00243"></a>00243         ts-&gt;<a class="code" href="classschema.html#a6b8ab062669efb5f96e45d4e40f123b0">draw</a>(dev);
<a name="l00244"></a>00244     }
<a name="l00245"></a>00245 }
<a name="l00246"></a>00246 
<a name="l00247"></a>00247 
<a name="l00248"></a>00248 
<a name="l00253"></a><a class="code" href="drawschema_8cpp.html#a4ba32ce8ec678ffbdf068a4483543239">00253</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="drawschema_8cpp.html#a4ba32ce8ec678ffbdf068a4483543239" title="Create a new directory in the current one to store the diagrams.">mkchdir</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="main_8cpp.html#a678e1ef3077e128e543805a7381066f9">dirname</a>)
<a name="l00254"></a>00254 {
<a name="l00255"></a>00255     <span class="comment">//cerr &lt;&lt; &quot;mkchdir of &quot; &lt;&lt; dirname &lt;&lt; endl;</span>
<a name="l00256"></a>00256     <span class="keywordflow">if</span> (getcwd(<a class="code" href="drawschema_8cpp.html#a7ce3017d02da6ef6554e0406e1a5b767">gCurrentDir</a>, 512) != 0) {
<a name="l00257"></a>00257         <span class="keywordtype">int</span> status = mkdir(dirname, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
<a name="l00258"></a>00258         <span class="keywordflow">if</span> (status == 0 || errno == EEXIST) {
<a name="l00259"></a>00259             <span class="keywordflow">if</span> (chdir(dirname) == 0) {
<a name="l00260"></a>00260                 <span class="keywordflow">return</span> 0;
<a name="l00261"></a>00261             }
<a name="l00262"></a>00262         }
<a name="l00263"></a>00263     }
<a name="l00264"></a>00264     perror(<span class="stringliteral">&quot;mkchdir&quot;</span>);
<a name="l00265"></a>00265     exit(errno);
<a name="l00266"></a>00266     <span class="comment">//return errno;</span>
<a name="l00267"></a>00267 }
<a name="l00268"></a>00268 
<a name="l00269"></a>00269 
<a name="l00273"></a><a class="code" href="drawschema_8cpp.html#aa993eaaab62326b7ec82db3ac19d420c">00273</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="drawschema_8cpp.html#aa993eaaab62326b7ec82db3ac19d420c" title="Switch back to the previously stored current directory.">cholddir</a> ()
<a name="l00274"></a>00274 {
<a name="l00275"></a>00275     <span class="keywordflow">if</span> (chdir(<a class="code" href="drawschema_8cpp.html#a7ce3017d02da6ef6554e0406e1a5b767">gCurrentDir</a>) == 0) {
<a name="l00276"></a>00276         <span class="keywordflow">return</span> 0;
<a name="l00277"></a>00277     } <span class="keywordflow">else</span> {
<a name="l00278"></a>00278         perror(<span class="stringliteral">&quot;cholddir&quot;</span>);
<a name="l00279"></a>00279         exit(errno);
<a name="l00280"></a>00280     }
<a name="l00281"></a>00281 }
<a name="l00282"></a>00282 
<a name="l00283"></a>00283 
<a name="l00290"></a><a class="code" href="drawschema_8cpp.html#a03c5eaf62bfd359840eee917ced5814e">00290</a> <span class="keyword">static</span> <span class="keywordtype">char</span>* <a class="code" href="drawschema_8cpp.html#a03c5eaf62bfd359840eee917ced5814e" title="Transform the definition name property of tree &amp;lt;t&amp;gt; into a legal file name.">legalFileName</a>(<a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> t, <span class="keywordtype">int</span> n, <span class="keywordtype">char</span>* dst)
<a name="l00291"></a>00291 {
<a name="l00292"></a>00292     <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a>    id;
<a name="l00293"></a>00293     <span class="keywordtype">int</span>     i=0;
<a name="l00294"></a>00294     <span class="keywordflow">if</span> (<a class="code" href="names_8cpp.html#afa6f89a686c004f84729e2bca7bf2053" title="Indicates the identifier (if any) the expression was a definition of.">getDefNameProperty</a>(t, <span class="keywordtype">id</span>)) {
<a name="l00295"></a>00295         <span class="keyword">const</span> <span class="keywordtype">char</span>*     src = <a class="code" href="tree_8cpp.html#ac753d60778175e30a86cba647db017ad" title="if t has a node of type symbol, return its name otherwise error">tree2str</a>(<span class="keywordtype">id</span>);
<a name="l00296"></a>00296         <span class="keywordflow">for</span> (i=0; isalnum(src[i]) &amp;&amp; i&lt;16; i++) {
<a name="l00297"></a>00297             dst[i] = src[i];
<a name="l00298"></a>00298         }
<a name="l00299"></a>00299     }
<a name="l00300"></a>00300     dst[i] = 0;
<a name="l00301"></a>00301     <span class="keywordflow">if</span> (strcmp(dst, <span class="stringliteral">&quot;process&quot;</span>) != 0) { 
<a name="l00302"></a>00302         <span class="comment">// if it is not process add the hex address to make the name unique</span>
<a name="l00303"></a>00303         snprintf(&amp;dst[i], n-i, <span class="stringliteral">&quot;-%p&quot;</span>, t);
<a name="l00304"></a>00304     }
<a name="l00305"></a>00305     <span class="keywordflow">return</span> dst;
<a name="l00306"></a>00306 }
<a name="l00307"></a>00307 
<a name="l00308"></a>00308 
<a name="l00309"></a>00309 
<a name="l00310"></a>00310 <span class="comment">//------------------------ generating the schema -------------------------</span>
<a name="l00311"></a>00311 
<a name="l00318"></a><a class="code" href="drawschema_8cpp.html#aa93fe3ff7b0f90f0b913163058bab892">00318</a> <span class="keyword">static</span> <a class="code" href="classschema.html" title="An abstract block diagram schema.">schema</a>* <a class="code" href="drawschema_8cpp.html#aa93fe3ff7b0f90f0b913163058bab892" title="Generate an appropriate schema according to the type of block diagram.">generateDiagramSchema</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="l00319"></a>00319 {
<a name="l00320"></a>00320     <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a>    id;
<a name="l00321"></a>00321     <span class="keywordtype">int</span>     ins, outs;
<a name="l00322"></a>00322 
<a name="l00323"></a>00323     <span class="comment">//cerr &lt;&lt; t &lt;&lt; &quot; generateDiagramSchema &quot; &lt;&lt; boxpp(t)&lt;&lt; endl;</span>
<a name="l00324"></a>00324 
<a name="l00325"></a>00325     <span class="keywordflow">if</span> (<a class="code" href="names_8cpp.html#afa6f89a686c004f84729e2bca7bf2053" title="Indicates the identifier (if any) the expression was a definition of.">getDefNameProperty</a>(t, <span class="keywordtype">id</span>)) {
<a name="l00326"></a>00326         stringstream    s; s &lt;&lt; <a class="code" href="tree_8cpp.html#ac753d60778175e30a86cba647db017ad" title="if t has a node of type symbol, return its name otherwise error">tree2str</a>(<span class="keywordtype">id</span>);
<a name="l00327"></a>00327         <span class="comment">//cerr &lt;&lt; t &lt;&lt; &quot;\tNAMED : &quot; &lt;&lt; s.str() &lt;&lt; endl;</span>
<a name="l00328"></a>00328     }
<a name="l00329"></a>00329 
<a name="l00330"></a>00330     <span class="keywordflow">if</span> ( <a class="code" href="drawschema_8cpp.html#adc1837f7fea0faaf627265422a09f424">sFoldingFlag</a> &amp;&amp; <span class="comment">/*(gOccurrences-&gt;getCount(t) &gt; 0) &amp;&amp;*/</span>
<a name="l00331"></a>00331             (<a class="code" href="boxcomplexity_8cpp.html#af02bacfa671f9f6d8bea6f5f9c22e0af" title="Return the complexity propety of a box expression tree.">boxComplexity</a>(t) &gt; 2) &amp;&amp; <a class="code" href="names_8cpp.html#afa6f89a686c004f84729e2bca7bf2053" title="Indicates the identifier (if any) the expression was a definition of.">getDefNameProperty</a>(t, <span class="keywordtype">id</span>)) {
<a name="l00332"></a>00332         <span class="keywordtype">char</span>    temp[1024];
<a name="l00333"></a>00333         <a class="code" href="boxes_8hh.html#ac5c10eb592a85ecba6d6990f9f78010d" title="Return the type (number of inputs and outputs) of a box or false if undefined.">getBoxType</a>(t, &amp;ins, &amp;outs);
<a name="l00334"></a>00334         stringstream s, l;
<a name="l00335"></a>00335         s &lt;&lt; <a class="code" href="tree_8cpp.html#ac753d60778175e30a86cba647db017ad" title="if t has a node of type symbol, return its name otherwise error">tree2str</a>(<span class="keywordtype">id</span>);
<a name="l00336"></a>00336         l &lt;&lt; <a class="code" href="drawschema_8cpp.html#a03c5eaf62bfd359840eee917ced5814e" title="Transform the definition name property of tree &amp;lt;t&amp;gt; into a legal file name.">legalFileName</a>(t,1024,temp) &lt;&lt; <span class="stringliteral">&quot;.&quot;</span> &lt;&lt; <a class="code" href="drawschema_8cpp.html#acf24453e8b242d6f3843cf4d85a0634a">gDevSuffix</a>;
<a name="l00337"></a>00337         <a class="code" href="drawschema_8cpp.html#afe7d8ad1ff5133e12e4155750442a2b0" title="Schedule a makeBlockSchema diagram to be drawn.">scheduleDrawing</a>(t);
<a name="l00338"></a>00338         <span class="keywordflow">return</span> <a class="code" href="blockSchema_8cpp.html#a4f795fe515331bbaed4f661d1fb2591a" title="Build a simple colored blockSchema with a certain number of inputs and outputs, a...">makeBlockSchema</a>(ins, outs, s.str(), <a class="code" href="drawschema_8cpp.html#a71143cf231cb5d37bc9ec51068804376">linkcolor</a>, l.str());
<a name="l00339"></a>00339 
<a name="l00340"></a>00340     } <span class="keywordflow">else</span>  <span class="keywordflow">if</span> (<a class="code" href="names_8cpp.html#afa6f89a686c004f84729e2bca7bf2053" title="Indicates the identifier (if any) the expression was a definition of.">getDefNameProperty</a>(t, <span class="keywordtype">id</span>) &amp;&amp; ! <a class="code" href="boxes_8cpp.html#af4b23a35faec0884c4591ff92576c3d4">isBoxSlot</a>(t)) {
<a name="l00341"></a>00341         <span class="comment">// named case : not a slot, with a name</span>
<a name="l00342"></a>00342         <span class="comment">// draw a line around the object with its name</span>
<a name="l00343"></a>00343         stringstream    s; s &lt;&lt; <a class="code" href="tree_8cpp.html#ac753d60778175e30a86cba647db017ad" title="if t has a node of type symbol, return its name otherwise error">tree2str</a>(<span class="keywordtype">id</span>);
<a name="l00344"></a>00344         <span class="keywordflow">return</span> <a class="code" href="decorateSchema_8cpp.html#a81275d91bf8e76c149e885abab4be60a" title="Creates a new decorated schema.">makeDecorateSchema</a>(<a class="code" href="drawschema_8cpp.html#a5fbef93cc2293f75442f6f3c73cfd173" title="Generate the inside schema of a block diagram according to its type.">generateInsideSchema</a>(t), 10, s.str());
<a name="l00345"></a>00345 
<a name="l00346"></a>00346     } <span class="keywordflow">else</span> {
<a name="l00347"></a>00347         <span class="comment">// normal case</span>
<a name="l00348"></a>00348         <span class="keywordflow">return</span> <a class="code" href="drawschema_8cpp.html#a5fbef93cc2293f75442f6f3c73cfd173" title="Generate the inside schema of a block diagram according to its type.">generateInsideSchema</a>(t);
<a name="l00349"></a>00349     }
<a name="l00350"></a>00350 }
<a name="l00351"></a>00351 
<a name="l00352"></a>00352 
<a name="l00353"></a>00353 
<a name="l00358"></a><a class="code" href="drawschema_8cpp.html#a5fbef93cc2293f75442f6f3c73cfd173">00358</a> <span class="keyword">static</span> <a class="code" href="classschema.html" title="An abstract block diagram schema.">schema</a>* <a class="code" href="drawschema_8cpp.html#a5fbef93cc2293f75442f6f3c73cfd173" title="Generate the inside schema of a block diagram according to its type.">generateInsideSchema</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="l00359"></a>00359 {
<a name="l00360"></a>00360     <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, b, ff, l, type,<a class="code" href="symbol_8hh.html#a8243134fbbd9d924ebbb3f833922e310" title="Returns the name of a symbol.">name</a>,file;
<a name="l00361"></a>00361     <span class="keywordtype">int</span>     i;
<a name="l00362"></a>00362     <span class="keywordtype">double</span>  r;
<a name="l00363"></a>00363     <a class="code" href="boxes_8hh.html#a52afc5e73408f761d5d61926ced73eef">prim0</a>   p0;
<a name="l00364"></a>00364     <a class="code" href="boxes_8hh.html#ad7497a9790f9d05878096b459487a510">prim1</a>   p1;
<a name="l00365"></a>00365     <a class="code" href="boxes_8hh.html#abc5863a46190002232036f027c5acfdb">prim2</a>   p2;
<a name="l00366"></a>00366     <a class="code" href="boxes_8hh.html#a2769ccced25ffcb2997204594bb52f0e">prim3</a>   p3;
<a name="l00367"></a>00367     <a class="code" href="boxes_8hh.html#a55608c6610d13a8ccd575de80c191b31">prim4</a>   p4;
<a name="l00368"></a>00368     <a class="code" href="boxes_8hh.html#ae228ee0345249785e8f74cce21162037">prim5</a>   p5;
<a name="l00369"></a>00369 
<a name="l00370"></a>00370 
<a name="l00371"></a>00371     <a class="code" href="classxtended.html">xtended</a>* xt = (<a class="code" href="classxtended.html">xtended</a>*)<a class="code" href="symbol_8hh.html#a603fcb6c07eacf2688c2a8470637d0ff" title="Returns user data.">getUserData</a>(t);
<a name="l00372"></a>00372 
<a name="l00373"></a>00373     <span class="keywordflow">if</span> (xt)                         { <span class="keywordflow">return</span> <a class="code" href="blockSchema_8cpp.html#a4f795fe515331bbaed4f661d1fb2591a" title="Build a simple colored blockSchema with a certain number of inputs and outputs, a...">makeBlockSchema</a>(xt-&gt;<a class="code" href="classxtended.html#ad709963a78f1b630e44ff518134487b5">arity</a>(), 1, xt-&gt;<a class="code" href="classxtended.html#a59e2a80966bb13528803e79b32c7a365">name</a>(), <a class="code" href="drawschema_8cpp.html#ade87f4d78b3fa1f3558caecec6187d92">normalcolor</a>, <span class="stringliteral">&quot;&quot;</span>); }
<a name="l00374"></a>00374 
<a name="l00375"></a>00375     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#a7904414896442fcfa0947156b6563d52">isBoxInt</a>(t, &amp;i))       { stringstream  s; s &lt;&lt; i; <span class="keywordflow">return</span> <a class="code" href="blockSchema_8cpp.html#a4f795fe515331bbaed4f661d1fb2591a" title="Build a simple colored blockSchema with a certain number of inputs and outputs, a...">makeBlockSchema</a>(0, 1, s.str(), <a class="code" href="drawschema_8cpp.html#a57f1ee6d2a00091a076abd677e1dd9d8">numcolor</a>, <span class="stringliteral">&quot;&quot;</span> ); }
<a name="l00376"></a>00376     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#a292a68d93ea73f703bc880cca4d01bc2">isBoxReal</a>(t, &amp;r))      { stringstream  s; s &lt;&lt; r; <span class="keywordflow">return</span> <a class="code" href="blockSchema_8cpp.html#a4f795fe515331bbaed4f661d1fb2591a" title="Build a simple colored blockSchema with a certain number of inputs and outputs, a...">makeBlockSchema</a>(0, 1, s.str(), <a class="code" href="drawschema_8cpp.html#a57f1ee6d2a00091a076abd677e1dd9d8">numcolor</a>, <span class="stringliteral">&quot;&quot;</span> ); }
<a name="l00377"></a>00377     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#ac32713127f8c8c3cb26e28a31580b257">isBoxWire</a>(t))          { <span class="keywordflow">return</span> <a class="code" href="cableSchema_8cpp.html#aa5b7242ed5c2ea862d01978390a1bdda" title="Build n cables in parallel.">makeCableSchema</a>(); }
<a name="l00378"></a>00378     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#acf54df78e7e909644907619a03b3f695">isBoxCut</a>(t))           { <span class="keywordflow">return</span> <a class="code" href="cutSchema_8cpp.html#a7077e3bba2c5b10c5c6bd5bcfea546fb" title="Creates a new Cut schema.">makeCutSchema</a>();  }
<a name="l00379"></a>00379 
<a name="l00380"></a>00380     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#af6596889fd117b00a85ca9ee837f2988">isBoxPrim0</a>(t, &amp;p0))    { <span class="keywordflow">return</span> <a class="code" href="blockSchema_8cpp.html#a4f795fe515331bbaed4f661d1fb2591a" title="Build a simple colored blockSchema with a certain number of inputs and outputs, a...">makeBlockSchema</a>(0, 1, <a class="code" href="ppbox_8cpp.html#a5b146156345acaa92818b2a362e2507b">prim0name</a>(p0), <a class="code" href="drawschema_8cpp.html#ade87f4d78b3fa1f3558caecec6187d92">normalcolor</a>, <span class="stringliteral">&quot;&quot;</span>); }
<a name="l00381"></a>00381     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#a261369dc82c96fbfa1978859ca4cf2e3">isBoxPrim1</a>(t, &amp;p1))    { <span class="keywordflow">return</span> <a class="code" href="blockSchema_8cpp.html#a4f795fe515331bbaed4f661d1fb2591a" title="Build a simple colored blockSchema with a certain number of inputs and outputs, a...">makeBlockSchema</a>(1, 1, <a class="code" href="ppbox_8cpp.html#a8f1abadd58804b9c372328443250e0a0">prim1name</a>(p1), <a class="code" href="drawschema_8cpp.html#ade87f4d78b3fa1f3558caecec6187d92">normalcolor</a>, <span class="stringliteral">&quot;&quot;</span>); }
<a name="l00382"></a>00382     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#a9c79105875b22a5b09a0b6f768375d09">isBoxPrim2</a>(t, &amp;p2))    { <span class="keywordflow">return</span> <a class="code" href="blockSchema_8cpp.html#a4f795fe515331bbaed4f661d1fb2591a" title="Build a simple colored blockSchema with a certain number of inputs and outputs, a...">makeBlockSchema</a>(2, 1, <a class="code" href="ppbox_8cpp.html#aab6e83fd89926efe096c424c0e1e694b">prim2name</a>(p2), <a class="code" href="drawschema_8cpp.html#ade87f4d78b3fa1f3558caecec6187d92">normalcolor</a>, <span class="stringliteral">&quot;&quot;</span>); }
<a name="l00383"></a>00383     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#a826142cbc8a1a762612f22273303794e">isBoxPrim3</a>(t, &amp;p3))    { <span class="keywordflow">return</span> <a class="code" href="blockSchema_8cpp.html#a4f795fe515331bbaed4f661d1fb2591a" title="Build a simple colored blockSchema with a certain number of inputs and outputs, a...">makeBlockSchema</a>(3, 1, <a class="code" href="ppbox_8cpp.html#a98e1c3df1237e09e4d98ca263b47c9fe">prim3name</a>(p3), <a class="code" href="drawschema_8cpp.html#ade87f4d78b3fa1f3558caecec6187d92">normalcolor</a>, <span class="stringliteral">&quot;&quot;</span>); }
<a name="l00384"></a>00384     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#a5cae175b6153210d76c153feb2af908c">isBoxPrim4</a>(t, &amp;p4))    { <span class="keywordflow">return</span> <a class="code" href="blockSchema_8cpp.html#a4f795fe515331bbaed4f661d1fb2591a" title="Build a simple colored blockSchema with a certain number of inputs and outputs, a...">makeBlockSchema</a>(4, 1, <a class="code" href="ppbox_8cpp.html#a02ff42a6b78b33f02f96c67bf7fd386b">prim4name</a>(p4), <a class="code" href="drawschema_8cpp.html#ade87f4d78b3fa1f3558caecec6187d92">normalcolor</a>, <span class="stringliteral">&quot;&quot;</span>); }
<a name="l00385"></a>00385     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#aba4a65a9f30e78759da0796c55b13e8e">isBoxPrim5</a>(t, &amp;p5))    { <span class="keywordflow">return</span> <a class="code" href="blockSchema_8cpp.html#a4f795fe515331bbaed4f661d1fb2591a" title="Build a simple colored blockSchema with a certain number of inputs and outputs, a...">makeBlockSchema</a>(5, 1, <a class="code" href="ppbox_8cpp.html#a0d9d3bae236541656f2e0b0c88fee269">prim5name</a>(p5), <a class="code" href="drawschema_8cpp.html#ade87f4d78b3fa1f3558caecec6187d92">normalcolor</a>, <span class="stringliteral">&quot;&quot;</span>); }
<a name="l00386"></a>00386 
<a name="l00387"></a>00387     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#a70f7ab7aecc722355d6096ca89a7658f">isBoxFFun</a>(t, ff))                  { <span class="keywordflow">return</span> <a class="code" href="blockSchema_8cpp.html#a4f795fe515331bbaed4f661d1fb2591a" title="Build a simple colored blockSchema with a certain number of inputs and outputs, a...">makeBlockSchema</a>(<a class="code" href="prim2_8cpp.html#af82147adb6d445cb8f8878f6dcedba64">ffarity</a>(ff), 1, <a class="code" href="prim2_8cpp.html#a9293046e818b432cfa8a7d418679eff3">ffname</a>(ff), <a class="code" href="drawschema_8cpp.html#ade87f4d78b3fa1f3558caecec6187d92">normalcolor</a>, <span class="stringliteral">&quot;&quot;</span>); }
<a name="l00388"></a>00388     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#a8744a0451eacde8e56290b3fd74bc0b1">isBoxFConst</a>(t, type,name,file))    { <span class="keywordflow">return</span> <a class="code" href="blockSchema_8cpp.html#a4f795fe515331bbaed4f661d1fb2591a" title="Build a simple colored blockSchema with a certain number of inputs and outputs, a...">makeBlockSchema</a>(0, 1, <a class="code" href="tree_8cpp.html#ac753d60778175e30a86cba647db017ad" title="if t has a node of type symbol, return its name otherwise error">tree2str</a>(name), <a class="code" href="drawschema_8cpp.html#ade87f4d78b3fa1f3558caecec6187d92">normalcolor</a>, <span class="stringliteral">&quot;&quot;</span>); }
<a name="l00389"></a>00389     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#aed6793582932079092255c2643b45f91">isBoxFVar</a> (t, type, name,file))    { <span class="keywordflow">return</span> <a class="code" href="blockSchema_8cpp.html#a4f795fe515331bbaed4f661d1fb2591a" title="Build a simple colored blockSchema with a certain number of inputs and outputs, a...">makeBlockSchema</a>(0, 1, <a class="code" href="tree_8cpp.html#ac753d60778175e30a86cba647db017ad" title="if t has a node of type symbol, return its name otherwise error">tree2str</a>(name), <a class="code" href="drawschema_8cpp.html#ade87f4d78b3fa1f3558caecec6187d92">normalcolor</a>, <span class="stringliteral">&quot;&quot;</span>); }
<a name="l00390"></a>00390 
<a name="l00391"></a>00391     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#a83b021a73e7c4af2535efcfe0832c690">isBoxButton</a>(t))        { <span class="keywordflow">return</span> <a class="code" href="drawschema_8cpp.html#a6c2661dcc5e78bf16eb0c9f2b467510b" title="Generate a 0-&amp;gt;1 block schema for a user interface element.">generateUserInterfaceSchema</a>(t); }
<a name="l00392"></a>00392     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#a635dcccb574f9a9c911b89a756126473">isBoxCheckbox</a>(t))      { <span class="keywordflow">return</span> <a class="code" href="drawschema_8cpp.html#a6c2661dcc5e78bf16eb0c9f2b467510b" title="Generate a 0-&amp;gt;1 block schema for a user interface element.">generateUserInterfaceSchema</a>(t); }
<a name="l00393"></a>00393     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#a4bf55c2d9a65d986d0d19da98d14db16">isBoxVSlider</a>(t))       { <span class="keywordflow">return</span> <a class="code" href="drawschema_8cpp.html#a6c2661dcc5e78bf16eb0c9f2b467510b" title="Generate a 0-&amp;gt;1 block schema for a user interface element.">generateUserInterfaceSchema</a>(t); }
<a name="l00394"></a>00394     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#adf3ec537a021d2a50ddc8e029d540451">isBoxHSlider</a>(t))       { <span class="keywordflow">return</span> <a class="code" href="drawschema_8cpp.html#a6c2661dcc5e78bf16eb0c9f2b467510b" title="Generate a 0-&amp;gt;1 block schema for a user interface element.">generateUserInterfaceSchema</a>(t); }
<a name="l00395"></a>00395     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#aa135a488b7d54dcce1249f5761ab014a">isBoxNumEntry</a>(t))      { <span class="keywordflow">return</span> <a class="code" href="drawschema_8cpp.html#a6c2661dcc5e78bf16eb0c9f2b467510b" title="Generate a 0-&amp;gt;1 block schema for a user interface element.">generateUserInterfaceSchema</a>(t); }
<a name="l00396"></a>00396     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#a1f17c731544a73f907993681b57e7461">isBoxVBargraph</a>(t))     { <span class="keywordflow">return</span> <a class="code" href="drawschema_8cpp.html#abfd7187fd2597106ef700922db42e0b6" title="Generate a 1-&amp;gt;1 block schema for a user interface bargraph.">generateBargraphSchema</a>(t); }
<a name="l00397"></a>00397     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#aa34cc27fbf6e04a6825ba4461af2a9e0">isBoxHBargraph</a>(t))     { <span class="keywordflow">return</span> <a class="code" href="drawschema_8cpp.html#abfd7187fd2597106ef700922db42e0b6" title="Generate a 1-&amp;gt;1 block schema for a user interface bargraph.">generateBargraphSchema</a>(t); }
<a name="l00398"></a>00398 
<a name="l00399"></a>00399     <span class="comment">// don&#39;t draw group rectangle when labels are empty (ie &quot;&quot;)</span>
<a name="l00400"></a>00400     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#a5643302db2568cf9eaa48fd6f7d336a9">isBoxVGroup</a>(t,l,a))    {   stringstream s; s &lt;&lt; <span class="stringliteral">&quot;vgroup(&quot;</span> &lt;&lt; <a class="code" href="tree_8cpp.html#ac753d60778175e30a86cba647db017ad" title="if t has a node of type symbol, return its name otherwise error">tree2str</a>(l) &lt;&lt; <span class="stringliteral">&quot;)&quot;</span>;
<a name="l00401"></a>00401                                         <a class="code" href="classschema.html" title="An abstract block diagram schema.">schema</a>* r = <a class="code" href="drawschema_8cpp.html#aa93fe3ff7b0f90f0b913163058bab892" title="Generate an appropriate schema according to the type of block diagram.">generateDiagramSchema</a>(a);
<a name="l00402"></a>00402                                         <span class="keywordflow">return</span> <a class="code" href="decorateSchema_8cpp.html#a81275d91bf8e76c149e885abab4be60a" title="Creates a new decorated schema.">makeDecorateSchema</a>(r, 10, s.str()); }
<a name="l00403"></a>00403     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#a1b73cc14722de085e72c0a008fa56af3">isBoxHGroup</a>(t,l,a))    {   stringstream s; s &lt;&lt; <span class="stringliteral">&quot;hgroup(&quot;</span> &lt;&lt; <a class="code" href="tree_8cpp.html#ac753d60778175e30a86cba647db017ad" title="if t has a node of type symbol, return its name otherwise error">tree2str</a>(l) &lt;&lt; <span class="stringliteral">&quot;)&quot;</span>;
<a name="l00404"></a>00404                                         <a class="code" href="classschema.html" title="An abstract block diagram schema.">schema</a>* r = <a class="code" href="drawschema_8cpp.html#aa93fe3ff7b0f90f0b913163058bab892" title="Generate an appropriate schema according to the type of block diagram.">generateDiagramSchema</a>(a);
<a name="l00405"></a>00405                                         <span class="keywordflow">return</span> <a class="code" href="decorateSchema_8cpp.html#a81275d91bf8e76c149e885abab4be60a" title="Creates a new decorated schema.">makeDecorateSchema</a>(r, 10, s.str()); }
<a name="l00406"></a>00406     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#a3e76d86869cc8b1df759a4bcb972cf2d">isBoxTGroup</a>(t,l,a))    {   stringstream s; s &lt;&lt; <span class="stringliteral">&quot;tgroup(&quot;</span> &lt;&lt; <a class="code" href="tree_8cpp.html#ac753d60778175e30a86cba647db017ad" title="if t has a node of type symbol, return its name otherwise error">tree2str</a>(l) &lt;&lt; <span class="stringliteral">&quot;)&quot;</span>;
<a name="l00407"></a>00407                                         <a class="code" href="classschema.html" title="An abstract block diagram schema.">schema</a>* r = <a class="code" href="drawschema_8cpp.html#aa93fe3ff7b0f90f0b913163058bab892" title="Generate an appropriate schema according to the type of block diagram.">generateDiagramSchema</a>(a);
<a name="l00408"></a>00408                                         <span class="keywordflow">return</span> <a class="code" href="decorateSchema_8cpp.html#a81275d91bf8e76c149e885abab4be60a" title="Creates a new decorated schema.">makeDecorateSchema</a>(r, 10, s.str()); }
<a name="l00409"></a>00409 
<a name="l00410"></a>00410     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#ad7c79f7a1c0aa3109ab0548e59194d48">isBoxSeq</a>(t, a, b))     { <span class="keywordflow">return</span> <a class="code" href="schema_8h.html#aee99b4bfcc6a9f9ab9c91af512e5daee" title="Make a sequential schema.">makeSeqSchema</a>(<a class="code" href="drawschema_8cpp.html#aa93fe3ff7b0f90f0b913163058bab892" title="Generate an appropriate schema according to the type of block diagram.">generateDiagramSchema</a>(a), <a class="code" href="drawschema_8cpp.html#aa93fe3ff7b0f90f0b913163058bab892" title="Generate an appropriate schema according to the type of block diagram.">generateDiagramSchema</a>(b)); }
<a name="l00411"></a>00411     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#a8a24d365092cfdabb32218ab8e446dc6">isBoxPar</a>(t, a, b))     { <span class="keywordflow">return</span> <a class="code" href="parSchema_8cpp.html#aedc4f34e04691a4368884450608b5721">makeParSchema</a>(<a class="code" href="drawschema_8cpp.html#aa93fe3ff7b0f90f0b913163058bab892" title="Generate an appropriate schema according to the type of block diagram.">generateDiagramSchema</a>(a), <a class="code" href="drawschema_8cpp.html#aa93fe3ff7b0f90f0b913163058bab892" title="Generate an appropriate schema according to the type of block diagram.">generateDiagramSchema</a>(b)); }
<a name="l00412"></a>00412     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#a654a2a97bdc734448e669899976bdbd0">isBoxSplit</a>(t, a, b))   { <span class="keywordflow">return</span> <a class="code" href="schema_8h.html#abcac25065dd4f0ef5264c1316a337699" title="Creates a new split schema.">makeSplitSchema</a>(<a class="code" href="drawschema_8cpp.html#aa93fe3ff7b0f90f0b913163058bab892" title="Generate an appropriate schema according to the type of block diagram.">generateDiagramSchema</a>(a), <a class="code" href="drawschema_8cpp.html#aa93fe3ff7b0f90f0b913163058bab892" title="Generate an appropriate schema according to the type of block diagram.">generateDiagramSchema</a>(b)); }
<a name="l00413"></a>00413     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#a7b7d0ce5bacf1a799517f7b50dfe7a3e">isBoxMerge</a>(t, a, b))   { <span class="keywordflow">return</span> <a class="code" href="mergeSchema_8cpp.html#aecaa5ca9a79a8985439f2d20372d3be9" title="Creates a new merge schema.">makeMergeSchema</a>(<a class="code" href="drawschema_8cpp.html#aa93fe3ff7b0f90f0b913163058bab892" title="Generate an appropriate schema according to the type of block diagram.">generateDiagramSchema</a>(a), <a class="code" href="drawschema_8cpp.html#aa93fe3ff7b0f90f0b913163058bab892" title="Generate an appropriate schema according to the type of block diagram.">generateDiagramSchema</a>(b)); }
<a name="l00414"></a>00414     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#a97de4dc9680e2d0820a5d1d18255fa35">isBoxRec</a>(t, a, b))     { <span class="keywordflow">return</span> <a class="code" href="recSchema_8cpp.html#a8c399e3657df2ea0cd980abe6aa9d63c" title="Creates a new recursive schema (s1 ~ s2).">makeRecSchema</a>(<a class="code" href="drawschema_8cpp.html#aa93fe3ff7b0f90f0b913163058bab892" title="Generate an appropriate schema according to the type of block diagram.">generateDiagramSchema</a>(a), <a class="code" href="drawschema_8cpp.html#aa93fe3ff7b0f90f0b913163058bab892" title="Generate an appropriate schema according to the type of block diagram.">generateDiagramSchema</a>(b)); }
<a name="l00415"></a>00415 
<a name="l00416"></a>00416     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#af4b23a35faec0884c4591ff92576c3d4">isBoxSlot</a>(t, &amp;i))      { <span class="keywordflow">return</span> <a class="code" href="drawschema_8cpp.html#ac0758f1c55f48d5fd97749c5ca0a4d0f" title="Generate a 0-&amp;gt;1 block schema for an output slot.">generateOutputSlotSchema</a>(t); }
<a name="l00417"></a>00417     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="boxes_8cpp.html#ab73899d732fd2181be3d72f28c11ab3d">isBoxSymbolic</a>(t,a,b))  {
<a name="l00418"></a>00418         <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a>    id;
<a name="l00419"></a>00419         <span class="keywordflow">if</span> (<a class="code" href="names_8cpp.html#afa6f89a686c004f84729e2bca7bf2053" title="Indicates the identifier (if any) the expression was a definition of.">getDefNameProperty</a>(t, <span class="keywordtype">id</span>)) {
<a name="l00420"></a>00420             <span class="keywordflow">return</span> <a class="code" href="drawschema_8cpp.html#ab2d8b239da01cbe94c57ad7d34ef08ad" title="Generate an abstraction schema by placing in sequence the input slots and the body...">generateAbstractionSchema</a>(<a class="code" href="drawschema_8cpp.html#a8dcc7a4de6c720ee55d6bd423d85a6ae" title="Generate a 1-&amp;gt;0 block schema for an input slot.">generateInputSlotSchema</a>(a), b);
<a name="l00421"></a>00421         } <span class="keywordflow">else</span> {
<a name="l00422"></a>00422             <span class="keywordflow">return</span> <a class="code" href="decorateSchema_8cpp.html#a81275d91bf8e76c149e885abab4be60a" title="Creates a new decorated schema.">makeDecorateSchema</a>(<a class="code" href="drawschema_8cpp.html#ab2d8b239da01cbe94c57ad7d34ef08ad" title="Generate an abstraction schema by placing in sequence the input slots and the body...">generateAbstractionSchema</a>(<a class="code" href="drawschema_8cpp.html#a8dcc7a4de6c720ee55d6bd423d85a6ae" title="Generate a 1-&amp;gt;0 block schema for an input slot.">generateInputSlotSchema</a>(a), b), 10, <span class="stringliteral">&quot;Abstraction&quot;</span>);
<a name="l00423"></a>00423         }
<a name="l00424"></a>00424     }
<a name="l00425"></a>00425 
<a name="l00426"></a>00426     <span class="keywordflow">else</span> {
<a name="l00427"></a>00427 
<a name="l00428"></a>00428         fprintf(stderr, <span class="stringliteral">&quot;Internal Error, box expression not recognized : &quot;</span>); <a class="code" href="list_8cpp.html#a850f2e459a901e0c9908d3a3a54b306e">print</a>(t, stderr); fprintf(stderr, <span class="stringliteral">&quot;\n&quot;</span>);
<a name="l00429"></a>00429         exit(1);
<a name="l00430"></a>00430 
<a name="l00431"></a>00431     }
<a name="l00432"></a>00432 }
<a name="l00433"></a>00433 
<a name="l00434"></a>00434 <span class="comment">//------------------------ specific schema -------------------------</span>
<a name="l00435"></a>00435 
<a name="l00436"></a>00436 
<a name="l00440"></a><a class="code" href="drawschema_8cpp.html#a6c2661dcc5e78bf16eb0c9f2b467510b">00440</a> <span class="keyword">static</span> <a class="code" href="classschema.html" title="An abstract block diagram schema.">schema</a>*  <a class="code" href="drawschema_8cpp.html#a6c2661dcc5e78bf16eb0c9f2b467510b" title="Generate a 0-&amp;gt;1 block schema for a user interface element.">generateUserInterfaceSchema</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="l00441"></a>00441 {
<a name="l00442"></a>00442     stringstream    s;
<a name="l00443"></a>00443     s &lt;&lt; <a class="code" href="classboxpp.html">boxpp</a>(t);
<a name="l00444"></a>00444 
<a name="l00445"></a>00445     <span class="keywordflow">return</span> <a class="code" href="blockSchema_8cpp.html#a4f795fe515331bbaed4f661d1fb2591a" title="Build a simple colored blockSchema with a certain number of inputs and outputs, a...">makeBlockSchema</a>(0, 1, s.str(), <a class="code" href="drawschema_8cpp.html#afda0b9886e7b4caa0f7025e1cd9caf5c">uicolor</a>, <span class="stringliteral">&quot;&quot;</span>);
<a name="l00446"></a>00446 }
<a name="l00447"></a>00447 
<a name="l00448"></a>00448 
<a name="l00449"></a>00449 
<a name="l00453"></a><a class="code" href="drawschema_8cpp.html#abfd7187fd2597106ef700922db42e0b6">00453</a> <span class="keyword">static</span> <a class="code" href="classschema.html" title="An abstract block diagram schema.">schema</a>* <a class="code" href="drawschema_8cpp.html#abfd7187fd2597106ef700922db42e0b6" title="Generate a 1-&amp;gt;1 block schema for a user interface bargraph.">generateBargraphSchema</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="l00454"></a>00454 {
<a name="l00455"></a>00455     stringstream    s;
<a name="l00456"></a>00456     s &lt;&lt; <a class="code" href="classboxpp.html">boxpp</a>(t);
<a name="l00457"></a>00457 
<a name="l00458"></a>00458     <span class="keywordflow">return</span> <a class="code" href="blockSchema_8cpp.html#a4f795fe515331bbaed4f661d1fb2591a" title="Build a simple colored blockSchema with a certain number of inputs and outputs, a...">makeBlockSchema</a>(1, 1, s.str(), <a class="code" href="drawschema_8cpp.html#afda0b9886e7b4caa0f7025e1cd9caf5c">uicolor</a>, <span class="stringliteral">&quot;&quot;</span>);
<a name="l00459"></a>00459 }
<a name="l00460"></a>00460 
<a name="l00461"></a>00461 
<a name="l00462"></a>00462 
<a name="l00466"></a><a class="code" href="drawschema_8cpp.html#a8dcc7a4de6c720ee55d6bd423d85a6ae">00466</a> <span class="keyword">static</span> <a class="code" href="classschema.html" title="An abstract block diagram schema.">schema</a>* <a class="code" href="drawschema_8cpp.html#a8dcc7a4de6c720ee55d6bd423d85a6ae" title="Generate a 1-&amp;gt;0 block schema for an input slot.">generateInputSlotSchema</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)
<a name="l00467"></a>00467 {
<a name="l00468"></a>00468     <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> id; assert(<a class="code" href="names_8cpp.html#afa6f89a686c004f84729e2bca7bf2053" title="Indicates the identifier (if any) the expression was a definition of.">getDefNameProperty</a>(a, <span class="keywordtype">id</span>));
<a name="l00469"></a>00469     stringstream s; s &lt;&lt; <a class="code" href="tree_8cpp.html#ac753d60778175e30a86cba647db017ad" title="if t has a node of type symbol, return its name otherwise error">tree2str</a>(<span class="keywordtype">id</span>);
<a name="l00470"></a>00470     <span class="keywordflow">return</span> <a class="code" href="blockSchema_8cpp.html#a4f795fe515331bbaed4f661d1fb2591a" title="Build a simple colored blockSchema with a certain number of inputs and outputs, a...">makeBlockSchema</a>(1, 0, s.str(), <a class="code" href="drawschema_8cpp.html#a95eb74e9745ce1361c846f3106a4d948">slotcolor</a>, <span class="stringliteral">&quot;&quot;</span>);
<a name="l00471"></a>00471 }
<a name="l00472"></a>00472 
<a name="l00473"></a>00473 
<a name="l00474"></a>00474 
<a name="l00478"></a><a class="code" href="drawschema_8cpp.html#ac0758f1c55f48d5fd97749c5ca0a4d0f">00478</a> <span class="keyword">static</span> <a class="code" href="classschema.html" title="An abstract block diagram schema.">schema</a>* <a class="code" href="drawschema_8cpp.html#ac0758f1c55f48d5fd97749c5ca0a4d0f" title="Generate a 0-&amp;gt;1 block schema for an output slot.">generateOutputSlotSchema</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)
<a name="l00479"></a>00479 {
<a name="l00480"></a>00480     <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> id; assert(<a class="code" href="names_8cpp.html#afa6f89a686c004f84729e2bca7bf2053" title="Indicates the identifier (if any) the expression was a definition of.">getDefNameProperty</a>(a, <span class="keywordtype">id</span>));
<a name="l00481"></a>00481     stringstream s; s &lt;&lt; <a class="code" href="tree_8cpp.html#ac753d60778175e30a86cba647db017ad" title="if t has a node of type symbol, return its name otherwise error">tree2str</a>(<span class="keywordtype">id</span>);
<a name="l00482"></a>00482     <span class="keywordflow">return</span> <a class="code" href="blockSchema_8cpp.html#a4f795fe515331bbaed4f661d1fb2591a" title="Build a simple colored blockSchema with a certain number of inputs and outputs, a...">makeBlockSchema</a>(0, 1, s.str(), <a class="code" href="drawschema_8cpp.html#a95eb74e9745ce1361c846f3106a4d948">slotcolor</a>, <span class="stringliteral">&quot;&quot;</span>);
<a name="l00483"></a>00483 }
<a name="l00484"></a>00484 
<a name="l00485"></a>00485 
<a name="l00486"></a>00486 
<a name="l00491"></a><a class="code" href="drawschema_8cpp.html#ab2d8b239da01cbe94c57ad7d34ef08ad">00491</a> <span class="keyword">static</span> <a class="code" href="classschema.html" title="An abstract block diagram schema.">schema</a>* <a class="code" href="drawschema_8cpp.html#ab2d8b239da01cbe94c57ad7d34ef08ad" title="Generate an abstraction schema by placing in sequence the input slots and the body...">generateAbstractionSchema</a>(<a class="code" href="classschema.html" title="An abstract block diagram schema.">schema</a>* x, <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="l00492"></a>00492 {
<a name="l00493"></a>00493     <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,b;
<a name="l00494"></a>00494 
<a name="l00495"></a>00495     <span class="keywordflow">while</span> (<a class="code" href="boxes_8cpp.html#ab73899d732fd2181be3d72f28c11ab3d">isBoxSymbolic</a>(t,a,b)) {
<a name="l00496"></a>00496         x = <a class="code" href="parSchema_8cpp.html#aedc4f34e04691a4368884450608b5721">makeParSchema</a>(x, <a class="code" href="drawschema_8cpp.html#a8dcc7a4de6c720ee55d6bd423d85a6ae" title="Generate a 1-&amp;gt;0 block schema for an input slot.">generateInputSlotSchema</a>(a));
<a name="l00497"></a>00497         t = b;
<a name="l00498"></a>00498     }
<a name="l00499"></a>00499     <span class="keywordflow">return</span> <a class="code" href="schema_8h.html#aee99b4bfcc6a9f9ab9c91af512e5daee" title="Make a sequential schema.">makeSeqSchema</a>(x, <a class="code" href="drawschema_8cpp.html#aa93fe3ff7b0f90f0b913163058bab892" title="Generate an appropriate schema according to the type of block diagram.">generateDiagramSchema</a>(t));
<a name="l00500"></a>00500 }
<a name="l00501"></a>00501 
</pre></div></div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Wed Apr 28 23:59:58 2010 for FAUST compiler by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>