bug-bison
[Top][All Lists]
Advanced

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

Useless rule?


From: Jon Watte
Subject: Useless rule?
Date: Fri, 10 Jan 2003 23:46:45 -0800

I tried compiling the attached grammar using bison 1.875, passing
options -dv. It complained that there is one unused terminal, one
unused nonterminal, and four useless rules.

However, reading the grammar, I really don't see what it's
complaining about. The manual and FAQ, as well as a web search,
came up empty. I tried rearranging the file to push terminals up
and remove "convenience" nesting, but that still didn't fix it.

This bug first happened with version 1.32; I thought it might be
already known and upgraded to 1.875, but it still happens.

While it may be a bug in my thinking, I've checked it enough that
I find that theory unlikely. It may, however, be a bug in my
understanding about the strictures of bison grammars; if so, I'd
appreciate a pointer to the correct piece of the info file, as
I couldn't find anything relevant.

The file is only 240 lines long, so this seems like a small,
self-contained case.

Cheers,

                                / h+



PS: you might want to update that copyright date in the version
command, as the release archive was put up on Jan 1 :-)


bison -dv pieces.y
pieces.y: warning: 1 useless nonterminal and 4 useless rules
pieces.y:209.3-18: warning: useless nonterminal: edge_height_list
pieces.y:209.3-18: warning: useless rule: tile_edge_decl: edge_height_list
pieces.y:226.3-23: warning: useless rule: edge_cont_list: EDGE
edge_height_list
pieces.y:228.3-42: warning: useless rule: edge_cont_list: edge_cont_list ';'
EDGE edge_height_list
pieces.y:232.3-233.50: warning: useless rule: edge_height_list: '{' INTEGER
',' INTEGER '}' edge_height_list ',' '{' INTEGER ',' INTEGER '}'

bison -V
bison (GNU Bison) 1.875
Written by Robert Corbett and Richard Stallman.

Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Attachment: pieces.y
Description: Binary data

Attachment: pieces.output
Description: Binary data


reply via email to

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