[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gnubol: Re: Magic tokens
That's OK. The problem is with the definition of statement. I was defining two
kinds, 'general' and 'imperative'. The imperative form did not have size error
(because a size error is not allowed in an imperative, leaving aside the
complication that end-verb makes it imperative). I only allowed the imperative
form in the statements within the size error. So the greedy parser had nothing to
grab, and incorrectly the not size error with the higher level verb, which parsed
and run, but was wrong IMO.
add a to b << conditional statement.
size error
add c to d << imperative statement
not size error
display 'hello'
.
So for this reason I have to parse it as though nested conditionals are valid,
and then disallow them. But allowing nested conditionals (evaluate and search)
creates problems. I would be interested how your parser parses nested
evaluate/search when both include multiple WHEN clauses.
Once I have the hacks done do some "bet you can't parse this" tests (assuming the
PCCTS grammar is part of a whole executable - is it?).
Tim Josling
Michael McKernan wrote:
> A greedy parser will grab the size error for the appropriate verb.
> (You'll remember that {} means optional.)
--
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.