parameter information to it in a reentrant way. To do so, use the
declaration @code{%parse-param}:
-@deffn {Directive} %parse-param @{@var{argument-declaration}@}, @{@var{argument-name}@}
+@deffn {Directive} %parse-param @{@var{argument-declaration}@}
@findex %parse-param
-Declare that @code{argument-name} is an additional @code{yyparse}
-argument. This argument is also passed to @code{yyerror}. The
-@var{argument-declaration} is used when declaring functions or
-prototypes.
+Declare that an argument declared by @code{argument-declaration} is an
+additional @code{yyparse} argument. This argument is also passed to
+@code{yyerror}. The @var{argument-declaration} is used when declaring
+functions or prototypes. The last identifier in
+@var{argument-declaration} must be the argument name.
@end deffn
Here's an example. Write this in the parser:
@example
-%parse-param @{int *nastiness@}, @{nastiness@}
-%parse-param @{int *randomness@}, @{randomness@}
+%parse-param @{int *nastiness@}
+%parse-param @{int *randomness@}
@end example
@noindent
@code{%lex-param} just like @code{%parse-param} (@pxref{Parser
Function}).
-@deffn {Directive} lex-param @{@var{argument-declaration}@}, @{@var{argument-name}@}
+@deffn {Directive} lex-param @{@var{argument-declaration}@}
@findex %lex-param
-Declare that @code{argument-name} is an additional @code{yylex}
-argument.
+Declare that @code{argument-declaration} is an additional @code{yylex}
+argument declaration.
@end deffn
For instance:
@example
-%parse-param @{int *nastiness@}, @{nastiness@}
-%lex-param @{int *nastiness@}, @{nastiness@}
-%parse-param @{int *randomness@}, @{randomness@}
+%parse-param @{int *nastiness@}
+%lex-param @{int *nastiness@}
+%parse-param @{int *randomness@}
@end example
@noindent
void yyerror (YYLTYPE *locp, const char *msg); /* GLR parsers. */
@end example
-If @samp{%parse-param @{int *nastiness@}, @{nastiness@}} is used, then:
+If @samp{%parse-param @{int *nastiness@}} is used, then:
@example
void yyerror (int *randomness, const char *msg); /* Yacc parsers. */
%locations
/* Pure yylex. */
%pure-parser
-%lex-param @{int *nastiness@}, @{nastiness@}
+%lex-param @{int *nastiness@}
/* Pure yyparse. */
-%parse-param @{int *nastiness@}, @{nastiness@}
-%parse-param @{int *randomness@}, @{randomness@}
+%parse-param @{int *nastiness@}
+%parse-param @{int *randomness@}
@end example
@noindent
@xref{Precedence Decl, ,Operator Precedence}.
@end deffn
-@deffn {Directive} %lex-param @{@var{argument-declaration}@}. @{@var{argument-name}"@}
+@deffn {Directive} %lex-param @{@var{argument-declaration}@}
Bison declaration to specifying an additional parameter that
@code{yylex} should accept. @xref{Pure Calling,, Calling Conventions
for Pure Parsers}.
Summary}.
@end deffn
-@deffn {Directive} %parse-param @{@var{argument-declaration}@}, @{@var{argument-name}@}
+@deffn {Directive} %parse-param @{@var{argument-declaration}@}
Bison declaration to specifying an additional parameter that
@code{yyparse} should accept. @xref{Parser Function,, The Parser
Function @code{yyparse}}.