/[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.92 by eggert, Sun Dec 15 09:39:12 2002 UTC revision 1.93 by eggert, Wed Dec 18 00:09:33 2002 UTC
# Line 3879  Return immediately with value 0 (to repo Line 3879  Return immediately with value 0 (to repo
3879  Return immediately with value 1 (to report failure).  Return immediately with value 1 (to report failure).
3880  @end defmac  @end defmac
3881    
3882    @c For now, do not document %lex-param and %parse-param, since it's
3883    @c not clear that the current behavior is stable enough.  For example,
3884    @c we may need to add %error-param.
3885    @clear documentparam
3886    
3887    @ifset documentparam
3888  If you use a reentrant parser, you can optionally pass additional  If you use a reentrant parser, you can optionally pass additional
3889  parameter information to it in a reentrant way.  To do so, use the  parameter information to it in a reentrant way.  To do so, use the
3890  declaration @code{%parse-param}:  declaration @code{%parse-param}:
# Line 3886  declaration @code{%parse-param}: Line 3892  declaration @code{%parse-param}:
3892  @deffn {Directive} %parse-param @{@var{argument-declaration}@}  @deffn {Directive} %parse-param @{@var{argument-declaration}@}
3893  @findex %parse-param  @findex %parse-param
3894  Declare that an argument declared by @code{argument-declaration} is an  Declare that an argument declared by @code{argument-declaration} is an
3895  additional @code{yyparse} argument.  This argument is also passed to  additional @code{yyparse} argument.
3896  @code{yyerror}.  The @var{argument-declaration} is used when declaring  The @var{argument-declaration} is used when declaring
3897  functions or prototypes.  The last identifier in  functions or prototypes.  The last identifier in
3898  @var{argument-declaration} must be the argument name.  @var{argument-declaration} must be the argument name.
3899  @end deffn  @end deffn
# Line 3917  In the grammar actions, use expressions Line 3923  In the grammar actions, use expressions
3923  @example  @example
3924  exp: @dots{}    @{ @dots{}; *randomness += 1; @dots{} @}  exp: @dots{}    @{ @dots{}; *randomness += 1; @dots{} @}
3925  @end example  @end example
3926    @end ifset
3927    
3928    
3929  @node Lexical  @node Lexical
# Line 4123  this case, omit the second argument; @co Line 4130  this case, omit the second argument; @co
4130  only one argument.  only one argument.
4131    
4132    
4133    @ifset documentparam
4134  If you wish to pass the additional parameter data to @code{yylex}, use  If you wish to pass the additional parameter data to @code{yylex}, use
4135  @code{%lex-param} just like @code{%parse-param} (@pxref{Parser  @code{%lex-param} just like @code{%parse-param} (@pxref{Parser
4136  Function}).  Function}).
# Line 4163  and finally, if both @code{%pure-parser} Line 4171  and finally, if both @code{%pure-parser}
4171  int yylex   (YYSTYPE *lvalp, YYLTYPE *llocp, int *nastiness);  int yylex   (YYSTYPE *lvalp, YYLTYPE *llocp, int *nastiness);
4172  int yyparse (int *nastiness, int *randomness);  int yyparse (int *nastiness, int *randomness);
4173  @end example  @end example
4174    @end ifset
4175    
4176  @node Error Reporting  @node Error Reporting
4177  @section The Error Reporting Function @code{yyerror}  @section The Error Reporting Function @code{yyerror}
# Line 4227  void yyerror (char const *msg); Line 4236  void yyerror (char const *msg);
4236  void yyerror (YYLTYPE *locp, char const *msg);  /* GLR parsers.   */  void yyerror (YYLTYPE *locp, char const *msg);  /* GLR parsers.   */
4237  @end example  @end example
4238    
4239    @ifset documentparam
4240  If @samp{%parse-param @{int *nastiness@}} is used, then:  If @samp{%parse-param @{int *nastiness@}} is used, then:
4241    
4242  @example  @example
# Line 4260  void yyerror (YYLTYPE *locp, Line 4270  void yyerror (YYLTYPE *locp,
4270                int *nastiness, int *randomness,                int *nastiness, int *randomness,
4271                char const *msg);                char const *msg);
4272  @end example  @end example
4273    @end ifset
4274    
4275  @noindent  @noindent
4276  The prototypes are only indications of how the code produced by Bison  The prototypes are only indications of how the code produced by Bison
# Line 6580  Bison declaration to assign left associa Line 6591  Bison declaration to assign left associa
6591  @xref{Precedence Decl, ,Operator Precedence}.  @xref{Precedence Decl, ,Operator Precedence}.
6592  @end deffn  @end deffn
6593    
6594    @ifset documentparam
6595  @deffn {Directive} %lex-param @{@var{argument-declaration}@}  @deffn {Directive} %lex-param @{@var{argument-declaration}@}
6596  Bison declaration to specifying an additional parameter that  Bison declaration to specifying an additional parameter that
6597  @code{yylex} should accept.  @xref{Pure Calling,, Calling Conventions  @code{yylex} should accept.  @xref{Pure Calling,, Calling Conventions
6598  for Pure Parsers}.  for Pure Parsers}.
6599  @end deffn  @end deffn
6600    @end ifset
6601    
6602  @deffn {Directive} %merge  @deffn {Directive} %merge
6603  Bison declaration to assign a merging function to a rule.  If there is a  Bison declaration to assign a merging function to a rule.  If there is a
# Line 6612  Bison declaration to set the name of the Line 6625  Bison declaration to set the name of the
6625  Summary}.  Summary}.
6626  @end deffn  @end deffn
6627    
6628    @ifset documentparam
6629  @deffn {Directive} %parse-param @{@var{argument-declaration}@}  @deffn {Directive} %parse-param @{@var{argument-declaration}@}
6630  Bison declaration to specifying an additional parameter that  Bison declaration to specifying an additional parameter that
6631  @code{yyparse} should accept.  @xref{Parser Function,, The Parser  @code{yyparse} should accept.  @xref{Parser Function,, The Parser
6632  Function @code{yyparse}}.  Function @code{yyparse}}.
6633  @end deffn  @end deffn
6634    @end ifset
6635    
6636  @deffn {Directive} %prec  @deffn {Directive} %prec
6637  Bison declaration to assign a precedence to a specific rule.  Bison declaration to assign a precedence to a specific rule.

Legend:
Removed from v.1.92  
changed lines
  Added in v.1.93

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