INTERFACETypes and procedures for defining Juno modules implemented by external procedures.ExternalProc ;
IMPORT View, JunoAST, JunoScope, JunoRT; TYPE Closure = JunoRT.ExternalCode BRANDED "ExternalProc.Closure" OBJECT rt: View.Root END; (* A closure is the object passed to external procedures. *) PROCEDURE SetupBind(mod: JunoAST.Id; scp: JunoScope.T; rt: View.Root := NIL);
This module maintains a current root, a current module name, and a current scope to be used by theBind
procedure below. Set the current root tort
, the current module name tomod
, and the current scope toscp
.
PROCEDURE Bind(name: JunoAST.Id; cl: Closure; in, out := 0);
Allocate a slot in the external code table for the procedure named<mod>.<name>
(where <mod> is the current module); setcl.rt
to the current root; and bindname
to a procedure entity within
IN parameters, 0 INOUT parameters, andout
OUT parameters in the current scope.
END ExternalProc.