BEGIN
EXPR: TYPE ~ MathExpr.EXPR;
ROPE: TYPE ~ Rope.ROPE;
Viewer: TYPE ~ ViewerClasses.Viewer;
Create:
PUBLIC
PROC[expr:
EXPR ←
NIL, name:
ROPE]
RETURNS[Viewer] ~ {
effects: Constructs and returns a new math expression viewer
containing the expression expr. If expr = NIL, viewer will
contain an empty expression "plcaeholder".
RETURN[ViewExpr.Create[expr, name]];
};
SetContents:
PUBLIC
PROC[viewer: Viewer, expr:
EXPR] ~ {
modifies: viewer
effects: Changes the contents of math expression viewer viewer
to be expr.
ViewExpr.SetContents[viewer, expr];
};
GetContents:
PUBLIC
PROC[viewer: Viewer]
RETURNS[
ROPE] ~ {
effects: Returns the contents of viewer as a ROPE in
a format understood by the AlgebraStructures parser.
RETURN[ViewExpr.GetContents[viewer]];
};