[Cobolforgcc-devel] yacc/bison question
Status: Pre-Alpha
Brought to you by:
timjosling
|
From: Matthew V. <lin...@ho...> - 2001-06-11 01:36:18
|
Tim,
I was working on my file i/o grammar this weekend, and ran into some
issues with the LOCK MODE clause. I've kinda got it figured out, but
I'm not certain that it's the correct way:
I've got a clause:
LOCK [MODE IS] {MANUAL | AUTOMATIC} [[WITH] LOCK ON {RECORD | RECORDS}]
The two LOCKs were causing reduce/reduce errors. I finally ended up
sticking a "LOCK_ON" token in cobctok.def to alleviate the ambiguity for
bison/yacc. I'm a little worried about the kvalue, however. I've set
it to "LOCK ON". I'd like to figure out a way to delete that token, and
still not have any shift/reduce or reduce/reduce errors.=20
Here's the relevant bit from my file.tpl:
lock_mode_clause:
LOCK opt_mode opt_is manual_or_auto_kw opt_lock_on_clause {
RSN($1, "Lock Mode not yet supported");
}
;
manual_or_auto_kw:
MANUAL
| AUTOMATIC
;
opt_lock_on_clause:
/* nothing */
| with_lock_on
;
with_lock_on:
opt_with lock_on
;
lock_on:
LOCK_ON record_or_records
;
record_or_records:
RECORD
| RECORDS
;
If I change the "LOCK_ON" to "LOCK ON", I get a reduce/reduce error. I
would rather not have any errors, but I'm still a little dubious about a
"LOCK_ON" token.
Thoughts?
--
Matthew Vanecek
perl -e 'print
$i=3Dpack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'
***************************************************************************=
*****
For 93 million miles, there is nothing between the sun and my shadow
except me.
I'm always getting in the way of something...
|