SParse.mesa
Don Curry September 8, 1987 10:22:21 am PDT
DIRECTORY
IO;
SParse: CEDAR DEFINITIONS =
BEGIN
This is a simple infix boolean expression parser.
Syntax:
expr == id | int | ~expr | (expr) | expr + expr | expr * expr | id(expr, ..., expr)
int == INT
id  == ROPE excluding chars: space tab ~ + * , ( )
Order of precedence:  ~ * +
Tree:   TYPE = REF; -- ROPE | REF INT | LIST OF Tree (list.first is the operand ROPE)
ToTree:  PROC[rope: IO.ROPE]       RETURNS[Tree];
ToRope:  PROC[ref: Tree, indentedLevs: INT ← 2] RETURNS[IO.ROPE];
BadRope: SIGNAL; -- From ToTree
BadTree: SIGNAL; -- From ToRope
END.