DIRECTORY GGCoreTypes, Imager, ImagerColor, ImagerTransformation, IO, Rope, Tioga; GGParseIn: CEDAR DEFINITIONS = BEGIN BoundBox: TYPE = GGCoreTypes.BoundBox; Color: TYPE = Imager.Color; Point: TYPE = Imager.VEC; SequenceOfReal: TYPE = GGCoreTypes.SequenceOfReal; STREAM: TYPE = IO.STREAM; SyntaxError: SIGNAL [position: NAT, wasThere: Rope.ROPE, notThere: Rope.ROPE]; ReadBlank: PROC [f: STREAM]; ReadWhiteSpace: PROC [f: STREAM]; ReadHorizontalBlank: PROC [f: STREAM] RETURNS [good: BOOL]; ReadWord: PROC [f: STREAM] RETURNS [word: Rope.ROPE]; ReadRope: PROC [f: STREAM, rope: Rope.ROPE]; ReadChar: PROC [f: STREAM, c: CHAR]; ReadLine: PROC [f: STREAM] RETURNS [line: Rope.ROPE]; ReadKeyWord: PROC [f: STREAM] RETURNS [keyWord: Rope.ROPE, good: BOOL]; ReadListOfRope: PROC [f: STREAM] RETURNS [ropeList: LIST OF Rope.ROPE]; ReadStrokeEnd: PROC [f: STREAM] RETURNS [strokeEnd: Imager.StrokeEnd]; ReadStrokeJoint: PROC [f: STREAM] RETURNS [strokeJoint: Imager.StrokeJoint]; ReadColor: PROC [f: STREAM, version: REAL] RETURNS [color: Color]; ReadPixelArray: PROC [f: STREAM] RETURNS [pa: Imager.PixelArray]; ReadText: PROC [f: STREAM, version: REAL] RETURNS [text: Tioga.Node, screenStyle: BOOL]; ReadPoint: PROC [f: STREAM] RETURNS [point: Point]; ReadTransformation: PROC [f: STREAM] RETURNS [transform: ImagerTransformation.Transformation]; ReadFactoredTransformation: PROC [f: STREAM] RETURNS [transform: ImagerTransformation.Transformation]; ReadFactoredTransformationVEC: PROC [f: STREAM] RETURNS [transform: ImagerTransformation.Transformation]; ReadArrayOfReal: PROC [f: STREAM] RETURNS [reals: SequenceOfReal]; ReadBool: PROC [f: STREAM] RETURNS [truth: BOOL]; ReadNAT: PROC [f: STREAM] RETURNS [n: NAT]; ReadCARD: PROC [f: STREAM] RETURNS [n: CARD]; ReadReal: PROC [f: STREAM] RETURNS [r: REAL]; ReadScalarButtonValues: PROC [f: STREAM, version: REAL] RETURNS [names: LIST OF Rope.ROPE, values: LIST OF REAL, on: LIST OF BOOL]; ReadBox: PROC [f: STREAM] RETURNS [box: BoundBox]; END. J GGParseIn.mesa Copyright Σ 1986, 1988, 1992 by Xerox Corporation. All rights reserved. Contents: Routines for reading gargoyle data structures from a stream. Stolen from Solidviews Solidmodeler TFI3d.mesa. Last edited by Bier on October 19, 1987 1:13:43 pm PDT Pier, March 25, 1988 4:16:24 pm PST Bier, November 30, 1992 4:46 pm PST Doug Wyatt, April 9, 1992 3:24 pm PDT Whitespace Remove from f all whitespace up to the next non-whitespace character. Do nothing if there is none. Remove from f all whitespace up to the next non-whitespace character. Signal SyntaxError if there is none. Remove from f any SP, or TAB characters until a non-(SP or TAB) character is found. Note that this leaves CR alone. Raw Text ReadBlank[f]. Then let word be all of the characters up to the next TAB, CR, SP, comma, ], or ). The next few characters on f should be rope. Remove them. Signal SyntaxError if they aren't there. The next character on f should be c. Remove it. Signal SyntaxError if it isn't there. Read all characters up to the next CR. The next few characters on f should be followed by a colon with no intervening CR's. Put these characters into keyWord. If a CR is found before a colon, let good = FALSE. Reads a list of words separated by commas or spaces. Imager Types Cedar Types Reads a list of REALs enclosed in square brackets, separated by spaces, tabs, commas, or semi-colons. For instance [3.5, 2.6, 1, 4. 3.0 ] returns a list of 5 real numbers. Looks for T, F, TRUE, or FALSE. If none of these are found, raises SyntaxError. ReadBlank[f]. Then interpret the following characters and digits as a natural number. Stops at period, CR, SP, ], comma, and : . Reads a list of button values separated by spaces and ending with CR. A button value has the format [BOOL REAL ROPE] where BOOL is the letter T or F and ROPE is an optional rope for display of the REAL. Positions in each list are corresponding button value, name, and ON value for the button. ReadBlank[f]. Then interpret the following characters and digits as a real number. Stops at ), ], CR, SP, and TAB. Gargoyle Core Types Κφ•NewlineDelimiter –(cedarcode) style™codešœ™Kšœ Οeœ>™IKšΟnœp™xKšœ6™6Kšœ#™#K™#K™%K™—šΟk ˜ Kšœ8Ÿœ˜HK˜—Kšž œŸœŸ œŸ˜$˜Iprocšœ Ÿœ˜&LšœŸœ˜LšœŸœ Ÿœ˜LšœŸœ˜2Lš ŸœŸœŸŸŸŸœ˜L˜—Lš ž œŸœ ŸœŸœŸœ˜NIhead™ šž œŸœŸœ˜L™c—šžœŸœŸœ˜!Lšœk™k—š žœŸœŸœŸœŸœ˜;L™t—M™š žœŸœŸœŸœ Ÿœ˜5Lšœa™a—šžœŸœŸœ Ÿœ˜,Lšœd™d—šžœŸœŸœŸœ˜$LšœW™W—š žœŸœŸœŸœ Ÿœ˜5L™&—š ž œŸœŸœŸœŸœŸœ˜GLšœOŸœ.Ÿœ%Ÿœ™¬—šžœŸœŸœŸœ ŸœŸœŸœ˜GL™4—M™ Lšž œŸœŸœŸœ˜FLšžœŸœŸœŸœ#˜LLš ž œŸœŸœ ŸœŸœ˜BKšžœŸœŸœŸœ˜ALš žœŸœŸœ ŸœŸœ!Ÿœ˜XLšž œŸœŸœŸœ˜3LšžœŸœŸœŸœ2˜^LšžœŸœŸœŸœ2˜fLšžœŸœŸœŸœ2˜iM™ šžœŸœŸœŸœ˜BL™¬—š žœŸœŸœŸœ Ÿœ˜1L™P—Lš žœŸœŸœŸœŸœ˜+š žœŸœŸœŸœŸœ˜-L™‚—Lš žœŸœŸœŸœŸœ˜-šžœŸœŸœ ŸœŸœ ŸœŸœŸœ ŸœŸœŸœŸœŸœŸœ˜ƒL™₯L™t—M™LšžœŸœŸœŸœ˜2K˜KšŸœ˜—…—Ξ