P
pocmatos
Hi all,
I'm doing parsing with flex and bison and I read numbers which are just
a sequence of digits [0-9]+ and keep them in an int, however if the
number is bigger than int, I should output error. What's the best way
to check this?
In the flex side I have:
{numeral} { yylval.num = strtoul(yytext, NULL, 0);
return NUMERAL; }
Is there a straightforward way to check if the number in yytext is
bigger than INT_MAX?
Cheers,
Paulo Matos
I'm doing parsing with flex and bison and I read numbers which are just
a sequence of digits [0-9]+ and keep them in an int, however if the
number is bigger than int, I should output error. What's the best way
to check this?
In the flex side I have:
{numeral} { yylval.num = strtoul(yytext, NULL, 0);
return NUMERAL; }
Is there a straightforward way to check if the number in yytext is
bigger than INT_MAX?
Cheers,
Paulo Matos