@}
%@{
-static void yyprint(FILE *, int, YYSTYPE);
-#define YYPRINT(F, N, L) yyprint(F, N, L)
+static void print_token_value (FILE *, int, YYSTYPE);
+#define YYPRINT(F, N, L) print_token_value (F, N, L)
%@}
@dots{}
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
calculator (@pxref{Mfcalc Decl, ,Declarations for @code{mfcalc}}):
@smallexample
-#define YYPRINT(file, type, value) yyprint (file, type, value)
+#define YYPRINT(file, type, value) print_token_value (file, type, value)
static void
-yyprint (FILE *file, int type, YYSTYPE value)
+print_token_value (FILE *file, int type, YYSTYPE value)
@{
if (type == VAR)
fprintf (file, "%s", value.tptr->name);
@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}}.