Sophie

Sophie

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

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: labels.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>labels.cpp</h1><a href="labels_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#include &quot;<a class="code" href="labels_8hh.html">labels.hh</a>&quot;</span>
<a name="l00002"></a>00002 
<a name="l00003"></a>00003 <span class="comment">//=========================== PATHNAME ===============================</span>
<a name="l00004"></a>00004 
<a name="l00018"></a><a class="code" href="labels_8cpp.html#a34b0488a5a59c45bc4b66465668fde5d">00018</a> <a class="code" href="classSymbol.html" title="Symbols are unique objects with a name stored in a hash table.">Sym</a> <a class="code" href="labels_8cpp.html#a34b0488a5a59c45bc4b66465668fde5d" title="Grammar for labels with pathnames ----------------------------------- &amp;lt;label&amp;gt;...">PATHROOT</a> = <a class="code" href="symbol_8hh.html#aaa87083235b70d1042e59ae25e0800d8" title="Returns (and creates if new) the symbol of name str.">symbol</a> (<span class="stringliteral">&quot;/&quot;</span>);
<a name="l00019"></a><a class="code" href="labels_8cpp.html#a0e3389d777f9a0e89e85123a7ce91976">00019</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="labels_8cpp.html#a0e3389d777f9a0e89e85123a7ce91976">pathRoot</a>()                     { <span class="keywordflow">return</span> <a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(PATHROOT); }
<a name="l00020"></a><a class="code" href="labels_8cpp.html#a29a3dea1e6ab4039ba7da6dda9ef1a7c">00020</a> <span class="keywordtype">bool</span> <a class="code" href="labels_8cpp.html#a29a3dea1e6ab4039ba7da6dda9ef1a7c">isPathRoot</a>(<a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> t)             { <span class="keywordflow">return</span> <a class="code" href="tree_8cpp.html#a06be972e0437c7c09e8a1274586fe176">isTree</a>(t, PATHROOT); }
<a name="l00021"></a>00021 
<a name="l00022"></a><a class="code" href="labels_8cpp.html#a6736725938d785b87ecc5c1db17a0aeb">00022</a> <a class="code" href="classSymbol.html" title="Symbols are unique objects with a name stored in a hash table.">Sym</a> <a class="code" href="labels_8cpp.html#a6736725938d785b87ecc5c1db17a0aeb">PATHPARENT</a> = <a class="code" href="symbol_8hh.html#aaa87083235b70d1042e59ae25e0800d8" title="Returns (and creates if new) the symbol of name str.">symbol</a> (<span class="stringliteral">&quot;..&quot;</span>);
<a name="l00023"></a><a class="code" href="labels_8cpp.html#ad33d38970d9445fb1a4324ffa0d22537">00023</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="labels_8cpp.html#ad33d38970d9445fb1a4324ffa0d22537">pathParent</a>()                   { <span class="keywordflow">return</span> <a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(PATHPARENT); }
<a name="l00024"></a><a class="code" href="labels_8cpp.html#a5bfedfc5998d42333728c6f60667568a">00024</a> <span class="keywordtype">bool</span> <a class="code" href="labels_8cpp.html#a5bfedfc5998d42333728c6f60667568a">isPathParent</a>(<a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> t)           { <span class="keywordflow">return</span> <a class="code" href="tree_8cpp.html#a06be972e0437c7c09e8a1274586fe176">isTree</a>(t, PATHPARENT); }
<a name="l00025"></a>00025 
<a name="l00026"></a><a class="code" href="labels_8cpp.html#a550f3e737e9a1d00bdf6624e68d7e230">00026</a> <a class="code" href="classSymbol.html" title="Symbols are unique objects with a name stored in a hash table.">Sym</a> <a class="code" href="labels_8cpp.html#a550f3e737e9a1d00bdf6624e68d7e230">PATHCURRENT</a> = <a class="code" href="symbol_8hh.html#aaa87083235b70d1042e59ae25e0800d8" title="Returns (and creates if new) the symbol of name str.">symbol</a> (<span class="stringliteral">&quot;.&quot;</span>);
<a name="l00027"></a><a class="code" href="labels_8cpp.html#aafaf5a475b77126670f0e49d864aac31">00027</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="labels_8cpp.html#aafaf5a475b77126670f0e49d864aac31">pathCurrent</a>()                  { <span class="keywordflow">return</span> <a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(PATHCURRENT); }
<a name="l00028"></a><a class="code" href="labels_8cpp.html#ae90fbab193b30fa7b70f8f55ad483956">00028</a> <span class="keywordtype">bool</span> <a class="code" href="labels_8cpp.html#ae90fbab193b30fa7b70f8f55ad483956">isPathCurrent</a>(<a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> t)          { <span class="keywordflow">return</span> <a class="code" href="tree_8cpp.html#a06be972e0437c7c09e8a1274586fe176">isTree</a>(t, PATHCURRENT); }
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 
<a name="l00031"></a>00031 
<a name="l00036"></a><a class="code" href="labels_8cpp.html#aea7d5137855b830b140c22a09744f0fe">00036</a> <span class="keyword">static</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="labels_8cpp.html#aea7d5137855b830b140c22a09744f0fe" title="analyze name for &amp;quot;H:name&amp;quot; | &amp;quot;V:name&amp;quot; etc">encodeName</a>(<span class="keywordtype">char</span> g, <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; <a class="code" href="symbol_8hh.html#a8243134fbbd9d924ebbb3f833922e310" title="Returns the name of a symbol.">name</a>)
<a name="l00037"></a>00037 {
<a name="l00038"></a>00038     <span class="keywordflow">switch</span> (g) {
<a name="l00039"></a>00039         <span class="keywordflow">case</span> <span class="charliteral">&#39;v&#39;</span>:
<a name="l00040"></a>00040         <span class="keywordflow">case</span> <span class="charliteral">&#39;V&#39;</span>: <span class="keywordflow">return</span> <a class="code" href="list_8hh.html#ae1ed153946fcfc025009c6d9c9c40bee">cons</a>(<a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(0), <a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(name));
<a name="l00041"></a>00041 
<a name="l00042"></a>00042         <span class="keywordflow">case</span> <span class="charliteral">&#39;h&#39;</span>:
<a name="l00043"></a>00043         <span class="keywordflow">case</span> <span class="charliteral">&#39;H&#39;</span>: <span class="keywordflow">return</span> <a class="code" href="list_8hh.html#ae1ed153946fcfc025009c6d9c9c40bee">cons</a>(<a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(1), <a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(name));
<a name="l00044"></a>00044 
<a name="l00045"></a>00045         <span class="keywordflow">case</span> <span class="charliteral">&#39;t&#39;</span>:
<a name="l00046"></a>00046         <span class="keywordflow">case</span> <span class="charliteral">&#39;T&#39;</span>: <span class="keywordflow">return</span> <a class="code" href="list_8hh.html#ae1ed153946fcfc025009c6d9c9c40bee">cons</a>(<a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(2), <a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(name));
<a name="l00047"></a>00047 
<a name="l00048"></a>00048         <span class="keywordflow">default</span> : <span class="keywordflow">return</span> <a class="code" href="list_8hh.html#ae1ed153946fcfc025009c6d9c9c40bee">cons</a>(<a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(0), <a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(name));
<a name="l00049"></a>00049     }
<a name="l00050"></a>00050 }
<a name="l00051"></a>00051 
<a name="l00052"></a>00052 
<a name="l00057"></a><a class="code" href="labels_8cpp.html#a8e07db8682a579529270ae62d5a24ec6">00057</a> <span class="keyword">static</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="labels_8cpp.html#a8e07db8682a579529270ae62d5a24ec6" title="Analyzes a label and converts it as a path.">label2path</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* label)
<a name="l00058"></a>00058 {
<a name="l00059"></a>00059     <span class="keywordflow">if</span> (label[0] == 0) {
<a name="l00060"></a>00060         <span class="keywordflow">return</span> <a class="code" href="list_8hh.html#ae1ed153946fcfc025009c6d9c9c40bee">cons</a>(<a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(<span class="stringliteral">&quot;&quot;</span>), <a class="code" href="list_8cpp.html#a538b704dd07794b7237108f1917c471e">nil</a>);
<a name="l00061"></a>00061 
<a name="l00062"></a>00062     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (label[0] == <span class="charliteral">&#39;/&#39;</span>) {
<a name="l00063"></a>00063         <span class="keywordflow">return</span> <a class="code" href="list_8hh.html#ae1ed153946fcfc025009c6d9c9c40bee">cons</a>(<a class="code" href="labels_8cpp.html#a0e3389d777f9a0e89e85123a7ce91976">pathRoot</a>(), <a class="code" href="labels_8cpp.html#a8e07db8682a579529270ae62d5a24ec6" title="Analyzes a label and converts it as a path.">label2path</a>(&amp;label[1]));
<a name="l00064"></a>00064 
<a name="l00065"></a>00065     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((label[0] == <span class="charliteral">&#39;.&#39;</span>) &amp;&amp; (label[1] == <span class="charliteral">&#39;/&#39;</span>)) {
<a name="l00066"></a>00066         <span class="keywordflow">return</span> <a class="code" href="labels_8cpp.html#a8e07db8682a579529270ae62d5a24ec6" title="Analyzes a label and converts it as a path.">label2path</a>(&amp;label[2]);
<a name="l00067"></a>00067 
<a name="l00068"></a>00068     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((label[0] == <span class="charliteral">&#39;.&#39;</span>) &amp;&amp; (label[1] == <span class="charliteral">&#39;.&#39;</span>) &amp;&amp; (label[2] == <span class="charliteral">&#39;/&#39;</span>)) {
<a name="l00069"></a>00069         <span class="keywordflow">return</span> <a class="code" href="list_8hh.html#ae1ed153946fcfc025009c6d9c9c40bee">cons</a>(<a class="code" href="labels_8cpp.html#ad33d38970d9445fb1a4324ffa0d22537">pathParent</a>(), <a class="code" href="labels_8cpp.html#a8e07db8682a579529270ae62d5a24ec6" title="Analyzes a label and converts it as a path.">label2path</a>(&amp;label[3]));
<a name="l00070"></a>00070 
<a name="l00071"></a>00071     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (label[1] == <span class="charliteral">&#39;:&#39;</span>) {
<a name="l00072"></a>00072         <span class="keywordtype">char</span>    g = label[0];
<a name="l00073"></a>00073         <span class="keywordtype">string</span>  s;
<a name="l00074"></a>00074         <span class="keywordtype">int</span>     i = 2;
<a name="l00075"></a>00075         <span class="keywordflow">while</span> ((label[i] != 0) &amp;&amp; (label[i] != <span class="charliteral">&#39;/&#39;</span>)) {
<a name="l00076"></a>00076             s.push_back(label[i]);
<a name="l00077"></a>00077             i++;
<a name="l00078"></a>00078         }
<a name="l00079"></a>00079         <span class="keywordflow">if</span> (label[i] == <span class="charliteral">&#39;/&#39;</span>) i++;
<a name="l00080"></a>00080         <span class="keywordflow">return</span> <a class="code" href="list_8hh.html#ae1ed153946fcfc025009c6d9c9c40bee">cons</a>(<a class="code" href="labels_8cpp.html#aea7d5137855b830b140c22a09744f0fe" title="analyze name for &amp;quot;H:name&amp;quot; | &amp;quot;V:name&amp;quot; etc">encodeName</a>(g,s), <a class="code" href="labels_8cpp.html#a8e07db8682a579529270ae62d5a24ec6" title="Analyzes a label and converts it as a path.">label2path</a>(&amp;label[i]));
<a name="l00081"></a>00081 
<a name="l00082"></a>00082     } <span class="keywordflow">else</span> {
<a name="l00083"></a>00083         <span class="keywordflow">return</span> <a class="code" href="list_8hh.html#ae1ed153946fcfc025009c6d9c9c40bee">cons</a>(<a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(label),<a class="code" href="list_8cpp.html#a538b704dd07794b7237108f1917c471e">nil</a>);
<a name="l00084"></a>00084     }
<a name="l00085"></a>00085 }
<a name="l00086"></a>00086 
<a name="l00087"></a>00087 
<a name="l00094"></a><a class="code" href="labels_8cpp.html#a5f1201c3a38839b6ee81b22c2ddd5a76">00094</a> <span class="keyword">static</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="labels_8cpp.html#a5f1201c3a38839b6ee81b22c2ddd5a76" title="Concatenate the relative path to the absolute path Note that the relpath is top-down...">concatPath</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> relpath, <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> abspath)
<a name="l00095"></a>00095 {
<a name="l00096"></a>00096     <span class="keywordflow">if</span> (<a class="code" href="list_8hh.html#a8bdd73641276e0c0f999f504348eacc1">isList</a>(relpath)) {
<a name="l00097"></a>00097         <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> head = <a class="code" href="list_8hh.html#a067ad6f83087b420a1c44e48e56be389">hd</a>(relpath);
<a name="l00098"></a>00098         <span class="keywordflow">if</span> (<a class="code" href="labels_8cpp.html#a29a3dea1e6ab4039ba7da6dda9ef1a7c">isPathRoot</a>(head)) {
<a name="l00099"></a>00099             <span class="keywordflow">return</span> <a class="code" href="labels_8cpp.html#a5f1201c3a38839b6ee81b22c2ddd5a76" title="Concatenate the relative path to the absolute path Note that the relpath is top-down...">concatPath</a>(<a class="code" href="list_8hh.html#a4075748f5c7156306ec898795313a2e0">tl</a>(relpath), <a class="code" href="list_8cpp.html#a538b704dd07794b7237108f1917c471e">nil</a>);
<a name="l00100"></a>00100         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="labels_8cpp.html#a5bfedfc5998d42333728c6f60667568a">isPathParent</a>(head)) {
<a name="l00101"></a>00101             <span class="keywordflow">if</span> (!<a class="code" href="list_8hh.html#a8bdd73641276e0c0f999f504348eacc1">isList</a>(abspath)) { 
<a name="l00102"></a>00102                 <span class="comment">//cerr &lt;&lt; &quot;abspath : &quot; &lt;&lt; *abspath &lt;&lt; endl; </span>
<a name="l00103"></a>00103                 <span class="keywordflow">return</span> <a class="code" href="labels_8cpp.html#a5f1201c3a38839b6ee81b22c2ddd5a76" title="Concatenate the relative path to the absolute path Note that the relpath is top-down...">concatPath</a>(<a class="code" href="list_8hh.html#a4075748f5c7156306ec898795313a2e0">tl</a>(relpath), <a class="code" href="list_8hh.html#a067ad6f83087b420a1c44e48e56be389">hd</a>(relpath));
<a name="l00104"></a>00104             } <span class="keywordflow">else</span> {
<a name="l00105"></a>00105                 <span class="keywordflow">return</span> <a class="code" href="labels_8cpp.html#a5f1201c3a38839b6ee81b22c2ddd5a76" title="Concatenate the relative path to the absolute path Note that the relpath is top-down...">concatPath</a>(<a class="code" href="list_8hh.html#a4075748f5c7156306ec898795313a2e0">tl</a>(relpath), <a class="code" href="list_8hh.html#a4075748f5c7156306ec898795313a2e0">tl</a>(abspath));
<a name="l00106"></a>00106             }
<a name="l00107"></a>00107         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="labels_8cpp.html#ae90fbab193b30fa7b70f8f55ad483956">isPathCurrent</a>(head)) {
<a name="l00108"></a>00108             <span class="keywordflow">return</span> <a class="code" href="labels_8cpp.html#a5f1201c3a38839b6ee81b22c2ddd5a76" title="Concatenate the relative path to the absolute path Note that the relpath is top-down...">concatPath</a>(<a class="code" href="list_8hh.html#a4075748f5c7156306ec898795313a2e0">tl</a>(relpath), abspath);
<a name="l00109"></a>00109         } <span class="keywordflow">else</span> {
<a name="l00110"></a>00110             <span class="keywordflow">return</span> <a class="code" href="labels_8cpp.html#a5f1201c3a38839b6ee81b22c2ddd5a76" title="Concatenate the relative path to the absolute path Note that the relpath is top-down...">concatPath</a>(<a class="code" href="list_8hh.html#a4075748f5c7156306ec898795313a2e0">tl</a>(relpath), <a class="code" href="list_8hh.html#ae1ed153946fcfc025009c6d9c9c40bee">cons</a>(head,abspath));
<a name="l00111"></a>00111         }
<a name="l00112"></a>00112     } <span class="keywordflow">else</span> {
<a name="l00113"></a>00113         assert(<a class="code" href="list_8hh.html#a2569c3a07bbbfa55e0afde62de62aeec">isNil</a>(relpath));
<a name="l00114"></a>00114         <span class="keywordflow">return</span> abspath;
<a name="l00115"></a>00115     }
<a name="l00116"></a>00116 }
<a name="l00117"></a>00117 
<a name="l00118"></a>00118 
<a name="l00119"></a><a class="code" href="labels_8cpp.html#a278d43b52191749283aa8074557cd8af">00119</a> <span class="keyword">static</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="labels_8cpp.html#a278d43b52191749283aa8074557cd8af">normalizeLabel</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> label, <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 name="l00120"></a>00120 {
<a name="l00121"></a>00121     <span class="comment">// we suppose label = &quot;../label&quot; ou &quot;name/label&quot; ou &quot;name&quot;  </span>
<a name="l00122"></a>00122     <span class="comment">//cout &lt;&lt; &quot;Normalize Label &quot; &lt;&lt; *label &lt;&lt; &quot; with path &quot; &lt;&lt; *path &lt;&lt; endl;</span>
<a name="l00123"></a>00123     <span class="keywordflow">if</span> (<a class="code" href="list_8hh.html#a8bdd73641276e0c0f999f504348eacc1">isList</a>(label)) {
<a name="l00124"></a>00124         <span class="keywordflow">return</span> <a class="code" href="list_8hh.html#ae1ed153946fcfc025009c6d9c9c40bee">cons</a>(label, path);
<a name="l00125"></a>00125     } <span class="keywordflow">else</span> {
<a name="l00126"></a>00126         <a class="code" href="classSymbol.html" title="Symbols are unique objects with a name stored in a hash table.">Sym</a> s;
<a name="l00127"></a>00127         assert (<a class="code" href="node_8hh.html#ab714e75c43d570297ff54578dc7e9ce3">isSym</a>(label-&gt;<a class="code" href="classCTree.html#a8de786fec095c8304b9ffa7c1c316237" title="return the content of the tree">node</a>(),&amp;s));
<a name="l00128"></a>00128         <span class="keywordflow">return</span> <a class="code" href="labels_8cpp.html#a5f1201c3a38839b6ee81b22c2ddd5a76" title="Concatenate the relative path to the absolute path Note that the relpath is top-down...">concatPath</a>(<a class="code" href="labels_8cpp.html#a8e07db8682a579529270ae62d5a24ec6" title="Analyzes a label and converts it as a path.">label2path</a>(<a class="code" href="symbol_8hh.html#a8243134fbbd9d924ebbb3f833922e310" title="Returns the name of a symbol.">name</a>(s)),path);
<a name="l00129"></a>00129     }
<a name="l00130"></a>00130 }
<a name="l00131"></a>00131 
<a name="l00132"></a><a class="code" href="labels_8hh.html#a8118f87a9c00e0b0fca7eb97e52bde95">00132</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="labels_8cpp.html#a8118f87a9c00e0b0fca7eb97e52bde95">normalizePath</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 name="l00133"></a>00133 {
<a name="l00134"></a>00134     <span class="comment">//cout &lt;&lt; &quot;Normalize Path [[&quot; &lt;&lt; *path &lt;&lt; &quot;]]&quot; &lt;&lt; endl;</span>
<a name="l00135"></a>00135     <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> npath;
<a name="l00136"></a>00136     <span class="keywordflow">if</span> (<a class="code" href="list_8hh.html#a2569c3a07bbbfa55e0afde62de62aeec">isNil</a>(path)) {
<a name="l00137"></a>00137         npath = path;
<a name="l00138"></a>00138     } <span class="keywordflow">else</span> {
<a name="l00139"></a>00139         npath = <a class="code" href="labels_8cpp.html#a278d43b52191749283aa8074557cd8af">normalizeLabel</a>(<a class="code" href="list_8hh.html#a067ad6f83087b420a1c44e48e56be389">hd</a>(path), <a class="code" href="labels_8cpp.html#a8118f87a9c00e0b0fca7eb97e52bde95">normalizePath</a>(<a class="code" href="list_8hh.html#a4075748f5c7156306ec898795313a2e0">tl</a>(path)));
<a name="l00140"></a>00140     }
<a name="l00141"></a>00141     <span class="comment">//cout &lt;&lt; &quot;              -&gt; [[&quot; &lt;&lt; *npath &lt;&lt; &quot;]]&quot; &lt;&lt; endl;</span>
<a name="l00142"></a>00142     <span class="keywordflow">return</span> npath;
<a name="l00143"></a>00143 }
<a name="l00144"></a>00144 
</pre></div></div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Wed Apr 28 23:59:59 2010 for FAUST compiler by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>