next up previous index
Next: Structure of a script Up: Procedures Previous: Recursion

Predefined procedures

RainCode allows you to define procedures with predefined names that will be called automatically on given circumstances. If no such procedure is defined, RainCode simply proceeds. These predefined procedures must be parameterless.

All the predefined procedures names available today or to be added in the future are fully in uppercase characters. Hence, using mixed identifiers - that is, identifiers with at least a single lowercase characters - for your own procedures ensures you that they will never conflict with the predefined ones.

The predefined procedures recognized by RainCode are:

INIT
 is called before a script starts, that is, before it walks through all the nodes of a parse tree.

TERMINATE
  is called after that a tree has been visited entirely. One usually redefines this procedure to close streams, output statistics, or issue a conclusion message after that a source file has been analyzed entirely.