JunoProcViewer.mesa (ex OldParseWindow.mesa)
Coded September 6, 1982 12:25 am
Last Edited by: Gnelson, October 11, 1983 9:29 pm
Last Edited by: Stolfi, June 13, 1984 11:17:16 am PDT

Maintains a text viewer and a list of symbolic expressions parsed from that viewer.

TO FIX: Implement it.

DIRECTORY

ViewerClasses USING [Viewer],
Rope USING [ROPE];

JunoProcViewer: CEDAR DEFINITIONS =

BEGIN OPEN Rope;

Viewer: TYPE = ViewerClasses.Viewer;

NewViewer: PROC RETURNS [viewer: Viewer];

Appends a new empty viewer to the list of proc viewers.

ParseViewer: PROC [viewer: Viewer, Proc: BranchVisitProc]
RETURNS [nerrors: INTEGER];

Applies ParseProc on all nodes that may have been edited since last call to ParseViewer.

BranchVisitProc: TYPE = PROC [text1, text2: ROPE]
RETURNS [new1, new2: ROPE, errBeg, errEnd: INT ← -1];

A procedure that parses and unparses a branch of the viewer (a branch consists of a level-1 node and a single child). If errorPos is non-negative, the parsing stops, and the caret is positioned errorPos characters from the beginning of new1+new2.

AddBranch: PUBLIC PROC[viewer: Viewer, text1, text2: ROPE];
adds a new branch at the end of the viewer, with header node = text1 and only child = text2..

DestroyViewer: PUBLIC PROC [viewer: Viewer];

Destroys the given viewer, if its contents have been saved

END.