A Source.T
represents the state of the source view.
INTERFACESource ; IMPORT View, VBT, JunoAST, JunoCompileErr; TYPE T <: Public; Public = View.T OBJECT METHODS init(root: View.Root): T; END;
NEW(T).init(r)
creates a new source view on the root r
.
PROCEDURE Compile(s: T; time: VBT.TimeStamp; skipify: BOOLEAN): BOOLEAN;
Take the following two steps:
1. If the current command is out-of-date, parse the current command, and 2. Compile the current command (reflecting "skipify") and install itscompiled code.If any parse or compilation errors occur, display an error message, highlight the error using timestamp
time
. Otherwise, sets.root.astTrue
toTRUE
.
PROCEDURE Make(s: T; time: VBT.TimeStamp; skipify: BOOLEAN): BOOLEAN;
CallCompile(s, time, skipify)
. If that succeeds, update the drawing (thereby settings.root.dTrue
toTRUE
) and unparse the current command (thereby settings.root.sTrue
toTRUE
). The current command that gets unparsed will contain any new hints engendered by running the current command when the drawing is updated.Returns
TRUE
iff no lex, parse, compilation, or run-time errors occurred.
PROCEDURE ShowError( s: T; ast: JunoAST.T; READONLY err: JunoCompileErr.ErrVal; ts: VBT.TimeStamp);
Unparseast
tos
, highlight its subtreeerr.ast
, and display the messageerr.msg
to the user. Iferr.ast
is not a subtree ofast
, the error message and error tree are written to standard error.
PROCEDURE GetText(s:T): TEXT;
Return the contents of s
.
PROCEDURE SetText(s: T; txt: TEXT);
Set the contents ofs
totxt
. Used when restoring a checkpoint.
END Source.