- Нужно передавать информацию о файле и строках в кодогенератор.
- Нет процедур привязанных к типм (10.2)
- Не полная реализация модуля Files
+ * Нет процедур ReadNum WriteReal WriteLReal WriteNum WriteSet WriteBool
- Разршить отсутсвие RETURN в функциях без BEGIN
С вкорячиванием трапа, естественно.
i := 1;
WHILE i < Args.count DO
Args.GetArg(i, str); Texts.WriteString(W, str); Texts.Write(W, " ");
+ Out.String("Param "); Out.Int(i, 0); Out.Char(" "); Out.String(str); Out.Ln;
INC(i)
END;
Texts.Append(Par.text, W.buf);
END
END LogNotifier;
-PROCEDURE StubNotifier(T: Texts.Text; op: INTEGER; beg, end: LONGINT);
-BEGIN
-END StubNotifier;
-
BEGIN
NEW(Par);
NEW(Par.text);
- Par.text.notify := StubNotifier;
Par.pos := 0;
Texts.Open(Par.text, "");
PopulateParams;
public static void WriteInt(RECORD1 R[], int R$, short x)
{
- SYSTEM.TRAP(-3);
+ byte[][] i = new byte[1][2];
+ i[0][0] = (byte) ((x >>> 8) & 0xff);
+ i[0][1] = (byte) ((x) & 0xff);
+ WriteBytes(R, R$, i, 0, 2);
}
public static void WriteLInt(RECORD1 R[], int R$, int x)
{
- SYSTEM.TRAP(-3);
+ byte[][] i = new byte[1][4];
+ i[0][0] = (byte) ((x >>> 24) & 0xff);
+ i[0][1] = (byte) ((x >>> 16) & 0xff);
+ i[0][2] = (byte) ((x >>> 8) & 0xff);
+ i[0][3] = (byte) ((x) & 0xff);
+ WriteBytes(R, R$, i, 0, 4);
}
public static void WriteReal(RECORD1 R[], int R$, float x)
public static void WriteString(RECORD1 R[], int R$, byte x[])
{
- SYSTEM.TRAP(-3);
+ byte[][] i = new byte[1][];
+ i[0] = x;
+ WriteBytes(R, R$, i, 0, SYSTEM.LEN(x));
}
public static void WriteSet(RECORD1 R[], int R$, int x)
public static void WriteBytes(RECORD1 r[], int r$, byte[][] x, int x$, int n)
{
- SYSTEM.TRAP(-3);
+ RECORD1 rider = r[r$];
+ RandomAccessFile desc = rider.base.desc;
+
+ try
+ {
+ rider.base.SetActive(rider);
+ desc.write(x[x$], 0, n);
+ rider.position += n;
+ }
+ catch(IOException e)
+ {
+ rider.res[0] = n;
+ rider.eof[0] = true;
+ }
}
public static void BEGIN()