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

Re: [GNU-COBOL] Yet Another Grammar question



Hi again, Laura,

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 ... if it were followed by
END-ADD, making ADD 9 ... an imperative, but Parsing ADD 9 ... NOT ON
SIZE ... will succeed in any case, unless it uses something like the
imperative_add rule that I hypothesized earlier.  Even then, it would
require an arbitrary amount of backtracking to reparse the simple 
ADD 9 ... and then associate the NOT ON SIZE with the outer add.  I
am confident the committee would not intentionally do that to us.

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.

Consider my request to raise the issue again when it becomes
troublesome retracted.

Mike
  

>>>>> "Laura" == Laura Tweedy <ltweedy@bellatlantic.net>
>>>>> wrote the following on Wed, 21 Jul 1999 00:58:53 -0400

      ...

  Laura> Third, I read the rest of this section to say that if we
  Laura> have nested imperatives, such as:

  Laura> ADD 5 TO FOO ON SIZE ERROR ADD 3 TO BAR

  Laura> But, if the answer to my first question is, no, we don't
  Laura> need a closing delimiter, and since and "imperative
  Laura> statement" can be more than one statement, how would we
  Laura> differentiate between more imperative statements and those
  Laura> that should logically follow the original ADD?

  Laura> For example, how do we interpret:

ADD 5 TO FOO
	ON SIZE ERROR ADD 3 TO BAR
		      ACCEPT BAZ
                      ADD 9 TO OTHER

  Laura> Based on this ambiguity, I'm inclined to believe that some
  Laura> kind of delimiter is required at the end of the "imperative
  Laura> statement".

  Laura> But, since "NOT ON SIZE ERROR" cannot occur within one of
  Laura> the nested ADDs, we can write the following without any
  Laura> ambiguity or explicit delimiters on the "imperative
  Laura> statement":

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

  Laura> I am at a loss as to how to interpret the standard in this
  Laura> matter.  Does anyone have an idea as to the correct
  Laura> interpretation?

  Laura> Thanks!  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.