The code generator has two access functions from the outside (from the view of software modules). (code-gen-proc classified_procedure) is used to generate WAM code from a classified procedure. This is the function we use from the outside to compile a procedure incrementally.
In the future, the compilation of a single clause may become important for dynamic asserts and retracts. The appropriate function to produce WAM code for a single classified clause is (code-gen-cc clause_classification).
If extensions to the code generator are made, one should ensure that this interface does not change.
In the following, functions for code generation are described. Nonterminals are used as input parameters representing the argument type. The right arrows prefix the returned value of the system, which is often represented by nonterminal symbols. The symbols in bold case are the terminal symbols.