[Flex-help] Fail flex on second program
flex is a tool for generating scanners
Brought to you by:
wlestes
From: Azael R. <aza...@gm...> - 2019-08-01 20:24:23
|
Greetings to all and thanks advances for paying attention to my mail I have a mistake just baffling I run muy first program and next gets output correct Number : 1 . Number : 1 . Number : 0 - Stage : snapshot Build : 20190729201751 So y run a second program but i get a incorrect result Name :1 Should be Number : 1 like in first ran program The program entry is the same, they differ in that one is the test program (cunit) and the second is the productive program, in both cases the complete scanner is called from a shared library generated in cmake and the scanner is generated in C ++ the firts rule in flex file is {DIGIT}{1,11} { std::cout << "Number : " << yytext << std::endl; yylval->build< int >( atoi(yytext) ); return token::NUMBER; } whe run the second program no call this rule it call final rule {NAME} {std::cout << "Name: " << yytext << std::endl; yylval- >build< std::string >( yytext ); return token::NAME;} my cuestion is why this differ is the same input, the same class scaner only diferent program. I attach my flex file, if you need the rest I put a link for both firt program https://github.com/azaeldevel/toolkit.git commit 8b4845dda686321fbaf0d9e6a5abc04992dd6f24 second program https://github.com/azaeldevel/apidb.git commit c887addfdc0a7fbad80df3571a8214c5e0bb8d34 I appreciate any comments |