Skip to content

Compiler

Wolf Wejgaard edited this page Mar 25, 2017 · 10 revisions

Every TclForth word compiles itself. The TclForth interpreter parses the word from the source and passes control to the word.

This is similar to Tcl where the interpreter passes control to the commands. However, Tcl commands need the interpreter again to fetch their arguments from the input stream. TclForth words get their arguments ready to use on the parameter stack.

Action Words

A normal executable non-compiler word (proc, code, colon) appends a call to itself in the generated Tcl code, it adds its name and a closing ";".

Example: dup appends " dup ; "

Objecttypes

The object parses the following word in the source. If the word is a valid command of this type, the correspondig method script is evaluated. Else, if no command, the default ({}) method applies.

Compiler

Compiler words perform their defined actions. For example, the flow control words build a corresponding Tcl flow structure. The compiler words are defined in Tcl code.

Code window

You can inspect the compiled Tcl code in the code window in the console. Open the window in the Setupmenu.

Clone this wiki locally