DIRECTORY Basics USING [Comparison], RedBlackTree, Rope USING [Compare, ROPE], RiscAssemblerTokenDef USING [idNode], RiscAssembler, RiscAssemblerBaseDef; RiscAssemblerBaseImpl: CEDAR MONITOR IMPORTS RedBlackTree, Rope EXPORTS RiscAssemblerBaseDef ~ { OPEN RiscAssemblerTokenDef, RiscAssembler, RiscAssemblerBaseDef; ROPE: TYPE ~ Rope.ROPE; Table: TYPE ~ RedBlackTree.Table; FIREWALL: PUBLIC SIGNAL ~ CODE; CodeConcat: PUBLIC PROC [left: EncodingSequence, right: EncodingSequence] RETURNS [list: EncodingSequence] ~ { list _ NIL; }; InstructionSequence: PUBLIC PROC [instr: Encoding] RETURNS [list: EncodingSequence] ~ { list _ LIST[instr]; }; Code: PUBLIC PROC [op: Opcode] RETURNS [instr: Encoding] ~ { instr _ op.ORD; }; CodeFirewall: PUBLIC PROC [op: Opcode] RETURNS [instr: Encoding] ~ { instr _ op.ORD; SIGNAL FIREWALL; }; CodeRand: PUBLIC PROC [op: Opcode, label: LabelInstance] RETURNS [instr: Encoding] ~ { instr _ op.ORD; }; CodeRandFirewall: PUBLIC PROC [op: Opcode, label: LabelInstance] RETURNS [instr: Encoding] ~ { instr _ op.ORD; SIGNAL FIREWALL; }; SymbolCopy: PUBLIC PROC [in: Table] RETURNS [out: Table] ~ { out _ in; }; SymbolConcat: PUBLIC PROC [t: Table, entry: LabelInstance] RETURNS [new: Table] ~ { RedBlackTree.Insert[t, entry, entry.text]; new _ t; }; CodeOrigin: PUBLIC PROC RETURNS [origin: INT] ~ { origin _ 1; }; InitialSymbolTable: PUBLIC PROC RETURNS [t: Table] ~ { t _ RedBlackTree.Create[GetKey, Compare]; }; NewLabel: PUBLIC PROC [id: idNode, address: INT, definedAt: INT] RETURNS [l: LabelInstance] ~ { l _ NEW[EntryObject _ [id.text, address, definedAt]]; }; SymbolIndex: PUBLIC PROC [t: Table, id: idNode] RETURNS [l: LabelInstance] ~ { data: RedBlackTree.UserData ~ RedBlackTree.Lookup[t, id.text]; l _ NARROW[data]; }; GetKey: PROC [data: RedBlackTree.UserData] RETURNS [key: RedBlackTree.Key] ~ { id: idNode ~ NARROW[data]; key _ id.text; }; Compare: PROC [k: RedBlackTree.Key, data: RedBlackTree.UserData] RETURNS [Basics.Comparison] ~ { l: LabelInstance ~ NARROW[data]; left: ROPE ~ NARROW[k]; right: ROPE ~ l.text; RETURN[Rope.Compare[left, right]]; }; }... °RiscAssemblerBaseImpl.Mesa Copyright Σ 1987 by Xerox Corporation. All rights reserved. Bill Jackson (bj) May 27, 1987 7:54:22 pm PDT have to cons up nodes with values! Κ‡˜codešœ™Kšœ<™˜>Kšœœ˜Kšœ˜K˜—šžœœœ˜NKšœ œ˜Kšœ˜K˜K˜—šžœœ4œ˜`Kšœœ˜ Kšœœœ˜Kšœœ ˜Jšœ˜"K˜K˜—Kšœ˜K˜——…—J 