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

📄 goop.htm

📁 strongForth: a strongly typed dialect of Forth implemented in ANS Forth.
💻 HTM
📖 第 1 页 / 共 4 页
字号:
condition exists if <kbd>STRUCTURE</kbd> was not previously created by 
<kbd>(NEW)</kbd>. 
An exception is thrown if the memory space canot be returned.</p>
<hr><p><pre><b>DESTRUCTOR ( OBJECT -- 1ST )</b></pre></p>
<p>Do nothing.</p>
<p><kbd>DESTRUCTOR</kbd> is the destructor of class <kbd>OBJECT</kbd>.</p>
<hr><p><pre><b>ENCLOSE-VTABLE ( ADDRESS -- VTABLE-SIZE ADDRESS -> TOKEN ADDRESS -> TOKEN )</b></pre></p>
<p><kbd>VTABLE-SIZE</kbd> is the size in address units of the virtual 
member table of the class 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. The first <kbd>ADDRESS -> TOKEN</kbd> is the 
address of the first token in the virtual member table. The second 
<kbd>ADDRESS -> TOKEN</kbd> is the address of the cell after the last 
token in the virtual member table.</p>
<hr><p><pre><b>ENDCLASS ( WID TUPLE -> WID OBJ-SIZE -- )</b></pre></p>
<p>With <kbd>OBJ-SIZE</kbd> being the number of bits occupied by the 
data members of the class <kbd>THIS-CLASS</kbd>, calculate the number 
of cells of the class and store the corresponding number of address 
units in its virtual member table. Restore the compilation word list 
to <kbd>WID</kbd>. Restore the search order to the one saved in 
<kbd>TUPLE -> WID</kbd>. If class <kbd>THIS-CLASS</kbd> has friends, 
make the <kbd>PRIVATE</kbd> and <kbd>PROTECTED</kbd> word lists 
available as one combined word list.</p>
<p><kbd>ENDCLASS</kbd> is used in the form 
<kbd>CLASS <em>name</em> ... BODY ... ENDCLASS</kbd> to terminate the 
definition of a class.</p>
<hr><p><pre><b>ENDSTRUCT ( STRUCT-SIZE -- )</b></pre></p>
<p>With <kbd>STRUCT-SIZE</kbd> being the number of bits occupied by the 
data members of the structure <kbd>THIS-CLASS</kbd>, calculate the number 
of cells of the structure and store the corresponding number of address 
units as an attribute of the structure. </p>
<p><kbd>ENDSTRUCT</kbd> is used in the form 
<kbd>STRUCT <em>name</em> ... ENDSTRUCT</kbd> to terminate the definition 
of a structure.</p>
<hr><p><pre><b>ENDUNION ( STRUCT-SIZE STRUCT-SIZE STRUCT-SIZE -- 3RD )</b></pre></p>
<p>Terminate a union of data members within a structure or 
class definition. <kbd>3RD</kbd> is the 
maximum of the second and the third <kbd>STRUCT-SIZE</kbd>.</p>
<hr><p><pre><b>ERASE ( BADDRESS -> SINGLE UNSIGNED -- )</b></pre></p>
<p>If <kbd>UNSIGNED</kbd> is not equal to zero, clear all bits in each 
of <kbd>UNSIGNED</kbd> consecutive bit fields beginning 
at <kbd>BADDRESS -> SINGLE</kbd>. Only the number of low-order 
bits corresponding to the length of the bit fields are transferred.</p>
<hr><p><pre><b>ERASE ( OBJECT -- )</b></pre></p>
<p>Clear all bits in all data members of <kbd>OBJECT</kbd>.</p>
<hr><p><pre><b>FILL ( BADDRESS -> SINGLE UNSIGNED 2ND -- )</b></pre></p>
<p>If <kbd>UNSIGNED</kbd> is not equal to zero, store <kbd>2ND</kbd> in 
each of <kbd>UNSIGNED</kbd> consecutive bit fields
beginning at <kbd>BADDRESS -> SINGLE</kbd>. Only the number of low-order 
bits corresponding to the length of the bit fields are transferred.</p>
<hr><p><pre><b>FRIENDS( ( OBJ-SIZE "&lt;spaces><em>name1</em>&lt;spaces><em>name2</em> ... &lt;spaces><em>namen</em> )" -- 1ST )</b></pre></p>
Create a list of <em>n</em> friend classes of the class 
<kbd>THIS-CLASS</kbd> by repeatedly skipping leading spaces, parsing 
<em>name</em>, and adding the class identified by <em>name</em> to the 
list of friends of class <kbd>THIS-CLASS</kbd>. The list of friend 
classes is terminated by <kbd>)</kbd>. <kbd>OBJ-SIZE</kbd> is a dummy 
parameter that ensures that <kbd>FRIENDS(</kbd> is always used within 
the body of a class definition. <kbd>1ST</kbd> is equal to 
<kbd>OBJ-SIZE</kbd>.</p>
<p><kbd>FRIENDS(</kbd> may be used zero or one time within the body of 
a class definition. An exception is thrown if <kbd>FRIENDS(</kbd> is 
executed more than once within the body of a class definition, or if 
a <em>name</em> is parsed that does not identify a class.</p>
<p>The friend classes of class <kbd>THIS-CLASS</kbd> may be granted access 
to the <kbd>PRIVATE</kbd> and <kbd>PROTECTED</kbd> word lists of class 
<kbd>THIS-CLASS</kbd> by using <kbd>ACCESS</kbd> within the class 
definitions of the friend classes</p>
<hr><p><pre><b>IS ( OBJ-SIZE DEFINITION "&lt;spaces><em>name</em>" -- 1ST )</b></pre></p>
<p>Skip leading space delimiters. Parse <em>name</em> delimited by a space. 
Find a virtual member <em>name</em> whose stack diagram is 
identical to the one of <kbd>DEFINITION</kbd>, except for the last 
input parameter, which may also be a direct or indirect parent type of the 
last input parameter of <kbd>DEFINITION</kbd>. In the virtual member table 
of class <kbd>THIS-CLASS</kbd>, 
assign the execution semantics of <kbd>DEFINITION</kbd> to <em>name</em>. 
An exception is thrown if no virtual member with name <em>name</em> exists 
whose stack diagram is identical to the one of <kbd>DEFINITION</kbd>, or if 
<kbd>DEFINITION</kbd> is unfinished.</p>
<p>Virtual members are words defined by <kbd>VIRTUAL</kbd>.</p>
<p><kbd>OBJ-SIZE</kbd> is a dummy parameter that ensures that 
<kbd>IS</kbd> is always used within the body of a class definition. 
<kbd>1ST</kbd> is equal to <kbd>OBJ-SIZE</kbd>.</p>
<hr><p><pre><b>ISVIRTUAL ( SIGNED DEFINITION SINGLE -- 1ST )</b></pre></p>
<p><kbd>1ST</kbd> is equal to <kbd>SIGNED</kbd> if and only if the 
following conditions are met:</p>
<ol>
 <li><kbd>DEFINITION</kbd> is a virtual member function.</li>
 <li>The stack diagram of <kbd>DEFINITION</kbd> is exactly the same as the 
 stack diagram of the sample definition <kbd>SINGLE</kbd>; except for the 
 last input parameter.</li>
 <li>The last input parameter of <kbd>DEFINITION</kbd> is either identical to 
 the last input parameter of the sample definition <kbd>SINGLE</kbd>, or a 
 direct or indirect parent of it.</li>
</ol> 
<p>If one condition is not met, <kbd>1ST</kbd> is zero. 
<kbd>ISVIRTUAL</kbd> is used as a callback word that implements an additional 
matching criterion for <kbd>SEARCH</kbd>.</p>
<hr><p><pre><b>LSB ( BADDRESS -- UNSIGNED )</b></pre></p>
<p><kbd>UNSIGNED</kbd> is the bit position of the least 
significant bit of the bit field specified by <kbd>BADDRESS</kbd>.</p>
<hr><p><pre><b>MEMBER ( STRUCT-SIZE SINGLE "&lt;spaces><em>name</em>" -- 1ST )</b></pre></p>
<p>Perform the semantics of <kbd>AUTOTHIS</kbd> if <kbd>THIS-CLASS</kbd> 
is a class.</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>STRUCT-SIZE</kbd> aligned to cell size, plus the number of bits 
in one cell.</p>
<p><em>name</em> is referred to as a <em>data member</em>. <kbd>MEMBER</kbd> 
allocates one cell for a data member of data type <kbd>SINGLE</kbd> in the 
structure or class <kbd>THIS-CLASS</kbd>.</p>
Execution: <b><kbd>( x -- ADDRESS -> SINGLE )</kbd></b>
<br><kbd>ADDRESS -> SINGLE</kbd> is the address of the 
data member of the structure or object <kbd>x</kbd>, that was allocated at 
the time <em>name</em> was created.</p>
<hr><p><pre><b>MEMBER ( STRUCT-SIZE DOUBLE "&lt;spaces><em>name</em>" -- 1ST )</b></pre></p>
<p>Perform the semantics of <kbd>AUTOTHIS</kbd> if <kbd>THIS-CLASS</kbd> 
is a class.</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>STRUCT-SIZE</kbd> aligned to cell size, plus the number of bits 
in two cells.</p>
<p><em>name</em> is referred to as a <em>data member</em>. <kbd>MEMBER</kbd> 
allocates two cells for a data member of data type <kbd>DOUBLE</kbd> in the 
structure or class <kbd>THIS-CLASS</kbd>.</p>
Execution: <b><kbd>( x -- ADDRESS -> DOUBLE )</kbd></b>
<br><kbd>ADDRESS -> DOUBLE</kbd> is the address of the 
data member of the structure or object <kbd>x</kbd>, that was allocated at 
the time <em>name</em> was created.</p>
<hr><p><pre><b>MEMBERS ( STRUCT-SIZE SINGLE UNSIGNED "&lt;spaces><em>name</em>" -- 1ST )</b></pre></p>
<p>Perform the semantics of <kbd>AUTOTHIS</kbd> if <kbd>THIS-CLASS</kbd> 
is a class.</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>STRUCT-SIZE</kbd> aligned to cell size, plus <kbd>UNSIGNED</kbd> 
times the number of bits in one cell.</p>
<p><em>name</em> is referred to as a <em>data member</em>. <kbd>MEMBERS</kbd> 
allocates <kbd>UNSIGNED</kbd> consecutive cells for data members of data type 
<kbd>SINGLE</kbd> in the structure or class <kbd>THIS-CLASS</kbd>.</p>
Execution: <b><kbd>( x -- ADDRESS -> SINGLE )</kbd></b>
<br><kbd>ADDRESS -> SINGLE</kbd> is the address of the first of <kbd>UNSIGNED</kbd> 
data members of the structure or object <kbd>x</kbd>, that were allocated at 
the time <em>name</em> was created.</p>
<hr><p><pre><b>MEMBERS ( STRUCT-SIZE DOUBLE UNSIGNED "&lt;spaces><em>name</em>" -- 1ST )</b></pre></p>
<p>Perform the semantics of <kbd>AUTOTHIS</kbd> if <kbd>THIS-CLASS</kbd> 
is a class.</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>STRUCT-SIZE</kbd> aligned to cell size, plus <kbd>UNSIGNED</kbd> 
times the number of bits in two cells.</p>
<p><em>name</em> is referred to as a <em>data member</em>. <kbd>MEMBERS</kbd> 
allocates <kbd>UNSIGNED</kbd> consecutive double cells for data members of 
data type <kbd>DOUBLE</kbd> in the structure or class <kbd>THIS-CLASS</kbd>.</p>
Execution: <b><kbd>( x -- ADDRESS -> DOUBLE )</kbd></b>
<br><kbd>ADDRESS -> DOUBLE</kbd> is the address of the first of <kbd>UNSIGNED</kbd> 
data members of the structure or object <kbd>x</kbd>, that were allocated at 
the time <em>name</em> was created.</p>
<hr><p><pre><b>MSB ( BADDRESS -- UNSIGNED )</b></pre></p>
<p><kbd>UNSIGNED</kbd> is the bit position of the most significant bit 
of the bit field specified by <kbd>BADDRESS</kbd>. If the bit 
field crosses a cell boundary, the value of <kbd>UNSIGNED</kbd> is 
greater or equal to the number of bits in one cell.</p>
<hr><p><pre><b>NEW ( "&lt;spaces><em>name</em>" -- )</b></pre></p>
<p>Execution: <b><kbd>( -- STRUCTUR )</kbd></b> or <b><kbd>( -- OBJECT )</kbd></b>
<br>Save the input source specification. Skip leading space delimiters. 
Parse <em>name</em> delimited by a space. Find <em>name</em> and 
determine the data type with the name <em>name</em>.
If <em>name</em> is a structure, discard the saved input source 
specification and evaluate <kbd>(NEW)</kbd> together with 
a literal of data type <kbd>ADDRESS -> <em>name</em></kbd> to create 
a new structure with data type <em>name</em>.
If <em>name</em> is an object, restore the input source 
specification and evaluate <kbd>(NEW)</kbd> together with 
a literal of data type <kbd>ADDRESS -> <em>name</em></kbd> to create 
a new object with data type <em>name</em>.
An exception is thrown if the given data type is neither a structure 
nor an object.</p>
<p><kbd>NEW</kbd> is an immediate word.</p>
<hr><p><pre><b>OBJ-SIZE ( STACK-DIAGRAM -- 1ST )</b></pre></p>
<p>When used in a stack diagram, specifies an input or output parameter 
with data type <kbd>OBJ-SIZE</kbd>.</p>
<hr><p><pre><b>OBJECT ( STACK-DIAGRAM -- 1ST )</b></pre></p>
<p>When used in a stack diagram, specifies an input or output parameter 
with data type <kbd>OBJECT</kbd>. All classes are direct or 
indirect subtypes of data type <kbd>OBJECT</kbd>.</p>

⌨️ 快捷键说明

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