From: Akim Demaille Date: Mon, 10 May 2010 08:41:21 +0000 (+0200) Subject: doc: fix lalr1.cc documentation. X-Git-Tag: v2.7.90~679 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/86e5b4402f4e8ede509a4043420aa6e3d3c6cae2 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. (cherry picked from commit 0100cd629d91e3e799b9feb7182965ff348ba61c) Conflicts: ChangeLog doc/bison.texinfo --- diff --git a/ChangeLog b/ChangeLog index cea5f026..fe9a735f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-05-10 Akim Demaille + + 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 c++: use YYRHSLOC. diff --git a/THANKS b/THANKS index 75a09bce..2fa3b286 100644 --- a/THANKS +++ b/THANKS @@ -44,6 +44,7 @@ Guido Trentalancia trentalg@aston.ac.uk 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 diff --git a/doc/bison.texinfo b/doc/bison.texinfo index bac6ac54..8792db80 100644 --- a/doc/bison.texinfo +++ b/doc/bison.texinfo @@ -8569,8 +8569,8 @@ int yyparse (void); @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} @@ -8828,6 +8828,14 @@ additional argument for its constructor. 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 @@ -8894,8 +8902,8 @@ depends whether you use unions, or variants. 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.