toka.nbk: Home | Index | Next Page: ErrorCodes | Previous Page: decompile.c


 dictionary.c

Use

This file provides the functionality to create new dictionary entries and search for a specific entry.

Functions Provided

Variables:
  ENTRY dictionary[4096];
  Holds the dictionary entries, up to 4096

  long last
  A pointer to the most recent dictionary entry

add_entry(char *name, Inst xt, Inst class)
Add an entry to the dictionary.

name_attach(void *class)
Attach a name (from the input stream) to the 
specified quote address. This word is given the
semantics of the specified class.

name_quote()
Attach a name (from the input stream) to the 
specified quote address. This word is given the
semantics of quote_forth_class().

name_quote_macro()
Attach a name (from the input stream) to the 
specified quote address. This word is given the
semantics of quote_macro_class().

name_data()
Attach a name (from the input stream) to the data
at the specified address. Semantics are the same
as the data_class().

find_word()
Search for a word (name taken from the string
passed on TOS) in the dictionary. Returns the
xt, class, and a flag of -1 if found. If not
found, returns only a flag of 0.

return_quote()
Find a name (from the input stream) and return a
quote that corresponds to the word.

return_name()
Return a pointer to the name of a dictionary entry

return_xt()
Return the starting address of a word 

return_class()
Return the class number for a dictionary entry

Primitives Provided

is
is-data
is-macro
`
:name
:xt
:class
last

toka.nbk: Home | Index | Next Page: ErrorCodes | Previous Page: decompile.c


Notebook exported on Sunday, 1 July 2007, 19:54:43 PM EDT