diff options
Diffstat (limited to 'src/declinfo.l')
-rw-r--r-- | src/declinfo.l | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/src/declinfo.l b/src/declinfo.l index af94569..014ef75 100644 --- a/src/declinfo.l +++ b/src/declinfo.l @@ -20,6 +20,9 @@ %option noyywrap %option reentrant %option extra-type="struct declinfoYY_state *" +%top{ +#include <stdint.h> +} %{ @@ -39,7 +42,9 @@ #define YY_NO_INPUT 1 #define YY_NO_UNISTD_H 1 #define YY_NEVER_INTERACTIVE 1 - + +#define USE_STATE2STRING 0 + /* ----------------------------------------------------------------- * * statics @@ -63,10 +68,13 @@ struct declinfoYY_state bool insidePHP; }; +#if USE_STATE2STRING static const char *stateToString(int state); +#endif + static void addType(yyscan_t yyscanner); static void addTypeName(yyscan_t yyscanner); -static int yyread(char *buf,int max_size, yyscan_t yyscanner); +static yy_size_t yyread(char *buf,yy_size_t max_size, yyscan_t yyscanner); /* ----------------------------------------------------------------- */ @@ -141,6 +149,7 @@ ID "$"?([a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*)|(@[0-9]+) addType(yyscanner); } <Start>{B}*"("({ID}"::")*{B}*[&*]({B}*("const"|"volatile"){B}+)? { + if (yyextra->insidePHP) REJECT; addType(yyscanner); QCString text=yytext; yyextra->type+=text.stripWhiteSpace(); @@ -234,16 +243,16 @@ static void addTypeName(yyscan_t yyscanner) yyextra->name.resize(0); } -static int yyread(char *buf,int max_size, yyscan_t yyscanner) +static yy_size_t yyread(char *buf,yy_size_t max_size, yyscan_t yyscanner) { struct yyguts_t *yyg = (struct yyguts_t*)yyscanner; - int c=0; - while( c < max_size && yyextra->inputString[yyextra->inputPosition] ) - { - *buf = yyextra->inputString[yyextra->inputPosition++] ; - c++; buf++; - } - return c; + yy_size_t c=0; + while( c < max_size && yyextra->inputString[yyextra->inputPosition] ) + { + *buf = yyextra->inputString[yyextra->inputPosition++] ; + c++; buf++; + } + return c; } /*@ public interface------------------------------------------------------------ @@ -380,5 +389,6 @@ int main() } #endif - +#if USE_STATE2STRING #include "declinfo.l.h" +#endif |