<!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/csymbol.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 Page</span></a></li> <li><a href="pages.html"><span>Related 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 List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <div class="header"> <div class="headertitle"> <h1>/net/fileserver/nas/home/mdh/vrq/src/csymbol.h</h1> </div> </div> <div class="contents"> <a href="csymbol_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"> * csymbol.hpp</span> <a name="l00025"></a>00025 <span class="comment"> * - class definition for symbol CSymbol </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 CSYMBOL_HPP</span> <a name="l00032"></a>00032 <span class="preprocessor"></span><span class="preprocessor">#define CSYMBOL_HPP</span> <a name="l00033"></a>00033 <span class="preprocessor"></span> <a name="l00034"></a>00034 <span class="preprocessor">#include "<a class="code" href="glue_8h.html">glue.h</a>"</span> <a name="l00035"></a>00035 <span class="preprocessor">#include "<a class="code" href="cobject_8h.html">cobject.h</a>"</span> <a name="l00036"></a>00036 <span class="preprocessor">#include <set></span> <a name="l00037"></a>00037 <a name="l00038"></a>00038 <a name="l00044"></a><a class="code" href="classCSymbol.html">00044</a> <span class="keyword">class </span><a class="code" href="classCSymbol.html" title="Holder for character strings.">CSymbol</a> : <span class="keyword">public</span> <a class="code" href="classCObject.html" title="Base class for vrq objects.">CObject</a> <a name="l00045"></a>00045 { <a name="l00046"></a>00046 <span class="keyword">private</span>: <a name="l00047"></a>00047 <span class="keyword">struct </span>SymbolCompare { <a name="l00048"></a>00048 <span class="keywordtype">bool</span> operator()( <a class="code" href="classCSymbol.html" title="Holder for character strings.">CSymbol</a>* <span class="keyword">const</span>& lhs, <a class="code" href="classCSymbol.html" title="Holder for character strings.">CSymbol</a>* <span class="keyword">const</span>& rhs ); <a name="l00049"></a>00049 }; <a name="l00050"></a>00050 <span class="keyword">static</span> set<CSymbol*,SymbolCompare> hashTable; <a name="l00051"></a>00051 <span class="keyword">static</span> <a class="code" href="classCSymbol.html" title="Holder for character strings.">CSymbol</a>* freeSymbol; <a name="l00052"></a>00052 <span class="keyword">static</span> <a class="code" href="classCObstack.html" title="Bulk object allocation object.">CObstack</a>* obstack; <a name="l00053"></a>00053 <span class="keyword">static</span> <a class="code" href="glue_8h.html#a0cb58e7e6f0bad369840a52e54a56ae0" title="Short cut for signed 32 bit integer.">INT32</a> nextLabelId; <a name="l00054"></a>00054 <a name="l00055"></a>00055 <a name="l00056"></a>00056 <span class="keyword">const</span> <span class="keywordtype">char</span>* name; <a name="l00057"></a>00057 <a class="code" href="glue_8h.html#a0cb58e7e6f0bad369840a52e54a56ae0" title="Short cut for signed 32 bit integer.">INT32</a> hash; <a name="l00058"></a>00058 <span class="keyword">public</span>: <a name="l00065"></a>00065 <span class="keyword">static</span> <a class="code" href="classCSymbol.html" title="Holder for character strings.">CSymbol</a>* <a class="code" href="classCSymbol.html#a625749f6baff22dc83435449d5792914" title="Find symbol for given string.">Lookup</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* name ); <a name="l00072"></a>00072 <span class="keyword">static</span> <a class="code" href="classCSymbol.html" title="Holder for character strings.">CSymbol</a>* <a class="code" href="classCSymbol.html#a93e194bda3fc3c7be18619445e259edd" title="Generated a new symbol with a unique name using the given prefix.">GenSymbol</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* prefix ); <a name="l00076"></a>00076 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classCSymbol.html#a8b6c5dca74be6b89412654941a1b707f" title="Dump symbol table.">DumpTable</a>( <span class="keywordtype">void</span> ); <a name="l00080"></a>00080 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classCSymbol.html#a89ecc8be0217f9b5c9c817826a60f68e" title="Set heap to use for storage.">SetObstack</a>( <a class="code" href="classCObstack.html" title="Bulk object allocation object.">CObstack</a>* aObstack ); <a name="l00085"></a>00085 <a class="code" href="classCSymbol.html#a1d2915b5d91307c8e7351cf53263f06f" title="Create a symbol.">CSymbol</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* aName ); <a name="l00089"></a>00089 <a class="code" href="classCSymbol.html#ab00432bd7072d861f45a0eddcd9c24e3" title="Destroy symbol.">~CSymbol</a>( <span class="keywordtype">void</span> ); <a name="l00094"></a>00094 <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classCSymbol.html#a9736de9ba821265b58513e8045300df7" title="Get symbol&#39;s text.">GetName</a>( <span class="keywordtype">void</span> ) <span class="keyword">const</span>; <a name="l00099"></a>00099 <span class="keywordtype">int</span> <a class="code" href="classCSymbol.html#ade764a0a7f49d0187d6bb4db964405b2" title="Determine if string is an escaped symbol.">Escaped</a>( <span class="keywordtype">void</span> ) <span class="keyword">const</span>; <a name="l00104"></a>00104 <span class="keywordtype">int</span> <a class="code" href="classCSymbol.html#a1f6c14488df8b100b01c8f3fffeb3304" title="Determine if symbol is external reference return non-zero if symbol is external.">External</a>() <span class="keyword">const</span>; <a name="l00108"></a>00108 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classCSymbol.html#a4ce290f4b5b9b0fd4fde32ea3bb72e0b" title="Dump hash table stats.">DumpStats</a>(); <a name="l00112"></a>00112 <span class="keyword">private</span>: <a name="l00113"></a>00113 <span class="keyword">static</span> <a class="code" href="glue_8h.html#a0cb58e7e6f0bad369840a52e54a56ae0" title="Short cut for signed 32 bit integer.">INT32</a> Hash( <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keywordtype">string</span> ); <a name="l00117"></a>00117 }; <a name="l00118"></a>00118 <a name="l00129"></a>00129 <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="group__utilities.html#gac536009e2095d02e437a6a2e725712a1" title="Convert a string representing an identifier to an escaped format for printing (if needed)...">Identifier</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* s ); <a name="l00130"></a>00130 <a name="l00131"></a>00131 <span class="preprocessor">#endif // CSYMBOL_HPP</span> </pre></div></div> </div> <hr class="footer"/><address class="footer"><small>Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address> </body> </html>