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.
This commit is contained in:
Akim Demaille
2010-05-10 10:27:23 +02:00
parent 12ff095cad
commit 0100cd629d
3 changed files with 25 additions and 7 deletions
+9
View File
@@ -1,3 +1,12 @@
2010-05-10 Akim Demaille <[email protected]>
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-07 Akim Demaille <[email protected]> 2010-05-07 Akim Demaille <[email protected]>
doc: fix typo. doc: fix typo.
+1
View File
@@ -44,6 +44,7 @@ Guido Trentalancia [email protected]
H. Merijn Brand [email protected] H. Merijn Brand [email protected]
Hans Aberg [email protected] Hans Aberg [email protected]
Jan Nieuwenhuizen [email protected] Jan Nieuwenhuizen [email protected]
Jerry Quinn [email protected]
Jesse Thilo [email protected] Jesse Thilo [email protected]
Jim Kent [email protected] Jim Kent [email protected]
Jim Meyering [email protected] Jim Meyering [email protected]
+13 -5
View File
@@ -8013,8 +8013,8 @@ int yyparse (void);
@c - initial action @c - initial action
The C++ @acronym{LALR}(1) parser is selected using the skeleton directive, The C++ @acronym{LALR}(1) parser is selected using the skeleton directive,
@samp{%skeleton "lalr1.c"}, or the synonymous command-line option @samp{%skeleton "lalr1.cc"}, or the synonymous command-line option
@option{--skeleton=lalr1.c}. @option{--skeleton=lalr1.cc}.
@xref{Decl Summary}. @xref{Decl Summary}.
When run, @command{bison} will create several entities in the @samp{yy} When run, @command{bison} will create several entities in the @samp{yy}
@@ -8163,11 +8163,19 @@ this class is detailed below. It can be extended using the
it describes an additional member of the parser class, and an it describes an additional member of the parser class, and an
additional argument for its constructor. additional argument for its constructor.
@defcv {Type} {parser} {semantic_value_type} @defcv {Type} {parser} {semantic_type}
@defcvx {Type} {parser} {location_value_type} @defcvx {Type} {parser} {location_type}
The types for semantics value and locations. The types for semantics value and locations.
@end defcv @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
@deftypemethod {parser} {} parser (@var{type1} @var{arg1}, ...) @deftypemethod {parser} {} parser (@var{type1} @var{arg1}, ...)
Build a new parser object. There are no arguments by default, unless Build a new parser object. There are no arguments by default, unless
@samp{%parse-param @{@var{type1} @var{arg1}@}} was used. @samp{%parse-param @{@var{type1} @var{arg1}@}} was used.
@@ -8206,7 +8214,7 @@ The parser invokes the scanner by calling @code{yylex}. Contrary to C
parsers, C++ parsers are always pure: there is no point in using the parsers, C++ parsers are always pure: there is no point in using the
@code{%define api.pure} directive. Therefore the interface is as follows. @code{%define api.pure} directive. Therefore the interface is as follows.
@deftypemethod {parser} {int} yylex (semantic_value_type& @var{yylval}, location_type& @var{yylloc}, @var{type1} @var{arg1}, ...) @deftypemethod {parser} {int} yylex (semantic_type* @var{yylval}, location_type* @var{yylloc}, @var{type1} @var{arg1}, ...)
Return the next token. Its type is the return value, its semantic Return the next token. Its type is the return value, its semantic
value and location being @var{yylval} and @var{yylloc}. Invocations of value and location being @var{yylval} and @var{yylloc}. Invocations of
@samp{%lex-param @{@var{type1} @var{arg1}@}} yield additional arguments. @samp{%lex-param @{@var{type1} @var{arg1}@}} yield additional arguments.