Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > ffa1e6f5ad04360808fe8840fe3ba036 > files > 233

vrq-devel-1.0.88-1.fc14.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>vrq: /net/fileserver/nas/home/mdh/vrq/src/cnode.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
  <table border="0" cellspacing="0" cellpadding="0" width="100%">
   <tr>
    <td width="180"><a href="index.html"><img src="vrq.png" width="150" height="100" border="0" alt="vrq"></a></td>
    <td background="top_bg.png" align="right" width="100%">
      <img src="glyth.png" width="500" height="100" border="0" alt="">
    </td>
   </tr>
   <tr>
    <td background="#FFFFFF" align="right" width="50" height="4"></td>
   </tr>
  </table>
</head><body>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul class="tablist">
      <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="modules.html"><span>Modules</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="tabs2">
    <ul class="tablist">
      <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>
<div class="header">
  <div class="headertitle">
<h1>/net/fileserver/nas/home/mdh/vrq/src/cnode.h</h1>  </div>
</div>
<div class="contents">
<a href="cnode_8h.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"> * Copyright (C) 1997-2007, Mark Hummel</span>
<a name="l00003"></a>00003 <span class="comment"> * This file is part of Vrq.</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> * Vrq is free software; you can redistribute it and/or</span>
<a name="l00006"></a>00006 <span class="comment"> * modify it under the terms of the GNU General Public</span>
<a name="l00007"></a>00007 <span class="comment"> * License as published by the Free Software Foundation; either</span>
<a name="l00008"></a>00008 <span class="comment"> * version 2 of the License, or (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * Vrq is distributed in the hope that it will be useful,</span>
<a name="l00011"></a>00011 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span>
<a name="l00013"></a>00013 <span class="comment"> * General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment"> *</span>
<a name="l00015"></a>00015 <span class="comment"> * You should have received a copy of the GNU General Public</span>
<a name="l00016"></a>00016 <span class="comment"> * License along with this library; if not, write to the Free Software</span>
<a name="l00017"></a>00017 <span class="comment"> * Foundation, Inc., 51 Franklin Street, Fifth Floor, </span>
<a name="l00018"></a>00018 <span class="comment"> * Boston, MA  02110-1301  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 <span class="comment">/******************************************************************************</span>
<a name="l00022"></a>00022 <span class="comment"> *</span>
<a name="l00023"></a>00023 <span class="comment"> *</span>
<a name="l00024"></a>00024 <span class="comment"> *         cnode.hpp</span>
<a name="l00025"></a>00025 <span class="comment"> *              - abstract class for declaration </span>
<a name="l00026"></a>00026 <span class="comment"> *</span>
<a name="l00027"></a>00027 <span class="comment"> *</span>
<a name="l00028"></a>00028 <span class="comment"> ******************************************************************************</span>
<a name="l00029"></a>00029 <span class="comment"> */</span>
<a name="l00030"></a>00030 
<a name="l00031"></a>00031 <span class="preprocessor">#ifndef CNODE_HPP</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span><span class="preprocessor">#define CNODE_HPP</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span>
<a name="l00034"></a>00034 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00036"></a>00036 <span class="preprocessor">#include &lt;sstream&gt;</span>
<a name="l00037"></a>00037 <span class="preprocessor">#include &lt;math.h&gt;</span>
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;list&gt;</span>
<a name="l00039"></a>00039 <span class="preprocessor">#include &lt;set&gt;</span>
<a name="l00040"></a>00040 <span class="preprocessor">#include &quot;<a class="code" href="glue_8h.html">glue.h</a>&quot;</span>
<a name="l00041"></a>00041 <span class="preprocessor">#include &quot;<a class="code" href="csymbol_8h.html">csymbol.h</a>&quot;</span>
<a name="l00042"></a>00042 <span class="preprocessor">#include &quot;<a class="code" href="cdecl_8h.html">cdecl.h</a>&quot;</span>
<a name="l00043"></a>00043 <span class="preprocessor">#include &quot;<a class="code" href="cvector_8h.html">cvector.h</a>&quot;</span>
<a name="l00044"></a>00044 <span class="preprocessor">#include &quot;<a class="code" href="cobstack_8h.html">cobstack.h</a>&quot;</span>
<a name="l00045"></a>00045 <span class="preprocessor">#include &quot;<a class="code" href="cattr_8h.html">cattr.h</a>&quot;</span>
<a name="l00046"></a>00046 
<a name="l00047"></a>00047 <span class="keyword">class </span><a class="code" href="classCGenvar.html" title="Declaration object for genvars.">CGenvar</a>;
<a name="l00048"></a>00048 <span class="keyword">class </span><a class="code" href="classCParam.html" title="Declaration object for parameters.">CParam</a>;
<a name="l00049"></a>00049 <span class="keyword">class </span><a class="code" href="classCFref.html" title="Forward reference declaration.">CFref</a>;
<a name="l00050"></a>00050 <span class="keyword">class </span><a class="code" href="classCVar.html" title="Declaration object for variables.">CVar</a>;
<a name="l00051"></a>00051 <span class="keyword">class </span><a class="code" href="classCNet.html" title="Declaration object for nets.">CNet</a>;
<a name="l00052"></a>00052 <span class="keyword">class </span><a class="code" href="classCPort.html" title="Declaration object for module/function/task ports.">CPort</a>;
<a name="l00053"></a>00053 <span class="keyword">class </span><a class="code" href="classCPortDir.html" title="Declaration object for input/output/inout statements.">CPortDir</a>;
<a name="l00054"></a>00054 <span class="keyword">class </span><a class="code" href="classCInstance.html" title="Declaration object for module and gate instances.">CInstance</a>;
<a name="l00055"></a>00055 <span class="keyword">class </span><a class="code" href="classCFunction.html" title="Declaration object for functions and tasks.">CFunction</a>;
<a name="l00056"></a>00056 <span class="keyword">class </span><a class="code" href="classCModule.html">CModule</a>;
<a name="l00057"></a>00057 <span class="keyword">class </span><a class="code" href="classCGate.html" title="Gate declaration object.">CGate</a>;
<a name="l00058"></a>00058 <span class="keyword">class </span>CEvent;
<a name="l00059"></a>00059 <span class="keyword">class </span><a class="code" href="classCAttr.html" title="Declaration object for holding lists of verilog attributes and their corresponding expressions...">CAttr</a>;
<a name="l00060"></a>00060 <span class="keyword">class </span><a class="code" href="classCBlock.html" title="Declaration class for block constructs.">CBlock</a>;
<a name="l00061"></a>00061 <span class="keyword">class </span><a class="code" href="classCSpecify.html" title="Declaration object for specify blocks.">CSpecify</a>;
<a name="l00062"></a>00062 <span class="keyword">class </span><a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>;
<a name="l00063"></a>00063 <span class="keyword">class </span>CTypedef;
<a name="l00064"></a><a class="code" href="cnode_8h.html#af00e3e29d8be8504da4d630b6f2be86a">00064</a> <span class="keyword">class </span>CEnum;
<a name="l00065"></a>00065 <span class="keyword">typedef</span> <a class="code" href="classCBlock.html" title="Declaration class for block constructs.">CBlock</a> <a class="code" href="classCBlock.html" title="Declaration class for block constructs.">CScope</a>;
<a name="l00066"></a>00066 <span class="keyword">inline</span> <span class="keywordtype">char</span>* <a class="code" href="group__utilities.html#gadba73693074d75c740c6a68704ba71f0" title="Convert double to char string allocating storage on given heap.">d2s</a>( <span class="keywordtype">double</span> d, <a class="code" href="classCObstack.html" title="Bulk object allocation object.">CObstack</a>* stack );
<a name="l00067"></a>00067 
<a name="l00071"></a><a class="code" href="cnode_8h.html#a037f9a3f242886ffc22581c9fc867574">00071</a> <span class="keyword">enum</span> <a class="code" href="cnode_8h.html#a037f9a3f242886ffc22581c9fc867574" title="Edge values.">Edge_t</a> {
<a name="l00072"></a><a class="code" href="cnode_8h.html#a037f9a3f242886ffc22581c9fc867574a11cec235bca7f49bfde6478ff2ce43be">00072</a>         <a class="code" href="cnode_8h.html#a037f9a3f242886ffc22581c9fc867574a11cec235bca7f49bfde6478ff2ce43be">eEDGE01</a> = 0x1,
<a name="l00073"></a><a class="code" href="cnode_8h.html#a037f9a3f242886ffc22581c9fc867574ac6f1b183dab2904948a94fb7c1876d8e">00073</a>         <a class="code" href="cnode_8h.html#a037f9a3f242886ffc22581c9fc867574ac6f1b183dab2904948a94fb7c1876d8e">eEDGE10</a> = 0x2,
<a name="l00074"></a><a class="code" href="cnode_8h.html#a037f9a3f242886ffc22581c9fc867574affe52512f641a5ab61ca4bc8947a55ba">00074</a>         <a class="code" href="cnode_8h.html#a037f9a3f242886ffc22581c9fc867574affe52512f641a5ab61ca4bc8947a55ba">eEDGE0x</a> = 0x4,
<a name="l00075"></a><a class="code" href="cnode_8h.html#a037f9a3f242886ffc22581c9fc867574a746e9baf584cc13dc91137a4e88f4173">00075</a>         <a class="code" href="cnode_8h.html#a037f9a3f242886ffc22581c9fc867574a746e9baf584cc13dc91137a4e88f4173">eEDGEx1</a> = 0x8,
<a name="l00076"></a><a class="code" href="cnode_8h.html#a037f9a3f242886ffc22581c9fc867574a94a247905278b6b78c0fcd9fd3ed52e2">00076</a>         <a class="code" href="cnode_8h.html#a037f9a3f242886ffc22581c9fc867574a94a247905278b6b78c0fcd9fd3ed52e2">eEDGE1x</a> = 0x10,
<a name="l00077"></a><a class="code" href="cnode_8h.html#a037f9a3f242886ffc22581c9fc867574a75340b8b90e65f226d84c532b4b9649d">00077</a>         <a class="code" href="cnode_8h.html#a037f9a3f242886ffc22581c9fc867574a75340b8b90e65f226d84c532b4b9649d">eEDGEx0</a> = 0x20,
<a name="l00078"></a>00078 };
<a name="l00079"></a>00079         
<a name="l00083"></a><a class="code" href="cnode_8h.html#a68d700a24f988399e796bd9ec0fab5ef">00083</a> <span class="keyword">enum</span> <a class="code" href="cnode_8h.html#a68d700a24f988399e796bd9ec0fab5ef" title="Timing mode values.">DelayMode_t</a> {
<a name="l00084"></a><a class="code" href="cnode_8h.html#a68d700a24f988399e796bd9ec0fab5efa1c832c79ae7e49e1c9d32acce2ce76c6">00084</a>         eMIN_DELAY,
<a name="l00085"></a><a class="code" href="cnode_8h.html#a68d700a24f988399e796bd9ec0fab5efa3c815f52576155b31cec0d30c4776f56">00085</a>         eTYP_DELAY,
<a name="l00086"></a><a class="code" href="cnode_8h.html#a68d700a24f988399e796bd9ec0fab5efac0be462041a0c7f6c42bc2552ec205d6">00086</a>         <a class="code" href="cnode_8h.html#a68d700a24f988399e796bd9ec0fab5efac0be462041a0c7f6c42bc2552ec205d6">eMAX_DELAY</a>
<a name="l00087"></a>00087 };
<a name="l00088"></a>00088 
<a name="l00092"></a><a class="code" href="cnode_8h.html#af77d11dbb72efad5ff27814d1c69f3df">00092</a> <span class="keyword">enum</span> <a class="code" href="cnode_8h.html#af77d11dbb72efad5ff27814d1c69f3df" title="Strength values.">Strength_t</a> {
<a name="l00093"></a><a class="code" href="cnode_8h.html#af77d11dbb72efad5ff27814d1c69f3dfa169517daa4b36262557270e8fd3cf567">00093</a>         <a class="code" href="cnode_8h.html#af77d11dbb72efad5ff27814d1c69f3dfa169517daa4b36262557270e8fd3cf567">eUNDEFINED</a> = 0,
<a name="l00094"></a><a class="code" href="cnode_8h.html#af77d11dbb72efad5ff27814d1c69f3dfad1295bcca347173d80a5de593840ae3d">00094</a>         eSUPPLY,
<a name="l00095"></a><a class="code" href="cnode_8h.html#af77d11dbb72efad5ff27814d1c69f3dfa68cf08252eae423158342789d1b620ee">00095</a>         eSTRONG,
<a name="l00096"></a><a class="code" href="cnode_8h.html#af77d11dbb72efad5ff27814d1c69f3dfadc0751c8ce7974ba97943e90546557fb">00096</a>         ePULL,
<a name="l00097"></a><a class="code" href="cnode_8h.html#af77d11dbb72efad5ff27814d1c69f3dfa14ba7145fced374d4d661d6daaac3c6b">00097</a>         eLARGE,
<a name="l00098"></a><a class="code" href="cnode_8h.html#af77d11dbb72efad5ff27814d1c69f3dfadae153c26a024bb6465932f4a76558c7">00098</a>         eWEAK,
<a name="l00099"></a><a class="code" href="cnode_8h.html#af77d11dbb72efad5ff27814d1c69f3dfa01a09ec5fd04a6fed50115c75bb0b5eb">00099</a>         eMEDIUM,
<a name="l00100"></a><a class="code" href="cnode_8h.html#af77d11dbb72efad5ff27814d1c69f3dfab5acd1e2fdc4d0b05f6e89e78d20255e">00100</a>         eSMALL,
<a name="l00101"></a><a class="code" href="cnode_8h.html#af77d11dbb72efad5ff27814d1c69f3dfaeccdd69eb663aa50d506548c4321c08b">00101</a>         eHIGHZ,
<a name="l00102"></a>00102 };
<a name="l00103"></a>00103 
<a name="l00107"></a><a class="code" href="structStrengthPair__t.html">00107</a> <span class="keyword">struct </span><a class="code" href="structStrengthPair__t.html" title="Pair of strengths.">StrengthPair_t</a> {
<a name="l00108"></a><a class="code" href="structStrengthPair__t.html#af5b8b2d309422e7ee3b6ec6a0297d4e9">00108</a>         <a class="code" href="cnode_8h.html#af77d11dbb72efad5ff27814d1c69f3df" title="Strength values.">Strength_t</a>      <a class="code" href="structStrengthPair__t.html#af5b8b2d309422e7ee3b6ec6a0297d4e9">s0</a>;
<a name="l00109"></a><a class="code" href="structStrengthPair__t.html#a82f76d349dbd509ac3aa8d184f66be05">00109</a>         <a class="code" href="cnode_8h.html#af77d11dbb72efad5ff27814d1c69f3df" title="Strength values.">Strength_t</a>      <a class="code" href="structStrengthPair__t.html#a82f76d349dbd509ac3aa8d184f66be05">s1</a>;
<a name="l00110"></a>00110 };
<a name="l00111"></a>00111 
<a name="l00112"></a>00112 <span class="preprocessor">#define DEFINE_ENUM</span>
<a name="l00113"></a>00113 <span class="preprocessor"></span><span class="preprocessor">#include &quot;<a class="code" href="cnode__def_8h.html" title="Definitions for parse tree nodes.">cnode_def.h</a>&quot;</span>
<a name="l00114"></a>00114 <span class="preprocessor">#undef DEFINE_ENUM</span>
<a name="l00115"></a>00115 <span class="preprocessor"></span>
<a name="l00116"></a>00116 
<a name="l00123"></a>00123 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;
<a name="l00124"></a><a class="code" href="classCNode__sp.html">00124</a> <span class="keyword">class </span><a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp</a> {
<a name="l00125"></a>00125         T* ptr; 
<a name="l00126"></a>00126 <span class="keyword">public</span>:
<a name="l00127"></a><a class="code" href="classCNode__sp.html#ac75c97cc7e47bc4e0aa1c7152bea3403">00127</a>         <a class="code" href="classCNode__sp.html#ac75c97cc7e47bc4e0aa1c7152bea3403" title="Pointer to untyped argument.">CNode_sp</a>( <span class="keywordtype">void</span>** np ) { ptr = (T*)np; }
<a name="l00128"></a><a class="code" href="classCNode__sp.html#a042c1b01b2d7c7d53533bbb40f4a92c8">00128</a>         T <a class="code" href="classCNode__sp.html#a042c1b01b2d7c7d53533bbb40f4a92c8">operator=</a>( T n ) { *ptr = n; <span class="keywordflow">return</span> n; }
<a name="l00129"></a><a class="code" href="classCNode__sp.html#af418aed1a1a9dd854b4c894fb272807d">00129</a>         T <a class="code" href="classCNode__sp.html#af418aed1a1a9dd854b4c894fb272807d">operator-&gt;</a>() { <span class="keywordflow">return</span> *ptr; }
<a name="l00130"></a><a class="code" href="classCNode__sp.html#a80802b9a8d123a3c09f2df8be3a67b04">00130</a>         <a class="code" href="classCNode__sp.html#a80802b9a8d123a3c09f2df8be3a67b04">operator T</a>() { <span class="keywordflow">return</span> *ptr; }
<a name="l00131"></a><a class="code" href="classCNode__sp.html#aaec329d1e7f3447660ab719ed95c828f">00131</a>         <span class="keywordtype">int</span> <a class="code" href="classCNode__sp.html#aaec329d1e7f3447660ab719ed95c828f">operator==</a>( T v ) { <span class="keywordflow">return</span> *ptr == v; }
<a name="l00132"></a><a class="code" href="classCNode__sp.html#aa555d73edb9b63581fb95b7525362f8f">00132</a>         <span class="keywordtype">int</span> <a class="code" href="classCNode__sp.html#aa555d73edb9b63581fb95b7525362f8f">operator!=</a>( T v ) { <span class="keywordflow">return</span> *ptr != v; }
<a name="l00133"></a><a class="code" href="classCNode__sp.html#a7202dc878a44eb8e5a97624c22cfd38c">00133</a>         <span class="keywordtype">int</span> <a class="code" href="classCNode__sp.html#a7202dc878a44eb8e5a97624c22cfd38c">operator==</a>( <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a> p ) { <span class="keywordflow">return</span> *ptr == *p.ptr; }
<a name="l00134"></a><a class="code" href="classCNode__sp.html#a24dc662e535eb8c65d3d00c45f3eacd3">00134</a>         <span class="keywordtype">int</span> <a class="code" href="classCNode__sp.html#a24dc662e535eb8c65d3d00c45f3eacd3">operator!=</a>( <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a> p ) { <span class="keywordflow">return</span> *ptr != *p.ptr; }
<a name="l00135"></a>00135 };
<a name="l00136"></a>00136 
<a name="l00141"></a><a class="code" href="structCNode__pr.html">00141</a> <span class="keyword">struct </span><a class="code" href="structCNode__pr.html" title="Helper class for building tail recursive binary CNode trees Used by parser.">CNode_pr</a> {
<a name="l00142"></a><a class="code" href="structCNode__pr.html#a24e945a3e47e1a03082dd887a27337fb">00142</a>         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* <a class="code" href="structCNode__pr.html#a24e945a3e47e1a03082dd887a27337fb">head</a>;
<a name="l00143"></a><a class="code" href="structCNode__pr.html#af6fdb26ae3611d876f530aff13510739">00143</a>         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* <a class="code" href="structCNode__pr.html#af6fdb26ae3611d876f530aff13510739">tail</a>;
<a name="l00144"></a>00144 <span class="keyword">public</span>:
<a name="l00145"></a><a class="code" href="structCNode__pr.html#a3f12971a5e0ce893a527d97b172b2d1d">00145</a>         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* <a class="code" href="structCNode__pr.html#a3f12971a5e0ce893a527d97b172b2d1d">operator=</a>( <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* n ) { <a class="code" href="structCNode__pr.html#a24e945a3e47e1a03082dd887a27337fb">head</a> = n; <a class="code" href="structCNode__pr.html#af6fdb26ae3611d876f530aff13510739">tail</a> = n; <span class="keywordflow">return</span> n; }
<a name="l00146"></a><a class="code" href="structCNode__pr.html#a9cdde4bbe9b0d2ca98bb82681269efe4">00146</a>         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* <a class="code" href="structCNode__pr.html#a9cdde4bbe9b0d2ca98bb82681269efe4">operator-&gt;</a>() { <span class="keywordflow">return</span> <a class="code" href="structCNode__pr.html#a24e945a3e47e1a03082dd887a27337fb">head</a>; }
<a name="l00147"></a><a class="code" href="structCNode__pr.html#a87475acbde4ae457a0a1768996641621">00147</a>         <a class="code" href="structCNode__pr.html#a87475acbde4ae457a0a1768996641621">operator CNode*</a>() { <span class="keywordflow">return</span> <a class="code" href="structCNode__pr.html#a24e945a3e47e1a03082dd887a27337fb">head</a>; }
<a name="l00148"></a><a class="code" href="structCNode__pr.html#a6353696402c2036d9dbd05f398b70f39">00148</a>         <span class="keywordtype">int</span> <a class="code" href="structCNode__pr.html#a6353696402c2036d9dbd05f398b70f39">operator==</a>( <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* v ) { <span class="keywordflow">return</span> <a class="code" href="structCNode__pr.html#a24e945a3e47e1a03082dd887a27337fb">head</a> == v; }
<a name="l00149"></a><a class="code" href="structCNode__pr.html#a1312491c07f0acee5d98b6fff451be7d">00149</a>         <span class="keywordtype">int</span> <a class="code" href="structCNode__pr.html#a1312491c07f0acee5d98b6fff451be7d">operator!=</a>( <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* v ) { <span class="keywordflow">return</span> <a class="code" href="structCNode__pr.html#a24e945a3e47e1a03082dd887a27337fb">head</a> != v; }
<a name="l00150"></a><a class="code" href="structCNode__pr.html#a30115d2b70e8d7ca4393975bae81ec2b">00150</a>         <span class="keywordtype">int</span> <a class="code" href="structCNode__pr.html#a30115d2b70e8d7ca4393975bae81ec2b">operator==</a>( <a class="code" href="structCNode__pr.html" title="Helper class for building tail recursive binary CNode trees Used by parser.">CNode_pr</a> p ) { <span class="keywordflow">return</span> <a class="code" href="structCNode__pr.html#a24e945a3e47e1a03082dd887a27337fb">head</a> == p.<a class="code" href="structCNode__pr.html#a24e945a3e47e1a03082dd887a27337fb">head</a>; }
<a name="l00151"></a><a class="code" href="structCNode__pr.html#ade732d8f4aee1a79d5402daf6f646abe">00151</a>         <span class="keywordtype">int</span> <a class="code" href="structCNode__pr.html#ade732d8f4aee1a79d5402daf6f646abe">operator!=</a>( <a class="code" href="structCNode__pr.html" title="Helper class for building tail recursive binary CNode trees Used by parser.">CNode_pr</a> p ) { <span class="keywordflow">return</span> <a class="code" href="structCNode__pr.html#a24e945a3e47e1a03082dd887a27337fb">head</a> != p.<a class="code" href="structCNode__pr.html#a24e945a3e47e1a03082dd887a27337fb">head</a>; }
<a name="l00152"></a>00152         <span class="keyword">friend</span> <a class="code" href="structCNode__pr.html" title="Helper class for building tail recursive binary CNode trees Used by parser.">CNode_pr</a> <a class="code" href="structCNode__pr.html#adb74632900e9a0cd5f75d7879980bf23">cLINK</a>( <a class="code" href="structCNode__pr.html" title="Helper class for building tail recursive binary CNode trees Used by parser.">CNode_pr</a> pr1, <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* n2 );
<a name="l00153"></a>00153 };
<a name="l00154"></a>00154 
<a name="l00159"></a><a class="code" href="structCNode__triplet.html">00159</a> <span class="keyword">struct </span><a class="code" href="structCNode__triplet.html" title="Helper class for building tail recursive binary CNode trees Used by parser.">CNode_triplet</a> {
<a name="l00160"></a><a class="code" href="structCNode__triplet.html#ae14186b26a6ad9c3a471894b2bcb6db1">00160</a>         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* <a class="code" href="structCNode__triplet.html#ae14186b26a6ad9c3a471894b2bcb6db1">first</a>;
<a name="l00161"></a><a class="code" href="structCNode__triplet.html#afc81d09fa245638792b9eb8c4e827c1e">00161</a>         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* <a class="code" href="structCNode__triplet.html#afc81d09fa245638792b9eb8c4e827c1e">second</a>;
<a name="l00162"></a><a class="code" href="structCNode__triplet.html#a9a499deaccd7ab9ec89c8db46675a7c5">00162</a>         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* <a class="code" href="structCNode__triplet.html#a9a499deaccd7ab9ec89c8db46675a7c5">third</a>;
<a name="l00163"></a>00163 };
<a name="l00164"></a>00164 
<a name="l00165"></a>00165 
<a name="l00186"></a><a class="code" href="classCNode.html">00186</a> <span class="keyword">class </span><a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a> : <span class="keyword">public</span> <a class="code" href="classCObject.html" title="Base class for vrq objects.">CObject</a>
<a name="l00187"></a>00187 {
<a name="l00188"></a>00188 <span class="keyword">private</span>:
<a name="l00189"></a>00189         <span class="keyword">static</span> list&lt;CObstack*&gt; stackList; 
<a name="l00190"></a>00190         <span class="keyword">static</span> <a class="code" href="classCObstack.html" title="Bulk object allocation object.">CObstack</a>         evalHeap; 
<a name="l00191"></a>00191         <span class="keyword">static</span> <a class="code" href="glue_8h.html#a0cb58e7e6f0bad369840a52e54a56ae0" title="Short cut for signed 32 bit integer.">INT32</a>            evalCount; 
<a name="l00192"></a>00192         <span class="keyword">static</span> <a class="code" href="classCObstack.html" title="Bulk object allocation object.">CObstack</a>* stack;     
<a name="l00193"></a>00193         <span class="keyword">static</span> map&lt;CNode*,int&gt; labelCache;  
<a name="l00194"></a>00194         <span class="keyword">static</span> <span class="keywordtype">int</span> labelCacheEnabled;   
<a name="l00195"></a>00195         <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513" title="Parse tree opcodes.">NodeOp_t</a>        op;         
<a name="l00196"></a>00196         <span class="keywordtype">void</span>*           left;       
<a name="l00197"></a>00197         <span class="keywordtype">void</span>*           right;      
<a name="l00198"></a>00198         <a class="code" href="structCoord__t.html" title="Structure to hold file coordinates.">Coord_t</a>         loc;        
<a name="l00199"></a>00199         <a class="code" href="structCoord__t.html" title="Structure to hold file coordinates.">Coord_t</a>         *locp;      
<a name="l00200"></a>00200         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*          attributes; 
<a name="l00201"></a>00201         <span class="comment">/*</span>
<a name="l00202"></a>00202 <span class="comment">         * These decorations are temporary and used</span>
<a name="l00203"></a>00203 <span class="comment">         * by the expression evaluation routines</span>
<a name="l00204"></a>00204 <span class="comment">         */</span>
<a name="l00205"></a>00205         <a class="code" href="cdatatype_8h.html#aff499c00c9873bf3fcf1c46bf2652790" title="Expression node type.">NodeType_t</a>      type;       
<a name="l00206"></a>00206         <a class="code" href="glue_8h.html#a0cb58e7e6f0bad369840a52e54a56ae0" title="Short cut for signed 32 bit integer.">INT32</a>           width;      
<a name="l00207"></a>00207         <span class="keywordtype">int</span>             fixedWidth; 
<a name="l00208"></a>00208 <span class="keyword">private</span>:
<a name="l00209"></a>00209         <span class="keywordtype">int</span>     LabelBits( <span class="keywordtype">int</span> supressErrorMessages = FALSE );
<a name="l00210"></a>00210         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*  FixBits( <a class="code" href="glue_8h.html#a0cb58e7e6f0bad369840a52e54a56ae0" title="Short cut for signed 32 bit integer.">INT32</a> newWidth, <a class="code" href="cdatatype_8h.html#aff499c00c9873bf3fcf1c46bf2652790" title="Expression node type.">NodeType_t</a> newType );
<a name="l00211"></a>00211         <span class="keywordtype">void</span>    _EvalVector( <a class="code" href="classCVector.html" title="Bit vector class for implementing 4 state verilog signed and unsigned arithmetic.">CVector</a>&amp; v );
<a name="l00212"></a>00212         <span class="keywordtype">double</span>  _EvalReal( <span class="keywordtype">void</span> );
<a name="l00213"></a>00213         <span class="keywordtype">void</span> FixedWidth( <span class="keywordtype">int</span> v ) { fixedWidth = v; }
<a name="l00214"></a>00214         <span class="keywordtype">int</span>  FixedWidth() { <span class="keywordflow">return</span> fixedWidth; }
<a name="l00215"></a>00215         <span class="keywordtype">int</span>  ConditionalWiden();
<a name="l00216"></a>00216         <span class="keywordtype">int</span>  WidthFixed();
<a name="l00217"></a>00217         <span class="keywordtype">unsigned</span>  NodeMask();
<a name="l00218"></a>00218         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*  GetNLeft( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> (<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*)left; }
<a name="l00219"></a>00219         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*  GetNRight( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> (<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*)right; }
<a name="l00220"></a>00220         <span class="keyword">static</span> <span class="keywordtype">void</span> _LabelBits( <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* n, <span class="keywordtype">void</span>* arg );
<a name="l00221"></a>00221 <span class="keyword">public</span>:
<a name="l00226"></a><a class="code" href="classCNode.html#ac6e8859a1a0ff907ce428f1d416a3e50">00226</a>         <span class="keyword">static</span> <a class="code" href="classCObstack.html" title="Bulk object allocation object.">CObstack</a>* <a class="code" href="classCNode.html#ac6e8859a1a0ff907ce428f1d416a3e50" title="Gets pointer to current heap allocator.">CurrentHeap</a>() { <span class="keywordflow">return</span> stack; }
<a name="l00236"></a><a class="code" href="classCNode.html#aceb010903a1eed3faf9b624efe39b59f">00236</a>         <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classCNode.html#aceb010903a1eed3faf9b624efe39b59f" title="Use evaluation stack.">UseEvalStack</a>( <span class="keywordtype">void</span> ) {
<a name="l00237"></a>00237                 stackList.push_front( stack );
<a name="l00238"></a>00238                 evalCount++;
<a name="l00239"></a>00239                 stack = &amp;evalHeap;
<a name="l00240"></a>00240         }
<a name="l00245"></a><a class="code" href="classCNode.html#a3cc9d5a6aa558b8329cb74aaca59ee16">00245</a>         <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classCNode.html#a3cc9d5a6aa558b8329cb74aaca59ee16" title="Set heap to a specific heap.">SetBuildStack</a>( <a class="code" href="classCObstack.html" title="Bulk object allocation object.">CObstack</a>* aStack ) {
<a name="l00246"></a>00246                 MASSERT( evalCount == 0 );
<a name="l00247"></a>00247                 stackList.push_front( stack );
<a name="l00248"></a>00248                 stack = aStack;
<a name="l00249"></a>00249         }
<a name="l00253"></a><a class="code" href="classCNode.html#a8e136fbeb5667916489f13eb25857150">00253</a>         <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classCNode.html#a8e136fbeb5667916489f13eb25857150" title="Restore previous heap.">ResetBuildStack</a>( <span class="keywordtype">void</span> ) {
<a name="l00254"></a>00254                 <span class="keywordflow">if</span>( stack == &amp;evalHeap ) {
<a name="l00255"></a>00255                         evalCount--;
<a name="l00256"></a>00256                         <span class="keywordflow">if</span>( evalCount == 0 ) {
<a name="l00257"></a>00257                                 evalHeap.<a class="code" href="classCObstack.html#a7763a15e24a5bd82bc0fd382a1addb06" title="Free all storage including and after object.">Free</a>( NULL );
<a name="l00258"></a>00258                         }
<a name="l00259"></a>00259                 }
<a name="l00260"></a>00260                 <span class="keywordflow">if</span>( stackList.empty() ) {
<a name="l00261"></a>00261                         stack = NULL;
<a name="l00262"></a>00262                 } <span class="keywordflow">else</span> {
<a name="l00263"></a>00263                         stack = *stackList.begin();
<a name="l00264"></a>00264                         stackList.pop_front();
<a name="l00265"></a>00265                 }
<a name="l00266"></a>00266         }
<a name="l00276"></a><a class="code" href="classCNode.html#a00647caded505eb712d2087d552e9c95">00276</a>         <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classCNode.html#a00647caded505eb712d2087d552e9c95" title="Enable cache of labeled nodes to be tracked.">EnableLabelCache</a>()
<a name="l00277"></a>00277         {
<a name="l00278"></a>00278             labelCacheEnabled = 1;
<a name="l00279"></a>00279         }
<a name="l00284"></a><a class="code" href="classCNode.html#a7821d44f84eb78f006d3019d5e9c6bcd">00284</a>         <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classCNode.html#a7821d44f84eb78f006d3019d5e9c6bcd" title="Disable caching of label info (width and type) and clear all accumulated data.">DisableAndClearLabelCache</a>()
<a name="l00285"></a>00285         {
<a name="l00286"></a>00286             labelCacheEnabled = 0;
<a name="l00287"></a>00287             labelCache.erase( labelCache.begin(), labelCache.end() );
<a name="l00288"></a>00288         }
<a name="l00296"></a>00296         <a class="code" href="classCNode.html#ad959ad79c878000832b757937e71a63f" title="Constructor for parse node.">CNode</a>( <a class="code" href="structCoord__t.html" title="Structure to hold file coordinates.">Coord_t</a>* aLoc, <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513" title="Parse tree opcodes.">NodeOp_t</a> aOp ); 
<a name="l00301"></a><a class="code" href="classCNode.html#a4822c9360f069b308f6ed62debb28151">00301</a>         <a class="code" href="structCoord__t.html" title="Structure to hold file coordinates.">Coord_t</a>* <a class="code" href="classCNode.html#a4822c9360f069b308f6ed62debb28151" title="Get node&amp;#39;s file coordinates.">GetCoord</a>() { <span class="keywordflow">return</span> locp; }
<a name="l00306"></a><a class="code" href="classCNode.html#aea4bcc23b1bba68d0a243e729b9da0ce">00306</a>         <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513" title="Parse tree opcodes.">NodeOp_t</a> <a class="code" href="classCNode.html#aea4bcc23b1bba68d0a243e729b9da0ce" title="Return node&amp;#39;s operation type.">GetOp</a>() { <span class="keywordflow">return</span> op; }
<a name="l00313"></a><a class="code" href="classCNode.html#a16b5c099d1ac314ca36121a760f81c88">00313</a>         <span class="keywordtype">void</span> <a class="code" href="classCNode.html#a16b5c099d1ac314ca36121a760f81c88" title="Set node&amp;#39;s operation type.">SetOp</a>( <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513" title="Parse tree opcodes.">NodeOp_t</a> aOp ) { 
<a name="l00314"></a>00314                 <span class="keywordtype">int</span> oldCount = <a class="code" href="classCNode.html#a8112f4008e9237d8cbd78429446c68bb" title="Get the number of operands for the node.">ArgCount</a>();
<a name="l00315"></a>00315                 op = aOp; 
<a name="l00316"></a>00316                 MASSERT( oldCount == <a class="code" href="classCNode.html#a8112f4008e9237d8cbd78429446c68bb" title="Get the number of operands for the node.">ArgCount</a>() );
<a name="l00317"></a>00317         }
<a name="l00323"></a>00323         <span class="keywordtype">unsigned</span> <a class="code" href="classCNode.html#aa033841783882d505e2be1a38ed1a32c" title="Calculate hash of tree.">Hash</a>();
<a name="l00329"></a>00329         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a> <a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>( <span class="keywordtype">int</span> index );
<a name="l00334"></a>00334         <span class="keywordtype">int</span>     <a class="code" href="classCNode.html#a8112f4008e9237d8cbd78429446c68bb" title="Get the number of operands for the node.">ArgCount</a>( <span class="keywordtype">void</span> );
<a name="l00342"></a>00342         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*  <a class="code" href="classCNode.html#a9141bcdb51320383820d0d268c50eb71" title="Replicate tree.">Clone</a>( <a class="code" href="classCObstack.html" title="Bulk object allocation object.">CObstack</a>* heap = stack );
<a name="l00347"></a>00347         <span class="keywordtype">int</span>     <a class="code" href="classCNode.html#a9de9394f1024fcdd68f7ed82609c347e" title="Get the precedence of the operator represented by the node.">Precedence</a>();
<a name="l00354"></a>00354         <span class="keywordtype">void</span>    <a class="code" href="classCNode.html#a474cb6a7eeff6e6182359381c1f5753a" title="Walk tree invoking callback on each node after children have been visited.">PostVisit1</a>( <span class="keywordtype">void</span> (*callback)(<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*,<span class="keywordtype">void</span>*), <span class="keywordtype">void</span>* data );
<a name="l00363"></a>00363         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*  <a class="code" href="classCNode.html#a4302c1d26a33a5a4169b79d30daccd8a" title="Walk tree invoking callback on each node after children have been visited.">PostSubVisit1</a>( <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* (*callback)(<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*,<span class="keywordtype">void</span>*), 
<a name="l00364"></a>00364                                                         <span class="keywordtype">void</span>* data );
<a name="l00372"></a>00372         <span class="keywordtype">void</span>    <a class="code" href="classCNode.html#a99e57d389a0c4042f2b38eb8d2b7f164" title="Walk tree invoking callback on each node before children have been visited.">PreVisit1</a>( <span class="keywordtype">int</span> (*callback)(<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*,<span class="keywordtype">void</span>*), <span class="keywordtype">void</span>* data );
<a name="l00381"></a>00381         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*  <a class="code" href="classCNode.html#a8589a7f9323bb6374cb43219ecfbbd84" title="Create simplified expression tree with given width and type.">Simplify</a>( <a class="code" href="glue_8h.html#a0cb58e7e6f0bad369840a52e54a56ae0" title="Short cut for signed 32 bit integer.">INT32</a> newWidth, <a class="code" href="cdatatype_8h.html#aff499c00c9873bf3fcf1c46bf2652790" title="Expression node type.">NodeType_t</a> newType );
<a name="l00391"></a>00391         <span class="keywordtype">int</span>     <a class="code" href="classCNode.html#a3f3afd2955807122314575a0e4e150ca" title="Checks expression tree to see if expression can result in an X or Z.">IsNonX</a>( <span class="keywordtype">int</span> integerIsNonX = 0, <span class="keywordtype">char</span>* exclude = NULL );
<a name="l00397"></a>00397         <span class="keywordtype">int</span>     <a class="code" href="classCNode.html#a502e4db2e95f5a117c38f87bb5215de5" title="Checks expression tree to see if it is constant.">IsConstant</a>();
<a name="l00407"></a>00407         <span class="keywordtype">int</span>     <a class="code" href="classCNode.html#ad279202102b4f81c9d25ad8727ecc7d9" title="Checks to see if expression tree can be evaluated.">IsEvaluateable</a>();
<a name="l00413"></a>00413         <span class="keywordtype">int</span>     <a class="code" href="classCNode.html#a7ca286cfec44b3a6d9f38bfc1cb780a6" title="Checks to see if expression tree is volatile.">IsVolatile</a>( <span class="keywordtype">void</span> );
<a name="l00418"></a>00418         <a class="code" href="glue_8h.html#a0cb58e7e6f0bad369840a52e54a56ae0" title="Short cut for signed 32 bit integer.">INT32</a>   <a class="code" href="classCNode.html#a4b83e73f220c7487b38a3fba0a1f12f2" title="Evaluates expression tree and returns value as a 32 bit integer.">EvalINT32</a>();
<a name="l00425"></a>00425         <span class="keywordtype">void</span>    <a class="code" href="classCNode.html#a5503573dc2dabfcb88815576831a4a55" title="Evaluates expression tree evaluated in unconstrainted context.">EvalVector</a>( <a class="code" href="classCVector.html" title="Bit vector class for implementing 4 state verilog signed and unsigned arithmetic.">CVector</a>&amp; v );
<a name="l00434"></a>00434         <span class="keywordtype">void</span>    <a class="code" href="classCNode.html#a5503573dc2dabfcb88815576831a4a55" title="Evaluates expression tree evaluated in unconstrainted context.">EvalVector</a>( <a class="code" href="classCVector.html" title="Bit vector class for implementing 4 state verilog signed and unsigned arithmetic.">CVector</a>&amp; v, <a class="code" href="glue_8h.html#a0cb58e7e6f0bad369840a52e54a56ae0" title="Short cut for signed 32 bit integer.">INT32</a> newWidth, <a class="code" href="cdatatype_8h.html#aff499c00c9873bf3fcf1c46bf2652790" title="Expression node type.">NodeType_t</a> newType );
<a name="l00440"></a>00440         <span class="keywordtype">double</span>  <a class="code" href="classCNode.html#a4b059e1817976d9f53bec0898d1d4b3b" title="Evaluates expression tree evaluated in a real context.">EvalReal</a>( <span class="keywordtype">void</span> );
<a name="l00445"></a>00445         <span class="keywordtype">void</span>    <a class="code" href="classCNode.html#a0b468e037caf218454a6a210b98697d2" title="Print a compact representation of the parse tree.">Dump</a>( FILE* f );
<a name="l00451"></a>00451         <span class="keywordtype">int</span>     <a class="code" href="classCNode.html#acc4d0c6b5cea6949754e4ebfcfd14bca" title="Evaluates if expression width is constant.">IsWidthConstant</a>( <span class="keywordtype">void</span> );
<a name="l00457"></a>00457         <span class="keywordtype">int</span>     <a class="code" href="classCNode.html#a4c58242c86884ca9ba9a7244a9a0970c" title="Evaluates if expression width is volatile.">IsWidthVolatile</a>( <span class="keywordtype">void</span> );
<a name="l00467"></a>00467         <span class="keywordtype">int</span>     <a class="code" href="classCNode.html#ab7a798650fb20d393f357b300b60737e" title="Evaluates if expression width can be evaluated.">IsWidthEvaluateable</a>( <span class="keywordtype">void</span> );
<a name="l00472"></a>00472         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*  <a class="code" href="classCNode.html#ac30e190c8020b215eae31d1a1e7353f1" title="Create expression representing width of expression.">GetWidthExp</a>( <span class="keywordtype">void</span> );
<a name="l00478"></a><a class="code" href="classCNode.html#acc0ddc36117388a91352e39e449f6f0e">00478</a>         <a class="code" href="glue_8h.html#a0cb58e7e6f0bad369840a52e54a56ae0" title="Short cut for signed 32 bit integer.">INT32</a>   <a class="code" href="classCNode.html#acc0ddc36117388a91352e39e449f6f0e" title="Evaluate width of expression.">GetWidth</a>( <span class="keywordtype">void</span> ) { LabelBits(TRUE); <span class="keywordflow">return</span> width; }
<a name="l00483"></a><a class="code" href="classCNode.html#abc3c773a01f308a86a2e3b6134c31c61">00483</a>         <span class="keywordtype">int</span>     <a class="code" href="classCNode.html#abc3c773a01f308a86a2e3b6134c31c61" title="Determine if expression is a 1 bit signed or unsigned value.">IsScalar</a>( <span class="keywordtype">void</span> ) { LabelBits(TRUE); <span class="keywordflow">return</span> width==1; }
<a name="l00488"></a><a class="code" href="classCNode.html#a11d5eea07e5095ff6bf5b4f3fee2aea0">00488</a>         <span class="keywordtype">int</span>     <a class="code" href="classCNode.html#a11d5eea07e5095ff6bf5b4f3fee2aea0" title="Determine if expression is a multi-bit signed or unsigned value.">IsVector</a>( <span class="keywordtype">void</span> ) { LabelBits(TRUE); <span class="keywordflow">return</span> width&gt;1; }
<a name="l00493"></a><a class="code" href="classCNode.html#a24ad7d7060bfa89e16c1b5ea751dcc2a">00493</a>         <span class="keywordtype">int</span>     <a class="code" href="classCNode.html#a24ad7d7060bfa89e16c1b5ea751dcc2a" title="Determine if expression is real.">IsReal</a>( <span class="keywordtype">void</span> ) { LabelBits(TRUE); <span class="keywordflow">return</span> type==eR; }
<a name="l00498"></a><a class="code" href="classCNode.html#ad70eb3f37a5aa3c4459765bff21a6c8e">00498</a>         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*  <a class="code" href="classCNode.html#ad70eb3f37a5aa3c4459765bff21a6c8e" title="Get attributes attached to operation.">GetAttributes</a>() { <span class="keywordflow">return</span> attributes; }
<a name="l00503"></a><a class="code" href="classCNode.html#a913e3feeeb243fc89f7fe30ba9ef1bad">00503</a>         <span class="keywordtype">void</span>    <a class="code" href="classCNode.html#a913e3feeeb243fc89f7fe30ba9ef1bad" title="Attach attributes to operation.">SetAttributes</a>( <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* attr ) { attributes = attr; }
<a name="l00511"></a>00511         <span class="keywordtype">int</span>   <a class="code" href="classCNode.html#ae60a066d098bcecb904c436aa514f99e" title="Determine if node has the given attribute.">HasAttribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* n=NULL, <span class="keywordtype">int</span> init = 1 );
<a name="l00519"></a>00519         <a class="code" href="classCAttr.html" title="Declaration object for holding lists of verilog attributes and their corresponding expressions...">CAttr</a>* <a class="code" href="classCNode.html#ab64a772f477c5970a5ad6cc806f87174" title="Get attribute attached to node with the given attribute.">GetAttribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* n=NULL, <span class="keywordtype">int</span> init = 1 );
<a name="l00524"></a><a class="code" href="classCNode.html#a04082f01000bc79c004e063d77841755">00524</a>         <a class="code" href="cdatatype_8h.html#aff499c00c9873bf3fcf1c46bf2652790" title="Expression node type.">NodeType_t</a> <a class="code" href="classCNode.html#a04082f01000bc79c004e063d77841755" title="Get node expression type.">GetNodeType</a>( <span class="keywordtype">void</span> ) { LabelBits(TRUE); <span class="keywordflow">return</span> type; }
<a name="l00525"></a>00525 };
<a name="l00526"></a>00526 
<a name="l00527"></a>00527 
<a name="l00528"></a>00528 <span class="comment">/************************************************</span>
<a name="l00529"></a>00529 <span class="comment">        Arg&lt;CNode*&gt;     </span>
<a name="l00530"></a>00530 <span class="comment">        - returns CNode smart pointer to arg by index</span>
<a name="l00531"></a>00531 <span class="comment"> ***********************************************/</span>
<a name="l00532"></a>00532 
<a name="l00533"></a><a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135">00533</a> <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a> <a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">CNode::Arg</a>(<span class="keywordtype">int</span> index) 
<a name="l00534"></a>00534 {
<a name="l00535"></a>00535         <span class="keywordflow">switch</span>( <a class="code" href="classCNode.html#a8112f4008e9237d8cbd78429446c68bb" title="Get the number of operands for the node.">ArgCount</a>() ) {
<a name="l00536"></a>00536         <span class="keywordflow">case</span> 1:
<a name="l00537"></a>00537                 <span class="keywordflow">switch</span>( index ) {
<a name="l00538"></a>00538                 <span class="keywordflow">case</span> 0:
<a name="l00539"></a>00539                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;left);              
<a name="l00540"></a>00540                 <span class="keywordflow">default</span>:
<a name="l00541"></a>00541                         MASSERT( FALSE );
<a name="l00542"></a>00542                         <span class="keywordflow">return</span> NULL;
<a name="l00543"></a>00543                 } 
<a name="l00544"></a>00544         <span class="keywordflow">case</span> 2:
<a name="l00545"></a>00545                 <span class="keywordflow">switch</span>( index ) {
<a name="l00546"></a>00546                 <span class="keywordflow">case</span> 0:
<a name="l00547"></a>00547                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;left);              
<a name="l00548"></a>00548                 <span class="keywordflow">case</span> 1:
<a name="l00549"></a>00549                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;right);             
<a name="l00550"></a>00550                 <span class="keywordflow">default</span>:
<a name="l00551"></a>00551                         MASSERT( FALSE );
<a name="l00552"></a>00552                         <span class="keywordflow">return</span> NULL;
<a name="l00553"></a>00553                 } 
<a name="l00554"></a>00554         <span class="keywordflow">case</span> 3:
<a name="l00555"></a>00555                 <span class="keywordflow">switch</span>( index ) {
<a name="l00556"></a>00556                 <span class="keywordflow">case</span> 0:
<a name="l00557"></a>00557                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNLeft()-&gt;left);          
<a name="l00558"></a>00558                 <span class="keywordflow">case</span> 1:
<a name="l00559"></a>00559                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNLeft()-&gt;right);         
<a name="l00560"></a>00560                 <span class="keywordflow">case</span> 2:
<a name="l00561"></a>00561                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;right);             
<a name="l00562"></a>00562                 <span class="keywordflow">default</span>:
<a name="l00563"></a>00563                         MASSERT( FALSE );
<a name="l00564"></a>00564                         <span class="keywordflow">return</span> NULL;
<a name="l00565"></a>00565                 } 
<a name="l00566"></a>00566         <span class="keywordflow">case</span> 4:
<a name="l00567"></a>00567                 <span class="keywordflow">switch</span>( index ) {
<a name="l00568"></a>00568                 <span class="keywordflow">case</span> 0:
<a name="l00569"></a>00569                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNLeft()-&gt;left);          
<a name="l00570"></a>00570                 <span class="keywordflow">case</span> 1:
<a name="l00571"></a>00571                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNLeft()-&gt;right);         
<a name="l00572"></a>00572                 <span class="keywordflow">case</span> 2:
<a name="l00573"></a>00573                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNRight()-&gt;left);         
<a name="l00574"></a>00574                 <span class="keywordflow">case</span> 3:
<a name="l00575"></a>00575                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNRight()-&gt;right);                
<a name="l00576"></a>00576                 <span class="keywordflow">default</span>:
<a name="l00577"></a>00577                         MASSERT( FALSE );
<a name="l00578"></a>00578                         <span class="keywordflow">return</span> NULL;
<a name="l00579"></a>00579                 } 
<a name="l00580"></a>00580         <span class="keywordflow">case</span> 5:
<a name="l00581"></a>00581                 <span class="keywordflow">switch</span>( index ) {
<a name="l00582"></a>00582                 <span class="keywordflow">case</span> 0:
<a name="l00583"></a>00583                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNLeft()-&gt;GetNLeft()-&gt;left);              
<a name="l00584"></a>00584                 <span class="keywordflow">case</span> 1:
<a name="l00585"></a>00585                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNLeft()-&gt;GetNLeft()-&gt;right);             
<a name="l00586"></a>00586                 <span class="keywordflow">case</span> 2:
<a name="l00587"></a>00587                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNLeft()-&gt;right);         
<a name="l00588"></a>00588                 <span class="keywordflow">case</span> 3:
<a name="l00589"></a>00589                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNRight()-&gt;left);         
<a name="l00590"></a>00590                 <span class="keywordflow">case</span> 4:
<a name="l00591"></a>00591                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNRight()-&gt;right);                
<a name="l00592"></a>00592                 <span class="keywordflow">default</span>:
<a name="l00593"></a>00593                         MASSERT( FALSE );
<a name="l00594"></a>00594                         <span class="keywordflow">return</span> NULL;
<a name="l00595"></a>00595                 } 
<a name="l00596"></a>00596         <span class="keywordflow">case</span> 6:
<a name="l00597"></a>00597                 <span class="keywordflow">switch</span>( index ) {
<a name="l00598"></a>00598                 <span class="keywordflow">case</span> 0:
<a name="l00599"></a>00599                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNLeft()-&gt;GetNLeft()-&gt;left);              
<a name="l00600"></a>00600                 <span class="keywordflow">case</span> 1:
<a name="l00601"></a>00601                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNLeft()-&gt;GetNLeft()-&gt;right);             
<a name="l00602"></a>00602                 <span class="keywordflow">case</span> 2:
<a name="l00603"></a>00603                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNLeft()-&gt;GetNRight()-&gt;left);             
<a name="l00604"></a>00604                 <span class="keywordflow">case</span> 3:
<a name="l00605"></a>00605                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNLeft()-&gt;GetNRight()-&gt;right);            
<a name="l00606"></a>00606                 <span class="keywordflow">case</span> 4:
<a name="l00607"></a>00607                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNRight()-&gt;left);         
<a name="l00608"></a>00608                 <span class="keywordflow">case</span> 5:
<a name="l00609"></a>00609                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNRight()-&gt;right);                
<a name="l00610"></a>00610                 <span class="keywordflow">default</span>:
<a name="l00611"></a>00611                         MASSERT( FALSE );
<a name="l00612"></a>00612                         <span class="keywordflow">return</span> NULL;
<a name="l00613"></a>00613                 } 
<a name="l00614"></a>00614         <span class="keywordflow">case</span> 7:
<a name="l00615"></a>00615                 <span class="keywordflow">switch</span>( index ) {
<a name="l00616"></a>00616                 <span class="keywordflow">case</span> 0:
<a name="l00617"></a>00617                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNLeft()-&gt;GetNLeft()-&gt;left);              
<a name="l00618"></a>00618                 <span class="keywordflow">case</span> 1:
<a name="l00619"></a>00619                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNLeft()-&gt;GetNLeft()-&gt;right);             
<a name="l00620"></a>00620                 <span class="keywordflow">case</span> 2:
<a name="l00621"></a>00621                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNLeft()-&gt;GetNRight()-&gt;left);             
<a name="l00622"></a>00622                 <span class="keywordflow">case</span> 3:
<a name="l00623"></a>00623                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNLeft()-&gt;GetNRight()-&gt;right);            
<a name="l00624"></a>00624                 <span class="keywordflow">case</span> 4:
<a name="l00625"></a>00625                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNRight()-&gt;GetNLeft()-&gt;left);             
<a name="l00626"></a>00626                 <span class="keywordflow">case</span> 5:
<a name="l00627"></a>00627                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNRight()-&gt;GetNLeft()-&gt;right);            
<a name="l00628"></a>00628                 <span class="keywordflow">case</span> 6:
<a name="l00629"></a>00629                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNRight()-&gt;right);                
<a name="l00630"></a>00630                 <span class="keywordflow">default</span>:
<a name="l00631"></a>00631                         MASSERT( FALSE );
<a name="l00632"></a>00632                         <span class="keywordflow">return</span> NULL;
<a name="l00633"></a>00633                 } 
<a name="l00634"></a>00634         <span class="keywordflow">case</span> 8:
<a name="l00635"></a>00635                 <span class="keywordflow">switch</span>( index ) {
<a name="l00636"></a>00636                 <span class="keywordflow">case</span> 0:
<a name="l00637"></a>00637                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNLeft()-&gt;GetNLeft()-&gt;left);              
<a name="l00638"></a>00638                 <span class="keywordflow">case</span> 1:
<a name="l00639"></a>00639                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNLeft()-&gt;GetNLeft()-&gt;right);             
<a name="l00640"></a>00640                 <span class="keywordflow">case</span> 2:
<a name="l00641"></a>00641                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNLeft()-&gt;GetNRight()-&gt;left);             
<a name="l00642"></a>00642                 <span class="keywordflow">case</span> 3:
<a name="l00643"></a>00643                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNLeft()-&gt;GetNRight()-&gt;right);            
<a name="l00644"></a>00644                 <span class="keywordflow">case</span> 4:
<a name="l00645"></a>00645                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNRight()-&gt;GetNLeft()-&gt;left);             
<a name="l00646"></a>00646                 <span class="keywordflow">case</span> 5:
<a name="l00647"></a>00647                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNRight()-&gt;GetNLeft()-&gt;right);            
<a name="l00648"></a>00648                 <span class="keywordflow">case</span> 6:
<a name="l00649"></a>00649                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNRight()-&gt;GetNRight()-&gt;left);            
<a name="l00650"></a>00650                 <span class="keywordflow">case</span> 7:
<a name="l00651"></a>00651                         <span class="keywordflow">return</span> <a class="code" href="classCNode__sp.html" title="Smart pointer for CNode class Creates safe references to CNode arguments Supports assignment...">CNode_sp&lt;T&gt;</a>(&amp;GetNRight()-&gt;GetNRight()-&gt;right);           
<a name="l00652"></a>00652                 <span class="keywordflow">default</span>:
<a name="l00653"></a>00653                         MASSERT( FALSE );
<a name="l00654"></a>00654                         <span class="keywordflow">return</span> NULL;
<a name="l00655"></a>00655                 } 
<a name="l00656"></a>00656                 
<a name="l00657"></a>00657         <span class="keywordflow">default</span>:
<a name="l00658"></a>00658                 MASSERT( FALSE );               
<a name="l00659"></a>00659         }
<a name="l00660"></a>00660 }
<a name="l00661"></a>00661 <span class="keywordtype">int</span> <a class="code" href="cnode_8h.html#a1a1d6f964063fc8f09e489e9c5565b93">Equivalent</a>( <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* a, <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* b );
<a name="l00662"></a>00662 <span class="comment">/******************************************************</span>
<a name="l00663"></a>00663 <span class="comment">  real operation routines</span>
<a name="l00664"></a>00664 <span class="comment"> ******************************************************/</span>
<a name="l00665"></a>00665 
<a name="l00666"></a><a class="code" href="cnode_8h.html#aa36924ee5bc5b3102a9e0fefb9c910af">00666</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="cnode_8h.html#aa36924ee5bc5b3102a9e0fefb9c910af">Add</a>( <span class="keywordtype">double</span>* r, <span class="keywordtype">double</span>* a, <span class="keywordtype">double</span>* b )
<a name="l00667"></a>00667 {
<a name="l00668"></a>00668         *r = *a + *b;
<a name="l00669"></a>00669 }
<a name="l00670"></a>00670 
<a name="l00671"></a><a class="code" href="cnode_8h.html#a8b9b0f83482201fd71ae7d0a03277d0e">00671</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="cnode_8h.html#a8b9b0f83482201fd71ae7d0a03277d0e">Sub</a>( <span class="keywordtype">double</span>* r, <span class="keywordtype">double</span>* a, <span class="keywordtype">double</span>* b )
<a name="l00672"></a>00672 {
<a name="l00673"></a>00673         *r = *a - *b;
<a name="l00674"></a>00674 }
<a name="l00675"></a>00675 
<a name="l00676"></a><a class="code" href="cnode_8h.html#a775bed8a29aa227cd06e2444500621f7">00676</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="cnode_8h.html#a775bed8a29aa227cd06e2444500621f7">Mul</a>( <span class="keywordtype">double</span>* r, <span class="keywordtype">double</span>* a, <span class="keywordtype">double</span>* b )
<a name="l00677"></a>00677 {
<a name="l00678"></a>00678         *r = *a * *b;
<a name="l00679"></a>00679 }
<a name="l00680"></a>00680 
<a name="l00681"></a><a class="code" href="cnode_8h.html#ac7b57eaafd8f2e8712dd89fe61674c3b">00681</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="cnode_8h.html#ac7b57eaafd8f2e8712dd89fe61674c3b">Div</a>( <span class="keywordtype">double</span>* r, <span class="keywordtype">double</span>* a, <span class="keywordtype">double</span>* b )
<a name="l00682"></a>00682 {
<a name="l00683"></a>00683         *r = *a / *b;
<a name="l00684"></a>00684 }
<a name="l00685"></a>00685 
<a name="l00686"></a><a class="code" href="cnode_8h.html#a8f34adc7b597143cb6cf8aed59dcd337">00686</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="cnode_8h.html#a8f34adc7b597143cb6cf8aed59dcd337">Neg</a>( <span class="keywordtype">double</span>* r, <span class="keywordtype">double</span>* a )
<a name="l00687"></a>00687 {
<a name="l00688"></a>00688         *r = - *a; 
<a name="l00689"></a>00689 }
<a name="l00690"></a>00690 
<a name="l00691"></a><a class="code" href="cnode_8h.html#ae2d7f70032d876d9ad3e479954422a4e">00691</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="cnode_8h.html#ae2d7f70032d876d9ad3e479954422a4e">Plus</a>( <span class="keywordtype">double</span>* r, <span class="keywordtype">double</span>* a )
<a name="l00692"></a>00692 {
<a name="l00693"></a>00693         *r = *a; 
<a name="l00694"></a>00694 }
<a name="l00695"></a>00695 
<a name="l00696"></a><a class="code" href="cnode_8h.html#a8244e2d6ac60db51a301f972620c8e98">00696</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="cnode_8h.html#a8244e2d6ac60db51a301f972620c8e98">Pow</a>( <span class="keywordtype">double</span>* r, <span class="keywordtype">double</span>* a, <span class="keywordtype">double</span>* b )
<a name="l00697"></a>00697 {
<a name="l00698"></a>00698         *r = pow(*a,*b);
<a name="l00699"></a>00699 }
<a name="l00700"></a>00700 
<a name="l00701"></a>00701 
<a name="l00702"></a>00702 <span class="comment">/*****************************************************</span>
<a name="l00703"></a>00703 <span class="comment"> * Create stubs for illegal operations</span>
<a name="l00704"></a>00704 <span class="comment"> ****************************************************/</span>
<a name="l00705"></a>00705 <span class="preprocessor">#define ILLEGAL_OP2(op) \</span>
<a name="l00706"></a>00706 <span class="preprocessor">inline void op( double*, double*, double* )\</span>
<a name="l00707"></a>00707 <span class="preprocessor">{ fatal( NULL, #op &quot; is illegal for reals&quot; ); }</span>
<a name="l00708"></a>00708 <span class="preprocessor"></span>
<a name="l00709"></a>00709 <span class="preprocessor">#define ILLEGAL_OP1(op) \</span>
<a name="l00710"></a>00710 <span class="preprocessor">inline void op( double*, double* )\</span>
<a name="l00711"></a>00711 <span class="preprocessor">{ fatal( NULL, #op &quot; is illegal for reals&quot; ); }</span>
<a name="l00712"></a>00712 <span class="preprocessor"></span>
<a name="l00713"></a>00713 <a class="code" href="cnode_8h.html#ab3ab4ec79b158cc90744ae929a50f08d">ILLEGAL_OP2</a>(Rsh);
<a name="l00714"></a>00714 <a class="code" href="cnode_8h.html#ab3ab4ec79b158cc90744ae929a50f08d">ILLEGAL_OP2</a>(Lsh);
<a name="l00715"></a>00715 
<a name="l00716"></a>00716 <a class="code" href="cnode_8h.html#ab3ab4ec79b158cc90744ae929a50f08d">ILLEGAL_OP2</a>(Rep);
<a name="l00717"></a>00717 <a class="code" href="cnode_8h.html#ab3ab4ec79b158cc90744ae929a50f08d">ILLEGAL_OP2</a>(Mod);
<a name="l00718"></a>00718 <a class="code" href="cnode_8h.html#ab3ab4ec79b158cc90744ae929a50f08d">ILLEGAL_OP2</a>(And);
<a name="l00719"></a>00719 <a class="code" href="cnode_8h.html#ab3ab4ec79b158cc90744ae929a50f08d">ILLEGAL_OP2</a>(Xor);
<a name="l00720"></a>00720 <a class="code" href="cnode_8h.html#ab3ab4ec79b158cc90744ae929a50f08d">ILLEGAL_OP2</a>(Xnor);
<a name="l00721"></a>00721 <a class="code" href="cnode_8h.html#ab3ab4ec79b158cc90744ae929a50f08d">ILLEGAL_OP2</a>(Or);
<a name="l00722"></a>00722 <a class="code" href="cnode_8h.html#ab3ab4ec79b158cc90744ae929a50f08d">ILLEGAL_OP2</a>(Lor);
<a name="l00723"></a>00723 <a class="code" href="cnode_8h.html#ab3ab4ec79b158cc90744ae929a50f08d">ILLEGAL_OP2</a>(Land);
<a name="l00724"></a>00724 <a class="code" href="cnode_8h.html#a3a5876ee5cb6b2c605d167bcabf58f0c">ILLEGAL_OP1</a>(Com);
<a name="l00725"></a>00725 <a class="code" href="cnode_8h.html#a3a5876ee5cb6b2c605d167bcabf58f0c">ILLEGAL_OP1</a>(Rand);
<a name="l00726"></a>00726 <a class="code" href="cnode_8h.html#a3a5876ee5cb6b2c605d167bcabf58f0c">ILLEGAL_OP1</a>(Rnand);
<a name="l00727"></a>00727 <a class="code" href="cnode_8h.html#a3a5876ee5cb6b2c605d167bcabf58f0c">ILLEGAL_OP1</a>(Ror);
<a name="l00728"></a>00728 <a class="code" href="cnode_8h.html#a3a5876ee5cb6b2c605d167bcabf58f0c">ILLEGAL_OP1</a>(Rnor);
<a name="l00729"></a>00729 <a class="code" href="cnode_8h.html#a3a5876ee5cb6b2c605d167bcabf58f0c">ILLEGAL_OP1</a>(Rxor);
<a name="l00730"></a>00730 <a class="code" href="cnode_8h.html#a3a5876ee5cb6b2c605d167bcabf58f0c">ILLEGAL_OP1</a>(Rxnor);
<a name="l00731"></a>00731 
<a name="l00732"></a>00732 <span class="preprocessor">#define DEFINE_CONSTRUCTOR</span>
<a name="l00733"></a>00733 <span class="preprocessor"></span><span class="preprocessor">#include &quot;<a class="code" href="cnode__def_8h.html" title="Definitions for parse tree nodes.">cnode_def.h</a>&quot;</span>
<a name="l00734"></a>00734 <span class="preprocessor">#undef DEFINE_CONSTRUCTOR</span>
<a name="l00735"></a>00735 <span class="preprocessor"></span>
<a name="l00736"></a>00736 <span class="comment">/****************************************************</span>
<a name="l00737"></a>00737 <span class="comment">        Node building helper routines</span>
<a name="l00738"></a>00738 <span class="comment">*****************************************************/</span>
<a name="l00739"></a>00739 
<a name="l00746"></a><a class="code" href="group__node__constructors.html#ga068de0b6574048fa5e98714af5bc5bb9">00746</a> <span class="keyword">inline</span> <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*   <a class="code" href="group__node__constructors.html#ga068de0b6574048fa5e98714af5bc5bb9" title="Short cut for creating VCONSTANT node with a given vector value.">cVECTOR</a>( <a class="code" href="classCVector.html" title="Bit vector class for implementing 4 state verilog signed and unsigned arithmetic.">CVector</a>&amp; vec ) 
<a name="l00747"></a>00747 {
<a name="l00748"></a>00748         <a class="code" href="classCVector.html" title="Bit vector class for implementing 4 state verilog signed and unsigned arithmetic.">CVector</a>* v = <a class="code" href="classCVector.html#a381ec54a1446d581e81b3c4b65347915" title="Create vector allocating all storage from given heap.">CVector::AllocFromHeap</a>( <a class="code" href="classCNode.html#ac6e8859a1a0ff907ce428f1d416a3e50" title="Gets pointer to current heap allocator.">CNode::CurrentHeap</a>(), vec.<a class="code" href="classCVector.html#aad5dd1c7f2d819694e4e59101f68b3b4" title="Get vector bit width.">GetWidth</a>() );
<a name="l00749"></a>00749         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* n;
<a name="l00750"></a>00750         *v = vec;
<a name="l00751"></a>00751         v-&gt;<a class="code" href="classCVector.html#a949419bc0ed97b6dec80742c9f0addd1" title="Set preferred base for printing value.">SetPreferredBase</a>( vec.<a class="code" href="classCVector.html#aea371ed98ce8941208c0704ecc1c1179" title="Get preferred base for printing value.">GetPreferredBase</a>() );
<a name="l00752"></a>00752         n = <span class="keyword">new</span>(<a class="code" href="classCNode.html#ac6e8859a1a0ff907ce428f1d416a3e50" title="Gets pointer to current heap allocator.">CNode::CurrentHeap</a>()) <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>( NULL, <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513a83b96207e0c46251df7e03aa4f636215" title="vector constant">eVCONSTANT</a> );
<a name="l00753"></a>00753         n-&gt;Arg&lt;<a class="code" href="classCVector.html" title="Bit vector class for implementing 4 state verilog signed and unsigned arithmetic.">CVector</a>*&gt;(0) = v;
<a name="l00754"></a>00754         <span class="keywordflow">return</span> n;
<a name="l00755"></a>00755 }
<a name="l00756"></a>00756 
<a name="l00763"></a><a class="code" href="group__node__constructors.html#gaa1852f623365f7ecd10ad9c853682436">00763</a> <span class="keyword">inline</span> <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*   <a class="code" href="group__node__constructors.html#gaa1852f623365f7ecd10ad9c853682436" title="Short cut for creating VCONSTANT node with a given string value.">cSTRING</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* s ) 
<a name="l00764"></a>00764 {
<a name="l00765"></a>00765         <span class="keywordtype">int</span> len = strlen( s );
<a name="l00766"></a>00766         <span class="keywordflow">if</span>( !len ) {
<a name="l00767"></a>00767              len = 1;
<a name="l00768"></a>00768         }
<a name="l00769"></a>00769         <a class="code" href="classCVector.html" title="Bit vector class for implementing 4 state verilog signed and unsigned arithmetic.">CVector</a>* v = <a class="code" href="classCVector.html#a381ec54a1446d581e81b3c4b65347915" title="Create vector allocating all storage from given heap.">CVector::AllocFromHeap</a>( <a class="code" href="classCNode.html#ac6e8859a1a0ff907ce428f1d416a3e50" title="Gets pointer to current heap allocator.">CNode::CurrentHeap</a>(), len*8 );
<a name="l00770"></a>00770         v-&gt;<a class="code" href="classCVector.html#a917edd9dc234b92be36a5ecaadc340c3" title="Load string value from string.">LoadString</a>( s );
<a name="l00771"></a>00771         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* n = <span class="keyword">new</span>(<a class="code" href="classCNode.html#ac6e8859a1a0ff907ce428f1d416a3e50" title="Gets pointer to current heap allocator.">CNode::CurrentHeap</a>()) <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>( NULL, <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513a83b96207e0c46251df7e03aa4f636215" title="vector constant">eVCONSTANT</a> );
<a name="l00772"></a>00772         n-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCVector.html" title="Bit vector class for implementing 4 state verilog signed and unsigned arithmetic.">CVector</a>*&gt;(0) = v;
<a name="l00773"></a>00773         <span class="keywordflow">return</span> n;
<a name="l00774"></a>00774 }
<a name="l00775"></a>00775 
<a name="l00782"></a><a class="code" href="group__node__constructors.html#ga63fd75b2bd53df304201c6eb0bccc10c">00782</a> <span class="keyword">inline</span> <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*   <a class="code" href="group__node__constructors.html#ga63fd75b2bd53df304201c6eb0bccc10c" title="Short cut for creating VCONSTANT node with a given integer value.">cINT32</a>( <a class="code" href="glue_8h.html#a0cb58e7e6f0bad369840a52e54a56ae0" title="Short cut for signed 32 bit integer.">INT32</a> i ) 
<a name="l00783"></a>00783 {
<a name="l00784"></a>00784         <a class="code" href="classCVector.html" title="Bit vector class for implementing 4 state verilog signed and unsigned arithmetic.">CVector</a>* v = <a class="code" href="classCVector.html#a381ec54a1446d581e81b3c4b65347915" title="Create vector allocating all storage from given heap.">CVector::AllocFromHeap</a>( <a class="code" href="classCNode.html#ac6e8859a1a0ff907ce428f1d416a3e50" title="Gets pointer to current heap allocator.">CNode::CurrentHeap</a>(), 32 );
<a name="l00785"></a>00785         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* n;
<a name="l00786"></a>00786         *v = i;
<a name="l00787"></a>00787         v-&gt;<a class="code" href="classCVector.html#aa8cb2798f2245ab831b41907aaae4fa6" title="Get sized attribute.">Sized</a>(FALSE);
<a name="l00788"></a>00788         v-&gt;<a class="code" href="classCVector.html#ab06adf2ea848fd8b026059bccf469d74" title="Get signed attribute.">Signed</a>(TRUE);
<a name="l00789"></a>00789         v-&gt;<a class="code" href="classCVector.html#a19c69a84aebf15902cacff286ea2d591" title="Get based attribute.">Based</a>(FALSE);
<a name="l00790"></a>00790         n = <span class="keyword">new</span>(<a class="code" href="classCNode.html#ac6e8859a1a0ff907ce428f1d416a3e50" title="Gets pointer to current heap allocator.">CNode::CurrentHeap</a>()) <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>( NULL, <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513a83b96207e0c46251df7e03aa4f636215" title="vector constant">eVCONSTANT</a> );
<a name="l00791"></a>00791         n-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCVector.html" title="Bit vector class for implementing 4 state verilog signed and unsigned arithmetic.">CVector</a>*&gt;(0) = v;
<a name="l00792"></a>00792         <span class="keywordflow">return</span> n;
<a name="l00793"></a>00793 }
<a name="l00794"></a>00794 
<a name="l00801"></a><a class="code" href="group__node__constructors.html#gaf433cf9ad1e89edf474954736a9538e1">00801</a> <span class="keyword">inline</span> <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* <a class="code" href="group__node__constructors.html#gaf433cf9ad1e89edf474954736a9538e1" title="Short cut for creating RCONSTANT node with a given double value.">cREAL</a>( <span class="keywordtype">double</span> number ) 
<a name="l00802"></a>00802 {
<a name="l00803"></a>00803     <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* node = <span class="keyword">new</span>(<a class="code" href="classCNode.html#ac6e8859a1a0ff907ce428f1d416a3e50" title="Gets pointer to current heap allocator.">CNode::CurrentHeap</a>()) <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>( NULL, <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513a61a92007fde65202b2ff406abf2a179f" title="real constant">eRCONSTANT</a> );
<a name="l00804"></a>00804     node-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<span class="keywordtype">char</span>*&gt;(0) = <a class="code" href="group__utilities.html#gadba73693074d75c740c6a68704ba71f0" title="Convert double to char string allocating storage on given heap.">d2s</a>(number,<a class="code" href="classCNode.html#ac6e8859a1a0ff907ce428f1d416a3e50" title="Gets pointer to current heap allocator.">CNode::CurrentHeap</a>());
<a name="l00805"></a>00805     <span class="keywordflow">return</span> node;
<a name="l00806"></a>00806 }
<a name="l00807"></a>00807 
<a name="l00815"></a><a class="code" href="group__node__constructors.html#ga655654ba7add955e54e68a4930a58217">00815</a> <span class="keyword">inline</span> <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*   <a class="code" href="group__node__constructors.html#ga655654ba7add955e54e68a4930a58217" title="Link together two nodes with an ELIST operator.">cELINK</a>( <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* n1, <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* n2 )
<a name="l00816"></a>00816 {
<a name="l00817"></a>00817         <span class="keywordflow">if</span>( n1 == NULL ) {
<a name="l00818"></a>00818                 <span class="keywordflow">return</span> n2;
<a name="l00819"></a>00819         } <span class="keywordflow">else</span> <span class="keywordflow">if</span>( n2 == NULL ) {
<a name="l00820"></a>00820                 <span class="keywordflow">return</span> n1;
<a name="l00821"></a>00821         }
<a name="l00822"></a>00822         <span class="keywordflow">return</span> <a class="code" href="group__node__constructors.html#gae03f6ff900765ba554767056740172bd" title="Node construction shortcut for ELIST expression list.">cELIST</a>( n1, n2 );
<a name="l00823"></a>00823 }
<a name="l00824"></a>00824 
<a name="l00832"></a><a class="code" href="group__node__constructors.html#ga0222b6091fb2fa22cabf39a623a37009">00832</a> <span class="keyword">inline</span> <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*   <a class="code" href="group__node__constructors.html#ga0222b6091fb2fa22cabf39a623a37009" title="Short cut for creating an subtree that calculates the absolute value of an expression.">cABS</a>( <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* a ) 
<a name="l00833"></a>00833 {
<a name="l00834"></a>00834         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* a1 = a-&gt;<a class="code" href="classCNode.html#a9141bcdb51320383820d0d268c50eb71" title="Replicate tree.">Clone</a>();
<a name="l00835"></a>00835         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* a2 = a-&gt;<a class="code" href="classCNode.html#a9141bcdb51320383820d0d268c50eb71" title="Replicate tree.">Clone</a>();
<a name="l00836"></a>00836         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* c = <a class="code" href="group__node__constructors.html#ga49efee3e8c5758f3aa3fd42b032331ab" title="Node construction shortcut for GE greater than or equal.">cGE</a>(a,<a class="code" href="group__node__constructors.html#ga63fd75b2bd53df304201c6eb0bccc10c" title="Short cut for creating VCONSTANT node with a given integer value.">cINT32</a>(0));
<a name="l00837"></a>00837         <span class="keywordflow">return</span> <a class="code" href="group__node__constructors.html#ga815dc804468daf726f31eca348338a2e" title="Node construction shortcut for HOOK condition expression operator.">cHOOK</a>( c, a1, <a class="code" href="group__node__constructors.html#gacf1c129f71fa0de70daabab7e888cbc0" title="Node construction shortcut for NEG negation.">cNEG</a>( a2) );
<a name="l00838"></a>00838 }
<a name="l00839"></a>00839 
<a name="l00848"></a><a class="code" href="group__node__constructors.html#gac79c10da1936efee9a2cf3183643e2e1">00848</a> <span class="keyword">inline</span> <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*   <a class="code" href="group__node__constructors.html#gac79c10da1936efee9a2cf3183643e2e1" title="Short cut for creating an subtree that calculates the absolute difference between two expressions...">cABSDIFF</a>( <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* a, <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* b ) 
<a name="l00849"></a>00849 {
<a name="l00850"></a>00850         <span class="keywordflow">return</span> <a class="code" href="group__node__constructors.html#ga0222b6091fb2fa22cabf39a623a37009" title="Short cut for creating an subtree that calculates the absolute value of an expression.">cABS</a>( <a class="code" href="group__node__constructors.html#ga3c6e4399f0a4f022db88fe341cc33fc9" title="Node construction shortcut for SUB subtract.">cSUB</a>( a, b ) );
<a name="l00851"></a>00851 }
<a name="l00852"></a>00852 
<a name="l00861"></a><a class="code" href="group__node__constructors.html#ga42eb3c612a8dc800c6845467136df71e">00861</a> <span class="keyword">inline</span> <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*   <a class="code" href="group__node__constructors.html#ga42eb3c612a8dc800c6845467136df71e" title="Short cut for linking together to nodes with a LIST operator.">cLINK</a>( <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* n1, <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* n2 )
<a name="l00862"></a>00862 {
<a name="l00863"></a>00863         <span class="keywordflow">if</span>( n1 == NULL ) {
<a name="l00864"></a>00864                 <span class="keywordflow">return</span> n2;
<a name="l00865"></a>00865         } <span class="keywordflow">else</span> <span class="keywordflow">if</span>( n2 == NULL ) {
<a name="l00866"></a>00866                 <span class="keywordflow">return</span> n1;
<a name="l00867"></a>00867         }
<a name="l00868"></a>00868         <span class="keywordflow">return</span> <a class="code" href="group__node__constructors.html#ga94e490d9462642092011edac4980c10f" title="Node construction shortcut for LIST list of nodes.">cLIST</a>( n1, n2 );
<a name="l00869"></a>00869 }
<a name="l00870"></a>00870 
<a name="l00879"></a><a class="code" href="group__node__constructors.html#ga0cfb34e4ac661ea504cc232d173bd599">00879</a> <span class="keyword">inline</span> <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*   <a class="code" href="group__node__constructors.html#ga0cfb34e4ac661ea504cc232d173bd599" title="Short cut for creating a expression tree that calculates the maximum of two expressions.">cMAX</a>( <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* n1, <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* n2 ) 
<a name="l00880"></a>00880 {
<a name="l00881"></a>00881         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* cond = <a class="code" href="group__node__constructors.html#ga0cdd9390a0891629bc09c4a636631273" title="Node construction shortcut for LT less than.">cLT</a>(n2-&gt;<a class="code" href="classCNode.html#a9141bcdb51320383820d0d268c50eb71" title="Replicate tree.">Clone</a>(),n1-&gt;<a class="code" href="classCNode.html#a9141bcdb51320383820d0d268c50eb71" title="Replicate tree.">Clone</a>());
<a name="l00882"></a>00882         <span class="keywordflow">return</span> <a class="code" href="group__node__constructors.html#ga815dc804468daf726f31eca348338a2e" title="Node construction shortcut for HOOK condition expression operator.">cHOOK</a>(cond,n1,n2);
<a name="l00883"></a>00883 }
<a name="l00884"></a>00884 
<a name="l00885"></a>00885 
<a name="l00886"></a>00886 <span class="comment">/****************************************************</span>
<a name="l00887"></a>00887 <span class="comment">        utility routines</span>
<a name="l00888"></a>00888 <span class="comment">*****************************************************/</span>
<a name="l00889"></a>00889 
<a name="l00902"></a><a class="code" href="group__node__utilities.html#ga517bc4387bbf7828bb6b88ba32cf7e21">00902</a> <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keywordtype">void</span> <a class="code" href="group__node__utilities.html#ga517bc4387bbf7828bb6b88ba32cf7e21" title="Walks a list of nodes and collects the specified augments of a given node type.">ArgList2Vector</a>(<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* n, <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513" title="Parse tree opcodes.">NodeOp_t</a> op, 
<a name="l00903"></a>00903                                 <span class="keywordtype">int</span> argNumber, vector&lt;T&gt;&amp; v) 
<a name="l00904"></a>00904 {
<a name="l00905"></a>00905     <span class="keywordflow">if</span>( !n ) {
<a name="l00906"></a>00906         <span class="keywordflow">return</span>;
<a name="l00907"></a>00907     }
<a name="l00908"></a>00908     <span class="keywordflow">switch</span>( n-&gt;<a class="code" href="classCNode.html#aea4bcc23b1bba68d0a243e729b9da0ce" title="Return node&amp;#39;s operation type.">GetOp</a>() ) {
<a name="l00909"></a>00909     <span class="keywordflow">case</span> <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513adb35311cecef5fbb085c97b07e486405" title="list of nodes">eLIST</a>:
<a name="l00910"></a>00910         ArgList2Vector&lt;T&gt;(n-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(0),op,argNumber,v);
<a name="l00911"></a>00911         ArgList2Vector&lt;T&gt;(n-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(1),op,argNumber,v);
<a name="l00912"></a>00912         <span class="keywordflow">break</span>;
<a name="l00913"></a>00913     <span class="keywordflow">default</span>:
<a name="l00914"></a>00914         <span class="keywordflow">if</span>( n-&gt;<a class="code" href="classCNode.html#aea4bcc23b1bba68d0a243e729b9da0ce" title="Return node&amp;#39;s operation type.">GetOp</a>() == op ) {
<a name="l00915"></a>00915             v.push_back(n-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;T&gt;(argNumber));
<a name="l00916"></a>00916         }
<a name="l00917"></a>00917         <span class="keywordflow">break</span>;
<a name="l00918"></a>00918     }
<a name="l00919"></a>00919 }
<a name="l00920"></a>00920 
<a name="l00929"></a><a class="code" href="group__node__utilities.html#ga2469137ed5c74149d8c1d472ce03a55c">00929</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__node__utilities.html#ga2469137ed5c74149d8c1d472ce03a55c" title="Walks an expression elist of nodes and collects the subtrees that don&amp;#39;t match the given node type...">EList2VectorExclude</a>(<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* n, <span class="keyword">const</span> set&lt;NodeOp_t&gt;&amp; excludeOps, vector&lt;CNode*&gt;&amp; v) 
<a name="l00930"></a>00930 {
<a name="l00931"></a>00931     <span class="keywordflow">if</span>( !n ) {
<a name="l00932"></a>00932         <span class="keywordflow">return</span>;
<a name="l00933"></a>00933     }
<a name="l00934"></a>00934     <span class="keywordflow">switch</span>( n-&gt;<a class="code" href="classCNode.html#aea4bcc23b1bba68d0a243e729b9da0ce" title="Return node&amp;#39;s operation type.">GetOp</a>() ) {
<a name="l00935"></a>00935     <span class="keywordflow">case</span> <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513a883177933c5c1426df37f362a6dc8626" title="expression list">eELIST</a>:
<a name="l00936"></a>00936         <a class="code" href="group__node__utilities.html#ga2469137ed5c74149d8c1d472ce03a55c" title="Walks an expression elist of nodes and collects the subtrees that don&amp;#39;t match the given node type...">EList2VectorExclude</a>(n-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(0),excludeOps,v);
<a name="l00937"></a>00937         <a class="code" href="group__node__utilities.html#ga2469137ed5c74149d8c1d472ce03a55c" title="Walks an expression elist of nodes and collects the subtrees that don&amp;#39;t match the given node type...">EList2VectorExclude</a>(n-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(1),excludeOps,v);
<a name="l00938"></a>00938         <span class="keywordflow">break</span>;
<a name="l00939"></a>00939     <span class="keywordflow">default</span>:
<a name="l00940"></a>00940         <span class="keywordflow">if</span>( excludeOps.find(n-&gt;<a class="code" href="classCNode.html#aea4bcc23b1bba68d0a243e729b9da0ce" title="Return node&amp;#39;s operation type.">GetOp</a>()) == excludeOps.end() ) {
<a name="l00941"></a>00941             v.push_back(n);
<a name="l00942"></a>00942         }
<a name="l00943"></a>00943         <span class="keywordflow">break</span>;
<a name="l00944"></a>00944     }
<a name="l00945"></a>00945 }
<a name="l00946"></a>00946 
<a name="l00955"></a><a class="code" href="group__node__utilities.html#ga5db67491a656247efbfa5def03f906b6">00955</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__node__utilities.html#ga5db67491a656247efbfa5def03f906b6" title="Walks an expression list of nodes and collects the subtrees that don&amp;#39;t match the given node types...">List2VectorExclude</a>(<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* n, <span class="keyword">const</span> set&lt;NodeOp_t&gt;&amp; excludeOps, vector&lt;CNode*&gt;&amp; v) 
<a name="l00956"></a>00956 {
<a name="l00957"></a>00957     <span class="keywordflow">if</span>( !n ) {
<a name="l00958"></a>00958         <span class="keywordflow">return</span>;
<a name="l00959"></a>00959     }
<a name="l00960"></a>00960     <span class="keywordflow">switch</span>( n-&gt;<a class="code" href="classCNode.html#aea4bcc23b1bba68d0a243e729b9da0ce" title="Return node&amp;#39;s operation type.">GetOp</a>() ) {
<a name="l00961"></a>00961     <span class="keywordflow">case</span> <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513adb35311cecef5fbb085c97b07e486405" title="list of nodes">eLIST</a>:
<a name="l00962"></a>00962         <a class="code" href="group__node__utilities.html#ga5db67491a656247efbfa5def03f906b6" title="Walks an expression list of nodes and collects the subtrees that don&amp;#39;t match the given node types...">List2VectorExclude</a>(n-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(0),excludeOps,v);
<a name="l00963"></a>00963         <a class="code" href="group__node__utilities.html#ga5db67491a656247efbfa5def03f906b6" title="Walks an expression list of nodes and collects the subtrees that don&amp;#39;t match the given node types...">List2VectorExclude</a>(n-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(1),excludeOps,v);
<a name="l00964"></a>00964         <span class="keywordflow">break</span>;
<a name="l00965"></a>00965     <span class="keywordflow">default</span>:
<a name="l00966"></a>00966         <span class="keywordflow">if</span>( excludeOps.find(n-&gt;<a class="code" href="classCNode.html#aea4bcc23b1bba68d0a243e729b9da0ce" title="Return node&amp;#39;s operation type.">GetOp</a>()) == excludeOps.end() ) {
<a name="l00967"></a>00967             v.push_back(n);
<a name="l00968"></a>00968         }
<a name="l00969"></a>00969         <span class="keywordflow">break</span>;
<a name="l00970"></a>00970     }
<a name="l00971"></a>00971 }
<a name="l00972"></a>00972 
<a name="l00979"></a><a class="code" href="group__node__utilities.html#ga1de6a178e8bad48b36acd8aade25ba4e">00979</a> <span class="keyword">inline</span> <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* <a class="code" href="group__node__utilities.html#ga1de6a178e8bad48b36acd8aade25ba4e" title="Converts a vector array of CNode* into a linked ELIST of the elements.">Vector2EList</a>(<span class="keyword">const</span> vector&lt;CNode*&gt;&amp; v) 
<a name="l00980"></a>00980 {
<a name="l00981"></a>00981     <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* result = NULL;
<a name="l00982"></a>00982     vector&lt;CNode*&gt;::const_reverse_iterator ptr;
<a name="l00983"></a>00983     <span class="keywordflow">for</span>( ptr = v.rbegin(); ptr != v.rend(); ++ptr ) {
<a name="l00984"></a>00984         <span class="keywordflow">if</span>( result ) {
<a name="l00985"></a>00985             result = <a class="code" href="group__node__constructors.html#gae03f6ff900765ba554767056740172bd" title="Node construction shortcut for ELIST expression list.">cELIST</a>(*ptr, result);
<a name="l00986"></a>00986         } <span class="keywordflow">else</span> {
<a name="l00987"></a>00987             result = *ptr;
<a name="l00988"></a>00988         }
<a name="l00989"></a>00989     }
<a name="l00990"></a>00990     <span class="keywordflow">return</span> result;
<a name="l00991"></a>00991 }
<a name="l00992"></a>00992 
<a name="l00999"></a><a class="code" href="group__node__utilities.html#gad65774f7ca1ac072f5c60e9ebf7024c5">00999</a> <span class="keyword">inline</span> <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* <a class="code" href="group__node__utilities.html#gad65774f7ca1ac072f5c60e9ebf7024c5" title="Converts a list of CNode* into a linked ELIST of the elements.">List2EList</a>(list&lt;CNode*&gt;&amp; v) 
<a name="l01000"></a>01000 {
<a name="l01001"></a>01001     <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* result = NULL;
<a name="l01002"></a>01002     list&lt;CNode*&gt;::reverse_iterator ptr;
<a name="l01003"></a>01003     <span class="keywordflow">for</span>( ptr = v.rbegin(); ptr != v.rend(); ++ptr ) {
<a name="l01004"></a>01004         <span class="keywordflow">if</span>( result ) {
<a name="l01005"></a>01005             result = <a class="code" href="group__node__constructors.html#gae03f6ff900765ba554767056740172bd" title="Node construction shortcut for ELIST expression list.">cELIST</a>(*ptr, result);
<a name="l01006"></a>01006         } <span class="keywordflow">else</span> {
<a name="l01007"></a>01007             result = *ptr;
<a name="l01008"></a>01008         }
<a name="l01009"></a>01009     }
<a name="l01010"></a>01010     <span class="keywordflow">return</span> result;
<a name="l01011"></a>01011 }
<a name="l01012"></a>01012 
<a name="l01021"></a><a class="code" href="group__node__utilities.html#gac5892f78ece46bc33ede58a5ac2a9fef">01021</a> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="group__node__utilities.html#gac5892f78ece46bc33ede58a5ac2a9fef" title="Walks a list/elist of nodes and counts the number of node with the specified operation.">ListCount</a>(<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* n, <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513" title="Parse tree opcodes.">NodeOp_t</a> op) 
<a name="l01022"></a>01022 {
<a name="l01023"></a>01023     <span class="keywordtype">int</span> result = 0;
<a name="l01024"></a>01024     <span class="keywordflow">if</span>( !n ) {
<a name="l01025"></a>01025         <span class="keywordflow">return</span> result;
<a name="l01026"></a>01026     }
<a name="l01027"></a>01027     <span class="keywordflow">switch</span>( n-&gt;<a class="code" href="classCNode.html#aea4bcc23b1bba68d0a243e729b9da0ce" title="Return node&amp;#39;s operation type.">GetOp</a>() ) {
<a name="l01028"></a>01028     <span class="keywordflow">case</span> <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513adb35311cecef5fbb085c97b07e486405" title="list of nodes">eLIST</a>:
<a name="l01029"></a>01029     <span class="keywordflow">case</span> <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513a883177933c5c1426df37f362a6dc8626" title="expression list">eELIST</a>:
<a name="l01030"></a>01030         result += <a class="code" href="group__node__utilities.html#gac5892f78ece46bc33ede58a5ac2a9fef" title="Walks a list/elist of nodes and counts the number of node with the specified operation.">ListCount</a>(n-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(0),op);
<a name="l01031"></a>01031         result += <a class="code" href="group__node__utilities.html#gac5892f78ece46bc33ede58a5ac2a9fef" title="Walks a list/elist of nodes and counts the number of node with the specified operation.">ListCount</a>(n-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(1),op);
<a name="l01032"></a>01032         <span class="keywordflow">break</span>;
<a name="l01033"></a>01033     <span class="keywordflow">default</span>:
<a name="l01034"></a>01034         <span class="keywordflow">if</span>( n-&gt;<a class="code" href="classCNode.html#aea4bcc23b1bba68d0a243e729b9da0ce" title="Return node&amp;#39;s operation type.">GetOp</a>() == op ) {
<a name="l01035"></a>01035             result = 1;
<a name="l01036"></a>01036         }
<a name="l01037"></a>01037         <span class="keywordflow">break</span>;
<a name="l01038"></a>01038     }
<a name="l01039"></a>01039     <span class="keywordflow">return</span> result;
<a name="l01040"></a>01040 }
<a name="l01041"></a>01041 
<a name="l01048"></a><a class="code" href="group__node__utilities.html#gad8af5bcbb7ce221e466cf2040e20b425">01048</a> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="group__node__utilities.html#gac5892f78ece46bc33ede58a5ac2a9fef" title="Walks a list/elist of nodes and counts the number of node with the specified operation.">ListCount</a>(<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* n) 
<a name="l01049"></a>01049 {
<a name="l01050"></a>01050     <span class="keywordtype">int</span> result = 0;
<a name="l01051"></a>01051     <span class="keywordflow">if</span>( !n ) {
<a name="l01052"></a>01052         <span class="keywordflow">return</span> result;
<a name="l01053"></a>01053     }
<a name="l01054"></a>01054     <span class="keywordflow">switch</span>( n-&gt;<a class="code" href="classCNode.html#aea4bcc23b1bba68d0a243e729b9da0ce" title="Return node&amp;#39;s operation type.">GetOp</a>() ) {
<a name="l01055"></a>01055     <span class="keywordflow">case</span> <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513adb35311cecef5fbb085c97b07e486405" title="list of nodes">eLIST</a>:
<a name="l01056"></a>01056     <span class="keywordflow">case</span> <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513a883177933c5c1426df37f362a6dc8626" title="expression list">eELIST</a>:
<a name="l01057"></a>01057         result += <a class="code" href="group__node__utilities.html#gac5892f78ece46bc33ede58a5ac2a9fef" title="Walks a list/elist of nodes and counts the number of node with the specified operation.">ListCount</a>(n-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(0));
<a name="l01058"></a>01058         result += <a class="code" href="group__node__utilities.html#gac5892f78ece46bc33ede58a5ac2a9fef" title="Walks a list/elist of nodes and counts the number of node with the specified operation.">ListCount</a>(n-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(1));
<a name="l01059"></a>01059         <span class="keywordflow">break</span>;
<a name="l01060"></a>01060     <span class="keywordflow">default</span>:
<a name="l01061"></a>01061         result = 1;
<a name="l01062"></a>01062         <span class="keywordflow">break</span>;
<a name="l01063"></a>01063     }
<a name="l01064"></a>01064     <span class="keywordflow">return</span> result;
<a name="l01065"></a>01065 }
<a name="l01066"></a>01066 
<a name="l01077"></a><a class="code" href="group__utilities.html#ga7b78ea35c9ff6a9aba4f580e038a7ba9">01077</a> <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="group__utilities.html#ga7b78ea35c9ff6a9aba4f580e038a7ba9" title="Convert char string to double.">s2d</a>( <span class="keywordtype">char</span>* s ) {
<a name="l01078"></a>01078         <span class="keywordflow">return</span> atof(s);
<a name="l01079"></a>01079 }
<a name="l01080"></a>01080 
<a name="l01089"></a><a class="code" href="group__utilities.html#gadba73693074d75c740c6a68704ba71f0">01089</a> <span class="keyword">inline</span> <span class="keywordtype">char</span>* <a class="code" href="group__utilities.html#gadba73693074d75c740c6a68704ba71f0" title="Convert double to char string allocating storage on given heap.">d2s</a>( <span class="keywordtype">double</span> d, <a class="code" href="classCObstack.html" title="Bulk object allocation object.">CObstack</a>* heap ) {
<a name="l01090"></a>01090      <span class="keywordtype">char</span> buffer[256];
<a name="l01091"></a>01091      <span class="comment">// note this isn&#39;t quite correct as it will turn</span>
<a name="l01092"></a>01092      <span class="comment">// reals into ints, ie 2.0 =&gt; 2</span>
<a name="l01093"></a>01093      snprintf( buffer, <span class="keyword">sizeof</span>(buffer), <span class="stringliteral">&quot;%g&quot;</span>, d );
<a name="l01094"></a>01094      <span class="keywordtype">char</span>* s = (<span class="keywordtype">char</span>*)heap-&gt;<a class="code" href="classCObstack.html#a5a34d5a2800a901ed15366c11bf269ef" title="Allocate block of storage with given size.">Alloc</a>(strlen(buffer)+1);
<a name="l01095"></a>01095      strcpy( s, buffer );
<a name="l01096"></a>01096      <span class="keywordflow">return</span> s;
<a name="l01097"></a>01097 }
<a name="l01098"></a>01098 
<a name="l01099"></a>01099 <span class="comment">/*********************************************</span>
<a name="l01100"></a>01100 <span class="comment"> * Adjust nodes structure to be efficient for</span>
<a name="l01101"></a>01101 <span class="comment"> * tail recursion</span>
<a name="l01102"></a>01102 <span class="comment"> *********************************************/</span>
<a name="l01103"></a><a class="code" href="cnode_8h.html#a015458588cc4b079241ae9fc381c6836">01103</a> <span class="keyword">inline</span> <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* <a class="code" href="cnode_8h.html#a015458588cc4b079241ae9fc381c6836">RebalanceRight</a>( <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* n ) {
<a name="l01104"></a>01104         <span class="keywordflow">if</span>( n == NULL ) {
<a name="l01105"></a>01105                 <span class="keywordflow">return</span> n;
<a name="l01106"></a>01106         }
<a name="l01107"></a>01107         <span class="keywordflow">if</span>( n-&gt;<a class="code" href="classCNode.html#aea4bcc23b1bba68d0a243e729b9da0ce" title="Return node&amp;#39;s operation type.">GetOp</a>() != eLIST ) {
<a name="l01108"></a>01108                 <span class="keywordflow">return</span> n;
<a name="l01109"></a>01109         }
<a name="l01110"></a>01110         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* result = n;
<a name="l01111"></a>01111         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* parent = NULL;   
<a name="l01112"></a>01112         <span class="keywordflow">while</span>( 1 ) {
<a name="l01113"></a>01113             <span class="keywordflow">while</span>( n-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(0) &amp;&amp; n-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(0)-&gt;GetOp() == eLIST ) {
<a name="l01114"></a>01114                 <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* l = n-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(0);
<a name="l01115"></a>01115                 <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* ll = l-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(0);
<a name="l01116"></a>01116                 <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* lr = l-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(1);
<a name="l01117"></a>01117                 l-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(1) = n;
<a name="l01118"></a>01118                 n-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(0) = lr;
<a name="l01119"></a>01119                 n = l;
<a name="l01120"></a>01120                 <span class="keywordflow">if</span>( parent ) { 
<a name="l01121"></a>01121                     parent-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(1) = n;
<a name="l01122"></a>01122                 } <span class="keywordflow">else</span> {
<a name="l01123"></a>01123                     result = n;
<a name="l01124"></a>01124                 }
<a name="l01125"></a>01125             }
<a name="l01126"></a>01126             <span class="keywordflow">if</span>( n-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(1) &amp;&amp; n-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(1)-&gt;GetOp() == eLIST ) {
<a name="l01127"></a>01127                 parent = n;
<a name="l01128"></a>01128                 n = n-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(1);
<a name="l01129"></a>01129             } <span class="keywordflow">else</span> {
<a name="l01130"></a>01130                 <span class="keywordflow">break</span>;
<a name="l01131"></a>01131             }
<a name="l01132"></a>01132         }
<a name="l01133"></a>01133         <span class="keywordflow">return</span> result;
<a name="l01134"></a>01134 }
<a name="l01135"></a>01135 <span class="comment">/*********************************************</span>
<a name="l01136"></a>01136 <span class="comment"> * Analyse tree struct.</span>
<a name="l01137"></a>01137 <span class="comment"> * - depth is worst case stack depth right side</span>
<a name="l01138"></a>01138 <span class="comment"> *   optimization.</span>
<a name="l01139"></a>01139 <span class="comment"> *   count is number nodes.</span>
<a name="l01140"></a>01140 <span class="comment"> *********************************************/</span>
<a name="l01141"></a><a class="code" href="cnode_8h.html#a6b9b2b5948abab3433ca0b1a205d56f5">01141</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="cnode_8h.html#a6b9b2b5948abab3433ca0b1a205d56f5">MeasureDepth</a>( <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* n, <span class="keywordtype">int</span>* count, <span class="keywordtype">int</span>* depth )
<a name="l01142"></a>01142 {
<a name="l01143"></a>01143     *count = 0;
<a name="l01144"></a>01144     *depth = 0;
<a name="l01145"></a>01145     <span class="keywordflow">if</span>( !n ) {
<a name="l01146"></a>01146         <span class="keywordflow">return</span>;
<a name="l01147"></a>01147     }
<a name="l01148"></a>01148     <span class="keywordflow">if</span>( n-&gt;<a class="code" href="classCNode.html#aea4bcc23b1bba68d0a243e729b9da0ce" title="Return node&amp;#39;s operation type.">GetOp</a>() == eLIST ) {
<a name="l01149"></a>01149         <span class="keywordtype">int</span> count0 = 0;
<a name="l01150"></a>01150         <span class="keywordtype">int</span> depth0 = 0;
<a name="l01151"></a>01151         <span class="keywordtype">int</span> count1 = 0;
<a name="l01152"></a>01152         <span class="keywordtype">int</span> depth1 = 0;
<a name="l01153"></a>01153         <span class="keywordflow">if</span>( n-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(0) ) {
<a name="l01154"></a>01154             <a class="code" href="cnode_8h.html#a6b9b2b5948abab3433ca0b1a205d56f5">MeasureDepth</a>( n-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(0), &amp;count0, &amp;depth0 );
<a name="l01155"></a>01155             depth0++;
<a name="l01156"></a>01156         }
<a name="l01157"></a>01157         <span class="keywordflow">if</span>( n-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(1)  ) {
<a name="l01158"></a>01158             <a class="code" href="cnode_8h.html#a6b9b2b5948abab3433ca0b1a205d56f5">MeasureDepth</a>( n-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(1), &amp;count1, &amp;depth1 );
<a name="l01159"></a>01159         }
<a name="l01160"></a>01160         *count = count0+count1;
<a name="l01161"></a>01161         *depth = depth0 &gt; depth1 ? depth0 : depth1;
<a name="l01162"></a>01162     }
<a name="l01163"></a>01163     (*count)++;
<a name="l01164"></a>01164 }
<a name="l01165"></a>01165 
<a name="l01166"></a>01166 
<a name="l01167"></a>01167 <span class="comment">/**************************************************</span>
<a name="l01168"></a>01168 <span class="comment"> * Helper routine for parser to build trees that </span>
<a name="l01169"></a>01169 <span class="comment"> * are effient for tail recursion.</span>
<a name="l01170"></a>01170 <span class="comment"> *************************************************/</span>
<a name="l01171"></a><a class="code" href="cnode_8h.html#adb74632900e9a0cd5f75d7879980bf23">01171</a> <span class="keyword">inline</span> <a class="code" href="structCNode__pr.html" title="Helper class for building tail recursive binary CNode trees Used by parser.">CNode_pr</a> <a class="code" href="group__node__constructors.html#ga42eb3c612a8dc800c6845467136df71e" title="Short cut for linking together to nodes with a LIST operator.">cLINK</a>( <a class="code" href="structCNode__pr.html" title="Helper class for building tail recursive binary CNode trees Used by parser.">CNode_pr</a> pr1, <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* n2 )
<a name="l01172"></a>01172 {
<a name="l01173"></a>01173     <span class="keywordflow">if</span>( !n2 ) {
<a name="l01174"></a>01174         <span class="keywordflow">return</span> pr1;
<a name="l01175"></a>01175     } <span class="keywordflow">else</span> <span class="keywordflow">if</span>( !pr1.<a class="code" href="structCNode__pr.html#af6fdb26ae3611d876f530aff13510739">tail</a> ) {
<a name="l01176"></a>01176         <a class="code" href="structCNode__pr.html" title="Helper class for building tail recursive binary CNode trees Used by parser.">CNode_pr</a> pr;
<a name="l01177"></a>01177         pr.<a class="code" href="structCNode__pr.html#a24e945a3e47e1a03082dd887a27337fb">head</a> = n2;
<a name="l01178"></a>01178         pr.<a class="code" href="structCNode__pr.html#af6fdb26ae3611d876f530aff13510739">tail</a> = n2;
<a name="l01179"></a>01179         <span class="keywordflow">return</span> pr;
<a name="l01180"></a>01180     } <span class="keywordflow">else</span> <span class="keywordflow">if</span>( pr1.<a class="code" href="structCNode__pr.html#af6fdb26ae3611d876f530aff13510739">tail</a>-&gt;<a class="code" href="classCNode.html#aea4bcc23b1bba68d0a243e729b9da0ce" title="Return node&amp;#39;s operation type.">GetOp</a>() != eLIST ) {
<a name="l01181"></a>01181         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* t = <a class="code" href="group__node__constructors.html#ga42eb3c612a8dc800c6845467136df71e" title="Short cut for linking together to nodes with a LIST operator.">cLINK</a>( pr1.<a class="code" href="structCNode__pr.html#a24e945a3e47e1a03082dd887a27337fb">head</a>, n2 );
<a name="l01182"></a>01182         <a class="code" href="structCNode__pr.html" title="Helper class for building tail recursive binary CNode trees Used by parser.">CNode_pr</a> pr;
<a name="l01183"></a>01183         pr.<a class="code" href="structCNode__pr.html#a24e945a3e47e1a03082dd887a27337fb">head</a> = t;
<a name="l01184"></a>01184         pr.<a class="code" href="structCNode__pr.html#af6fdb26ae3611d876f530aff13510739">tail</a> = t;
<a name="l01185"></a>01185         <span class="keywordflow">return</span> pr;
<a name="l01186"></a>01186     } <span class="keywordflow">else</span> {
<a name="l01187"></a>01187         pr1.<a class="code" href="structCNode__pr.html#af6fdb26ae3611d876f530aff13510739">tail</a>-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(1) = <a class="code" href="group__node__constructors.html#ga42eb3c612a8dc800c6845467136df71e" title="Short cut for linking together to nodes with a LIST operator.">cLINK</a>(pr1.<a class="code" href="structCNode__pr.html#af6fdb26ae3611d876f530aff13510739">tail</a>-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(1),n2);
<a name="l01188"></a>01188         <a class="code" href="structCNode__pr.html" title="Helper class for building tail recursive binary CNode trees Used by parser.">CNode_pr</a> pr;
<a name="l01189"></a>01189         pr.head = pr1.<a class="code" href="structCNode__pr.html#a24e945a3e47e1a03082dd887a27337fb">head</a>;
<a name="l01190"></a>01190         pr.tail = pr1.<a class="code" href="structCNode__pr.html#af6fdb26ae3611d876f530aff13510739">tail</a>-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(1);
<a name="l01191"></a>01191         <span class="keywordflow">return</span> pr;
<a name="l01192"></a>01192     }
<a name="l01193"></a>01193 }
<a name="l01194"></a>01194 
<a name="l01195"></a>01195 <span class="comment">/**************************************************</span>
<a name="l01196"></a>01196 <span class="comment"> * convert hierarchical reference tree to string</span>
<a name="l01197"></a>01197 <span class="comment"> *************************************************/</span>
<a name="l01198"></a><a class="code" href="cnode_8h.html#a2bf151d629da3a82eccef7829e77a7e1">01198</a> <span class="keyword">inline</span> <span class="keywordtype">string</span> <a class="code" href="cnode_8h.html#a2bf151d629da3a82eccef7829e77a7e1">HierarchicalReference2String</a>( <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* ref )
<a name="l01199"></a>01199 {
<a name="l01200"></a>01200     <span class="keywordtype">string</span> buffer;
<a name="l01201"></a>01201     <span class="keywordflow">switch</span>( ref-&gt;<a class="code" href="classCNode.html#aea4bcc23b1bba68d0a243e729b9da0ce" title="Return node&amp;#39;s operation type.">GetOp</a>() ) {
<a name="l01202"></a>01202     <span class="keywordflow">case</span> <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513aae58a743eb04be6df8a6cb046a0f7e1e" title="dimensioned reference (array/bit select)">eARRAY</a>: {
<a name="l01203"></a>01203         buffer = <a class="code" href="cnode_8h.html#a2bf151d629da3a82eccef7829e77a7e1">HierarchicalReference2String</a>(ref-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(0)).c_str();
<a name="l01204"></a>01204         vector&lt;CNode*&gt; indexes;
<a name="l01205"></a>01205         <a class="code" href="group__node__utilities.html#ga2469137ed5c74149d8c1d472ce03a55c" title="Walks an expression elist of nodes and collects the subtrees that don&amp;#39;t match the given node type...">EList2VectorExclude</a>( ref-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(1), 
<a name="l01206"></a>01206                          set&lt;NodeOp_t&gt;(), indexes );
<a name="l01207"></a>01207         vector&lt;CNode*&gt;::iterator ptr;
<a name="l01208"></a>01208         <span class="keywordflow">for</span>( ptr = indexes.begin(); ptr != indexes.end(); ++ptr ) {
<a name="l01209"></a>01209             <span class="keywordflow">switch</span>( ref-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(0)-&gt;GetOp() ) {
<a name="l01210"></a>01210             <span class="keywordflow">case</span> <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513a8896a20b0f62194efc10c79de38ec074" title="vector subrange">eSLICE</a>:
<a name="l01211"></a>01211             <span class="keywordflow">case</span> <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513a7034d050b8e97119a2a28a2d4e39f4ef" title="vector subrange with ascending index select">ePSLICE</a>:
<a name="l01212"></a>01212             <span class="keywordflow">case</span> <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513abbb2e76b8ae4135617ebdac7d300e48f" title="vector subrange with descending index select">eMSLICE</a>:
<a name="l01213"></a>01213             <span class="keywordflow">break</span>;
<a name="l01214"></a>01214             <span class="keywordflow">default</span>: {
<a name="l01215"></a>01215                 <a class="code" href="glue_8h.html#a0cb58e7e6f0bad369840a52e54a56ae0" title="Short cut for signed 32 bit integer.">INT32</a> value = (*ptr)-&gt;EvalINT32();
<a name="l01216"></a>01216             ostringstream subscript;
<a name="l01217"></a>01217             subscript &lt;&lt; <span class="charliteral">&#39;[&#39;</span> &lt;&lt; value &lt;&lt; <span class="charliteral">&#39;]&#39;</span>; 
<a name="l01218"></a>01218             buffer += subscript.str();
<a name="l01219"></a>01219             } <span class="keywordflow">break</span>;
<a name="l01220"></a>01220             }
<a name="l01221"></a>01221         }
<a name="l01222"></a>01222         } <span class="keywordflow">break</span>;
<a name="l01223"></a>01223     <span class="keywordflow">case</span> <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513a0d2bb7c7109924dfdf4c729a39d89bf1" title="member reference (structure, class or external">eMEMBER</a>:
<a name="l01224"></a>01224         buffer = <a class="code" href="cnode_8h.html#a2bf151d629da3a82eccef7829e77a7e1">HierarchicalReference2String</a>(ref-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*&gt;(0)).c_str();
<a name="l01225"></a>01225         buffer += <span class="stringliteral">&quot;.&quot;</span>;
<a name="l01226"></a>01226         buffer += ref-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCSymbol.html" title="Holder for character strings.">CSymbol</a>*&gt;(1)-&gt;GetName();
<a name="l01227"></a>01227         <span class="keywordflow">break</span>;
<a name="l01228"></a>01228     <span class="keywordflow">case</span> <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513ad6f183844d7cfac0bd93e6e637520b2e" title="external reference">eEXTERNAL_REF</a>:
<a name="l01229"></a>01229         buffer = ref-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCSymbol.html" title="Holder for character strings.">CSymbol</a>*&gt;(0)-&gt;GetName();
<a name="l01230"></a>01230         ref = NULL;
<a name="l01231"></a>01231         <span class="keywordflow">break</span>;
<a name="l01232"></a>01232     <span class="keywordflow">case</span> <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513a975710581b3e67e4df9048b20653be59" title="reference to net">eNET_REF</a>:              
<a name="l01233"></a>01233     <span class="keywordflow">case</span> <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513ad398fc2628018ed8485e99c9bd28e8f7" title="reference to variable">eVAR_REF</a>:              
<a name="l01234"></a>01234     <span class="keywordflow">case</span> <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513ac50cc7f49ff7c43f88e815160d865774" title="reference to parameter">ePARAM_REF</a>:            
<a name="l01235"></a>01235     <span class="keywordflow">case</span> <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513a9d7bc86149d5a557e11aa9f9d34c7a2f" title="reference to port">ePORT_REF</a>:             
<a name="l01236"></a>01236     <span class="keywordflow">case</span> <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513aafa3eca19ef27d4282a4e89cb293951c" title="reference to a forward declared variable">eFWD_REF</a>:              
<a name="l01237"></a>01237     <span class="keywordflow">case</span> <a class="code" href="cnode__def_8h.html#a21e7e2c6d95679cd908f0b20e8408513ab21a341f6a115d49b2f730f8a8fdadeb" title="reference to a genvar">eGENVAR_REF</a>:           
<a name="l01238"></a>01238         buffer = ref-&gt;<a class="code" href="classCNode.html#a380e5e5cec5d65afc871ea9c64c27135" title="Get a node&amp;#39;s operand.">Arg</a>&lt;<a class="code" href="classCDecl.html" title="Base class for describing declaration objects.">CDecl</a>*&gt;(0)-&gt;GetName();
<a name="l01239"></a>01239         ref = NULL;
<a name="l01240"></a>01240         <span class="keywordflow">break</span>;
<a name="l01241"></a>01241     <span class="keywordflow">default</span>:;
<a name="l01242"></a>01242         MASSERT( FALSE );
<a name="l01243"></a>01243     }
<a name="l01244"></a>01244     <span class="keywordflow">return</span> buffer;
<a name="l01245"></a>01245 }
<a name="l01246"></a>01246 
<a name="l01247"></a>01247 <span class="comment">/*****************************************************</span>
<a name="l01248"></a>01248 <span class="comment"> * Support routines for cnode_def.h constructs</span>
<a name="l01249"></a>01249 <span class="comment"> *****************************************************/</span>
<a name="l01250"></a><a class="code" href="cnode_8h.html#ab20dd10cb144790ff21b0a4c37320e1d">01250</a> <span class="keyword">inline</span> <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* <a class="code" href="cnode_8h.html#ab20dd10cb144790ff21b0a4c37320e1d">cMAX_N</a>( <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* first, ... )
<a name="l01251"></a>01251 {
<a name="l01252"></a>01252     <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* result = first;
<a name="l01253"></a>01253     va_list ap;
<a name="l01254"></a>01254     va_start( ap, first );
<a name="l01255"></a>01255     <span class="keywordflow">while</span>( 1 ) {
<a name="l01256"></a>01256         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* arg = va_arg(ap,<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*);
<a name="l01257"></a>01257         <span class="keywordflow">if</span>( !arg ) {
<a name="l01258"></a>01258             <span class="keywordflow">break</span>;
<a name="l01259"></a>01259         }
<a name="l01260"></a>01260         <span class="keywordflow">if</span>( !<a class="code" href="cnode_8h.html#a1a1d6f964063fc8f09e489e9c5565b93">Equivalent</a>( result, arg ) ) {
<a name="l01261"></a>01261             result = <a class="code" href="group__node__constructors.html#ga0cfb34e4ac661ea504cc232d173bd599" title="Short cut for creating a expression tree that calculates the maximum of two expressions.">cMAX</a>( result, arg );
<a name="l01262"></a>01262         }
<a name="l01263"></a>01263     }
<a name="l01264"></a>01264     va_end( ap );
<a name="l01265"></a>01265     <span class="keywordflow">return</span> result;
<a name="l01266"></a>01266 }
<a name="l01267"></a>01267 
<a name="l01268"></a><a class="code" href="cnode_8h.html#af8563bd4b20a258e543dd29e080eba58">01268</a> <span class="keyword">inline</span> <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* <a class="code" href="cnode_8h.html#af8563bd4b20a258e543dd29e080eba58">cADD_N</a>( <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* first, ... )
<a name="l01269"></a>01269 {
<a name="l01270"></a>01270     <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* result = first;
<a name="l01271"></a>01271     va_list ap;
<a name="l01272"></a>01272     va_start( ap, first );
<a name="l01273"></a>01273     <span class="keywordflow">while</span>( 1 ) {
<a name="l01274"></a>01274         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* arg = va_arg(ap,<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*);
<a name="l01275"></a>01275         <span class="keywordflow">if</span>( !arg ) {
<a name="l01276"></a>01276             <span class="keywordflow">break</span>;
<a name="l01277"></a>01277         }
<a name="l01278"></a>01278         result = <a class="code" href="cnode_8h.html#a24ffa6a25b42d0cb01a1e15a48bc8cb5">cADD</a>( result, arg );
<a name="l01279"></a>01279     }
<a name="l01280"></a>01280     va_end( ap );
<a name="l01281"></a>01281     <span class="keywordflow">return</span> result;
<a name="l01282"></a>01282 }
<a name="l01283"></a>01283 
<a name="l01284"></a><a class="code" href="cnode_8h.html#aac81c3004628e99ed2e9774275130d6f">01284</a> <span class="keyword">inline</span> <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* <a class="code" href="cnode_8h.html#aac81c3004628e99ed2e9774275130d6f">cMUL_N</a>( <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* first, ... )
<a name="l01285"></a>01285 {
<a name="l01286"></a>01286     <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* result = first;
<a name="l01287"></a>01287     va_list ap;
<a name="l01288"></a>01288     va_start( ap, first );
<a name="l01289"></a>01289     <span class="keywordflow">while</span>( 1 ) {
<a name="l01290"></a>01290         <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* arg = va_arg(ap,<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*);
<a name="l01291"></a>01291         <span class="keywordflow">if</span>( !arg ) {
<a name="l01292"></a>01292             <span class="keywordflow">break</span>;
<a name="l01293"></a>01293         }
<a name="l01294"></a>01294         result = <a class="code" href="cnode_8h.html#a52608f49a43743ea6697031d17776072">cMUL</a>( result, arg );
<a name="l01295"></a>01295     }
<a name="l01296"></a>01296     va_end( ap );
<a name="l01297"></a>01297     <span class="keywordflow">return</span> result;
<a name="l01298"></a>01298 }
<a name="l01299"></a>01299 
<a name="l01300"></a><a class="code" href="cnode_8h.html#a022d6fc246552e0b1112b9c6c4bae76b">01300</a> <span class="keyword">inline</span> <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* <a class="code" href="cnode_8h.html#a022d6fc246552e0b1112b9c6c4bae76b">cABSDIFFPLUS1_N</a>( <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* first, ... )
<a name="l01301"></a>01301 {
<a name="l01302"></a>01302     va_list ap;
<a name="l01303"></a>01303     va_start( ap, first );
<a name="l01304"></a>01304     <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* second = va_arg(ap,<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*);
<a name="l01305"></a>01305     <span class="comment">/*</span>
<a name="l01306"></a>01306 <span class="comment">     * only make sense for 2 args</span>
<a name="l01307"></a>01307 <span class="comment">     */</span>
<a name="l01308"></a>01308     MASSERT( va_arg(ap,<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*) == NULL );
<a name="l01309"></a>01309     va_end( ap );
<a name="l01310"></a>01310 <span class="comment">//    return cADD(cABSDIFF(first,second),cINT32(1));</span>
<a name="l01311"></a>01311     <span class="keywordflow">return</span> <a class="code" href="group__node__constructors.html#ga815dc804468daf726f31eca348338a2e" title="Node construction shortcut for HOOK condition expression operator.">cHOOK</a>(
<a name="l01312"></a>01312                 <a class="code" href="group__node__constructors.html#ga49efee3e8c5758f3aa3fd42b032331ab" title="Node construction shortcut for GE greater than or equal.">cGE</a>(first,second),
<a name="l01313"></a>01313                 <a class="code" href="cnode_8h.html#a24ffa6a25b42d0cb01a1e15a48bc8cb5">cADD</a>(<a class="code" href="group__node__constructors.html#ga3c6e4399f0a4f022db88fe341cc33fc9" title="Node construction shortcut for SUB subtract.">cSUB</a>(first-&gt;<a class="code" href="classCNode.html#a9141bcdb51320383820d0d268c50eb71" title="Replicate tree.">Clone</a>(),second-&gt;<a class="code" href="classCNode.html#a9141bcdb51320383820d0d268c50eb71" title="Replicate tree.">Clone</a>()),<a class="code" href="group__node__constructors.html#ga63fd75b2bd53df304201c6eb0bccc10c" title="Short cut for creating VCONSTANT node with a given integer value.">cINT32</a>(1)),
<a name="l01314"></a>01314                 <a class="code" href="cnode_8h.html#a24ffa6a25b42d0cb01a1e15a48bc8cb5">cADD</a>(<a class="code" href="group__node__constructors.html#ga3c6e4399f0a4f022db88fe341cc33fc9" title="Node construction shortcut for SUB subtract.">cSUB</a>(second-&gt;<a class="code" href="classCNode.html#a9141bcdb51320383820d0d268c50eb71" title="Replicate tree.">Clone</a>(),first-&gt;<a class="code" href="classCNode.html#a9141bcdb51320383820d0d268c50eb71" title="Replicate tree.">Clone</a>()),<a class="code" href="group__node__constructors.html#ga63fd75b2bd53df304201c6eb0bccc10c" title="Short cut for creating VCONSTANT node with a given integer value.">cINT32</a>(1)) );
<a name="l01315"></a>01315                 
<a name="l01316"></a>01316 }
<a name="l01317"></a>01317 
<a name="l01318"></a><a class="code" href="cnode_8h.html#a51c10c30e5ecd54bd93c86a1a438c27b">01318</a> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="group__node__constructors.html#ga0cfb34e4ac661ea504cc232d173bd599" title="Short cut for creating a expression tree that calculates the maximum of two expressions.">cMAX</a>( <span class="keywordtype">int</span> a1, <span class="keywordtype">int</span> a2 )
<a name="l01319"></a>01319 {
<a name="l01320"></a>01320     <span class="keywordflow">return</span> a1 &lt; a2 ? a2 : a1;
<a name="l01321"></a>01321 }
<a name="l01322"></a>01322 
<a name="l01323"></a><a class="code" href="cnode_8h.html#a0f89c3507d86c15d102ab2771fa47879">01323</a> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="group__node__constructors.html#ga0cfb34e4ac661ea504cc232d173bd599" title="Short cut for creating a expression tree that calculates the maximum of two expressions.">cMAX</a>( <span class="keywordtype">int</span> a1, <span class="keywordtype">int</span> a2, <span class="keywordtype">int</span> a3 )
<a name="l01324"></a>01324 {
<a name="l01325"></a>01325     <span class="keywordflow">return</span> <a class="code" href="group__node__constructors.html#ga0cfb34e4ac661ea504cc232d173bd599" title="Short cut for creating a expression tree that calculates the maximum of two expressions.">cMAX</a>(a1,<a class="code" href="group__node__constructors.html#ga0cfb34e4ac661ea504cc232d173bd599" title="Short cut for creating a expression tree that calculates the maximum of two expressions.">cMAX</a>(a2,a3));
<a name="l01326"></a>01326 }
<a name="l01327"></a>01327 
<a name="l01328"></a><a class="code" href="cnode_8h.html#a24ffa6a25b42d0cb01a1e15a48bc8cb5">01328</a> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="cnode_8h.html#a24ffa6a25b42d0cb01a1e15a48bc8cb5">cADD</a>( <span class="keywordtype">int</span> a1, <span class="keywordtype">int</span> a2 )
<a name="l01329"></a>01329 {
<a name="l01330"></a>01330     <span class="keywordflow">return</span> a1 + a2;
<a name="l01331"></a>01331 }
<a name="l01332"></a>01332 
<a name="l01333"></a><a class="code" href="cnode_8h.html#a52608f49a43743ea6697031d17776072">01333</a> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="cnode_8h.html#a52608f49a43743ea6697031d17776072">cMUL</a>( <span class="keywordtype">int</span> a1, <span class="keywordtype">int</span> a2 )
<a name="l01334"></a>01334 {
<a name="l01335"></a>01335     <span class="keywordflow">return</span> a1 * a2;
<a name="l01336"></a>01336 }
<a name="l01337"></a>01337 
<a name="l01338"></a><a class="code" href="cnode_8h.html#a7937b5fd1c7690e93b3f704c1bf25cde">01338</a> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="cnode_8h.html#a7937b5fd1c7690e93b3f704c1bf25cde">cABSDIFFPLUS1</a>( <span class="keywordtype">int</span> a1, <span class="keywordtype">int</span> a2 )
<a name="l01339"></a>01339 {
<a name="l01340"></a>01340     <span class="keywordtype">int</span> diff = a1-a2;
<a name="l01341"></a>01341     <span class="keywordflow">return</span> (diff &lt; 0 ? -diff : diff)+1;
<a name="l01342"></a>01342 }
<a name="l01343"></a>01343 
<a name="l01344"></a>01344 
<a name="l01345"></a>01345 <span class="preprocessor">#endif // CNODE_HPP</span>
<a name="l01346"></a>01346 <span class="preprocessor"></span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>Generated by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address>
</body>
</html>