DIRECTORY CD, Rope, SymTab; CDGenerate: CEDAR DEFINITIONS = BEGIN Context: TYPE = REF --READONLY-- ContextRep; ContextRep: TYPE = RECORD [rep: PRIVATE REF, case: BOOL, cache: BOOL]; GeneratorProc: TYPE = PROC [design: CD.Design, key: Rope.ROPE, context: Context, data: REF] RETURNS [ob: CD.Object_NIL]; Create: PROC [case: BOOL _ TRUE, cache: BOOL _ TRUE] RETURNS [Context]; Clear: PROC [context: Context]; Register: PROC[context: Context, key: Rope.ROPE, generator: GeneratorProc, cache: BOOL_TRUE, data: REF_NIL] RETURNS [first: BOOL]; FetchRegistration: PROC[context: Context, key: Rope.ROPE] RETURNS [generator: GeneratorProc, cache: BOOL, data: REF]; FetchCached: PROC[context: Context, design: CD.Design, key: Rope.ROPE] RETURNS [CD.Object]; FetchNCall: PROC[context: Context, design: CD.Design, key: Rope.ROPE, cache: BOOL_TRUE] RETURNS [CD.Object]; Flush: PROC [context: Context, design: CD.Design, key: Rope.ROPE]; FlushAll: PROC [context: Context, design: CD.Design]; SelectOneOf: PROC [context: Context, label: Rope.ROPE] RETURNS [key: Rope.ROPE]; AssertContext: PROC [project: Rope.ROPE] RETURNS [Context]; END. τCDGenerate.mesa (part of ChipNDale) Copyright c 1985 by Xerox Corporation. All rights reserved. Created by Christian Jacobi, June 5, 1985 8:02:35 pm PDT Last edited by: Christian Jacobi, October 20, 1986 12:48:33 pm PDT Common interface for object generators. A Context is a name space of object generators. Contexts may or may not cache the generated objects. Caching genenerated objects: to avoid multiple generation of aequivalent objects. The user assumes that he might reuse an object instead of creating a new object, whenever he uses the caching scheme. --creates a new, empty context --cache: whether this context tries to cache generated objects --undo all registrations in this context --first: TRUE if key did not already exist --cache: tries to cache the result; works only if context itself is willing to cache --data: passed through to FetchNCall calling generator --fetch the registration of a generator key --generator NIL if not found --fetch a generated object if it is cached. --returns NIL if not found, not cached or looks different --fetch a generator and invoke it --returns NIL if not found or generated --caching only if generator and this call want caching --Removes this entry from the cache --Removes all entries from the cache --convenient procedures --Interactive selection of a generator from a context --NIL if discarded --Fetches a context; if not done then create one and store it for next call of AssertTable. --This context can be imported by lots of unknown applications... Κ½˜codešœ#™#Kšœ Οmœ1™™>K˜—šŸœžœ˜Kšœ(™(K˜—šŸœžœžœ#žœžœžœžœžœ žœ˜‚Kšœ*™*KšœT™TKšœ6™6K™K™—š Ÿœžœžœžœ#žœžœ˜uKšœ+™+Kšœ™K˜—šŸ œžœ0žœžœ ˜[Kšœ+™+Kšœ9™9K˜—šŸ œžœžœžœ žœžœžœžœ ˜lKšœ!™!Kšœ'™'Kšœ6™6—K˜šŸœžœ1žœ˜BKšœ#™#K˜—šŸœžœ'˜5Kšœ$™$K˜—K™Kšœ™K˜š Ÿ œžœžœžœ žœ˜PKšœ5™5Kšœ™K˜—šŸ œžœžœžœ ˜;Kšœ[™[KšœA™AK˜—Kšžœ˜K˜—…—x )