Translates a given Mazeppa program to C11 (with GNU extensions).
oc
is the output channel to which the resulting C code will be written. The input program must have the main
function defined (otherwise, Panic
will be raised); entry
will be the name of an extern
C function that will correspond to your original main
. If there is a scoping violation (such as referencing an undefined variable), Panic
will be raised.
entry
will be the only generated function with external linkage. For example, if your main
function looks like this:
main(xs, ys, zs) := append(append(xs, ys), zs);
then the corresponding C function will have the following prototype:
extern mz_Value entry(mz_Value, mz_Value, mz_Value);
where mz_Value
refers to the type definition from mazeppa.h
.