gm2
[Top][All Lists]
Advanced

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

Re: [Gm2] cvs updated


From: Gaius Mulley
Subject: Re: [Gm2] cvs updated
Date: Sun, 01 Dec 2002 11:43:59 +0000

>>
>>
>>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;
>...
>....

yes I see, I'll alter the bnf to reflect ISO case both in statements
and variant records.

>
>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

many thanks for this bug report.
>
>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

and this one too!

>
>
>If I find more I'll tell.

please do..

>
>Regards !
>
>Iztok
>

incidently I've currently working on a fix for the bug you reported
concerning ConvTypes (forward declaration of the procedure type).

Gaius



reply via email to

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