Hi Asfar, > Le 24 févr. 2015 à 19:35, Askar Safin <safinas...@mail.ru> 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 <a...@lrde.epita.fr> 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 a...@ajrh.net Antonio Silva Correia amsilvacorr...@hotmail.com Arnold Robbins arn...@skeeve.com Art Haas ah...@neosoft.com +Askar Safin safinas...@mail.ru Baron Schwartz ba...@sequent.org Ben Pfaff b...@cs.stanford.edu Benoit Perrot benoit.per...@epita.fr 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