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

📄 goop.htm

📁 strongForth: a strongly typed dialect of Forth implemented in ANS Forth.
💻 HTM
📖 第 1 页 / 共 4 页
字号:
<hr><p><pre><b>OBJECT? ( DATA-TYPE -- ADDRESS )</b></pre></p>
<p>If <kbd>DATA-TYPE</kbd> is a class, <kbd>ADDRESS</kbd> is the address 
of the data field of the definition that is associated with 
<kbd>DATA-TYPE</kbd>. Otherwise, <kbd>ADDRESS</kbd> is zero.</p>
<hr><p><pre><b>PARENT? ( DATA-TYPE DATA-TYPE -- ADDRESS )</b></pre></p>
<p>If the first <kbd>DATA-TYPE</kbd> is a direct or indirect subtype 
of the second <kbd>DATA-TYPE</kbd>, or if the first <kbd>DATA-TYPE</kbd> 
is equal to the second <kbd>DATA-TYPE</kbd>, <kbd>ADDRESS</kbd> is the 
address of the code field of the definition that is associated with the 
first <kbd>DATA-TYPE</kbd>. Otherwise, <kbd>ADDRESS</kbd> is zero.</p>
<hr><p><pre><b>PRIVATE ( -- )</b></pre></p>
<p>Replace the first word list in the search order with the 
<kbd>PRIVATE</kbd> word list. An ambiguous condition exists if the 
<kbd>PRIVATE</kbd> word list is used outside of a class definition.</p>
<p><kbd>PRIVATE</kbd> is a vocabulary.</p>
<hr><p><pre><b>PRIVATE-LAST ( -- ADDRESS -> ADDRESS )</b></pre></p>
<p><kbd>ADDRESS -> ADDRESS</kbd> is the address of a cell that contains the 
name field address of the most recent definition in the <kbd>PRIVATE</kbd> 
word list.</p>
<hr><p><pre><b>PRIVATE-WORDLIST ( -- WID )</b></pre></p>
<p><kbd>WID</kbd> is the identifier of the <kbd>PRIVATE</kbd> word list.</p>
<hr><p><pre><b>PROCREATES ( DATA-TYPE "&lt;spaces><em>name</em>" -- )</b></pre></p>
<p>Extend the semantics of <kbd>PROCREATES</kbd> as follows. 
If <kbd>DATA-TYPE</kbd> is a structure, allocate one additional cell in 
the data field of the definition that is associated with the new data 
type. If <kbd>DATA-TYPE</kbd> is a class, allocate four additional 
cells in the data field of the definition that is associated with the 
new data type.</p>
<hr><p><pre><b>PROTECTED ( -- )</b></pre></p>
<p>Replace the first word list in the search order with the 
<kbd>PROTECTED</kbd> word list. An ambiguous condition exists if the 
<kbd>PROTECTED</kbd> word list is used outside of a class definition.</p>
<p><kbd>PROTECTED</kbd> is a vocabulary.</p>
<hr><p><pre><b>PROTECTED-LAST ( -- ADDRESS -> ADDRESS )</b></pre></p>
<p><kbd>ADDRESS -> ADDRESS</kbd> is the address of a cell that contains the 
name field address of the most recent definition in the <kbd>PROTECTED</kbd> 
word list.</p>
<hr><p><pre><b>PROTECTED-WORDLIST ( -- WID )</b></pre></p>
<p><kbd>WID</kbd> is the identifier of the <kbd>PROTECTED</kbd> word list.</p>
<hr><p><pre><b>PURE-VIRTUAL ( OBJECT -- )</b></pre></p>
<p>Drop <kbd>OBJECT</kbd> and throw an exception.</p>
<p><kbd>PURE-VIRTUAL</kbd> is a dummy word to be executed in the place of 
pure virtual members.</p>
<hr><p><pre><b>SIZE ( BADDRESS -- UNSIGNED )</b></pre></p>
<p><kbd>UNSIGNED</kbd> is the length of the bit field specified by 
<kbd>BADDRESS</kbd>.</p>
<hr><p><pre><b>SIZE ( OBJECT -- UNSIGNED )</b></pre></p>
<p><kbd>UNSIGNED</kbd> is the size in cells of the data members of 
<kbd>OBJECT</kbd>.</p>
<hr><p><pre><b>SIZE-OBJECT ( ADDRESS -- UNSIGNED )</b></pre></p>
<p><kbd>UNSIGNED</kbd> is the size in address units of an object whose 
class is identified by <kbd>ADDRESS</kbd>. An ambiguous condition exists if 
<kbd>ADDRESS</kbd> is not the address of the virtual member table of a 
class.</p>
<hr><p><pre><b>SIZE-OBJECT ( DATA-TYPE -- UNSIGNED )</b></pre></p>
<p><kbd>UNSIGNED</kbd> is the size in address units of objects of class 
<kbd>DATA-TYPE</kbd>. 
An exception is thrown if <kbd>DATA-TYPE</kbd> is not a class.</p>
<hr><p><pre><b>SIZE-STRUCTURE ( ADDRESS -- UNSIGNED )</b></pre></p>
<p><kbd>UNSIGNED</kbd> is the size in address units of the structure 
identified by <kbd>ADDRESS</kbd>. An ambiguous condition exists if 
<kbd>ADDRESS</kbd> was not produced by <kbd>STRUCTURE?</kbd> or 
<kbd>?STRUCTURE</kbd>.</p>
<hr><p><pre><b>SIZE-STRUCTURE ( DATA-TYPE -- UNSIGNED )</b></pre></p>
<p><kbd>UNSIGNED</kbd> is the size in address units of the structure 
<kbd>DATA-TYPE</kbd>. 
An exception is thrown if <kbd>DATA-TYPE</kbd> is not a structure.</p>
<hr><p><pre><b>STRIP-WORDLIST ( -- )</b></pre></p>
<p>Transform the search order consisting of 
<kbd>wid1, ... widn-1, widn</kbd> (where <kbd>wid1</kbd> is searched 
first) into <kbd>wid1, ... widn-1</kbd>. An exception is thrown if the 
search order was empty before <kbd>STRIP-WORDLIST</kbd> was executed.</p>
<hr><p><pre><b>STRUCT ( -- STRUCT-SIZE )</b></pre></p>
<p>Skip leading space delimiters. Parse <em>name</em> delimited by a space. 
Find <em>name</em> and assign the data type with the name <em>name</em> to 
<kbd>THIS-CLASS</kbd>. An exception is thrown if <em>name</em> is not a 
structure, or if the parent of <em>name</em> has not yet been defined. 
<kbd>STRUCT-SIZE</kbd> is the size in bits of the parent of 
<em>name</em>.</p>
<p><kbd>STRUCT</kbd> is used in the form 
<kbd>STRUCT <em>name</em> ... ENDSTRUCT</kbd> to define the data members of 
a structure <em>name</em>.</p>
<hr><p><pre><b>STRUCT-SIZE ( STACK-DIAGRAM -- 1ST )</b></pre></p>
<p>When used in a stack diagram, specifies an input or output parameter 
with data type <kbd>STRUCT-SIZE</kbd>.</p>
<hr><p><pre><b>STRUCTURE ( STACK-DIAGRAM -- 1ST )</b></pre></p>
<p>When used in a stack diagram, specifies an input or output parameter 
with data type <kbd>STRUCTURE</kbd>. All structures are direct or 
indirect subtypes of data type <kbd>STRUCTURE</kbd>.</p>
<hr><p><pre><b>STRUCTURE? ( DATA-TYPE -- ADDRESS )</b></pre></p>
<p>If <kbd>DATA-TYPE</kbd> is a structure, <kbd>ADDRESS</kbd> is the 
address of a cell that contains the size in address units of structures 
with data type <kbd>DATA-TYPE</kbd>. Otherwise, <kbd>ADDRESS</kbd> is zero.</p>
<hr><p><pre><b>THIS-CLASS ( -- DATA-TYPE )</b></pre></p>
<p><kbd>DATA-TYPE</kbd> is the data type whose class definition is 
currently being compiled. If no class is currently being compiled, 
<kbd>DATA-TYPE</kbd> is undefined.</p>
<hr><p><pre><b>THIS-PARENT ( -- DATA-TYPE )</b></pre></p>
<p><kbd>DATA-TYPE</kbd> is the parent of the data type whose class 
definition is currently being compiled. An ambiguous condition exists 
if no class is currently being compiled.</p>
<hr><p><pre><b>THIS-VTABLE ( -- ADDRESS -> ADDRESS )</b></pre></p>
<p><kbd>ADDRESS -> ADDRESS</kbd> is the address of the first of two cells. 
The first cell contains the address of the virtual member table of the 
class <kbd>THIS-CLASS</kbd>. 
The second cell contains the address of the friends table of the class 
<kbd>THIS-CLASS</kbd>. An ambiguous condition exists if 
<kbd>THIS-CLASS</kbd> is not a class.</p>
<hr><p><pre><b>UNION ( STRUCT-SIZE -- 1ST 1ST 1ST )</b></pre></p>
<p>Starts a union of data members within a structure or class definition. 
All parameters <kbd>1ST</kbd> are equal to <kbd>STRUCT-SIZE</kbd>. The 
first <kbd>1ST</kbd> marks the starting bit position of the union, the 
second <kbd>1ST</kbd> marks the end bit position of the largest block so 
far, and the third <kbd>1ST</kbd> is the current bit position of the 
current block.</p>
<hr><p><pre><b>VTABLE-SIZE ( STACK-DIAGRAM -- 1ST )</b></pre></p>
<p>When used in a stack diagram, specifies an input or output parameter 
with data type <kbd>VTABLE-SIZE</kbd>.</p>
<hr><p><pre><b>VIRTUAL ( VTABLE-SIZE "&lt;spaces><em>name</em>" -- 1ST )</b></pre></p>
<p>Skip leading space delimiters. Parse <em>name</em> delimited by a 
space. Create a new definition for <em>name</em> with the execution semantics 
defined below, and make it the latest definition. <kbd>1ST</kbd> is equal 
to <kbd>VTABLE-SIZE</kbd> plus the size of a cell in address units. 
An exception is thrown if <kbd>VIRTUAL</kbd> is executed in compilation 
state.</p>
<p>If <em>name</em> is not yet in the <kbd>AUTOTHIS</kbd> word list, add 
a definition for <em>name</em> to the <kbd>AUTOTHIS</kbd> word 
list using <kbd>AUTOTHIS</kbd>.</p>
<p>Note that the new definition does have no stack effects by default. 
Stack effects have to be specified separately.
By using a stack diagram phrase <kbd>( ... -- ... )</kbd> immediately 
following <kbd>VIRTUAL</kbd> and the definition name, the new definition 
is modified to incorporate stack effects. An ambiguous condition exists 
if the stack diagram does not contain at least one input parameter, or if 
the last input parameter is not a class.</p>
<p><em>name</em> Execution: <b><kbd>( ... <em>class</em> -- ... )</kbd></b>
<br>Execute the definition whose token is stored in the virtual member 
table of <em>class</em>, the last input parameter of <em>name</em>. 
<em>class</em> is <kbd>OBJECT</kbd> or a direct or indirect subtype of 
<kbd>OBJECT</kbd>. The token is stored in the virtual member 
table by a succeeding	execution of <kbd>IS</kbd>. <em>name</em> is 
called a <em>virtual member</em>. An ambiguous condition exists 
if <em>name</em> is executed before it is being assigned an execution 
semantics by <kbd>IS</kbd>.</p>
<hr><p><pre><b>VIRTUAL-MATCH ( SIGNED DEFINITION SINGLE -- 1ST )</b></pre></p>
<p><kbd>1ST</kbd> is equal to <kbd>SIGNED</kbd> if and only if 
<kbd>DEFINITION</kbd> is a virtual member definition <em>and</em> 
the stack diagram of <kbd>DEFINITION</kbd> matches the contents of the 
contents of data type heap. Otherwise, <kbd>1ST</kbd> is zero.
The matching algorithm depends on the value of <kbd>SINGLE</kbd>.</p>
<p><kbd>SINGLE</kbd> = 0:<br>
In interpretation state, only words whose input parameters match the 
data types on the interpreter data type heap can be found. In compilation 
state, only non-immediate words whose input parameters match the data types 
on the compiler data type heap, and immediate words whose input parameters 
match the data types on the interpreter data type heap can be found.</p>
<p><kbd>SINGLE</kbd> = -1:<br>
Only words whose input parameters match the data types on the compiler 
data type heap can be found. An ambiguous condition exists if executed in 
interpretation state.</p>
<p><kbd>SINGLE</kbd> = address of a sample definition:<br>
Only words whose input parameters match the data types on the compiler 
data type heap can be found. Additionally, the output parameter list, 
after resolving all data type references to the input parameters, has 
to be identical to the output parameter list of the definition whose 
address is passed in parameter <kbd>SINGLE</kbd>.</p>
<hr><p><pre><b>[BIND] ( "&lt;spaces><em>name1</em>" "&lt;spaces><em>name2</em>" -- )</b></pre></p>
<p>Skip leading space delimiters. Parse <em>name1</em> delimited by a space. 
Find <em>name1</em> and determine the class with the name <em>name1</em>. 
Skip leading space delimiters. Parse <em>name2</em> delimited by a space. 
Find <em>name2</em>. Statically bind <em>name2</em> to the class with the name 
<em>name1</em> and compile it. An exception is thrown if a class with the name 
<em>name1</em> does not exist or if <em>name2</em> is not a virtual member. 
An ambiguous condition exists if <em>name2</em> is not a virtual member of 
the class with the name <em>name1</em>.</p>
<hr><p><pre><b>[PARENT] ( "&lt;spaces><em>name</em>" -- )</b></pre></p>
<p>Skip leading space delimiters. Parse <em>name</em> delimited by a space. 
Find <em>name</em>. Statically bind <em>name</em> to the parent of class 
<kbd>THIS-CLASS</kbd> and compile it. An exception is thrown if the parent 
of <kbd>THIS-CLASS</kbd> is not a class or if <em>name</em> is not a virtual 
member. An ambiguous condition exists if <em>name</em> is not a virtual 
member of the parent of <kbd>THIS-CLASS</kbd>.</p>
<hr>
<p><a href="http://home.vrweb.de/s.becher/">Dr. Stephan Becher</a> - January 30th, 2009</p></body>
</body>
</html>

⌨️ 快捷键说明

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