⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cell_8hpp-source.html

📁 parser in C++~~~~~~~~~~~~
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>a1: Cell.hpp Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3.9.1 --><div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div><h1>Cell.hpp</h1><a href="Cell_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 00022 <span class="preprocessor">#ifndef CELL_HPP</span>00023 <span class="preprocessor"></span><span class="preprocessor">#define CELL_HPP</span>00024 <span class="preprocessor"></span>00025 <span class="preprocessor">#include &lt;cstddef&gt;</span>00026 <span class="preprocessor">#include &lt;cstdlib&gt;</span>00027 <span class="preprocessor">#include &lt;iostream&gt;</span>00028 <span class="preprocessor">#include &lt;fstream&gt;</span>00029 <span class="preprocessor">#include &lt;sstream&gt;</span>00030 <span class="preprocessor">#include &lt;string&gt;</span>00031 <span class="preprocessor">#include &lt;stack&gt;</span>00032 00033 <span class="keyword">using</span> <span class="keyword">namespace </span>std;00034 <a name="l00039"></a><a class="code" href="classCell.html">00039</a> <span class="keyword">class </span><a class="code" href="classCell.html">Cell</a> {00040 <span class="keyword">public</span>:00041 00045   <a class="code" href="classCell.html">Cell</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> i);00046 00050   <a class="code" href="classCell.html">Cell</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> d);00051 00055   <a class="code" href="classCell.html">Cell</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span> s);00056 00060   <a class="code" href="classCell.html">Cell</a>(<a class="code" href="classCell.html">Cell</a>* <span class="keyword">const</span> my_car, <a class="code" href="classCell.html">Cell</a>* <span class="keyword">const</span> my_cdr);00061 00066   <span class="keywordtype">bool</span> is_int() <span class="keyword">const</span>;00067 00072   <span class="keywordtype">bool</span> is_double() <span class="keyword">const</span>;00073 00078   <span class="keywordtype">bool</span> is_symbol() <span class="keyword">const</span>;00079 00084   <span class="keywordtype">bool</span> is_cons() <span class="keyword">const</span>;00085 00090   <span class="keywordtype">int</span> <a class="code" href="cons_8hpp.html#a10">get_int</a>() <span class="keyword">const</span>;00091 00096   <span class="keywordtype">double</span> <a class="code" href="cons_8hpp.html#a11">get_double</a>() <span class="keyword">const</span>;00097 00102   string <a class="code" href="cons_8hpp.html#a12">get_symbol</a>() <span class="keyword">const</span>;00103 00108   <a class="code" href="classCell.html">Cell</a>* get_car() <span class="keyword">const</span>;00109 00114   <a class="code" href="classCell.html">Cell</a>* get_cdr() <span class="keyword">const</span>;00115 00120   <span class="keywordtype">void</span> print(ostream&amp; os = cout) <span class="keyword">const</span>;00121 00122 <span class="keyword">private</span>:00123 <a name="l00124"></a><a class="code" href="classCell.html#y4">00124</a>   <span class="keyword">enum</span> TypeTag {type_int, type_double, type_symbol, type_conspair};<a name="l00125"></a><a class="code" href="classCell.html#r0">00125</a>   TypeTag tag_m;<a name="l00126"></a><a class="code" href="structCell_1_1ConsPair.html">00126</a>   <span class="keyword">struct </span><a class="code" href="structCell_1_1ConsPair.html">ConsPair</a>00127   {<a name="l00128"></a><a class="code" href="structCell_1_1ConsPair.html#o0">00128</a>     <a class="code" href="classCell.html">Cell</a> *car;  <a name="l00129"></a><a class="code" href="structCell_1_1ConsPair.html#o1">00129</a>     <a class="code" href="classCell.html">Cell</a> *cdr;  00130   };00131   <span class="keyword">union</span>00132 <span class="keyword">  </span>{<a name="l00133"></a><a class="code" href="classCell.html#r1">00133</a>     <span class="keywordtype">int</span> int_m;  <a name="l00134"></a><a class="code" href="classCell.html#r2">00134</a>     <span class="keywordtype">double</span> double_m;    <a name="l00135"></a><a class="code" href="classCell.html#r3">00135</a>     <span class="keywordtype">char</span>* symbol_m;     <a name="l00136"></a><a class="code" href="classCell.html#r4">00136</a>     <a class="code" href="structCell_1_1ConsPair.html">ConsPair</a> conspair_m;        00137   };00138 };00139 00140 <span class="comment">// Reminder: cons.hpp expects nil to be defined somewhere (for this</span>00141 <span class="comment">// implementation, Cell.cpp is the logical place to define it).</span>00142 <span class="comment">// Here we promise this again, just to be safe.</span>00143 <span class="keyword">extern</span> <a class="code" href="classCell.html">Cell</a>* <span class="keyword">const</span> nil;00144 00145 <span class="preprocessor">#endif // CELL_HPP</span></pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu Mar 8 19:07:07 2007 for a1 by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -