]> git.saurik.com Git - bison.git/blobdiff - doc/bison.texinfo
Regen.
[bison.git] / doc / bison.texinfo
index f34123541269cf18b44ee3a70dee8e4bb198092d..a82c0783849774278c2266ca93a0077f16fa7fa0 100644 (file)
@@ -40,7 +40,7 @@ This manual is for @acronym{GNU} Bison (version @value{VERSION},
 @value{UPDATED}), the @acronym{GNU} parser generator.
 
 Copyright @copyright{} 1988, 1989, 1990, 1991, 1992, 1993, 1995, 1998,
-1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
@@ -3186,17 +3186,23 @@ Actually, actions are not the best place to compute locations.  Since
 locations are much more general than semantic values, there is room in
 the output parser to redefine the default action to take for each
 rule.  The @code{YYLLOC_DEFAULT} macro is invoked each time a rule is
-matched, before the associated action is run.
+matched, before the associated action is run.  It is also invoked
+while processing a syntax error, to compute the error's location.
 
 Most of the time, this macro is general enough to suppress location
 dedicated code from semantic actions.
 
 The @code{YYLLOC_DEFAULT} macro takes three parameters.  The first one is
-the location of the grouping (the result of the computation).  The second one
-is an array holding locations of all right hand side elements of the rule
-being matched.  The last one is the size of the right hand side rule.
+the location of the grouping (the result of the computation).  When a
+rule is matched, the second parameter is an array holding locations of
+all right hand side elements of the rule being matched, and the third
+parameter is the size of the rule's right hand side.  When processing
+a syntax error, the second parameter is an array holding locations of
+the symbols that were discarded during error processing, and the third
+parameter is the number of discarded symbols.
 
-By default, it is defined this way for simple @acronym{LALR}(1) parsers:
+By default, @code{YYLLOC_DEFAULT} is defined this way for simple
+@acronym{LALR}(1) parsers:
 
 @example
 @group
@@ -3491,7 +3497,7 @@ should use @code{$$} to designate the semantic value associated to the
 (@pxref{Parser Function, , The Parser Function @code{yyparse}}).
 
 @strong{Warning:} as of Bison 1.875, this feature is still considered as
-experimental, as there was not enough users feedback.  In particular,
+experimental, as there was not enough user feedback.  In particular,
 the syntax might still change.
 @end deffn
 
@@ -3552,7 +3558,7 @@ The declaration looks like this:
 
 Here @var{n} is a decimal integer.  The declaration says there should be
 no warning if there are @var{n} shift/reduce conflicts and no
-reduce/reduce conflicts.  An error, instead of the usual warning, is
+reduce/reduce conflicts.  The usual warning is
 given if there are either more or fewer conflicts, or if there are any
 reduce/reduce conflicts.
 
@@ -3574,9 +3580,9 @@ Add an @code{%expect} declaration, copying the number @var{n} from the
 number which Bison printed.
 @end itemize
 
-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.
+Now Bison will stop annoying you if you do not change the number of
+conflicts, but it will warn you again if changes in the grammar result
+in more or fewer conflicts.
 
 @node Start Decl
 @subsection The Start-Symbol
@@ -5176,6 +5182,13 @@ structure should generally be adequate.  On @acronym{LALR}(1) portions of a
 grammar, in particular, it is only slightly slower than with the default
 Bison parser.
 
+For a more detailed exposition of GLR parsers, please see: Elizabeth
+Scott, Adrian Johnstone and Shamsa Sadaf Hussain, Tomita-Style
+Generalised @acronym{LR} Parsers, Royal Holloway, University of
+London, Department of Computer Science, TR-00-12,
+@uref{http://www.cs.rhul.ac.uk/research/languages/publications/tomita_style_1.ps},
+(2000-12-24).
+
 @node Stack Overflow
 @section Stack Overflow, and How to Avoid It
 @cindex stack overflow
@@ -5603,8 +5616,8 @@ useless: STR;
 @example
 calc.y: warning: 1 useless nonterminal and 1 useless rule
 calc.y:11.1-7: warning: useless nonterminal: useless
-calc.y:11.8-12: warning: useless rule: useless: STR
-calc.y contains 7 shift/reduce conflicts.
+calc.y:11.10-12: warning: useless rule: useless: STR
+calc.y: conflicts: 7 shift/reduce
 @end example
 
 When given @option{--report=state}, in addition to @file{calc.tab.c}, it
@@ -5626,10 +5639,10 @@ Conflict in state 8 between rule 2 and token '*' resolved as shift.
 The next section lists states that still have conflicts.
 
 @example
-State 8 contains 1 shift/reduce conflict.
-State 9 contains 1 shift/reduce conflict.
-State 10 contains 1 shift/reduce conflict.
-State 11 contains 4 shift/reduce conflicts.
+State 8 conflicts: 1 shift/reduce
+State 9 conflicts: 1 shift/reduce
+State 10 conflicts: 1 shift/reduce
+State 11 conflicts: 4 shift/reduce
 @end example
 
 @noindent
@@ -5841,8 +5854,8 @@ state 7
     exp         go to state 11
 @end example
 
-As was announced in beginning of the report, @samp{State 8 contains 1
-shift/reduce conflict}:
+As was announced in beginning of the report, @samp{State 8 conflicts:
+1 shift/reduce}:
 
 @example
 state 8