DIRECTORY BasicTime USING [], FS USING [StreamOpen], HashTable USING [EachPairAction, Pairs, Value], IO USING [STREAM, rope, Close, PutF, PutRope], Rope USING [ROPE, Cat], SiroccoPrivate USING [AquireState, CComponent, CType, FileHeader, Handle, Nest, TABLES, UnDoable]; GenerateAuxInterface: CEDAR PROGRAM IMPORTS FS, HashTable, IO, Rope, SiroccoPrivate EXPORTS SiroccoPrivate ~ { OPEN SiroccoPrivate; ROPE: TYPE ~ Rope.ROPE; Value: TYPE ~ HashTable.Value; Heading: PROC [out: IO.STREAM, programKeyWD: ROPE] ~ { SiroccoPrivate.FileHeader[out, Rope.Cat[programKeyWD, "Aux.Mesa"]]; IO.PutRope[out, Nest["DIRECTORY", 1]]; IO.PutF[out, Nest["%g;", 0], IO.rope[programKeyWD]]; IO.PutRope[out, Nest["", 0]]; IO.PutF[out, Nest["%gAux: CEDAR DEFINITIONS ~ {", 1], IO.rope[programKeyWD]]; IO.PutF[out, Nest["OPEN %g;", 1], IO.rope[programKeyWD]]; }; GenAuxDefs: PUBLIC PROC ~ { aux: IO.STREAM; failure: BOOLEAN; h: Handle; GenerateInterfaceItem: HashTable.EachPairAction ~ { name: ROPE _ NARROW [key]; entry: CType _ NARROW [value]; item: ROPE; local: BOOLEAN; GenItem: PROC ~ { IO.PutF[aux, "%gExpose%g: PROC [arg: %g, level: NAT] RETURNS [res: ROPE];%g", IO.rope[Nest[NIL, 1]], IO.rope[item], IO.rope[item], IO.rope[Nest[NIL,1]] ]; }; [item, local] _ UnDoable[name, h.programKeyWD]; IF (local) THEN { SELECT entry.class FROM array => GenItem[]; boolean => GenItem[]; bulkDataSink => NULL; -- can't print meaningfully bulkDataSource => NULL; -- can't print meaningfully cardinal => GenItem[]; choice => GenItem[]; enumeration => GenItem[]; error => NULL; -- always a constant! integer => GenItem[]; longCardinal => GenItem[]; longInteger => GenItem[]; procedure => NULL; -- always a constant! record => { fieldList: CComponent _ entry.children; IF (fieldList = NIL) THEN { IO.PutF[aux, "%gExpose%g: PROC [--arg: %g,-- level: NAT] RETURNS [res: ROPE];%g", IO.rope[Nest[NIL, 1]], IO.rope[item], IO.rope[item], IO.rope[Nest[NIL,1]] ]; RETURN }; GenItem[] }; sequence => GenItem[]; string => GenItem[]; unspecified => GenItem[]; ENDCASE => ERROR; }; }; h _ SIGNAL AquireState[]; aux _ FS.StreamOpen[Rope.Cat[h.programKeyWD, "Aux.Mesa"], $create]; Heading[aux, h.programKeyWD]; failure _ HashTable.Pairs[h.allTheTables.typeTable, GenerateInterfaceItem]; IO.PutRope[aux, Nest[NIL, 0]]; IO.PutRope[aux, Nest["}...", 0]]; IO.Close[aux]; }; }.  GenerateAuxInterface.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Bill Jackson (bj) September 25, 1986 3:15:00 am PDT Demers, December 30, 1986 4:05:10 pm PST Copied Types Procs Handle Empty Record as a special case because of compiler bug GenAuxDefs MAIN ΚΞ˜šœ™Icodešœ Οmœ1™