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

Re: FW: gnubol: How do we parse this language, anyway?



Bill,

I am interested in Microfocus COBOL, but also COBOL for FUNCTION
currentsynonym("MVS"). Here are a couple of test cases for the nested conditional
search/eval.

As Bob suggested, I am going to have a very sharp demarcation between parsing and
the rest so I should be able to handle changes down the track if needed. I am
really intrigued how Microfocus would handle this kind of thing.

Regards,
Tim Josling


<program1>
       IDENTIFICATION DIVISION.
       PROGRAM-ID. COBOL-TEST.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  a.
         03  b occurs 10 indexed by ix pic x.
       01  a2.
         03  b2 occurs 10 indexed by ix2 pic x.
       01  c   pic 9.
       PROCEDURE DIVISION.
       001.
           move "1234567890" to a.
           search b
                  when b (ix) = "6"
                       set c to ix
                       evaluate true
                           when c = 1
                                display "surprise"
                           when c = 6
                                display "no surprise"
                           when other
                                display "surprise"
      ***               end-evaluate
                  when b (ix) = "7"
                        display "5 found"
           .
</program1>

<program2>
       IDENTIFICATION DIVISION.
       PROGRAM-ID. COBOL-TEST.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  a.
         03  b occurs 10 indexed by ix pic x.
       01  a2.
         03  b2 occurs 10 indexed by ix2 pic x.
       01  c   pic 9.
       PROCEDURE DIVISION.
       001.
           move "1234567890" to a.
           search b
                  when b (ix) = "6"
                       set c to ix
                       evaluate true
                           when c = 1
                                display "surprise"
                           when c = 6
                                display "no surprise"
      ***                 when other
      ***                       display "surprise"
      ***               end-evaluate
                  when b (ix) = "7"
                        display "5 found"
           .
</program2>


"William M. Klein" wrote:

> Tim,
>  Which "their" are you talking about?...
>
> If you have ANY test code that you would like run on various compilers, I
> would be happy to post it in comp.lang.cobol - with which compilers we would
> like to see tested.  Usually such requests get fairly good (and medium
> timely) results.
>
> Bill Klein
>   wmklein <at> ix.netcom.com
>


--
This message was sent through the gnu-cobol mailing list.  To remove yourself
from this mailing list, send a message to majordomo@lusars.net with the
words "unsubscribe gnu-cobol" in the message body.  For more information on
the GNU COBOL project, send mail to gnu-cobol-owner@lusars.net.