WordHeader Class Reference
[Internal - Internal implementation of the forth virtual machine]

Representation of a forth word's header in the dictionary. More...

List of all members.

Public Types

enum  WordFlags {
  Token = 1<<5,
  Immediate = 1<<6,
  Valid = 1<<7
}

Public Member Functions

CELLCFA ()

Public Attributes

CELL Previous
CHAR NameLength
CHAR Name [1]

Detailed Description

Representation of a forth word's header in the dictionary.

Definition at line 152 of file forth.cpp.


Member Enumeration Documentation

Bit flags representing the type of a word definition. The flags are present in NameLength.

Enumerator:
Token 

The words CFA contains its exection token value. (As opposed to a list of execution tokens.)

Immediate 

The word is an IMMEDIATE word.

Valid 

The word can be found in the dictionary.

Definition at line 183 of file forth.cpp.


Member Function Documentation

CELL* WordHeader::CFA (  ) 

Calculate the word's Code Field Address (CFA).

Returns:
The word's CFA.

Definition at line 196 of file forth.cpp.


Member Data Documentation

Link to the previous word in the wordlist, this is an address offset from 'this'. E.g. to get a pointer to the previous word:

    WordHeader* word = a_word;
    WordHeader* previous_word = (WordHeader*)((CELL)a_word+Previous);

If Previous equals zero then the end of the wordlist has been reached and the this header isn't associated with a word definition.

Definition at line 165 of file forth.cpp.

Length of the word's name. This also includes flag values from WordFlags. To mask out these flags, AND the value with NameLengthMask.

Definition at line 171 of file forth.cpp.

The first character of the name. Any subsequent characters follow immediately after this one.

Definition at line 177 of file forth.cpp.


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.1