[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gnubol: Re: Magic tokens
>>>>> "Bob" == RKRayhawk <RKRayhawk@aol.com>
>>>>> wrote the following on Mon, 6 Dec 1999 16:10:55 EST
Bob> Let me quote some material that went back and forth enough I
Bob> don't know who said what, but it is important. Then if you
Bob> will consider my comment below.
Bob> In a message dated 12/4/99 9:41:38 PM EST, mck@tivoli.mv.com
Bob> writes:
Bob> << >>>> "Mike" == Michael McKernan <mck@tivoli.mv.com>
>>>>>> wrote the following on Sat, 04 Dec 1999 21:23:50 -0500
Mike> Tim, I don't know if this translates to bison very well, but
Mike> I am thinking along these lines.
Bob> add_imperative
Bob> : add_common { size_err end_add | end_add }
Bob> ;
Bob> add_stmt
Bob> : add_common { size_err } { end_add }
Bob> ;
Bob> add_common
Bob> : ADD
Bob> ( CORR identifier TO identifier { ROUNDED }
Bob> | ( identifier | NUMERIC_LITERAL )+
Bob> ( giving_phrase
Bob> ! TO ( identifier | NUMERIC_LITERAL ) giving_phrase
Bob> | TO ( identifier { ROUNDED } )+
Bob> )
Bob> )
Bob> ;
Mike> A greedy parser will grab the size error for the appropriate
Mike> verb. (You'll remember that {} means optional.)
Bob> Well, now that I look at it, it may be a reduce/reduce
Bob> conflict since both rules are capable of deriving the same
Bob> string. Well, FWIW.
>>>
Bob> At any given time we need competition between
Bob> A)
Bob> simple unterminated arithmetic statement
Bob> simple explicitly terminated arithmetic statement
Bob> sticky arithmetic with a conditional unterminated (A.3)
Bob> arithmetic with a conditional terminated (thus no longer
Bob> sticky) (A.4)
Bob> B)
Bob> sticky arithmetic with both conditional branches yet
Bob> unterminated arithmetic with both conditional branches
Bob> terminated (thus nolonger sticky)
Bob> (B.2)
Honest Bob, there is no problem. Once we buy into the nearest
preceding eligible verb binding rule, we can only hold on and go
where it takes us. There are no choices, no alternatives. The
grammar above is entirely adequate (along with the rules referenced
but not shown); nothing more is needed.
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.