|
-
August 1st, 2019, 04:23 PM
#1
Flex fail on call second program
Greetings to all and thanks advances for paying attention to my mail
I have a mistake just baffling
I run my 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 first rule in flex file is
Code:
{DIGIT}{1,11} {
std::cout << "Number : " <<
yytext << std::endl;
yylval->build< int >(atoi(yytext));
return token::NUMBER;
}
when run the second program no call this rule it call final rule
Code:
{NAME} {
std::cout << "Name: " << yytext << std::endl;
yylval->build< std::string >( yytext );
return token::NAME;
}
my question is why this differ is the same input, the same class scanner
only different program.
first program https://github.com/azaeldevel/toolkit.git commit
8b4845dda686321fbaf0d9e6a5abc04992dd6f24
second program https://github.com/azaeldevel/apidb.git commit
c887addfdc0a7fbad80df3571a8214c5e0bb8d34
I appreciate any comments
Last edited by 2kaud; August 2nd, 2019 at 03:17 AM.
Reason: Added code tags
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|