DIRECTORY IO, Rope, TextNode, TiogaFileOps; TiogaStreamsExtras: CEDAR DEFINITIONS = BEGIN ROPE: TYPE = Rope.ROPE; FullCreateInput: PROC [from: TextNode.Ref, commentHandling: FullCommentHandling _ [FALSE[]], levelPrefix: ROPE _ NIL] RETURNS [in: IO.STREAM]; FullCommentHandling: TYPE = RECORD [variant: SELECT see: BOOL FROM FALSE => [], TRUE => [prefix, suffix: ROPE _ NIL], ENDCASE]; FullCreateOutput: PROC [to: TiogaFileOps.Ref, breakAtNewline: BOOL _ FALSE, levelPrefix, defaultFormat: ROPE _ NIL, flexilevel: BOOL _ FALSE, spacesPerTab, normalNestIndent, minFmtIndent: INT _ 0, maxFmtIndent: INT _ -1, commentHandling: FullCommentHandling _ [FALSE[]] ] RETURNS [out: IO.STREAM]; END. ~TiogaStreamsExtras.Mesa Mike Spreitzer April 24, 1990 6:47 am PDT Input Create a Tioga Input Stream on descendents of from. Each subnode's chars are prefixed by levelPrefix * (-1 + its depth realtive to from), then maybe prefix for comment nodes. Each subnode's chars are suffixed by a newline, after the comment suffix (if any). Output Creates children of to. IF breakAtNewline, THEN s.PutChar['\n] gets translated to s.EndNode[reset, FALSE]. IF (NOT flexilevel) AND levelPrefix # NIL, THEN every node that begins with N repetitions of levelPrefix will be indented N levels deeper than it otherwise would be. IF flexilevel, THEN the depth of each node is 1 more than the depth of the most recent node with less leading whitespace. Spaces are white; tabs are white iff spacesPerTab>0; nothing else is white. Each child node will have format=defaultFormat, unless explicitly overridden by SetFormat. IF flexilevel AND normalNestIndent>0 AND maxFmtIndent= minFmtIndent, THEN each node whose amount of leading white space exceeds it parent's by N is created with format defaultFormat-N if N IN [minFmtIndent..maxFmtIndent], otherwise with format defaultFormat-M and a postfix property (M IN {minFmtIndent, maxFmtIndent}); normalNestIndent is indentation of children relative to parent. When commentHandling.see, nodes with the given prefix and suffix become comment nodes without the prefix or suffix. Κ³– "cedar" style•NewlineDelimiter ˜™Icode™)—J˜KšΟk œœ˜+K˜KšΠbxœœ œ˜'K˜Kš˜K˜Kšœœœ˜head™šΟnœœ>œœœœœœ˜ŽKšœ.Οeœ™3KšœO œ'™zKšœR™R—K˜š œœœ œœ˜BKšœ˜ Kšœœœ˜%Kšœ˜ —K˜—™šŸœœ(œœœœœœ0œœ/œœœœ˜©Kšœ œ™KšœR™RKšœ₯™₯KšœΖ™ΖKšœZ™ZKšœ“™“Kšœκ™κKšœs™s—K˜—Kšœ˜—…—Έ ι