summaryrefslogtreecommitdiffstats
path: root/idlc/source/scanner.ll
diff options
context:
space:
mode:
Diffstat (limited to 'idlc/source/scanner.ll')
-rw-r--r--idlc/source/scanner.ll24
1 files changed, 18 insertions, 6 deletions
diff --git a/idlc/source/scanner.ll b/idlc/source/scanner.ll
index 4125195f5916..2206297a0ffd 100644
--- a/idlc/source/scanner.ll
+++ b/idlc/source/scanner.ll
@@ -25,6 +25,8 @@
*
************************************************************************/
+%option yylineno
+
%{
/*
* scanner.ll - Lexical scanner for IDLC 1.0
@@ -46,12 +48,19 @@
#include "attributeexceptions.hxx"
+
class AstExpression;
class AstArray;
class AstMember;
#include <parser.hxx>
+/* handle locations */
+int yycolumn = 1;
+
+#define YY_USER_ACTION idlc()->setOffset(yycolumn, yycolumn+yyleng-1); \
+ yycolumn += yyleng;
+
sal_Int32 beginLine = 0;
::rtl::OString docu;
@@ -225,6 +234,7 @@ static void parseLineAndFile(sal_Char* pBuf)
for (; *r != '\0' && *r != ' ' && *r != '\t'; r++) ;
*r++ = 0;
idlc()->setLineNumber((sal_uInt32)atol(h));
+ yylineno = atol(h);
/* Find file name, if present */
for (; *r != '"'; r++)
@@ -281,8 +291,10 @@ IDENTIFIER ("_"?({ALPHA}|{DIGIT})+)*
%%
[ \t\r]+ ; /* eat up whitespace */
-[\n] {
- idlc()->incLineNumber();
+[\n] {
+ idlc()->incLineNumber();
+ yycolumn = 1;
+ yylineno++;
}
attribute return IDL_ATTRIBUTE;
@@ -347,21 +359,21 @@ published return IDL_PUBLISHED;
"..." return IDL_ELLIPSIS;
("-")?{INT_LITERAL}+(l|L|u|U)? {
- return asciiToInteger(yytext, &yylval.ival, &yylval.uval);
+ return asciiToInteger(yytext, &yylval.ival, &yylval.uval);
}
("-")?{OCT_LITERAL}+(l|L|u|U)? {
- return asciiToInteger(yytext, &yylval.ival, &yylval.uval);
+ return asciiToInteger(yytext, &yylval.ival, &yylval.uval);
}
("-")?{HEX_LITERAL}+(l|L|u|U)? {
- return asciiToInteger(yytext, &yylval.ival, &yylval.uval);
+ return asciiToInteger(yytext, &yylval.ival, &yylval.uval);
}
("-")?{DIGIT}+(e|E){1}(("+"|"-")?{DIGIT}+)+(f|F)? |
("-")?"."{DIGIT}+((e|E)("+"|"-")?{DIGIT}+)?(f|F)? |
("-")?{DIGIT}*"."{DIGIT}+((e|E)("+"|"-")?{DIGIT}+)?(f|F)? {
- yylval.dval = asciiToFloat( yytext );
+ yylval.dval = asciiToFloat( yytext );
return IDL_FLOATING_PT_LITERAL;
}