📄 forth_8h-source.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>forth/forth.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.4.4 --><div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div><div class="nav"><a class="el" href="dir_000002.html">forth</a></div><h1>forth.h</h1><a href="forth_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <a name="l00012"></a>00012 <span class="preprocessor">#ifndef __FORTH_H__</span><a name="l00013"></a>00013 <span class="preprocessor"></span><span class="preprocessor">#define __FORTH_H__</span><a name="l00014"></a>00014 <span class="preprocessor"></span><a name="l00038"></a><a class="code" href="group__forth.html#ga0">00038</a> <span class="keyword">typedef</span> <a class="code" href="group__integers.html#ga5">int32</a> <a class="code" href="group__forth.html#ga0">CELL</a>;<a name="l00039"></a>00039 <a name="l00040"></a>00040 <a class="code" href="common_8h.html#a5">ASSERT_COMPILE</a>(<span class="keyword">sizeof</span>(<a class="code" href="group__forth.html#ga0">CELL</a>)>=<span class="keyword">sizeof</span>(CELL*)); <span class="comment">// CELL must be big enough to store pointers</span><a name="l00041"></a>00041 <a name="l00046"></a><a class="code" href="group__forth.html#ga1">00046</a> <span class="keyword">typedef</span> <a class="code" href="group__integers.html#ga2">uint32</a> <a class="code" href="group__forth.html#ga1">UCELL</a>;<a name="l00047"></a>00047 <a name="l00052"></a><a class="code" href="group__forth.html#ga2">00052</a> <span class="keyword">typedef</span> <a class="code" href="group__integers.html#ga0">uint8</a> <a class="code" href="group__forth.html#ga2">CHAR</a>;<a name="l00053"></a>00053 <a name="l00057"></a><a class="code" href="group__forth.html#ga5">00057</a> <span class="preprocessor">#define BITS_PER_CHAR 8</span><a name="l00058"></a>00058 <span class="preprocessor"></span><a name="l00062"></a><a class="code" href="group__forth.html#ga6">00062</a> <span class="preprocessor">#define CHARS_PER_CELL 4</span><a name="l00063"></a>00063 <span class="preprocessor"></span><a name="l00064"></a>00064 <a class="code" href="common_8h.html#a5">ASSERT_COMPILE</a>(<a class="code" href="group__forth.html#ga6">CHARS_PER_CELL</a>==<span class="keyword">sizeof</span>(CELL)/<span class="keyword">sizeof</span>(CHAR)); <span class="comment">// Check CHARS_PER_CELL is defined correctly</span><a name="l00065"></a>00065 <a name="l00066"></a>00066 <a name="l00087"></a><a class="code" href="classForthIo.html">00087</a> <span class="keyword">class </span><a class="code" href="classForthIo.html">ForthIo</a><a name="l00088"></a>00088 {<a name="l00089"></a>00089 <span class="keyword">public</span>:<a name="l00096"></a>00096 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classForthIo.html#a0">ConsoleOut</a>(<span class="keyword">const</span> CHAR* text,UCELL textLength) = 0;<a name="l00097"></a>00097 <a name="l00103"></a>00103 <span class="keyword">virtual</span> CELL <a class="code" href="classForthIo.html#a1">ConsoleIn</a>() = 0;<a name="l00104"></a>00104 <span class="keyword">public</span>:<a name="l00118"></a><a class="code" href="classForthIo.html#o0">00118</a> CHAR <a class="code" href="classForthIo.html#o0">NewLine</a>[4];<a name="l00119"></a>00119 };<a name="l00120"></a>00120 <a name="l00121"></a>00121 <a name="l00125"></a><a class="code" href="classForth.html">00125</a> <span class="keyword">class </span><a class="code" href="classForth.html">Forth</a><a name="l00126"></a>00126 {<a name="l00127"></a>00127 <span class="keyword">public</span>:<a name="l00137"></a>00137 <span class="keyword">static</span> <a class="code" href="classForth.html">Forth</a>* <a class="code" href="classForth.html#e0">Construct</a>(<span class="keywordtype">void</span>* memoryStart,<a class="code" href="group__integers.html#ga6">uint</a> memorySize,<a class="code" href="classForthIo.html">ForthIo</a>* ioHandler);<a name="l00138"></a>00138 <a name="l00142"></a>00142 <span class="keywordtype">void</span> <a class="code" href="classForth.html#a0">Reset</a>();<a name="l00143"></a>00143 <a name="l00152"></a>00152 CELL <a class="code" href="classForth.html#a1">Quit</a>();<a name="l00153"></a>00153 <a name="l00161"></a>00161 CELL <a class="code" href="classForth.html#a2">Execute</a>(CELL xt);<a name="l00162"></a>00162 <a name="l00171"></a>00171 CELL <a class="code" href="classForth.html#a3">Evaluate</a>(<span class="keyword">const</span> CHAR* text,<a class="code" href="group__integers.html#ga6">uint</a> textLength);<a name="l00172"></a>00172 <a name="l00181"></a>00181 <span class="keywordtype">void</span> <a class="code" href="classForth.html#a4">Push</a>(<span class="keyword">const</span> CELL* cells, <a class="code" href="group__integers.html#ga6">uint</a> numCells);<a name="l00182"></a>00182 <a name="l00194"></a>00194 <span class="keyword">const</span> CELL* <a class="code" href="classForth.html#a5">Pop</a>(<a class="code" href="group__integers.html#ga6">uint</a> numCells);<a name="l00195"></a>00195 <a name="l00196"></a>00196 };<a name="l00197"></a>00197 <a name="l00198"></a>00198 <span class="comment">// End of group</span><a name="l00200"></a>00200 <a name="l00201"></a>00201 <span class="preprocessor">#endif</span></pre></div><HR><ADDRESS STYLE="align: right;"><SMALL>Generated by <A HREF="http://www.doxygen.org/index.html"><IMG SRC="doxygen.png" ALT="doxygen" ALIGN="middle" BORDER="0"></A> 1.4.4</SMALL></ADDRESS></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -