StrongForth Search-Order Glossary


#ORDER ( -- DATA -> UNSIGNED )

DATA -> UNSIGNED is the address of a cell containing the number of word lists in the present search order.


#VOCS ( -- UNSIGNED )

UNSIGNED is the maximum number of word lists in the search order.


. ( WID -- )

Display the name of the vocabulary that corresponds to the word list identified by WID as a character string, followed by a space. If the word list is invalid or is not associated with a vocabulary, display ??? instead.


?DEFINITION ( WID -- DEFINITION )

DEFINITION is the vocabulary that corresponds to the word list identified by WID. If WID is not a valid word list, DEFINITION is the null definition.


ALSO ( -- )

Transform the search order consisting of wid1, wid2, ... widn (where wid1 is searched first) into wid1, wid1, wid2, ... widn. An exception is thrown if the search order is empty, or if there are too many word lists in the search order.


ASSEMBLER ( -- )

Replace the first word list in the search order with a word list that is reserved for the assembler.

ASSEMBLER is a vocabulary.


CONTEXT ( -- DATA -> WID )

DATA -> WID is the address of a number of cells that contain the identifiers of the word lists that constititute the search order. The first word list to be searched is the one whose identifier is stored at DATA -> WID.


DEFINITIONS ( -- )

Make the compilation word list the same as the first word list in the search order. Specifies that the names of subsequent definitions will be placed in the compilation word list. Subsequent changes in the search order will not affect the compilation word list.


DO-VOCABULARY ( -- )

Append the runtime semantics given below to the current definition.

Replace the first word list in the search order with the word list whose identifier is stored in the data field of the current definition.


EDITOR ( -- )

Replace the first word list in the search order with a word list that is reserved for the block editor.

EDITOR is a vocabulary.


ENVIRONMENT ( -- )

Replace the first word list in the search order with the ENVIRONMENT-WORDLIST word list.

ENVIRONMENT is a vocabulary.


FORTH ( -- )

Replace the first word list in the search order with the FORTH-WORDLIST word list.

FORTH is a vocabulary.


GET-ORDER ( -- TUPLE -> WID )

TUPLE -> WID is a tuple containing the identifiers of the word lists in the search order. The first identifier in the tuple identifies the word list that is searched first. The search order is unaffected.


LOCAL ( -- )

Replace the first word list in the search order with the LOCAL-WORDLIST word list.

LOCAL is a vocabulary.


MARKER ( "<spaces>name" -- )

Skip leading space delimiters. Parse name delimited by a space. Create a definition for name with the execution semantics defined below.

name Execution: ( -- )
Restore all dictionary allocation pointers, memory space pointers, and word lists to the state they had just prior to the definition of name. Remove the definition of name and all subsequent definitions. Restoration of any structures still existing that could refer to deleted definitions or deallocated data space is not necessarily provided. No other contextual information such as the number-conversion radix is affected.


ONLY ( -- )

Set the search order to the minimum search order, which consists only of the FORTH-WORDLIST word list.


ORDER ( -- )

Display the names of the vocabularies that correspnd to the word lists in the search order in their search order sequence, from first searched to last searched. Also display the name of the vocabulary that corresponds to the compilation word list.


PREVIOUS ( -- )

Transform the search order consisting of wid1, wid2, ... widn (where wid1 is searched first) into wid2, ... widn. An exception is thrown if the search order was empty before PREVIOUS was executed.


SEARCH-ALL ( CDATA -> CHARACTER UNSIGNED SINGLE CODE -- DEFINITION SIGNED )

Extend the semantics of SEARCH-ALL to be:

Search all word lists in the search order for the definition whose name is given by the character string CDATA -> CHARACTER UNSIGNED. If the definition is not found, return zero as DEFINITION and zero as SIGNED. If the definition is found, return it as DEFINITION. If the definition is an immediate word, also return one (+1), otherwise also return minus one (-1) as SIGNED.

CODE is the address of a machine code subroutine that applies additional matching criteria. If those matching criteria require a parameter, the parameter is passed by SINGLE. The subroutine expects register CX to contain either one or minus one, depending on whether the definition is an immediate word, BX to contain the value of SINGLE, and register pair ES:DI to contain the address of the definition's attribute field. If the definition matches the criterion, the register set remains unchanged. Otherwise, register CX becomes zero.

If UNSIGNED is zero, the definition's name is not considered by SEARCH-ALL. In this case, only the matching criteria specified by SINGLE and CODE matter.

SEARCH-ALL is a deferred definition.


SET-ORDER ( -- )

Set the search order to the minimum search order, which consists only of the FORTH-WORDLIST word list.


SET-ORDER ( TUPLE -> WID -- )

Set the search order to the word lists whose identifiers are contained in the tuple TUPLE -> WID. Subsequently, the first word list of the tuple will be searched first. If the tuple is empty, empty the search order. An exception is thrown if the size of the tuple is greater than the maximum number of word lists in the search order.


VOCABULARY ( "<spaces>name" -- )

Skip leading space delimiters. Parse name delimited by a space. Create a new empty word list. Create a definition for name with the execution semantics defined below. Store the identifier of the new word list and a link to the previous definition defined by VOCUBULARY in the data field of the new definition.

name Execution: ( -- )

Replace the first word list in the search order with the new word list.

Note: Words defined by VOCABULARY are called vocabularies.


VOC-LINK ( -- DATA -> DEFINITION )

DATA -> DEFINITION is the address of a double cell containing the most recently defined vocabulary.


WORDLIST ( -- WID ) 

Create a new empty word list, returning its word list identifier WID.


WORDS ( "<spaces>name" -- )

List all names and stack diagrams of the definitions in the first word list of the search order, whose name are identical to name. If the parameter name is not provided, list all names and stack diagrams of all definitions in the first word list of the search order. Each definition is displayed on a separate line.


Dr. Stephan Becher - February 9th, 2008