DIRECTORY GGCoreTypes, Imager, ImagerColor, ImagerTransformation, IO, Rope, TextNode; GGParseIn: CEDAR DEFINITIONS = BEGIN BoundBox: TYPE = GGCoreTypes.BoundBox; Color: TYPE = Imager.Color; Point: TYPE = Imager.VEC; SequenceOfReal: TYPE = GGCoreTypes.SequenceOfReal; SyntaxError: SIGNAL [position: NAT, wasThere: Rope.ROPE, notThere: Rope.ROPE]; ReadBlank: PROC [f: IO.STREAM]; ReadWhiteSpace: PROC [f: IO.STREAM]; ReadHorizontalBlank: PROC [f: IO.STREAM] RETURNS [good: BOOL]; ReadWWord: PROC [f: IO.STREAM] RETURNS [word: Rope.ROPE]; ReadWRope: PROC [f: IO.STREAM, rope: Rope.ROPE]; ReadChar: PROC [f: IO.STREAM, c: CHAR]; ReadLine: PROC [f: IO.STREAM] RETURNS [line: Rope.ROPE]; ReadKeyWord: PROC [f: IO.STREAM] RETURNS [keyWord: Rope.ROPE, good: BOOL]; ReadListOfRope: PROC [f: IO.STREAM] RETURNS [ropeList: LIST OF Rope.ROPE]; ReadStrokeEnd: PROC [f: IO.STREAM] RETURNS [strokeEnd: Imager.StrokeEnd]; ReadStrokeJoint: PROC [f: IO.STREAM] RETURNS [strokeJoint: Imager.StrokeJoint]; ReadColor: PROC [f: IO.STREAM, version: REAL] RETURNS [color: Color]; ReadPixelArray: PROC [f: IO.STREAM] RETURNS [pa: Imager.PixelArray]; ReadText: PROC [f: IO.STREAM, version: REAL] RETURNS [text: TextNode.Ref, screenStyle: BOOL]; ReadPoint: PROC [f: IO.STREAM] RETURNS [point: Point]; ReadTransformation: PROC [f: IO.STREAM] RETURNS [transform: ImagerTransformation.Transformation]; ReadFactoredTransformation: PROC [f: IO.STREAM] RETURNS [transform: ImagerTransformation.Transformation]; ReadFactoredTransformationVEC: PROC [f: IO.STREAM] RETURNS [transform: ImagerTransformation.Transformation]; ReadArrayOfReal: PROC [f: IO.STREAM] RETURNS [reals: SequenceOfReal]; ReadBool: PROC [f: IO.STREAM, version: REAL] RETURNS [truth: BOOL, good: BOOL]; ReadWNAT: PROC [f: IO.STREAM] RETURNS [n: NAT]; ReadWCARD: PROC [f: IO.STREAM] RETURNS [n: CARD]; ReadWReal: PROC [f: IO.STREAM] RETURNS [r: REAL]; ReadScalarButtonValues: PROC [f: IO.STREAM, version: REAL] RETURNS [names: LIST OF Rope.ROPE, values: LIST OF REAL, on: LIST OF BOOL]; ReadBox: PROC [f: IO.STREAM] RETURNS [box: BoundBox]; END. FGGParseIn.mesa Copyright Σ 1986, 1988 by Xerox Corporation. All rights reserved. Last edited by Bier on October 19, 1987 1:13:43 pm PDT Contents: Routines for reading gargoyle data structures from a stream. Stolen from Solidviews Solidmodeler TFI3d.mesa. Pier, March 25, 1988 4:16:24 pm PST Bier, November 28, 1988 9:12:35 pm PST 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. For files made after 8701.26, we expect T or F. Before, we expect TRUE or FALSE. If this is not found, good = FALSE. 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 Κ*˜Icodešœ™KšœC™CKšœ6™6šΟnœp™xKšœ#™#K™&—K™šΟk ˜ Kšœ8žœ˜K—K˜Kš œžœž œ˜K˜Kšž˜˜Iprocšœ žœ˜&Lšœžœ˜Lšœžœ žœ˜Lšœžœ˜2—L˜Lš  œžœ žœžœžœ˜NIhead™ š œžœžœžœ˜L™c—šœžœžœžœ˜$Lšœk™k—š œžœžœžœžœžœ˜>L™t—M™š  œžœžœžœžœ žœ˜9Lšœa™a—š  œžœžœžœ žœ˜0Lšœd™d—š œžœžœžœžœ˜'LšœW™W—š œžœžœžœžœ žœ˜8L™&—š œžœžœžœžœžœžœ˜JLšœOžœ.žœ%žœ™¬—šœžœžœžœžœ žœžœžœ˜JL™4—M™ Lš  œžœžœžœžœ˜ILš œžœžœžœžœ#˜OLš  œžœžœžœ žœžœ˜EKš œžœžœžœžœ˜DLšœžœžœžœ žœžœ#žœ˜]Lš  œžœžœžœžœ˜6Lš œžœžœžœžœ2˜aLš œžœžœžœžœ2˜iLš œžœžœžœžœ2˜lM™ š œžœžœžœžœ˜EL™¬—šœžœžœžœ žœžœ žœžœ˜OLšœv™v—Lš œžœžœžœžœžœ˜/š  œžœžœžœžœžœ˜1L™‚—Lš  œžœžœžœžœžœ˜1šœžœžœžœ žœžœ žœžœžœ žœžœžœžœžœžœ˜†L™₯L™t—M™Lš œžœžœžœžœ˜5K˜Kšžœ˜J˜—…—&–