Next: Index
Up: Managing the modularity
Previous: Use clauses
When a module that imports other modules is executed through a number
of USE clauses, the behaviours is as follows:
-
RainCode first computes the transitive closure of all the
modules involved in the script, including it self. In
this transitive closure, each module occurs at most
once, even if it is imported several times by different
modules.
-
All the INIT procedures of all the modules are executed
once.
-
Then, each of the parse trees to analyse is considered
in sequence, each of the sub-nodes is visited, and
for each of these subnodes, all the matching
ON clauses of all the modules involved in the
script are executed.
-
Finally, all the TERMINATE procedures of all the modules are
executed once.