<> <> DIRECTORY IO, IOUtils, Rope, StructuredStreams; StructuredStreamsTest: CEDAR PROGRAM IMPORTS IO, SS:StructuredStreams = BEGIN Parse: PROC [from, to: IO.STREAM] RETURNS [level: INTEGER] = { level _ 0; WHILE NOT from.EndOf[] DO c: CHAR _ from.GetChar[]; SELECT c FROM '{ => {SS.Begin[to]; level _ level + 1}; '} => {SS.End[to]; level _ level - 1}; '< => { united: BOOL _ from.GetBool[]; offset: INTEGER _ from.GetInt[]; SS.Bp[to, united, offset]; WHILE from.GetChar[] # '> DO NULL ENDLOOP; }; ENDCASE => to.PutChar[c]; ENDLOOP; level _ level; }; END.