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

Re: Parsing nested statements: was Re: gnubol: subsets



>>>>> "Tim" == Tim Josling <TIMJOSLING@prodigy.net>
>>>>> wrote the following on Fri, 26 Nov 1999 03:22:01 +1000

  Tim> It's not a show stopper just more to do. A bit like
  Tim> next-sentence / end-if handling.

  Tim> How would you parse these (if not how the indentation
  Tim> suggests)?

Hi Tim,

All of the following is based on my interpretation of the standard
and an assumption that the prospective IBM verification will turn out
as I expect.  In case you're not aware of it, this is a long weekend
holiday for most of us in the States, but the list has good
representation elsewhere, so perhaps someone from Europe, Asia or
Australia can get us an answer before Monday.  Anyway, anything I say
here should get filed until we know the answer.


Noone questions this one.

add a to b // just an abvious starting point
    size error
          add c to d
          display ...
.

This looks fine.

add a to b
   size error
         add c to d
            size error // it can only bind in one place I guess
                   add e to f
.

I don't think this is what the standard says about this case.  The
"not size error" should bind to the inner add because the inner add
is able to take a "not size error" phrase and it doesn't yet have
one.  Take another look at paragraph 6.4.3 and see if you don't
agree.  That change would make it right associative once again.

add a to b
   size error
      add c to d
   not size error // this is what the standard says though it is not right
associative
      add e to f
.

By the same reasoning, the "not size error" in this example belongs
to "add e to f".  The other indentation looks good.

add a to b
   size error
          add c to d
                 size error
                      add e to f
                 not size error // we are in uncharted waters here - what does
IBM do?
                       add g to h
.

Best regards,

Mike




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