next up previous index
Next: ON clauses Up: Structure of a script Previous: Structure of a script

ROOT and ROOTS

    A RainCode script does not execute just by itself. It operates on one or more parse trees which describe a source file each. Accessing these parse trees is controlled by two variables:

ROOT
is meant to be used if one source file is managed at the time. It refers to a non-terminal value made of the root of the parse tree.
ROOTS
is meant to be used if more than a single source file is managed at any time. It then refers to a list of values made of the roots of the various source files that are analyzed together.

The two variables are always defined, but are mutually exclusive when it comes to holding a significant value. In other words, if a single source code is being analysed, ROOT holds a significant value and ROOTS is void; while ROOT is void and ROOTS holds a significant value if more than a single source is being analysed.