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

gnubol: WHEN and other conditional phrases



At 15:19 12/13/99 , RKRayhawk@aol.com wrote:

>In a message dated 12/13/99 5:39:10 PM EST, SiedentopC@Alte-Leipziger.de
>writes:
>
><<
>   ==000016==> IGYPS2112-E The "EVALUATE" verb did not have a matching scope
>  terminator.  A scope
>                           terminator was inserted on line 24.  The execution
>  results may not be
>                           correct.
>   >>

I like this message.  I might leave out " The execution results may not be 
correct," because that's implied by the level E severity.  I would also 
like a second message at line 24 saying something like "The EVALUATE verb 
at line 16 does not have an explicit scope terminator.  END-EVALUATE 
inserted here."  Some might object to giving two diagnostics, but there are 
valid reasons to put the message in each place.  Rather than argue over 
which spot is most appropriate, let's just use both.

Also I think we should plagi^H^H^H^H^H imitate IBM's nesting level indicators.

>I would like to note in passing that this particular vendor is flagging
>several distinct situations with a single error number: IGYPS2112.
>
>It may be easily possible for us to make distinctions, we will defnitely need
>specific code to detect specific implied terminations. This is noteworthy
>because the implied termination of an EVALUATE without a WHEN OTHER probably
>should not be recovered, where as it may be reasonable to recover whilst
>trapping an implied terminator for an EVALUATE that does have that alternate
>clause.

I agree and disagree.  I agree that we should have a separate error number 
for each verb.  What I don't see is why you think EVALUATE without WHEN 
OTHER is so distinct from EVALUATE with WHEN OTHER.  The former can pair 
with WHEN, WHEN OTHER, or END-EVALUATE, the latter can pair with 
END-EVALUATE only.  Either may be implicitly terminated by a conditional 
phrase of a containing statement (as long as that phrase doesn't pair to 
the last statement of the statement block).  EVALUATE with WHEN OTHER can 
also be implicitly terminated by the WHEN of a containing SEARCH or EVALUATE.

In all the talk about mixing SEARH with EVALUATE, I think we've missed 
mixing SEARCH with SEARCH and EVALUATE with EVALUATE.  Examples:

SEARCH
     AT END
         SEARCH ALL
             WHEN
     WHEN

Since SEARCH ALL can only take one WHEN, does the second WHEN bind to the 
outer SEARCH?  Similarly:

EVALUATE
     WHEN
         EVALUATE
             WHEN
             WHEN OTHER
     WHEN

Switching to a different class of conditional phrases, what about this:

READ RANDOM-FILE
     INVALID KEY
        WRITE SEQUENTIAL-FILE
     NOT INVALID KEY

Since WRITE of a sequential file cannot take NOT INVALID KEY, does it bind 
to the READ?  (Bill, has J4 ever ruled on this one?)

--
RB |\  Randall Bart
aa |/  Barticus@usa.net        1-818-985-3259       Barticus@att.net
nr |\  8321 Burnet Av #1, North Hills, CA 91343
dt ||\                                Computer Programmer since 1972
a   |/ I Love You               12 years Unisys/Burroughs experience
l   |\ MS^7=6/28/107                          Will work for paycheck
l   |/ DOT-HS-808-065   http://users.aol.com/PanicYr00/RBResume.html

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