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

Re: gnubol: How do we parse this language, anyway?



Randall,  

You and Michael are dead right and I was quite wrong. I will have to
carefully
reread the standard. 

I downloaded Fujitsu cobol V3 and tried a few scenarios.

In summary, it allows no latitude. It binds size error or not size error
to nearest feasible verb. A nested verb loses feasibility when it has
been terminated by end-verb; by another verb; by a period. 

Thus:

add a to b 
     size error
         add c to d
             size error
                 display 
>>> error conditional add within conditional add

add a to b
     size error
        add c to d
        end-add
     not size error
         display
>>> OK, both size errors bind to first add

add a to b
    size error
        add c to d
        display ...
    not size error
        display
>>> OK! because display terminates nested add so not size binds to first add

add a to b
    size error
        add c to d
        display ...
    not size error
        display ...
    size error
        display

>>> Error: excess size error...

Tim Josling

Randall Bart wrote:

> At 11:09 AM 11/28/99 , Tim Josling wrote:
>
> >Thus I predict the not size will bind to the add.
>
> The NOT conditional phrases were introduced in Cobol-85, along with the
> scope terminators.  The NOT SIZE will bind to the SUBTRACT.  To get it to
> bind to the ADD, you need END-SUBTRACT (which is why the optional END-x is
> allowed on imperative verbs.


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