Buy the book!
|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
Bison normally warns if there are any conflicts in the grammar
(see section Shift/Reduce Conflicts), but most real grammars
have harmless shift/reduce conflicts which are resolved in a predictable
way and would be difficult to eliminate. It is desirable to suppress
the warning about these conflicts unless the number of conflicts
changes. You can do this with the
The declaration looks like this:
Here n is a decimal integer. The declaration says there should be no warning if there are n shift/reduce conflicts and no reduce/reduce conflicts. An error, instead of the usual warning, is given if there are either more or fewer conflicts, or if there are any reduce/reduce conflicts.
In general, using
%expect involves these steps:
%expect. Use the `-v' option to get a verbose list of where the conflicts occur. Bison will also print the number of conflicts.
%expectdeclaration, copying the number n from the number which Bison printed.
Now Bison will stop annoying you about the conflicts you have checked, but it will warn you again if changes in the grammar result in additional conflicts.
|webmaster donations bookstore||delorie software privacy|
|Copyright © 2003 by The Free Software Foundation||Updated Jun 2003|