summaryrefslogtreecommitdiffstats
path: root/src/constexp.l
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2001-07-15 17:11:26 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2001-07-15 17:11:26 (GMT)
commit89f2a610a5ca245dcc19dc7e95b49ff664c3b66a (patch)
treebc5400211360251f121d60efdd50b09f10db11d2 /src/constexp.l
parentd5150cf4f1de010ad62f6de641532805ba81940a (diff)
downloadDoxygen-89f2a610a5ca245dcc19dc7e95b49ff664c3b66a.zip
Doxygen-89f2a610a5ca245dcc19dc7e95b49ff664c3b66a.tar.gz
Doxygen-89f2a610a5ca245dcc19dc7e95b49ff664c3b66a.tar.bz2
Release-1.2.8-20010715
Diffstat (limited to 'src/constexp.l')
-rw-r--r--src/constexp.l36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/constexp.l b/src/constexp.l
index b6604ff..92b3da4 100644
--- a/src/constexp.l
+++ b/src/constexp.l
@@ -25,11 +25,13 @@
#define YY_NO_UNPUT
#define YY_NEVER_INTERACTIVE 1
-QCString strToken;
+QCString g_strToken;
+CPPValue g_resultValue;
+int g_constExpLineNr;
+QCString g_constExpFileName;
-static const char *inputString;
-static int inputPosition;
-CPPValue resultValue;
+static const char *g_inputString;
+static int g_inputPosition;
#undef YY_INPUT
#define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size);
@@ -37,9 +39,9 @@ CPPValue resultValue;
static int yyread(char *buf,int max_size)
{
int c=0;
- while( c < max_size && inputString[inputPosition] )
+ while( c < max_size && g_inputString[g_inputPosition] )
{
- *buf = inputString[inputPosition++] ;
+ *buf = g_inputString[g_inputPosition++] ;
c++; buf++;
}
return c;
@@ -74,36 +76,38 @@ static int yyread(char *buf,int max_size)
"(" { return TOK_LPAREN; }
")" { return TOK_RPAREN; }
"'"(([^\'\n\r\\]+)|(\\(([ntvbrfa\\?'\"])|([0-9]+)|([xX][0-9a-fA-F]+))))"'" {
- strToken=yytext;
+ g_strToken=yytext;
return TOK_CHARACTER;
}
-0[0-7]*[uUlL]* { strToken=yytext;
+0[0-7]*[uUlL]* { g_strToken=yytext;
return TOK_OCTALINT;
}
-[1-9][0-9]*[uUlL]* { strToken=yytext;
+[1-9][0-9]*[uUlL]* { g_strToken=yytext;
return TOK_DECIMALINT;
}
-(0x|0X)[0-9a-fA-F]+[uUlL]* { strToken=yytext; return TOK_HEXADECIMALINT; }
+(0x|0X)[0-9a-fA-F]+[uUlL]* { g_strToken=yytext; return TOK_HEXADECIMALINT; }
(([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+))([eE]([\-\+])?[0-9]+)?([fFlL])? {
- strToken=yytext; return TOK_FLOAT;
+ g_strToken=yytext; return TOK_FLOAT;
}
([0-9]+[eE])([\-\+])?[0-9]+([fFlL])? {
- strToken=yytext; return TOK_FLOAT;
+ g_strToken=yytext; return TOK_FLOAT;
}
.
\n
%%
-bool parseCppExpression(const QCString &s)
+bool parseCppExpression(const char *fileName,int lineNr,const QCString &s)
{
//printf("Expression: `%s'\n",s.data());
- inputString = s;
- inputPosition = 0;
+ g_constExpFileName = fileName;
+ g_constExpLineNr = lineNr;
+ g_inputString = s;
+ g_inputPosition = 0;
cppExpYYrestart( cppExpYYin );
cppExpYYparse();
//printf("Result: %ld\n",(long)resultValue);
- return (long)resultValue!=0;
+ return (long)g_resultValue!=0;
}
extern "C" {