CDGenerateBackdoor.mesa (part of ChipNDale)
Copyright © 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:49:15 pm PDT
DIRECTORY
CD, CDGenerate, Rope, SymTab;
CDGenerateBackdoor: CEDAR DEFINITIONS =
BEGIN
Allows to do more stuff with the CDGenerate Contexts.
Context: TYPE = CDGenerate.Context;
IGeneratorProc: TYPE = PROC [design: CD.Design, key: Rope.ROPE, passContext, realContext: Context] RETURNS [ob: CD.Object←NIL];
SelectorProc: TYPE = PROC [context: Context, label: Rope.ROPE] RETURNS [key: Rope.ROPENIL];
CreateIndirect: PROC [onTopOf: Context,
iGenerator: IGeneratorProc,
selector: SelectorProc ← NIL,
cache: BOOLTRUE,
flushThrough: BOOLTRUE,
clearThrough: BOOLTRUE,
registerThrough: BOOLTRUE]
RETURNS
[context: Context];
--calls to context will be indirected to calls of iGenerator.
--iGenerator will get onTopOf as realContext field, so it can call again using FetchIndirect...
--set selector to CDGenerate.SelectOneOf if selector should propagate indirectly to onTopOf
Indiretee: PROC [context: Context] RETURNS [Context];
--NIL if not indirect
FetchIndirect: PROC [passContext, realContext: Context, design: CD.Design, key: Rope.ROPE, cache: BOOLFALSE] RETURNS [ob: CD.Object];
--Like FetchNCall except:
--passContext: will be passed trough as parameter to generator only
--realContext: context to be really called.
--To be called from indirection generators
publicContexts: SymTab.Ref;
--space for contexts to be returned or created using AssertContext
END.