gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gm2] GM2 ISO


From: Iztok
Subject: [Gm2] GM2 ISO
Date: Tue, 06 May 2003 13:18:54 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020903

Gaius !

I am glad to see your efforts to make GM2 ISO compliant. As was before, I am going to help you by trying to compile my working code. I hope you will be responsive since I would like to use GM2 for our ARM-based device demonstration at the end of this month - so you may expect lots of bug reports.



1. BITSET should be builtin type as CARDINAL, INTEGER etc. are


2. LENGTH, SIZE are pervasive functions (as ORD, VAL, etc) while TSIZE, CAST should be imported from SYSTEM


3. Following fails:

MODULE bits32;

FROM SYSTEM IMPORT BITSET;

TYPE BITS32 = BITSET;

VAR b : BITSET;
   b32 : BITS32;

BEGIN
 b := BITSET{};
 b32 := BITS32{};
END bits32.

#>gm2 -Wiso -c bits32.mod
bits32.mod:12:expecting a set type BITS32



4. Following fails while by ISO should not:

MODULE case;

VAR r1 : RECORD CASE :CARDINAL OF (* case without tag field has this syntax by ISO *)
          0 : v1 : CARDINAL;
        | 1 : v2 : INTEGER;
        ELSE END END;

VAR r2 : RECORD CASE CARDINAL OF
| 0 : v1 : CARDINAL; (* pipe is allowed before first record field by ISO *)
        | 1 : v2 : INTEGER;
        ELSE END END;

BEGIN
END case.

#> gm2 -Wiso -c case.mod
case.mod:3:syntax error, found `:'
case.mod:9:syntax error, found `|'
case.mod:14:compilation failed


5. Following also fails while it should not

MODULE bits32;

FROM SYSTEM IMPORT BITSET,CAST;

TYPE BITS32 = BITSET;

VAR b : BITSET;
   b32 : BITS32;

PROCEDURE f1 (b : BITSET) : BITS32;
 BEGIN
   RETURN CAST(BITS32,b);
 END f1;

BEGIN
 b := BITSET{};
 b32 := CAST(BITS32,BITSET{3}) + f1(BITSET{3});
END bits32.

> gm2 -Wiso -c bits32.mod
../../gcc-3.2+gm2-20030412/gcc/gm2/gm2-compiler/M2Base.mod:505:*** internal error *** unexpected base type


Regards !

I.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]