Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

Test - Test code for forth virtual machine
[Forth - Forth virtual machine]


Classes

class  StdForthIo
class  ForthTest

Defines

#define SOURCE_ROOT_PATH   "forth\\"
#define STRING(string)   string
#define LINE(string)   string "\n"
#define COUNTED_STRING(string)   (CHAR*)STRING(string),(sizeof(string)-1)

Functions

bool ReadFile (const char *name, void *&address, unsigned &size)
void TestForth ()
CELL ForthTest::Include (const char *fileName)
CELL ForthTest::IncludeLines (const char *fileName)


Define Documentation

#define SOURCE_ROOT_PATH   "forth\\"
 

Path for source code location

Definition at line 43 of file forthtest.cpp.

#define STRING string   )     string
 

Macro to include string constants in source which match the width of the CHAR type.

Definition at line 107 of file forthtest.cpp.

#define LINE string   )     string "\n"
 

Macro to include a line of text as an in-source constant .

Definition at line 109 of file forthtest.cpp.

#define COUNTED_STRING string   )     (CHAR*)STRING(string),(sizeof(string)-1)
 

Construct counted string arguments in the form (CHAR*)string,(CELL)stringLength

Parameters:
string A quoted string, e.g. "A string"

Definition at line 204 of file forthtest.cpp.


Function Documentation

bool ReadFile const char *  name,
void *&  address,
unsigned &  size
 

Read a files contents into memory. The file is assumed to contain characters of 8 bit size but they are stored in memory as characters the same size as the Forth VM's CHAR.

Parameters:
name The file name.
address On success, this is the address of the memory cell containing the read contents. This memory must be freed when it is no longer required.
size On success, this is the number of characters in the file.
Returns:
True, if the read was successful, false otherwise.

Definition at line 77 of file forthtest.cpp.

void TestForth  ) 
 

Top level test function. Call this to perform all tests.

Definition at line 210 of file forthtest.cpp.

CELL ForthTest::Include const char *  fileName  )  [inherited]
 

Load the contents of a file and EVALUATE it.

Parameters:
fileName The name of the file.
Returns:
0 or a forth execption value.

Definition at line 135 of file forthtest.cpp.

CELL ForthTest::IncludeLines const char *  fileName  )  [inherited]
 

Load the contents of a file and EVALUATE it a line at a time.

Parameters:
fileName The name of the file.
Returns:
0 or a forth execption value.

Definition at line 150 of file forthtest.cpp.


Generated by  doxygen 1.4.4