gnucobol-users
[Top][All Lists]
Advanced

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

[open-cobol-list] Small Cobol changes for MVS compatibility


From: David Korn
Subject: [open-cobol-list] Small Cobol changes for MVS compatibility
Date: Sun Nov 14 21:26:11 2004

We found and made the following changes to OpenCobol to get code
from MVS to compile on Linux. 

1.      Lines like TITLE. 'string' are ignored by adding
                "TITLE" |
        after
                "AUTHOR" |
        in pplex.l.

2.      The IBM Compiler treats
                COMPUTE X EQUAL ...
        as
                COMPUTE X '=' ...
        so I changed
                arithmetic_x_list '=' expr
        to
                arithmetic_x_list equal expr
        and added
                equal:  '=' | EQUAL;
        to parser.y.

3.      The rule for COPY .. REPLACE was not correct.  Referring to
        the IBM Cobol definition for the REPLACING clause we discovered
        that IBM defines that  when evaluating pseudo-text leading and
        trailing blanks are ignored (but not imbedded blanks).

        EXAMPLE:
                COPY RBDK3736 REPLACING == S3736: == BY == W9810 ==.
        where RBDK3736 contains,
                05 S3736:-DTE-CRTE-FLE-MPS PIC 9(08).
        results in
              05  W9810 -DTE-CRTE-FLE-MPS PIC 9(08).
        NOT
              05  W9810-DTE-CRTE-FLE-MPS PIC 9(08).

        To fix this we changed the line
                "=="                    { BEGIN PSEUDO_STATE; return EQEQ; }
                "=="                    { BEGIN COPY_STATE; return EQEQ; }
        in ppplex.l  to
                "=="[ ]*                { BEGIN PSEUDO_STATE; return EQEQ;
                [ ]*"=="                { BEGIN COPY_STATE; return EQEQ; }


Let me know whether these changes or ok.

David Korn
address@hidden


reply via email to

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