kpmy %!s(int64=6) %!d(string=hai) anos
pai
achega
cded2432ae

+ 8 - 7
personal/wirth/ProjectOberon/Sources/ORB.Mod.txt

@@ -1,4 +1,4 @@
-MODULE ORB;   (*NW 25.6.2014  / 19.4.2017  in Oberon-07*)
+MODULE ORB;   (*NW 25.6.2014  / 11.9.2018  in Oberon-07*)
   IMPORT Files, ORS;
   (*Definition of data types Object and Type, which together form the data structure
     called "symbol table". Contains procedures for creation of Objects, and for search:
@@ -22,9 +22,8 @@ MODULE ORB;   (*NW 25.6.2014  / 19.4.2017  in Oberon-07*)
     Type* = POINTER TO TypeDesc;
 
     ObjDesc*= RECORD
-      class*, exno*: BYTE;
+      class*, lev*, exno*: INTEGER;
       expo*, rdo*: BOOLEAN;   (*exported / read-only*)
-      lev*: INTEGER;
       next*, dsc*: Object;
       type*: Type;
       name*: ORS.Ident;
@@ -224,9 +223,11 @@ MODULE ORB;   (*NW 25.6.2014  / 19.4.2017  in Oberon-07*)
           IF class = Typ THEN
             t := obj.type; t.typobj := obj; Read(R, k);  (*fixup bases of previously declared pointer types*)
             WHILE k # 0 DO typtab[k].base := t; Read(R, k) END
-          ELSIF class = Const THEN
-            IF obj.type.form = Real THEN Files.ReadInt(R, obj.val) ELSE Files.ReadNum(R, obj.val) END
-          ELSIF class = Var THEN Files.ReadNum(R, obj.val); obj.rdo := TRUE
+          ELSE
+            IF class = Const THEN
+              IF obj.type.form = Real THEN Files.ReadInt(R, obj.val) ELSE Files.ReadNum(R, obj.val) END
+            ELSIF class = Var THEN Files.ReadNum(R, obj.val); obj.rdo := TRUE
+            END
           END ;
           obj.next := thismod.dsc; thismod.dsc := obj; Read(R, class)
         END ;
@@ -291,7 +292,7 @@ MODULE ORB;   (*NW 25.6.2014  / 19.4.2017  in Oberon-07*)
       IF (t.mno > 0) & (obj # NIL) THEN  (*re-export, output name*)
         mod := topScope.next;
         WHILE (mod # NIL) & (mod.lev # t.mno) DO mod := mod.next END ;
-        IF mod # NIL THEN Files.WriteString(R, mod.name); Files.WriteInt(R, mod.val); Files.WriteString(R, obj.name)
+        IF mod # NIL THEN Files.WriteString(R, mod(Module).orgname); Files.WriteInt(R, mod.val); Files.WriteString(R, obj.name)
         ELSE ORS.Mark("re-export not found"); Write(R, 0)
         END
       ELSE Write(R, 0)

+ 3 - 4
personal/wirth/ProjectOberon/Sources/ORG.Mod.txt

@@ -1,5 +1,5 @@
-MODULE ORG; (* N.Wirth, 16.4.2016 / 4.4.2017 / 22.7.2018  Oberon compiler; code generator for RISC*)
-  IMPORT SYSTEM, Files, ORS, ORB;
+MODULE ORG; (* N.Wirth, 16.4.2016 / 4.4.2017 / 11.9.2018  Oberon compiler; code generator for RISC*)
+  IMPORT SYSTEM, Files,  ORS, ORB;
   (*Code generator for Oberon compiler for RISC processor.
      Procedural interface to Parser OSAP; result in array "code".
      Procedure Close writes code-files*)
@@ -90,6 +90,7 @@ MODULE ORG; (* N.Wirth, 16.4.2016 / 4.4.2017 / 22.7.2018  Oberon compiler; code
   BEGIN
     IF RH # 0 THEN ORS.Mark("Reg Stack"); RH := 0 END ;
     IF pc >= maxCode - 40 THEN ORS.Mark("program too long") END ;
+    IF frame # 0 THEN ORS.Mark("frame error"); frame := 0 END
   END CheckRegs;
 
   PROCEDURE SetCC(VAR x: Item; n: LONGINT);
@@ -1111,7 +1112,5 @@ MODULE ORG; (* N.Wirth, 16.4.2016 / 4.4.2017 / 22.7.2018  Oberon compiler; code
     Files.Write(R, "O"); Files.Register(F)
   END Close;
 
-  (*---------------decoder-----------------*)
-
 BEGIN relmap[0] := 1; relmap[1] := 9; relmap[2] := 5; relmap[3] := 6; relmap[4] := 14; relmap[5] := 13;
 END ORG.

+ 3 - 3
personal/wirth/ProjectOberon/Sources/ORP.Mod.txt

@@ -1,4 +1,4 @@
-MODULE ORP; (*N. Wirth 1.7.97 / 8.8.2018  Oberon compiler for RISC in Oberon-07*)
+MODULE ORP; (*N. Wirth 1.7.97 / 11.9.2018  Oberon compiler for RISC in Oberon-07*)
   IMPORT Texts, Oberon, ORS, ORB, ORG;
   (*Author: Niklaus Wirth, 2014.
     Parser of Oberon-RISC compiler. Uses Scanner ORS to obtain symbols (tokens),
@@ -97,7 +97,7 @@ MODULE ORP; (*N. Wirth 1.7.97 / 8.8.2018  Oberon compiler for RISC in Oberon-07*
   PROCEDURE TypeTest(VAR x: ORG.Item; T: ORB.Type; guard: BOOLEAN);
     VAR xt: ORB.Type;
   BEGIN xt := x.type;
-    IF (T.form IN {ORB.Pointer, ORB.Record}) & (T.form = xt.form) THEN
+    IF (T.form = xt.form ) & ((T.form = ORB.Pointer) OR (T.form = ORB.Record) & (x.mode = ORB.Par)) THEN
       WHILE (xt # T) & (xt # NIL) DO xt := xt.base END ;
       IF xt # T THEN xt := x.type;
         IF xt.form = ORB.Pointer THEN
@@ -990,7 +990,7 @@ MODULE ORP; (*N. Wirth 1.7.97 / 8.8.2018  Oberon compiler for RISC in Oberon-07*
     Oberon.Collect(0)
   END Compile;
 
-BEGIN Texts.OpenWriter(W); Texts.WriteString(W, "OR Compiler  22.7.2018");
+BEGIN Texts.OpenWriter(W); Texts.WriteString(W, "OR Compiler  11.9.2018");
   Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf);
   NEW(dummy); dummy.class := ORB.Var; dummy.type := ORB.intType;
   expression := expression0; Type := Type0; FormalType := FormalType0

+ 5 - 0
personal/wirth/news.txt

@@ -1,3 +1,8 @@
+20180912 - Update Oberon compiler
+  Type tests other than for pointers and record parameters detected as illegal.
+  see ORP.TypeTest
+  Reexport of objects from aliased modules fixed. See ORB.OutType.
+  Updated files are ORP.Mod.txt, ORG.Mod.txt, ORB.Mod.txt
 20180804 - Update RISC5 definition in Lola, according to changes on 2018 06 28
   RISC5.Lola   RISC5Top.Lola
 20180720 - Update compiler: ORP.Mod.txt and ORG.Mod.txt