
346 Compilers – Principles and Practice
c
Forth definitions can be implemented in Forth – called high-level definitions – or in some other
way, usually a lower-level language and as a result often called low-level definitions, code
definitions or primitives.
c
Many Forth systems are implemented mainly in Forth.
If you want to learn and use FORTH in some application, you should start by getting familiar with
the following words in FORTH:
Arithmetic: + − * / /MOD */ ABS INVERT
Comparison: MIN MAX =
Logic: AND OR XOR NOT
Stack manipulation: DUP DROP SWAP OVER
Loops and decisions: IF ELSE ENDIF ?DO I LOOP
Input/Output: . ." EMIT CR KEY
Defining words: ...