/[bison]/bison/doc/bison.texinfo
ViewVC logotype

Diff of /bison/doc/bison.texinfo

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.112 by eggert, Tue Sep 30 20:11:29 2003 UTC revision 1.113 by eggert, Wed Oct 1 21:33:23 2003 UTC
# Line 3684  Using it in a way that would be associat Line 3684  Using it in a way that would be associat
3684  @end deffn  @end deffn
3685    
3686  @deffn {Directive} %default-prec  @deffn {Directive} %default-prec
3687  Specify whether to assign a precedence to rules lacking an  Assign a precedence to rules lacking an explicit @code{%prec} modifier
 explicit @code{%prec} modifier  
3688  (@pxref{Contextual Precedence, ,Context-Dependent Precedence}).  (@pxref{Contextual Precedence, ,Context-Dependent Precedence}).
3689  @end deffn  @end deffn
3690    
# Line 3759  and so on.  @xref{Multiple Parsers, ,Mul Line 3758  and so on.  @xref{Multiple Parsers, ,Mul
3758  Program}.  Program}.
3759  @end deffn  @end deffn
3760    
3761    @deffn {Directive} %no-default-prec
3762    Do not assign a precedence to rules lacking an explicit @code{%prec}
3763    modifier (@pxref{Contextual Precedence, ,Context-Dependent
3764    Precedence}).
3765    @end deffn
3766    
3767  @deffn {Directive} %no-parser  @deffn {Directive} %no-parser
3768  Do not include any C code in the parser file; generate tables only.  The  Do not include any C code in the parser file; generate tables only.  The
3769  parser file contains just @code{#define} directives and static variable  parser file contains just @code{#define} directives and static variable
# Line 4862  minus, Bison silently assumes that minus Line 4867  minus, Bison silently assumes that minus
4867  This kind of problem can be tricky to debug, since one typically  This kind of problem can be tricky to debug, since one typically
4868  discovers the mistake only by testing the code.  discovers the mistake only by testing the code.
4869    
4870  The @code{%default-prec 0;} declaration makes it easier to discover  The @code{%no-default-prec;} declaration makes it easier to discover
4871  this kind of problem systematically.  It causes rules that lack a  this kind of problem systematically.  It causes rules that lack a
4872  @code{%prec} modifier to have no precedence, even if the last terminal  @code{%prec} modifier to have no precedence, even if the last terminal
4873  symbol mentioned in their components has a declared precedence.  symbol mentioned in their components has a declared precedence.
4874    
4875  If @code{%default-prec 0;} is in effect, you must specify @code{%prec}  If @code{%no-default-prec;} is in effect, you must specify @code{%prec}
4876  for all rules that participate in precedence conflict resolution.  for all rules that participate in precedence conflict resolution.
4877  Then you will see any shift/reduce conflict until you tell Bison how  Then you will see any shift/reduce conflict until you tell Bison how
4878  to resolve it, either by changing your grammar or by adding an  to resolve it, either by changing your grammar or by adding an
4879  explicit precedence.  This will probably add declarations to the  explicit precedence.  This will probably add declarations to the
4880  grammar, but it helps to protect against incorrect rule precedences.  grammar, but it helps to protect against incorrect rule precedences.
4881    
4882  The effect of @code{%default-prec 0;} can be reversed by giving  The effect of @code{%no-default-prec;} can be reversed by giving
4883  @code{%default-prec 1;}, which is the default.  @code{%default-prec;}, which is the default.
4884    
4885  @node Parser States  @node Parser States
4886  @section Parser States  @section Parser States
# Line 6808  parsing.  @xref{Parser Function, ,The Pa Line 6813  parsing.  @xref{Parser Function, ,The Pa
6813  Equip the parser for debugging.  @xref{Decl Summary}.  Equip the parser for debugging.  @xref{Decl Summary}.
6814  @end deffn  @end deffn
6815    
6816  @deffn {Directive} %default-prec @var{state};  @deffn {Directive} %default-prec
6817  Bison declaration to specify whether to assign a precedence to rules  Assign a precedence to rules that lack an explicit @samp{%prec}
6818  that lack an explicit @samp{%prec} modifier.  @xref{Contextual  modifier.  @xref{Contextual Precedence, ,Context-Dependent
6819  Precedence, ,Context-Dependent Precedence}.  Precedence}.
6820  @end deffn  @end deffn
6821    
6822  @deffn {Directive} %defines  @deffn {Directive} %defines
# Line 6867  function is applied to the two semantic Line 6872  function is applied to the two semantic
6872  Bison declaration to rename the external symbols.  @xref{Decl Summary}.  Bison declaration to rename the external symbols.  @xref{Decl Summary}.
6873  @end deffn  @end deffn
6874    
6875    @deffn {Directive} %no-default-prec
6876    Do not assign a precedence to rules that lack an explicit @samp{%prec}
6877    modifier.  @xref{Contextual Precedence, ,Context-Dependent
6878    Precedence}.
6879    @end deffn
6880    
6881  @deffn {Directive} %no-lines  @deffn {Directive} %no-lines
6882  Bison declaration to avoid generating @code{#line} directives in the  Bison declaration to avoid generating @code{#line} directives in the
6883  parser file.  @xref{Decl Summary}.  parser file.  @xref{Decl Summary}.

Legend:
Removed from v.1.112  
changed lines
  Added in v.1.113

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26