gm2
[Top][All Lists]
Advanced

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

Re: [Gm2] cvs updated


From: Iztok Kobal
Subject: Re: [Gm2] cvs updated
Date: Fri, 29 Nov 2002 13:55:53 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0



I don't understand your comment about the CASE statement though.. the
gm2 bnf is:

CaseStatement := "CASE" Expression "OF" Case { "|" Case }
                [ "ELSE" StatementSequence ] "END" =:

Case := CaseLabelList ":" StatementSequence =:

perhaps you could post a small code example?

AFAIK ISO M2 compilers (SBM2, XDS, GPM) (I am not sure if it is by standard) allow:

CaseStatement := "CASE" Expression "OF" ["|"] Case { "|" Case }
                [ "ELSE" StatementSequence ] "END" =:


While PIM2 explicitly disallows it.

It is not really important - only when having code with compiler options where can be possible that the first line in the CASE statement varies:

CASE a OF
#if SOMETHING
 case1 : statement1;
#endif
 | case2 : statement2;
...
....

This very example could be solved by putting the "|" char at end of line - but you know that everyone has its own aestetics for source formatting.

Anyway, what is really important is that the work on ISO is going on.


And more about CASE

Compilation of next (illegal) CASE sentence

TYPE CT = RECORD
           CASE  b:CARDINAL OF
             1 : a : CARDINAL;
           | 2 : a : INTEGER;
           END;
         END;

produces

case.mod:0: internal error: Segmentation fault

while legal (at least by ISO) CASE sentence

TYPE CT = RECORD
           CASE  :CARDINAL OF  (* virtual case modifier *)
             1 : a : CARDINAL;
           | 2 : b : INTEGER;
           END;
         END;

produces

case.mod:...:syntax error, found `:'
case.mod:...:compilation failed


If I find more I'll tell.

Regards !

Iztok


--
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with address@hidden http://shopnow.netscape.com/




reply via email to

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