-- JaMExecDefs.mesa -- Written by John Warnock, January, 1978. -- Last changed by Doug Wyatt, February 10, 1981 6:53 PM DIRECTORY JaMMasterDefs USING [Object]; JaMExecDefs: DEFINITIONS = { OPEN JaMMasterDefs; -- The following routines provide for the control of execution. It is -- assumed that the current stack is the execution stack. -- "Execute" executes the undiscriminated object. Execute: PROCEDURE; -- "If" is the implementation of the testing instruction. -- Two operands are required: an Object and a Boolean. If the -- Boolean is TRUE then the object is executed otherwise the -- object is popped. If: PROCEDURE; -- "IfElse" is the implementation of the two way conditional execution -- instruction. Three operands are required: Object1,Object2, and a Boolean. -- If the Boolean is TRUE then Object2 is executed otherwise Object1 is -- executed. IfElse: PROCEDURE; -- "Rept" is the "loop for count" instruction. Two operands are required: -- an IntegerType and an Object. The Object is executed for the number -- of times indicated by the Integer. (0 for Negative). Rept: PROCEDURE; -- "For" is based on the Algol "for i _ i step j until k do" instruction. -- Four operands are required: three IntegerTypes and an Object. -- The Object is executed for each iteration, with the current loop index on -- the operand stack. For: PROCEDURE; -- "Loop" is the "loop forever" instruction. One operand is required: -- The Object is executed until an ".exit" command is executed. Loop: PROCEDURE; -- "Exit" procedure pops the executionstack until the inner most loop is -- terminated. (until a mark is encountered). Exit: PROCEDURE; -- "Stop" procedure pops the executionstack and checkpoints the VM. Stop: PROCEDURE; -- "JaMError" is an error that is caught by execution control. The -- restore parameter is used to indicate to execution control if it -- is safe to restore the operand stack. execute is the StringType Object -- that will be pushed onto the execution stack. JaMError: ERROR[execute: StringType Object, restore: BOOLEAN]; -- Here are a number of possible error strings badbcdfile: StringType Object; badname: StringType Object; commandovrflw: StringType Object; dictfull: StringType Object; longname: StringType Object; nostream: StringType Object; overflow: StringType Object; rangechk: StringType Object; sizechk: StringType Object; stkovrflw: StringType Object; stkundflw: StringType Object; syntaxerr: StringType Object; typechk: StringType Object; undefkey: StringType Object; unregistered: StringType Object; SetWakeUp: PROCEDURE[BOOLEAN]; GetWakeUp: PROCEDURE RETURNS[BOOLEAN]; JaMExec: PROGRAM; }. DKW March 27, 1980 6:15 PM added JaMExec: PROGRAM; DKW September 29, 1980 11:49 AM changed WakeUp to SetWakeUp, added GetWakeUp (670)