File indexing completed on 2024-04-14 04:31:35
0001 #line 2 "kdev-pg-lexer.cc" 0002 0003 #line 4 "kdev-pg-lexer.cc" 0004 0005 #define YY_INT_ALIGNED short int 0006 0007 /* A lexical scanner generated by flex */ 0008 0009 #define FLEX_SCANNER 0010 #define YY_FLEX_MAJOR_VERSION 2 0011 #define YY_FLEX_MINOR_VERSION 6 0012 #define YY_FLEX_SUBMINOR_VERSION 1 0013 #if YY_FLEX_SUBMINOR_VERSION > 0 0014 #define FLEX_BETA 0015 #endif 0016 0017 /* First, we deal with platform-specific or compiler-specific issues. */ 0018 0019 /* begin standard C headers. */ 0020 #include <stdio.h> 0021 #include <string.h> 0022 #include <errno.h> 0023 #include <stdlib.h> 0024 0025 /* end standard C headers. */ 0026 0027 /* flex integer type definitions */ 0028 0029 #ifndef FLEXINT_H 0030 #define FLEXINT_H 0031 0032 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ 0033 0034 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 0035 0036 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, 0037 * if you want the limit (max/min) macros for int types. 0038 */ 0039 #ifndef __STDC_LIMIT_MACROS 0040 #define __STDC_LIMIT_MACROS 1 0041 #endif 0042 0043 #include <inttypes.h> 0044 typedef int8_t flex_int8_t; 0045 typedef uint8_t flex_uint8_t; 0046 typedef int16_t flex_int16_t; 0047 typedef uint16_t flex_uint16_t; 0048 typedef int32_t flex_int32_t; 0049 typedef uint32_t flex_uint32_t; 0050 #else 0051 typedef signed char flex_int8_t; 0052 typedef short int flex_int16_t; 0053 typedef int flex_int32_t; 0054 typedef unsigned char flex_uint8_t; 0055 typedef unsigned short int flex_uint16_t; 0056 typedef unsigned int flex_uint32_t; 0057 0058 /* Limits of integral types. */ 0059 #ifndef INT8_MIN 0060 #define INT8_MIN (-128) 0061 #endif 0062 #ifndef INT16_MIN 0063 #define INT16_MIN (-32767-1) 0064 #endif 0065 #ifndef INT32_MIN 0066 #define INT32_MIN (-2147483647-1) 0067 #endif 0068 #ifndef INT8_MAX 0069 #define INT8_MAX (127) 0070 #endif 0071 #ifndef INT16_MAX 0072 #define INT16_MAX (32767) 0073 #endif 0074 #ifndef INT32_MAX 0075 #define INT32_MAX (2147483647) 0076 #endif 0077 #ifndef UINT8_MAX 0078 #define UINT8_MAX (255U) 0079 #endif 0080 #ifndef UINT16_MAX 0081 #define UINT16_MAX (65535U) 0082 #endif 0083 #ifndef UINT32_MAX 0084 #define UINT32_MAX (4294967295U) 0085 #endif 0086 0087 #endif /* ! C99 */ 0088 0089 #endif /* ! FLEXINT_H */ 0090 0091 /* TODO: this is always defined, so inline it */ 0092 #define yyconst const 0093 0094 #if defined(__GNUC__) && __GNUC__ >= 3 0095 #define yynoreturn __attribute__((__noreturn__)) 0096 #else 0097 #define yynoreturn 0098 #endif 0099 0100 /* Returned upon end-of-file. */ 0101 #define YY_NULL 0 0102 0103 /* Promotes a possibly negative, possibly signed char to an unsigned 0104 * integer for use as an array index. If the signed char is negative, 0105 * we want to instead treat it as an 8-bit unsigned char, hence the 0106 * double cast. 0107 */ 0108 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) 0109 0110 /* Enter a start condition. This macro really ought to take a parameter, 0111 * but we do it the disgusting crufty way forced on us by the ()-less 0112 * definition of BEGIN. 0113 */ 0114 #define BEGIN (yy_start) = 1 + 2 * 0115 0116 /* Translate the current start state into a value that can be later handed 0117 * to BEGIN to return to the state. The YYSTATE alias is for lex 0118 * compatibility. 0119 */ 0120 #define YY_START (((yy_start) - 1) / 2) 0121 #define YYSTATE YY_START 0122 0123 /* Action number for EOF rule of a given start state. */ 0124 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 0125 0126 /* Special action meaning "start processing a new file". */ 0127 #define YY_NEW_FILE yyrestart(yyin ) 0128 0129 #define YY_END_OF_BUFFER_CHAR 0 0130 0131 /* Size of default input buffer. */ 0132 #ifndef YY_BUF_SIZE 0133 #ifdef __ia64__ 0134 /* On IA-64, the buffer size is 16k, not 8k. 0135 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. 0136 * Ditto for the __ia64__ case accordingly. 0137 */ 0138 #define YY_BUF_SIZE 32768 0139 #else 0140 #define YY_BUF_SIZE 16384 0141 #endif /* __ia64__ */ 0142 #endif 0143 0144 /* The state buf must be large enough to hold one state per character in the main buffer. 0145 */ 0146 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) 0147 0148 #ifndef YY_TYPEDEF_YY_BUFFER_STATE 0149 #define YY_TYPEDEF_YY_BUFFER_STATE 0150 typedef struct yy_buffer_state *YY_BUFFER_STATE; 0151 #endif 0152 0153 #ifndef YY_TYPEDEF_YY_SIZE_T 0154 #define YY_TYPEDEF_YY_SIZE_T 0155 typedef size_t yy_size_t; 0156 #endif 0157 0158 extern int yyleng; 0159 0160 extern FILE *yyin, *yyout; 0161 0162 #define EOB_ACT_CONTINUE_SCAN 0 0163 #define EOB_ACT_END_OF_FILE 1 0164 #define EOB_ACT_LAST_MATCH 2 0165 0166 #define YY_LESS_LINENO(n) 0167 #define YY_LINENO_REWIND_TO(ptr) 0168 0169 /* Return all but the first "n" matched characters back to the input stream. */ 0170 #define yyless(n) \ 0171 do \ 0172 { \ 0173 /* Undo effects of setting up yytext. */ \ 0174 int yyless_macro_arg = (n); \ 0175 YY_LESS_LINENO(yyless_macro_arg);\ 0176 *yy_cp = (yy_hold_char); \ 0177 YY_RESTORE_YY_MORE_OFFSET \ 0178 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ 0179 YY_DO_BEFORE_ACTION; /* set up yytext again */ \ 0180 } \ 0181 while ( 0 ) 0182 0183 #define unput(c) yyunput( c, (yytext_ptr) ) 0184 0185 #ifndef YY_STRUCT_YY_BUFFER_STATE 0186 #define YY_STRUCT_YY_BUFFER_STATE 0187 struct yy_buffer_state 0188 { 0189 FILE *yy_input_file; 0190 0191 char *yy_ch_buf; /* input buffer */ 0192 char *yy_buf_pos; /* current position in input buffer */ 0193 0194 /* Size of input buffer in bytes, not including room for EOB 0195 * characters. 0196 */ 0197 int yy_buf_size; 0198 0199 /* Number of characters read into yy_ch_buf, not including EOB 0200 * characters. 0201 */ 0202 int yy_n_chars; 0203 0204 /* Whether we "own" the buffer - i.e., we know we created it, 0205 * and can realloc() it to grow it, and should free() it to 0206 * delete it. 0207 */ 0208 int yy_is_our_buffer; 0209 0210 /* Whether this is an "interactive" input source; if so, and 0211 * if we're using stdio for input, then we want to use getc() 0212 * instead of fread(), to make sure we stop fetching input after 0213 * each newline. 0214 */ 0215 int yy_is_interactive; 0216 0217 /* Whether we're considered to be at the beginning of a line. 0218 * If so, '^' rules will be active on the next match, otherwise 0219 * not. 0220 */ 0221 int yy_at_bol; 0222 0223 int yy_bs_lineno; /**< The line count. */ 0224 int yy_bs_column; /**< The column count. */ 0225 0226 /* Whether to try to fill the input buffer when we reach the 0227 * end of it. 0228 */ 0229 int yy_fill_buffer; 0230 0231 int yy_buffer_status; 0232 0233 #define YY_BUFFER_NEW 0 0234 #define YY_BUFFER_NORMAL 1 0235 /* When an EOF's been seen but there's still some text to process 0236 * then we mark the buffer as YY_EOF_PENDING, to indicate that we 0237 * shouldn't try reading from the input source any more. We might 0238 * still have a bunch of tokens to match, though, because of 0239 * possible backing-up. 0240 * 0241 * When we actually see the EOF, we change the status to "new" 0242 * (via yyrestart()), so that the user can continue scanning by 0243 * just pointing yyin at a new input file. 0244 */ 0245 #define YY_BUFFER_EOF_PENDING 2 0246 0247 }; 0248 #endif /* !YY_STRUCT_YY_BUFFER_STATE */ 0249 0250 /* Stack of input buffers. */ 0251 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ 0252 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ 0253 static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ 0254 0255 /* We provide macros for accessing buffer states in case in the 0256 * future we want to put the buffer states in a more general 0257 * "scanner state". 0258 * 0259 * Returns the top of the stack, or NULL. 0260 */ 0261 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ 0262 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ 0263 : NULL) 0264 0265 /* Same as previous macro, but useful when we know that the buffer stack is not 0266 * NULL or when we need an lvalue. For internal use only. 0267 */ 0268 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] 0269 0270 /* yy_hold_char holds the character lost when yytext is formed. */ 0271 static char yy_hold_char; 0272 static int yy_n_chars; /* number of characters read into yy_ch_buf */ 0273 int yyleng; 0274 0275 /* Points to current character in buffer. */ 0276 static char *yy_c_buf_p = NULL; 0277 static int yy_init = 0; /* whether we need to initialize */ 0278 static int yy_start = 0; /* start state number */ 0279 0280 /* Flag which is used to allow yywrap()'s to do buffer switches 0281 * instead of setting up a fresh yyin. A bit of a hack ... 0282 */ 0283 static int yy_did_buffer_switch_on_eof; 0284 0285 void yyrestart (FILE *input_file ); 0286 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); 0287 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); 0288 void yy_delete_buffer (YY_BUFFER_STATE b ); 0289 void yy_flush_buffer (YY_BUFFER_STATE b ); 0290 void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); 0291 void yypop_buffer_state (void ); 0292 0293 static void yyensure_buffer_stack (void ); 0294 static void yy_load_buffer_state (void ); 0295 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); 0296 0297 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) 0298 0299 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); 0300 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); 0301 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); 0302 0303 void *yyalloc (yy_size_t ); 0304 void *yyrealloc (void *,yy_size_t ); 0305 void yyfree (void * ); 0306 0307 #define yy_new_buffer yy_create_buffer 0308 0309 #define yy_set_interactive(is_interactive) \ 0310 { \ 0311 if ( ! YY_CURRENT_BUFFER ){ \ 0312 yyensure_buffer_stack (); \ 0313 YY_CURRENT_BUFFER_LVALUE = \ 0314 yy_create_buffer(yyin,YY_BUF_SIZE ); \ 0315 } \ 0316 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ 0317 } 0318 0319 #define yy_set_bol(at_bol) \ 0320 { \ 0321 if ( ! YY_CURRENT_BUFFER ){\ 0322 yyensure_buffer_stack (); \ 0323 YY_CURRENT_BUFFER_LVALUE = \ 0324 yy_create_buffer(yyin,YY_BUF_SIZE ); \ 0325 } \ 0326 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ 0327 } 0328 0329 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) 0330 0331 /* Begin user sect3 */ 0332 0333 typedef unsigned char YY_CHAR; 0334 0335 FILE *yyin = NULL, *yyout = NULL; 0336 0337 typedef int yy_state_type; 0338 0339 extern int yylineno; 0340 0341 int yylineno = 1; 0342 0343 extern char *yytext; 0344 #ifdef yytext_ptr 0345 #undef yytext_ptr 0346 #endif 0347 #define yytext_ptr yytext 0348 0349 static yy_state_type yy_get_previous_state (void ); 0350 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); 0351 static int yy_get_next_buffer (void ); 0352 static void yynoreturn yy_fatal_error (yyconst char* msg ); 0353 0354 /* Done after the current pattern has been matched and before the 0355 * corresponding action - sets up yytext. 0356 */ 0357 #define YY_DO_BEFORE_ACTION \ 0358 (yytext_ptr) = yy_bp; \ 0359 (yytext_ptr) -= (yy_more_len); \ 0360 yyleng = (int) (yy_cp - (yytext_ptr)); \ 0361 (yy_hold_char) = *yy_cp; \ 0362 *yy_cp = '\0'; \ 0363 (yy_c_buf_p) = yy_cp; 0364 0365 #define YY_NUM_RULES 139 0366 #define YY_END_OF_BUFFER 140 0367 /* This struct is not used in this scanner, 0368 but its presence is necessary. */ 0369 struct yy_trans_info 0370 { 0371 flex_int32_t yy_verify; 0372 flex_int32_t yy_nxt; 0373 }; 0374 static yyconst flex_int16_t yy_acclist[518] = 0375 { 0, 0376 1, 1, 131, 131, 59, 59, 107, 107, 110, 110, 0377 126, 126, 140, 138, 139, 1, 138, 139, 2, 139, 0378 2, 138, 139, 138, 139, 13, 138, 139, 138, 139, 0379 22, 138, 139, 7, 138, 139, 8, 138, 139, 18, 0380 138, 139, 17, 138, 139, 11, 138, 139, 138, 139, 0381 14, 138, 139, 12, 136, 138, 139, 136, 138, 139, 0382 15, 138, 139, 4, 138, 139, 16, 138, 139, 19, 0383 138, 139, 20, 138, 139, 134, 135, 138, 139, 71, 0384 138, 139, 135, 138, 139, 135, 138, 139, 135, 138, 0385 139, 9, 138, 139, 21, 138, 139, 10, 138, 139, 0386 0387 131, 139, 130, 139, 130, 139, 132, 139, 70, 139, 0388 59, 70, 139, 60, 139, 60, 70, 139, 61, 70, 0389 139, 69, 70, 139, 70, 139, 70, 139, 70, 139, 0390 70, 139, 107, 139, 104, 139, 104, 139, 106, 139, 0391 108, 139, 109, 139, 124, 139, 110, 124, 139, 111, 0392 139, 111, 124, 139, 114, 124, 139, 124, 139, 122, 0393 124, 139, 113, 124, 139, 121, 124, 139, 122, 124, 0394 139, 123, 124, 139, 122, 124, 139, 122, 124, 139, 0395 122, 124, 139, 122, 124, 139, 122, 124, 139, 126, 0396 128, 139, 125, 139, 125, 128, 139, 127, 128, 139, 0397 0398 139, 102, 139, 73, 139, 73, 139, 139, 139, 85, 0399 139, 79, 139, 80, 139, 87, 139, 88, 139, 139, 0400 90, 139, 101, 139,16484, 76, 139, 81, 139, 89, 0401 139, 101, 139,16483,16484, 77, 139, 139, 78, 139, 0402 83, 139, 139, 82, 139, 86, 139, 1, 2, 137, 0403 52, 53, 3, 5, 6, 136, 4, 135, 134, 135, 0404 129, 135, 135, 131, 130, 132, 132, 133, 59, 60, 0405 107, 104, 105, 110, 111, 112, 122, 113, 122, 122, 0406 122, 122, 122, 122, 122, 126, 125, 73, 103, 72, 0407 91, 101,16484, 8292,16459, 76, 8291, 8292, 101,16483, 0408 0409 16484, 98, 101, 101, 101, 101, 101, 137, 3, 135, 0410 135, 105, 112, 122, 122, 122, 122, 122, 122, 103, 0411 97, 96, 72, 84, 101, 101, 101, 101, 101, 8267, 0412 101, 101, 101, 101, 74, 46, 47, 135, 68, 122, 0413 122, 118, 122, 122, 122, 122, 84, 84, 84, 84, 0414 101, 101, 101, 101, 101, 101, 101, 101, 54, 48, 0415 49, 25, 135, 122, 122, 122, 119, 122, 122, 93, 0416 84, 84, 84, 84, 101, 101, 101, 101, 101, 101, 0417 101, 58, 50, 55, 28, 62, 122, 115, 122, 122, 0418 122, 94, 95, 84, 84, 84, 84, 101, 101, 101, 0419 0420 101, 101, 101, 56, 63, 122, 122, 122, 84, 84, 0421 84, 101, 101, 101, 101, 101, 101, 57, 117, 122, 0422 122, 120, 122, 84, 84, 84, 101, 101, 101, 101, 0423 101, 101, 43, 51, 64, 116, 122, 92, 84, 84, 0424 84, 101, 101, 101, 101, 101, 30, 67, 84, 84, 0425 101, 101, 101, 37, 45, 32, 23, 66, 65, 84, 0426 84, 101, 101, 44, 31, 41, 24, 84, 101, 101, 0427 26, 33, 29, 84, 101, 101, 84, 101, 101, 40, 0428 42, 84, 101, 101, 84, 101, 101, 84, 101, 101, 0429 34, 39, 84, 101, 101, 36, 84, 101, 101, 27, 0430 0431 84, 101, 101, 84, 101, 101, 84, 101, 101, 84, 0432 101, 101, 84, 101, 38, 84, 35 0433 } ; 0434 0435 static yyconst flex_int16_t yy_accept[670] = 0436 { 0, 0437 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0438 11, 12, 13, 13, 13, 14, 16, 19, 21, 24, 0439 26, 29, 31, 34, 37, 40, 43, 46, 49, 51, 0440 54, 58, 61, 64, 67, 70, 73, 76, 80, 83, 0441 86, 89, 92, 95, 98, 101, 103, 105, 107, 109, 0442 111, 114, 116, 119, 122, 125, 127, 129, 131, 133, 0443 135, 137, 139, 141, 143, 145, 147, 150, 152, 155, 0444 158, 160, 163, 166, 169, 172, 175, 178, 181, 184, 0445 187, 190, 193, 195, 198, 201, 202, 204, 206, 208, 0446 209, 210, 212, 214, 216, 218, 220, 221, 223, 226, 0447 0448 228, 230, 232, 236, 238, 239, 241, 243, 244, 246, 0449 248, 249, 250, 250, 251, 251, 252, 253, 253, 253, 0450 253, 253, 253, 253, 253, 253, 253, 253, 254, 255, 0451 256, 257, 258, 259, 261, 262, 263, 264, 265, 266, 0452 267, 268, 269, 270, 271, 271, 271, 271, 271, 271, 0453 272, 273, 273, 274, 274, 275, 276, 277, 278, 279, 0454 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 0455 289, 290, 290, 290, 290, 290, 290, 290, 291, 292, 0456 292, 292, 294, 295, 295, 296, 296, 297, 297, 299, 0457 302, 303, 304, 305, 306, 307, 308, 308, 308, 309, 0458 0459 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 0460 309, 309, 309, 309, 309, 309, 310, 311, 312, 312, 0461 312, 312, 312, 312, 312, 312, 312, 313, 313, 314, 0462 315, 316, 317, 318, 319, 320, 320, 321, 321, 322, 0463 322, 322, 322, 323, 323, 324, 325, 325, 326, 327, 0464 328, 329, 330, 331, 331, 332, 333, 334, 335, 335, 0465 336, 336, 337, 337, 337, 337, 337, 337, 337, 337, 0466 337, 337, 338, 338, 338, 338, 338, 338, 338, 339, 0467 339, 340, 340, 340, 340, 340, 340, 340, 341, 342, 0468 344, 345, 346, 347, 347, 347, 347, 347, 348, 349, 0469 0470 350, 351, 352, 353, 354, 355, 355, 356, 357, 358, 0471 359, 359, 359, 359, 359, 359, 360, 360, 360, 360, 0472 360, 361, 361, 361, 361, 361, 362, 362, 364, 364, 0473 364, 364, 364, 364, 364, 364, 365, 366, 367, 369, 0474 370, 370, 370, 371, 371, 372, 373, 374, 375, 376, 0475 377, 378, 379, 380, 381, 382, 382, 382, 382, 382, 0476 382, 382, 382, 383, 383, 384, 384, 384, 385, 385, 0477 385, 386, 386, 386, 386, 386, 386, 386, 386, 387, 0478 388, 390, 391, 392, 392, 393, 394, 395, 396, 397, 0479 398, 399, 400, 401, 402, 403, 404, 404, 404, 404, 0480 0481 404, 404, 405, 405, 405, 405, 405, 405, 405, 405, 0482 405, 405, 405, 405, 405, 405, 405, 406, 406, 407, 0483 408, 409, 409, 410, 411, 412, 413, 414, 415, 416, 0484 417, 418, 418, 418, 418, 418, 418, 418, 419, 419, 0485 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 0486 419, 419, 419, 419, 419, 421, 422, 424, 424, 425, 0487 426, 427, 428, 429, 430, 431, 432, 433, 434, 434, 0488 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, 0489 434, 434, 435, 435, 435, 435, 435, 435, 435, 435, 0490 435, 436, 438, 439, 440, 441, 442, 443, 444, 445, 0491 0492 446, 447, 447, 447, 447, 447, 447, 447, 447, 447, 0493 447, 448, 448, 448, 448, 448, 448, 448, 448, 448, 0494 448, 448, 448, 449, 450, 451, 452, 453, 454, 454, 0495 455, 455, 455, 455, 456, 456, 456, 457, 457, 457, 0496 457, 457, 457, 457, 457, 458, 458, 459, 460, 461, 0497 462, 463, 464, 464, 464, 464, 464, 464, 464, 465, 0498 465, 465, 466, 466, 467, 467, 468, 469, 470, 471, 0499 471, 472, 472, 473, 473, 473, 473, 473, 473, 474, 0500 475, 476, 477, 477, 477, 477, 477, 477, 477, 477, 0501 477, 478, 479, 480, 480, 480, 481, 481, 481, 481, 0502 0503 481, 482, 483, 484, 485, 485, 485, 485, 485, 485, 0504 485, 486, 487, 488, 488, 488, 488, 488, 488, 488, 0505 489, 490, 491, 492, 492, 493, 493, 493, 493, 494, 0506 495, 496, 496, 496, 497, 497, 498, 499, 500, 501, 0507 501, 501, 502, 503, 504, 504, 504, 505, 506, 507, 0508 507, 507, 508, 509, 510, 510, 510, 511, 512, 513, 0509 513, 513, 514, 515, 516, 516, 517, 518, 518 0510 } ; 0511 0512 static yyconst YY_CHAR yy_ec[256] = 0513 { 0, 0514 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 0515 1, 2, 4, 1, 1, 1, 1, 1, 1, 1, 0516 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0517 1, 5, 6, 7, 8, 6, 9, 10, 6, 11, 0518 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 0519 21, 21, 21, 21, 21, 22, 22, 23, 24, 25, 0520 26, 27, 28, 29, 30, 30, 30, 31, 30, 30, 0521 32, 32, 32, 32, 32, 33, 32, 32, 34, 32, 0522 32, 35, 32, 32, 36, 32, 32, 36, 37, 32, 0523 38, 39, 40, 41, 42, 6, 43, 44, 45, 46, 0524 0525 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 0526 57, 58, 59, 60, 61, 62, 63, 64, 52, 65, 0527 66, 52, 67, 68, 69, 70, 6, 1, 1, 1, 0528 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0529 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0530 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0531 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0532 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0533 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0534 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0535 0536 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0537 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0538 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0539 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0540 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0541 1, 1, 1, 1, 1 0542 } ; 0543 0544 static yyconst YY_CHAR yy_meta[71] = 0545 { 0, 0546 1, 2, 3, 3, 4, 5, 6, 5, 5, 5, 0547 5, 5, 5, 5, 5, 7, 5, 5, 8, 8, 0548 8, 8, 9, 10, 5, 5, 5, 5, 5, 11, 0549 11, 12, 12, 12, 12, 12, 12, 6, 13, 6, 0550 5, 12, 11, 11, 11, 11, 11, 11, 12, 12, 0551 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0552 12, 12, 12, 12, 12, 12, 5, 5, 14, 5 0553 } ; 0554 0555 static yyconst flex_uint16_t yy_base[704] = 0556 { 0, 0557 0, 0, 68, 70, 73, 77, 92, 98, 138, 0, 0558 83, 100, 208, 0, 1820, 1821, 92, 1821, 1816, 76, 0559 1821, 254, 1821, 1821, 1821, 1821, 1821, 1821, 82, 1792, 0560 91, 106, 1821, 1793, 1821, 1821, 1821, 252, 1793, 0, 0561 1772, 1754, 1821, 1821, 1821, 0, 1821, 1810, 93, 1821, 0562 132, 1821, 1809, 1821, 1821, 1760, 1753, 1762, 230, 0, 0563 1821, 1805, 284, 1821, 1821, 1821, 290, 1821, 1804, 1821, 0564 1790, 0, 294, 1821, 298, 1821, 305, 309, 313, 317, 0565 323, 0, 1821, 1802, 1821, 1821, 1821, 1821, 1801, 302, 0566 259, 1821, 1821, 1821, 1821, 1821, 284, 1821, 344, 373, 0567 0568 1821, 1821, 396, 1780, 348, 1821, 1821, 0, 1821, 1821, 0569 348, 1821, 315, 1821, 333, 1821, 1821, 1741, 1750, 1735, 0570 296, 1752, 1755, 330, 1746, 1749, 312, 0, 1821, 1821, 0571 387, 1771, 0, 409, 1821, 1732, 1727, 0, 1821, 340, 0572 348, 1821, 356, 1821, 1730, 1735, 45, 57, 1746, 0, 0573 1821, 379, 1821, 384, 390, 1821, 0, 0, 391, 428, 0574 433, 437, 441, 445, 449, 453, 0, 1821, 1821, 395, 0575 1821, 397, 1746, 1731, 1731, 1743, 372, 0, 1821, 474, 0576 1746, 481, 1821, 470, 506, 1768, 521, 491, 1821, 1767, 0577 1821, 464, 522, 530, 554, 538, 1713, 482, 492, 521, 0578 0579 1719, 1724, 1721, 1720, 389, 464, 1722, 1716, 1714, 370, 0580 1725, 1714, 1728, 1711, 1717, 0, 1724, 1750, 1706, 1705, 0581 1711, 1702, 1699, 1700, 1707, 525, 527, 532, 0, 559, 0582 567, 584, 588, 593, 597, 533, 552, 555, 1821, 1704, 0583 1697, 1707, 1821, 1714, 0, 1821, 590, 475, 613, 622, 0584 646, 644, 1732, 514, 659, 666, 687, 680, 1686, 1821, 0585 1712, 1821, 1696, 1689, 1704, 1699, 1687, 1701, 1700, 320, 0586 1684, 1821, 1688, 1694, 1680, 1688, 1685, 1693, 1689, 1678, 0587 1821, 1675, 1693, 1675, 1691, 1686, 1681, 682, 650, 691, 0588 701, 705, 719, 1669, 1683, 1675, 1664, 723, 630, 0, 0589 0590 528, 730, 744, 765, 737, 549, 751, 758, 795, 782, 0591 744, 1667, 1664, 1677, 1675, 1821, 1663, 1661, 1665, 1673, 0592 1821, 1659, 1656, 1670, 1669, 1821, 1659, 0, 508, 1654, 0593 1653, 1649, 1649, 1665, 1664, 784, 808, 813, 825, 830, 0594 1657, 1647, 1821, 1659, 834, 638, 0, 548, 841, 850, 0595 871, 856, 865, 901, 887, 1662, 1639, 1656, 1640, 1659, 0596 1638, 1649, 550, 1640, 1821, 1637, 1645, 1821, 1639, 1652, 0597 1651, 1647, 1637, 1627, 1646, 1643, 1640, 1624, 1821, 877, 0598 889, 908, 915, 1629, 1821, 1821, 919, 695, 0, 563, 0599 934, 955, 941, 943, 985, 951, 1623, 1621, 1639, 1639, 0600 0601 576, 1821, 1592, 444, 1597, 1607, 583, 1583, 1599, 1573, 0602 1565, 1556, 1545, 1540, 1509, 1495, 1821, 1496, 972, 989, 0603 998, 1462, 1002, 0, 625, 1019, 1040, 1027, 1034, 1070, 0604 1056, 1475, 1461, 1460, 1444, 1436, 1425, 1821, 49, 1439, 0605 1439, 1436, 722, 1414, 1391, 1407, 1393, 1370, 1362, 1377, 0606 1358, 1356, 1290, 1300, 1058, 1077, 1083, 1298, 1087, 0, 0607 654, 1103, 1125, 1110, 1112, 720, 1119, 1821, 1301, 1296, 0608 1299, 1296, 1279, 1276, 1274, 1290, 1273, 1286, 704, 1284, 0609 1287, 1821, 1285, 1258, 1262, 1264, 1267, 1242, 1241, 1227, 0610 1821, 1140, 1821, 1144, 0, 709, 1158, 783, 1165, 784, 0611 0612 1167, 1244, 1215, 1229, 1206, 1215, 1204, 1189, 1190, 1178, 0613 1821, 1177, 1165, 1181, 1164, 1170, 1173, 1171, 1154, 1167, 0614 1143, 1144, 1821, 1169, 761, 820, 1176, 1182, 1144, 1821, 0615 1134, 1147, 1139, 1821, 1134, 1132, 1821, 1120, 1091, 1094, 0616 1080, 1089, 1067, 1078, 1821, 1067, 1821, 1821, 1821, 773, 0617 1189, 1191, 1065, 1054, 1059, 1039, 1043, 1022, 1821, 1039, 0618 1031, 1821, 1004, 1821, 1008, 1821, 799, 1197, 1203, 1002, 0619 1010, 988, 1821, 995, 984, 964, 937, 925, 1821, 845, 0620 1213, 1215, 924, 902, 856, 857, 832, 841, 836, 807, 0621 858, 1221, 1227, 811, 801, 1821, 791, 773, 777, 745, 0622 0623 1821, 863, 1229, 1237, 729, 739, 728, 697, 702, 644, 0624 893, 1239, 1245, 627, 638, 594, 583, 583, 563, 905, 0625 1251, 1253, 1821, 549, 1821, 548, 503, 500, 923, 1261, 0626 1263, 459, 431, 1821, 395, 959, 1269, 1275, 1821, 378, 0627 366, 964, 1277, 1285, 367, 356, 968, 1287, 1293, 316, 0628 308, 976, 1299, 1301, 274, 256, 993, 1309, 942, 220, 0629 82, 1006, 950, 1821, 60, 1821, 1821, 1821, 1348, 1362, 0630 1376, 1390, 1404, 1411, 1423, 1437, 1451, 1465, 1472, 1477, 0631 1489, 1503, 1516, 1526, 1025, 1540, 1554, 1568, 1582, 1596, 0632 1610, 1617, 1627, 1635, 1641, 1652, 1666, 1040, 1056, 1057, 0633 0634 1129, 1142, 1146 0635 } ; 0636 0637 static yyconst flex_int16_t yy_def[704] = 0638 { 0, 0639 668, 1, 669, 669, 670, 670, 671, 671, 668, 9, 0640 672, 672, 668, 13, 668, 668, 668, 668, 668, 673, 0641 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 0642 668, 668, 668, 668, 668, 668, 668, 674, 668, 674, 0643 674, 674, 668, 668, 668, 675, 668, 668, 676, 668, 0644 668, 668, 668, 668, 668, 668, 668, 668, 668, 677, 0645 668, 668, 678, 668, 668, 668, 668, 668, 668, 668, 0646 668, 679, 668, 668, 680, 668, 680, 680, 680, 680, 0647 680, 681, 668, 668, 668, 668, 668, 668, 668, 682, 0648 668, 668, 668, 668, 668, 668, 668, 668, 683, 668, 0649 0650 668, 668, 683, 668, 684, 668, 668, 685, 668, 668, 0651 668, 668, 673, 668, 686, 668, 668, 668, 668, 668, 0652 668, 668, 668, 668, 668, 668, 668, 687, 668, 668, 0653 668, 668, 674, 674, 668, 674, 674, 675, 668, 676, 0654 676, 668, 668, 668, 668, 668, 668, 668, 668, 677, 0655 668, 678, 668, 688, 668, 668, 689, 679, 668, 680, 0656 680, 680, 680, 680, 680, 680, 681, 668, 668, 682, 0657 668, 690, 668, 668, 668, 668, 668, 691, 668, 668, 0658 692, 683, 668, 693, 668, 668, 668, 668, 668, 103, 0659 668, 694, 694, 694, 694, 694, 695, 673, 673, 686, 0660 0661 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 0662 668, 668, 668, 668, 668, 687, 674, 674, 668, 668, 0663 668, 668, 668, 668, 668, 678, 678, 688, 689, 680, 0664 680, 680, 680, 680, 680, 682, 682, 690, 668, 668, 0665 668, 668, 668, 668, 691, 668, 696, 694, 694, 694, 0666 195, 694, 668, 697, 694, 694, 195, 694, 695, 668, 0667 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 0668 668, 668, 668, 668, 668, 668, 668, 668, 674, 668, 0669 668, 668, 668, 668, 668, 668, 668, 680, 680, 680, 0670 680, 680, 680, 668, 668, 668, 668, 668, 668, 698, 0671 0672 668, 694, 694, 251, 694, 697, 694, 694, 195, 694, 0673 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 0674 668, 668, 668, 668, 668, 668, 668, 674, 668, 668, 0675 668, 668, 668, 668, 668, 680, 680, 680, 680, 680, 0676 668, 668, 668, 668, 668, 668, 699, 668, 694, 694, 0677 251, 694, 694, 195, 694, 668, 668, 668, 668, 668, 0678 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 0679 668, 668, 668, 668, 668, 668, 668, 668, 668, 680, 0680 680, 680, 680, 668, 668, 668, 668, 668, 700, 668, 0681 694, 251, 694, 694, 195, 694, 668, 668, 668, 668, 0682 0683 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 0684 668, 668, 668, 668, 668, 668, 668, 668, 680, 680, 0685 680, 668, 668, 701, 668, 694, 251, 694, 694, 195, 0686 694, 668, 668, 668, 668, 668, 668, 668, 668, 668, 0687 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 0688 668, 668, 668, 668, 680, 680, 680, 668, 668, 702, 0689 668, 694, 251, 694, 694, 694, 694, 668, 668, 668, 0690 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 0691 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 0692 668, 680, 668, 668, 703, 668, 694, 694, 694, 694, 0693 0694 694, 668, 668, 668, 668, 668, 668, 668, 668, 668, 0695 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 0696 668, 668, 668, 668, 668, 694, 694, 694, 668, 668, 0697 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 0698 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 0699 694, 694, 668, 668, 668, 668, 668, 668, 668, 668, 0700 668, 668, 668, 668, 668, 668, 668, 694, 694, 668, 0701 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 0702 694, 694, 668, 668, 668, 668, 668, 668, 668, 668, 0703 668, 694, 694, 668, 668, 668, 668, 668, 668, 668, 0704 0705 668, 668, 694, 694, 668, 668, 668, 668, 668, 668, 0706 668, 694, 694, 668, 668, 668, 668, 668, 668, 668, 0707 694, 694, 668, 668, 668, 668, 668, 668, 668, 694, 0708 694, 668, 668, 668, 668, 668, 694, 694, 668, 668, 0709 668, 668, 694, 694, 668, 668, 668, 694, 694, 668, 0710 668, 668, 694, 694, 668, 668, 668, 694, 694, 668, 0711 668, 668, 694, 668, 668, 668, 668, 0, 668, 668, 0712 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 0713 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 0714 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 0715 0716 668, 668, 668 0717 } ; 0718 0719 static yyconst flex_uint16_t yy_nxt[1892] = 0720 { 0, 0721 16, 17, 18, 19, 17, 16, 20, 21, 22, 23, 0722 24, 25, 26, 27, 28, 29, 30, 16, 31, 32, 0723 32, 32, 33, 34, 16, 35, 16, 36, 37, 38, 0724 38, 38, 38, 38, 38, 38, 38, 39, 16, 16, 0725 16, 38, 40, 40, 41, 40, 40, 40, 40, 40, 0726 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 0727 40, 42, 40, 40, 40, 40, 43, 44, 45, 16, 0728 47, 48, 47, 48, 51, 52, 53, 51, 51, 52, 0729 53, 51, 114, 54, 55, 83, 84, 54, 55, 221, 0730 49, 474, 49, 111, 61, 62, 111, 128, 63, 475, 0731 0732 61, 62, 83, 84, 63, 222, 85, 223, 129, 131, 0733 131, 131, 131, 224, 115, 141, 56, 57, 58, 667, 0734 56, 57, 58, 85, 131, 131, 131, 131, 665, 64, 0735 59, 65, 142, 143, 59, 64, 143, 65, 66, 67, 0736 68, 69, 67, 66, 66, 70, 66, 66, 66, 66, 0737 66, 66, 66, 71, 66, 66, 72, 72, 72, 72, 0738 73, 74, 66, 66, 66, 66, 66, 75, 75, 75, 0739 75, 75, 75, 75, 75, 66, 66, 76, 66, 75, 0740 77, 75, 75, 75, 75, 75, 75, 75, 75, 75, 0741 75, 75, 78, 79, 75, 75, 75, 75, 75, 80, 0742 0743 75, 81, 75, 75, 66, 66, 66, 66, 86, 87, 0744 88, 89, 87, 86, 90, 86, 91, 92, 93, 94, 0745 95, 96, 86, 97, 98, 86, 99, 99, 99, 99, 0746 86, 100, 86, 86, 86, 101, 102, 103, 103, 103, 0747 103, 103, 103, 103, 103, 104, 105, 106, 107, 103, 0748 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 0749 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 0750 99, 99, 99, 99, 108, 109, 86, 110, 116, 664, 0751 117, 134, 134, 134, 134, 134, 134, 134, 134, 148, 0752 153, 155, 149, 134, 155, 159, 118, 119, 159, 178, 0753 0754 120, 661, 173, 174, 121, 175, 176, 122, 171, 123, 0755 179, 124, 177, 125, 126, 127, 158, 158, 158, 158, 0756 660, 114, 154, 158, 158, 158, 158, 158, 158, 158, 0757 158, 158, 158, 158, 158, 158, 158, 158, 158, 199, 0758 172, 158, 158, 158, 158, 180, 180, 180, 180, 111, 0759 656, 204, 111, 115, 213, 162, 205, 143, 214, 181, 0760 143, 655, 668, 164, 161, 166, 319, 183, 215, 163, 0761 141, 200, 208, 165, 185, 185, 185, 185, 193, 668, 0762 320, 194, 184, 195, 196, 153, 209, 668, 186, 210, 0763 227, 155, 159, 193, 155, 159, 187, 188, 188, 188, 0764 0765 188, 171, 651, 237, 194, 131, 131, 131, 131, 650, 0766 195, 181, 195, 196, 243, 646, 272, 154, 244, 189, 0767 273, 265, 228, 266, 645, 190, 190, 190, 190, 190, 0768 190, 190, 190, 172, 184, 238, 641, 190, 134, 134, 0769 134, 134, 134, 134, 134, 134, 158, 158, 158, 158, 0770 134, 158, 158, 158, 158, 158, 158, 158, 158, 158, 0771 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 0772 158, 158, 158, 158, 158, 180, 180, 180, 180, 181, 0773 640, 230, 180, 180, 180, 180, 232, 439, 114, 440, 0774 668, 231, 188, 188, 188, 188, 668, 183, 114, 233, 0775 0776 249, 234, 184, 250, 183, 251, 252, 185, 185, 185, 0777 185, 267, 235, 184, 189, 249, 185, 185, 639, 184, 0778 115, 186, 185, 185, 185, 185, 250, 199, 268, 253, 0779 115, 153, 251, 153, 251, 252, 186, 181, 227, 171, 0780 255, 255, 255, 255, 187, 181, 348, 348, 256, 256, 0781 256, 185, 185, 181, 372, 635, 258, 258, 171, 200, 0782 184, 237, 634, 154, 373, 154, 390, 390, 184, 181, 0783 228, 172, 257, 257, 257, 257, 184, 158, 158, 158, 0784 158, 425, 425, 257, 257, 158, 158, 158, 158, 633, 0785 172, 404, 184, 238, 405, 632, 257, 257, 257, 257, 0786 0787 257, 257, 158, 158, 158, 158, 158, 158, 158, 158, 0788 289, 158, 158, 158, 158, 158, 158, 158, 158, 628, 0789 298, 288, 436, 299, 443, 300, 301, 444, 668, 627, 0790 290, 302, 302, 302, 302, 298, 437, 668, 626, 292, 0791 303, 303, 303, 461, 461, 291, 299, 293, 346, 346, 0792 346, 184, 300, 625, 300, 301, 388, 388, 388, 668, 0793 184, 668, 305, 305, 304, 304, 304, 304, 158, 158, 0794 158, 158, 496, 496, 181, 304, 304, 307, 307, 307, 0795 307, 181, 184, 624, 308, 308, 308, 623, 304, 304, 0796 304, 304, 304, 304, 619, 181, 337, 184, 310, 310, 0797 0798 158, 158, 158, 158, 184, 309, 309, 309, 309, 158, 0799 158, 158, 158, 388, 388, 388, 309, 309, 184, 158, 0800 158, 158, 158, 158, 158, 158, 158, 525, 525, 309, 0801 309, 309, 309, 309, 309, 181, 336, 158, 158, 158, 0802 158, 345, 345, 345, 345, 668, 512, 618, 349, 349, 0803 349, 349, 668, 617, 513, 352, 352, 338, 184, 668, 0804 339, 340, 350, 350, 350, 479, 181, 480, 184, 353, 0805 353, 353, 353, 181, 616, 184, 308, 308, 308, 550, 0806 550, 615, 184, 351, 351, 351, 351, 356, 614, 184, 0807 357, 567, 567, 358, 351, 351, 184, 181, 668, 181, 0808 0809 355, 355, 158, 158, 158, 158, 610, 351, 351, 351, 0810 351, 351, 351, 354, 354, 354, 354, 580, 580, 609, 0811 184, 184, 184, 608, 354, 354, 158, 158, 158, 158, 0812 380, 158, 158, 158, 158, 668, 607, 354, 354, 354, 0813 354, 354, 354, 158, 158, 158, 158, 606, 158, 158, 0814 158, 158, 387, 387, 387, 387, 668, 605, 184, 391, 0815 391, 391, 391, 591, 591, 668, 601, 381, 350, 350, 0816 350, 668, 382, 383, 393, 393, 602, 602, 600, 184, 0817 181, 611, 611, 394, 394, 394, 394, 599, 184, 392, 0818 392, 392, 392, 598, 184, 158, 158, 158, 158, 597, 0819 0820 392, 392, 181, 184, 596, 396, 396, 158, 158, 158, 0821 158, 620, 620, 392, 392, 392, 392, 392, 392, 395, 0822 395, 395, 395, 629, 629, 184, 158, 158, 158, 158, 0823 395, 395, 419, 158, 158, 158, 158, 423, 423, 423, 0824 423, 636, 636, 395, 395, 395, 395, 395, 395, 668, 0825 420, 595, 426, 426, 426, 426, 668, 181, 181, 428, 0826 428, 429, 429, 429, 429, 668, 181, 594, 421, 431, 0827 431, 590, 184, 427, 427, 427, 427, 642, 642, 184, 0828 184, 184, 647, 647, 427, 427, 652, 652, 184, 184, 0829 158, 158, 158, 158, 657, 657, 589, 427, 427, 427, 0830 0831 427, 427, 427, 430, 430, 430, 430, 158, 158, 158, 0832 158, 662, 662, 588, 430, 430, 158, 158, 158, 158, 0833 459, 459, 459, 459, 666, 666, 587, 430, 430, 430, 0834 430, 430, 430, 455, 668, 197, 197, 462, 462, 462, 0835 462, 586, 668, 585, 457, 464, 464, 347, 456, 181, 0836 347, 584, 465, 465, 465, 465, 583, 184, 463, 463, 0837 463, 463, 579, 389, 424, 184, 389, 424, 578, 463, 0838 463, 181, 184, 577, 467, 467, 158, 158, 158, 158, 0839 576, 575, 463, 463, 463, 463, 463, 463, 466, 466, 0840 466, 466, 574, 573, 184, 158, 158, 158, 158, 466, 0841 0842 466, 158, 158, 158, 158, 494, 494, 494, 494, 572, 0843 571, 570, 466, 466, 466, 466, 466, 466, 668, 566, 0844 565, 497, 497, 497, 497, 668, 564, 181, 499, 499, 0845 500, 500, 500, 500, 181, 563, 460, 501, 501, 460, 0846 562, 184, 492, 498, 498, 498, 498, 561, 184, 495, 0847 184, 560, 495, 246, 498, 498, 246, 184, 158, 158, 0848 158, 158, 524, 524, 524, 524, 559, 498, 498, 498, 0849 498, 498, 498, 668, 558, 557, 526, 526, 526, 526, 0850 668, 556, 181, 527, 527, 528, 528, 549, 549, 549, 0851 549, 668, 555, 554, 551, 551, 184, 181, 553, 548, 0852 0853 552, 552, 547, 184, 668, 184, 181, 568, 568, 569, 0854 569, 546, 668, 545, 184, 581, 581, 544, 181, 543, 0855 184, 582, 582, 542, 541, 540, 539, 184, 668, 184, 0856 181, 592, 592, 593, 593, 184, 668, 538, 537, 603, 0857 603, 184, 181, 536, 668, 604, 604, 612, 612, 535, 0858 534, 184, 181, 184, 668, 613, 613, 621, 621, 184, 0859 181, 533, 532, 622, 622, 184, 668, 184, 181, 630, 0860 630, 631, 631, 531, 530, 184, 668, 184, 181, 637, 0861 637, 638, 638, 184, 668, 529, 523, 643, 643, 184, 0862 181, 184, 668, 644, 644, 648, 648, 522, 521, 184, 0863 0864 181, 184, 668, 649, 649, 653, 653, 184, 181, 520, 0865 519, 654, 654, 184, 668, 184, 181, 658, 658, 659, 0866 659, 518, 517, 184, 668, 184, 516, 663, 663, 515, 0867 514, 184, 511, 510, 509, 508, 507, 184, 506, 184, 0868 505, 504, 503, 502, 493, 491, 490, 184, 46, 46, 0869 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 0870 46, 46, 50, 50, 50, 50, 50, 50, 50, 50, 0871 50, 50, 50, 50, 50, 50, 60, 60, 60, 60, 0872 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 0873 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 0874 0875 82, 82, 82, 82, 113, 113, 489, 113, 113, 113, 0876 113, 113, 113, 113, 113, 113, 113, 113, 133, 488, 0877 487, 133, 133, 138, 138, 486, 138, 138, 138, 138, 0878 138, 485, 138, 138, 138, 138, 138, 140, 140, 484, 0879 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 0880 140, 150, 150, 483, 150, 150, 482, 150, 150, 150, 0881 150, 150, 150, 150, 150, 152, 152, 481, 152, 152, 0882 152, 152, 152, 152, 152, 152, 152, 152, 152, 158, 0883 478, 477, 158, 158, 160, 476, 473, 160, 160, 167, 0884 167, 472, 167, 167, 167, 167, 167, 167, 471, 167, 0885 0886 167, 167, 167, 170, 170, 470, 170, 170, 170, 170, 0887 170, 170, 170, 170, 170, 170, 170, 182, 182, 182, 0888 469, 468, 182, 182, 458, 182, 182, 182, 182, 192, 0889 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 0890 198, 198, 454, 198, 198, 198, 198, 198, 198, 198, 0891 198, 198, 198, 198, 216, 216, 453, 216, 216, 216, 0892 216, 216, 216, 216, 216, 216, 216, 216, 226, 226, 0893 452, 226, 226, 226, 226, 226, 226, 226, 226, 226, 0894 226, 226, 229, 229, 451, 229, 229, 229, 229, 229, 0895 229, 229, 229, 229, 229, 229, 236, 236, 450, 236, 0896 0897 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 0898 245, 245, 449, 245, 245, 245, 245, 245, 245, 245, 0899 245, 245, 245, 245, 246, 448, 447, 246, 246, 246, 0900 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 0901 248, 248, 248, 446, 445, 248, 248, 248, 259, 442, 0902 441, 259, 259, 438, 259, 246, 246, 246, 246, 246, 0903 246, 246, 246, 246, 246, 246, 306, 306, 306, 306, 0904 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 0905 435, 434, 433, 432, 422, 418, 417, 416, 415, 414, 0906 413, 412, 411, 410, 409, 408, 407, 406, 403, 402, 0907 0908 401, 400, 399, 398, 397, 386, 385, 384, 379, 378, 0909 377, 376, 375, 374, 371, 370, 369, 368, 367, 366, 0910 365, 364, 363, 362, 361, 360, 359, 344, 343, 342, 0911 341, 335, 334, 333, 332, 331, 330, 329, 328, 327, 0912 326, 325, 324, 323, 322, 321, 318, 317, 316, 315, 0913 314, 313, 312, 311, 260, 253, 297, 296, 295, 294, 0914 287, 286, 285, 284, 283, 282, 281, 280, 279, 278, 0915 277, 276, 275, 274, 271, 270, 269, 264, 263, 262, 0916 261, 260, 668, 254, 247, 242, 241, 240, 239, 225, 0917 220, 219, 218, 217, 132, 212, 211, 207, 206, 203, 0918 0919 202, 201, 191, 169, 168, 157, 156, 151, 147, 146, 0920 145, 144, 139, 137, 136, 135, 132, 130, 112, 668, 0921 15, 668, 668, 668, 668, 668, 668, 668, 668, 668, 0922 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 0923 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 0924 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 0925 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 0926 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 0927 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 0928 668 0929 0930 } ; 0931 0932 static yyconst flex_int16_t yy_chk[1892] = 0933 { 0, 0934 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0935 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0936 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0937 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0938 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0939 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0940 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0941 3, 3, 4, 4, 5, 5, 5, 5, 6, 6, 0942 6, 6, 20, 5, 5, 11, 11, 6, 6, 147, 0943 3, 439, 4, 17, 7, 7, 17, 29, 7, 439, 0944 0945 8, 8, 12, 12, 8, 147, 11, 148, 29, 31, 0946 31, 31, 31, 148, 20, 49, 5, 5, 5, 665, 0947 6, 6, 6, 12, 32, 32, 32, 32, 661, 7, 0948 5, 7, 49, 51, 6, 8, 51, 8, 9, 9, 0949 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0950 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0951 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0952 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0953 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0954 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0955 0956 9, 9, 9, 9, 9, 9, 9, 9, 13, 13, 0957 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 0958 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 0959 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 0960 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 0961 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 0962 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 0963 13, 13, 13, 13, 13, 13, 13, 13, 22, 660, 0964 22, 38, 38, 38, 38, 38, 38, 38, 38, 59, 0965 63, 67, 59, 38, 67, 73, 22, 22, 73, 97, 0966 0967 22, 656, 91, 91, 22, 91, 91, 22, 90, 22, 0968 97, 22, 91, 22, 22, 22, 75, 75, 75, 75, 0969 655, 113, 63, 77, 77, 77, 77, 78, 78, 78, 0970 78, 79, 79, 79, 79, 80, 80, 80, 80, 115, 0971 90, 81, 81, 81, 81, 99, 99, 99, 99, 111, 0972 651, 121, 111, 113, 127, 78, 121, 143, 127, 99, 0973 143, 650, 140, 80, 77, 81, 270, 99, 127, 79, 0974 141, 115, 124, 80, 100, 100, 100, 100, 105, 140, 0975 270, 105, 99, 105, 105, 152, 124, 141, 100, 124, 0976 154, 155, 159, 105, 155, 159, 100, 103, 103, 103, 0977 0978 103, 170, 646, 172, 105, 131, 131, 131, 131, 645, 0979 105, 103, 105, 105, 177, 641, 210, 152, 177, 103, 0980 210, 205, 154, 205, 640, 103, 103, 103, 103, 103, 0981 103, 103, 103, 170, 103, 172, 635, 103, 134, 134, 0982 134, 134, 134, 134, 134, 134, 160, 160, 160, 160, 0983 134, 161, 161, 161, 161, 162, 162, 162, 162, 163, 0984 163, 163, 163, 164, 164, 164, 164, 165, 165, 165, 0985 165, 166, 166, 166, 166, 180, 180, 180, 180, 192, 0986 633, 161, 182, 182, 182, 182, 163, 404, 198, 404, 0987 248, 162, 188, 188, 188, 188, 182, 180, 199, 164, 0988 0989 184, 165, 192, 184, 182, 184, 184, 185, 185, 185, 0990 185, 206, 166, 248, 188, 184, 254, 254, 632, 182, 0991 198, 185, 187, 187, 187, 187, 184, 200, 206, 185, 0992 199, 226, 184, 227, 184, 184, 187, 193, 228, 236, 0993 193, 193, 193, 193, 187, 194, 301, 301, 194, 194, 0994 194, 306, 306, 196, 329, 628, 196, 196, 237, 200, 0995 193, 238, 627, 226, 329, 227, 348, 348, 194, 195, 0996 228, 236, 195, 195, 195, 195, 196, 230, 230, 230, 0997 230, 390, 390, 195, 195, 231, 231, 231, 231, 626, 0998 237, 363, 195, 238, 363, 624, 195, 195, 195, 195, 0999 1000 195, 195, 232, 232, 232, 232, 233, 233, 233, 233, 1001 231, 234, 234, 234, 234, 235, 235, 235, 235, 619, 1002 247, 230, 401, 247, 407, 247, 247, 407, 249, 618, 1003 232, 249, 249, 249, 249, 247, 401, 250, 617, 234, 1004 250, 250, 250, 425, 425, 233, 247, 235, 299, 299, 1005 299, 249, 247, 616, 247, 247, 346, 346, 346, 252, 1006 250, 251, 252, 252, 251, 251, 251, 251, 289, 289, 1007 289, 289, 461, 461, 255, 251, 251, 255, 255, 255, 1008 255, 256, 252, 615, 256, 256, 256, 614, 251, 251, 1009 251, 251, 251, 251, 610, 258, 289, 255, 258, 258, 1010 1011 288, 288, 288, 288, 256, 257, 257, 257, 257, 290, 1012 290, 290, 290, 388, 388, 388, 257, 257, 258, 291, 1013 291, 291, 291, 292, 292, 292, 292, 496, 496, 257, 1014 257, 257, 257, 257, 257, 466, 288, 293, 293, 293, 1015 293, 298, 298, 298, 298, 302, 479, 609, 302, 302, 1016 302, 302, 305, 608, 479, 305, 305, 291, 466, 303, 1017 292, 293, 303, 303, 303, 443, 307, 443, 302, 307, 1018 307, 307, 307, 308, 607, 305, 308, 308, 308, 525, 1019 525, 606, 303, 304, 304, 304, 304, 311, 605, 307, 1020 311, 550, 550, 311, 304, 304, 308, 310, 498, 500, 1021 1022 310, 310, 336, 336, 336, 336, 600, 304, 304, 304, 1023 304, 304, 304, 309, 309, 309, 309, 567, 567, 599, 1024 310, 498, 500, 598, 309, 309, 337, 337, 337, 337, 1025 336, 338, 338, 338, 338, 526, 597, 309, 309, 309, 1026 309, 309, 309, 339, 339, 339, 339, 595, 340, 340, 1027 340, 340, 345, 345, 345, 345, 349, 594, 526, 349, 1028 349, 349, 349, 580, 580, 350, 590, 337, 350, 350, 1029 350, 352, 338, 340, 352, 352, 591, 591, 589, 349, 1030 353, 602, 602, 353, 353, 353, 353, 588, 350, 351, 1031 351, 351, 351, 587, 352, 380, 380, 380, 380, 586, 1032 1033 351, 351, 355, 353, 585, 355, 355, 381, 381, 381, 1034 381, 611, 611, 351, 351, 351, 351, 351, 351, 354, 1035 354, 354, 354, 620, 620, 355, 382, 382, 382, 382, 1036 354, 354, 380, 383, 383, 383, 383, 387, 387, 387, 1037 387, 629, 629, 354, 354, 354, 354, 354, 354, 391, 1038 382, 584, 391, 391, 391, 391, 393, 659, 394, 393, 1039 393, 394, 394, 394, 394, 663, 396, 583, 383, 396, 1040 396, 578, 391, 392, 392, 392, 392, 636, 636, 393, 1041 659, 394, 642, 642, 392, 392, 647, 647, 663, 396, 1042 419, 419, 419, 419, 652, 652, 577, 392, 392, 392, 1043 1044 392, 392, 392, 395, 395, 395, 395, 420, 420, 420, 1045 420, 657, 657, 576, 395, 395, 421, 421, 421, 421, 1046 423, 423, 423, 423, 662, 662, 575, 395, 395, 395, 1047 395, 395, 395, 419, 426, 685, 685, 426, 426, 426, 1048 426, 574, 428, 572, 421, 428, 428, 698, 420, 429, 1049 698, 571, 429, 429, 429, 429, 570, 426, 427, 427, 1050 427, 427, 565, 699, 700, 428, 699, 700, 563, 427, 1051 427, 431, 429, 561, 431, 431, 455, 455, 455, 455, 1052 560, 558, 427, 427, 427, 427, 427, 427, 430, 430, 1053 430, 430, 557, 556, 431, 456, 456, 456, 456, 430, 1054 1055 430, 457, 457, 457, 457, 459, 459, 459, 459, 555, 1056 554, 553, 430, 430, 430, 430, 430, 430, 462, 546, 1057 544, 462, 462, 462, 462, 464, 543, 465, 464, 464, 1058 465, 465, 465, 465, 467, 542, 701, 467, 467, 701, 1059 541, 462, 456, 463, 463, 463, 463, 540, 464, 702, 1060 465, 539, 702, 703, 463, 463, 703, 467, 492, 492, 1061 492, 492, 494, 494, 494, 494, 538, 463, 463, 463, 1062 463, 463, 463, 497, 536, 535, 497, 497, 497, 497, 1063 499, 533, 501, 499, 499, 501, 501, 524, 524, 524, 1064 524, 527, 532, 531, 527, 527, 497, 528, 529, 522, 1065 1066 528, 528, 521, 499, 551, 501, 552, 551, 551, 552, 1067 552, 520, 568, 519, 527, 568, 568, 518, 569, 517, 1068 528, 569, 569, 516, 515, 514, 513, 551, 581, 552, 1069 582, 581, 581, 582, 582, 568, 592, 512, 510, 592, 1070 592, 569, 593, 509, 603, 593, 593, 603, 603, 508, 1071 507, 581, 604, 582, 612, 604, 604, 612, 612, 592, 1072 613, 506, 505, 613, 613, 593, 621, 603, 622, 621, 1073 621, 622, 622, 504, 503, 604, 630, 612, 631, 630, 1074 630, 631, 631, 613, 637, 502, 490, 637, 637, 621, 1075 638, 622, 643, 638, 638, 643, 643, 489, 488, 630, 1076 1077 644, 631, 648, 644, 644, 648, 648, 637, 649, 487, 1078 486, 649, 649, 638, 653, 643, 654, 653, 653, 654, 1079 654, 485, 484, 644, 658, 648, 483, 658, 658, 481, 1080 480, 649, 478, 477, 476, 475, 474, 653, 473, 654, 1081 472, 471, 470, 469, 458, 454, 453, 658, 669, 669, 1082 669, 669, 669, 669, 669, 669, 669, 669, 669, 669, 1083 669, 669, 670, 670, 670, 670, 670, 670, 670, 670, 1084 670, 670, 670, 670, 670, 670, 671, 671, 671, 671, 1085 671, 671, 671, 671, 671, 671, 671, 671, 671, 671, 1086 672, 672, 672, 672, 672, 672, 672, 672, 672, 672, 1087 1088 672, 672, 672, 672, 673, 673, 452, 673, 673, 673, 1089 673, 673, 673, 673, 673, 673, 673, 673, 674, 451, 1090 450, 674, 674, 675, 675, 449, 675, 675, 675, 675, 1091 675, 448, 675, 675, 675, 675, 675, 676, 676, 447, 1092 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 1093 676, 677, 677, 446, 677, 677, 445, 677, 677, 677, 1094 677, 677, 677, 677, 677, 678, 678, 444, 678, 678, 1095 678, 678, 678, 678, 678, 678, 678, 678, 678, 679, 1096 442, 441, 679, 679, 680, 440, 437, 680, 680, 681, 1097 681, 436, 681, 681, 681, 681, 681, 681, 435, 681, 1098 1099 681, 681, 681, 682, 682, 434, 682, 682, 682, 682, 1100 682, 682, 682, 682, 682, 682, 682, 683, 683, 683, 1101 433, 432, 683, 683, 422, 683, 683, 683, 683, 684, 1102 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 1103 686, 686, 418, 686, 686, 686, 686, 686, 686, 686, 1104 686, 686, 686, 686, 687, 687, 416, 687, 687, 687, 1105 687, 687, 687, 687, 687, 687, 687, 687, 688, 688, 1106 415, 688, 688, 688, 688, 688, 688, 688, 688, 688, 1107 688, 688, 689, 689, 414, 689, 689, 689, 689, 689, 1108 689, 689, 689, 689, 689, 689, 690, 690, 413, 690, 1109 1110 690, 690, 690, 690, 690, 690, 690, 690, 690, 690, 1111 691, 691, 412, 691, 691, 691, 691, 691, 691, 691, 1112 691, 691, 691, 691, 692, 411, 410, 692, 692, 692, 1113 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, 1114 693, 694, 694, 409, 408, 694, 694, 694, 695, 406, 1115 405, 695, 695, 403, 695, 696, 696, 696, 696, 696, 1116 696, 696, 696, 696, 696, 696, 697, 697, 697, 697, 1117 697, 697, 697, 697, 697, 697, 697, 697, 697, 697, 1118 400, 399, 398, 397, 384, 378, 377, 376, 375, 374, 1119 373, 372, 371, 370, 369, 367, 366, 364, 362, 361, 1120 1121 360, 359, 358, 357, 356, 344, 342, 341, 335, 334, 1122 333, 332, 331, 330, 327, 325, 324, 323, 322, 320, 1123 319, 318, 317, 315, 314, 313, 312, 297, 296, 295, 1124 294, 287, 286, 285, 284, 283, 282, 280, 279, 278, 1125 277, 276, 275, 274, 273, 271, 269, 268, 267, 266, 1126 265, 264, 263, 261, 259, 253, 244, 242, 241, 240, 1127 225, 224, 223, 222, 221, 220, 219, 218, 217, 215, 1128 214, 213, 212, 211, 209, 208, 207, 204, 203, 202, 1129 201, 197, 190, 186, 181, 176, 175, 174, 173, 149, 1130 146, 145, 137, 136, 132, 126, 125, 123, 122, 120, 1131 1132 119, 118, 104, 89, 84, 71, 69, 62, 58, 57, 1133 56, 53, 48, 42, 41, 39, 34, 30, 19, 15, 1134 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 1135 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 1136 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 1137 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 1138 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 1139 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 1140 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 1141 668 1142 1143 } ; 1144 1145 extern int yy_flex_debug; 1146 int yy_flex_debug = 0; 1147 1148 static yy_state_type *yy_state_buf=0, *yy_state_ptr=0; 1149 static char *yy_full_match; 1150 static int yy_lp; 1151 static int yy_looking_for_trail_begin = 0; 1152 static int yy_full_lp; 1153 static int *yy_full_state; 1154 #define YY_TRAILING_MASK 0x2000 1155 #define YY_TRAILING_HEAD_MASK 0x4000 1156 #define REJECT \ 1157 { \ 1158 *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ \ 1159 yy_cp = (yy_full_match); /* restore poss. backed-over text */ \ 1160 (yy_lp) = (yy_full_lp); /* restore orig. accepting pos. */ \ 1161 (yy_state_ptr) = (yy_full_state); /* restore orig. state */ \ 1162 yy_current_state = *(yy_state_ptr); /* restore curr. state */ \ 1163 ++(yy_lp); \ 1164 goto find_rule; \ 1165 } 1166 1167 static int yy_more_flag = 0; 1168 static int yy_more_len = 0; 1169 #define yymore() ((yy_more_flag) = 1) 1170 #define YY_MORE_ADJ (yy_more_len) 1171 #define YY_RESTORE_YY_MORE_OFFSET 1172 char *yytext; 1173 #line 1 "kdev-pg-lexer.ll" 1174 #line 2 "kdev-pg-lexer.ll" 1175 /* This file is part of kdev-pg-qt 1176 Copyright (C) 2006 Jakob Petsovits <jpetso@gmx.at> 1177 1178 This library is free software; you can redistribute it and/or 1179 modify it under the terms of the GNU Library General Public 1180 License as published by the Free Software Foundation; either 1181 version 2 of the License, or (at your option) any later version. 1182 1183 This library is distributed in the hope that it will be useful, 1184 but WITHOUT ANY WARRANTY; without even the implied warranty of 1185 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1186 Library General Public License for more details. 1187 1188 You should have received a copy of the GNU Library General Public License 1189 along with this library; see the file COPYING.LIB. If not, write to 1190 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 1191 Boston, MA 02110-1301, USA. 1192 */ 1193 1194 #include <QDebug> 1195 1196 #include "kdev-pg.h" 1197 #include "kdev-pg-parser.hh" 1198 1199 #include <QFile> 1200 #include <QFileInfo> 1201 #include <QTextStream> 1202 1203 int inp(); 1204 void appendLineBuffer(); 1205 void newline(); 1206 void countNewlines(const char*, int); 1207 void yyerror(const char* ); 1208 extern int yyLine; 1209 extern int currentOffset; 1210 extern bool yymoreFlag; 1211 1212 namespace KDevPG 1213 { 1214 extern QFile file; 1215 extern QFileInfo fileInfo; 1216 extern QTextStream checkOut; 1217 } 1218 1219 #define YYMORE yymoreFlag = true; yymore(); 1220 1221 #define YY_INPUT(buf, result, max_size) \ 1222 { \ 1223 int c = inp(); \ 1224 result = (c == EOF) ? YY_NULL : (buf[0] = (char)c, 1); \ 1225 } 1226 1227 #define YY_USER_ACTION appendLineBuffer(); 1228 1229 #define COPY_TO_YYLVAL(string, len) \ 1230 yylval.str = (char*) calloc(len+1, sizeof(char)); \ 1231 strncpy(yylval.str, string, len); \ 1232 yylval.str[len] = '\0'; 1233 #define COPY_CODE_TO_YYLVAL(string, len) \ 1234 if(KDevPG::globalSystem.lineNumberPolicy == KDevPG::World::BeautifulCode) \ 1235 { \ 1236 COPY_TO_YYLVAL(string, len) \ 1237 } \ 1238 else \ 1239 { \ 1240 QByteArray tmp("\n#"); \ 1241 if(KDevPG::globalSystem.lineNumberPolicy == KDevPG::World::CompatibilityLineNumbers) \ 1242 tmp += "line"; \ 1243 tmp += " " + QString::number(firstCodeLine).toLocal8Bit(); \ 1244 tmp += " \"" + KDevPG::fileInfo.absoluteFilePath().toLocal8Bit() + "\""; \ 1245 if(KDevPG::globalSystem.lineNumberPolicy == KDevPG::World::FullLineNumbers) \ 1246 tmp += " 1"; \ 1247 tmp += "\n"; \ 1248 size_t memlen = tmp.size() + firstCodeColumn + len + 16 + 1; \ 1249 yylval.str = (char*) calloc(memlen, sizeof(char)); \ 1250 strncpy(yylval.str, tmp.data(), tmp.size()); \ 1251 memset(yylval.str + tmp.size(), ' ', firstCodeColumn); \ 1252 strncpy(yylval.str + tmp.size() + firstCodeColumn, string, len); \ 1253 yylval.str[memlen-1] = '\0'; \ 1254 } 1255 1256 #define ESCAPE_CHARACTER(chr) \ 1257 yylval.str = (char*) calloc(2, sizeof(char)); yylval.str[0] = chr; yylval.str[1] = '\0'; return T_STRING; 1258 1259 namespace { 1260 enum RulePosition { 1261 RuleBody, 1262 RuleFooter, 1263 RuleLexer 1264 }; 1265 RulePosition rulePosition = RuleBody; 1266 int openBrackets; // for rule arguments and regexp usage 1267 int firstCodeLine; // where the current code-block begins 1268 int firstCodeColumn; 1269 } 1270 1271 #ifdef _WIN32 1272 #include <io.h> 1273 #else 1274 #include <unistd.h> 1275 #endif 1276 1277 1278 1279 1280 1281 1282 1283 #line 1284 "kdev-pg-lexer.cc" 1284 1285 #define INITIAL 0 1286 #define CODE 1 1287 #define PARSERCLASS 2 1288 #define RULE_ARGUMENTS 3 1289 #define RULE_PARAMETERS_HEADER 4 1290 #define RULE_PARAMETERS_VARNAME 5 1291 #define RULE_LEXER 6 1292 1293 #ifndef YY_EXTRA_TYPE 1294 #define YY_EXTRA_TYPE void * 1295 #endif 1296 1297 static int yy_init_globals (void ); 1298 1299 /* Accessor methods to globals. 1300 These are made visible to non-reentrant scanners for convenience. */ 1301 1302 int yylex_destroy (void ); 1303 1304 int yyget_debug (void ); 1305 1306 void yyset_debug (int debug_flag ); 1307 1308 YY_EXTRA_TYPE yyget_extra (void ); 1309 1310 void yyset_extra (YY_EXTRA_TYPE user_defined ); 1311 1312 FILE *yyget_in (void ); 1313 1314 void yyset_in (FILE * _in_str ); 1315 1316 FILE *yyget_out (void ); 1317 1318 void yyset_out (FILE * _out_str ); 1319 1320 int yyget_leng (void ); 1321 1322 char *yyget_text (void ); 1323 1324 int yyget_lineno (void ); 1325 1326 void yyset_lineno (int _line_number ); 1327 1328 /* Macros after this point can all be overridden by user definitions in 1329 * section 1. 1330 */ 1331 1332 #ifndef YY_SKIP_YYWRAP 1333 #ifdef __cplusplus 1334 extern "C" int yywrap (void ); 1335 #else 1336 extern int yywrap (void ); 1337 #endif 1338 #endif 1339 1340 #ifndef YY_NO_UNPUT 1341 1342 static void yyunput (int c,char *buf_ptr ); 1343 1344 #endif 1345 1346 #ifndef yytext_ptr 1347 static void yy_flex_strncpy (char *,yyconst char *,int ); 1348 #endif 1349 1350 #ifdef YY_NEED_STRLEN 1351 static int yy_flex_strlen (yyconst char * ); 1352 #endif 1353 1354 #ifndef YY_NO_INPUT 1355 1356 #ifdef __cplusplus 1357 static int yyinput (void ); 1358 #else 1359 static int input (void ); 1360 #endif 1361 1362 #endif 1363 1364 /* Amount of stuff to slurp up with each read. */ 1365 #ifndef YY_READ_BUF_SIZE 1366 #ifdef __ia64__ 1367 /* On IA-64, the buffer size is 16k, not 8k */ 1368 #define YY_READ_BUF_SIZE 16384 1369 #else 1370 #define YY_READ_BUF_SIZE 8192 1371 #endif /* __ia64__ */ 1372 #endif 1373 1374 /* Copy whatever the last rule matched to the standard output. */ 1375 #ifndef ECHO 1376 /* This used to be an fputs(), but since the string might contain NUL's, 1377 * we now use fwrite(). 1378 */ 1379 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) 1380 #endif 1381 1382 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, 1383 * is returned in "result". 1384 */ 1385 #ifndef YY_INPUT 1386 #define YY_INPUT(buf,result,max_size) \ 1387 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ 1388 { \ 1389 int c = '*'; \ 1390 size_t n; \ 1391 for ( n = 0; n < max_size && \ 1392 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 1393 buf[n] = (char) c; \ 1394 if ( c == '\n' ) \ 1395 buf[n++] = (char) c; \ 1396 if ( c == EOF && ferror( yyin ) ) \ 1397 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 1398 result = n; \ 1399 } \ 1400 else \ 1401 { \ 1402 errno=0; \ 1403 while ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ 1404 { \ 1405 if( errno != EINTR) \ 1406 { \ 1407 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 1408 break; \ 1409 } \ 1410 errno=0; \ 1411 clearerr(yyin); \ 1412 } \ 1413 }\ 1414 \ 1415 1416 #endif 1417 1418 /* No semi-colon after return; correct usage is to write "yyterminate();" - 1419 * we don't want an extra ';' after the "return" because that will cause 1420 * some compilers to complain about unreachable statements. 1421 */ 1422 #ifndef yyterminate 1423 #define yyterminate() return YY_NULL 1424 #endif 1425 1426 /* Number of entries by which start-condition stack grows. */ 1427 #ifndef YY_START_STACK_INCR 1428 #define YY_START_STACK_INCR 25 1429 #endif 1430 1431 /* Report a fatal error. */ 1432 #ifndef YY_FATAL_ERROR 1433 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) 1434 #endif 1435 1436 /* end tables serialization structures and prototypes */ 1437 1438 /* Default declaration of generated scanner - a define so the user can 1439 * easily add parameters. 1440 */ 1441 #ifndef YY_DECL 1442 #define YY_DECL_IS_OURS 1 1443 1444 extern int yylex (void); 1445 1446 #define YY_DECL int yylex (void) 1447 #endif /* !YY_DECL */ 1448 1449 /* Code executed at the beginning of each rule, after yytext and yyleng 1450 * have been set up. 1451 */ 1452 #ifndef YY_USER_ACTION 1453 #define YY_USER_ACTION 1454 #endif 1455 1456 /* Code executed at the end of each rule. */ 1457 #ifndef YY_BREAK 1458 #define YY_BREAK /*LINTED*/break; 1459 #endif 1460 1461 #define YY_RULE_SETUP \ 1462 YY_USER_ACTION 1463 1464 /** The main scanner function which does all the work. 1465 */ 1466 YY_DECL 1467 { 1468 yy_state_type yy_current_state; 1469 char *yy_cp, *yy_bp; 1470 int yy_act; 1471 1472 if ( !(yy_init) ) 1473 { 1474 (yy_init) = 1; 1475 1476 #ifdef YY_USER_INIT 1477 YY_USER_INIT; 1478 #endif 1479 1480 /* Create the reject buffer large enough to save one state per allowed character. */ 1481 if ( ! (yy_state_buf) ) 1482 (yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE ); 1483 if ( ! (yy_state_buf) ) 1484 YY_FATAL_ERROR( "out of dynamic memory in yylex()" ); 1485 1486 if ( ! (yy_start) ) 1487 (yy_start) = 1; /* first start state */ 1488 1489 if ( ! yyin ) 1490 yyin = stdin; 1491 1492 if ( ! yyout ) 1493 yyout = stdout; 1494 1495 if ( ! YY_CURRENT_BUFFER ) { 1496 yyensure_buffer_stack (); 1497 YY_CURRENT_BUFFER_LVALUE = 1498 yy_create_buffer(yyin,YY_BUF_SIZE ); 1499 } 1500 1501 yy_load_buffer_state( ); 1502 } 1503 1504 { 1505 #line 118 "kdev-pg-lexer.ll" 1506 1507 1508 1509 #line 1510 "kdev-pg-lexer.cc" 1510 1511 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ 1512 { 1513 (yy_more_len) = 0; 1514 if ( (yy_more_flag) ) 1515 { 1516 (yy_more_len) = (yy_c_buf_p) - (yytext_ptr); 1517 (yy_more_flag) = 0; 1518 } 1519 yy_cp = (yy_c_buf_p); 1520 1521 /* Support of yytext. */ 1522 *yy_cp = (yy_hold_char); 1523 1524 /* yy_bp points to the position in yy_ch_buf of the start of 1525 * the current run. 1526 */ 1527 yy_bp = yy_cp; 1528 1529 yy_current_state = (yy_start); 1530 1531 (yy_state_ptr) = (yy_state_buf); 1532 *(yy_state_ptr)++ = yy_current_state; 1533 1534 yy_match: 1535 do 1536 { 1537 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; 1538 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1539 { 1540 yy_current_state = (int) yy_def[yy_current_state]; 1541 if ( yy_current_state >= 669 ) 1542 yy_c = yy_meta[(unsigned int) yy_c]; 1543 } 1544 yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; 1545 *(yy_state_ptr)++ = yy_current_state; 1546 ++yy_cp; 1547 } 1548 while ( yy_base[yy_current_state] != 1821 ); 1549 1550 yy_find_action: 1551 yy_current_state = *--(yy_state_ptr); 1552 (yy_lp) = yy_accept[yy_current_state]; 1553 find_rule: /* we branch to this label when backing up */ 1554 for ( ; ; ) /* until we find what rule we matched */ 1555 { 1556 if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] ) 1557 { 1558 yy_act = yy_acclist[(yy_lp)]; 1559 if ( yy_act & YY_TRAILING_HEAD_MASK || 1560 (yy_looking_for_trail_begin) ) 1561 { 1562 if ( yy_act == (yy_looking_for_trail_begin) ) 1563 { 1564 (yy_looking_for_trail_begin) = 0; 1565 yy_act &= ~YY_TRAILING_HEAD_MASK; 1566 break; 1567 } 1568 } 1569 else if ( yy_act & YY_TRAILING_MASK ) 1570 { 1571 (yy_looking_for_trail_begin) = yy_act & ~YY_TRAILING_MASK; 1572 (yy_looking_for_trail_begin) |= YY_TRAILING_HEAD_MASK; 1573 (yy_full_match) = yy_cp; 1574 (yy_full_state) = (yy_state_ptr); 1575 (yy_full_lp) = (yy_lp); 1576 } 1577 else 1578 { 1579 (yy_full_match) = yy_cp; 1580 (yy_full_state) = (yy_state_ptr); 1581 (yy_full_lp) = (yy_lp); 1582 break; 1583 } 1584 ++(yy_lp); 1585 goto find_rule; 1586 } 1587 --yy_cp; 1588 yy_current_state = *--(yy_state_ptr); 1589 (yy_lp) = yy_accept[yy_current_state]; 1590 } 1591 1592 YY_DO_BEFORE_ACTION; 1593 1594 do_action: /* This label is used only to access EOF actions. */ 1595 1596 switch ( yy_act ) 1597 { /* beginning of action switch */ 1598 case 1: 1599 YY_RULE_SETUP 1600 #line 121 "kdev-pg-lexer.ll" 1601 /* skip */ ; 1602 YY_BREAK 1603 case 2: 1604 /* rule 2 can match eol */ 1605 YY_RULE_SETUP 1606 #line 122 "kdev-pg-lexer.ll" 1607 newline(); 1608 YY_BREAK 1609 case 3: 1610 YY_RULE_SETUP 1611 #line 123 "kdev-pg-lexer.ll" 1612 /* line comments, skip */ ; 1613 YY_BREAK 1614 case 4: 1615 YY_RULE_SETUP 1616 #line 125 "kdev-pg-lexer.ll" 1617 rulePosition = RuleBody; return ';'; 1618 YY_BREAK 1619 case 5: 1620 YY_RULE_SETUP 1621 #line 126 "kdev-pg-lexer.ll" 1622 if(rulePosition == RuleLexer) BEGIN(RULE_LEXER); else rulePosition = RuleFooter; return T_ARROW; 1623 YY_BREAK 1624 case 6: 1625 YY_RULE_SETUP 1626 #line 127 "kdev-pg-lexer.ll" 1627 return T_INLINE; 1628 YY_BREAK 1629 case 7: 1630 YY_RULE_SETUP 1631 #line 129 "kdev-pg-lexer.ll" 1632 return '('; 1633 YY_BREAK 1634 case 8: 1635 YY_RULE_SETUP 1636 #line 130 "kdev-pg-lexer.ll" 1637 return ')'; 1638 YY_BREAK 1639 case 9: 1640 YY_RULE_SETUP 1641 #line 131 "kdev-pg-lexer.ll" 1642 return '{'; 1643 YY_BREAK 1644 case 10: 1645 YY_RULE_SETUP 1646 #line 132 "kdev-pg-lexer.ll" 1647 return '}'; 1648 YY_BREAK 1649 case 11: 1650 YY_RULE_SETUP 1651 #line 133 "kdev-pg-lexer.ll" 1652 return ','; 1653 YY_BREAK 1654 case 12: 1655 YY_RULE_SETUP 1656 #line 134 "kdev-pg-lexer.ll" 1657 return '0'; 1658 YY_BREAK 1659 case 13: 1660 YY_RULE_SETUP 1661 #line 135 "kdev-pg-lexer.ll" 1662 return '#'; 1663 YY_BREAK 1664 case 14: 1665 YY_RULE_SETUP 1666 #line 136 "kdev-pg-lexer.ll" 1667 return '.'; 1668 YY_BREAK 1669 case 15: 1670 YY_RULE_SETUP 1671 #line 137 "kdev-pg-lexer.ll" 1672 return ':'; 1673 YY_BREAK 1674 case 16: 1675 YY_RULE_SETUP 1676 #line 138 "kdev-pg-lexer.ll" 1677 return '='; 1678 YY_BREAK 1679 case 17: 1680 YY_RULE_SETUP 1681 #line 139 "kdev-pg-lexer.ll" 1682 return '+'; 1683 YY_BREAK 1684 case 18: 1685 YY_RULE_SETUP 1686 #line 140 "kdev-pg-lexer.ll" 1687 return '*'; 1688 YY_BREAK 1689 case 19: 1690 YY_RULE_SETUP 1691 #line 141 "kdev-pg-lexer.ll" 1692 return '?'; 1693 YY_BREAK 1694 case 20: 1695 YY_RULE_SETUP 1696 #line 142 "kdev-pg-lexer.ll" 1697 return '@'; 1698 YY_BREAK 1699 case 21: 1700 YY_RULE_SETUP 1701 #line 143 "kdev-pg-lexer.ll" 1702 return '|'; 1703 YY_BREAK 1704 case 22: 1705 YY_RULE_SETUP 1706 #line 144 "kdev-pg-lexer.ll" 1707 return '&'; 1708 YY_BREAK 1709 case 23: 1710 YY_RULE_SETUP 1711 #line 146 "kdev-pg-lexer.ll" 1712 return T_TRY_RECOVER; 1713 YY_BREAK 1714 case 24: 1715 YY_RULE_SETUP 1716 #line 147 "kdev-pg-lexer.ll" 1717 return T_TRY_ROLLBACK; 1718 YY_BREAK 1719 case 25: 1720 YY_RULE_SETUP 1721 #line 148 "kdev-pg-lexer.ll" 1722 return T_CATCH; 1723 YY_BREAK 1724 case 26: 1725 YY_RULE_SETUP 1726 #line 150 "kdev-pg-lexer.ll" 1727 return T_EXPORT_MACRO; 1728 YY_BREAK 1729 case 27: 1730 YY_RULE_SETUP 1731 #line 151 "kdev-pg-lexer.ll" 1732 return T_EXPORT_MACRO_HEADER; 1733 YY_BREAK 1734 case 28: 1735 YY_RULE_SETUP 1736 #line 152 "kdev-pg-lexer.ll" 1737 return T_TOKEN_DECLARATION; 1738 YY_BREAK 1739 case 29: 1740 YY_RULE_SETUP 1741 #line 153 "kdev-pg-lexer.ll" 1742 return T_TOKEN_STREAM_DECLARATION; 1743 YY_BREAK 1744 case 30: 1745 YY_RULE_SETUP 1746 #line 154 "kdev-pg-lexer.ll" 1747 return T_NAMESPACE_DECLARATION; 1748 YY_BREAK 1749 case 31: 1750 YY_RULE_SETUP 1751 #line 155 "kdev-pg-lexer.ll" 1752 BEGIN(PARSERCLASS); return T_PARSERCLASS_DECLARATION; 1753 YY_BREAK 1754 case 32: 1755 YY_RULE_SETUP 1756 #line 156 "kdev-pg-lexer.ll" 1757 BEGIN(PARSERCLASS); return T_LEXERCLASS_DECLARATION; 1758 YY_BREAK 1759 case 33: 1760 YY_RULE_SETUP 1761 #line 157 "kdev-pg-lexer.ll" 1762 return T_INPUT_STREAM; 1763 YY_BREAK 1764 case 34: 1765 YY_RULE_SETUP 1766 #line 158 "kdev-pg-lexer.ll" 1767 return T_AST_DECLARATION; 1768 YY_BREAK 1769 case 35: 1770 YY_RULE_SETUP 1771 #line 159 "kdev-pg-lexer.ll" 1772 return T_PARSER_DECLARATION_HEADER; 1773 YY_BREAK 1774 case 36: 1775 YY_RULE_SETUP 1776 #line 160 "kdev-pg-lexer.ll" 1777 return T_PARSER_BITS_HEADER; 1778 YY_BREAK 1779 case 37: 1780 YY_RULE_SETUP 1781 #line 161 "kdev-pg-lexer.ll" 1782 return T_AST_HEADER; 1783 YY_BREAK 1784 case 38: 1785 YY_RULE_SETUP 1786 #line 162 "kdev-pg-lexer.ll" 1787 return T_LEXER_DECLARATION_HEADER; 1788 YY_BREAK 1789 case 39: 1790 YY_RULE_SETUP 1791 #line 163 "kdev-pg-lexer.ll" 1792 return T_LEXER_BITS_HEADER; 1793 YY_BREAK 1794 case 40: 1795 YY_RULE_SETUP 1796 #line 164 "kdev-pg-lexer.ll" 1797 return T_INPUT_ENCODING; 1798 YY_BREAK 1799 case 41: 1800 YY_RULE_SETUP 1801 #line 165 "kdev-pg-lexer.ll" 1802 return T_TABLE_LEXER; 1803 YY_BREAK 1804 case 42: 1805 YY_RULE_SETUP 1806 #line 166 "kdev-pg-lexer.ll" 1807 return T_SEQUENCE_LEXER; 1808 YY_BREAK 1809 case 43: 1810 YY_RULE_SETUP 1811 #line 167 "kdev-pg-lexer.ll" 1812 return T_AST_BASE; 1813 YY_BREAK 1814 case 44: 1815 YY_RULE_SETUP 1816 #line 168 "kdev-pg-lexer.ll" 1817 return T_PARSER_BASE; 1818 YY_BREAK 1819 case 45: 1820 YY_RULE_SETUP 1821 #line 169 "kdev-pg-lexer.ll" 1822 return T_LEXER_BASE; 1823 YY_BREAK 1824 case 46: 1825 YY_RULE_SETUP 1826 #line 170 "kdev-pg-lexer.ll" 1827 return T_BIN; 1828 YY_BREAK 1829 case 47: 1830 YY_RULE_SETUP 1831 #line 171 "kdev-pg-lexer.ll" 1832 return T_PRE; 1833 YY_BREAK 1834 case 48: 1835 YY_RULE_SETUP 1836 #line 172 "kdev-pg-lexer.ll" 1837 return T_POST; 1838 YY_BREAK 1839 case 49: 1840 YY_RULE_SETUP 1841 #line 173 "kdev-pg-lexer.ll" 1842 return T_TERN; 1843 YY_BREAK 1844 case 50: 1845 YY_RULE_SETUP 1846 #line 174 "kdev-pg-lexer.ll" 1847 return T_PAREN; 1848 YY_BREAK 1849 case 51: 1850 YY_RULE_SETUP 1851 #line 175 "kdev-pg-lexer.ll" 1852 return T_PRIORITY; 1853 YY_BREAK 1854 case 52: 1855 YY_RULE_SETUP 1856 #line 176 "kdev-pg-lexer.ll" 1857 rulePosition = RuleBody; return T_LOPR; 1858 YY_BREAK 1859 case 53: 1860 YY_RULE_SETUP 1861 #line 177 "kdev-pg-lexer.ll" 1862 rulePosition = RuleFooter; return T_ROPR; 1863 YY_BREAK 1864 case 54: 1865 YY_RULE_SETUP 1866 #line 178 "kdev-pg-lexer.ll" 1867 return T_LEFT_ASSOC; 1868 YY_BREAK 1869 case 55: 1870 YY_RULE_SETUP 1871 #line 179 "kdev-pg-lexer.ll" 1872 return T_RIGHT_ASSOC; 1873 YY_BREAK 1874 case 56: 1875 YY_RULE_SETUP 1876 #line 180 "kdev-pg-lexer.ll" 1877 return T_IS_LEFT_ASSOC; 1878 YY_BREAK 1879 case 57: 1880 YY_RULE_SETUP 1881 #line 181 "kdev-pg-lexer.ll" 1882 return T_IS_RIGHT_ASSOC; 1883 YY_BREAK 1884 case 58: 1885 YY_RULE_SETUP 1886 #line 182 "kdev-pg-lexer.ll" 1887 rulePosition = RuleLexer; return T_LEXER; 1888 YY_BREAK 1889 1890 case 59: 1891 YY_RULE_SETUP 1892 #line 185 "kdev-pg-lexer.ll" 1893 /* skip */ ; 1894 YY_BREAK 1895 case 60: 1896 /* rule 60 can match eol */ 1897 YY_RULE_SETUP 1898 #line 186 "kdev-pg-lexer.ll" 1899 newline(); 1900 YY_BREAK 1901 case 61: 1902 YY_RULE_SETUP 1903 #line 187 "kdev-pg-lexer.ll" 1904 return '('; 1905 YY_BREAK 1906 case 62: 1907 YY_RULE_SETUP 1908 #line 188 "kdev-pg-lexer.ll" 1909 return T_PUBLIC; 1910 YY_BREAK 1911 case 63: 1912 YY_RULE_SETUP 1913 #line 189 "kdev-pg-lexer.ll" 1914 return T_PRIVATE; 1915 YY_BREAK 1916 case 64: 1917 YY_RULE_SETUP 1918 #line 190 "kdev-pg-lexer.ll" 1919 return T_PROTECTED; 1920 YY_BREAK 1921 case 65: 1922 YY_RULE_SETUP 1923 #line 191 "kdev-pg-lexer.ll" 1924 return T_DECLARATION; 1925 YY_BREAK 1926 case 66: 1927 YY_RULE_SETUP 1928 #line 192 "kdev-pg-lexer.ll" 1929 return T_CONSTRUCTOR; 1930 YY_BREAK 1931 case 67: 1932 YY_RULE_SETUP 1933 #line 193 "kdev-pg-lexer.ll" 1934 return T_DESTRUCTOR; 1935 YY_BREAK 1936 case 68: 1937 YY_RULE_SETUP 1938 #line 194 "kdev-pg-lexer.ll" 1939 return T_BITS; 1940 YY_BREAK 1941 case 69: 1942 YY_RULE_SETUP 1943 #line 195 "kdev-pg-lexer.ll" 1944 BEGIN(INITIAL); return ')'; 1945 YY_BREAK 1946 case 70: 1947 YY_RULE_SETUP 1948 #line 196 "kdev-pg-lexer.ll" 1949 BEGIN(INITIAL); REJECT; /* everything else */ 1950 YY_BREAK 1951 1952 case 71: 1953 YY_RULE_SETUP 1954 #line 200 "kdev-pg-lexer.ll" 1955 { 1956 if (rulePosition == RuleBody) { /* use the arguments in a rule call */ 1957 firstCodeLine = yyLine; 1958 openBrackets = 0; 1959 BEGIN(RULE_ARGUMENTS); 1960 } 1961 else if (rulePosition == RuleFooter) { /* declare the arguments */ 1962 BEGIN(RULE_PARAMETERS_HEADER); return '['; 1963 } 1964 } 1965 YY_BREAK 1966 1967 case 72: 1968 YY_RULE_SETUP 1969 #line 212 "kdev-pg-lexer.ll" 1970 /* line comments, skip */ ; 1971 YY_BREAK 1972 case 73: 1973 /* rule 73 can match eol */ 1974 YY_RULE_SETUP 1975 #line 213 "kdev-pg-lexer.ll" 1976 newline(); 1977 YY_BREAK 1978 case 74: 1979 YY_RULE_SETUP 1980 #line 214 "kdev-pg-lexer.ll" 1981 ++yytext; COPY_TO_YYLVAL(yytext,yyleng-2); return T_NAMED_REGEXP; 1982 YY_BREAK 1983 case 75: 1984 /* rule 75 can match eol */ 1985 YY_RULE_SETUP 1986 #line 215 "kdev-pg-lexer.ll" 1987 countNewlines(yytext, yyleng); rulePosition = RuleBody; BEGIN(INITIAL); return ';'; 1988 YY_BREAK 1989 case 76: 1990 YY_RULE_SETUP 1991 #line 216 "kdev-pg-lexer.ll" 1992 return ';'; 1993 YY_BREAK 1994 case 77: 1995 YY_RULE_SETUP 1996 #line 217 "kdev-pg-lexer.ll" 1997 ++openBrackets; return '['; 1998 YY_BREAK 1999 case 78: 2000 YY_RULE_SETUP 2001 #line 218 "kdev-pg-lexer.ll" 2002 --openBrackets; return ']'; 2003 YY_BREAK 2004 case 79: 2005 YY_RULE_SETUP 2006 #line 219 "kdev-pg-lexer.ll" 2007 ++openBrackets; return '('; 2008 YY_BREAK 2009 case 80: 2010 YY_RULE_SETUP 2011 #line 220 "kdev-pg-lexer.ll" 2012 --openBrackets; return ')'; 2013 YY_BREAK 2014 case 81: 2015 YY_RULE_SETUP 2016 #line 221 "kdev-pg-lexer.ll" 2017 return '?'; 2018 YY_BREAK 2019 case 82: 2020 YY_RULE_SETUP 2021 #line 222 "kdev-pg-lexer.ll" 2022 return '|'; 2023 YY_BREAK 2024 case 83: 2025 YY_RULE_SETUP 2026 #line 223 "kdev-pg-lexer.ll" 2027 return '^'; 2028 YY_BREAK 2029 case 84: 2030 YY_RULE_SETUP 2031 #line 224 "kdev-pg-lexer.ll" 2032 COPY_TO_YYLVAL(yytext,yyleng); return T_RANGE; 2033 YY_BREAK 2034 case 85: 2035 YY_RULE_SETUP 2036 #line 225 "kdev-pg-lexer.ll" 2037 return '&'; 2038 YY_BREAK 2039 case 86: 2040 YY_RULE_SETUP 2041 #line 226 "kdev-pg-lexer.ll" 2042 return '~'; 2043 YY_BREAK 2044 case 87: 2045 YY_RULE_SETUP 2046 #line 227 "kdev-pg-lexer.ll" 2047 return '*'; 2048 YY_BREAK 2049 case 88: 2050 YY_RULE_SETUP 2051 #line 228 "kdev-pg-lexer.ll" 2052 return '+'; 2053 YY_BREAK 2054 case 89: 2055 YY_RULE_SETUP 2056 #line 229 "kdev-pg-lexer.ll" 2057 return '@'; 2058 YY_BREAK 2059 case 90: 2060 YY_RULE_SETUP 2061 #line 230 "kdev-pg-lexer.ll" 2062 return '.'; 2063 YY_BREAK 2064 case 91: 2065 YY_RULE_SETUP 2066 #line 231 "kdev-pg-lexer.ll" 2067 return T_ARROW; 2068 YY_BREAK 2069 case 92: 2070 YY_RULE_SETUP 2071 #line 232 "kdev-pg-lexer.ll" 2072 return T_CONTINUE; 2073 YY_BREAK 2074 case 93: 2075 YY_RULE_SETUP 2076 #line 233 "kdev-pg-lexer.ll" 2077 return T_FAIL; 2078 YY_BREAK 2079 case 94: 2080 YY_RULE_SETUP 2081 #line 234 "kdev-pg-lexer.ll" 2082 return T_ENTER_RULE_SET; 2083 YY_BREAK 2084 case 95: 2085 YY_RULE_SETUP 2086 #line 235 "kdev-pg-lexer.ll" 2087 return T_LEAVE_RULE_SET; 2088 YY_BREAK 2089 case 96: 2090 YY_RULE_SETUP 2091 #line 236 "kdev-pg-lexer.ll" 2092 return T_LOOKAHEAD; 2093 YY_BREAK 2094 case 97: 2095 YY_RULE_SETUP 2096 #line 237 "kdev-pg-lexer.ll" 2097 return T_BARRIER; 2098 YY_BREAK 2099 case 98: 2100 YY_RULE_SETUP 2101 #line 238 "kdev-pg-lexer.ll" 2102 firstCodeLine = yyLine; firstCodeColumn = currentOffset + 2; BEGIN(CODE); 2103 YY_BREAK 2104 case 99: 2105 /* rule 99 can match eol */ 2106 YY_RULE_SETUP 2107 #line 239 "kdev-pg-lexer.ll" 2108 COPY_TO_YYLVAL(yytext,yyleng); return T_TERMINAL; 2109 YY_BREAK 2110 case 100: 2111 /* rule 100 can match eol */ 2112 YY_RULE_SETUP 2113 #line 240 "kdev-pg-lexer.ll" 2114 COPY_TO_YYLVAL(yytext,yyleng); return T_IDENTIFIER; 2115 YY_BREAK 2116 case 101: 2117 YY_RULE_SETUP 2118 #line 241 "kdev-pg-lexer.ll" 2119 COPY_TO_YYLVAL(yytext,yyleng); return T_UNQUOTED_STRING; 2120 YY_BREAK 2121 case 102: 2122 YY_RULE_SETUP 2123 #line 242 "kdev-pg-lexer.ll" 2124 /* skip */ 2125 YY_BREAK 2126 case 103: 2127 YY_RULE_SETUP 2128 #line 243 "kdev-pg-lexer.ll" 2129 yytext++; COPY_TO_YYLVAL(yytext,yyleng-2); return T_STRING; 2130 YY_BREAK 2131 case YY_STATE_EOF(RULE_LEXER): 2132 #line 245 "kdev-pg-lexer.ll" 2133 { 2134 BEGIN(INITIAL); // is not set automatically by yyrestart() 2135 KDevPG::checkOut << "** ERROR Encountered end of file in an unclosed rule lexer definition..." << Qt::endl; 2136 yyerror(""); 2137 return 0; 2138 } 2139 YY_BREAK 2140 2141 2142 case 104: 2143 /* rule 104 can match eol */ 2144 YY_RULE_SETUP 2145 #line 254 "kdev-pg-lexer.ll" 2146 newline(); YYMORE; 2147 YY_BREAK 2148 case 105: 2149 YY_RULE_SETUP 2150 #line 255 "kdev-pg-lexer.ll" 2151 YYMORE; /* this and... */ 2152 YY_BREAK 2153 case 106: 2154 YY_RULE_SETUP 2155 #line 256 "kdev-pg-lexer.ll" 2156 YYMORE; /* ...this prevent brackets inside strings to be counted */ 2157 YY_BREAK 2158 case 107: 2159 YY_RULE_SETUP 2160 #line 257 "kdev-pg-lexer.ll" 2161 YYMORE; /* gather everything that's not a bracket, and append what comes next */ 2162 YY_BREAK 2163 case 108: 2164 YY_RULE_SETUP 2165 #line 258 "kdev-pg-lexer.ll" 2166 openBrackets++; YYMORE; 2167 YY_BREAK 2168 case 109: 2169 YY_RULE_SETUP 2170 #line 259 "kdev-pg-lexer.ll" 2171 { 2172 openBrackets--; 2173 if (openBrackets < 0) { 2174 COPY_CODE_TO_YYLVAL(yytext,(yyleng-1)); /* cut off the trailing bracket */ 2175 BEGIN(INITIAL); 2176 return T_RULE_ARGUMENTS; 2177 } 2178 } 2179 YY_BREAK 2180 case YY_STATE_EOF(RULE_ARGUMENTS): 2181 #line 267 "kdev-pg-lexer.ll" 2182 { 2183 BEGIN(INITIAL); // is not set automatically by yyrestart() 2184 KDevPG::checkOut << "** ERROR Encountered end of file in an unclosed rule argument specification..." << Qt::endl; 2185 yyerror(""); 2186 return 0; 2187 } 2188 YY_BREAK 2189 2190 2191 case 110: 2192 YY_RULE_SETUP 2193 #line 276 "kdev-pg-lexer.ll" 2194 /* skip */ ; 2195 YY_BREAK 2196 case 111: 2197 /* rule 111 can match eol */ 2198 YY_RULE_SETUP 2199 #line 277 "kdev-pg-lexer.ll" 2200 newline(); 2201 YY_BREAK 2202 case 112: 2203 YY_RULE_SETUP 2204 #line 278 "kdev-pg-lexer.ll" 2205 /* line comments, skip */ ; 2206 YY_BREAK 2207 case 113: 2208 YY_RULE_SETUP 2209 #line 279 "kdev-pg-lexer.ll" 2210 BEGIN(RULE_PARAMETERS_VARNAME); return ':'; 2211 YY_BREAK 2212 case 114: 2213 YY_RULE_SETUP 2214 #line 280 "kdev-pg-lexer.ll" 2215 return '#'; 2216 YY_BREAK 2217 case 115: 2218 YY_RULE_SETUP 2219 #line 281 "kdev-pg-lexer.ll" 2220 return T_MEMBER; 2221 YY_BREAK 2222 case 116: 2223 YY_RULE_SETUP 2224 #line 282 "kdev-pg-lexer.ll" 2225 return T_TEMPORARY; 2226 YY_BREAK 2227 case 117: 2228 YY_RULE_SETUP 2229 #line 283 "kdev-pg-lexer.ll" 2230 return T_ARGUMENT; 2231 YY_BREAK 2232 case 118: 2233 YY_RULE_SETUP 2234 #line 284 "kdev-pg-lexer.ll" 2235 return T_NODE; 2236 YY_BREAK 2237 case 119: 2238 YY_RULE_SETUP 2239 #line 285 "kdev-pg-lexer.ll" 2240 return T_TOKEN; 2241 YY_BREAK 2242 case 120: 2243 YY_RULE_SETUP 2244 #line 286 "kdev-pg-lexer.ll" 2245 return T_VARIABLE; 2246 YY_BREAK 2247 case 121: 2248 YY_RULE_SETUP 2249 #line 287 "kdev-pg-lexer.ll" 2250 return ';'; /* only used for "token" types */ 2251 YY_BREAK 2252 case 122: 2253 YY_RULE_SETUP 2254 #line 288 "kdev-pg-lexer.ll" 2255 COPY_TO_YYLVAL(yytext,yyleng); return T_IDENTIFIER; 2256 YY_BREAK 2257 case 123: 2258 YY_RULE_SETUP 2259 #line 289 "kdev-pg-lexer.ll" 2260 BEGIN(INITIAL); return ']'; 2261 YY_BREAK 2262 case 124: 2263 YY_RULE_SETUP 2264 #line 290 "kdev-pg-lexer.ll" 2265 BEGIN(INITIAL); REJECT; /* everything else */ 2266 YY_BREAK 2267 2268 2269 case 125: 2270 /* rule 125 can match eol */ 2271 YY_RULE_SETUP 2272 #line 294 "kdev-pg-lexer.ll" 2273 newline(); YYMORE; 2274 YY_BREAK 2275 case 126: 2276 YY_RULE_SETUP 2277 #line 295 "kdev-pg-lexer.ll" 2278 YYMORE; /* gather everything that's not a semicolon, and append what comes next */ 2279 YY_BREAK 2280 case 127: 2281 YY_RULE_SETUP 2282 #line 296 "kdev-pg-lexer.ll" 2283 { 2284 // strip trailing whitespace 2285 int length = yyleng-1; // and first, the trailing semicolon 2286 for (int i = length-1; i < 1; i--) { 2287 switch(yytext[i-1]) 2288 { 2289 case ' ': 2290 case '\f': 2291 case '\t': 2292 continue; 2293 default: 2294 length = i; 2295 break; 2296 } 2297 } 2298 COPY_TO_YYLVAL(yytext,length); 2299 BEGIN(RULE_PARAMETERS_HEADER); 2300 return T_IDENTIFIER; 2301 } 2302 YY_BREAK 2303 case 128: 2304 YY_RULE_SETUP 2305 #line 315 "kdev-pg-lexer.ll" 2306 BEGIN(INITIAL); REJECT; /* everything else */ 2307 YY_BREAK 2308 2309 case 129: 2310 YY_RULE_SETUP 2311 #line 319 "kdev-pg-lexer.ll" 2312 firstCodeLine = yyLine; firstCodeColumn = currentOffset + 2; BEGIN(CODE); 2313 YY_BREAK 2314 2315 case 130: 2316 /* rule 130 can match eol */ 2317 YY_RULE_SETUP 2318 #line 321 "kdev-pg-lexer.ll" 2319 newline(); YYMORE; 2320 YY_BREAK 2321 case 131: 2322 YY_RULE_SETUP 2323 #line 322 "kdev-pg-lexer.ll" 2324 YYMORE; /* gather everything that's not a colon, and append what comes next */ 2325 YY_BREAK 2326 case 132: 2327 YY_RULE_SETUP 2328 #line 323 "kdev-pg-lexer.ll" 2329 YYMORE; /* also gather colons that are not followed by colons or newlines */ 2330 YY_BREAK 2331 case 133: 2332 YY_RULE_SETUP 2333 #line 324 "kdev-pg-lexer.ll" 2334 { 2335 COPY_CODE_TO_YYLVAL(yytext, (yyleng-2)); /* cut off the trailing stuff */ 2336 if(rulePosition == RuleLexer) 2337 BEGIN(RULE_LEXER); 2338 else 2339 BEGIN(INITIAL); 2340 return T_CODE; 2341 } 2342 YY_BREAK 2343 case YY_STATE_EOF(CODE): 2344 #line 332 "kdev-pg-lexer.ll" 2345 { 2346 BEGIN(INITIAL); // is not set automatically by yyrestart() 2347 KDevPG::checkOut << "** ERROR Encountered end of file in an unclosed code segment..." << Qt::endl; 2348 yyerror(""); 2349 return 0; 2350 } 2351 YY_BREAK 2352 2353 case 134: 2354 YY_RULE_SETUP 2355 #line 341 "kdev-pg-lexer.ll" 2356 COPY_TO_YYLVAL(yytext,yyleng); return T_TERMINAL; 2357 YY_BREAK 2358 case 135: 2359 YY_RULE_SETUP 2360 #line 342 "kdev-pg-lexer.ll" 2361 COPY_TO_YYLVAL(yytext,yyleng); return T_IDENTIFIER; 2362 YY_BREAK 2363 case 136: 2364 YY_RULE_SETUP 2365 #line 343 "kdev-pg-lexer.ll" 2366 COPY_TO_YYLVAL(yytext,yyleng); return T_NUMBER; 2367 YY_BREAK 2368 case 137: 2369 YY_RULE_SETUP 2370 #line 346 "kdev-pg-lexer.ll" 2371 { 2372 yytext++; /* start inside the quotes */ 2373 COPY_TO_YYLVAL(yytext,yyleng-2); /* cut off the trailing quote */ 2374 return T_STRING; 2375 } 2376 YY_BREAK 2377 case 138: 2378 YY_RULE_SETUP 2379 #line 352 "kdev-pg-lexer.ll" 2380 { 2381 KDevPG::checkOut << "Unexpected character: ``" << yytext[0] << "''" << Qt::endl; 2382 yyerror(""); 2383 } 2384 YY_BREAK 2385 case 139: 2386 YY_RULE_SETUP 2387 #line 358 "kdev-pg-lexer.ll" 2388 ECHO; 2389 YY_BREAK 2390 #line 2391 "kdev-pg-lexer.cc" 2391 case YY_STATE_EOF(INITIAL): 2392 case YY_STATE_EOF(PARSERCLASS): 2393 case YY_STATE_EOF(RULE_PARAMETERS_HEADER): 2394 case YY_STATE_EOF(RULE_PARAMETERS_VARNAME): 2395 yyterminate(); 2396 2397 case YY_END_OF_BUFFER: 2398 { 2399 /* Amount of text matched not including the EOB char. */ 2400 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; 2401 2402 /* Undo the effects of YY_DO_BEFORE_ACTION. */ 2403 *yy_cp = (yy_hold_char); 2404 YY_RESTORE_YY_MORE_OFFSET 2405 2406 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) 2407 { 2408 /* We're scanning a new file or input source. It's 2409 * possible that this happened because the user 2410 * just pointed yyin at a new source and called 2411 * yylex(). If so, then we have to assure 2412 * consistency between YY_CURRENT_BUFFER and our 2413 * globals. Here is the right place to do so, because 2414 * this is the first action (other than possibly a 2415 * back-up) that will match for the new input source. 2416 */ 2417 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 2418 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; 2419 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; 2420 } 2421 2422 /* Note that here we test for yy_c_buf_p "<=" to the position 2423 * of the first EOB in the buffer, since yy_c_buf_p will 2424 * already have been incremented past the NUL character 2425 * (since all states make transitions on EOB to the 2426 * end-of-buffer state). Contrast this with the test 2427 * in input(). 2428 */ 2429 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) 2430 { /* This was really a NUL. */ 2431 yy_state_type yy_next_state; 2432 2433 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; 2434 2435 yy_current_state = yy_get_previous_state( ); 2436 2437 /* Okay, we're now positioned to make the NUL 2438 * transition. We couldn't have 2439 * yy_get_previous_state() go ahead and do it 2440 * for us because it doesn't know how to deal 2441 * with the possibility of jamming (and we don't 2442 * want to build jamming into it because then it 2443 * will run more slowly). 2444 */ 2445 2446 yy_next_state = yy_try_NUL_trans( yy_current_state ); 2447 2448 yy_bp = (yytext_ptr) + YY_MORE_ADJ; 2449 2450 if ( yy_next_state ) 2451 { 2452 /* Consume the NUL. */ 2453 yy_cp = ++(yy_c_buf_p); 2454 yy_current_state = yy_next_state; 2455 goto yy_match; 2456 } 2457 2458 else 2459 { 2460 yy_cp = (yy_c_buf_p); 2461 goto yy_find_action; 2462 } 2463 } 2464 2465 else switch ( yy_get_next_buffer( ) ) 2466 { 2467 case EOB_ACT_END_OF_FILE: 2468 { 2469 (yy_did_buffer_switch_on_eof) = 0; 2470 2471 if ( yywrap( ) ) 2472 { 2473 /* Note: because we've taken care in 2474 * yy_get_next_buffer() to have set up 2475 * yytext, we can now set up 2476 * yy_c_buf_p so that if some total 2477 * hoser (like flex itself) wants to 2478 * call the scanner after we return the 2479 * YY_NULL, it'll still work - another 2480 * YY_NULL will get returned. 2481 */ 2482 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; 2483 2484 yy_act = YY_STATE_EOF(YY_START); 2485 goto do_action; 2486 } 2487 2488 else 2489 { 2490 if ( ! (yy_did_buffer_switch_on_eof) ) 2491 YY_NEW_FILE; 2492 } 2493 break; 2494 } 2495 2496 case EOB_ACT_CONTINUE_SCAN: 2497 (yy_c_buf_p) = 2498 (yytext_ptr) + yy_amount_of_matched_text; 2499 2500 yy_current_state = yy_get_previous_state( ); 2501 2502 yy_cp = (yy_c_buf_p); 2503 yy_bp = (yytext_ptr) + YY_MORE_ADJ; 2504 goto yy_match; 2505 2506 case EOB_ACT_LAST_MATCH: 2507 (yy_c_buf_p) = 2508 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; 2509 2510 yy_current_state = yy_get_previous_state( ); 2511 2512 yy_cp = (yy_c_buf_p); 2513 yy_bp = (yytext_ptr) + YY_MORE_ADJ; 2514 goto yy_find_action; 2515 } 2516 break; 2517 } 2518 2519 default: 2520 YY_FATAL_ERROR( 2521 "fatal flex scanner internal error--no action found" ); 2522 } /* end of action switch */ 2523 } /* end of scanning one token */ 2524 } /* end of user's declarations */ 2525 } /* end of yylex */ 2526 2527 /* yy_get_next_buffer - try to read in a new buffer 2528 * 2529 * Returns a code representing an action: 2530 * EOB_ACT_LAST_MATCH - 2531 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position 2532 * EOB_ACT_END_OF_FILE - end of file 2533 */ 2534 static int yy_get_next_buffer (void) 2535 { 2536 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; 2537 char *source = (yytext_ptr); 2538 int number_to_move, i; 2539 int ret_val; 2540 2541 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) 2542 YY_FATAL_ERROR( 2543 "fatal flex scanner internal error--end of buffer missed" ); 2544 2545 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) 2546 { /* Don't try to fill the buffer, so this is an EOF. */ 2547 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) 2548 { 2549 /* We matched a single character, the EOB, so 2550 * treat this as a final EOF. 2551 */ 2552 return EOB_ACT_END_OF_FILE; 2553 } 2554 2555 else 2556 { 2557 /* We matched some text prior to the EOB, first 2558 * process it. 2559 */ 2560 return EOB_ACT_LAST_MATCH; 2561 } 2562 } 2563 2564 /* Try to read more data. */ 2565 2566 /* First move last chars to start of buffer. */ 2567 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); 2568 2569 for ( i = 0; i < number_to_move; ++i ) 2570 *(dest++) = *(source++); 2571 2572 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) 2573 /* don't do the read, it's not guaranteed to return an EOF, 2574 * just force an EOF 2575 */ 2576 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; 2577 2578 else 2579 { 2580 int num_to_read = 2581 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; 2582 2583 while ( num_to_read <= 0 ) 2584 { /* Not enough room in the buffer - grow it. */ 2585 2586 YY_FATAL_ERROR( 2587 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); 2588 2589 } 2590 2591 if ( num_to_read > YY_READ_BUF_SIZE ) 2592 num_to_read = YY_READ_BUF_SIZE; 2593 2594 /* Read in more data. */ 2595 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), 2596 (yy_n_chars), num_to_read ); 2597 2598 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 2599 } 2600 2601 if ( (yy_n_chars) == 0 ) 2602 { 2603 if ( number_to_move == YY_MORE_ADJ ) 2604 { 2605 ret_val = EOB_ACT_END_OF_FILE; 2606 yyrestart(yyin ); 2607 } 2608 2609 else 2610 { 2611 ret_val = EOB_ACT_LAST_MATCH; 2612 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = 2613 YY_BUFFER_EOF_PENDING; 2614 } 2615 } 2616 2617 else 2618 ret_val = EOB_ACT_CONTINUE_SCAN; 2619 2620 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { 2621 /* Extend the array by 50%, plus the number we really need. */ 2622 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); 2623 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); 2624 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) 2625 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); 2626 } 2627 2628 (yy_n_chars) += number_to_move; 2629 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; 2630 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; 2631 2632 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; 2633 2634 return ret_val; 2635 } 2636 2637 /* yy_get_previous_state - get the state just before the EOB char was reached */ 2638 2639 static yy_state_type yy_get_previous_state (void) 2640 { 2641 yy_state_type yy_current_state; 2642 char *yy_cp; 2643 2644 yy_current_state = (yy_start); 2645 2646 (yy_state_ptr) = (yy_state_buf); 2647 *(yy_state_ptr)++ = yy_current_state; 2648 2649 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) 2650 { 2651 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 2652 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 2653 { 2654 yy_current_state = (int) yy_def[yy_current_state]; 2655 if ( yy_current_state >= 669 ) 2656 yy_c = yy_meta[(unsigned int) yy_c]; 2657 } 2658 yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; 2659 *(yy_state_ptr)++ = yy_current_state; 2660 } 2661 2662 return yy_current_state; 2663 } 2664 2665 /* yy_try_NUL_trans - try to make a transition on the NUL character 2666 * 2667 * synopsis 2668 * next_state = yy_try_NUL_trans( current_state ); 2669 */ 2670 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) 2671 { 2672 int yy_is_jam; 2673 2674 YY_CHAR yy_c = 1; 2675 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 2676 { 2677 yy_current_state = (int) yy_def[yy_current_state]; 2678 if ( yy_current_state >= 669 ) 2679 yy_c = yy_meta[(unsigned int) yy_c]; 2680 } 2681 yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; 2682 yy_is_jam = (yy_current_state == 668); 2683 if ( ! yy_is_jam ) 2684 *(yy_state_ptr)++ = yy_current_state; 2685 2686 return yy_is_jam ? 0 : yy_current_state; 2687 } 2688 2689 #ifndef YY_NO_UNPUT 2690 2691 static void yyunput (int c, char * yy_bp ) 2692 { 2693 char *yy_cp; 2694 2695 yy_cp = (yy_c_buf_p); 2696 2697 /* undo effects of setting up yytext */ 2698 *yy_cp = (yy_hold_char); 2699 2700 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) 2701 { /* need to shift things up to make room */ 2702 /* +2 for EOB chars. */ 2703 int number_to_move = (yy_n_chars) + 2; 2704 char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ 2705 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; 2706 char *source = 2707 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; 2708 2709 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) 2710 *--dest = *--source; 2711 2712 yy_cp += (int) (dest - source); 2713 yy_bp += (int) (dest - source); 2714 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = 2715 (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; 2716 2717 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) 2718 YY_FATAL_ERROR( "flex scanner push-back overflow" ); 2719 } 2720 2721 *--yy_cp = (char) c; 2722 2723 (yytext_ptr) = yy_bp; 2724 (yy_hold_char) = *yy_cp; 2725 (yy_c_buf_p) = yy_cp; 2726 } 2727 2728 #endif 2729 2730 #ifndef YY_NO_INPUT 2731 #ifdef __cplusplus 2732 static int yyinput (void) 2733 #else 2734 static int input (void) 2735 #endif 2736 2737 { 2738 int c; 2739 2740 *(yy_c_buf_p) = (yy_hold_char); 2741 2742 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) 2743 { 2744 /* yy_c_buf_p now points to the character we want to return. 2745 * If this occurs *before* the EOB characters, then it's a 2746 * valid NUL; if not, then we've hit the end of the buffer. 2747 */ 2748 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) 2749 /* This was really a NUL. */ 2750 *(yy_c_buf_p) = '\0'; 2751 2752 else 2753 { /* need more input */ 2754 int offset = (yy_c_buf_p) - (yytext_ptr); 2755 ++(yy_c_buf_p); 2756 2757 switch ( yy_get_next_buffer( ) ) 2758 { 2759 case EOB_ACT_LAST_MATCH: 2760 /* This happens because yy_g_n_b() 2761 * sees that we've accumulated a 2762 * token and flags that we need to 2763 * try matching the token before 2764 * proceeding. But for input(), 2765 * there's no matching to consider. 2766 * So convert the EOB_ACT_LAST_MATCH 2767 * to EOB_ACT_END_OF_FILE. 2768 */ 2769 2770 /* Reset buffer status. */ 2771 yyrestart(yyin ); 2772 2773 /*FALLTHROUGH*/ 2774 2775 case EOB_ACT_END_OF_FILE: 2776 { 2777 if ( yywrap( ) ) 2778 return 0; 2779 2780 if ( ! (yy_did_buffer_switch_on_eof) ) 2781 YY_NEW_FILE; 2782 #ifdef __cplusplus 2783 return yyinput(); 2784 #else 2785 return input(); 2786 #endif 2787 } 2788 2789 case EOB_ACT_CONTINUE_SCAN: 2790 (yy_c_buf_p) = (yytext_ptr) + offset; 2791 break; 2792 } 2793 } 2794 } 2795 2796 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ 2797 *(yy_c_buf_p) = '\0'; /* preserve yytext */ 2798 (yy_hold_char) = *++(yy_c_buf_p); 2799 2800 return c; 2801 } 2802 #endif /* ifndef YY_NO_INPUT */ 2803 2804 /** Immediately switch to a different input stream. 2805 * @param input_file A readable stream. 2806 * 2807 * @note This function does not reset the start condition to @c INITIAL . 2808 */ 2809 void yyrestart (FILE * input_file ) 2810 { 2811 2812 if ( ! YY_CURRENT_BUFFER ){ 2813 yyensure_buffer_stack (); 2814 YY_CURRENT_BUFFER_LVALUE = 2815 yy_create_buffer(yyin,YY_BUF_SIZE ); 2816 } 2817 2818 yy_init_buffer(YY_CURRENT_BUFFER,input_file ); 2819 yy_load_buffer_state( ); 2820 } 2821 2822 /** Switch to a different input buffer. 2823 * @param new_buffer The new input buffer. 2824 * 2825 */ 2826 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) 2827 { 2828 2829 /* TODO. We should be able to replace this entire function body 2830 * with 2831 * yypop_buffer_state(); 2832 * yypush_buffer_state(new_buffer); 2833 */ 2834 yyensure_buffer_stack (); 2835 if ( YY_CURRENT_BUFFER == new_buffer ) 2836 return; 2837 2838 if ( YY_CURRENT_BUFFER ) 2839 { 2840 /* Flush out information for old buffer. */ 2841 *(yy_c_buf_p) = (yy_hold_char); 2842 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); 2843 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 2844 } 2845 2846 YY_CURRENT_BUFFER_LVALUE = new_buffer; 2847 yy_load_buffer_state( ); 2848 2849 /* We don't actually know whether we did this switch during 2850 * EOF (yywrap()) processing, but the only time this flag 2851 * is looked at is after yywrap() is called, so it's safe 2852 * to go ahead and always set it. 2853 */ 2854 (yy_did_buffer_switch_on_eof) = 1; 2855 } 2856 2857 static void yy_load_buffer_state (void) 2858 { 2859 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 2860 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; 2861 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; 2862 (yy_hold_char) = *(yy_c_buf_p); 2863 } 2864 2865 /** Allocate and initialize an input buffer state. 2866 * @param file A readable stream. 2867 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. 2868 * 2869 * @return the allocated buffer state. 2870 */ 2871 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) 2872 { 2873 YY_BUFFER_STATE b; 2874 2875 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); 2876 if ( ! b ) 2877 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 2878 2879 b->yy_buf_size = (yy_size_t)size; 2880 2881 /* yy_ch_buf has to be 2 characters longer than the size given because 2882 * we need to put in 2 end-of-buffer characters. 2883 */ 2884 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); 2885 if ( ! b->yy_ch_buf ) 2886 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 2887 2888 b->yy_is_our_buffer = 1; 2889 2890 yy_init_buffer(b,file ); 2891 2892 return b; 2893 } 2894 2895 /** Destroy the buffer. 2896 * @param b a buffer created with yy_create_buffer() 2897 * 2898 */ 2899 void yy_delete_buffer (YY_BUFFER_STATE b ) 2900 { 2901 2902 if ( ! b ) 2903 return; 2904 2905 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ 2906 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; 2907 2908 if ( b->yy_is_our_buffer ) 2909 yyfree((void *) b->yy_ch_buf ); 2910 2911 yyfree((void *) b ); 2912 } 2913 2914 /* Initializes or reinitializes a buffer. 2915 * This function is sometimes called more than once on the same buffer, 2916 * such as during a yyrestart() or at EOF. 2917 */ 2918 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) 2919 2920 { 2921 int oerrno = errno; 2922 2923 yy_flush_buffer(b ); 2924 2925 b->yy_input_file = file; 2926 b->yy_fill_buffer = 1; 2927 2928 /* If b is the current buffer, then yy_init_buffer was _probably_ 2929 * called from yyrestart() or through yy_get_next_buffer. 2930 * In that case, we don't want to reset the lineno or column. 2931 */ 2932 if (b != YY_CURRENT_BUFFER){ 2933 b->yy_bs_lineno = 1; 2934 b->yy_bs_column = 0; 2935 } 2936 2937 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; 2938 2939 errno = oerrno; 2940 } 2941 2942 /** Discard all buffered characters. On the next scan, YY_INPUT will be called. 2943 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. 2944 * 2945 */ 2946 void yy_flush_buffer (YY_BUFFER_STATE b ) 2947 { 2948 if ( ! b ) 2949 return; 2950 2951 b->yy_n_chars = 0; 2952 2953 /* We always need two end-of-buffer characters. The first causes 2954 * a transition to the end-of-buffer state. The second causes 2955 * a jam in that state. 2956 */ 2957 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; 2958 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; 2959 2960 b->yy_buf_pos = &b->yy_ch_buf[0]; 2961 2962 b->yy_at_bol = 1; 2963 b->yy_buffer_status = YY_BUFFER_NEW; 2964 2965 if ( b == YY_CURRENT_BUFFER ) 2966 yy_load_buffer_state( ); 2967 } 2968 2969 /** Pushes the new state onto the stack. The new state becomes 2970 * the current state. This function will allocate the stack 2971 * if necessary. 2972 * @param new_buffer The new state. 2973 * 2974 */ 2975 void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) 2976 { 2977 if (new_buffer == NULL) 2978 return; 2979 2980 yyensure_buffer_stack(); 2981 2982 /* This block is copied from yy_switch_to_buffer. */ 2983 if ( YY_CURRENT_BUFFER ) 2984 { 2985 /* Flush out information for old buffer. */ 2986 *(yy_c_buf_p) = (yy_hold_char); 2987 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); 2988 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 2989 } 2990 2991 /* Only push if top exists. Otherwise, replace top. */ 2992 if (YY_CURRENT_BUFFER) 2993 (yy_buffer_stack_top)++; 2994 YY_CURRENT_BUFFER_LVALUE = new_buffer; 2995 2996 /* copied from yy_switch_to_buffer. */ 2997 yy_load_buffer_state( ); 2998 (yy_did_buffer_switch_on_eof) = 1; 2999 } 3000 3001 /** Removes and deletes the top of the stack, if present. 3002 * The next element becomes the new top. 3003 * 3004 */ 3005 void yypop_buffer_state (void) 3006 { 3007 if (!YY_CURRENT_BUFFER) 3008 return; 3009 3010 yy_delete_buffer(YY_CURRENT_BUFFER ); 3011 YY_CURRENT_BUFFER_LVALUE = NULL; 3012 if ((yy_buffer_stack_top) > 0) 3013 --(yy_buffer_stack_top); 3014 3015 if (YY_CURRENT_BUFFER) { 3016 yy_load_buffer_state( ); 3017 (yy_did_buffer_switch_on_eof) = 1; 3018 } 3019 } 3020 3021 /* Allocates the stack if it does not exist. 3022 * Guarantees space for at least one push. 3023 */ 3024 static void yyensure_buffer_stack (void) 3025 { 3026 int num_to_alloc; 3027 3028 if (!(yy_buffer_stack)) { 3029 3030 /* First allocation is just for 2 elements, since we don't know if this 3031 * scanner will even need a stack. We use 2 instead of 1 to avoid an 3032 * immediate realloc on the next call. 3033 */ 3034 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ 3035 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc 3036 (num_to_alloc * sizeof(struct yy_buffer_state*) 3037 ); 3038 if ( ! (yy_buffer_stack) ) 3039 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); 3040 3041 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); 3042 3043 (yy_buffer_stack_max) = num_to_alloc; 3044 (yy_buffer_stack_top) = 0; 3045 return; 3046 } 3047 3048 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ 3049 3050 /* Increase the buffer to prepare for a possible push. */ 3051 yy_size_t grow_size = 8 /* arbitrary grow size */; 3052 3053 num_to_alloc = (yy_buffer_stack_max) + grow_size; 3054 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc 3055 ((yy_buffer_stack), 3056 num_to_alloc * sizeof(struct yy_buffer_state*) 3057 ); 3058 if ( ! (yy_buffer_stack) ) 3059 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); 3060 3061 /* zero only the new slots.*/ 3062 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); 3063 (yy_buffer_stack_max) = num_to_alloc; 3064 } 3065 } 3066 3067 /** Setup the input buffer state to scan directly from a user-specified character buffer. 3068 * @param base the character buffer 3069 * @param size the size in bytes of the character buffer 3070 * 3071 * @return the newly allocated buffer state object. 3072 */ 3073 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) 3074 { 3075 YY_BUFFER_STATE b; 3076 3077 if ( size < 2 || 3078 base[size-2] != YY_END_OF_BUFFER_CHAR || 3079 base[size-1] != YY_END_OF_BUFFER_CHAR ) 3080 /* They forgot to leave room for the EOB's. */ 3081 return NULL; 3082 3083 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); 3084 if ( ! b ) 3085 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); 3086 3087 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ 3088 b->yy_buf_pos = b->yy_ch_buf = base; 3089 b->yy_is_our_buffer = 0; 3090 b->yy_input_file = NULL; 3091 b->yy_n_chars = b->yy_buf_size; 3092 b->yy_is_interactive = 0; 3093 b->yy_at_bol = 1; 3094 b->yy_fill_buffer = 0; 3095 b->yy_buffer_status = YY_BUFFER_NEW; 3096 3097 yy_switch_to_buffer(b ); 3098 3099 return b; 3100 } 3101 3102 /** Setup the input buffer state to scan a string. The next call to yylex() will 3103 * scan from a @e copy of @a str. 3104 * @param yystr a NUL-terminated string to scan 3105 * 3106 * @return the newly allocated buffer state object. 3107 * @note If you want to scan bytes that may contain NUL values, then use 3108 * yy_scan_bytes() instead. 3109 */ 3110 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) 3111 { 3112 3113 return yy_scan_bytes(yystr,(int) strlen(yystr) ); 3114 } 3115 3116 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will 3117 * scan from a @e copy of @a bytes. 3118 * @param yybytes the byte buffer to scan 3119 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. 3120 * 3121 * @return the newly allocated buffer state object. 3122 */ 3123 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) 3124 { 3125 YY_BUFFER_STATE b; 3126 char *buf; 3127 yy_size_t n; 3128 int i; 3129 3130 /* Get memory for full buffer, including space for trailing EOB's. */ 3131 n = (yy_size_t) (_yybytes_len + 2); 3132 buf = (char *) yyalloc(n ); 3133 if ( ! buf ) 3134 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); 3135 3136 for ( i = 0; i < _yybytes_len; ++i ) 3137 buf[i] = yybytes[i]; 3138 3139 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; 3140 3141 b = yy_scan_buffer(buf,n ); 3142 if ( ! b ) 3143 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); 3144 3145 /* It's okay to grow etc. this buffer, and we should throw it 3146 * away when we're done. 3147 */ 3148 b->yy_is_our_buffer = 1; 3149 3150 return b; 3151 } 3152 3153 #ifndef YY_EXIT_FAILURE 3154 #define YY_EXIT_FAILURE 2 3155 #endif 3156 3157 static void yynoreturn yy_fatal_error (yyconst char* msg ) 3158 { 3159 (void) fprintf( stderr, "%s\n", msg ); 3160 exit( YY_EXIT_FAILURE ); 3161 } 3162 3163 /* Redefine yyless() so it works in section 3 code. */ 3164 3165 #undef yyless 3166 #define yyless(n) \ 3167 do \ 3168 { \ 3169 /* Undo effects of setting up yytext. */ \ 3170 int yyless_macro_arg = (n); \ 3171 YY_LESS_LINENO(yyless_macro_arg);\ 3172 yytext[yyleng] = (yy_hold_char); \ 3173 (yy_c_buf_p) = yytext + yyless_macro_arg; \ 3174 (yy_hold_char) = *(yy_c_buf_p); \ 3175 *(yy_c_buf_p) = '\0'; \ 3176 yyleng = yyless_macro_arg; \ 3177 } \ 3178 while ( 0 ) 3179 3180 /* Accessor methods (get/set functions) to struct members. */ 3181 3182 /** Get the current line number. 3183 * 3184 */ 3185 int yyget_lineno (void) 3186 { 3187 3188 return yylineno; 3189 } 3190 3191 /** Get the input stream. 3192 * 3193 */ 3194 FILE *yyget_in (void) 3195 { 3196 return yyin; 3197 } 3198 3199 /** Get the output stream. 3200 * 3201 */ 3202 FILE *yyget_out (void) 3203 { 3204 return yyout; 3205 } 3206 3207 /** Get the length of the current token. 3208 * 3209 */ 3210 int yyget_leng (void) 3211 { 3212 return yyleng; 3213 } 3214 3215 /** Get the current token. 3216 * 3217 */ 3218 3219 char *yyget_text (void) 3220 { 3221 return yytext; 3222 } 3223 3224 /** Set the current line number. 3225 * @param _line_number line number 3226 * 3227 */ 3228 void yyset_lineno (int _line_number ) 3229 { 3230 3231 yylineno = _line_number; 3232 } 3233 3234 /** Set the input stream. This does not discard the current 3235 * input buffer. 3236 * @param _in_str A readable stream. 3237 * 3238 * @see yy_switch_to_buffer 3239 */ 3240 void yyset_in (FILE * _in_str ) 3241 { 3242 yyin = _in_str ; 3243 } 3244 3245 void yyset_out (FILE * _out_str ) 3246 { 3247 yyout = _out_str ; 3248 } 3249 3250 int yyget_debug (void) 3251 { 3252 return yy_flex_debug; 3253 } 3254 3255 void yyset_debug (int _bdebug ) 3256 { 3257 yy_flex_debug = _bdebug ; 3258 } 3259 3260 static int yy_init_globals (void) 3261 { 3262 /* Initialization is the same as for the non-reentrant scanner. 3263 * This function is called from yylex_destroy(), so don't allocate here. 3264 */ 3265 3266 (yy_buffer_stack) = NULL; 3267 (yy_buffer_stack_top) = 0; 3268 (yy_buffer_stack_max) = 0; 3269 (yy_c_buf_p) = NULL; 3270 (yy_init) = 0; 3271 (yy_start) = 0; 3272 3273 (yy_state_buf) = 0; 3274 (yy_state_ptr) = 0; 3275 (yy_full_match) = 0; 3276 (yy_lp) = 0; 3277 3278 /* Defined in main.c */ 3279 #ifdef YY_STDINIT 3280 yyin = stdin; 3281 yyout = stdout; 3282 #else 3283 yyin = NULL; 3284 yyout = NULL; 3285 #endif 3286 3287 /* For future reference: Set errno on error, since we are called by 3288 * yylex_init() 3289 */ 3290 return 0; 3291 } 3292 3293 /* yylex_destroy is for both reentrant and non-reentrant scanners. */ 3294 int yylex_destroy (void) 3295 { 3296 3297 /* Pop the buffer stack, destroying each element. */ 3298 while(YY_CURRENT_BUFFER){ 3299 yy_delete_buffer(YY_CURRENT_BUFFER ); 3300 YY_CURRENT_BUFFER_LVALUE = NULL; 3301 yypop_buffer_state(); 3302 } 3303 3304 /* Destroy the stack itself. */ 3305 yyfree((yy_buffer_stack) ); 3306 (yy_buffer_stack) = NULL; 3307 3308 yyfree ( (yy_state_buf) ); 3309 (yy_state_buf) = NULL; 3310 3311 /* Reset the globals. This is important in a non-reentrant scanner so the next time 3312 * yylex() is called, initialization will occur. */ 3313 yy_init_globals( ); 3314 3315 return 0; 3316 } 3317 3318 /* 3319 * Internal utility routines. 3320 */ 3321 3322 #ifndef yytext_ptr 3323 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) 3324 { 3325 3326 int i; 3327 for ( i = 0; i < n; ++i ) 3328 s1[i] = s2[i]; 3329 } 3330 #endif 3331 3332 #ifdef YY_NEED_STRLEN 3333 static int yy_flex_strlen (yyconst char * s ) 3334 { 3335 int n; 3336 for ( n = 0; s[n]; ++n ) 3337 ; 3338 3339 return n; 3340 } 3341 #endif 3342 3343 void *yyalloc (yy_size_t size ) 3344 { 3345 return malloc(size); 3346 } 3347 3348 void *yyrealloc (void * ptr, yy_size_t size ) 3349 { 3350 3351 /* The cast to (char *) in the following accommodates both 3352 * implementations that use char* generic pointers, and those 3353 * that use void* generic pointers. It works with the latter 3354 * because both ANSI C and C++ allow castless assignment from 3355 * any pointer type to void*, and deal with argument conversions 3356 * as though doing an assignment. 3357 */ 3358 return realloc(ptr, size); 3359 } 3360 3361 void yyfree (void * ptr ) 3362 { 3363 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ 3364 } 3365 3366 #define YYTABLES_NAME "yytables" 3367 3368 #line 358 "kdev-pg-lexer.ll" 3369 3370 3371 3372 char ch; 3373 int yyLine = 1, currentOffset = 0; 3374 bool endOfLine = false, yymoreFlag = false; 3375 int yyTextLineLeng = 1024; 3376 char *yyTextLine = (char*)malloc(yyTextLineLeng); 3377 3378 int inp() 3379 { 3380 if( KDevPG::file.atEnd() ) 3381 return EOF; 3382 KDevPG::file.getChar( &ch ); 3383 return ch; 3384 } 3385 3386 void newline() 3387 { 3388 ++yyLine; 3389 endOfLine = true; 3390 } 3391 3392 void countNewlines(const char* code, int leng) 3393 { 3394 for(int i = 0; i != leng; ++i) 3395 if(code[i] == '\n') 3396 ++yyLine; 3397 } 3398 3399 /* initialize the line buffer */ 3400 void clearLineBuffer() 3401 { 3402 yyTextLine[0] = '\0'; 3403 currentOffset = 0; 3404 endOfLine = false; 3405 } 3406 3407 struct InitLineBuffer 3408 { 3409 InitLineBuffer() 3410 { 3411 clearLineBuffer(); 3412 } 3413 } _initLineBuffer; 3414 3415 /* add the current token to the current line */ 3416 void appendLineBuffer() 3417 { 3418 if (endOfLine == true) 3419 clearLineBuffer(); 3420 3421 static int lastTextLeng = 0; 3422 3423 currentOffset = strlen(yyTextLine); /* start of current */ 3424 3425 int newLeng = currentOffset + strlen(yytext) - (yymoreFlag ? lastTextLeng : 0) + 1; 3426 if(newLeng > yyTextLineLeng) 3427 { 3428 do 3429 { 3430 yyTextLineLeng *= 2; 3431 } 3432 while(newLeng > yyTextLineLeng); 3433 yyTextLine = (char*)realloc(yyTextLine, yyTextLineLeng); 3434 } 3435 3436 strcpy(yyTextLine+currentOffset, yytext + (yymoreFlag ? lastTextLeng : 0)); /* append current */ 3437 /* strcpy is faster than strcat */ 3438 3439 Q_ASSERT(strlen(yyTextLine) < size_t(yyTextLineLeng)); 3440 3441 lastTextLeng = strlen(yytext); 3442 yymoreFlag = false; 3443 } 3444 3445 void yyerror(const char* msg ) 3446 { 3447 Q_UNUSED(msg); 3448 KDevPG::checkOut << "** LEXICAL ERROR at line " << yyLine << " column " << currentOffset << Qt::endl; 3449 3450 char *current_end = yyTextLine + strlen(yyTextLine); 3451 char *p; 3452 3453 /* get the rest of the line if we are not already at the end */ 3454 if(!endOfLine) 3455 { 3456 p = current_end; 3457 int c = ch; 3458 3459 while(c != EOF && c != '\n') 3460 { 3461 *p++ = c; 3462 c = inp(); 3463 } 3464 3465 *p++ = '\n'; 3466 *p = 0; 3467 } 3468 3469 /* yyTextLine[] now has the whole line, with the current token */ 3470 /* at currentOffset */ 3471 3472 /* print error message and current line */ 3473 KDevPG::checkOut << yyTextLine; 3474 3475 /* print a ^ under the most recent token */ 3476 KDevPG::checkOut << QString(currentOffset, ' ').append('^') << Qt::endl; /* currentOffset spaces, then ^ */ 3477 3478 exit(EXIT_FAILURE); 3479 } 3480 3481 int yywrap() { return 1; } 3482 3483