<> <> <> <<>> DIRECTORY Commander USING [CommandProc, Register], IO USING [int, PutF], OneCasabaParser USING [GetReportStream], Rope USING [ROPE], ThreeC4Support USING [GetReportStream], ExampleATDef USING [ExpressionNode], ExampleParserDef USING [ParseOneStream]; ExampleDriver: CEDAR MONITOR IMPORTS Commander, IO, OneCasabaParser, ThreeC4Support, ExampleParserDef ~ { ROPE: TYPE ~ Rope.ROPE; debugFlags: CARDINAL _ 0; ExampleProc: Commander.CommandProc ~ { ENABLE { ThreeC4Support.GetReportStream => RESUME[cmd.out]; OneCasabaParser.GetReportStream => { result _ $Failure; RESUME[cmd.out] }; }; root: ExampleATDef.ExpressionNode; result _ $Success; -- bad assumption? root _ NARROW[ExampleParserDef.ParseOneStream[cmd.in, debugFlags, cmd.out]]; IF ( result = $Failure ) THEN { IO.PutF[cmd.out, "Syntax Errors Detected.\n"]; } ELSE { value: INT; IO.PutF[cmd.out, "No Syntax Errors Detected.\n"]; value _ root.procs.Evaluate[root]; IO.PutF[cmd.out, "And the value is: %g.\n", IO.int[value]]; }; }; exampledoc: ROPE ~ " < file\n\tWhere the contents of file is an interesting expression"; Commander.Register["Example", ExampleProc, exampledoc]; }...