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

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



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

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

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

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
.

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
.

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
.

Tim Josling

Michael McKernan wrote:

>   Tim> I have no problems if Bob is right, but if the IBM
>   Tim> compilers behave as suggested I have a lot more work to do.
>
>   Tim> Tim Josling
>
> ...
> Since this is not a specification like the standard, but a
> description of an implementation, it obvously should be verified.  I
> don't see the work to be done as especially onerous, however.  You
> stop scanning ahead, remove the extra productions and stop trying to
> distinguish between imperative and conditional statements.  Now
> everything falls out.  Are there other problems?
> ...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.