CDGenerateDirectoryImpl.mesa (part of ChipNDale)
Copyright © 1985 by Xerox Corporation. All rights reserved.
by Christian Jacobi, June 5, 1985 8:02:35 pm PDT
Last Edited by Christian Jacobi, September 19, 1985 4:36:38 am PDT
DIRECTORY
CD,
CDGenerate,
CDGenerateBackdoor,
CDDirectory,
Rope,
SymTab,
TerminalIO;
CDGenerateDirectoryImpl: CEDAR PROGRAM
IMPORTS CDGenerate, CDGenerateBackdoor, CDDirectory, Rope, SymTab, TerminalIO =
BEGIN
DirectorySelector: CDGenerateBackdoor.SelectorProc =
BEGIN
key ← TerminalIO.RequestRope[" from directory>"];
END;
DirectoryIndirector: CDGenerateBackdoor.IGeneratorProc =
BEGIN
IF Rope.IsEmpty[key] THEN key ← TerminalIO.RequestRope["type name >"];
RETURN [CDDirectory.Fetch[design, key].object]
END;
dummy: CDGenerate.Table ← CDGenerate.Create[];
fromDirectory: CDGenerate.Table ← CDGenerateBackdoor.CreateIndirect[
onTopOf: dummy,
iGenerator: DirectoryIndirector,
selector: DirectorySelector
];
TRUSTED {
[] ← SymTab.Insert[CDGenerateBackdoor.publicTables, "DIRECTORY", LOOPHOLE[fromDirectory]];
};
END.