Article View: gnu.utils.bug
Article #542bison-1.03 bug
From: fox
Date: Wed, 15 Nov 1989 16:02
Date: Wed, 15 Nov 1989 16:02
55 lines
1452 bytes
1452 bytes
I have just learned that if a grammar contains useless nonterminals
it will not work properly. Here is the last entry in the change log:
Wed Aug 23 15:03:07 1989 Jay Fenlason (hack at gnu)
* Makefile: Include system.h in bison-dist.tar
Here is an input file that provides evidence of the bug:
------------- Cut here ---------------
%token sym5
%token sym6
%token sym7
%token sym8
%token sym9
%token sym0
%%
sym1:
sym3
| sym4
;
sym2:
sym5
| sym6
;
sym3:
sym7
| sym8
;
sym4:
sym9
| sym0
;
------------------------------
And here is the evidence: incorrect entries in yyrline[]:
static const short yyrline[] = { 0,
10, 12, 15, 17, 20, 22
};
The sym2: rule is useless, but its lines appear in the array
and those of sym4 do not. Note that it is not only yydebug
output that is incorrect; such parsers do not parse correctly.
Thanks,
David Fox
fox@allegra.att.com
fox@cs.columbia.edu
Technical Details
Message-ID:
<8911151725.AA28108@life.ai.mit.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!tut.cis.ohio-state.edu!allegra.att.com!foxShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!tut.cis.ohio-state.edu!allegra.att.com!fox From: fox@allegra.att.com Newsgroups: gnu.utils.bug Subject: bison-1.03 bug Message-ID: <8911151725.AA28108@life.ai.mit.edu> Date: 15 Nov 89 16:02:41 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 55