-- BBVForUserExec.mesa -- Russ Atkinson, November 15, 1982 11:03 am DIRECTORY BBBreak USING [BreakIndex, NullIndex], PrintTV USING [PutClosure], Rope USING [ROPE], RTBasic USING [TV], WorldVM USING [World]; BBVForUserExec: CEDAR DEFINITIONS = BEGIN OPEN BBBreak, PrintTV, Rope, RTBasic, WorldVM; -- operations that report results (including intermediate results) as they go SetBreak: PROC [report: ReportProc, world: World _ NIL, entry,exit: BOOL _ FALSE] RETURNS [break: BreakIndex _ NullIndex]; -- set a new breakpoint at the current selection -- returns BBBreak.NullIndex if not successful -- world = NIL => use LocalWorld -- entry forces entry-point breakpoint, exit goes to the end -- (can set both entry & exit breakpoints) ClearBreak: PROC [report: ReportProc, world: World _ NIL, entry,exit: BOOL _ FALSE] RETURNS [break: BreakIndex _ NullIndex]; -- clears the breakpoint at the current selection -- returns BBBreak.NullIndex if no such break or not successful -- world = NIL => use LocalWorld -- entry forces entry-point breakpoint, exit goes to the end -- (can clear both entry & exit breakpoints) GetBreak: PROC [report: ReportProc, world: World _ NIL, entry,exit: BOOL _ FALSE] RETURNS [break: BreakIndex _ NullIndex]; -- get the breakpoint (if any) associated with the current selection -- returns BBBreak.NullIndex if no such breakpoint or not successful -- world = NIL => use LocalWorld -- entry forces entry-point breakpoint, exit goes to the end -- (both => give either one set (test entry first)) DisplayFrame: PROC [frame: TV, put: PutClosure, report: ReportProc, args,vars,allVars: BOOL _ FALSE]; -- displays the local or global frame to the put proc -- args => print arguments, vars => print variables -- allVars => print all variables (otherwise just top-level variables) SourceFromTV: PROC [tv: TV, report: ReportProc, backupPC: BOOL _ TRUE] RETURNS [name: ROPE, index: INT]; -- gets the source file name and the source index for the given TV -- which must be a local frame or global frame -- if not successful, then name = NIL & index < 0 -- if the TV is a local frame, we use backupPC to determine whether we -- subtract 1 from the pc to determine the "context pc" (don't do this for a break) OpenSource: PROC [name: ROPE, index: INT, chars: INT _ 2, report: ReportProc]; -- uses the results of GetSource to open a viewer on the source -- if index >= 0, then also sets the selection to the given index (for chars characters) ReportProc: TYPE = PROC [msg: ROPE, severity: Severity]; -- type of user-supplied procedure used to report results in above operations ReportError: ERROR [msg: ROPE, severity: Severity]; -- error used if supplied ReportProc = NIL and severity IN [warning..fatal] Severity: TYPE = {success, comment, warning, fatal}; -- success => operation is completed -- comment => intermediate information -- warning => something is wrong, but not fatal -- fatal => operation is completed, but did not succeed END. Êr˜Jš¦ÏcDœÏk œ žœ$žœžœžœ žœžœ žœžœž œžœžœ.NœÏnœžœ+žœžœžœžœ&1œ/œ‘œŸ œžœ+žœžœžœžœ&2œ@œ“œŸœžœ+žœžœžœžœ&EœEœšœŸ œžœ žœ:žœžœ6œ4œGœŸ œžœžœ žœžœžœžœ žœCœ/œ2œGœTœŸ œžœžœ žœ žœ@œYœŸ œžœžœžœNœžœžœMœ žœ+%œ'œ0œ8œžœ˜ä—…— f Þ