5 #define YY_INT_ALIGNED short int
7 /* A lexical scanner generated by flex */
9 #define yy_create_buffer parser__create_buffer
10 #define yy_delete_buffer parser__delete_buffer
11 #define yy_flex_debug parser__flex_debug
12 #define yy_init_buffer parser__init_buffer
13 #define yy_flush_buffer parser__flush_buffer
14 #define yy_load_buffer_state parser__load_buffer_state
15 #define yy_switch_to_buffer parser__switch_to_buffer
16 #define yyin parser_in
17 #define yyleng parser_leng
18 #define yylex parser_lex
19 #define yylineno parser_lineno
20 #define yyout parser_out
21 #define yyrestart parser_restart
22 #define yytext parser_text
23 #define yywrap parser_wrap
24 #define yyalloc parser_alloc
25 #define yyrealloc parser_realloc
26 #define yyfree parser_free
29 #define YY_FLEX_MAJOR_VERSION 2
30 #define YY_FLEX_MINOR_VERSION 5
31 #define YY_FLEX_SUBMINOR_VERSION 37
32 #if YY_FLEX_SUBMINOR_VERSION > 0
36 /* First, we deal with platform-specific or compiler-specific issues. */
38 /* begin standard C headers. */
44 /* end standard C headers. */
46 /* flex integer type definitions */
51 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
53 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
55 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
56 * if you want the limit (max/min) macros for int types.
58 #ifndef __STDC_LIMIT_MACROS
59 #define __STDC_LIMIT_MACROS 1
63 typedef int8_t flex_int8_t
;
64 typedef uint8_t flex_uint8_t
;
65 typedef int16_t flex_int16_t
;
66 typedef uint16_t flex_uint16_t
;
67 typedef int32_t flex_int32_t
;
68 typedef uint32_t flex_uint32_t
;
70 typedef signed char flex_int8_t
;
71 typedef short int flex_int16_t
;
72 typedef int flex_int32_t
;
73 typedef unsigned char flex_uint8_t
;
74 typedef unsigned short int flex_uint16_t
;
75 typedef unsigned int flex_uint32_t
;
77 /* Limits of integral types. */
79 #define INT8_MIN (-128)
82 #define INT16_MIN (-32767-1)
85 #define INT32_MIN (-2147483647-1)
88 #define INT8_MAX (127)
91 #define INT16_MAX (32767)
94 #define INT32_MAX (2147483647)
97 #define UINT8_MAX (255U)
100 #define UINT16_MAX (65535U)
103 #define UINT32_MAX (4294967295U)
108 #endif /* ! FLEXINT_H */
112 /* The "const" storage-class-modifier is valid. */
115 #else /* ! __cplusplus */
117 /* C99 requires __STDC__ to be defined as 1. */
118 #if defined (__STDC__)
122 #endif /* defined (__STDC__) */
123 #endif /* ! __cplusplus */
126 #define yyconst const
131 /* Returned upon end-of-file. */
134 /* Promotes a possibly negative, possibly signed char to an unsigned
135 * integer for use as an array index. If the signed char is negative,
136 * we want to instead treat it as an 8-bit unsigned char, hence the
139 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
141 /* Enter a start condition. This macro really ought to take a parameter,
142 * but we do it the disgusting crufty way forced on us by the ()-less
143 * definition of BEGIN.
145 #define BEGIN (yy_start) = 1 + 2 *
147 /* Translate the current start state into a value that can be later handed
148 * to BEGIN to return to the state. The YYSTATE alias is for lex
151 #define YY_START (((yy_start) - 1) / 2)
152 #define YYSTATE YY_START
154 /* Action number for EOF rule of a given start state. */
155 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
157 /* Special action meaning "start processing a new file". */
158 #define YY_NEW_FILE parser_restart(parser_in )
160 #define YY_END_OF_BUFFER_CHAR 0
162 /* Size of default input buffer. */
164 #define YY_BUF_SIZE 16384
167 /* The state buf must be large enough to hold one state per character in the main buffer.
169 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
171 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
172 #define YY_TYPEDEF_YY_BUFFER_STATE
173 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
176 #ifndef YY_TYPEDEF_YY_SIZE_T
177 #define YY_TYPEDEF_YY_SIZE_T
178 typedef size_t yy_size_t
;
181 extern yy_size_t parser_leng
;
183 extern FILE *parser_in
, *parser_out
;
185 #define EOB_ACT_CONTINUE_SCAN 0
186 #define EOB_ACT_END_OF_FILE 1
187 #define EOB_ACT_LAST_MATCH 2
189 #define YY_LESS_LINENO(n)
191 /* Return all but the first "n" matched characters back to the input stream. */
195 /* Undo effects of setting up parser_text. */ \
196 int yyless_macro_arg = (n); \
197 YY_LESS_LINENO(yyless_macro_arg);\
198 *yy_cp = (yy_hold_char); \
199 YY_RESTORE_YY_MORE_OFFSET \
200 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
201 YY_DO_BEFORE_ACTION; /* set up parser_text again */ \
205 #define unput(c) yyunput( c, (yytext_ptr) )
207 #ifndef YY_STRUCT_YY_BUFFER_STATE
208 #define YY_STRUCT_YY_BUFFER_STATE
209 struct yy_buffer_state
213 char *yy_ch_buf
; /* input buffer */
214 char *yy_buf_pos
; /* current position in input buffer */
216 /* Size of input buffer in bytes, not including room for EOB
219 yy_size_t yy_buf_size
;
221 /* Number of characters read into yy_ch_buf, not including EOB
224 yy_size_t yy_n_chars
;
226 /* Whether we "own" the buffer - i.e., we know we created it,
227 * and can realloc() it to grow it, and should free() it to
230 int yy_is_our_buffer
;
232 /* Whether this is an "interactive" input source; if so, and
233 * if we're using stdio for input, then we want to use getc()
234 * instead of fread(), to make sure we stop fetching input after
237 int yy_is_interactive
;
239 /* Whether we're considered to be at the beginning of a line.
240 * If so, '^' rules will be active on the next match, otherwise
245 int yy_bs_lineno
; /**< The line count. */
246 int yy_bs_column
; /**< The column count. */
248 /* Whether to try to fill the input buffer when we reach the
253 int yy_buffer_status
;
255 #define YY_BUFFER_NEW 0
256 #define YY_BUFFER_NORMAL 1
257 /* When an EOF's been seen but there's still some text to process
258 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
259 * shouldn't try reading from the input source any more. We might
260 * still have a bunch of tokens to match, though, because of
261 * possible backing-up.
263 * When we actually see the EOF, we change the status to "new"
264 * (via parser_restart()), so that the user can continue scanning by
265 * just pointing parser_in at a new input file.
267 #define YY_BUFFER_EOF_PENDING 2
270 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
272 /* Stack of input buffers. */
273 static size_t yy_buffer_stack_top
= 0; /**< index of top of stack. */
274 static size_t yy_buffer_stack_max
= 0; /**< capacity of stack. */
275 static YY_BUFFER_STATE
* yy_buffer_stack
= 0; /**< Stack as an array. */
277 /* We provide macros for accessing buffer states in case in the
278 * future we want to put the buffer states in a more general
281 * Returns the top of the stack, or NULL.
283 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
284 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
287 /* Same as previous macro, but useful when we know that the buffer stack is not
288 * NULL or when we need an lvalue. For internal use only.
290 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
292 /* yy_hold_char holds the character lost when parser_text is formed. */
293 static char yy_hold_char
;
294 static yy_size_t yy_n_chars
; /* number of characters read into yy_ch_buf */
295 yy_size_t parser_leng
;
297 /* Points to current character in buffer. */
298 static char *yy_c_buf_p
= (char *) 0;
299 static int yy_init
= 0; /* whether we need to initialize */
300 static int yy_start
= 0; /* start state number */
302 /* Flag which is used to allow parser_wrap()'s to do buffer switches
303 * instead of setting up a fresh parser_in. A bit of a hack ...
305 static int yy_did_buffer_switch_on_eof
;
307 void parser_restart (FILE *input_file
);
308 void parser__switch_to_buffer (YY_BUFFER_STATE new_buffer
);
309 YY_BUFFER_STATE
parser__create_buffer (FILE *file
,int size
);
310 void parser__delete_buffer (YY_BUFFER_STATE b
);
311 void parser__flush_buffer (YY_BUFFER_STATE b
);
312 void parser_push_buffer_state (YY_BUFFER_STATE new_buffer
);
313 void parser_pop_buffer_state (void );
315 static void parser_ensure_buffer_stack (void );
316 static void parser__load_buffer_state (void );
317 static void parser__init_buffer (YY_BUFFER_STATE b
,FILE *file
);
319 #define YY_FLUSH_BUFFER parser__flush_buffer(YY_CURRENT_BUFFER )
321 YY_BUFFER_STATE
parser__scan_buffer (char *base
,yy_size_t size
);
322 YY_BUFFER_STATE
parser__scan_string (yyconst
char *yy_str
);
323 YY_BUFFER_STATE
parser__scan_bytes (yyconst
char *bytes
,yy_size_t len
);
325 void *parser_alloc (yy_size_t
);
326 void *parser_realloc (void *,yy_size_t
);
327 void parser_free (void * );
329 #define yy_new_buffer parser__create_buffer
331 #define yy_set_interactive(is_interactive) \
333 if ( ! YY_CURRENT_BUFFER ){ \
334 parser_ensure_buffer_stack (); \
335 YY_CURRENT_BUFFER_LVALUE = \
336 parser__create_buffer(parser_in,YY_BUF_SIZE ); \
338 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
341 #define yy_set_bol(at_bol) \
343 if ( ! YY_CURRENT_BUFFER ){\
344 parser_ensure_buffer_stack (); \
345 YY_CURRENT_BUFFER_LVALUE = \
346 parser__create_buffer(parser_in,YY_BUF_SIZE ); \
348 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
351 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
353 /* Begin user sect3 */
355 typedef unsigned char YY_CHAR
;
357 FILE *parser_in
= (FILE *) 0, *parser_out
= (FILE *) 0;
359 typedef int yy_state_type
;
361 extern int parser_lineno
;
363 int parser_lineno
= 1;
365 extern char *parser_text
;
366 #define yytext_ptr parser_text
368 static yy_state_type
yy_get_previous_state (void );
369 static yy_state_type
yy_try_NUL_trans (yy_state_type current_state
);
370 static int yy_get_next_buffer (void );
371 static void yy_fatal_error (yyconst
char msg
[] );
373 /* Done after the current pattern has been matched and before the
374 * corresponding action - sets up parser_text.
376 #define YY_DO_BEFORE_ACTION \
377 (yytext_ptr) = yy_bp; \
378 parser_leng = (size_t) (yy_cp - yy_bp); \
379 (yy_hold_char) = *yy_cp; \
381 (yy_c_buf_p) = yy_cp;
383 #define YY_NUM_RULES 41
384 #define YY_END_OF_BUFFER 42
385 /* This struct is not used in this scanner,
386 but its presence is necessary. */
389 flex_int32_t yy_verify
;
392 static yyconst flex_int16_t yy_accept
[210] =
394 0, 0, 0, 0, 0, 0, 0, 0, 3, 3,
395 6, 6, 0, 0, 42, 40, 29, 28, 40, 8,
396 40, 12, 40, 40, 24, 24, 40, 40, 40, 27,
397 27, 27, 19, 40, 29, 2, 27, 18, 41, 9,
398 18, 11, 24, 24, 21, 21, 21, 20, 29, 2,
399 3, 6, 6, 6, 13, 18, 34, 38, 32, 0,
400 0, 24, 24, 24, 0, 30, 36, 33, 35, 31,
401 27, 10, 27, 37, 0, 2, 0, 2, 0, 27,
402 17, 15, 14, 24, 0, 21, 21, 0, 2, 2,
403 3, 6, 6, 6, 16, 39, 25, 24, 24, 23,
405 27, 0, 0, 27, 24, 0, 21, 6, 6, 0,
406 23, 23, 27, 0, 0, 27, 24, 0, 21, 6,
407 6, 0, 25, 23, 23, 27, 0, 0, 27, 24,
408 0, 21, 6, 5, 27, 0, 0, 27, 24, 0,
409 21, 6, 5, 27, 0, 0, 27, 24, 0, 21,
410 6, 27, 0, 1, 27, 24, 0, 21, 6, 27,
411 0, 27, 0, 24, 4, 0, 26, 0, 27, 0,
412 4, 0, 27, 0, 0, 0, 0, 0, 0, 0,
413 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,
414 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
416 0, 0, 0, 0, 0, 0, 0, 22, 0
419 static yyconst flex_int32_t yy_ec
[256] =
421 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
422 1, 2, 2, 1, 1, 1, 1, 1, 1, 1,
423 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
424 1, 2, 4, 5, 6, 1, 1, 7, 8, 9,
425 1, 1, 10, 1, 11, 12, 1, 13, 14, 14,
426 14, 14, 14, 14, 14, 14, 14, 1, 1, 15,
427 16, 17, 1, 1, 18, 19, 19, 19, 20, 21,
428 22, 22, 22, 22, 22, 23, 22, 22, 22, 22,
429 22, 24, 25, 22, 26, 22, 22, 27, 28, 22,
430 29, 30, 31, 1, 32, 1, 33, 19, 34, 35,
432 36, 19, 37, 38, 39, 22, 22, 40, 41, 42,
433 43, 44, 22, 45, 22, 46, 47, 22, 48, 49,
434 22, 22, 1, 50, 1, 1, 1, 1, 1, 1,
435 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
436 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
437 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
438 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
439 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
440 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
441 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
443 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
444 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
445 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
446 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
447 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
451 static yyconst flex_int32_t yy_meta
[51] =
453 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
454 1, 1, 3, 3, 1, 1, 1, 3, 3, 3,
455 3, 4, 4, 4, 4, 4, 4, 4, 1, 1,
456 1, 4, 3, 3, 3, 3, 4, 4, 4, 4,
457 4, 4, 4, 4, 4, 4, 4, 4, 4, 1
460 static yyconst flex_int16_t yy_base
[251] =
462 0, 49, 49, 53, 54, 57, 90, 59, 404, 397,
463 138, 139, 140, 141, 399, 677, 677, 677, 381, 677,
464 389, 677, 378, 382, 176, 138, 48, 377, 50, 0,
465 387, 372, 677, 335, 151, 152, 345, 677, 677, 677,
466 48, 677, 213, 118, 250, 0, 378, 677, 66, 377,
467 0, 0, 339, 337, 677, 138, 677, 677, 677, 363,
468 56, 181, 129, 48, 0, 677, 677, 677, 677, 677,
469 0, 677, 351, 677, 156, 154, 332, 157, 325, 328,
470 677, 677, 677, 274, 0, 309, 0, 71, 360, 359,
471 0, 0, 325, 316, 677, 677, 199, 677, 677, 137,
473 337, 320, 317, 309, 333, 0, 368, 308, 296, 195,
474 191, 142, 322, 298, 300, 304, 392, 0, 427, 303,
475 288, 61, 230, 677, 677, 309, 299, 285, 281, 451,
476 0, 486, 288, 0, 296, 275, 284, 271, 510, 0,
477 545, 279, 0, 294, 266, 302, 269, 569, 0, 604,
478 263, 271, 265, 294, 254, 292, 279, 278, 239, 80,
479 244, 239, 0, 351, 0, 164, 677, 238, 245, 0,
480 0, 244, 274, 0, 273, 167, 0, 241, 262, 227,
481 0, 225, 0, 226, 0, 219, 0, 222, 247, 677,
482 0, 0, 0, 0, 246, 0, 0, 0, 0, 0,
484 0, 0, 0, 0, 0, 0, 0, 677, 677, 640,
485 644, 648, 650, 654, 656, 660, 664, 253, 252, 251,
486 249, 248, 668, 242, 239, 238, 672, 234, 227, 226,
487 221, 219, 217, 215, 211, 208, 207, 197, 188, 180,
488 178, 172, 171, 169, 144, 83, 82, 78, 77, 73
491 static yyconst flex_int16_t yy_def
[251] =
493 209, 1, 210, 210, 210, 210, 209, 7, 211, 211,
494 212, 212, 210, 210, 209, 209, 209, 209, 209, 209,
495 209, 209, 209, 209, 209, 209, 209, 209, 209, 213,
496 213, 213, 209, 209, 209, 209, 213, 209, 209, 209,
497 214, 209, 209, 43, 215, 215, 215, 209, 209, 209,
498 216, 217, 217, 217, 209, 214, 209, 209, 209, 209,
499 209, 209, 209, 209, 218, 209, 209, 209, 209, 209,
500 213, 209, 213, 209, 209, 209, 209, 209, 209, 213,
501 209, 209, 209, 209, 219, 215, 215, 209, 209, 209,
502 216, 217, 217, 217, 209, 209, 209, 209, 209, 218,
504 213, 209, 209, 213, 209, 220, 215, 217, 217, 209,
505 209, 209, 213, 209, 209, 213, 209, 221, 215, 217,
506 217, 209, 209, 209, 209, 213, 209, 209, 213, 209,
507 222, 215, 217, 223, 213, 209, 209, 213, 209, 224,
508 215, 217, 223, 213, 209, 209, 213, 209, 225, 215,
509 217, 213, 209, 209, 213, 209, 209, 215, 217, 213,
510 209, 213, 226, 209, 227, 209, 209, 209, 213, 228,
511 227, 209, 213, 229, 209, 209, 230, 209, 209, 209,
512 231, 209, 232, 209, 233, 209, 234, 209, 209, 209,
513 235, 236, 237, 238, 209, 239, 240, 241, 242, 243,
515 244, 245, 246, 247, 248, 249, 250, 209, 0, 209,
516 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
517 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
518 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
519 209, 209, 209, 209, 209, 209, 209, 209, 209, 209
522 static yyconst flex_int16_t yy_nxt
[728] =
524 16, 17, 18, 19, 20, 16, 21, 22, 16, 16,
525 23, 24, 25, 26, 27, 28, 29, 30, 30, 30,
526 30, 30, 31, 30, 32, 30, 30, 30, 33, 16,
527 16, 30, 30, 30, 30, 30, 30, 30, 30, 30,
528 30, 30, 30, 30, 30, 30, 30, 30, 30, 34,
529 35, 39, 82, 40, 36, 39, 39, 40, 42, 39,
530 49, 42, 66, 67, 50, 69, 70, 88, 97, 97,
531 99, 89, 88, 123, 123, 208, 89, 83, 41, 207,
532 206, 166, 41, 41, 205, 204, 41, 99, 167, 37,
533 16, 17, 18, 19, 20, 16, 21, 22, 16, 16,
535 23, 24, 43, 44, 27, 28, 29, 45, 45, 45,
536 45, 46, 47, 46, 46, 46, 46, 46, 33, 16,
537 48, 46, 45, 45, 45, 45, 46, 46, 46, 46,
538 46, 46, 46, 46, 46, 46, 46, 46, 46, 34,
539 39, 39, 39, 39, 209, 95, 203, 55, 55, 61,
540 62, 62, 75, 78, 98, 78, 76, 75, 78, 111,
541 63, 76, 112, 64, 125, 166, 209, 83, 176, 56,
542 56, 202, 167, 201, 200, 98, 111, 63, 53, 53,
543 199, 125, 198, 112, 64, 54, 54, 61, 62, 62,
544 197, 77, 61, 62, 62, 79, 77, 79, 63, 195,
546 79, 64, 65, 63, 122, 122, 64, 123, 123, 194,
547 193, 97, 97, 192, 178, 63, 124, 189, 110, 187,
548 63, 185, 64, 183, 65, 84, 84, 64, 179, 177,
549 85, 85, 85, 85, 110, 63, 174, 124, 64, 65,
550 170, 157, 123, 123, 149, 85, 85, 85, 85, 110,
551 140, 131, 63, 118, 106, 100, 196, 191, 190, 64,
552 188, 65, 86, 86, 186, 110, 184, 86, 86, 86,
553 86, 182, 181, 180, 176, 176, 175, 173, 172, 169,
554 168, 165, 86, 86, 86, 86, 105, 105, 163, 163,
555 162, 106, 106, 106, 106, 154, 63, 161, 160, 64,
557 159, 155, 163, 154, 164, 164, 106, 106, 106, 106,
558 153, 152, 151, 63, 63, 147, 146, 64, 145, 144,
559 64, 107, 107, 142, 138, 137, 107, 107, 107, 107,
560 136, 63, 135, 134, 133, 129, 128, 127, 64, 126,
561 121, 107, 107, 107, 107, 117, 117, 120, 116, 115,
562 118, 118, 118, 118, 114, 63, 113, 109, 64, 108,
563 90, 90, 104, 164, 164, 118, 118, 118, 118, 103,
564 102, 101, 63, 63, 96, 94, 64, 93, 90, 64,
565 119, 119, 72, 80, 74, 119, 119, 119, 119, 73,
566 63, 72, 68, 60, 59, 58, 57, 64, 209, 39,
568 119, 119, 119, 119, 130, 130, 39, 209, 209, 131,
569 131, 131, 131, 209, 63, 209, 209, 64, 209, 209,
570 209, 209, 209, 209, 131, 131, 131, 131, 209, 209,
571 209, 63, 209, 209, 209, 209, 209, 209, 64, 132,
572 132, 209, 209, 209, 132, 132, 132, 132, 209, 209,
573 209, 209, 209, 209, 209, 209, 209, 209, 209, 132,
574 132, 132, 132, 139, 139, 209, 209, 209, 140, 140,
575 140, 140, 209, 63, 209, 209, 64, 209, 209, 209,
576 209, 209, 209, 140, 140, 140, 140, 209, 209, 209,
577 63, 209, 209, 209, 209, 209, 209, 64, 141, 141,
579 209, 209, 209, 141, 141, 141, 141, 209, 209, 209,
580 209, 209, 209, 209, 209, 209, 209, 209, 141, 141,
581 141, 141, 148, 148, 209, 209, 209, 149, 149, 149,
582 149, 209, 63, 209, 209, 64, 209, 209, 209, 209,
583 209, 209, 149, 149, 149, 149, 209, 209, 209, 63,
584 209, 209, 209, 209, 209, 209, 64, 150, 150, 209,
585 209, 209, 150, 150, 150, 150, 209, 209, 209, 209,
586 209, 209, 209, 209, 209, 209, 209, 150, 150, 150,
587 150, 156, 156, 209, 209, 209, 157, 157, 157, 157,
588 209, 63, 209, 209, 64, 209, 209, 209, 209, 209,
590 209, 157, 157, 157, 157, 209, 209, 209, 63, 209,
591 209, 209, 209, 209, 209, 64, 158, 158, 209, 209,
592 209, 158, 158, 158, 158, 209, 209, 209, 209, 209,
593 209, 209, 209, 209, 209, 209, 158, 158, 158, 158,
594 38, 38, 38, 38, 51, 51, 51, 51, 52, 52,
595 52, 52, 71, 71, 81, 209, 81, 81, 87, 87,
596 91, 209, 91, 91, 92, 209, 92, 92, 143, 209,
597 143, 143, 171, 209, 171, 171, 15, 209, 209, 209,
598 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
599 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
601 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
602 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
603 209, 209, 209, 209, 209, 209, 209
606 static yyconst flex_int16_t yy_chk
[728] =
608 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
609 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
610 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
611 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
612 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
613 2, 3, 41, 3, 2, 4, 5, 4, 5, 6,
614 8, 6, 27, 27, 8, 29, 29, 49, 61, 61,
615 64, 49, 88, 122, 122, 250, 88, 41, 3, 249,
616 248, 160, 4, 5, 247, 246, 6, 64, 160, 2,
617 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
619 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
620 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
621 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
622 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
623 11, 12, 13, 14, 44, 56, 245, 13, 14, 26,
624 26, 26, 35, 36, 63, 76, 35, 75, 78, 100,
625 26, 75, 100, 26, 112, 166, 44, 56, 176, 13,
626 14, 244, 166, 243, 242, 63, 100, 26, 11, 12,
627 241, 112, 240, 100, 26, 11, 12, 25, 25, 25,
628 239, 35, 62, 62, 62, 36, 75, 76, 25, 238,
630 78, 25, 25, 62, 110, 110, 62, 110, 110, 237,
631 236, 97, 97, 235, 176, 25, 111, 234, 97, 233,
632 62, 232, 25, 231, 25, 43, 43, 62, 230, 229,
633 43, 43, 43, 43, 97, 43, 228, 111, 43, 43,
634 226, 225, 123, 123, 224, 43, 43, 43, 43, 123,
635 222, 221, 43, 220, 219, 218, 195, 189, 188, 43,
636 186, 43, 45, 45, 184, 123, 182, 45, 45, 45,
637 45, 180, 179, 178, 175, 173, 172, 169, 168, 162,
638 161, 159, 45, 45, 45, 45, 84, 84, 158, 157,
639 155, 84, 84, 84, 84, 154, 84, 153, 152, 84,
641 151, 147, 156, 146, 156, 156, 84, 84, 84, 84,
642 145, 144, 142, 84, 156, 138, 137, 156, 136, 135,
643 84, 86, 86, 133, 129, 128, 86, 86, 86, 86,
644 127, 156, 126, 121, 120, 116, 115, 114, 156, 113,
645 109, 86, 86, 86, 86, 105, 105, 108, 104, 103,
646 105, 105, 105, 105, 102, 105, 101, 94, 105, 93,
647 90, 89, 80, 164, 164, 105, 105, 105, 105, 79,
648 77, 73, 105, 164, 60, 54, 164, 53, 50, 105,
649 107, 107, 47, 37, 34, 107, 107, 107, 107, 32,
650 164, 31, 28, 24, 23, 21, 19, 164, 15, 10,
652 107, 107, 107, 107, 117, 117, 9, 0, 0, 117,
653 117, 117, 117, 0, 117, 0, 0, 117, 0, 0,
654 0, 0, 0, 0, 117, 117, 117, 117, 0, 0,
655 0, 117, 0, 0, 0, 0, 0, 0, 117, 119,
656 119, 0, 0, 0, 119, 119, 119, 119, 0, 0,
657 0, 0, 0, 0, 0, 0, 0, 0, 0, 119,
658 119, 119, 119, 130, 130, 0, 0, 0, 130, 130,
659 130, 130, 0, 130, 0, 0, 130, 0, 0, 0,
660 0, 0, 0, 130, 130, 130, 130, 0, 0, 0,
661 130, 0, 0, 0, 0, 0, 0, 130, 132, 132,
663 0, 0, 0, 132, 132, 132, 132, 0, 0, 0,
664 0, 0, 0, 0, 0, 0, 0, 0, 132, 132,
665 132, 132, 139, 139, 0, 0, 0, 139, 139, 139,
666 139, 0, 139, 0, 0, 139, 0, 0, 0, 0,
667 0, 0, 139, 139, 139, 139, 0, 0, 0, 139,
668 0, 0, 0, 0, 0, 0, 139, 141, 141, 0,
669 0, 0, 141, 141, 141, 141, 0, 0, 0, 0,
670 0, 0, 0, 0, 0, 0, 0, 141, 141, 141,
671 141, 148, 148, 0, 0, 0, 148, 148, 148, 148,
672 0, 148, 0, 0, 148, 0, 0, 0, 0, 0,
674 0, 148, 148, 148, 148, 0, 0, 0, 148, 0,
675 0, 0, 0, 0, 0, 148, 150, 150, 0, 0,
676 0, 150, 150, 150, 150, 0, 0, 0, 0, 0,
677 0, 0, 0, 0, 0, 0, 150, 150, 150, 150,
678 210, 210, 210, 210, 211, 211, 211, 211, 212, 212,
679 212, 212, 213, 213, 214, 0, 214, 214, 215, 215,
680 216, 0, 216, 216, 217, 0, 217, 217, 223, 0,
681 223, 223, 227, 0, 227, 227, 209, 209, 209, 209,
682 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
683 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
685 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
686 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
687 209, 209, 209, 209, 209, 209, 209
690 static yy_state_type yy_last_accepting_state
;
691 static char *yy_last_accepting_cpos
;
693 extern int parser__flex_debug
;
694 int parser__flex_debug
= 0;
696 /* The intent behind this definition is that it'll catch
697 * any uses of REJECT which flex missed.
699 #define REJECT reject_used_but_not_detected
700 #define yymore() yymore_used_but_not_detected
701 #define YY_MORE_ADJ 0
702 #define YY_RESTORE_YY_MORE_OFFSET
708 * Copyright 2002 Ove Kaaven
710 * This library is free software; you can redistribute it and/or
711 * modify it under the terms of the GNU Lesser General Public
712 * License as published by the Free Software Foundation; either
713 * version 2.1 of the License, or (at your option) any later version.
715 * This library is distributed in the hope that it will be useful,
716 * but WITHOUT ANY WARRANTY; without even the implied warranty of
717 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
718 * Lesser General Public License for more details.
720 * You should have received a copy of the GNU Lesser General Public
721 * License along with this library; if not, write to the Free Software
722 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
724 #define YY_NO_INPUT 1
734 #include "wine/port.h"
747 #define YY_NO_UNISTD_H
753 #include "wine/wpp.h"
755 #include "parser.tab.h"
757 static void addcchar(char c
);
758 static char *get_buffered_cstring(void);
760 static char *cbuffer
;
762 static int cbufalloc
= 0;
764 static int kw_token(const char *kw
);
765 static int attr_token(const char *kw
);
767 static warning_list_t
*disabled_warnings
= NULL
;
769 #define MAX_IMPORT_DEPTH 10
771 YY_BUFFER_STATE state
;
775 } import_stack
[MAX_IMPORT_DEPTH
];
776 int import_stack_ptr
= 0;
778 /* converts an integer in string form to an unsigned long and prints an error
780 static unsigned int xstrtoul(const char *nptr
, char **endptr
, int base
)
785 val
= strtoul(nptr
, endptr
, base
);
786 if ((val
== ULONG_MAX
&& errno
== ERANGE
) || ((unsigned int)val
!= val
))
787 error_loc("integer constant %s is too large\n", nptr
);
791 UUID
*parse_uuid(const char *u
)
793 UUID
* uuid
= xmalloc(sizeof(UUID
));
795 /* it would be nice to use UuidFromStringA */
796 uuid
->Data1
= strtoul(u
, NULL
, 16);
797 uuid
->Data2
= strtoul(u
+9, NULL
, 16);
798 uuid
->Data3
= strtoul(u
+14, NULL
, 16);
800 memcpy(b
, u
+19, 2); uuid
->Data4
[0] = strtoul(b
, NULL
, 16);
801 memcpy(b
, u
+21, 2); uuid
->Data4
[1] = strtoul(b
, NULL
, 16);
802 memcpy(b
, u
+24, 2); uuid
->Data4
[2] = strtoul(b
, NULL
, 16);
803 memcpy(b
, u
+26, 2); uuid
->Data4
[3] = strtoul(b
, NULL
, 16);
804 memcpy(b
, u
+28, 2); uuid
->Data4
[4] = strtoul(b
, NULL
, 16);
805 memcpy(b
, u
+30, 2); uuid
->Data4
[5] = strtoul(b
, NULL
, 16);
806 memcpy(b
, u
+32, 2); uuid
->Data4
[6] = strtoul(b
, NULL
, 16);
807 memcpy(b
, u
+34, 2); uuid
->Data4
[7] = strtoul(b
, NULL
, 16);
812 **************************************************************************
813 * The flexer starts here
814 **************************************************************************
816 #line 817 "parser.yy.c"
826 #ifndef YY_NO_UNISTD_H
827 /* Special case for "unistd.h", since it is non-ANSI. We include it way
828 * down here because we want the user's section 1 to have been scanned first.
829 * The user has a chance to override it with an option.
834 #ifndef YY_EXTRA_TYPE
835 #define YY_EXTRA_TYPE void *
838 static int yy_init_globals (void );
840 /* Accessor methods to globals.
841 These are made visible to non-reentrant scanners for convenience. */
843 int parser_lex_destroy (void );
845 int parser_get_debug (void );
847 void parser_set_debug (int debug_flag
);
849 YY_EXTRA_TYPE
parser_get_extra (void );
851 void parser_set_extra (YY_EXTRA_TYPE user_defined
);
853 FILE *parser_get_in (void );
855 void parser_set_in (FILE * in_str
);
857 FILE *parser_get_out (void );
859 void parser_set_out (FILE * out_str
);
861 yy_size_t
parser_get_leng (void );
863 char *parser_get_text (void );
865 int parser_get_lineno (void );
867 void parser_set_lineno (int line_number
);
869 /* Macros after this point can all be overridden by user definitions in
873 #ifndef YY_SKIP_YYWRAP
875 extern "C" int parser_wrap (void );
877 extern int parser_wrap (void );
882 static void yy_flex_strncpy (char *,yyconst
char *,int );
885 #ifdef YY_NEED_STRLEN
886 static int yy_flex_strlen (yyconst
char * );
892 static int yyinput (void );
894 static int input (void );
899 static int yy_start_stack_ptr
= 0;
900 static int yy_start_stack_depth
= 0;
901 static int *yy_start_stack
= NULL
;
903 static void yy_push_state (int new_state
);
905 static void yy_pop_state (void );
907 /* Amount of stuff to slurp up with each read. */
908 #ifndef YY_READ_BUF_SIZE
909 #define YY_READ_BUF_SIZE 8192
912 /* Copy whatever the last rule matched to the standard output. */
914 /* This used to be an fputs(), but since the string might contain NUL's,
915 * we now use fwrite().
917 #define ECHO do { if (fwrite( parser_text, parser_leng, 1, parser_out )) {} } while (0)
920 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
921 * is returned in "result".
924 #define YY_INPUT(buf,result,max_size) \
925 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
929 for ( n = 0; n < max_size && \
930 (c = getc( parser_in )) != EOF && c != '\n'; ++n ) \
933 buf[n++] = (char) c; \
934 if ( c == EOF && ferror( parser_in ) ) \
935 YY_FATAL_ERROR( "input in flex scanner failed" ); \
941 while ( (result = fread(buf, 1, max_size, parser_in))==0 && ferror(parser_in)) \
943 if( errno != EINTR) \
945 YY_FATAL_ERROR( "input in flex scanner failed" ); \
949 clearerr(parser_in); \
956 /* No semi-colon after return; correct usage is to write "yyterminate();" -
957 * we don't want an extra ';' after the "return" because that will cause
958 * some compilers to complain about unreachable statements.
961 #define yyterminate() return YY_NULL
964 /* Number of entries by which start-condition stack grows. */
965 #ifndef YY_START_STACK_INCR
966 #define YY_START_STACK_INCR 25
969 /* Report a fatal error. */
970 #ifndef YY_FATAL_ERROR
971 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
974 /* end tables serialization structures and prototypes */
976 /* Default declaration of generated scanner - a define so the user can
977 * easily add parameters.
980 #define YY_DECL_IS_OURS 1
982 extern int parser_lex (void);
984 #define YY_DECL int parser_lex (void)
985 #endif /* !YY_DECL */
987 /* Code executed at the beginning of each rule, after parser_text and parser_leng
990 #ifndef YY_USER_ACTION
991 #define YY_USER_ACTION
994 /* Code executed at the end of each rule. */
996 #define YY_BREAK break;
999 #define YY_RULE_SETUP \
1000 if ( parser_leng > 0 ) \
1001 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1002 (parser_text[parser_leng - 1] == '\n'); \
1005 /** The main scanner function which does all the work.
1009 register yy_state_type yy_current_state
;
1010 register char *yy_cp
, *yy_bp
;
1011 register int yy_act
;
1013 #line 130 "parser.l"
1015 #line 1016 "parser.yy.c"
1026 (yy_start
) = 1; /* first start state */
1032 parser_out
= stdout
;
1034 if ( ! YY_CURRENT_BUFFER
) {
1035 parser_ensure_buffer_stack ();
1036 YY_CURRENT_BUFFER_LVALUE
=
1037 parser__create_buffer(parser_in
,YY_BUF_SIZE
);
1040 parser__load_buffer_state( );
1043 while ( 1 ) /* loops until end-of-file is reached */
1045 yy_cp
= (yy_c_buf_p
);
1047 /* Support of parser_text. */
1048 *yy_cp
= (yy_hold_char
);
1050 /* yy_bp points to the position in yy_ch_buf of the start of
1055 yy_current_state
= (yy_start
);
1056 yy_current_state
+= YY_AT_BOL();
1060 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
1061 if ( yy_accept
[yy_current_state
] )
1063 (yy_last_accepting_state
) = yy_current_state
;
1064 (yy_last_accepting_cpos
) = yy_cp
;
1066 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1068 yy_current_state
= (int) yy_def
[yy_current_state
];
1069 if ( yy_current_state
>= 210 )
1070 yy_c
= yy_meta
[(unsigned int) yy_c
];
1072 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1075 while ( yy_current_state
!= 209 );
1076 yy_cp
= (yy_last_accepting_cpos
);
1077 yy_current_state
= (yy_last_accepting_state
);
1080 yy_act
= yy_accept
[yy_current_state
];
1082 YY_DO_BEFORE_ACTION
;
1084 do_action
: /* This label is used only to access EOF actions. */
1087 { /* beginning of action switch */
1088 case 0: /* must back up */
1089 /* undo the effects of YY_DO_BEFORE_ACTION */
1090 *yy_cp
= (yy_hold_char
);
1091 yy_cp
= (yy_last_accepting_cpos
);
1092 yy_current_state
= (yy_last_accepting_state
);
1093 goto yy_find_action
;
1097 #line 131 "parser.l"
1098 yy_push_state(PP_PRAGMA
);
1102 #line 132 "parser.l"
1103 yy_push_state(PP_LINE
);
1107 #line 133 "parser.l"
1112 lineno
= (int)strtol(parser_text
, &cptr
, 10);
1114 error_loc("Malformed '#...' line-directive; invalid linenumber\n");
1115 fname
= strchr(cptr
, '"');
1117 error_loc("Malformed '#...' line-directive; missing filename\n");
1119 cptr
= strchr(fname
, '"');
1121 error_loc("Malformed '#...' line-directive; missing terminating \"\n");
1123 line_number
= lineno
- 1; /* We didn't read the newline */
1124 input_name
= xstrdup(fname
);
1129 #line 151 "parser.l"
1130 yyless(9); yy_pop_state(); return tCPPQUOTE
;
1134 #line 152 "parser.l"
1136 if(import_stack_ptr
) {
1138 error_loc("winrt IDL file imported in non-winrt mode\n");
1140 const char *ptr
= parser_text
+5;
1144 while(isspace(*ptr
))
1146 if(!strncmp(ptr
, "ns_prefix", 9) && (!*(ptr
+= 9) || isspace(*ptr
)))
1147 use_abi_namespace
= TRUE
;
1154 #line 168 "parser.l"
1155 parser_lval
.str
= xstrdup(parser_text
); yy_pop_state(); return aPRAGMA
;
1159 #line 169 "parser.l"
1160 return tPRAGMA_WARNING
;
1164 #line 170 "parser.l"
1165 yy_push_state(QUOTE
); cbufidx
= 0;
1169 #line 171 "parser.l"
1172 parser_lval
.str
= get_buffered_cstring();
1178 #line 176 "parser.l"
1179 yy_push_state(WSTRQUOTE
); cbufidx
= 0;
1183 #line 177 "parser.l"
1186 parser_lval
.str
= get_buffered_cstring();
1192 #line 182 "parser.l"
1193 yy_push_state(SQUOTE
); cbufidx
= 0;
1197 #line 183 "parser.l"
1200 parser_lval
.str
= get_buffered_cstring();
1205 #line 189 "parser.l"
1208 #line 189 "parser.l"
1209 addcchar(parser_text
[1]);
1213 #line 190 "parser.l"
1214 addcchar(parser_text
[1]);
1218 #line 191 "parser.l"
1219 addcchar('\\'); addcchar(parser_text
[1]);
1223 #line 192 "parser.l"
1224 addcchar(parser_text
[0]);
1228 #line 193 "parser.l"
1229 yy_push_state(ATTR
); return '[';
1233 #line 194 "parser.l"
1234 yy_pop_state(); return ']';
1238 #line 195 "parser.l"
1239 return attr_token(parser_text
);
1243 #line 196 "parser.l"
1245 parser_lval
.uuid
= parse_uuid(parser_text
);
1251 #line 200 "parser.l"
1253 parser_lval
.num
= xstrtoul(parser_text
, NULL
, 0);
1259 #line 204 "parser.l"
1261 parser_lval
.num
= xstrtoul(parser_text
, NULL
, 0);
1267 #line 208 "parser.l"
1269 parser_lval
.dbl
= strtod(parser_text
, NULL
);
1274 *yy_cp
= (yy_hold_char
); /* undo effects of setting up parser_text */
1275 (yy_c_buf_p
) = yy_cp
-= 1;
1276 YY_DO_BEFORE_ACTION
; /* set up parser_text again */
1278 #line 212 "parser.l"
1283 #line 213 "parser.l"
1284 return kw_token(parser_text
);
1287 /* rule 28 can match eol */
1289 #line 214 "parser.l"
1294 #line 215 "parser.l"
1299 #line 216 "parser.l"
1304 #line 217 "parser.l"
1309 #line 218 "parser.l"
1314 #line 219 "parser.l"
1319 #line 220 "parser.l"
1324 #line 221 "parser.l"
1325 return GREATEREQUAL
;
1329 #line 222 "parser.l"
1334 #line 223 "parser.l"
1339 #line 224 "parser.l"
1344 #line 225 "parser.l"
1349 #line 226 "parser.l"
1350 return parser_text
[0];
1352 case YY_STATE_EOF(INITIAL
):
1353 case YY_STATE_EOF(QUOTE
):
1354 case YY_STATE_EOF(WSTRQUOTE
):
1355 case YY_STATE_EOF(ATTR
):
1356 case YY_STATE_EOF(PP_LINE
):
1357 case YY_STATE_EOF(PP_PRAGMA
):
1358 case YY_STATE_EOF(SQUOTE
):
1359 #line 227 "parser.l"
1361 if (import_stack_ptr
)
1368 #line 232 "parser.l"
1371 #line 1372 "parser.yy.c"
1373 case YY_END_OF_BUFFER
:
1375 /* Amount of text matched not including the EOB char. */
1376 int yy_amount_of_matched_text
= (int) (yy_cp
- (yytext_ptr
)) - 1;
1378 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1379 *yy_cp
= (yy_hold_char
);
1380 YY_RESTORE_YY_MORE_OFFSET
1382 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_NEW
)
1384 /* We're scanning a new file or input source. It's
1385 * possible that this happened because the user
1386 * just pointed parser_in at a new source and called
1387 * parser_lex(). If so, then we have to assure
1388 * consistency between YY_CURRENT_BUFFER and our
1389 * globals. Here is the right place to do so, because
1390 * this is the first action (other than possibly a
1391 * back-up) that will match for the new input source.
1393 (yy_n_chars
) = YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
1394 YY_CURRENT_BUFFER_LVALUE
->yy_input_file
= parser_in
;
1395 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
= YY_BUFFER_NORMAL
;
1398 /* Note that here we test for yy_c_buf_p "<=" to the position
1399 * of the first EOB in the buffer, since yy_c_buf_p will
1400 * already have been incremented past the NUL character
1401 * (since all states make transitions on EOB to the
1402 * end-of-buffer state). Contrast this with the test
1405 if ( (yy_c_buf_p
) <= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
)] )
1406 { /* This was really a NUL. */
1407 yy_state_type yy_next_state
;
1409 (yy_c_buf_p
) = (yytext_ptr
) + yy_amount_of_matched_text
;
1411 yy_current_state
= yy_get_previous_state( );
1413 /* Okay, we're now positioned to make the NUL
1414 * transition. We couldn't have
1415 * yy_get_previous_state() go ahead and do it
1416 * for us because it doesn't know how to deal
1417 * with the possibility of jamming (and we don't
1418 * want to build jamming into it because then it
1419 * will run more slowly).
1422 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
1424 yy_bp
= (yytext_ptr
) + YY_MORE_ADJ
;
1426 if ( yy_next_state
)
1428 /* Consume the NUL. */
1429 yy_cp
= ++(yy_c_buf_p
);
1430 yy_current_state
= yy_next_state
;
1436 yy_cp
= (yy_last_accepting_cpos
);
1437 yy_current_state
= (yy_last_accepting_state
);
1438 goto yy_find_action
;
1442 else switch ( yy_get_next_buffer( ) )
1444 case EOB_ACT_END_OF_FILE
:
1446 (yy_did_buffer_switch_on_eof
) = 0;
1448 if ( parser_wrap( ) )
1450 /* Note: because we've taken care in
1451 * yy_get_next_buffer() to have set up
1452 * parser_text, we can now set up
1453 * yy_c_buf_p so that if some total
1454 * hoser (like flex itself) wants to
1455 * call the scanner after we return the
1456 * YY_NULL, it'll still work - another
1457 * YY_NULL will get returned.
1459 (yy_c_buf_p
) = (yytext_ptr
) + YY_MORE_ADJ
;
1461 yy_act
= YY_STATE_EOF(YY_START
);
1467 if ( ! (yy_did_buffer_switch_on_eof
) )
1473 case EOB_ACT_CONTINUE_SCAN
:
1475 (yytext_ptr
) + yy_amount_of_matched_text
;
1477 yy_current_state
= yy_get_previous_state( );
1479 yy_cp
= (yy_c_buf_p
);
1480 yy_bp
= (yytext_ptr
) + YY_MORE_ADJ
;
1483 case EOB_ACT_LAST_MATCH
:
1485 &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
)];
1487 yy_current_state
= yy_get_previous_state( );
1489 yy_cp
= (yy_c_buf_p
);
1490 yy_bp
= (yytext_ptr
) + YY_MORE_ADJ
;
1491 goto yy_find_action
;
1498 "fatal flex scanner internal error--no action found" );
1499 } /* end of action switch */
1500 } /* end of scanning one token */
1501 } /* end of parser_lex */
1503 /* yy_get_next_buffer - try to read in a new buffer
1505 * Returns a code representing an action:
1506 * EOB_ACT_LAST_MATCH -
1507 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1508 * EOB_ACT_END_OF_FILE - end of file
1510 static int yy_get_next_buffer (void)
1512 register char *dest
= YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
;
1513 register char *source
= (yytext_ptr
);
1514 register int number_to_move
, i
;
1517 if ( (yy_c_buf_p
) > &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
) + 1] )
1519 "fatal flex scanner internal error--end of buffer missed" );
1521 if ( YY_CURRENT_BUFFER_LVALUE
->yy_fill_buffer
== 0 )
1522 { /* Don't try to fill the buffer, so this is an EOF. */
1523 if ( (yy_c_buf_p
) - (yytext_ptr
) - YY_MORE_ADJ
== 1 )
1525 /* We matched a single character, the EOB, so
1526 * treat this as a final EOF.
1528 return EOB_ACT_END_OF_FILE
;
1533 /* We matched some text prior to the EOB, first
1536 return EOB_ACT_LAST_MATCH
;
1540 /* Try to read more data. */
1542 /* First move last chars to start of buffer. */
1543 number_to_move
= (int) ((yy_c_buf_p
) - (yytext_ptr
)) - 1;
1545 for ( i
= 0; i
< number_to_move
; ++i
)
1546 *(dest
++) = *(source
++);
1548 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
1549 /* don't do the read, it's not guaranteed to return an EOF,
1552 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
) = 0;
1556 yy_size_t num_to_read
=
1557 YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
- number_to_move
- 1;
1559 while ( num_to_read
<= 0 )
1560 { /* Not enough room in the buffer - grow it. */
1562 /* just a shorter name for the current buffer */
1563 YY_BUFFER_STATE b
= YY_CURRENT_BUFFER_LVALUE
;
1565 int yy_c_buf_p_offset
=
1566 (int) ((yy_c_buf_p
) - b
->yy_ch_buf
);
1568 if ( b
->yy_is_our_buffer
)
1570 yy_size_t new_size
= b
->yy_buf_size
* 2;
1572 if ( new_size
<= 0 )
1573 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
1575 b
->yy_buf_size
*= 2;
1577 b
->yy_ch_buf
= (char *)
1578 /* Include room in for 2 EOB chars. */
1579 parser_realloc((void *) b
->yy_ch_buf
,b
->yy_buf_size
+ 2 );
1582 /* Can't grow it, we don't own it. */
1585 if ( ! b
->yy_ch_buf
)
1587 "fatal error - scanner input buffer overflow" );
1589 (yy_c_buf_p
) = &b
->yy_ch_buf
[yy_c_buf_p_offset
];
1591 num_to_read
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
-
1596 if ( num_to_read
> YY_READ_BUF_SIZE
)
1597 num_to_read
= YY_READ_BUF_SIZE
;
1599 /* Read in more data. */
1600 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[number_to_move
]),
1601 (yy_n_chars
), num_to_read
);
1603 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
);
1606 if ( (yy_n_chars
) == 0 )
1608 if ( number_to_move
== YY_MORE_ADJ
)
1610 ret_val
= EOB_ACT_END_OF_FILE
;
1611 parser_restart(parser_in
);
1616 ret_val
= EOB_ACT_LAST_MATCH
;
1617 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
=
1618 YY_BUFFER_EOF_PENDING
;
1623 ret_val
= EOB_ACT_CONTINUE_SCAN
;
1625 if ((yy_size_t
) ((yy_n_chars
) + number_to_move
) > YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
) {
1626 /* Extend the array by 50%, plus the number we really need. */
1627 yy_size_t new_size
= (yy_n_chars
) + number_to_move
+ ((yy_n_chars
) >> 1);
1628 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
= (char *) parser_realloc((void *) YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
,new_size
);
1629 if ( ! YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
)
1630 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1633 (yy_n_chars
) += number_to_move
;
1634 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
)] = YY_END_OF_BUFFER_CHAR
;
1635 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
) + 1] = YY_END_OF_BUFFER_CHAR
;
1637 (yytext_ptr
) = &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[0];
1642 /* yy_get_previous_state - get the state just before the EOB char was reached */
1644 static yy_state_type
yy_get_previous_state (void)
1646 register yy_state_type yy_current_state
;
1647 register char *yy_cp
;
1649 yy_current_state
= (yy_start
);
1650 yy_current_state
+= YY_AT_BOL();
1652 for ( yy_cp
= (yytext_ptr
) + YY_MORE_ADJ
; yy_cp
< (yy_c_buf_p
); ++yy_cp
)
1654 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
1655 if ( yy_accept
[yy_current_state
] )
1657 (yy_last_accepting_state
) = yy_current_state
;
1658 (yy_last_accepting_cpos
) = yy_cp
;
1660 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1662 yy_current_state
= (int) yy_def
[yy_current_state
];
1663 if ( yy_current_state
>= 210 )
1664 yy_c
= yy_meta
[(unsigned int) yy_c
];
1666 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1669 return yy_current_state
;
1672 /* yy_try_NUL_trans - try to make a transition on the NUL character
1675 * next_state = yy_try_NUL_trans( current_state );
1677 static yy_state_type
yy_try_NUL_trans (yy_state_type yy_current_state
)
1679 register int yy_is_jam
;
1680 register char *yy_cp
= (yy_c_buf_p
);
1682 register YY_CHAR yy_c
= 1;
1683 if ( yy_accept
[yy_current_state
] )
1685 (yy_last_accepting_state
) = yy_current_state
;
1686 (yy_last_accepting_cpos
) = yy_cp
;
1688 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1690 yy_current_state
= (int) yy_def
[yy_current_state
];
1691 if ( yy_current_state
>= 210 )
1692 yy_c
= yy_meta
[(unsigned int) yy_c
];
1694 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1695 yy_is_jam
= (yy_current_state
== 209);
1697 return yy_is_jam
? 0 : yy_current_state
;
1702 static int yyinput (void)
1704 static int input (void)
1710 *(yy_c_buf_p
) = (yy_hold_char
);
1712 if ( *(yy_c_buf_p
) == YY_END_OF_BUFFER_CHAR
)
1714 /* yy_c_buf_p now points to the character we want to return.
1715 * If this occurs *before* the EOB characters, then it's a
1716 * valid NUL; if not, then we've hit the end of the buffer.
1718 if ( (yy_c_buf_p
) < &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
)] )
1719 /* This was really a NUL. */
1720 *(yy_c_buf_p
) = '\0';
1723 { /* need more input */
1724 yy_size_t offset
= (yy_c_buf_p
) - (yytext_ptr
);
1727 switch ( yy_get_next_buffer( ) )
1729 case EOB_ACT_LAST_MATCH
:
1730 /* This happens because yy_g_n_b()
1731 * sees that we've accumulated a
1732 * token and flags that we need to
1733 * try matching the token before
1734 * proceeding. But for input(),
1735 * there's no matching to consider.
1736 * So convert the EOB_ACT_LAST_MATCH
1737 * to EOB_ACT_END_OF_FILE.
1740 /* Reset buffer status. */
1741 parser_restart(parser_in
);
1745 case EOB_ACT_END_OF_FILE
:
1747 if ( parser_wrap( ) )
1750 if ( ! (yy_did_buffer_switch_on_eof
) )
1759 case EOB_ACT_CONTINUE_SCAN
:
1760 (yy_c_buf_p
) = (yytext_ptr
) + offset
;
1766 c
= *(unsigned char *) (yy_c_buf_p
); /* cast for 8-bit char's */
1767 *(yy_c_buf_p
) = '\0'; /* preserve parser_text */
1768 (yy_hold_char
) = *++(yy_c_buf_p
);
1770 YY_CURRENT_BUFFER_LVALUE
->yy_at_bol
= (c
== '\n');
1774 #endif /* ifndef YY_NO_INPUT */
1776 /** Immediately switch to a different input stream.
1777 * @param input_file A readable stream.
1779 * @note This function does not reset the start condition to @c INITIAL .
1781 void parser_restart (FILE * input_file
)
1784 if ( ! YY_CURRENT_BUFFER
){
1785 parser_ensure_buffer_stack ();
1786 YY_CURRENT_BUFFER_LVALUE
=
1787 parser__create_buffer(parser_in
,YY_BUF_SIZE
);
1790 parser__init_buffer(YY_CURRENT_BUFFER
,input_file
);
1791 parser__load_buffer_state( );
1794 /** Switch to a different input buffer.
1795 * @param new_buffer The new input buffer.
1798 void parser__switch_to_buffer (YY_BUFFER_STATE new_buffer
)
1801 /* TODO. We should be able to replace this entire function body
1803 * parser_pop_buffer_state();
1804 * parser_push_buffer_state(new_buffer);
1806 parser_ensure_buffer_stack ();
1807 if ( YY_CURRENT_BUFFER
== new_buffer
)
1810 if ( YY_CURRENT_BUFFER
)
1812 /* Flush out information for old buffer. */
1813 *(yy_c_buf_p
) = (yy_hold_char
);
1814 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= (yy_c_buf_p
);
1815 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
);
1818 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
1819 parser__load_buffer_state( );
1821 /* We don't actually know whether we did this switch during
1822 * EOF (parser_wrap()) processing, but the only time this flag
1823 * is looked at is after parser_wrap() is called, so it's safe
1824 * to go ahead and always set it.
1826 (yy_did_buffer_switch_on_eof
) = 1;
1829 static void parser__load_buffer_state (void)
1831 (yy_n_chars
) = YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
1832 (yytext_ptr
) = (yy_c_buf_p
) = YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
;
1833 parser_in
= YY_CURRENT_BUFFER_LVALUE
->yy_input_file
;
1834 (yy_hold_char
) = *(yy_c_buf_p
);
1837 /** Allocate and initialize an input buffer state.
1838 * @param file A readable stream.
1839 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1841 * @return the allocated buffer state.
1843 YY_BUFFER_STATE
parser__create_buffer (FILE * file
, int size
)
1847 b
= (YY_BUFFER_STATE
) parser_alloc(sizeof( struct yy_buffer_state
) );
1849 YY_FATAL_ERROR( "out of dynamic memory in parser__create_buffer()" );
1851 b
->yy_buf_size
= size
;
1853 /* yy_ch_buf has to be 2 characters longer than the size given because
1854 * we need to put in 2 end-of-buffer characters.
1856 b
->yy_ch_buf
= (char *) parser_alloc(b
->yy_buf_size
+ 2 );
1857 if ( ! b
->yy_ch_buf
)
1858 YY_FATAL_ERROR( "out of dynamic memory in parser__create_buffer()" );
1860 b
->yy_is_our_buffer
= 1;
1862 parser__init_buffer(b
,file
);
1867 /** Destroy the buffer.
1868 * @param b a buffer created with parser__create_buffer()
1871 void parser__delete_buffer (YY_BUFFER_STATE b
)
1877 if ( b
== YY_CURRENT_BUFFER
) /* Not sure if we should pop here. */
1878 YY_CURRENT_BUFFER_LVALUE
= (YY_BUFFER_STATE
) 0;
1880 if ( b
->yy_is_our_buffer
)
1881 parser_free((void *) b
->yy_ch_buf
);
1883 parser_free((void *) b
);
1886 /* Initializes or reinitializes a buffer.
1887 * This function is sometimes called more than once on the same buffer,
1888 * such as during a parser_restart() or at EOF.
1890 static void parser__init_buffer (YY_BUFFER_STATE b
, FILE * file
)
1895 parser__flush_buffer(b
);
1897 b
->yy_input_file
= file
;
1898 b
->yy_fill_buffer
= 1;
1900 /* If b is the current buffer, then parser__init_buffer was _probably_
1901 * called from parser_restart() or through yy_get_next_buffer.
1902 * In that case, we don't want to reset the lineno or column.
1904 if (b
!= YY_CURRENT_BUFFER
){
1905 b
->yy_bs_lineno
= 1;
1906 b
->yy_bs_column
= 0;
1909 b
->yy_is_interactive
= 0;
1914 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1915 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1918 void parser__flush_buffer (YY_BUFFER_STATE b
)
1925 /* We always need two end-of-buffer characters. The first causes
1926 * a transition to the end-of-buffer state. The second causes
1927 * a jam in that state.
1929 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
1930 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1932 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
1935 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1937 if ( b
== YY_CURRENT_BUFFER
)
1938 parser__load_buffer_state( );
1941 /** Pushes the new state onto the stack. The new state becomes
1942 * the current state. This function will allocate the stack
1944 * @param new_buffer The new state.
1947 void parser_push_buffer_state (YY_BUFFER_STATE new_buffer
)
1949 if (new_buffer
== NULL
)
1952 parser_ensure_buffer_stack();
1954 /* This block is copied from parser__switch_to_buffer. */
1955 if ( YY_CURRENT_BUFFER
)
1957 /* Flush out information for old buffer. */
1958 *(yy_c_buf_p
) = (yy_hold_char
);
1959 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= (yy_c_buf_p
);
1960 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
);
1963 /* Only push if top exists. Otherwise, replace top. */
1964 if (YY_CURRENT_BUFFER
)
1965 (yy_buffer_stack_top
)++;
1966 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
1968 /* copied from parser__switch_to_buffer. */
1969 parser__load_buffer_state( );
1970 (yy_did_buffer_switch_on_eof
) = 1;
1973 /** Removes and deletes the top of the stack, if present.
1974 * The next element becomes the new top.
1977 void parser_pop_buffer_state (void)
1979 if (!YY_CURRENT_BUFFER
)
1982 parser__delete_buffer(YY_CURRENT_BUFFER
);
1983 YY_CURRENT_BUFFER_LVALUE
= NULL
;
1984 if ((yy_buffer_stack_top
) > 0)
1985 --(yy_buffer_stack_top
);
1987 if (YY_CURRENT_BUFFER
) {
1988 parser__load_buffer_state( );
1989 (yy_did_buffer_switch_on_eof
) = 1;
1993 /* Allocates the stack if it does not exist.
1994 * Guarantees space for at least one push.
1996 static void parser_ensure_buffer_stack (void)
1998 yy_size_t num_to_alloc
;
2000 if (!(yy_buffer_stack
)) {
2002 /* First allocation is just for 2 elements, since we don't know if this
2003 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2004 * immediate realloc on the next call.
2007 (yy_buffer_stack
) = (struct yy_buffer_state
**)parser_alloc
2008 (num_to_alloc
* sizeof(struct yy_buffer_state
*)
2010 if ( ! (yy_buffer_stack
) )
2011 YY_FATAL_ERROR( "out of dynamic memory in parser_ensure_buffer_stack()" );
2013 memset((yy_buffer_stack
), 0, num_to_alloc
* sizeof(struct yy_buffer_state
*));
2015 (yy_buffer_stack_max
) = num_to_alloc
;
2016 (yy_buffer_stack_top
) = 0;
2020 if ((yy_buffer_stack_top
) >= ((yy_buffer_stack_max
)) - 1){
2022 /* Increase the buffer to prepare for a possible push. */
2023 int grow_size
= 8 /* arbitrary grow size */;
2025 num_to_alloc
= (yy_buffer_stack_max
) + grow_size
;
2026 (yy_buffer_stack
) = (struct yy_buffer_state
**)parser_realloc
2028 num_to_alloc
* sizeof(struct yy_buffer_state
*)
2030 if ( ! (yy_buffer_stack
) )
2031 YY_FATAL_ERROR( "out of dynamic memory in parser_ensure_buffer_stack()" );
2033 /* zero only the new slots.*/
2034 memset((yy_buffer_stack
) + (yy_buffer_stack_max
), 0, grow_size
* sizeof(struct yy_buffer_state
*));
2035 (yy_buffer_stack_max
) = num_to_alloc
;
2039 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2040 * @param base the character buffer
2041 * @param size the size in bytes of the character buffer
2043 * @return the newly allocated buffer state object.
2045 YY_BUFFER_STATE
parser__scan_buffer (char * base
, yy_size_t size
)
2050 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
2051 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
2052 /* They forgot to leave room for the EOB's. */
2055 b
= (YY_BUFFER_STATE
) parser_alloc(sizeof( struct yy_buffer_state
) );
2057 YY_FATAL_ERROR( "out of dynamic memory in parser__scan_buffer()" );
2059 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
2060 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
2061 b
->yy_is_our_buffer
= 0;
2062 b
->yy_input_file
= 0;
2063 b
->yy_n_chars
= b
->yy_buf_size
;
2064 b
->yy_is_interactive
= 0;
2066 b
->yy_fill_buffer
= 0;
2067 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2069 parser__switch_to_buffer(b
);
2074 /** Setup the input buffer state to scan a string. The next call to parser_lex() will
2075 * scan from a @e copy of @a str.
2076 * @param yystr a NUL-terminated string to scan
2078 * @return the newly allocated buffer state object.
2079 * @note If you want to scan bytes that may contain NUL values, then use
2080 * parser__scan_bytes() instead.
2082 YY_BUFFER_STATE
parser__scan_string (yyconst
char * yystr
)
2085 return parser__scan_bytes(yystr
,strlen(yystr
) );
2088 /** Setup the input buffer state to scan the given bytes. The next call to parser_lex() will
2089 * scan from a @e copy of @a bytes.
2090 * @param yybytes the byte buffer to scan
2091 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2093 * @return the newly allocated buffer state object.
2095 YY_BUFFER_STATE
parser__scan_bytes (yyconst
char * yybytes
, yy_size_t _yybytes_len
)
2102 /* Get memory for full buffer, including space for trailing EOB's. */
2103 n
= _yybytes_len
+ 2;
2104 buf
= (char *) parser_alloc(n
);
2106 YY_FATAL_ERROR( "out of dynamic memory in parser__scan_bytes()" );
2108 for ( i
= 0; i
< _yybytes_len
; ++i
)
2109 buf
[i
] = yybytes
[i
];
2111 buf
[_yybytes_len
] = buf
[_yybytes_len
+1] = YY_END_OF_BUFFER_CHAR
;
2113 b
= parser__scan_buffer(buf
,n
);
2115 YY_FATAL_ERROR( "bad buffer in parser__scan_bytes()" );
2117 /* It's okay to grow etc. this buffer, and we should throw it
2118 * away when we're done.
2120 b
->yy_is_our_buffer
= 1;
2125 static void yy_push_state (int new_state
)
2127 if ( (yy_start_stack_ptr
) >= (yy_start_stack_depth
) )
2131 (yy_start_stack_depth
) += YY_START_STACK_INCR
;
2132 new_size
= (yy_start_stack_depth
) * sizeof( int );
2134 if ( ! (yy_start_stack
) )
2135 (yy_start_stack
) = (int *) parser_alloc(new_size
);
2138 (yy_start_stack
) = (int *) parser_realloc((void *) (yy_start_stack
),new_size
);
2140 if ( ! (yy_start_stack
) )
2141 YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
2144 (yy_start_stack
)[(yy_start_stack_ptr
)++] = YY_START
;
2149 static void yy_pop_state (void)
2151 if ( --(yy_start_stack_ptr
) < 0 )
2152 YY_FATAL_ERROR( "start-condition stack underflow" );
2154 BEGIN((yy_start_stack
)[(yy_start_stack_ptr
)]);
2157 #ifndef YY_EXIT_FAILURE
2158 #define YY_EXIT_FAILURE 2
2161 static void yy_fatal_error (yyconst
char* msg
)
2163 (void) fprintf( stderr
, "%s\n", msg
);
2164 exit( YY_EXIT_FAILURE
);
2167 /* Redefine yyless() so it works in section 3 code. */
2173 /* Undo effects of setting up parser_text. */ \
2174 int yyless_macro_arg = (n); \
2175 YY_LESS_LINENO(yyless_macro_arg);\
2176 parser_text[parser_leng] = (yy_hold_char); \
2177 (yy_c_buf_p) = parser_text + yyless_macro_arg; \
2178 (yy_hold_char) = *(yy_c_buf_p); \
2179 *(yy_c_buf_p) = '\0'; \
2180 parser_leng = yyless_macro_arg; \
2184 /* Accessor methods (get/set functions) to struct members. */
2186 /** Get the current line number.
2189 int parser_get_lineno (void)
2192 return parser_lineno
;
2195 /** Get the input stream.
2198 FILE *parser_get_in (void)
2203 /** Get the output stream.
2206 FILE *parser_get_out (void)
2211 /** Get the length of the current token.
2214 yy_size_t
parser_get_leng (void)
2219 /** Get the current token.
2223 char *parser_get_text (void)
2228 /** Set the current line number.
2229 * @param line_number
2232 void parser_set_lineno (int line_number
)
2235 parser_lineno
= line_number
;
2238 /** Set the input stream. This does not discard the current
2240 * @param in_str A readable stream.
2242 * @see parser__switch_to_buffer
2244 void parser_set_in (FILE * in_str
)
2246 parser_in
= in_str
;
2249 void parser_set_out (FILE * out_str
)
2251 parser_out
= out_str
;
2254 int parser_get_debug (void)
2256 return parser__flex_debug
;
2259 void parser_set_debug (int bdebug
)
2261 parser__flex_debug
= bdebug
;
2264 static int yy_init_globals (void)
2266 /* Initialization is the same as for the non-reentrant scanner.
2267 * This function is called from parser_lex_destroy(), so don't allocate here.
2270 (yy_buffer_stack
) = 0;
2271 (yy_buffer_stack_top
) = 0;
2272 (yy_buffer_stack_max
) = 0;
2273 (yy_c_buf_p
) = (char *) 0;
2277 (yy_start_stack_ptr
) = 0;
2278 (yy_start_stack_depth
) = 0;
2279 (yy_start_stack
) = NULL
;
2281 /* Defined in main.c */
2284 parser_out
= stdout
;
2286 parser_in
= (FILE *) 0;
2287 parser_out
= (FILE *) 0;
2290 /* For future reference: Set errno on error, since we are called by
2296 /* parser_lex_destroy is for both reentrant and non-reentrant scanners. */
2297 int parser_lex_destroy (void)
2300 /* Pop the buffer stack, destroying each element. */
2301 while(YY_CURRENT_BUFFER
){
2302 parser__delete_buffer(YY_CURRENT_BUFFER
);
2303 YY_CURRENT_BUFFER_LVALUE
= NULL
;
2304 parser_pop_buffer_state();
2307 /* Destroy the stack itself. */
2308 parser_free((yy_buffer_stack
) );
2309 (yy_buffer_stack
) = NULL
;
2311 /* Destroy the start condition stack. */
2312 parser_free((yy_start_stack
) );
2313 (yy_start_stack
) = NULL
;
2315 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2316 * parser_lex() is called, initialization will occur. */
2323 * Internal utility routines.
2327 static void yy_flex_strncpy (char* s1
, yyconst
char * s2
, int n
)
2330 for ( i
= 0; i
< n
; ++i
)
2335 #ifdef YY_NEED_STRLEN
2336 static int yy_flex_strlen (yyconst
char * s
)
2339 for ( n
= 0; s
[n
]; ++n
)
2346 void *parser_alloc (yy_size_t size
)
2348 return (void *) malloc( size
);
2351 void *parser_realloc (void * ptr
, yy_size_t size
)
2353 /* The cast to (char *) in the following accommodates both
2354 * implementations that use char* generic pointers, and those
2355 * that use void* generic pointers. It works with the latter
2356 * because both ANSI C and C++ allow castless assignment from
2357 * any pointer type to void*, and deal with argument conversions
2358 * as though doing an assignment.
2360 return (void *) realloc( (char *) ptr
, size
);
2363 void parser_free (void * ptr
)
2365 free( (char *) ptr
); /* see parser_realloc() for (char *) cast */
2368 #define YYTABLES_NAME "yytables"
2370 #line 231 "parser.l"
2375 int parser_wrap(void)
2386 /* This table MUST be alphabetically sorted on the kw field */
2387 static const struct keyword keywords
[] = {
2391 {"__cdecl", tCDECL
},
2392 {"__fastcall", tFASTCALL
},
2393 {"__int3264", tINT3264
},
2394 {"__int64", tINT64
},
2395 {"__pascal", tPASCAL
},
2396 {"__stdcall", tSTDCALL
},
2398 {"_fastcall", tFASTCALL
},
2399 {"_pascal", tPASCAL
},
2400 {"_stdcall", tSTDCALL
},
2401 {"boolean", tBOOLEAN
},
2406 {"coclass", tCOCLASS
},
2408 {"cpp_quote", tCPPQUOTE
},
2409 {"default", tDEFAULT
},
2410 {"dispinterface", tDISPINTERFACE
},
2411 {"double", tDOUBLE
},
2413 {"error_status_t", tERRORSTATUST
},
2414 {"extern", tEXTERN
},
2416 {"handle_t", tHANDLET
},
2418 {"import", tIMPORT
},
2419 {"importlib", tIMPORTLIB
},
2420 {"inline", tINLINE
},
2422 {"interface", tINTERFACE
},
2423 {"library", tLIBRARY
},
2425 {"methods", tMETHODS
},
2426 {"module", tMODULE
},
2427 {"namespace", tNAMESPACE
},
2428 {"pascal", tPASCAL
},
2429 {"properties", tPROPERTIES
},
2430 {"register", tREGISTER
},
2432 {"signed", tSIGNED
},
2433 {"sizeof", tSIZEOF
},
2435 {"static", tSTATIC
},
2436 {"stdcall", tSTDCALL
},
2437 {"struct", tSTRUCT
},
2438 {"switch", tSWITCH
},
2439 {"typedef", tTYPEDEF
},
2441 {"unsigned", tUNSIGNED
},
2443 {"wchar_t", tWCHAR
},
2445 #define NKEYWORDS (sizeof(keywords)/sizeof(keywords[0]))
2447 /* keywords only recognized in attribute lists
2448 * This table MUST be alphabetically sorted on the kw field
2450 static const struct keyword attr_keywords
[] =
2452 {"aggregatable", tAGGREGATABLE
},
2453 {"allocate", tALLOCATE
},
2454 {"annotation", tANNOTATION
},
2455 {"apartment", tAPARTMENT
},
2456 {"appobject", tAPPOBJECT
},
2458 {"async_uuid", tASYNCUUID
},
2459 {"auto_handle", tAUTOHANDLE
},
2460 {"bindable", tBINDABLE
},
2462 {"broadcast", tBROADCAST
},
2463 {"byte_count", tBYTECOUNT
},
2464 {"call_as", tCALLAS
},
2465 {"callback", tCALLBACK
},
2467 {"comm_status", tCOMMSTATUS
},
2468 {"context_handle", tCONTEXTHANDLE
},
2469 {"context_handle_noserialize", tCONTEXTHANDLENOSERIALIZE
},
2470 {"context_handle_serialize", tCONTEXTHANDLENOSERIALIZE
},
2471 {"control", tCONTROL
},
2472 {"decode", tDECODE
},
2473 {"defaultbind", tDEFAULTBIND
},
2474 {"defaultcollelem", tDEFAULTCOLLELEM
},
2475 {"defaultvalue", tDEFAULTVALUE
},
2476 {"defaultvtable", tDEFAULTVTABLE
},
2477 {"disable_consistency_check", tDISABLECONSISTENCYCHECK
},
2478 {"displaybind", tDISPLAYBIND
},
2479 {"dllname", tDLLNAME
},
2481 {"enable_allocate", tENABLEALLOCATE
},
2482 {"encode", tENCODE
},
2483 {"endpoint", tENDPOINT
},
2485 {"explicit_handle", tEXPLICITHANDLE
},
2486 {"fault_status", tFAULTSTATUS
},
2487 {"force_allocate", tFORCEALLOCATE
},
2489 {"handle", tHANDLE
},
2490 {"helpcontext", tHELPCONTEXT
},
2491 {"helpfile", tHELPFILE
},
2492 {"helpstring", tHELPSTRING
},
2493 {"helpstringcontext", tHELPSTRINGCONTEXT
},
2494 {"helpstringdll", tHELPSTRINGDLL
},
2495 {"hidden", tHIDDEN
},
2497 {"idempotent", tIDEMPOTENT
},
2498 {"ignore", tIGNORE
},
2500 {"immediatebind", tIMMEDIATEBIND
},
2501 {"implicit_handle", tIMPLICITHANDLE
},
2503 {"in_line", tIN_LINE
},
2504 {"input_sync", tINPUTSYNC
},
2506 {"length_is", tLENGTHIS
},
2507 {"licensed", tLICENSED
},
2510 {"message", tMESSAGE
},
2511 {"neutral", tNEUTRAL
},
2512 {"nocode", tNOCODE
},
2513 {"nonbrowsable", tNONBROWSABLE
},
2514 {"noncreatable", tNONCREATABLE
},
2515 {"nonextensible", tNONEXTENSIBLE
},
2516 {"notify", tNOTIFY
},
2517 {"notify_flag", tNOTIFYFLAG
},
2518 {"object", tOBJECT
},
2520 {"oleautomation", tOLEAUTOMATION
},
2521 {"optimize", tOPTIMIZE
},
2522 {"optional", tOPTIONAL
},
2524 {"partial_ignore", tPARTIALIGNORE
},
2525 {"pointer_default", tPOINTERDEFAULT
},
2526 {"progid", tPROGID
},
2527 {"propget", tPROPGET
},
2528 {"propput", tPROPPUT
},
2529 {"propputref", tPROPPUTREF
},
2532 {"public", tPUBLIC
},
2534 {"readonly", tREADONLY
},
2536 {"represent_as", tREPRESENTAS
},
2537 {"requestedit", tREQUESTEDIT
},
2538 {"restricted", tRESTRICTED
},
2539 {"retval", tRETVAL
},
2540 {"single", tSINGLE
},
2541 {"size_is", tSIZEIS
},
2542 {"source", tSOURCE
},
2543 {"strict_context_handle", tSTRICTCONTEXTHANDLE
},
2544 {"string", tSTRING
},
2545 {"switch_is", tSWITCHIS
},
2546 {"switch_type", tSWITCHTYPE
},
2547 {"threading", tTHREADING
},
2548 {"transmit_as", tTRANSMITAS
},
2549 {"uidefault", tUIDEFAULT
},
2550 {"unique", tUNIQUE
},
2551 {"user_marshal", tUSERMARSHAL
},
2552 {"usesgetlasterror", tUSESGETLASTERROR
},
2554 {"v1_enum", tV1ENUM
},
2555 {"vararg", tVARARG
},
2556 {"version", tVERSION
},
2557 {"vi_progid", tVIPROGID
},
2558 {"wire_marshal", tWIREMARSHAL
},
2569 #define KWP(p) ((const struct keyword *)(p))
2571 static int kw_cmp_func(const void *s1
, const void *s2
)
2573 return strcmp(KWP(s1
)->kw
, KWP(s2
)->kw
);
2576 static int kw_token(const char *kw
)
2578 struct keyword key
, *kwp
;
2580 kwp
= bsearch(&key
, keywords
, NKEYWORDS
, sizeof(keywords
[0]), kw_cmp_func
);
2581 if (kwp
&& (winrt_mode
|| kwp
->token
!= tNAMESPACE
)) {
2582 parser_lval
.str
= xstrdup(kwp
->kw
);
2585 parser_lval
.str
= xstrdup(kw
);
2586 return is_type(kw
) ? aKNOWNTYPE
: aIDENTIFIER
;
2589 static int attr_token(const char *kw
)
2591 struct keyword key
, *kwp
;
2593 kwp
= bsearch(&key
, attr_keywords
, sizeof(attr_keywords
)/sizeof(attr_keywords
[0]),
2594 sizeof(attr_keywords
[0]), kw_cmp_func
);
2596 parser_lval
.str
= xstrdup(kwp
->kw
);
2599 return kw_token(kw
);
2602 static void addcchar(char c
)
2604 if(cbufidx
>= cbufalloc
)
2607 cbuffer
= xrealloc(cbuffer
, cbufalloc
* sizeof(cbuffer
[0]));
2608 if(cbufalloc
> 65536)
2609 parser_warning("Reallocating string buffer larger than 64kB\n");
2611 cbuffer
[cbufidx
++] = c
;
2614 static char *get_buffered_cstring(void)
2617 return xstrdup(cbuffer
);
2620 void pop_import(void)
2622 int ptr
= import_stack_ptr
-1;
2625 parser__delete_buffer(YY_CURRENT_BUFFER
);
2626 parser__switch_to_buffer(import_stack
[ptr
].state
);
2631 temp_name
= import_stack
[ptr
].temp_name
;
2632 input_name
= import_stack
[ptr
].input_name
;
2633 line_number
= import_stack
[ptr
].line_number
;
2639 struct imports
*next
;
2642 int do_import(char *fname
)
2646 struct imports
*import
;
2647 int ptr
= import_stack_ptr
;
2650 import
= first_import
;
2651 while (import
&& strcmp(import
->name
, fname
))
2652 import
= import
->next
;
2653 if (import
) return 0; /* already imported */
2655 import
= xmalloc(sizeof(struct imports
));
2656 import
->name
= xstrdup(fname
);
2657 import
->next
= first_import
;
2658 first_import
= import
;
2660 /* don't search for a file name with a path in the include directories,
2661 * for compatibility with MIDL */
2662 if (strchr( fname
, '/' ) || strchr( fname
, '\\' ))
2663 path
= xstrdup( fname
);
2664 else if (!(path
= wpp_find_include( fname
, input_name
)))
2665 error_loc("Unable to open include file %s\n", fname
);
2667 import_stack
[ptr
].temp_name
= temp_name
;
2668 import_stack
[ptr
].input_name
= input_name
;
2669 import_stack
[ptr
].line_number
= line_number
;
2674 name
= xstrdup( "widl.XXXXXX" );
2675 if((fd
= mkstemps( name
, 0 )) == -1)
2676 error("Could not generate a temp name from %s\n", name
);
2679 if (!(f
= fdopen(fd
, "wt")))
2680 error("Could not open fd %s for writing\n", name
);
2682 ret
= wpp_parse( path
, f
);
2686 if((f
= fopen(temp_name
, "r")) == NULL
)
2687 error_loc("Unable to open %s\n", temp_name
);
2689 import_stack
[ptr
].state
= YY_CURRENT_BUFFER
;
2690 parser__switch_to_buffer(parser__create_buffer(f
,YY_BUF_SIZE
));
2694 void abort_import(void)
2698 for (ptr
=0; ptr
<import_stack_ptr
; ptr
++)
2699 unlink(import_stack
[ptr
].temp_name
);
2702 static void warning_disable(int warning
)
2704 warning_t
*warning_entry
;
2705 LIST_FOR_EACH_ENTRY(warning_entry
, disabled_warnings
, warning_t
, entry
)
2706 if(warning_entry
->num
== warning
)
2708 warning_entry
= xmalloc( sizeof(*warning_entry
) );
2709 warning_entry
->num
= warning
;
2710 list_add_tail(disabled_warnings
, &warning_entry
->entry
);
2713 static void warning_enable(int warning
)
2715 warning_t
*warning_entry
;
2716 LIST_FOR_EACH_ENTRY(warning_entry
, disabled_warnings
, warning_t
, entry
)
2717 if(warning_entry
->num
== warning
)
2719 list_remove(&warning_entry
->entry
);
2720 free(warning_entry
);
2725 int do_warning(char *toggle
, warning_list_t
*wnum
)
2727 warning_t
*warning
, *next
;
2729 if(!disabled_warnings
)
2731 disabled_warnings
= xmalloc( sizeof(*disabled_warnings
) );
2732 list_init( disabled_warnings
);
2735 if(!strcmp(toggle
, "disable"))
2736 LIST_FOR_EACH_ENTRY(warning
, wnum
, warning_t
, entry
)
2737 warning_disable(warning
->num
);
2738 else if(!strcmp(toggle
, "enable"))
2739 LIST_FOR_EACH_ENTRY(warning
, wnum
, warning_t
, entry
)
2740 warning_enable(warning
->num
);
2744 LIST_FOR_EACH_ENTRY_SAFE(warning
, next
, wnum
, warning_t
, entry
)
2749 int is_warning_enabled(int warning
)
2751 warning_t
*warning_entry
;
2752 if(!disabled_warnings
)
2754 LIST_FOR_EACH_ENTRY(warning_entry
, disabled_warnings
, warning_t
, entry
)
2755 if(warning_entry
->num
== warning
)