ExecPrivateRecord:
TYPE =
MONITORED
RECORD[
historyList: HistoryList,
id: ROPE, -- i.e. A, B, ... Z, AA, AB, etc.
execState: GlobalExecState ← notListening,
eventState: LocalExecState ← readyForNext,
for dealing with the interpreter
evalMode: BOOLEAN ← FALSE,
actionAreaData: REF ActionAreaData ← NIL,
spawnedActionArea: ExecHandle ← NIL,
evalHead: BBEval.EvalHead ← NIL,
the following relate to interactions with typein and output.
lastChar: CHARACTER ← NULL, -- lastcharacter output to (or echoed to) exec.out .used in UserExecImpl.DefaultDeliverWhen, e.g. to remember if a CR was preceded by a '.
dontPrompt: BOOLEAN ← FALSE, -- for continuing an event, e.g. following ESC completion. What the user sees on the input line is accurate.
continuation: BOOLEAN ← FALSE,
eventNum: INT ← 1, -- the event number of the next event to be created. used to prompt the user. Also used in UserExecInterpImpl.TreatAsExpr and used in HistoryImpl.CreateEvent.
advice: LIST OF Advice ← NIL, -- list of expressions to be evaluated when userexecutive is again ready for input.
lastLine: ROPE ← NIL, -- holds last input line. ExecProcessInput obtains the input from this field. Used in UserExecImpl.DefaultDeliverWhen to handle treatment of esc.
for compatibility with old Exec interface
execDotW: TTY.Handle, -- UserExecRegCmdsImpl.CallRegisteredProc sets Exec.w to this before calling a procedure registered through Exec.AppendCommand
process: UNSAFE PROCESS, -- initialized to Process.GetCurrent[] when exec handle is created. used by UserExecImpl.GetExecHandle to find out which exec the current process is under. Also used to determine the parent for a spawned action area.
following deals with problems of synchronizing input/output to exec where may have several events running simultaneously.
execOwner: UNSAFE PROCESS ← NIL, -- usually itself
execOwnerCount: INT ← 0, -- to permit clients to Acquire/Release Exec without having to worry about previously owned in same process.
GlobalExecState:
TYPE = {notListening, listening, dormant, suspended, destroyed};
ExecState contains the global state of the exec. EventState describes its state with respect to the current event. There is some redundancy, in that if execState = destroyed, eventState could never be running. However, execState might be dormant or notListening and eventState could be running, e.g. if DoIt were called directly.
ActionAreaData:
TYPE =
RECORD[
action: BBAction.Action ← NIL,
parentExec: ExecHandle ← NIL,
world: WorldVM.World ← NIL,
viewer: Viewer ← NIL,
fullMsg, abbrevMsg, iconMsg: ROPE ← NIL,
aborted, booted: BOOL ← FALSE, -- when action = NIL, this says whether it was proceeded or aborted. Used in userexecimpl
tiogaDoc: BOOL ← TRUE,
restoreSelAfterEachEvent: BOOL ← FALSE,
start, end: TiogaOps.Location ← [NIL, 0],
level: TiogaOps.SelectionGrain ← char,
caretBefore: BOOL ← NULL,
pendingDelete: BOOL ← NULL
];