mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 01:03:04 +00:00
(Parser Function, Purel Calling, Error
Reporting, Table of Symbols): Omit mentions of %lex-param and %parse-param from the documentation for now.
This commit is contained in:
@@ -3879,6 +3879,12 @@ Return immediately with value 0 (to report success).
|
|||||||
Return immediately with value 1 (to report failure).
|
Return immediately with value 1 (to report failure).
|
||||||
@end defmac
|
@end defmac
|
||||||
|
|
||||||
|
@c For now, do not document %lex-param and %parse-param, since it's
|
||||||
|
@c not clear that the current behavior is stable enough. For example,
|
||||||
|
@c we may need to add %error-param.
|
||||||
|
@clear documentparam
|
||||||
|
|
||||||
|
@ifset documentparam
|
||||||
If you use a reentrant parser, you can optionally pass additional
|
If you use a reentrant parser, you can optionally pass additional
|
||||||
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
|
||||||
declaration @code{%parse-param}:
|
declaration @code{%parse-param}:
|
||||||
@@ -3886,8 +3892,8 @@ declaration @code{%parse-param}:
|
|||||||
@deffn {Directive} %parse-param @{@var{argument-declaration}@}
|
@deffn {Directive} %parse-param @{@var{argument-declaration}@}
|
||||||
@findex %parse-param
|
@findex %parse-param
|
||||||
Declare that an argument declared by @code{argument-declaration} is an
|
Declare that an argument declared by @code{argument-declaration} is an
|
||||||
additional @code{yyparse} argument. This argument is also passed to
|
additional @code{yyparse} argument.
|
||||||
@code{yyerror}. The @var{argument-declaration} is used when declaring
|
The @var{argument-declaration} is used when declaring
|
||||||
functions or prototypes. The last identifier in
|
functions or prototypes. The last identifier in
|
||||||
@var{argument-declaration} must be the argument name.
|
@var{argument-declaration} must be the argument name.
|
||||||
@end deffn
|
@end deffn
|
||||||
@@ -3917,6 +3923,7 @@ In the grammar actions, use expressions like this to refer to the data:
|
|||||||
@example
|
@example
|
||||||
exp: @dots{} @{ @dots{}; *randomness += 1; @dots{} @}
|
exp: @dots{} @{ @dots{}; *randomness += 1; @dots{} @}
|
||||||
@end example
|
@end example
|
||||||
|
@end ifset
|
||||||
|
|
||||||
|
|
||||||
@node Lexical
|
@node Lexical
|
||||||
@@ -4123,6 +4130,7 @@ this case, omit the second argument; @code{yylex} will be called with
|
|||||||
only one argument.
|
only one argument.
|
||||||
|
|
||||||
|
|
||||||
|
@ifset documentparam
|
||||||
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
|
||||||
@code{%lex-param} just like @code{%parse-param} (@pxref{Parser
|
@code{%lex-param} just like @code{%parse-param} (@pxref{Parser
|
||||||
Function}).
|
Function}).
|
||||||
@@ -4163,6 +4171,7 @@ and finally, if both @code{%pure-parser} and @code{%locations} are used:
|
|||||||
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp, int *nastiness);
|
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp, int *nastiness);
|
||||||
int yyparse (int *nastiness, int *randomness);
|
int yyparse (int *nastiness, int *randomness);
|
||||||
@end example
|
@end example
|
||||||
|
@end ifset
|
||||||
|
|
||||||
@node Error Reporting
|
@node Error Reporting
|
||||||
@section The Error Reporting Function @code{yyerror}
|
@section The Error Reporting Function @code{yyerror}
|
||||||
@@ -4227,6 +4236,7 @@ void yyerror (char const *msg); /* Yacc parsers. */
|
|||||||
void yyerror (YYLTYPE *locp, char const *msg); /* GLR parsers. */
|
void yyerror (YYLTYPE *locp, char const *msg); /* GLR parsers. */
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
|
@ifset documentparam
|
||||||
If @samp{%parse-param @{int *nastiness@}} is used, then:
|
If @samp{%parse-param @{int *nastiness@}} is used, then:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
@@ -4260,6 +4270,7 @@ void yyerror (YYLTYPE *locp,
|
|||||||
int *nastiness, int *randomness,
|
int *nastiness, int *randomness,
|
||||||
char const *msg);
|
char const *msg);
|
||||||
@end example
|
@end example
|
||||||
|
@end ifset
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
The prototypes are only indications of how the code produced by Bison
|
The prototypes are only indications of how the code produced by Bison
|
||||||
@@ -6580,11 +6591,13 @@ Bison declaration to assign left associativity to token(s).
|
|||||||
@xref{Precedence Decl, ,Operator Precedence}.
|
@xref{Precedence Decl, ,Operator Precedence}.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
|
@ifset documentparam
|
||||||
@deffn {Directive} %lex-param @{@var{argument-declaration}@}
|
@deffn {Directive} %lex-param @{@var{argument-declaration}@}
|
||||||
Bison declaration to specifying an additional parameter that
|
Bison declaration to specifying an additional parameter that
|
||||||
@code{yylex} should accept. @xref{Pure Calling,, Calling Conventions
|
@code{yylex} should accept. @xref{Pure Calling,, Calling Conventions
|
||||||
for Pure Parsers}.
|
for Pure Parsers}.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
@end ifset
|
||||||
|
|
||||||
@deffn {Directive} %merge
|
@deffn {Directive} %merge
|
||||||
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
|
||||||
@@ -6612,11 +6625,13 @@ Bison declaration to set the name of the parser file. @xref{Decl
|
|||||||
Summary}.
|
Summary}.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
|
@ifset documentparam
|
||||||
@deffn {Directive} %parse-param @{@var{argument-declaration}@}
|
@deffn {Directive} %parse-param @{@var{argument-declaration}@}
|
||||||
Bison declaration to specifying an additional parameter that
|
Bison declaration to specifying an additional parameter that
|
||||||
@code{yyparse} should accept. @xref{Parser Function,, The Parser
|
@code{yyparse} should accept. @xref{Parser Function,, The Parser
|
||||||
Function @code{yyparse}}.
|
Function @code{yyparse}}.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
@end ifset
|
||||||
|
|
||||||
@deffn {Directive} %prec
|
@deffn {Directive} %prec
|
||||||
Bison declaration to assign a precedence to a specific rule.
|
Bison declaration to assign a precedence to a specific rule.
|
||||||
|
|||||||
Reference in New Issue
Block a user