TamarinLispImpl.mesa
Copyright © 1987 by Xerox Corporation. All rights reserved.
Last Edited by: Alan Bell May 22, 1987 4:13:17 pm PDT
DIRECTORY
Rope,
IO,
FS,
List,
TamarinLisp;
TamarinLispImpl: CEDAR PROGRAM
IMPORTS List, IO, FS
EXPORTS TamarinLisp =
BEGIN OPEN TamarinLisp;
LORA: TYPE = List.LORA;
constList: LORANIL;
dpCcList: LORANIL;
specRegConstList: LORANIL;
uCodeList: LORANIL;
GetTamarinConstants: PUBLIC PROC RETURNS[res: LORA] = {
res ← List.Reverse[constList] };
GetDpCondCodes: PUBLIC PROC RETURNS[res: LORA] = {
res ← List.Reverse[dpCcList] };
GetSpecRegConstants: PUBLIC PROC RETURNS[res: LORA] = {
res ← List.Reverse[specRegConstList] };
GetUCodeContents: PUBLIC PROC RETURNS[res: LORA] = {
res ← List.Reverse[uCodeList] };
TamConstant: PUBLIC PROC [atm: ATOM, val: INT] = {
const: TamConst ← NEW[ TamConstRec];
const^ ← [atm, val];
constList ← CONS[ const, constList] };
DpCCode: PUBLIC PROC [index: NAT, d1, d2, nD1, nD, d1XorD2: Rope.ROPE] = {
const: DpCondCode ← NEW[ DpCondCodeRec];
const^ ← [index, d1, d2, nD1, nD, d1XorD2];
dpCcList ← CONS[ const, dpCcList] };
SpecRegConst: PUBLIC PROC [wh, index: NAT, val: Rope.ROPE] = {
const: SpecRegConstant ← NEW[ SpecRegConstRec];
const^ ← [index, val];
specRegConstList ← CONS[ const, specRegConstList] };
AddUCode: PUBLIC PROC [aAddr, bAddr: NAT,
aeMI, aoMI, beMI, boMI: Rope.ROPE] = {
const: UCodeWord ← NEW[ UCodeWordRec];
const^ ← [0, aAddr, bAddr, aeMI, aoMI, beMI, boMI];
uCodeList ← CONS[ const, uCodeList] };
GetUCode: PROC = {
stream: IO.STREAM;
aindex, bindex: NAT;
aeMI, aoMI, beMI, boMI: Rope.ROPE;
stream ← FS.StreamOpen["/Phylum/CTamarin/TamarinRoseSim/TamUCode"];
stream ← FS.StreamOpen["///DaTools/TamUCode"];
FOR i: NAT ← 0, i + 1 WHILE i < 128 DO
aindex ← IO.GetInt[stream];
aeMI ← IO.GetTokenRope[stream].token;
aoMI ← IO.GetTokenRope[stream].token;
bindex ← IO.GetInt[stream];
beMI ← IO.GetTokenRope[stream].token;
boMI ← IO.GetTokenRope[stream].token;
AddUCode[aindex, bindex, aeMI, aoMI, beMI, boMI];
ENDLOOP;
IO.Close[stream];
};
GetUCode[];
END.