summaryrefslogtreecommitdiffstats
path: root/src/constexp.l
diff options
context:
space:
mode:
Diffstat (limited to 'src/constexp.l')
-rw-r--r--src/constexp.l11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/constexp.l b/src/constexp.l
index 0f053bd..889626c 100644
--- a/src/constexp.l
+++ b/src/constexp.l
@@ -90,6 +90,9 @@ CONSTSUFFIX ([uU][lL]?[lL]?)|([lL][lL]?[uU]?)
(0x|0X)[0-9a-fA-F]+{CONSTSUFFIX}? { yyextra->strToken=yytext+2;
return TOK_HEXADECIMALINT;
}
+(0b|0B)[01]+{CONSTSUFFIX}? { yyextra->strToken=yytext+2;
+ return TOK_BINARYINT;
+ }
(([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+))([eE]([\-\+])?[0-9]+)?([fFlL])? {
yyextra->strToken=yytext; return TOK_FLOAT;
}
@@ -132,7 +135,7 @@ ConstExpressionParser::~ConstExpressionParser()
delete p;
}
-bool ConstExpressionParser::parse(const char *fileName,int lineNr,const QCString &s)
+bool ConstExpressionParser::parse(const char *fileName,int lineNr,const std::string &s)
{
struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
@@ -146,13 +149,13 @@ bool ConstExpressionParser::parse(const char *fileName,int lineNr,const QCString
yyextra->inputPosition = 0;
constexpYYrestart( yyin, p->yyscanner );
- printlex(yy_flex_debug, TRUE, __FILE__, fileName);
- //printf("Expression: '%s'\n",s.data());
+ printlex(yy_flex_debug, true, __FILE__, fileName);
+ //printf("Expression: '%s'\n",qPrint(s));
constexpYYparse(p->yyscanner);
//printf("Result: %ld\n",(long)g_resultValue);
- printlex(yy_flex_debug, FALSE, __FILE__, fileName);
+ printlex(yy_flex_debug, false, __FILE__, fileName);
bool result = (long)yyextra->resultValue!=0;
return result;