bug-bison
[Top][All Lists]
Advanced

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

%raw is broken?


From: Akim Demaille
Subject: %raw is broken?
Date: 20 Sep 2000 14:10:04 +0200
User-agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)

Hi everybody, and Jesse in particular,

I'm backing at working on Bison, and I'm currently setting up a test
suite.  One of my tests fails.  Since I'm tempted to call this a Bison
bug, I did check this test in CVS Bison, but if I'm wrong, I'll remove
it quickly.

It seems to me that %raw (aka --raw) does not work properly.
`calc.y', which is generated by the test suite, is appended below, but
the following trace should demonstrate the problem:

src/bison/tests % bison calc.y -o calc.c && gcc calc.c -o calc   nostromo 14:03
src/bison/tests % echo "1 + 2" | ./calc && echo                  nostromo 14:03
3
src/bison/tests % bison calc.y -o calc.c --raw && gcc calc.c -o calc
src/bison/tests % echo "1 + 2" | ./calc && echo                  nostromo 14:03
parse error


I suppose the way the tokens are numbered with %raw is not completely
propagated in bison, or maybe %raw must not be used when you do return
characters (and not only tokens in its %token meaning) in which case
bison should probably refuse to see character literals in the grammar.

I don't know too well, but anyway, I'm pretty sure it should not
happen this way, or at least the documentation should display huge
warnings (I found none).

BTW, I never quite understood the interest of this option, could
someone explain it to me?

Thanks!

        Akim

Attachment: calc.y
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]