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

Re: [GNU-COBOL] Yet Another Grammar question



[The example in question]

> ADD 5 TO FOO
>         ON SIZE ERROR ADD 3 TO BAR
>                       ACCEPT BAZ
>                       ADD 9 TO OTHER
>         NOT ON SIZE ERROR PERFORM SOME-PAR

> I seem to have overlooked the hard part.  This is a truly nasty
> example and is more than worthy of official clarication.  The problem
> is that the NOT ON SIZE ERROR phrase in your second example would
> seem to legitimately belong to ADD 9 ... 

As I read the standard, the ADD statement can only appear in the SIZE
ERROR clauses (and other imperative-statement locations) when it appears
"Whithout the optional ON SIZE ERROR and NOT ON SIZE ERROR phrases". 
So, the NOT ON SIZE ERROR PERFORM SOME-PAR can only be matched with the
very first ADD, that being ADD 5 TO FOO.

A lot about the sentence vs. statement has been cleared up, but I guess
I should state my reason for asking about imperative-statement in the
first place.  I would *really* like there to be a terminator at the end
of any statements that are to be executed when the ON SIZE ERROR
condition occurs.  That is, I would much rather have the above example
look like:

ADD 5 TO FOO
         ON SIZE ERROR ADD 3 TO BAR
                       ACCEPT BAZ
                       ADD 9 TO OTHER.  <- or END-ADD
         NOT ON SIZE ERROR PERFORM SOME-PAR

This would make parsing much easier.


> I would prefer to require an END-ADD after ADD 9 ... to have the
> semantics of the program be what you apparently intend, but I see no
> way to mount a defense for that position.  You'll have to find a real
> expert this time, and if there isn't one in the group, perhaps you
> should post the question to comp.lang.cobol.  Some of the standards
> people do hang out there some of the time.
> 
	Thank you, I will do that. :)

laura
--
Laura Tweedy .. ltweedy@bellatlantic.net

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