DIRECTORY ClassIncreek USING [Increek, NewStdIncreek], RefTab USING [Create, Ref, Store], TIPPrivate, TIPUser; TIPUserImpl: CEDAR PROGRAM IMPORTS ClassIncreek, RefTab, TIPUser EXPORTS TIPUser, TIPPrivate SHARES TIPUser = BEGIN OPEN TIPUser, TIPPrivate; predTable: PUBLIC RefTab.Ref _ RefTab.Create[]; -- table for user defined predicates CreateClient: PUBLIC PROC [notify: TIPNotifyProc _ NIL, buttons: TIPButtonProc _ NIL] RETURNS [self: TIPClient] = BEGIN self _ NEW[TIPClientRec _ [ notifyProc: notify, buttonProc: buttons, parseInfo: CreateParseInfo[], matcher: ]]; self.matcher _ FORK MatchProcess[self]; END; DestroyClient: PUBLIC PROC [self: TIPClient] = TRUSTED BEGIN self.parseInfo.inCreek _ NIL; self.parseInfo.localCreek _ NIL; self.parseInfo.timeCreek _ NIL; FOR i: CARDINAL IN [0..10) DO self.parseInfo.creekStack[i] _ NIL ENDLOOP; JOIN self.matcher; END; CreateParseInfo: PUBLIC PROC [parseTable: TIPTable _ NIL] RETURNS [new: TIPParseInfo] = TRUSTED BEGIN new _ NEW[TIPParseInfoRec _ [ inCreek: ClassIncreek.NewStdIncreek[], localCreek: ClassIncreek.NewStdIncreek[], timeCreek: ClassIncreek.NewStdIncreek[], creekStack: ALL[ClassIncreek.NewStdIncreek[]], tableHead: parseTable ]]; END; PushTIPTable: PUBLIC PROC [user: TIPClient, table: TIPTable, opaque: BOOLEAN] = BEGIN t: TIPTable; FOR t _ table, t.link UNTIL t.link=NIL DO ENDLOOP; t.link _ user.parseInfo.tableHead; user.parseInfo.tableHead _ table; table.opaque _ opaque; END; PopTIPTable: PUBLIC PROC [user: TIPClient] RETURNS [old: TIPTable] = BEGIN IF (old_user.parseInfo.tableHead)#NIL THEN user.parseInfo.tableHead _ user.parseInfo.tableHead.link; END; RegisterTIPPredicate: PUBLIC PROC [key: ATOM, p: TIPPredicate] = BEGIN [] _ RefTab.Store[predTable, key, NEW[TIPPredicate _ p]]; END; END. ,TIPUserImpl.mesa; Edit by McGregor, November 23, 1982 1:29 pm Last Edited by: Maxwell, January 3, 1983 11:06 am garbage collector will get old table unless the client keeps a reference a user-defined predicate may be included in the enables list of a TIPTable via this association mechanism. Κ–– "Mesa" style˜JšΟc=™=Jšœ1™1J™šΟk ˜ Jšœ žœ˜,Jšœžœ˜"J˜ J˜J˜—Jšœ ž ˜J˜Jšžœ˜%Jšžœ˜Jšžœ žœžœ˜0J˜Jšœ žœ$˜TJ˜š Οn œžœžœžœžœ˜Ušžœž˜!šœžœ˜J˜J˜J˜J˜J˜—Jšœžœ˜'Jšžœ˜J˜——šŸ œžœžœž ˜