[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: It seems yy::parser::token::INTEGER should be instead of yy::parser:
From: |
Akim Demaille |
Subject: |
Re: It seems yy::parser::token::INTEGER should be instead of yy::parser::INTEGER in the manual |
Date: |
Tue, 3 Mar 2015 16:13:31 +0100 |
Hi Asfar,
> Le 24 févr. 2015 à 19:35, Askar Safin <address@hidden> a écrit :
>
> Hi. "10.1.5.1 Split Symbols" of Bison 3.0.4 manual gives the following
> example:
> return yy::parser::INTEGER;
> But when I generate C++ parser it seems for me that
> yy::parser::token::INTEGER is default name here (at least for variant
> semantic type). So, it seems there is documentation bug.
Thanks for the report, you are right! I will install the following
patch, once I processed all your reports :)
commit 429fd11857f4b5a9c75db935c55212886b74e726
Author: Akim Demaille <address@hidden>
Date: Tue Mar 3 16:10:30 2015 +0100
doc: fixes in the C++ part
Reported by Askar Safin.
http://lists.gnu.org/archive/html/bug-bison/2015-02/msg00018.html
* doc/bison.texi (Split Symbols): Fix access to token types.
diff --git a/THANKS b/THANKS
index 32fc67f..12086a9 100644
--- a/THANKS
+++ b/THANKS
@@ -15,6 +15,7 @@ Anthony Heading address@hidden
Antonio Silva Correia address@hidden
Arnold Robbins address@hidden
Art Haas address@hidden
+Askar Safin address@hidden
Baron Schwartz address@hidden
Ben Pfaff address@hidden
Benoit Perrot address@hidden
diff --git a/doc/bison.texi b/doc/bison.texi
index 26c17d6..e787411 100644
--- a/doc/bison.texi
+++ b/doc/bison.texi
@@ -10902,11 +10902,11 @@ Regular union-based code in Lex scanner typically
look like:
@example
[0-9]+ @{
yylval.ival = text_to_int (yytext);
- return yy::parser::INTEGER;
+ return yy::parser::token::INTEGER;
@}
[a-z]+ @{
yylval.sval = new std::string (yytext);
- return yy::parser::IDENTIFIER;
+ return yy::parser::token::IDENTIFIER;
@}
@end example
@@ -10916,11 +10916,11 @@ initialized. So the code would look like:
@example
[0-9]+ @{
yylval.build<int>() = text_to_int (yytext);
- return yy::parser::INTEGER;
+ return yy::parser::token::INTEGER;
@}
[a-z]+ @{
yylval.build<std::string> = yytext;
- return yy::parser::IDENTIFIER;
+ return yy::parser::token::IDENTIFIER;
@}
@end example
@@ -10930,11 +10930,11 @@ or
@example
[0-9]+ @{
yylval.build(text_to_int (yytext));
- return yy::parser::INTEGER;
+ return yy::parser::token::INTEGER;
@}
[a-z]+ @{
yylval.build(yytext);
- return yy::parser::IDENTIFIER;
+ return yy::parser::token::IDENTIFIER;
@}
@end example
- Re: It seems yy::parser::token::INTEGER should be instead of yy::parser::INTEGER in the manual,
Akim Demaille <=