DIRECTORY Basics, Rope, Convert, List USING [AList, Assoc, PutAssoc] QEDataManager; QEDataManagerImpl: CEDAR PROGRAM IMPORTS List, Convert EXPORTS QEDataManager ~ BEGIN OPEN QEDataManager; ROPE: TYPE ~ Rope.ROPE; AList: TYPE ~ List.AList; LoganBerryLog: LBLog; -- a global simulated LoganBerry Log OnlineQEObjects: List.AList _ NIL; ResetWorld: PUBLIC PROC[] ~ { LoganBerryLog _ NIL; OnlineQEObjects _ NIL; }; OnlineQEObject: PROC [in: AlgebraClasses.Object, tryConnect: BOOL _ FALSE] RETURNS [out: AlgebraClasses.Object]; InstallAtomClass: PUBLIC PROC[class: AtomClass] ~ { GlobalAtomClasses _ List.PutAssoc[key: class.name, val: class, aList: GlobalAtomClasses]; AtomClassNames _ CONS[class.name, AtomClassNames]; }; LookupAtomClass: PUBLIC PROC[name: ATOM] RETURNS[AtomClass] ~ { atomClass: AtomClass _ NARROW[List.Assoc[key: name, aList: GlobalAtomClasses]]; IF atomClass = NIL THEN ERROR notFound; RETURN[atomClass]; }; KillAtomClass: PUBLIC PROC[name: ATOM] ~{ GlobalAtomClasses _ KillAssoc[name, GlobalAtomClasses] }; GlobalOperatorTable: List.AList _ NIL; notFound: PUBLIC ERROR = CODE; ResetWorld[]; END. φQEDataManagerImpl.mesa Arnon, November 19, 1987 4:18:58 pm PST Abbreviations from Imported Interfaces Simulated LoganBerry DB Global registry of QE objects loaded into memory Operations on Public Lists of Expression Class Names, by Expr Type Checks OnlineQEObjects to see if already online, if not, loads it and enters it into OnlineQEObjects. If tryConnect = TRUE, then for each field which contains one or more QE objects, looks for those objects in OnlineQEObjects, and if found, puts pointers to the online versions in the output object. If tryConnect = FALSE, then all such fields are left containing offline objects. effects: Installs class in global AtomClass DataBase add atom class to database - not very efficient, but does the job add atom class name to index effects: Returns the AtomClass object associated with name. SIGNALS notFound if no association exists Public Lists of Operator Names (Operators assumed to be CompoundExprs) Signals & Errors Start Code (Reset Database) Κb˜Jšœ™Jšœ'™'J˜codešΟk ˜ Kšœ˜Kšœ˜Kšœ˜Kšœœ˜#Kšœ˜K˜K˜—šΟnœœœ˜!Kšœ˜Kšœ˜K˜Kšœœ˜—headšž&™&Kšœœœ˜Kšœœ˜—šž™Kšž œ Οc$˜;—šž0™0Kšžœœ˜"—šžB™Bšž œœœ˜Kšœœ˜Kšœœ˜K˜K˜—š žœœ)œœœ˜pJšœ€™€J˜—šžœœœ˜3Kšœ5™5K™KšœB™BK˜YK˜Kšœ™Kšœœ˜2K˜K˜K˜—š žœœœœœ˜?Kšœ<™