LCOV - code coverage report
Current view: top level - idlc/source - scanner.l (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 217 288 75.3 %
Date: 2012-08-25 Functions: 3 4 75.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 158 353 44.8 %

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * This file is part of the LibreOffice project.
       3                 :            :  *
       4                 :            :  * This Source Code Form is subject to the terms of the Mozilla Public
       5                 :            :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       6                 :            :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       7                 :            :  *
       8                 :            :  * This file incorporates work covered by the following license notice:
       9                 :            :  *
      10                 :            :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      11                 :            :  *   contributor license agreements. See the NOTICE file distributed
      12                 :            :  *   with this work for additional information regarding copyright
      13                 :            :  *   ownership. The ASF licenses this file to you under the Apache
      14                 :            :  *   License, Version 2.0 (the "License"); you may not use this file
      15                 :            :  *   except in compliance with the License. You may obtain a copy of
      16                 :            :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      17                 :            :  */
      18                 :            : 
      19                 :            : %option yylineno
      20                 :            : 
      21                 :            : %{
      22                 :            : /*
      23                 :            :  * scanner.ll - Lexical scanner for IDLC 1.0
      24                 :            :  */
      25                 :            : 
      26                 :            : #include <ctype.h>
      27                 :            : #include <stdlib.h>
      28                 :            : #include <string.h>
      29                 :            : 
      30                 :            : #ifndef _IDLC_IDLC_HXX_
      31                 :            : #include <idlc/idlc.hxx>
      32                 :            : #endif
      33                 :            : #ifndef _IDLC_ERRORHANDLER_HXX_
      34                 :            : #include <idlc/errorhandler.hxx>
      35                 :            : #endif
      36                 :            : #ifndef _IDLC_FEHELPER_HXX_
      37                 :            : #include <idlc/fehelper.hxx>
      38                 :            : #endif
      39                 :            : 
      40                 :            : #include "attributeexceptions.hxx"
      41                 :            : 
      42                 :            : 
      43                 :            : class AstExpression;
      44                 :            : class AstArray;
      45                 :            : class AstMember;
      46                 :            : 
      47                 :            : #include <parser.hxx>
      48                 :            : 
      49                 :            : /* handle locations */
      50                 :            : int yycolumn = 1;
      51                 :            : 
      52                 :            : #define YY_USER_ACTION idlc()->setOffset(yycolumn, yycolumn+yyleng-1); \
      53                 :            :     yycolumn += yyleng;
      54                 :            : 
      55                 :            : sal_Int32               beginLine = 0;
      56                 :        166 : ::rtl::OString  docu;
      57                 :            : 
      58                 :      15536 : static int asciiToInteger(char const * s, sal_Int64  * sval, sal_uInt64 * uval) {
      59                 :      15536 :     bool neg = false;
      60         [ +  + ]:      15536 :     if (*s == '-') {
      61                 :        609 :         neg = true;
      62                 :        609 :         ++s;
      63                 :            :     }
      64                 :      15536 :     unsigned int base = 10;
      65         [ +  + ]:      15536 :     if (*s == '0') {
      66                 :       1848 :         base = 8;
      67                 :       1848 :         ++s;
      68 [ +  - ][ +  + ]:       1848 :         if (*s == 'X' || *s == 'x') {
      69                 :        765 :             base = 16;
      70                 :        765 :             ++s;
      71                 :            :         }
      72                 :            :     }
      73                 :      15536 :     sal_uInt64 val = 0;
      74         [ +  + ]:      47741 :     for (; *s != 0; ++s) {
      75                 :            :         unsigned int n;
      76 [ +  - ][ +  + ]:      32205 :         if (*s >= '0' && *s <= '9') {
      77                 :      32111 :             n = *s - '0';
      78                 :            :         } else {
      79   [ -  +  -  -  :         94 :             switch (*s) {
                +  +  - ]
      80                 :            :             case 'A':
      81                 :            :             case 'a':
      82                 :          0 :                 n = 10;
      83                 :          0 :                 break;
      84                 :            :             case 'B':
      85                 :            :             case 'b':
      86                 :          5 :                 n = 11;
      87                 :          5 :                 break;
      88                 :            :             case 'C':
      89                 :            :             case 'c':
      90                 :          0 :                 n = 12;
      91                 :          0 :                 break;
      92                 :            :             case 'D':
      93                 :            :             case 'd':
      94                 :          0 :                 n = 13;
      95                 :          0 :                 break;
      96                 :            :             case 'E':
      97                 :            :             case 'e':
      98                 :          2 :                 n = 14;
      99                 :          2 :                 break;
     100                 :            :             case 'F':
     101                 :            :             case 'f':
     102                 :         87 :                 n = 15;
     103                 :         87 :                 break;
     104                 :            :             default:
     105                 :          0 :                 goto done;
     106                 :            :             }
     107                 :            :         }
     108                 :            :         // The following guarantees the invariant val <= SAL_MAX_UINT64 (because
     109                 :            :         // base and n are sufficiently small), *if*
     110                 :            :         // std::numeric_limits<sal_uInt64>::max() == SAL_MAX_UINT64:
     111                 :      32205 :         sal_uInt64 nval = val * base + n;
     112         [ -  + ]:      32205 :         if (nval < val) {
     113                 :            :             idlc()->error()->syntaxError(
     114                 :          0 :                 PS_NoState, idlc()->getLineNumber(),
     115                 :          0 :                 "integral constant too large");
     116                 :          0 :             val = 0;
     117                 :          0 :             break;
     118                 :            :         }
     119                 :      32205 :         val = nval;
     120                 :            :     }
     121                 :            :  done:
     122         [ +  + ]:      15536 :     if (neg) {
     123         [ +  + ]:        609 :         if (val < SAL_CONST_UINT64(0x8000000000000000)) {
     124                 :        608 :             *sval = -static_cast< sal_Int64 >(val);
     125         [ +  - ]:          1 :         } else if (val == SAL_CONST_UINT64(0x8000000000000000)) {
     126                 :          1 :             *sval = SAL_MIN_INT64;
     127                 :            :         } else {
     128                 :            :             idlc()->error()->syntaxError(
     129                 :          0 :                 PS_NoState, idlc()->getLineNumber(),
     130                 :          0 :                 "negative integral constant too large");
     131                 :          0 :             *sval = 0;
     132                 :            :         }
     133                 :        609 :         return IDL_INTEGER_LITERAL;
     134         [ +  + ]:      14927 :     } else if (val <= static_cast< sal_uInt64 >(SAL_MAX_INT64)) {
     135                 :      14926 :         *sval = static_cast< sal_Int64 >(val);
     136                 :      14926 :         return IDL_INTEGER_LITERAL;
     137                 :            :     } else {
     138                 :          1 :         *uval = val;
     139                 :      15536 :         return IDL_INTEGER_ULITERAL;
     140                 :            :     }
     141                 :            : }
     142                 :            : 
     143                 :         20 : static double asciiToFloat(const sal_Char *s)
     144                 :            : {
     145                 :         20 :         double          d = 0.0;
     146                 :            :         double          e, k;
     147                 :         20 :         sal_Int32       neg = 0, negexp = 0;
     148                 :            : 
     149         [ -  + ]:         20 :         if (*s == '-')
     150                 :            :         {
     151                 :          0 :         neg = 1;
     152                 :          0 :         s++;
     153                 :            :         }
     154 [ +  + ][ +  - ]:         68 :         while (*s >= '0' && *s <= '9')
                 [ +  + ]
     155                 :            :         {
     156                 :         48 :         d = (d * 10) + *s - '0';
     157                 :         48 :         s++;
     158                 :            :         }
     159         [ +  - ]:         20 :         if (*s == '.')
     160                 :            :         {
     161                 :         20 :         s++;
     162                 :         20 :         e = 10;
     163 [ +  + ][ +  - ]:        140 :         while (*s >= '0' && *s <= '9')
                 [ +  + ]
     164                 :            :         {
     165                 :        120 :                 d += (*s - '0') / (e * 1.0);
     166                 :        120 :                 e *= 10;
     167                 :        120 :                 s++;
     168                 :            :         }
     169                 :            :         }
     170 [ +  - ][ -  + ]:         20 :         if (*s == 'e' || *s == 'E')
     171                 :            :         {
     172                 :          0 :         s++;
     173         [ #  # ]:          0 :         if (*s == '-')
     174                 :            :         {
     175                 :          0 :                 negexp = 1;
     176                 :          0 :                 s++;
     177                 :            :         } else
     178                 :            :         {
     179         [ #  # ]:          0 :                 if (*s == '+')
     180                 :          0 :                 s++;
     181                 :          0 :                 e = 0;
     182 [ #  # ][ #  # ]:          0 :                 while (*s >= '0' && *s <= '9')
                 [ #  # ]
     183                 :            :                 {
     184                 :          0 :                 e = (e * 10) + *s - '0';
     185                 :          0 :                 s++;
     186                 :            :                 }
     187         [ #  # ]:          0 :                 if (e > 0)
     188                 :            :                 {
     189         [ #  # ]:          0 :                 for (k = 1; e > 0; k *= 10, e--)
     190                 :            :                     ;
     191         [ #  # ]:          0 :                 if (negexp)
     192                 :          0 :                         d /= k;
     193                 :            :                 else
     194                 :          0 :                         d *= k;
     195                 :            :                 }
     196                 :            :                 }
     197                 :            :         }
     198         [ -  + ]:         20 :         if (neg) d *= -1.0;
     199                 :         20 :         return d;
     200                 :            : }
     201                 :            : 
     202                 :          0 : static void     idlParsePragma(sal_Char* pPragma)
     203                 :            : {
     204                 :          0 :         ::rtl::OString pragma(pPragma);
     205                 :          0 :         sal_Int32 index = pragma.indexOf("include");
     206                 :          0 :         sal_Char* begin = pPragma + index + 8;
     207                 :          0 :         sal_Char* offset = begin;
     208         [ #  # ]:          0 :         while (*offset != ',') offset++;
     209                 :            :         //::rtl::OString include = pragma.copy(index + 8, offset - begin);
     210                 :            :         //unused// idlc()->insertInclude(pragma.copy(index + 8, (sal_Int32)(offset - begin)));
     211                 :          0 : }       
     212                 :            : 
     213                 :     131954 : static void parseLineAndFile(sal_Char* pBuf)
     214                 :            : {
     215                 :     131954 :         sal_Char        *r = pBuf;
     216                 :            :         sal_Char    *h;
     217                 :     131954 :         sal_Bool        bIsInMain = sal_False;
     218                 :            : 
     219                 :            :         /* Skip initial '#' */
     220         [ +  - ]:     131954 :         if (*r != '#')
     221                 :            :                 return;
     222                 :            : 
     223                 :            :         /* Find line number */
     224 [ +  + ][ +  - ]:     791724 :         for (r++; *r == ' ' || *r == '\t' || isalpha(*r); r++) ;
         [ +  + ][ +  + ]
     225                 :     131954 :         h = r;
     226 [ +  - ][ +  + ]:     326650 :         for (; *r != '\0' && *r != ' ' && *r != '\t'; r++) ;
         [ +  - ][ +  + ]
     227                 :     131954 :         *r++ = 0;
     228         [ +  - ]:     131954 :         idlc()->setLineNumber((sal_uInt32)atol(h));
     229                 :     131954 :     yylineno = atol(h);
     230                 :            : 
     231                 :            :         /* Find file name, if present */
     232         [ -  + ]:     131954 :         for (; *r != '"'; r++)
     233                 :            :         {
     234 [ #  # ][ #  # ]:          0 :                 if (*r == '\n' || *r == '\0')
     235                 :            :                         return;
     236                 :            :         }
     237                 :     131954 :         h = ++r;
     238         [ +  + ]:    9655828 :         for (; *r != '"'; r++) ;
     239                 :     131954 :         *r = 0;
     240         [ -  + ]:     131954 :         if (*h == '\0')
     241 [ #  # ][ #  # ]:          0 :                 idlc()->setFileName(::rtl::OString("standard input"));
     242                 :            :         else
     243 [ +  - ][ +  - ]:     131954 :                 idlc()->setFileName(::rtl::OString(h));
     244                 :            : 
     245 [ +  - ][ +  - ]:     131954 :         bIsInMain = (idlc()->getFileName() == idlc()->getRealFileName()) ? sal_True : sal_False;
                 [ +  + ]
     246         [ +  - ]:     131954 :         idlc()->setInMainfile(bIsInMain);            
     247                 :            : }       
     248                 :            : 
     249                 :            : // Suppress any warnings from generated code:
     250                 :            : #if defined __GNUC__
     251                 :            : #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))
     252                 :            : #pragma GCC diagnostic ignored "-Wunused-function"
     253                 :            : #pragma GCC diagnostic ignored "-Wunused-label"
     254                 :            : #endif
     255                 :            : #elif defined __SUNPRO_CC
     256                 :            : #pragma disable_warn
     257                 :            : #elif defined _MSC_VER
     258                 :            : #pragma warning(push, 1)
     259                 :            : /**/
     260                 :            : #ifdef yywrap
     261                 :            : #undef  yywrap
     262                 :            : #define yywrap() 1
     263                 :            : #endif
     264                 :            : /**/
     265                 :            : #endif
     266                 :            : %}
     267                 :            : 
     268                 :            : %option noyywrap
     269                 :            : %option never-interactive
     270                 :            : 
     271                 :            : %x DOCU
     272                 :            : %x COMMENT
     273                 :            : 
     274                 :            : DIGIT           [0-9]
     275                 :            : OCT_DIGIT       [0-7]
     276                 :            : HEX_DIGIT       [a-fA-F0-9]
     277                 :            : CAPITAL         [A-Z]
     278                 :            : ALPHA           [a-zA-Z]
     279                 :            : INT_LITERAL     [1-9][0-9]*
     280                 :            : OCT_LITERAL     0{OCT_DIGIT}*
     281                 :            : HEX_LITERAL     (0x|0X){HEX_DIGIT}*
     282                 :            : 
     283                 :            : IDENTIFIER_NEW  ({ALPHA}({ALPHA}|{DIGIT})*)|({CAPITAL}("_"?({ALPHA}|{DIGIT})+)*)
     284                 :            : IDENTIFIER      ("_"?({ALPHA}|{DIGIT})+)*
     285                 :            : 
     286                 :            : %%
     287                 :            : 
     288                 :            : [ \t\r]+        ; /* eat up whitespace */
     289                 :    2668543 : [\n]           {
     290                 :    2591896 :        idlc()->incLineNumber();
     291                 :    2591896 :        yycolumn = 1;
     292         [ +  - ]:    2591896 :        yylineno++;
     293                 :            : }
     294                 :    2591896 : 
     295                 :       4980 : attribute       return IDL_ATTRIBUTE;
     296         [ +  - ]:       6481 : bound           return IDL_BOUND;
     297                 :          0 : case            return IDL_CASE;
     298         [ +  - ]:      16220 : const           return IDL_CONST;
     299         [ #  # ]:       1632 : constants       return IDL_CONSTANTS;
     300         [ +  - ]:      14719 : constrained     return IDL_CONSTRAINED;
     301         [ +  - ]:       1632 : default         return IDL_DEFAULT;
     302         [ #  # ]:       5727 : enum            return IDL_ENUM;
     303         [ #  # ]:      13137 : exception       return IDL_EXCEPTION;
     304         [ +  - ]:      54216 : interface       return IDL_INTERFACE;
     305         [ +  - ]:      13137 : maybeambiguous  return IDL_MAYBEAMBIGUOUS;
     306         [ +  - ]:      48492 : maybedefault    return IDL_MAYBEDEFAULT;
     307         [ #  # ]:        550 : maybevoid       return IDL_MAYBEVOID;
     308         [ +  - ]:     277949 : module          return IDL_MODULE;
     309         [ +  - ]:        550 : needs           return IDL_NEEDS;
     310         [ +  - ]:     277946 : observes        return IDL_OBSERVES;
     311         [ #  # ]:      13456 : optional        return IDL_OPTIONAL;
     312         [ #  # ]:      23273 : property        return IDL_PROPERTY;
     313         [ +  - ]:      40564 : raises          return IDL_RAISES;
     314         [ +  - ]:      25572 : readonly        return IDL_READONLY;
     315         [ +  - ]:      27108 : removable       return IDL_REMOVEABLE;
     316         [ +  - ]:       8269 : service         return IDL_SERVICE;
     317         [ #  # ]:      21282 : sequence        return IDL_SEQUENCE;
     318         [ +  - ]:       6133 : singleton       return IDL_SINGLETON;
     319         [ +  - ]:      34968 : struct          return IDL_STRUCT;
     320         [ +  - ]:        163 : switch          return IDL_SWITCH;
     321         [ +  - ]:      13702 : transient       return IDL_TRANSIENT;
     322         [ #  # ]:        961 : typedef         return IDL_TYPEDEF;
     323         [ +  - ]:         16 : union           return IDL_UNION;
     324         [ +  - ]:        961 : 
     325         [ #  # ]:      19387 : any             return IDL_ANY;                         
     326         [ +  - ]:      41876 : boolean         return IDL_BOOLEAN;
     327                 :       3106 : byte            return IDL_BYTE;
     328         [ +  - ]:      23477 : char            return IDL_CHAR;
     329         [ +  - ]:       6215 : double          return IDL_DOUBLE;
     330         [ +  - ]:       2558 : float           return IDL_FLOAT;
     331         [ +  - ]:       3402 : hyper           return IDL_HYPER;
     332         [ +  - ]:      50620 : long            return IDL_LONG;
     333         [ +  - ]:      25018 : short           return IDL_SHORT;
     334         [ +  - ]:      96696 : string          return IDL_STRING;
     335         [ +  - ]:      31066 : type            return IDL_TYPE;
     336         [ +  - ]:      56815 : unsigned        return IDL_UNSIGNED;
     337         [ +  - ]:      55508 : void            return IDL_VOID;
     338         [ +  - ]:       9169 : 
     339         [ +  - ]:      49167 : TRUE            return IDL_TRUE;
     340         [ #  # ]:          0 : True            return IDL_TRUE;
     341                 :          0 : FALSE           return IDL_FALSE;
     342         [ #  # ]:          0 : False           return IDL_FALSE;
     343         [ #  # ]:          0 : 
     344         [ #  # ]:      90260 : in              return IDL_IN;
     345         [ +  - ]:      92814 : out             return IDL_OUT;
     346                 :        134 : inout           return IDL_INOUT;
     347         [ +  - ]:      24853 : oneway          return IDL_ONEWAY;
     348         [ +  - ]:        134 : 
     349         [ +  - ]:      23480 : get             return IDL_GET;
     350         [ +  - ]:       2519 : set             return IDL_SET;
     351                 :            : 
     352         [ +  - ]:      72285 : published       return IDL_PUBLISHED;
     353         [ +  - ]:      70947 : 
     354                 :          2 : "..."           return IDL_ELLIPSIS;
     355         [ +  - ]:          2 : 
     356                 :            : ("-")?{INT_LITERAL}+(l|L|u|U)?    {
     357         [ +  - ]:      13688 :                 return asciiToInteger(yytext, &yylval.ival, &yylval.uval);
     358                 :            :             }
     359                 :            : 
     360                 :            : ("-")?{OCT_LITERAL}+(l|L|u|U)?    {
     361         [ +  - ]:       1083 :                 return asciiToInteger(yytext, &yylval.ival, &yylval.uval);
     362                 :            :             }
     363                 :            : 
     364                 :            : ("-")?{HEX_LITERAL}+(l|L|u|U)?    {
     365         [ +  - ]:        765 :                 return asciiToInteger(yytext, &yylval.ival, &yylval.uval);
     366                 :            :             }
     367                 :            : 
     368                 :            : ("-")?{DIGIT}+(e|E){1}(("+"|"-")?{DIGIT}+)+(f|F)? |
     369                 :            : ("-")?"."{DIGIT}+((e|E)("+"|"-")?{DIGIT}+)?(f|F)?       |
     370                 :            : ("-")?{DIGIT}*"."{DIGIT}+((e|E)("+"|"-")?{DIGIT}+)?(f|F)?        {
     371         [ +  - ]:         20 :                 yylval.dval = asciiToFloat( yytext );
     372                 :         20 :                                 return IDL_FLOATING_PT_LITERAL;
     373                 :            :             }
     374                 :            : 
     375                 :            : {IDENTIFIER}    {
     376 [ +  - ][ +  - ]:    1513336 :                                 yylval.sval = new ::rtl::OString(yytext);
     377                 :    1513336 :                                 return IDL_IDENTIFIER;
     378                 :            :                         }
     379                 :            : 
     380                 :            : \<\<      {
     381         [ #  # ]:          0 :                 yylval.strval = yytext;
     382                 :          0 :                 return IDL_LEFTSHIFT;
     383                 :            :         }
     384                 :            : \>\>      {
     385                 :          0 :                 yylval.strval = yytext;
     386         [ #  # ]:          0 :                 return IDL_RIGHTSHIFT;
     387                 :            :         }
     388                 :            : \:\:    {
     389                 :     585551 :                 yylval.strval = yytext;
     390         [ +  - ]:     585551 :                 return IDL_SCOPESEPARATOR;
     391                 :            :         }
     392                 :            : 
     393                 :            : "/*"  { 
     394         [ +  - ]:     196425 :                         BEGIN( COMMENT );
     395                 :     196425 :                         docu = ::rtl::OString();
     396                 :     196425 :                         beginLine = idlc()->getLineNumber();
     397                 :            :                 }
     398                 :     196425 : 
     399                 :            : "/***"        { 
     400         [ +  - ]:       8023 :                         BEGIN( COMMENT );
     401                 :       8023 :                         docu = ::rtl::OString();
     402                 :       8023 :                         beginLine = idlc()->getLineNumber();
     403                 :            :                 }
     404                 :       8023 : 
     405                 :            : <COMMENT>[^*]+    {
     406                 :     348169 :                                 docu += ::rtl::OString(yytext);
     407         [ +  - ]:     348169 :                         } 
     408                 :     348169 : 
     409                 :            : <COMMENT>"*"[^*/]+      {
     410                 :    1227296 :                                 docu += ::rtl::OString(yytext);
     411         [ +  - ]:    1227296 :                         }
     412                 :    1227296 : 
     413                 :            : <COMMENT>"**"   {
     414         [ +  - ]:     280595 :                                 docu += ::rtl::OString(yytext);
     415                 :            :                         }
     416                 :     280595 : 
     417                 :            : <COMMENT>[*]+"/"  {
     418         [ +  - ]:     204448 :                                 docu = docu.trim();
     419                 :     204448 :                 sal_Int32 nIndex = 0;
     420                 :     204448 :                 int count = 0;
     421         [ +  + ]:    1238096 :                 do { docu.getToken( 0, '\n', nIndex ); count++; } while( nIndex != -1 );
     422         [ +  - ]:     204448 :                                 idlc()->setLineNumber( beginLine + count - 1);
     423                 :     204448 :                                 BEGIN( INITIAL );
     424                 :            :                         }
     425                 :     204448 : 
     426                 :            : "/**" {
     427         [ +  - ]:     353083 :                         BEGIN( DOCU );
     428                 :     353083 :                         docu = ::rtl::OString();
     429                 :     353083 :                         beginLine = idlc()->getLineNumber();
     430                 :            :                 }
     431                 :     353083 : 
     432                 :            : <DOCU>[^*\n]+     {
     433         [ +  - ]:    1452034 :                                 docu += ::rtl::OString(yytext);
     434                 :            :                         }
     435                 :    1452034 : 
     436                 :            : <DOCU>"\n"[ \t]*"*"{1}        {
     437                 :       6872 :                                 idlc()->setLineNumber( idlc()->getLineNumber()  + 1);
     438         [ +  - ]:      13744 :                                 docu += ::rtl::OString("\n");
     439                 :            :                         }
     440                 :       6872 : 
     441                 :            : <DOCU>"\n"      {
     442                 :    1388049 :                                 idlc()->setLineNumber( idlc()->getLineNumber()  + 1);
     443         [ +  - ]:    2776098 :                                 docu += ::rtl::OString(yytext);
     444                 :            :                         }
     445                 :    1388049 : 
     446                 :            : <DOCU>"*"[^*^/\n]*      {
     447         [ +  - ]:       1492 :                                 docu += ::rtl::OString(yytext);
     448                 :            :                         }
     449                 :       1492 : 
     450                 :            : <DOCU>"\n"[ \t]*"*/"  {
     451                 :     351298 :                                 docu = docu.trim();
     452         [ +  - ]:     351298 :                                 sal_Int32 nIndex = 0;
     453                 :     351298 :                                 int count = 0;
     454         [ +  + ]:    1729201 :                                 do { docu.getToken( 0, '\n', nIndex ); count++; } while( nIndex != -1 );
     455         [ +  - ]:     351298 :                                 idlc()->setLineNumber( beginLine + count - 1);                
     456 [ +  + ][ +  + ]:     351298 :                                 if ( (nIndex = docu.indexOf("/*")) >= 0 || (nIndex = docu.indexOf("///")) >= 0 )
                 [ +  + ]
     457                 :            :                                 {
     458   [ +  -  +  +  :         44 :                     if ( 0 != nIndex &&
           -  + ][ -  + ]
     459                 :         29 :                          (docu.getStr()[nIndex - 1] != '"' && docu.getStr()[nIndex - 1] != ':') )
     460         [ #  # ]:          0 :                         idlc()->error()->syntaxError(PS_NoState, idlc()->getLineNumber(),
     461 [ #  # ][ #  # ]:          0 :                                                      "nested documentation strings are not allowed!");
     462                 :            :                                 }
     463         [ +  - ]:     351298 :                                 idlc()->setDocumentation(docu);
     464                 :     351298 :                                 BEGIN( INITIAL );
     465                 :            :                         }
     466                 :     351298 : 
     467                 :            : <DOCU>"*/"      {
     468         [ +  - ]:       1785 :                                 docu = docu.trim();
     469                 :       1785 :                                 sal_Int32 nIndex = 0;
     470                 :       1785 :                                 int count = 0;
     471         [ +  + ]:       2750 :                                 do { docu.getToken( 0, '\n', nIndex ); count++; } while( nIndex != -1 );
     472         [ +  - ]:       1785 :                                 idlc()->setLineNumber( beginLine + count - 1);
     473 [ -  + ][ -  + ]:       1785 :                                 if ( docu.indexOf("/*") >= 0 || docu.indexOf("//") >= 0 )
                 [ +  - ]
     474                 :            :                                 {
     475   [ #  #  #  #  :          0 :                     if ( 0 != nIndex &&
           #  # ][ #  # ]
     476                 :          0 :                          (docu.getStr()[nIndex - 1] != '"' && docu.getStr()[nIndex - 1] != ':') )
     477         [ #  # ]:          0 :                         idlc()->error()->syntaxError(PS_NoState, idlc()->getLineNumber(),
     478 [ #  # ][ #  # ]:          0 :                                                      "nested documentation strings are not allowed!");
     479                 :            :                                 }
     480         [ +  - ]:       1785 :                                 idlc()->setDocumentation(docu);
     481                 :       1785 :                                 BEGIN( INITIAL );
     482                 :            :                         }
     483                 :       1785 : 
     484                 :            : "//"[^/]{1}.*"\n" {
     485                 :            :                                 /* only a comment */
     486         [ +  - ]:      63280 :                                 ::rtl::OString docStr(yytext);
     487                 :      63280 :                                 docStr = docStr.copy( 0, docStr.lastIndexOf('\n') );
     488                 :      63280 :                                 docStr = docStr.copy( docStr.lastIndexOf('/')+1 );
     489                 :      63280 :                                 docStr = docStr.trim();
     490         [ +  - ]:      63280 :                                 idlc()->incLineNumber();
     491                 :            :                         }
     492                 :      63280 : 
     493                 :            : "///".*"\n"  {
     494                 :       4966 :                                 ::rtl::OString docStr(yytext);
     495         [ +  - ]:       9932 :                                 docStr = docStr.copy( 0, docStr.lastIndexOf('\n') );
     496                 :       4966 :                                 docStr = docStr.copy( docStr.lastIndexOf('/')+1 );
     497                 :       4966 :                                 docStr = docStr.trim();
     498         [ +  - ]:       4966 :                                 idlc()->incLineNumber();
     499         [ +  - ]:       4966 :                                 idlc()->setDocumentation(docStr);
     500                 :            :                         }
     501                 :       4966 : 
     502                 :    2106679 : .       return yytext[0];
     503         [ +  - ]:    2106679 : 
     504                 :            : ^#[ \t]*line[ \t]*[0-9]*" ""\""[^\"]*"\""\n    {
     505                 :     131954 :         parseLineAndFile(yytext);
     506         [ +  - ]:     131954 : }
     507                 :     131954 : 
     508                 :            : ^#[ \t]*[0-9]*" ""\""[^\"]*"\""" "[0-9]*\n {
     509                 :          0 :         parseLineAndFile(yytext);
     510         [ #  # ]:          0 : }
     511                 :          0 : 
     512                 :            : ^#[ \t]*[0-9]*" ""\""[^\"]*"\""\n {
     513                 :          0 :         parseLineAndFile(yytext);
     514         [ #  # ]:          0 : }
     515                 :          0 : 
     516                 :            : ^#[ \t]*[0-9]*\n {
     517                 :          0 :         parseLineAndFile(yytext);
     518         [ #  # ]:          0 : }
     519                 :          0 : 
     520                 :            : ^#[ \t]*ident.*\n {
     521                 :            :         /* ignore cpp ident */
     522         [ #  # ]:          0 :         idlc()->incLineNumber();
     523                 :            : }
     524                 :          0 : 
     525                 :            : ^#[ \t]*pragma[ \t].*\n        {       /* remember pragma */
     526                 :          0 :         idlParsePragma(yytext);
     527         [ #  # ]:          0 :         idlc()->incLineNumber();
     528                 :            : }
     529                 :          0 : 
     530                 :          0 : %%

Generated by: LCOV version 1.10