DIRECTORY AMBridge, AMTypes, Convert, DM, DragOpsCrossUtils, IO, PrintTV, Rope; DMImpl: CEDAR PROGRAM IMPORTS AMBridge, Convert, DragOpsCrossUtils, IO, PrintTV EXPORTS DM = BEGIN OPEN DM; Apply: PUBLIC PROC [component: Component, action: Action] = { IF component#NIL THEN component.action[action][component] }; ListApply: PUBLIC PROC [componentList: ComponentList, action: Action] = { FOR cl: ComponentList _ componentList, cl.rest WHILE cl#NIL DO cl.first.action[action][cl.first] ENDLOOP }; ConsHistory: PUBLIC PROC [phase: Action, data: REF ANY, history: LIST OF HistoryElement] RETURNS [newHistory: LIST OF HistoryElement] = { he: HistoryElement _ NEW [HistoryElementRec _ [phase: phase, data: data]]; newHistory _ CONS[he, history] }; PrintHistory: PUBLIC PROC [c: DM.Component, out: IO.STREAM] = { tv: AMTypes.TV; out.PutF["Component: %g\n", [rope[Convert.RopeFromAtom[c.componentType]]]]; FOR h: LIST OF HistoryElement _ Reverse[c.history], h.rest WHILE h#NIL DO TRUSTED{tv _ AMBridge.TVForReferent[h.first]}; PrintTV.Print[tv: tv, put: out, depth: 1000, width: 1000, verbose: FALSE]; out.PutF["\n"] ENDLOOP; out.PutF["\n"]; FOR cl: DM.ComponentList _ c.subComponents, cl.rest WHILE cl#NIL DO PrintHistory[cl.first, out] ENDLOOP }; Reverse: PROC [list: LIST OF HistoryElement] RETURNS [rev: LIST OF HistoryElement] = { rev _ NIL; WHILE list#NIL DO rev _ CONS[list.first, rev]; list _ list.rest ENDLOOP; }; PrintWord: PrintTV.TVPrintProc = { wdRef: REF Word; TRUSTED{wdRef _ NARROW[AMBridge.SomeRefFromTV[tv]]}; stream.Put[[integer[DragOpsCrossUtils.WordToInt[wdRef^]]]] }; PrintTV.RegisterTVPrintProc[type: CODE[Word], proc: PrintWord]; END. ˜DMImpl.mesa Written By: Pradeep Sindhu, August 24, 1985 7:17:26 pm PDT LastEdited By: Pradeep Sindhu, September 2, 1985 10:30:40 pm PDT Applies action to each of the components in the list c.subComponents Print c's history Print the history for each of c's subcomponents [tv: TV, data: REF ANY, stream: STREAM, depth: INT _ 4, width: INT _ 32, verbose: BOOL _ FALSE] RETURNS [useOld: BOOL _ FALSE] Κ-˜™ J™:J™@—J™J™šΟk ˜ Jšœ ˜ J˜J˜Jšœ˜J˜Jšœ˜J˜J˜—J™J™šΟbœœœ˜Jšœ'œ ˜9Jš œœœœœ˜Icode•StartOfExpansion‚ -- [tv: TV, data: REF ANY, stream: STREAM, depth: INT _ 4, width: INT _ 32, verbose: BOOL _ FALSE] RETURNS [useOld: BOOL _ FALSE]˜šΟnœœœ+˜=Kšœ œœ$˜9K˜—K˜šŸ œœœ3˜IK™DK˜šœ,œœ˜>K˜!Kš˜—K˜—K˜šŸ œœœœœ œœœœœ˜‰Kšœœ2˜JKšœ œ ˜K˜—K˜š Ÿ œœœœœœ˜?Jšœ œ˜J™JšœK˜Kš œœœ-œœ˜IJšœ'˜.JšœCœ˜JJšœ˜Jšœ˜—Jšœ˜J˜J˜J™/š œœ*œœ˜CJ˜Jš˜—K˜—K˜šŸœœœœœœœ˜VKšœœ˜ Kš œœœœ$œ˜HK˜—K˜šž œ˜"KšΠck~™~K˜Kšœœ˜Kšœ œ˜5K˜:K˜—J˜Jšœ"œ˜?J˜Jšœ˜——…—€ E