Unit forth
Description
Toy scripting language with a stack, postfix notation and Logo-like control structures.
Uses
- strutils
- sysutils
- classes
- contnrs
Overview
Classes, Interfaces, Objects and Records
| Name | Description |
|---|---|
Record TForthWord |
|
Class EForthError |
Functions and Procedures
procedure def_builtin(const name: string; const proc: TProcedure); |
procedure def_const(const name: string; const data: real); |
procedure def_value(const name: string; const data: real); |
procedure def_var(const name: string); |
procedure def_colon(const name: string); |
procedure push_data(const n: real); |
function pop_data: real; |
procedure push_word(const w: PForthWord); |
function pop_word: PForthWord; |
procedure refill; |
procedure refill(const line_in: string); |
procedure interpret; |
procedure interpret(const code: TStringList); |
Types
PForthWord = ˆTForthWord; |
TExecToken = procedure(const w: PForthWord); |
Constants
whitespace = [#9, #10, #11, #12, #13, ' ']; |
version_string = '1.3.1 beta'; |
Variables
dictionary: TFPDataHashTable; |
stack: array of real; |
word_stack: array of PForthWord; |
stack_pointer: integer; |
word_pointer: integer; |
input_buffer: TStringList; |
parse_buffer: TStringList; |
code_buffer: TStringList; |
loop_buffer: TStringList; |
parse_guard: string; |
latest: string; |
state: (interpreting, buffering); |
Description
Functions and Procedures
procedure def_builtin(const name: string; const proc: TProcedure); |
procedure def_const(const name: string; const data: real); |
procedure def_value(const name: string; const data: real); |
procedure def_var(const name: string); |
procedure def_colon(const name: string); |
procedure push_data(const n: real); |
function pop_data: real; |
procedure push_word(const w: PForthWord); |
function pop_word: PForthWord; |
procedure refill; |
procedure refill(const line_in: string); |
procedure interpret; |
procedure interpret(const code: TStringList); |
Types
PForthWord = ˆTForthWord; |
TExecToken = procedure(const w: PForthWord); |
Constants
whitespace = [#9, #10, #11, #12, #13, ' ']; |
version_string = '1.3.1 beta'; |
Variables
dictionary: TFPDataHashTable; |
stack: array of real; |
word_stack: array of PForthWord; |
|
Used for variables and such. |
stack_pointer: integer; |
|
Right after the last element. |
word_pointer: integer; |
|
Right after the last element. |
input_buffer: TStringList; |
|
Always parse word by word. |
parse_buffer: TStringList; |
|
Always parse word by word. |
code_buffer: TStringList; |
|
Used in control structures. |
loop_buffer: TStringList; |
|
Used in control structures. |
parse_guard: string; |
|
Word where buffering state ends. |
latest: string; |
|
Name of the most recently defined word. |
state: (interpreting, buffering); |
Generated by PasDoc 0.16.0.