diff options
author | Timothy Pearson <[email protected]> | 2012-12-06 16:47:27 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2012-12-06 16:47:27 -0600 |
commit | 78125ea2f051107b84fdc0354acdedb7885308ee (patch) | |
tree | c162d7f55467f81a01e2e669ce297acce06b3947 /src/moc/moc_lex.cpp | |
parent | 7aa5ac7f0e76c5b87e4ca837b75b3edd522a3372 (diff) | |
download | qt3-78125ea2f051107b84fdc0354acdedb7885308ee.tar.gz qt3-78125ea2f051107b84fdc0354acdedb7885308ee.zip |
Add real threading support, including per-thread event loops, to QThread
Diffstat (limited to 'src/moc/moc_lex.cpp')
-rw-r--r-- | src/moc/moc_lex.cpp | 499 |
1 files changed, 292 insertions, 207 deletions
diff --git a/src/moc/moc_lex.cpp b/src/moc/moc_lex.cpp index bef27ad..44aa983 100644 --- a/src/moc/moc_lex.cpp +++ b/src/moc/moc_lex.cpp @@ -8,7 +8,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 31 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -30,7 +30,15 @@ /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ -#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + #include <inttypes.h> typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; @@ -45,7 +53,6 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -76,6 +83,8 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -85,11 +94,12 @@ typedef unsigned int flex_uint32_t; #else /* ! __cplusplus */ -#if __STDC__ +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) #define YY_USE_CONST -#endif /* __STDC__ */ +#endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST @@ -131,9 +141,21 @@ typedef unsigned int flex_uint32_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; @@ -165,14 +187,9 @@ extern FILE *yyin, *yyout; #define unput(c) yyunput( c, (yytext_ptr) ) -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ - #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T -typedef unsigned int yy_size_t; +typedef size_t yy_size_t; #endif #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -267,7 +284,7 @@ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ +static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches @@ -928,22 +945,22 @@ int yy_flex_debug = 0; char *yytext; #line 1 "moc.l" /**************************************************************************** -** $Id: qt/moc_lex.cpp 3.3.8 edited Feb 2 14:59 $ ** ** Lexical analyzer for meta object compiler ** ** Created : 930417 ** -** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved. +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. ** ** This file is part of the Qt GUI Toolkit. ** -** This file may be used under the terms of the GNU General Public -** License versions 2.0 or 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Alternatively you may (at your option) use any -** later version of the GNU General Public License if such license has -** been publicly approved by Trolltech ASA (or its successors, if any) +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) ** and the KDE Free Qt Foundation. ** ** Please review the following information to ensure GNU General @@ -966,7 +983,7 @@ char *yytext; ** herein. ** *****************************************************************************/ -#line 39 "moc.l" +#line 42 "moc.l" #ifdef MOC_YACC_CODE #ifdef MOC_MWERKS_PLUGIN @@ -1032,7 +1049,7 @@ extern void addExpressionChar( const char ); extern void addExpressionString( const char * ); extern void moc_warn( const char *msg ); -#line 1033 "lex.yy.c" +#line 1053 "lex.yy.c" #define INITIAL 0 #define OUTSIDE 1 @@ -1061,6 +1078,37 @@ extern void moc_warn( const char *msg ); #define YY_EXTRA_TYPE void * #endif +static int yy_init_globals (void ); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy (void ); + +int yyget_debug (void ); + +void yyset_debug (int debug_flag ); + +YY_EXTRA_TYPE yyget_extra (void ); + +void yyset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *yyget_in (void ); + +void yyset_in (FILE * in_str ); + +FILE *yyget_out (void ); + +void yyset_out (FILE * out_str ); + +int yyget_leng (void ); + +char *yyget_text (void ); + +int yyget_lineno (void ); + +void yyset_lineno (int line_number ); + /* Macros after this point can all be overridden by user definitions in * section 1. */ @@ -1095,7 +1143,12 @@ static int input (void ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -1103,7 +1156,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1199,14 +1252,14 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 110 "moc.l" +#line 113 "moc.l" -#line 1203 "lex.yy.c" +#line 1259 "lex.yy.c" - if ( (yy_init) ) + if ( !(yy_init) ) { - (yy_init) = 0; + (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; @@ -1288,126 +1341,126 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 112 "moc.l" +#line 115 "moc.l" { X; BEGIN QT_DEF; return CLASS; } YY_BREAK case 2: YY_RULE_SETUP -#line 115 "moc.l" +#line 118 "moc.l" { X; BEGIN QT_DEF; return NAMESPACE; } YY_BREAK case 3: YY_RULE_SETUP -#line 118 "moc.l" +#line 121 "moc.l" { X; BEGIN QT_DEF; return USING; } YY_BREAK case 4: YY_RULE_SETUP -#line 121 "moc.l" +#line 124 "moc.l" { X; BEGIN QT_DEF; return TEMPLATE; } YY_BREAK case 5: YY_RULE_SETUP -#line 124 "moc.l" +#line 127 "moc.l" { X; return Q_OBJECT; } YY_BREAK case 6: YY_RULE_SETUP -#line 125 "moc.l" +#line 128 "moc.l" { X; return SIGNALS; } YY_BREAK case 7: YY_RULE_SETUP -#line 126 "moc.l" +#line 129 "moc.l" { X; return SLOTS; } YY_BREAK case 8: YY_RULE_SETUP -#line 127 "moc.l" +#line 130 "moc.l" { X; return Q_CLASSINFO; } YY_BREAK case 9: YY_RULE_SETUP -#line 128 "moc.l" +#line 131 "moc.l" { X; return Q_PROPERTY; } YY_BREAK case 10: YY_RULE_SETUP -#line 129 "moc.l" +#line 132 "moc.l" { X; return Q_OVERRIDE; } YY_BREAK case 11: YY_RULE_SETUP -#line 130 "moc.l" +#line 133 "moc.l" { X; return Q_ENUMS; } YY_BREAK case 12: YY_RULE_SETUP -#line 131 "moc.l" +#line 134 "moc.l" { X; return Q_SETS; } YY_BREAK case 13: YY_RULE_SETUP -#line 133 "moc.l" +#line 136 "moc.l" { fctLevel++;Y; } YY_BREAK case 14: YY_RULE_SETUP -#line 134 "moc.l" +#line 137 "moc.l" { fctLevel--;Y;if (fctLevel==0){X;return '}';}} YY_BREAK case 15: YY_RULE_SETUP -#line 135 "moc.l" +#line 138 "moc.l" { classPLevel++;Y; } YY_BREAK case 16: YY_RULE_SETUP -#line 136 "moc.l" +#line 139 "moc.l" { classPLevel--;Y;if (classPLevel == 0) {X;return '}';} } YY_BREAK case 17: YY_RULE_SETUP -#line 138 "moc.l" +#line 141 "moc.l" { X;if( classPLevel == 1 ) return PUBLIC; } YY_BREAK case 18: YY_RULE_SETUP -#line 139 "moc.l" +#line 142 "moc.l" { X;if( classPLevel == 1 ) return PROTECTED; } YY_BREAK case 19: YY_RULE_SETUP -#line 140 "moc.l" +#line 143 "moc.l" { X;if( classPLevel == 1 ) return PRIVATE; } YY_BREAK case 20: YY_RULE_SETUP -#line 141 "moc.l" +#line 144 "moc.l" { X;if( classPLevel == 1 ) return SIGNALS; } YY_BREAK case 21: YY_RULE_SETUP -#line 142 "moc.l" +#line 145 "moc.l" { X;if( classPLevel == 1 ) return SLOTS; } YY_BREAK case 22: YY_RULE_SETUP -#line 143 "moc.l" +#line 146 "moc.l" { X;if( classPLevel == 1 ) return Q_CLASSINFO; } YY_BREAK case 23: YY_RULE_SETUP -#line 144 "moc.l" +#line 147 "moc.l" { X; if ( classPLevel == 1 ) return Q_OBJECT; @@ -1417,212 +1470,212 @@ YY_RULE_SETUP YY_BREAK case 24: YY_RULE_SETUP -#line 150 "moc.l" +#line 153 "moc.l" { X;if( classPLevel == 1 ) return Q_PROPERTY; } YY_BREAK case 25: YY_RULE_SETUP -#line 151 "moc.l" +#line 154 "moc.l" { X;if( classPLevel == 1 ) return Q_OVERRIDE; } YY_BREAK case 26: YY_RULE_SETUP -#line 152 "moc.l" +#line 155 "moc.l" { X;if( classPLevel == 1 ) return Q_ENUMS; } YY_BREAK case 27: YY_RULE_SETUP -#line 153 "moc.l" +#line 156 "moc.l" { X;if( classPLevel == 1 ) return Q_SETS; } YY_BREAK case 28: YY_RULE_SETUP -#line 155 "moc.l" +#line 158 "moc.l" { namespacePLevel++;Y; } YY_BREAK case 29: YY_RULE_SETUP -#line 156 "moc.l" +#line 159 "moc.l" { namespacePLevel--;Y;if (namespacePLevel == 0) {X;return '}';}} YY_BREAK case 30: YY_RULE_SETUP -#line 158 "moc.l" +#line 161 "moc.l" { X; BEGIN QT_DEF; return CLASS; } YY_BREAK case 31: YY_RULE_SETUP -#line 161 "moc.l" +#line 164 "moc.l" { X; BEGIN QT_DEF; return TEMPLATE; } YY_BREAK case 32: YY_RULE_SETUP -#line 164 "moc.l" +#line 167 "moc.l" { X; BEGIN QT_DEF; return NAMESPACE; } YY_BREAK case 33: YY_RULE_SETUP -#line 167 "moc.l" +#line 170 "moc.l" { X; BEGIN QT_DEF; return USING; } YY_BREAK case 34: YY_RULE_SETUP -#line 171 "moc.l" +#line 174 "moc.l" { X; return '('; } YY_BREAK case 35: YY_RULE_SETUP -#line 172 "moc.l" +#line 175 "moc.l" { X; return ')'; } YY_BREAK case 36: YY_RULE_SETUP -#line 173 "moc.l" +#line 176 "moc.l" { X; return READ; } YY_BREAK case 37: YY_RULE_SETUP -#line 174 "moc.l" +#line 177 "moc.l" { X; return WRITE; } YY_BREAK case 38: YY_RULE_SETUP -#line 175 "moc.l" +#line 178 "moc.l" { X; return STORED; } YY_BREAK case 39: YY_RULE_SETUP -#line 176 "moc.l" +#line 179 "moc.l" { X; return RESET; } YY_BREAK case 40: YY_RULE_SETUP -#line 177 "moc.l" +#line 180 "moc.l" { X; return DESIGNABLE; } YY_BREAK case 41: YY_RULE_SETUP -#line 178 "moc.l" +#line 181 "moc.l" { X; return SCRIPTABLE; } YY_BREAK case 42: YY_RULE_SETUP -#line 181 "moc.l" +#line 184 "moc.l" { expLevel++;X; } YY_BREAK case 43: YY_RULE_SETUP -#line 182 "moc.l" +#line 185 "moc.l" { expLevel--;Y;if (expLevel == 0) { X; BEGIN QT_DEF; return ')';} } YY_BREAK case 44: YY_RULE_SETUP -#line 184 "moc.l" +#line 187 "moc.l" { expLevel++;X; } YY_BREAK case 45: YY_RULE_SETUP -#line 185 "moc.l" +#line 188 "moc.l" { expLevel--;X;if (expLevel == 0) { X; BEGIN QT_DEF; return ']';} } YY_BREAK case 46: YY_RULE_SETUP -#line 187 "moc.l" +#line 190 "moc.l" { if (expLevel == 0) { X; BEGIN QT_DEF; return ',' ;} } YY_BREAK case 47: YY_RULE_SETUP -#line 189 "moc.l" +#line 192 "moc.l" { if (expLevel == 0) { X; BEGIN QT_DEF; return ';' ;} } YY_BREAK case 48: YY_RULE_SETUP -#line 191 "moc.l" +#line 194 "moc.l" { expLevel++;X; } YY_BREAK case 49: YY_RULE_SETUP -#line 192 "moc.l" +#line 195 "moc.l" { expLevel--;Y;if (expLevel == 0) { X; BEGIN QT_DEF; return ')';} } YY_BREAK case 50: YY_RULE_SETUP -#line 194 "moc.l" +#line 197 "moc.l" { expLevel++;X; } YY_BREAK case 51: YY_RULE_SETUP -#line 195 "moc.l" +#line 198 "moc.l" { expLevel--;X;if (expLevel == 0) { X; BEGIN QT_DEF; return ']';} } YY_BREAK case 52: YY_RULE_SETUP -#line 197 "moc.l" +#line 200 "moc.l" { if (expLevel <= 1) { X; BEGIN QT_DEF; return ',' ;} } YY_BREAK case 53: YY_RULE_SETUP -#line 199 "moc.l" +#line 202 "moc.l" { if (expLevel == 0) { X; BEGIN QT_DEF; return ';' ;} } YY_BREAK case 54: YY_RULE_SETUP -#line 201 "moc.l" +#line 204 "moc.l" { enumLevel++;X; } YY_BREAK case 55: YY_RULE_SETUP -#line 202 "moc.l" +#line 205 "moc.l" { enumLevel--;X; } YY_BREAK case 56: YY_RULE_SETUP -#line 203 "moc.l" +#line 206 "moc.l" { enumLevel++;X; } YY_BREAK case 57: YY_RULE_SETUP -#line 204 "moc.l" +#line 207 "moc.l" { enumLevel--;X } YY_BREAK case 58: YY_RULE_SETUP -#line 205 "moc.l" +#line 208 "moc.l" { if (enumLevel == 0) { X; BEGIN QT_DEF; return ',' ;} } YY_BREAK case 59: YY_RULE_SETUP -#line 207 "moc.l" +#line 210 "moc.l" { if (enumLevel == 0) { X; BEGIN QT_DEF; return ';' ;} } YY_BREAK case 60: YY_RULE_SETUP -#line 209 "moc.l" +#line 212 "moc.l" { if (enumLevel == 0) { X; BEGIN QT_DEF; return '}' ;} } YY_BREAK case 61: YY_RULE_SETUP -#line 211 "moc.l" +#line 214 "moc.l" { templLevel++; Y; addExpressionChar( yytext[0] ); @@ -1630,7 +1683,7 @@ YY_RULE_SETUP YY_BREAK case 62: YY_RULE_SETUP -#line 215 "moc.l" +#line 218 "moc.l" { templLevel--; Y; if ( templLevel == 0 ) { @@ -1644,187 +1697,187 @@ YY_RULE_SETUP YY_BREAK case 63: YY_RULE_SETUP -#line 225 "moc.l" +#line 228 "moc.l" { X;return FRIEND; } YY_BREAK case 64: YY_RULE_SETUP -#line 226 "moc.l" +#line 229 "moc.l" { X;return TYPEDEF; } YY_BREAK case 65: YY_RULE_SETUP -#line 227 "moc.l" +#line 230 "moc.l" { X;return AUTO; } YY_BREAK case 66: YY_RULE_SETUP -#line 228 "moc.l" +#line 231 "moc.l" { X;return REGISTER; } YY_BREAK case 67: YY_RULE_SETUP -#line 229 "moc.l" +#line 232 "moc.l" { X;return STATIC; } YY_BREAK case 68: YY_RULE_SETUP -#line 230 "moc.l" +#line 233 "moc.l" { X;return EXTERN; } YY_BREAK case 69: YY_RULE_SETUP -#line 231 "moc.l" +#line 234 "moc.l" { X;return INLINE; } YY_BREAK case 70: YY_RULE_SETUP -#line 232 "moc.l" +#line 235 "moc.l" { X;return INLINE; } YY_BREAK case 71: YY_RULE_SETUP -#line 233 "moc.l" +#line 236 "moc.l" { X;return VIRTUAL; } YY_BREAK case 72: YY_RULE_SETUP -#line 234 "moc.l" +#line 237 "moc.l" { X;return CONST; } YY_BREAK case 73: YY_RULE_SETUP -#line 235 "moc.l" +#line 238 "moc.l" { X;return VOLATILE; } YY_BREAK case 74: YY_RULE_SETUP -#line 236 "moc.l" +#line 239 "moc.l" { X;return CHAR; } YY_BREAK case 75: YY_RULE_SETUP -#line 237 "moc.l" +#line 240 "moc.l" { X;return SHORT; } YY_BREAK case 76: YY_RULE_SETUP -#line 238 "moc.l" +#line 241 "moc.l" { X;return INT; } YY_BREAK case 77: YY_RULE_SETUP -#line 239 "moc.l" +#line 242 "moc.l" { X;return LONG; } YY_BREAK case 78: YY_RULE_SETUP -#line 240 "moc.l" +#line 243 "moc.l" { X;return SIGNED; } YY_BREAK case 79: YY_RULE_SETUP -#line 241 "moc.l" +#line 244 "moc.l" { X;return UNSIGNED; } YY_BREAK case 80: YY_RULE_SETUP -#line 242 "moc.l" +#line 245 "moc.l" { X;return FLOAT; } YY_BREAK case 81: YY_RULE_SETUP -#line 243 "moc.l" +#line 246 "moc.l" { X;return DOUBLE; } YY_BREAK case 82: YY_RULE_SETUP -#line 244 "moc.l" +#line 247 "moc.l" { X;return VOID; } YY_BREAK case 83: YY_RULE_SETUP -#line 245 "moc.l" +#line 248 "moc.l" { X;return ENUM; } YY_BREAK case 84: YY_RULE_SETUP -#line 246 "moc.l" +#line 249 "moc.l" { X;return CLASS; } YY_BREAK case 85: YY_RULE_SETUP -#line 247 "moc.l" +#line 250 "moc.l" { X;return STRUCT; } YY_BREAK case 86: YY_RULE_SETUP -#line 248 "moc.l" +#line 251 "moc.l" { X;return UNION; } YY_BREAK case 87: YY_RULE_SETUP -#line 249 "moc.l" +#line 252 "moc.l" { X;return ASM; } YY_BREAK case 88: YY_RULE_SETUP -#line 250 "moc.l" +#line 253 "moc.l" { X;return PRIVATE; } YY_BREAK case 89: YY_RULE_SETUP -#line 251 "moc.l" +#line 254 "moc.l" { X;return PROTECTED; } YY_BREAK case 90: YY_RULE_SETUP -#line 252 "moc.l" +#line 255 "moc.l" { X;return PUBLIC; } YY_BREAK case 91: YY_RULE_SETUP -#line 253 "moc.l" +#line 256 "moc.l" { X;return OPERATOR; } YY_BREAK case 92: YY_RULE_SETUP -#line 254 "moc.l" +#line 257 "moc.l" { X;return DBL_COLON; } YY_BREAK case 93: YY_RULE_SETUP -#line 255 "moc.l" +#line 258 "moc.l" { X;return TRIPLE_DOT; } YY_BREAK case 94: YY_RULE_SETUP -#line 256 "moc.l" +#line 259 "moc.l" { X;return TEMPLATE; } YY_BREAK case 95: YY_RULE_SETUP -#line 257 "moc.l" +#line 260 "moc.l" { X;return MUTABLE; } YY_BREAK case 96: YY_RULE_SETUP -#line 258 "moc.l" +#line 261 "moc.l" { X;return THROW; } YY_BREAK case 97: YY_RULE_SETUP -#line 259 "moc.l" +#line 262 "moc.l" { X;return USING; } YY_BREAK case 98: YY_RULE_SETUP -#line 260 "moc.l" +#line 263 "moc.l" { X;return NAMESPACE; } YY_BREAK case 99: YY_RULE_SETUP -#line 262 "moc.l" +#line 265 "moc.l" { X; yylval.string = qstrdup(yytext); @@ -1833,7 +1886,7 @@ YY_RULE_SETUP YY_BREAK case 100: YY_RULE_SETUP -#line 268 "moc.l" +#line 271 "moc.l" { X; yylval.string = qstrdup(yytext); @@ -1842,23 +1895,23 @@ YY_RULE_SETUP YY_BREAK case 101: YY_RULE_SETUP -#line 274 "moc.l" +#line 277 "moc.l" { X; return '('; } YY_BREAK case 102: YY_RULE_SETUP -#line 275 "moc.l" +#line 278 "moc.l" { X; return ')'; } YY_BREAK case 103: YY_RULE_SETUP -#line 276 "moc.l" +#line 279 "moc.l" { X; return ','; } YY_BREAK case 104: /* rule 104 can match eol */ YY_RULE_SETUP -#line 278 "moc.l" +#line 281 "moc.l" { X; yylval.string = qstrdup( yytext + 1 ); @@ -1868,23 +1921,23 @@ YY_RULE_SETUP YY_BREAK case 105: YY_RULE_SETUP -#line 285 "moc.l" +#line 288 "moc.l" ; YY_BREAK case 106: YY_RULE_SETUP -#line 286 "moc.l" +#line 289 "moc.l" ; YY_BREAK case 107: YY_RULE_SETUP -#line 287 "moc.l" +#line 290 "moc.l" ; YY_BREAK case 108: /* rule 108 can match eol */ YY_RULE_SETUP -#line 289 "moc.l" +#line 292 "moc.l" { /* discard strings */ Z; } @@ -1892,7 +1945,7 @@ YY_RULE_SETUP case 109: /* rule 109 can match eol */ YY_RULE_SETUP -#line 293 "moc.l" +#line 296 "moc.l" { /* discard strings */ Z; } @@ -1900,7 +1953,7 @@ YY_RULE_SETUP case 110: /* rule 110 can match eol */ YY_RULE_SETUP -#line 297 "moc.l" +#line 300 "moc.l" { /* discard strings */ Z; } @@ -1908,7 +1961,7 @@ YY_RULE_SETUP case 111: /* rule 111 can match eol */ YY_RULE_SETUP -#line 301 "moc.l" +#line 304 "moc.l" { /* discard strings */ Z; addExpressionString( yytext ); @@ -1918,7 +1971,7 @@ YY_RULE_SETUP case 112: /* rule 112 can match eol */ YY_RULE_SETUP -#line 308 "moc.l" +#line 311 "moc.l" { X; addExpressionString( yytext ); @@ -1929,7 +1982,7 @@ YY_RULE_SETUP case 113: /* rule 113 can match eol */ YY_RULE_SETUP -#line 315 "moc.l" +#line 318 "moc.l" { X; yylval.string = qstrdup( yytext + 1 ); @@ -1939,7 +1992,7 @@ YY_RULE_SETUP YY_BREAK case 114: YY_RULE_SETUP -#line 322 "moc.l" +#line 325 "moc.l" { X; yylval.char_val = yytext[1]; return CHAR_VAL; @@ -1947,7 +2000,7 @@ YY_RULE_SETUP YY_BREAK case 115: YY_RULE_SETUP -#line 327 "moc.l" +#line 330 "moc.l" { X; yylval.char_val = '\a'; return CHAR_VAL; @@ -1955,7 +2008,7 @@ YY_RULE_SETUP YY_BREAK case 116: YY_RULE_SETUP -#line 332 "moc.l" +#line 335 "moc.l" { X; yylval.char_val = '\b'; return CHAR_VAL; @@ -1963,7 +2016,7 @@ YY_RULE_SETUP YY_BREAK case 117: YY_RULE_SETUP -#line 337 "moc.l" +#line 340 "moc.l" { X; yylval.char_val = '\f'; return CHAR_VAL; @@ -1971,7 +2024,7 @@ YY_RULE_SETUP YY_BREAK case 118: YY_RULE_SETUP -#line 342 "moc.l" +#line 345 "moc.l" { X; yylval.char_val = '\n'; return CHAR_VAL; @@ -1979,7 +2032,7 @@ YY_RULE_SETUP YY_BREAK case 119: YY_RULE_SETUP -#line 347 "moc.l" +#line 350 "moc.l" { X; yylval.char_val = '\r'; return CHAR_VAL; @@ -1987,7 +2040,7 @@ YY_RULE_SETUP YY_BREAK case 120: YY_RULE_SETUP -#line 352 "moc.l" +#line 355 "moc.l" { X; yylval.char_val = '\t'; return CHAR_VAL; @@ -1995,7 +2048,7 @@ YY_RULE_SETUP YY_BREAK case 121: YY_RULE_SETUP -#line 357 "moc.l" +#line 360 "moc.l" { X; yylval.char_val = '\v'; return CHAR_VAL; @@ -2003,7 +2056,7 @@ YY_RULE_SETUP YY_BREAK case 122: YY_RULE_SETUP -#line 362 "moc.l" +#line 365 "moc.l" { X; yylval.char_val = '\\'; return CHAR_VAL; @@ -2011,7 +2064,7 @@ YY_RULE_SETUP YY_BREAK case 123: YY_RULE_SETUP -#line 367 "moc.l" +#line 370 "moc.l" { X; yylval.char_val = '\?'; return CHAR_VAL; @@ -2019,7 +2072,7 @@ YY_RULE_SETUP YY_BREAK case 124: YY_RULE_SETUP -#line 372 "moc.l" +#line 375 "moc.l" { X; yylval.char_val = '\''; return CHAR_VAL; @@ -2027,7 +2080,7 @@ YY_RULE_SETUP YY_BREAK case 125: YY_RULE_SETUP -#line 377 "moc.l" +#line 380 "moc.l" { X; yylval.char_val = '\"'; /* " */ return CHAR_VAL; @@ -2035,7 +2088,7 @@ YY_RULE_SETUP YY_BREAK case 126: YY_RULE_SETUP -#line 382 "moc.l" +#line 385 "moc.l" { X; yylval.char_val = '\0'; return CHAR_VAL; @@ -2043,7 +2096,7 @@ YY_RULE_SETUP YY_BREAK case 127: YY_RULE_SETUP -#line 387 "moc.l" +#line 390 "moc.l" { X; yylval.char_val = (char)strtol( &yytext[1], 0, 8 ); @@ -2052,7 +2105,7 @@ YY_RULE_SETUP YY_BREAK case 128: YY_RULE_SETUP -#line 393 "moc.l" +#line 396 "moc.l" { X; yylval.char_val = (char)strtol( &yytext[2], 0, 16 ); @@ -2061,7 +2114,7 @@ YY_RULE_SETUP YY_BREAK case 129: YY_RULE_SETUP -#line 399 "moc.l" +#line 402 "moc.l" { X; yylval.char_val = ' '; return CHAR_VAL; @@ -2069,7 +2122,7 @@ YY_RULE_SETUP YY_BREAK case 130: YY_RULE_SETUP -#line 404 "moc.l" +#line 407 "moc.l" { X; yylval.int_val = atoi(yytext); return INT_VAL; @@ -2077,7 +2130,7 @@ YY_RULE_SETUP YY_BREAK case 131: YY_RULE_SETUP -#line 409 "moc.l" +#line 412 "moc.l" { X; yylval.double_val = atof(yytext); return DOUBLE_VAL; @@ -2085,7 +2138,7 @@ YY_RULE_SETUP YY_BREAK case 132: YY_RULE_SETUP -#line 414 "moc.l" +#line 417 "moc.l" { X; yylval.double_val = atof(yytext); return DOUBLE_VAL; @@ -2096,7 +2149,7 @@ case 133: (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 420 "moc.l" +#line 423 "moc.l" { /* skip multi-line macro-definitions */ int c, c1; input(); /* Discard the '\n'. */ @@ -2110,12 +2163,12 @@ YY_RULE_SETUP YY_BREAK case 134: YY_RULE_SETUP -#line 431 "moc.l" +#line 434 "moc.l" { /* preprocessor commands are skipped */} YY_BREAK case 135: YY_RULE_SETUP -#line 432 "moc.l" +#line 435 "moc.l" { /* C++ comment */ QCString s = yytext; if ( s.contains( "MOC_SKIP_BEGIN" ) ) { @@ -2139,7 +2192,7 @@ YY_RULE_SETUP YY_BREAK case 136: YY_RULE_SETUP -#line 452 "moc.l" +#line 455 "moc.l" { /* C comment */ int c = ' '; do { @@ -2155,12 +2208,12 @@ YY_RULE_SETUP YY_BREAK case 137: YY_RULE_SETUP -#line 465 "moc.l" +#line 468 "moc.l" { addExpressionChar( yytext[0] ); } YY_BREAK case 138: YY_RULE_SETUP -#line 467 "moc.l" +#line 470 "moc.l" { /* spaces are important in template args, e.g. Foo<const int> */ @@ -2168,52 +2221,52 @@ YY_RULE_SETUP YY_BREAK case 139: YY_RULE_SETUP -#line 471 "moc.l" +#line 474 "moc.l" ; YY_BREAK case 140: YY_RULE_SETUP -#line 472 "moc.l" +#line 475 "moc.l" ; YY_BREAK case 141: YY_RULE_SETUP -#line 473 "moc.l" +#line 476 "moc.l" ; YY_BREAK case 142: YY_RULE_SETUP -#line 474 "moc.l" +#line 477 "moc.l" ; YY_BREAK case 143: YY_RULE_SETUP -#line 475 "moc.l" +#line 478 "moc.l" { addExpressionChar( yytext[0] ); } YY_BREAK case 144: YY_RULE_SETUP -#line 476 "moc.l" +#line 479 "moc.l" ; YY_BREAK case 145: YY_RULE_SETUP -#line 477 "moc.l" +#line 480 "moc.l" { addExpressionChar( yytext[0] ); } YY_BREAK case 146: YY_RULE_SETUP -#line 478 "moc.l" +#line 481 "moc.l" ; YY_BREAK case 147: YY_RULE_SETUP -#line 479 "moc.l" +#line 482 "moc.l" ; YY_BREAK case 148: YY_RULE_SETUP -#line 480 "moc.l" +#line 483 "moc.l" { X; return yytext[0]; @@ -2221,7 +2274,7 @@ YY_RULE_SETUP YY_BREAK case 149: YY_RULE_SETUP -#line 484 "moc.l" +#line 487 "moc.l" { X; return ';'; @@ -2230,17 +2283,17 @@ YY_RULE_SETUP case 150: /* rule 150 can match eol */ YY_RULE_SETUP -#line 488 "moc.l" +#line 491 "moc.l" { lineNo++; } YY_BREAK case 151: YY_RULE_SETUP -#line 493 "moc.l" +#line 496 "moc.l" ECHO; YY_BREAK -#line 2241 "lex.yy.c" +#line 2297 "lex.yy.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(OUTSIDE): case YY_STATE_EOF(QT_DEF): @@ -2439,7 +2492,7 @@ static int yy_get_next_buffer (void) else { - size_t num_to_read = + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -2484,7 +2537,7 @@ static int yy_get_next_buffer (void) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); + (yy_n_chars), (size_t) num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -2508,6 +2561,14 @@ static int yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; @@ -2926,7 +2987,9 @@ static void yyensure_buffer_stack (void) (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); - + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; @@ -2944,6 +3007,8 @@ static void yyensure_buffer_stack (void) ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); @@ -2988,26 +3053,26 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. - * @param str a NUL-terminated string to scan + * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ -YY_BUFFER_STATE yy_scan_string (yyconst char * yy_str ) +YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) { - return yy_scan_bytes(yy_str,strlen(yy_str) ); + return yy_scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_bytes (yyconst char * bytes, int len ) +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; @@ -3015,15 +3080,15 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * bytes, int len ) int i; /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; + n = _yybytes_len + 2; buf = (char *) yyalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer(buf,n ); if ( ! b ) @@ -3144,6 +3209,34 @@ void yyset_debug (int bdebug ) yy_flex_debug = bdebug ; } +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + (yy_buffer_stack) = 0; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = (char *) 0; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = (FILE *) 0; + yyout = (FILE *) 0; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { @@ -3159,6 +3252,10 @@ int yylex_destroy (void) yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( ); + return 0; } @@ -3170,7 +3267,7 @@ int yylex_destroy (void) static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { register int i; - for ( i = 0; i < n; ++i ) + for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif @@ -3179,7 +3276,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) static int yy_flex_strlen (yyconst char * s ) { register int n; - for ( n = 0; s[n]; ++n ) + for ( n = 0; s[n]; ++n ) ; return n; @@ -3210,19 +3307,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#undef YY_NEW_FILE -#undef YY_FLUSH_BUFFER -#undef yy_set_bol -#undef yy_new_buffer -#undef yy_set_interactive -#undef yytext_ptr -#undef YY_DO_BEFORE_ACTION - -#ifdef YY_DECL_IS_OURS -#undef YY_DECL_IS_OURS -#undef YY_DECL -#endif -#line 493 "moc.l" +#line 496 "moc.l" |