CommandTool.mesa
L Stewart, April 15, 1983 1:43 pm
DIRECTORY
Commander USING [Handle],
ReadEvalPrint USING [ClientProc],
Rope USING [ROPE];
CommandTool: CEDAR DEFINITIONS =
BEGIN
Create:
PROC;
Create a command tool.
DoCommand:
PROC [command: Rope.
ROPE, commandLine, in: Rope.
ROPE ←
NIL]
RETURNS [out, err: Rope.
ROPE];
Execute the given command, passing it the given commandLine and in, out, and err streams connected to the corresponding ropes. (Calls ExecuteCommand)
ExecuteCommand:
PROC [command: Commander.Handle];
Execute the given command, protected by ABORT and UNWIND catch phrases.
EachCommand: ReadEvalPrint.ClientProc;
A command tool works by passing EachCommand to a ReadEvalPrint evaluator. (Calls ExecuteCommand). If the clientData of the ReadEvalPrint.Handle is a Commander.Handle then EachCommand will use its propertyList field, otherwise EachCommand will create a trivial propertyList.
END.