DIRECTORY ComputeServerCallbacks, ComputeUtils, FS, IO, Rope; ComputeUtilsImpl: CEDAR PROGRAM IMPORTS IO, Rope EXPORTS ComputeServerCallbacks, ComputeUtils = BEGIN STREAM: TYPE = IO.STREAM; ROPE: TYPE = Rope.ROPE; Error: PUBLIC ERROR [error: FS.ErrorDesc] = CODE; SkipWhite: PUBLIC PROC [packageListStream: STREAM, flushLines: BOOL _ FALSE] RETURNS [c: CHAR] = { DO ENABLE IO.Error, IO.EndOfStream => GO TO stop; c _ packageListStream.PeekChar[]; SELECT c FROM '\n => IF NOT flushLines THEN RETURN; <= 40C => {}; '- => {-- could be a comment [] _ packageListStream.GetChar[]; IF packageListStream.PeekChar[] # '- THEN { packageListStream.Backup[c]; RETURN [c]; }; DO c _ packageListStream.GetChar[]; SELECT c FROM '\n => { packageListStream.Backup[c]; IF flushLines THEN EXIT; RETURN; }; '- => IF packageListStream.PeekChar[] = '- THEN EXIT; ENDCASE; ENDLOOP; }; ENDCASE => RETURN; [] _ packageListStream.GetChar[]; ENDLOOP; EXITS stop => {c _ 0C}; }; LocalToken: PUBLIC PROC [packageListStream: STREAM, flushLines: BOOL _ FALSE] RETURNS [token:ROPE _ NIL] = { stop: CHAR _ SkipWhite[packageListStream, flushLines]; token _ NIL; SELECT stop FROM 0C, '\n => RETURN; '" => token _ packageListStream.GetRopeLiteral[]; ENDCASE => token _ packageListStream.GetTokenRope[tokenProc].token; }; tokenProc: IO.BreakProc = { RETURN[SELECT char FROM IO.SP, IO.TAB, ', => sepr, IO.CR, ': => break, ENDCASE => other ]; }; trueOrFalse: PUBLIC PROC [token: ROPE] RETURNS [tOfF: ComputeUtils.threeValueLogic] = { IF token = NIL THEN RETURN[other]; IF token.Equal["TRUE", FALSE] THEN RETURN[true]; IF token.Equal["FALSE", FALSE] THEN RETURN[false]; RETURN[other]; }; END. jComputeUtilsImpl.mesa The Compute Server Utilities program running on the server/controller. This EXPORTs to ComputeServerCallbacks for the Error code. Run this once if testing in a single machine, and in each machine during normal operation. Last Edited by: Bob Hagmann, November 5, 1985 1:05:25 pm PST Copyright c 1984 by Xerox Corporation. All rights reserved. Variable Declarations DF File Parsing it is not a comment the end of a comment is either a '\n or a double - Only flush the \n if it was requested Bob Hagmann November 5, 1985 1:05:25 pm PST changes to: DIRECTORY, ComputeUtilsImpl, ROPE, Error Κ¨– "Cedar" style˜headšœ™IbodyšœF™FLšœ–™–L™