📄 classforth.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 Class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.4.1 --><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><h1>Forth Class Reference<br><small>[<a class="el" href="group__forth.html">Forth - Forth virtual machine</a>]</small></h1><code>#include <<a class="el" href="forth_8h-source.html">forth.h</a>></code><p><p>Inheritance diagram for Forth:<p><center><img src="classForth.png" usemap="#Forth_map" border="0" alt=""></center><map name="Forth_map"><area href="classForthVM.html" alt="ForthVM" shape="rect" coords="0,56,62,80"></map><a href="classForth-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>Public interface to the forth virtual machine. <p><p>Definition at line <a class="el" href="forth_8h-source.html#l00121">121</a> of file <a class="el" href="forth_8h-source.html">forth.h</a>.<table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr><tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classForth.html#a0">Reset</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__forth.html#ga0">CELL</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classForth.html#a1">Quit</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__forth.html#ga0">CELL</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classForth.html#a2">Execute</a> (<a class="el" href="group__forth.html#ga0">CELL</a> xt)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__forth.html#ga0">CELL</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classForth.html#a3">Evaluate</a> (const <a class="el" href="group__forth.html#ga2">CHAR</a> *text, <a class="el" href="group__integers.html#ga6">uint</a> textLength)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classForth.html#a4">Push</a> (const <a class="el" href="group__forth.html#ga0">CELL</a> *cells, <a class="el" href="group__integers.html#ga6">uint</a> numCells)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="group__forth.html#ga0">CELL</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classForth.html#a5">Pop</a> (<a class="el" href="group__integers.html#ga6">uint</a> numCells)</td></tr><tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classForth.html">Forth</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classForth.html#e0">Construct</a> (void *memoryStart, <a class="el" href="group__integers.html#ga6">uint</a> memorySize, <a class="el" href="classForthIo.html">ForthIo</a> *ioHandler)</td></tr></table><hr><h2>Member Function Documentation</h2><a class="anchor" name="e0" doxytag="Forth::Construct"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"><a class="el" href="classForth.html">Forth</a> * Forth::Construct </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">void * </td> <td class="mdname" nowrap> <em>memoryStart</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap><a class="el" href="group__integers.html#ga6">uint</a> </td> <td class="mdname" nowrap> <em>memorySize</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap><a class="el" href="classForthIo.html">ForthIo</a> * </td> <td class="mdname" nowrap> <em>ioHandler</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"><code> [static]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Construct a forth virtual machine in the specified memory region.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>memoryStart</em> </td><td>Start address of memory. </td></tr> <tr><td valign="top"></td><td valign="top"><em>memorySize</em> </td><td>Size of memory. </td></tr> <tr><td valign="top"></td><td valign="top"><em>ioHandler</em> </td><td>Pointer to the console i/o object the VM will use.</td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>Pointer to VM or 0 if <em>memorySize</em> is too small.</dd></dl><p>Definition at line <a class="el" href="forth_8cpp-source.html#l02272">2272</a> of file <a class="el" href="forth_8cpp-source.html">forth.cpp</a>. </td> </tr></table><a class="anchor" name="a0" doxytag="Forth::Reset"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">void Forth::Reset </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Reset the virtual machine state to that of a newly constructed object.<p>Definition at line <a class="el" href="forth_8cpp-source.html#l02285">2285</a> of file <a class="el" href="forth_8cpp-source.html">forth.cpp</a>. </td> </tr></table><a class="anchor" name="a1" doxytag="Forth::Quit"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"><a class="el" href="group__forth.html#ga0">CELL</a> Forth::Quit </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Perform the action of the forth word <code>QUIT</code>. I.e. continuously accept console input and interpret it.<p>To exit this function, enter the word <code>BYE</code> at the console.<p><dl compact><dt><b>Returns:</b></dt><dd>0 or a forth execption value.</dd></dl><p>Definition at line <a class="el" href="forth_8cpp-source.html#l02291">2291</a> of file <a class="el" href="forth_8cpp-source.html">forth.cpp</a>. </td> </tr></table><a class="anchor" name="a2" doxytag="Forth::Execute"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"><a class="el" href="group__forth.html#ga0">CELL</a> Forth::Execute </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group__forth.html#ga0">CELL</a> </td> <td class="mdname1" valign="top" nowrap> <em>xt</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Execute a forth execution token.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>xt</em> </td><td>A forth execution token.</td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>0 or a forth execption value.</dd></dl><p>Definition at line <a class="el" href="forth_8cpp-source.html#l02297">2297</a> of file <a class="el" href="forth_8cpp-source.html">forth.cpp</a>. </td> </tr></table><a class="anchor" name="a3" doxytag="Forth::Evaluate"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"><a class="el" href="group__forth.html#ga0">CELL</a> Forth::Evaluate </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="group__forth.html#ga2">CHAR</a> * </td> <td class="mdname" nowrap> <em>text</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap><a class="el" href="group__integers.html#ga6">uint</a> </td> <td class="mdname" nowrap> <em>textLength</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Evaluate (interpret) a text string.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>text</em> </td><td>Pointer to string. </td></tr> <tr><td valign="top"></td><td valign="top"><em>textLength</em> </td><td>Number of characters in string.</td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>0 or a forth execption value.</dd></dl><p>Definition at line <a class="el" href="forth_8cpp-source.html#l02303">2303</a> of file <a class="el" href="forth_8cpp-source.html">forth.cpp</a>. </td> </tr></table><a class="anchor" name="a4" doxytag="Forth::Push"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">void Forth::Push </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="group__forth.html#ga0">CELL</a> * </td> <td class="mdname" nowrap> <em>cells</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap><a class="el" href="group__integers.html#ga6">uint</a> </td> <td class="mdname" nowrap> <em>numCells</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Push a number of cells onto the forth parameter stack. Values are pushed in reverse order. E.g. <em>cells</em>[<em>numCells</em> -1] will be pushed first and <em>cells</em> [0] will be the top item on the stack.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>cells</em> </td><td>Pointer to values to be pushed. </td></tr> <tr><td valign="top"></td><td valign="top"><em>numCells</em> </td><td>Number of values to be pushed.</td></tr> </table></dl><p>Definition at line <a class="el" href="forth_8cpp-source.html#l02315">2315</a> of file <a class="el" href="forth_8cpp-source.html">forth.cpp</a>. </td> </tr></table><a class="anchor" name="a5" doxytag="Forth::Pop"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">const <a class="el" href="group__forth.html#ga0">CELL</a> * Forth::Pop </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group__integers.html#ga6">uint</a> </td> <td class="mdname1" valign="top" nowrap> <em>numCells</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Pop a number of cells off the forth parameter stack.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>numCells</em> </td><td>Number of values to be popped. This can be zero, in which case no values are removed from the stack, but a pointer to the top-most value is still returned; enabling values on the stack to read without removing them.</td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>Pointer to top most stack value popped; other values follow this in memory. These values become invalid once any other Forth class method is called.</dd></dl><p>Definition at line <a class="el" href="forth_8cpp-source.html#l02309">2309</a> of file <a class="el" href="forth_8cpp-source.html">forth.cpp</a>. </td> </tr></table><hr>The documentation for this class was generated from the following files:<ul><li>forth/<a class="el" href="forth_8h-source.html">forth.h</a><li>forth/<a class="el" href="forth_8cpp-source.html">forth.cpp</a></ul><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.1</SMALL></ADDRESS></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -