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

Re: gnubol: WHEN and other conditional phrases



In a message dated 12/15/99 8:44:41 AM EST, mck@tivoli.mv.com writes:

Lots of snipping  ...
<<  Essentially, we're parsing as if the terminators are not
 required, making diagnosis an incidental requirement.
 >>

I think that is an excellent view.  IMHO it leads to tearing the grammar 
rules into fragments, and managing considerable portions of scope issues in 
action code.

(putting asside code base issues for _sequential_ WRITES with INVALID KEY 
clauses).  
If we do not manifest type then 

READ RANDOM-FILE
     INVALID KEY
        WRITE SEQUENTIAL-FILE
     NOT INVALID KEY

can not be parsed as discussed by means of grammar rules, because you are not 
allowed 
to reduce that I/O verb in front of the conditional clause (NOT INVALID KEY) 
as a simple imperative, any more than arithmetics can be reduced as simple 
imperatives infront of a conditional clause (NOT ON SIZE ERROR). 

You can not solve that with shift or reduce. The block on the interior 
hanging on the first clause must be specified as not ending in a 'simple' 
(that is different then choosing a shift or a reduce). That can be done with 
subrules for blocks different from the most general unrestricted statement 
block, but they have to be different for different verb families. It expands 
the rules considerably. But even expanding the rules, I think, does not solve 
all the problems (it is especially true that transposition of the alternate 
clauses brings forth ambiguities like even our worst enemy should not have to 
deal with).

This stuff can be done but it is my view that we will be doing it in action 
code not with grammar rules. My real concern here is that if this is not 
visible then the grammar tool is hiding it from us, because of how we are 
using the tool.

Best Wishes
Bob Rayhawk
RKRayhawk@aol.com

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