diff options
Diffstat (limited to 'idlc/source/scanner.ll')
-rw-r--r-- | idlc/source/scanner.ll | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/idlc/source/scanner.ll b/idlc/source/scanner.ll index 9955a8c80..bbcc08fae 100644 --- a/idlc/source/scanner.ll +++ b/idlc/source/scanner.ll @@ -48,21 +48,12 @@ #include "attributeexceptions.hxx" - class AstExpression; class AstArray; class AstMember; #include <parser.hxx> -/* handle locations */ -int yycolumn = 1; - -#define YY_USER_ACTION yylloc->first_line = yylloc->last_line = yylineno; \ - yylloc->first_column = yycolumn; yylloc->last_column = yycolumn+yyleng-1; \ - idlc()->setOffset(yylloc->first_column, yylloc->last_column); \ - yycolumn += yyleng; - sal_Int32 beginLine = 0; ::rtl::OString docu; @@ -236,7 +227,6 @@ 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++) @@ -272,7 +262,6 @@ static void parseLineAndFile(sal_Char* pBuf) #endif %} -%option bison-bridge bison-locations %option noyywrap %option never-interactive @@ -294,10 +283,8 @@ IDENTIFIER ("_"?({ALPHA}|{DIGIT})+)* %% [ \t\r]+ ; /* eat up whitespace */ -[\n] { - idlc()->incLineNumber(); - yycolumn = 1; - yylineno++; +[\n] { + idlc()->incLineNumber(); } attribute return IDL_ATTRIBUTE; @@ -362,39 +349,39 @@ 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; } {IDENTIFIER} { - yylval->sval = new ::rtl::OString(yytext); + yylval.sval = new ::rtl::OString(yytext); return IDL_IDENTIFIER; } \<\< { - yylval->strval = yytext; + yylval.strval = yytext; return IDL_LEFTSHIFT; } \>\> { - yylval->strval = yytext; + yylval.strval = yytext; return IDL_RIGHTSHIFT; } \:\: { - yylval->strval = yytext; + yylval.strval = yytext; return IDL_SCOPESEPARATOR; } |