+2010-05-10 Akim Demaille <demaille@gostai.com>
+
+ doc: fix lalr1.cc documentation.
+ * doc/bison.texinfo (C++ Scanner Interface): Fix yylex signature.
+ (C++ Bison Interface): Fix lalr1.cc skeleton name.
+ (C++ Parser Interface): Fix semantic_type and location_type names.
+ Document yy::parser::token.
+ Reported by Jerry Quinn.
+
2010-05-10 Akim Demaille <demaille@gostai.com>
c++: use YYRHSLOC.
H. Merijn Brand h.m.brand@hccnet.nl
Hans Aberg haberg@matematik.su.se
Jan Nieuwenhuizen janneke@gnu.org
+Jerry Quinn jlquinn@optonline.net
Jesse Thilo jthilo@gnu.org
Jim Kent jkent@arch.sel.sony.com
Jim Meyering jim@meyering.net
@c - initial action
The C++ deterministic parser is selected using the skeleton directive,
-@samp{%skeleton "lalr1.c"}, or the synonymous command-line option
-@option{--skeleton=lalr1.c}.
+@samp{%skeleton "lalr1.cc"}, or the synonymous command-line option
+@option{--skeleton=lalr1.cc}.
@xref{Decl Summary}.
When run, @command{bison} will create several entities in the @samp{yy}
The types for semantic values and locations (if enabled).
@end defcv
+@defcv {Type} {parser} {token}
+A structure that contains (only) the definition of the tokens as the
+@code{yytokentype} enumeration. To refer to the token @code{FOO}, the
+scanner should use @code{yy::parser::token::FOO}. The scanner can use
+@samp{typedef yy::parser::token token;} to ``import'' the token enumeration
+(@pxref{Calc++ Scanner}).
+@end defcv
+
@defcv {Type} {parser} {syntax_error}
This class derives from @code{std::runtime_error}. Throw instances of it
from user actions to raise parse errors. This is equivalent with first
Therefore the interface is as follows.
-@deftypemethod {parser} {int} yylex (semantic_type& @var{yylval}, location_type& @var{yylloc}, @var{type1} @var{arg1}, ...)
-@deftypemethodx {parser} {int} yylex (semantic_type& @var{yylval}, @var{type1} @var{arg1}, ...)
+@deftypemethod {parser} {int} yylex (semantic_type* @var{yylval}, location_type* @var{yylloc}, @var{type1} @var{arg1}, ...)
+@deftypemethodx {parser} {int} yylex (semantic_type* @var{yylval}, @var{type1} @var{arg1}, ...)
Return the next token. Its type is the return value, its semantic value and
location (if enabled) being @var{yylval} and @var{yylloc}. Invocations of
@samp{%lex-param @{@var{type1} @var{arg1}@}} yield additional arguments.