CDPExt.mesa
Copyright © 1985, 1986 by Xerox Corporation. All rights reserved.
Created by Jacobi, December 12, 1985 2:19:57 pm PST
Last edited by: Christian Jacobi, October 21, 1986 4:00:22 pm PDT
DIRECTORY
CD,
CDBottomUp,
CDCommandOps,
CDOps,
CDTextExtraction,
CDSequencer,
IO,
Rope,
TerminalIO;
CDPExt:
CEDAR
PROGRAM
IMPORTS CDBottomUp, CDCommandOps, CDOps, CDTextExtraction, CDSequencer, IO, TerminalIO =
BEGIN
propertyExtractor: CDBottomUp.Class = CDBottomUp.Register[DoExt, ReUseExt];
Message:
PROC [handle: CDBottomUp.Handle, ob:
CD.Object, errNo:
INT, prefix: Rope.
ROPE] =
BEGIN
TerminalIO.PutF[" %g %g; found %g errors\n", IO.rope[prefix], IO.rope[CDOps.ObjectRope[ob]], IO.int[errNo]];
IF errNo>0
THEN {
handle.cnt ← handle.cnt+1;
handle.r ← IO.PutFR["%g %g errors in %g\n", IO.rope[handle.r], IO.int[errNo], IO.rope[CDOps.ObjectRope[ob]]]
};
CDSequencer.CheckAborted[handle.design];
END;
DoExt: CDBottomUp.DoProc =
BEGIN
errNo: INT ~ CDTextExtraction.ExtractProperties[handle.design, ob].errors;
Message[handle, ob, errNo, "extracting properties: "];
val ← NEW[INT𡤎rrNo];
END;
ReUseExt: CDBottomUp.ReUseProc =
BEGIN
WITH previousVal
SELECT
FROM
ri: REF INT => Message[handle, ob, ri^, "previously extracted properties: "];
ENDCASE => NULL;
END;
HierarchicalPropertyExtractionComm:
PROC [comm: CDSequencer.Command] =
BEGIN
HierarchicalPropertyExtraction:
PROC [design:
CD.Design, ob:
CD.Object] =
BEGIN
h: CDBottomUp.Handle ← CDBottomUp.StartRecurse[propertyExtractor, design, ob].handle;
IF h.cnt=0 THEN TerminalIO.PutRope["no errors found\n"]
ELSE TerminalIO.PutF1["error(s) found in %g object(s)\n", [integer[h.cnt]]]
END;
inst: CD.Instance ← CDOps.TheInstance[comm.design, "hierarchical Property extraction\n"];
IF inst#NIL THEN HierarchicalPropertyExtraction[comm.design, inst.ob];
END;
CDCommandOps.RegisterWithMenu[menu: $ProgramMenu, entry: "Hierarchical Property extraction", proc: HierarchicalPropertyExtractionComm, key: $HPExt];
END.