%code requires @{ #include "type1.h" @}
%union @{ type1 field1; @}
%destructor @{ type1_free ($$); @} <field1>
-%printer @{ type1_print ($$); @} <field1>
+%printer @{ type1_print (yyoutput, $$); @} <field1>
@end group
@group
%code requires @{ #include "type2.h" @}
%union @{ type2 field2; @}
%destructor @{ type2_free ($$); @} <field2>
-%printer @{ type2_print ($$); @} <field2>
+%printer @{ type2_print (yyoutput, $$); @} <field2>
@end group
@end example
@end example
@noindent
-results in the following signature:
+results in the following signatures:
@example
int yylex (int *nastiness);
Because Bison parsers have growing stacks, hitting the upper limit
usually results from using a right recursion instead of a left
-recursion, @xref{Recursion, ,Recursive Rules}.
+recursion, see @ref{Recursion, ,Recursive Rules}.
@vindex YYMAXDEPTH
By defining the macro @code{YYMAXDEPTH}, you can control how deep the
representation of it, either textually or graphically (as a DOT file).
The textual file is generated when the options @option{--report} or
-@option{--verbose} are specified, see @xref{Invocation, , Invoking
+@option{--verbose} are specified, see @ref{Invocation, , Invoking
Bison}. Its name is made by removing @samp{.tab.c} or @samp{.c} from
the parser implementation file name, and adding @samp{.output}
instead. Therefore, if the grammar file is @file{foo.y}, then the
@c FIXME: Document %printer, and mention that it takes a braced-code operand.
@comment file: calc++-parser.yy
@example
-%printer @{ debug_stream () << *$$; @} "identifier"
+%printer @{ yyoutput << *$$; @} "identifier"
%destructor @{ delete $$; @} "identifier"
-%printer @{ debug_stream () << $$; @} <ival>
+%printer @{ yyoutput << $$; @} <ival>
@end example
@noindent
appear in an action. The actual definition of these symbols is
opaque to the Bison grammar, and it might change in the future. The
only meaningful operation that you can do, is to return them.
-See @pxref{Java Action Features}.
+@xref{Java Action Features}.
Note that of these three symbols, only @code{YYACCEPT} and
@code{YYABORT} will cause a return from the @code{yyparse}
an union. The type of @code{$$}, even with angle brackets, is the base
type since Java casts are not allow on the left-hand side of assignments.
Also, @code{$@var{n}} and @code{@@@var{n}} are not allowed on the
-left-hand side of assignments. See @pxref{Java Semantic Values} and
-@pxref{Java Action Features}.
+left-hand side of assignments. @xref{Java Semantic Values}, and
+@ref{Java Action Features}.
@item
The prologue declarations have a different meaning than in C/C++ code.
@item @code{%code lexer}
blocks, if specified, should include the implementation of the
scanner. If there is no such block, the scanner can be any class
-that implements the appropriate interface (see @pxref{Java Scanner
+that implements the appropriate interface (@pxref{Java Scanner
Interface}).
@end table
message. What can I do?
@end quotation
-This question is already addressed elsewhere, @xref{Recursion,
-,Recursive Rules}.
+This question is already addressed elsewhere, see @ref{Recursion, ,Recursive
+Rules}.
@node How Can I Reset the Parser
@section How Can I Reset the Parser