bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Assertion `!yytname_' failed.


From: Akim Demaille
Subject: Re: Assertion `!yytname_' failed.
Date: Fri, 9 Jan 2015 13:48:21 +0100

> Le 3 févr. 2014 à 14:40, Antonio Correia <address@hidden> a écrit :
> 
> Hi all, 
> 
> I was testing error recovery with bison and I'm getting this assertion here: 
> 
> 
> /// Instantiate an empty \a T in here. 
> template <typename T> 
> T& 
> build () 
> { 
> YYASSERT (!yytname_); 
> YYASSERT (sizeof (T) <= S); 
> yytname_ = typeid (T).name (); 
> return *new (yyas_<T> ()) T; 
> } 
> 
> when using this simple grammar. 
> 
> 
> %token <char> CHAR "char" 
> %token <int> NUM "number" 
> %token SEMICOLON ";" 
> %token END 0 "end of file" 
> 
> %% 
> 
> 
> stms : stms CHAR ";" 
> | CHAR ";" 
> | error ";" {yyerrok;} 
> ; 
> 
> %% 
> 
> 
> I've used bison 3.0.2 and flex 2.5.37. 
> I'm attaching all the code I used with this test. 
> 
> I was expecting two syntax error messages, and in fact I get those messages 
> when I remove the parse.assert definition. 
> 
> I used g++ *.cpp -o test to compile the code, after bison and flex steps. 

Hi Antonio,

Thanks a lot for the report.  This was fixed (thanks to your
ticket on Savannah).  See 

http://lists.gnu.org/archive/html/bison-patches/2015-01/msg00008.html


reply via email to

[Prev in Thread] Current Thread [Next in Thread]