SiroccoDebugging.Mesa
Copyright Ó 1986, 1987 by Xerox Corporation. All rights reserved.
Bill Jackson (bj) June 4, 1987 0:41:56 am PDT
DIRECTORY
CardTab,
PriorityQueue;
SiroccoDebugging: CEDAR MONITOR
IMPORTS CardTab, PriorityQueue ~ {
Item: TYPE ~ RECORD [
position: CARD,
element: REF
];
First: PriorityQueue.SortPred ~ {
one: REF Item ~ NARROW[x];
two: REF Item ~ NARROW[y];
RETURN[( one.position > two.position )];
};
DumpCardTab: PROC [x: CardTab.Ref] RETURNS [hook: LIST OF REF Item ← NIL] ~ {
len: INT ~ CardTab.GetSize[x];
pq: PriorityQueue.Ref ~ PriorityQueue.Predict[len, First];
TakeNote: CardTab.EachPairAction ~ {
guy: REF Item ~ NEW [Item ← [key, val]];
PriorityQueue.Insert[pq, guy];
};
[] ← CardTab.Pairs[x, TakeNote];
FOR i: INT IN [0..len) DO
gal: REF Item ~ NARROW[PriorityQueue.Remove[pq]];
hook ← CONS[gal, hook];
ENDLOOP;
};
}.