DIRECTORY Basics USING [bytesPerWord], BcdDefs USING [BCD, Link, MTIndex, MTRecord, SGIndex, SGRecord, VersionStamp], ConvertUnsafe USING [SubString], Literals USING [LitDescriptor, LTIndex, LTNull, LTRecord, MSTIndex, STIndex, STNull], IO USING [STREAM], Rope USING [ROPE], SymbolTable USING [Base], Symbols USING [BitAddress, BodyRecord, BTIndex, ContextLevel, CSEIndex, CTXIndex, CTXNull, CTXRecord, ISEIndex, ISENull, lG, lL, lZ, MDIndex, Name, nullName, RootBti, SEIndex, SENull, SERecord, TransferMode, TypeClass, typeTYPE], Tree USING [Link, NodeName]; ListerUtils: DEFINITIONS = BEGIN BCD: TYPE = BcdDefs.BCD; BitAddress: TYPE = Symbols.BitAddress; BTIndex: TYPE = Symbols.BTIndex; BTRecord: TYPE = Symbols.BodyRecord; bytesPerWord: NAT = Basics.bytesPerWord; CSEIndex: TYPE = Symbols.CSEIndex; typeTYPE: CSEIndex = Symbols.typeTYPE; ContextLevel: TYPE = Symbols.ContextLevel; lZ: ContextLevel = Symbols.lZ; lG: ContextLevel = Symbols.lG; lL: ContextLevel = Symbols.lL; CTXIndex: TYPE = Symbols.CTXIndex; CTXNull: CTXIndex = Symbols.CTXNull; CTXRecord: TYPE = Symbols.CTXRecord; ISEIndex: TYPE = Symbols.ISEIndex; ISENull: ISEIndex = Symbols.ISENull; ISERecord: TYPE = SERecord.id; LTIndex: TYPE = Literals.LTIndex; LTNull: LTIndex = Literals.LTNull; LTRecord: TYPE = Literals.LTRecord; LitDescriptor: TYPE = Literals.LitDescriptor; MDIndex: TYPE = Symbols.MDIndex; MSTIndex: TYPE = Literals.MSTIndex; MSTNull: MSTIndex = LOOPHOLE[STNull]; MTIndex: TYPE = BcdDefs.MTIndex; MTRecord: TYPE = BcdDefs.MTRecord; Name: TYPE = Symbols.Name; nullName: Name = Symbols.nullName; NodeName: TYPE = Tree.NodeName; RefBCD: TYPE = REF BCD; RefMTRecord: TYPE = REF MTRecord; RefSGRecord: TYPE = REF SGRecord; RootBti: BTIndex = Symbols.RootBti; ROPE: TYPE = Rope.ROPE; SEIndex: TYPE = Symbols.SEIndex; SENull: SEIndex = Symbols.SENull; SERecord: TYPE = Symbols.SERecord; SGIndex: TYPE = BcdDefs.SGIndex; SGRecord: TYPE = BcdDefs.SGRecord; STIndex: TYPE = Literals.STIndex; STNull: STIndex = Literals.STNull; STREAM: TYPE = IO.STREAM; SubString: TYPE = ConvertUnsafe.SubString; SymbolTableBase: TYPE = SymbolTable.Base; TransferMode: TYPE = Symbols.TransferMode; TypeClass: TYPE = Symbols.TypeClass; VersionStamp: TYPE = BcdDefs.VersionStamp; OpCodeEntry: TYPE = RECORD [name: ROPE, push,pop,length: [0..8)]; OpCodeArray: TYPE = REF OpCodeArrayRep; OpCodeArrayRep: TYPE = ARRAY [0..256) OF OpCodeEntry; GetOpCodeArray: PROC RETURNS [OpCodeArray]; ReadBcd: PROC [fileName: ROPE] RETURNS [RefBCD]; ReadMtr: PROC [inStream: STREAM, bcd: RefBCD, mti: MTIndex] RETURNS [RefMTRecord]; ReadSgr: PROC [inStream: STREAM, bcd: RefBCD, sgi: SGIndex] RETURNS [RefSGRecord]; WithSegment: PROC [inStream: STREAM, bcd: RefBCD, sgi: SGIndex, inner: PROC [LONG POINTER]]; WithPages: PROC [inStream: STREAM, bcd: RefBCD, start,pages: CARDINAL, inner: PROC [LONG POINTER]]; PrintSE: PROC [sei: ISEIndex, nBlanks: CARDINAL, definitionsOnly: BOOL, stream: STREAM, stb: SymbolTableBase]; PrintSei: PUBLIC PROC [sei: ISEIndex, stream: STREAM, stb: SymbolTableBase]; PrintType: PROC [sei: SEIndex, stream: STREAM, stb: SymbolTableBase]; PrintTypeInfo: PROC [sei: SEIndex, nBlanks: CARDINAL, stream: STREAM, stb: SymbolTableBase]; PrintTree: PROC [tree: Tree.Link, nBlanks: NAT, stream: STREAM, stb: SymbolTableBase]; PrintLiteral: PUBLIC PROC [t: Tree.Link.literal, stream: STREAM, stb: SymbolTableBase]; PrintBcdLink: PUBLIC PROC [link: BcdDefs.Link, stream: STREAM]; PrintTreeLink: PUBLIC PROC [link: Tree.Link, stream: STREAM]; PrintName: PUBLIC PROC [name: Name, stream: STREAM, stb: SymbolTableBase]; WriteNodeName: PUBLIC PROC [n: NodeName, stream: STREAM]; WriteTypeName: PUBLIC PROC [n: TypeClass, stream: STREAM]; WriteModeName: PUBLIC PROC [n: TransferMode, stream: STREAM]; OutCtx: PUBLIC PROC [message: Rope.ROPE, ctx: CTXIndex, stream: STREAM]; OutArgType: PUBLIC PROC [message: ROPE, sei: CSEIndex, stream: STREAM, stb: SymbolTableBase]; PrintVersion: PUBLIC PROC [stamp: VersionStamp, stream: STREAM, useTime: BOOL _ FALSE]; PrintStringFromTable: PUBLIC PROC [index: CARDINAL, stream: STREAM, stb: SymbolTableBase]; PrintString: PUBLIC PROC [str: LONG STRING, stream: STREAM]; PrintSubString: PUBLIC PROC [ss: SubString, stream: STREAM]; PrintIndex: PUBLIC PROC [index: UNSPECIFIED, stream: STREAM]; Indent: PUBLIC PROC [stream: STREAM, nBlanks: NAT]; DescriptorValue: PUBLIC PROC [stb: SymbolTableBase, lti: LTIndex] RETURNS [LitDescriptor]; MasterString: PUBLIC PROC [stb: SymbolTableBase, sti: STIndex] RETURNS [MSTIndex _ MSTNull]; ShortName: PUBLIC PROC [rope: ROPE] RETURNS [ROPE]; END. äListerUtils.mesa Russ Atkinson, October 24, 1983 3:56 pm T Y P E S & C O N S T A N T S OpCode types & procedures Bcd acquisition procedures Reads the given BCD. Allows FS.Error to fall through to the caller. Reads the given module record. Reads the given segment record. Reads the given segment, invoking the inner procedure with a pointer to it. Reads the given pages, invoking the inner procedure with a pointer to them. Utility procedures Some of these utility routines were cloned from various places to allow stream: STREAM and stb: SymbolTableBase as arguments, so we don't have to use global variables. Prints out the information for the given sei. The indentation level is given by nBlanks. For a definitions file, definitionsOnly = TRUE. Just prints out the name for the given ISEIndex. Prints out the short form of the type, including its base ISEIndex. Prints out the long form of the type. The indentation level is given by nBlanks. Prints out the tree. The indentation level is given by nBlanks. Prints out the literal. Prints the link, distinguishing between proc, type, and var varieties. Prints the link in short form, distinguishing between subtree (default), hash, symbol, and literal varieties. Prints the name. Prints the NodeName in its readable form. Prints the TypeClass in its readable form. Prints the TransferMode in its readable form. Prints the ctx in short form (" ctx: %g"). Prints the message and sei in short form ("%g: %g"). Special consideration for NIL and ANY. Prints the version stamp. If useTime, then the time associated with the stamp is also printed (useful only for source files). Prints the string at the given index. Prints the given long string. Prints the given substring. Prints the given index as a decimal unsigned number. Prints a '\n, followed by nBlanks blanks. Gets the literal descriptor associated with the given LTIndex. Gets the master string for the given STIndex. Strips off version and directory information from the given file name. Ê9˜šœ™Jšœ'™'—J˜šÏk ˜ Jšœœ˜Jšœœœ<˜NJšœœ ˜ Jšœ œG˜UJšœœœ˜Jšœœœ˜Jšœ œ˜šœ˜ Jšœ×˜×—Jšœœ˜—J˜Jšœ œ˜ J˜šœ™J˜Jšœœ œ˜Jšœ œ˜&Jšœ œ˜ Jšœ œ˜$Jšœœ˜(šœ œ˜"Jšœ&˜&—šœœ˜*Jšœ˜Jšœ˜Jšœ˜—šœ œ˜"Jšœ$˜$—Jšœ œ˜$šœ œ˜"Jšœ$˜$—Jšœ œ˜šœ œ˜!Jšœ"˜"—Jšœ œ˜#Jšœœ˜-Jšœ œ˜ šœ œ˜#Jšœœ ˜%—Jšœ œ˜ Jšœ œ˜"šœœ˜Jšœ"˜"—Jšœ œ˜Jšœœœœ˜Jšœ œœ ˜!Jšœ œœ ˜!Jšœ#˜#Jšœœœ˜šœ œ˜ Jšœ!˜!—Jšœ œ˜"Jšœ œ˜ Jšœ œ˜"šœ œ˜!Jšœ"˜"—Jšœœœœ˜Jšœ œ˜*Jšœœ˜)Jšœœ˜*Jšœ œ˜$Jšœœ˜*J˜—šœ™J™Jšœ œœœ˜AJšœ œœ˜'Jšœœœ œ ˜5JšÏnœœœ˜+J™—šœ™J˜šžœ˜ Jšœ œœ ˜"JšœD™DJ™—šžœ˜ Jšœ œœ˜DJšœ™J™—šžœ˜ Jšœ œœ˜DJšœ™J™—šž œ˜Jš œ œ$œœœ˜JJšœK™KJ™—šž œ˜Jš œ œœ œœœ˜SJšœK™KJ™——šœ™JšœPœQ™§J˜šžœ˜ Jšœœœ œ˜`JšœŠ™ŠJ˜—šžœœœœ˜LJšœ0™0J˜—šž œœœ˜EJšœC™CJ˜—šž œ˜Jšœœ œ˜HJšœQ™QJ˜—šž œœœ œ˜VJšœ@™@—J˜šž œœœ œ˜WJšœ™J˜—šž œœœœ˜?JšœF™FJ˜—šž œ œœ˜=Jšœm™mJ˜—šž œœœœ˜JJšœ™J˜—šž œœœœ˜9Jšœ*™*J˜—šž œ œœ˜:Jšœ+™+J˜—šž œ œœ˜=Jšœ.™.J˜—šžœ œœœ˜HJšœ+™+J˜—šž œ ˜Jšœ œœ˜EšœPœœ™\J˜——šž œœ˜Jšœœ œœ˜=Jšœ~™~J˜—šžœ ˜!Jšœœ œ˜8Jšœ%™%J˜—š ž œ œœœ œ˜™>J˜——šž œœ˜Jšœ%œ˜BJšœ-™-J˜—š ž œ œœœœ˜3JšœF™FJ˜——Jšœ˜J˜—…—!