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

Re: gnubol: distinguishing data refs and conditional refs



At 02:46 PM 11/2/99 , RKRayhawk@aol.com wrote:

>A poorly constructed conditional expression (with good items) should not halt
>the compile or disrupt the parse. So in the discussions of things like
>
>     IF a = b OR ( c < d AND e < f ) OR z
>
>where z is a non-sequitur (such as a data name), we need to catch it and
>produce it (even if the production is to do nothing. Otherwise we will be way
>into the THEN  or ELSE clause attempting recovery.  With many real world
>programs that will create an unacceptable result.

I agree that invalid expressions should have error productions, but I don't 
see why we should end up "way into" anything.  Expression parsing should 
always halt on any verb or keyword other than expression keywords, and 
should resume at the first verb after the error (including the verb that 
terminated the expression).  Eg,

     IF  ((A = B) OR (C = GO TO X

As soon as the verb GO is encountered, we should be in an error 
production.  Parsing should resume at GO.

>In the procedure division, valid data references are basically backward
>references to things already declared in previous divisions. In the procedure
>division, a reference to a section or paragraph name might easily be a
>forward reference. In a single pass copilation, such a forward reference
>would be indistinguishable from a reference to an undeclared data name (an
>error).

Can you give me an example where data names and procedure names can occur 
in the same context?  Procedure names always occur after GO, PERFORM, INPUT 
PROCEDURE, OUTPUT PROCDURE, ALTER (boo), or a period (when declared).
--
RB |\  Randall Bart
aa |/  Barticus@usa.net 818-985-3259 Barticus@att.net
nr |\  8321 Burnet Av #1, North Hills, CA 91343
dt ||\
a   |/ Y2K website:    http://users.aol.com/PanicYr00
l   |\
l   |/ DOT-HS-808-065     I Love You    MS^7=6/28/107


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