Re: [Flex-help] help needed in the transition from flex 2.59 to 2.6
flex is a tool for generating scanners
Brought to you by:
wlestes
From: Will E. <wes...@gm...> - 2016-10-07 14:40:12
|
Thanks for the additional detail. I'll look into it. On Friday, 7 October 2016, 3:31 pm +0200, Rollastre Prostit <rol...@gm...> wrote: > Thanks for the response. > > I am sorry. You are right. I did read the version wrong. When I say > 2.59 it should have been 2.5.39. But the problem is the same. > > JDF@JDF /usr/bin > $ flex -V > flex 2.5.39 > > which is when it works fine as it assigns a reference to std::cin to the > pointer yyin (yyin=&std::cin). > > but when using flex 2.6.1 > > JDF@JDF /usr/bin > $ flex --version > flex 2.6.1 > > is when it uses the . operator > > yyin.rdbuf(std::cin.rdbuf()); > > when it should be using the -> operator. > > yyin->rdbuf(std::cin.rdbuf()); > > In fact, if I edit it manually, the compile error goes away. > > I don't know if this is a bug or that I have to specify something in the > .ll file. > > > On 07-Oct-16 1:57 PM, Will Estes wrote: > > THe version numbers you are siting are a bit muddled. What does "flex --version" report in both cases? > > > > On Friday, 7 October 2016, 8:45 am +0200, Rollastre Prostit <rol...@gm...> wrote: > > > >> Hello list. > >> > >> I looks like there are some changes in the code generated by flex 2.59 > >> and 2.6 (in C++) that break my build. > >> > >> in 2.59 the code in question in the XXXX.lexer.cpp is this: > >> > >> if(!yyin) > >> > >> /*%if-c-only*/ > >> > >> /*%endif*/ > >> > >> /*%if-c++-only*/ > >> > >> yyin=&std::cin; > >> > >> /*%endif*/ > >> > >> if(!yyout) > >> > >> /*%if-c-only*/ > >> > >> /*%endif*/ > >> > >> /*%if-c++-only*/ > >> > >> yyout=&std::cout; > >> > >> /*%endif*/ > >> > >> > >> and in 2.6 is like this: > >> if(!yyin) > >> > >> /*%if-c-only*/ > >> > >> /*%endif*/ > >> > >> /*%if-c++-only*/ > >> > >> yyin.rdbuf(std::cin.rdbuf()); > >> > >> /*%endif*/ > >> > >> if(!yyout) > >> > >> /*%if-c-only*/ > >> > >> /*%endif*/ > >> > >> /*%if-c++-only*/ > >> > >> yyout.rdbuf(std::cout.rdbuf()); > >> > >> /*%endif*/ > >> > >> > >> > >> It turns out that the 2.59 version works fine but the 2.6 doesn't > >> compile because yyin and yyout are pointers. I have searched for a > >> solution for my problem in the list but I couldn't find anything. I also > >> googled and found this > >> > >> http://stackoverflow.com/questions/34438023/openfoam-flex-yyin-rdbufstdcin-rdbuf-error > >> > >> http://htaccess9simo.blogspot.com.es/2015/12/openfoam-flex-yyinrdbufstdcinrdbuf-error.html > >> > >> Which basically workaround the problem by downgrading to 2.59 in the > >> /usr/bin. I already tested this and worked for me too. But I would > >> expect there is a better solution which doesn't require that my build > >> system ships a specific version of flex. Does somebody know what am I > >> doing (or not doing) that causes this problem? > >> > >> Thank you and sorry if the question is already posted, I just couldn't > >> find it! > >> > >> > >> ------------------------------------------------------------------------------ > >> Check out the vibrant tech community on one of the world's most > >> engaging tech sites, SlashDot.org! http://sdm.link/slashdot > >> -- > >> Flex-help mailing list > >> Fle...@li... > >> https://lists.sourceforge.net/lists/listinfo/flex-help > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > -- > Flex-help mailing list > Fle...@li... > https://lists.sourceforge.net/lists/listinfo/flex-help -- Will Estes Flex Project Maintainer wes...@gm... https://github.com/westes/flex |