Gen2Impl.mesa
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Jean Gastinel August 11, 1987 10:50:07 am PDT
Oracle Generation number 2
DIRECTORY
FS, IO, Rope, OracleGen;
Gen2Impl: CEDAR PROGRAM
IMPORTS FS, IO, OracleGen, Rope
~ BEGIN
OPEN OracleGen;
outf: IO.STREAM;
k : INT;
c : LONG CARDINAL;
s,s0,s1,s2,s3,r,t: Rope.ROPE;
GenCount64: PROC [k: INT] RETURNS [] ~ {
mid: INT ← 32;
SELECT k FROM
IN [0..3) => {
s ← Hex[c];
s ← LExtend[s,8];
s0 ← s;
s ← Rope.Concat["00000000 ",s];
t ← "XXXXXXXX XXXXXXXX";
};
IN [3..32) => {
s ← Hex[c];
s ← LExtend[s,8];
s0 ← s;
s ← Rope.Concat["00000000 ",s];
t ← Rope.Concat["00000000 ",s3];
};
IN [mid..36) => {
IF k=mid THEN c 𡤀 ;
s ← Hex[c];
s ← LExtend[s,8];
s0 ← s;
s ← Rope.Concat[s," 00000000"];
t ← Rope.Concat["00000000 ",s3];
};
IN [36..64) => {
s ← Hex[c];
s ← LExtend[s,8];
s0 ← s;
s ← Rope.Concat[s," 00000000"];
t ← Rope.Concat[s3," 00000000"];
};
ENDCASE;
s3 ← s2;
s2 ← s1;
s1 ← s0;
IF c=0 THEN c 𡤁 ELSE c ← 2*c;
};
Here the program start :
Create or Append the file
r ← "Gen.oracle";
outf ← FS.StreamOpen[r, $create];
outf.PutF["-- Begining of the text : \n"];
Start Generation :
s ← "00000000 00000000";
t ← "XXXXXXXX XXXXXXXX";
outf.PutF["%g | %g \n",IO.rope[s],IO.rope[t]];
c ← 0;
s1 ← "XXXXXXXX";
s2 ← "XXXXXXXX";
s3 ← "";
FOR k IN[0..64)
DO
GenCount64[k];
outf.PutF["%g | %g \n",IO.rope[s],IO.rope[t]];
ENDLOOP;
outf.Close[];
END.