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 35
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. */
165 /* On IA-64, the buffer size is 16k, not 8k.
166 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
167 * Ditto for the __ia64__ case accordingly.
169 #define YY_BUF_SIZE 32768
171 #define YY_BUF_SIZE 16384
172 #endif /* __ia64__ */
175 /* The state buf must be large enough to hold one state per character in the main buffer.
177 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
179 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
180 #define YY_TYPEDEF_YY_BUFFER_STATE
181 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
184 extern int parser_leng
;
186 extern FILE *parser_in
, *parser_out
;
188 #define EOB_ACT_CONTINUE_SCAN 0
189 #define EOB_ACT_END_OF_FILE 1
190 #define EOB_ACT_LAST_MATCH 2
192 #define YY_LESS_LINENO(n)
194 /* Return all but the first "n" matched characters back to the input stream. */
198 /* Undo effects of setting up parser_text. */ \
199 int yyless_macro_arg = (n); \
200 YY_LESS_LINENO(yyless_macro_arg);\
201 *yy_cp = (yy_hold_char); \
202 YY_RESTORE_YY_MORE_OFFSET \
203 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
204 YY_DO_BEFORE_ACTION; /* set up parser_text again */ \
208 #define unput(c) yyunput( c, (yytext_ptr) )
210 #ifndef YY_TYPEDEF_YY_SIZE_T
211 #define YY_TYPEDEF_YY_SIZE_T
212 typedef size_t yy_size_t
;
215 #ifndef YY_STRUCT_YY_BUFFER_STATE
216 #define YY_STRUCT_YY_BUFFER_STATE
217 struct yy_buffer_state
221 char *yy_ch_buf
; /* input buffer */
222 char *yy_buf_pos
; /* current position in input buffer */
224 /* Size of input buffer in bytes, not including room for EOB
227 yy_size_t yy_buf_size
;
229 /* Number of characters read into yy_ch_buf, not including EOB
234 /* Whether we "own" the buffer - i.e., we know we created it,
235 * and can realloc() it to grow it, and should free() it to
238 int yy_is_our_buffer
;
240 /* Whether this is an "interactive" input source; if so, and
241 * if we're using stdio for input, then we want to use getc()
242 * instead of fread(), to make sure we stop fetching input after
245 int yy_is_interactive
;
247 /* Whether we're considered to be at the beginning of a line.
248 * If so, '^' rules will be active on the next match, otherwise
253 int yy_bs_lineno
; /**< The line count. */
254 int yy_bs_column
; /**< The column count. */
256 /* Whether to try to fill the input buffer when we reach the
261 int yy_buffer_status
;
263 #define YY_BUFFER_NEW 0
264 #define YY_BUFFER_NORMAL 1
265 /* When an EOF's been seen but there's still some text to process
266 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
267 * shouldn't try reading from the input source any more. We might
268 * still have a bunch of tokens to match, though, because of
269 * possible backing-up.
271 * When we actually see the EOF, we change the status to "new"
272 * (via parser_restart()), so that the user can continue scanning by
273 * just pointing parser_in at a new input file.
275 #define YY_BUFFER_EOF_PENDING 2
278 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
280 /* Stack of input buffers. */
281 static size_t yy_buffer_stack_top
= 0; /**< index of top of stack. */
282 static size_t yy_buffer_stack_max
= 0; /**< capacity of stack. */
283 static YY_BUFFER_STATE
* yy_buffer_stack
= 0; /**< Stack as an array. */
285 /* We provide macros for accessing buffer states in case in the
286 * future we want to put the buffer states in a more general
289 * Returns the top of the stack, or NULL.
291 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
292 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
295 /* Same as previous macro, but useful when we know that the buffer stack is not
296 * NULL or when we need an lvalue. For internal use only.
298 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
300 /* yy_hold_char holds the character lost when parser_text is formed. */
301 static char yy_hold_char
;
302 static int yy_n_chars
; /* number of characters read into yy_ch_buf */
305 /* Points to current character in buffer. */
306 static char *yy_c_buf_p
= (char *) 0;
307 static int yy_init
= 0; /* whether we need to initialize */
308 static int yy_start
= 0; /* start state number */
310 /* Flag which is used to allow parser_wrap()'s to do buffer switches
311 * instead of setting up a fresh parser_in. A bit of a hack ...
313 static int yy_did_buffer_switch_on_eof
;
315 void parser_restart (FILE *input_file
);
316 void parser__switch_to_buffer (YY_BUFFER_STATE new_buffer
);
317 YY_BUFFER_STATE
parser__create_buffer (FILE *file
,int size
);
318 void parser__delete_buffer (YY_BUFFER_STATE b
);
319 void parser__flush_buffer (YY_BUFFER_STATE b
);
320 void parser_push_buffer_state (YY_BUFFER_STATE new_buffer
);
321 void parser_pop_buffer_state (void );
323 static void parser_ensure_buffer_stack (void );
324 static void parser__load_buffer_state (void );
325 static void parser__init_buffer (YY_BUFFER_STATE b
,FILE *file
);
327 #define YY_FLUSH_BUFFER parser__flush_buffer(YY_CURRENT_BUFFER )
329 YY_BUFFER_STATE
parser__scan_buffer (char *base
,yy_size_t size
);
330 YY_BUFFER_STATE
parser__scan_string (yyconst
char *yy_str
);
331 YY_BUFFER_STATE
parser__scan_bytes (yyconst
char *bytes
,int len
);
333 void *parser_alloc (yy_size_t
);
334 void *parser_realloc (void *,yy_size_t
);
335 void parser_free (void * );
337 #define yy_new_buffer parser__create_buffer
339 #define yy_set_interactive(is_interactive) \
341 if ( ! YY_CURRENT_BUFFER ){ \
342 parser_ensure_buffer_stack (); \
343 YY_CURRENT_BUFFER_LVALUE = \
344 parser__create_buffer(parser_in,YY_BUF_SIZE ); \
346 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
349 #define yy_set_bol(at_bol) \
351 if ( ! YY_CURRENT_BUFFER ){\
352 parser_ensure_buffer_stack (); \
353 YY_CURRENT_BUFFER_LVALUE = \
354 parser__create_buffer(parser_in,YY_BUF_SIZE ); \
356 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
359 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
361 /* Begin user sect3 */
363 typedef unsigned char YY_CHAR
;
365 FILE *parser_in
= (FILE *) 0, *parser_out
= (FILE *) 0;
367 typedef int yy_state_type
;
369 extern int parser_lineno
;
371 int parser_lineno
= 1;
373 extern char *parser_text
;
374 #define yytext_ptr parser_text
376 static yy_state_type
yy_get_previous_state (void );
377 static yy_state_type
yy_try_NUL_trans (yy_state_type current_state
);
378 static int yy_get_next_buffer (void );
379 static void yy_fatal_error (yyconst
char msg
[] );
381 /* Done after the current pattern has been matched and before the
382 * corresponding action - sets up parser_text.
384 #define YY_DO_BEFORE_ACTION \
385 (yytext_ptr) = yy_bp; \
386 parser_leng = (size_t) (yy_cp - yy_bp); \
387 (yy_hold_char) = *yy_cp; \
389 (yy_c_buf_p) = yy_cp;
391 #define YY_NUM_RULES 39
392 #define YY_END_OF_BUFFER 40
393 /* This struct is not used in this scanner,
394 but its presence is necessary. */
397 flex_int32_t yy_verify
;
400 static yyconst flex_int16_t yy_accept
[174] =
402 0, 0, 0, 0, 0, 0, 0, 0, 3, 3,
403 5, 5, 0, 0, 40, 38, 27, 26, 38, 6,
404 38, 10, 38, 38, 22, 22, 38, 38, 38, 25,
405 25, 25, 17, 38, 27, 2, 16, 39, 7, 16,
406 9, 22, 22, 19, 19, 19, 18, 27, 2, 3,
407 5, 5, 11, 16, 32, 36, 30, 0, 0, 22,
408 22, 22, 0, 28, 34, 31, 33, 29, 25, 8,
409 25, 35, 0, 2, 2, 0, 15, 13, 12, 22,
410 0, 19, 19, 0, 2, 2, 3, 5, 5, 14,
411 37, 23, 22, 22, 21, 25, 0, 22, 0, 19,
413 5, 0, 21, 21, 25, 0, 22, 0, 19, 5,
414 0, 23, 21, 21, 25, 0, 22, 0, 19, 5,
415 25, 0, 22, 0, 19, 5, 25, 0, 22, 0,
416 19, 5, 25, 1, 22, 0, 19, 5, 25, 0,
417 22, 4, 0, 24, 0, 4, 0, 0, 0, 0,
418 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
419 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
423 static yyconst flex_int32_t yy_ec
[256] =
425 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
426 1, 2, 2, 1, 1, 1, 1, 1, 1, 1,
427 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
428 1, 2, 4, 5, 6, 1, 1, 7, 8, 9,
429 1, 1, 10, 1, 11, 12, 1, 13, 14, 14,
430 14, 14, 14, 14, 14, 14, 14, 1, 1, 15,
431 16, 17, 1, 1, 18, 19, 19, 19, 20, 21,
432 22, 22, 22, 22, 22, 23, 22, 22, 22, 22,
433 22, 24, 25, 22, 26, 22, 22, 27, 28, 22,
434 29, 30, 31, 1, 32, 1, 33, 19, 34, 35,
436 36, 19, 37, 38, 39, 22, 22, 40, 41, 22,
437 42, 43, 22, 44, 22, 22, 45, 22, 22, 46,
438 22, 22, 1, 47, 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,
442 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,
447 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
448 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
449 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
450 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
451 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
455 static yyconst flex_int32_t yy_meta
[48] =
457 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
458 1, 1, 3, 3, 1, 1, 1, 3, 3, 3,
459 3, 4, 4, 4, 4, 4, 4, 4, 1, 1,
460 1, 4, 3, 3, 3, 3, 4, 4, 4, 4,
464 static yyconst flex_int16_t yy_base
[214] =
466 0, 46, 46, 50, 51, 54, 84, 56, 345, 344,
467 129, 130, 131, 132, 346, 639, 639, 639, 325, 639,
468 333, 639, 322, 326, 160, 124, 45, 321, 47, 0,
469 331, 316, 639, 286, 63, 139, 639, 639, 639, 45,
470 639, 194, 117, 228, 0, 326, 639, 64, 324, 0,
471 0, 286, 639, 135, 639, 639, 639, 312, 54, 154,
472 130, 119, 0, 639, 639, 639, 639, 639, 0, 639,
473 296, 639, 71, 146, 147, 272, 639, 639, 639, 252,
474 0, 285, 0, 72, 313, 312, 0, 0, 278, 639,
475 639, 140, 639, 639, 158, 291, 277, 309, 0, 342,
477 269, 182, 152, 162, 290, 265, 366, 0, 399, 269,
478 58, 196, 639, 639, 276, 255, 423, 0, 456, 259,
479 270, 258, 480, 0, 513, 255, 266, 281, 537, 0,
480 570, 244, 251, 275, 212, 265, 263, 227, 143, 0,
481 267, 0, 149, 639, 0, 0, 0, 0, 257, 0,
482 0, 0, 0, 256, 0, 0, 0, 0, 249, 0,
483 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
484 0, 639, 639, 606, 610, 614, 616, 620, 622, 626,
485 630, 256, 255, 253, 252, 251, 250, 248, 247, 634,
486 242, 241, 240, 234, 233, 230, 228, 221, 219, 216,
488 215, 208, 201, 198, 188, 185, 176, 154, 152, 143,
492 static yyconst flex_int16_t yy_def
[214] =
494 173, 1, 174, 174, 174, 174, 173, 7, 175, 175,
495 176, 176, 174, 174, 173, 173, 173, 173, 173, 173,
496 173, 173, 173, 173, 173, 173, 173, 173, 173, 177,
497 177, 177, 173, 173, 173, 173, 173, 173, 173, 178,
498 173, 173, 42, 179, 179, 179, 173, 173, 173, 180,
499 181, 181, 173, 178, 173, 173, 173, 173, 173, 173,
500 173, 173, 182, 173, 173, 173, 173, 173, 177, 173,
501 177, 173, 173, 173, 173, 173, 173, 173, 173, 173,
502 183, 179, 179, 173, 173, 173, 180, 181, 181, 173,
503 173, 173, 173, 173, 182, 177, 173, 173, 184, 179,
505 181, 173, 173, 173, 177, 173, 173, 185, 179, 181,
506 173, 173, 173, 173, 177, 173, 173, 186, 179, 181,
507 177, 173, 173, 187, 179, 181, 177, 173, 173, 188,
508 179, 181, 177, 173, 173, 173, 179, 181, 177, 189,
509 173, 190, 173, 173, 191, 190, 192, 193, 173, 194,
510 195, 196, 197, 173, 198, 199, 200, 201, 173, 202,
511 203, 204, 205, 206, 207, 208, 209, 210, 211, 212,
512 213, 173, 0, 173, 173, 173, 173, 173, 173, 173,
513 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
514 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
516 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
520 static yyconst flex_int16_t yy_nxt
[687] =
522 16, 17, 18, 19, 20, 16, 21, 22, 16, 16,
523 23, 24, 25, 26, 27, 28, 29, 30, 30, 30,
524 30, 30, 31, 30, 32, 30, 30, 30, 33, 16,
525 16, 30, 30, 30, 30, 30, 30, 30, 30, 30,
526 30, 30, 30, 30, 30, 30, 34, 35, 38, 78,
527 39, 36, 38, 38, 39, 41, 38, 48, 41, 64,
528 65, 49, 67, 68, 73, 84, 92, 92, 74, 85,
529 112, 112, 73, 84, 79, 40, 74, 85, 172, 40,
530 40, 171, 170, 40, 16, 17, 18, 19, 20, 16,
531 21, 22, 16, 16, 23, 24, 42, 43, 27, 28,
533 29, 44, 44, 44, 44, 45, 46, 45, 45, 45,
534 45, 45, 33, 16, 47, 45, 44, 44, 44, 44,
535 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
536 34, 38, 38, 38, 38, 59, 60, 60, 53, 53,
537 75, 94, 90, 173, 143, 169, 61, 75, 75, 62,
538 143, 144, 92, 92, 168, 93, 167, 144, 94, 102,
539 54, 54, 173, 61, 79, 59, 60, 60, 62, 52,
540 52, 59, 60, 60, 93, 102, 61, 113, 166, 62,
541 103, 76, 61, 104, 114, 62, 63, 165, 76, 76,
542 164, 111, 111, 61, 112, 112, 113, 103, 62, 61,
544 163, 114, 104, 162, 62, 63, 80, 80, 112, 112,
545 161, 81, 81, 81, 81, 102, 61, 159, 158, 62,
546 63, 157, 140, 156, 141, 141, 81, 81, 81, 81,
547 154, 102, 153, 61, 61, 152, 151, 62, 62, 63,
548 82, 82, 149, 148, 147, 82, 82, 82, 82, 145,
549 136, 61, 130, 124, 118, 108, 62, 99, 95, 160,
550 82, 82, 82, 82, 98, 98, 155, 150, 142, 99,
551 99, 99, 99, 140, 61, 140, 134, 62, 139, 141,
552 141, 138, 134, 133, 99, 99, 99, 99, 132, 61,
553 128, 61, 62, 127, 126, 122, 62, 100, 100, 121,
555 120, 116, 100, 100, 100, 100, 61, 115, 110, 106,
556 105, 62, 101, 86, 86, 97, 96, 100, 100, 100,
557 100, 107, 107, 91, 89, 86, 108, 108, 108, 108,
558 70, 61, 72, 71, 62, 70, 66, 58, 57, 56,
559 55, 108, 108, 108, 108, 173, 38, 38, 61, 173,
560 173, 173, 173, 62, 109, 109, 173, 173, 173, 109,
561 109, 109, 109, 173, 173, 173, 173, 173, 173, 173,
562 173, 173, 173, 173, 109, 109, 109, 109, 117, 117,
563 173, 173, 173, 118, 118, 118, 118, 173, 61, 173,
564 173, 62, 173, 173, 173, 173, 173, 173, 118, 118,
566 118, 118, 173, 173, 173, 61, 173, 173, 173, 173,
567 62, 119, 119, 173, 173, 173, 119, 119, 119, 119,
568 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
569 173, 119, 119, 119, 119, 123, 123, 173, 173, 173,
570 124, 124, 124, 124, 173, 61, 173, 173, 62, 173,
571 173, 173, 173, 173, 173, 124, 124, 124, 124, 173,
572 173, 173, 61, 173, 173, 173, 173, 62, 125, 125,
573 173, 173, 173, 125, 125, 125, 125, 173, 173, 173,
574 173, 173, 173, 173, 173, 173, 173, 173, 125, 125,
575 125, 125, 129, 129, 173, 173, 173, 130, 130, 130,
577 130, 173, 61, 173, 173, 62, 173, 173, 173, 173,
578 173, 173, 130, 130, 130, 130, 173, 173, 173, 61,
579 173, 173, 173, 173, 62, 131, 131, 173, 173, 173,
580 131, 131, 131, 131, 173, 173, 173, 173, 173, 173,
581 173, 173, 173, 173, 173, 131, 131, 131, 131, 135,
582 135, 173, 173, 173, 136, 136, 136, 136, 173, 61,
583 173, 173, 62, 173, 173, 173, 173, 173, 173, 136,
584 136, 136, 136, 173, 173, 173, 61, 173, 173, 173,
585 173, 62, 137, 137, 173, 173, 173, 137, 137, 137,
586 137, 173, 173, 173, 173, 173, 173, 173, 173, 173,
588 173, 173, 137, 137, 137, 137, 37, 37, 37, 37,
589 50, 50, 50, 50, 51, 51, 51, 51, 69, 69,
590 77, 173, 77, 77, 83, 83, 87, 173, 87, 87,
591 88, 173, 88, 88, 146, 173, 146, 146, 15, 173,
592 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
593 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
594 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
595 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
596 173, 173, 173, 173, 173, 173
599 static yyconst flex_int16_t yy_chk
[687] =
601 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
602 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
603 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
604 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
605 1, 1, 1, 1, 1, 1, 1, 2, 3, 40,
606 3, 2, 4, 5, 4, 5, 6, 8, 6, 27,
607 27, 8, 29, 29, 35, 48, 59, 59, 35, 48,
608 111, 111, 73, 84, 40, 3, 73, 84, 213, 4,
609 5, 212, 211, 6, 7, 7, 7, 7, 7, 7,
610 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
612 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
613 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
614 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
615 7, 11, 12, 13, 14, 26, 26, 26, 13, 14,
616 36, 62, 54, 43, 139, 210, 26, 74, 75, 26,
617 143, 139, 92, 92, 209, 61, 208, 143, 62, 92,
618 13, 14, 43, 26, 54, 60, 60, 60, 26, 11,
619 12, 25, 25, 25, 61, 92, 60, 103, 207, 60,
620 95, 36, 25, 95, 104, 25, 25, 206, 74, 75,
621 205, 102, 102, 60, 102, 102, 103, 95, 60, 25,
623 204, 104, 95, 203, 25, 25, 42, 42, 112, 112,
624 202, 42, 42, 42, 42, 112, 42, 201, 200, 42,
625 42, 199, 135, 198, 135, 135, 42, 42, 42, 42,
626 197, 112, 196, 42, 135, 195, 194, 135, 42, 42,
627 44, 44, 193, 192, 191, 44, 44, 44, 44, 189,
628 188, 135, 187, 186, 185, 184, 135, 183, 182, 159,
629 44, 44, 44, 44, 80, 80, 154, 149, 138, 80,
630 80, 80, 80, 137, 80, 136, 134, 80, 133, 141,
631 141, 132, 128, 127, 80, 80, 80, 80, 126, 141,
632 122, 80, 141, 121, 120, 116, 80, 82, 82, 115,
634 110, 106, 82, 82, 82, 82, 141, 105, 101, 97,
635 96, 141, 89, 86, 85, 76, 71, 82, 82, 82,
636 82, 98, 98, 58, 52, 49, 98, 98, 98, 98,
637 46, 98, 34, 32, 98, 31, 28, 24, 23, 21,
638 19, 98, 98, 98, 98, 15, 10, 9, 98, 0,
639 0, 0, 0, 98, 100, 100, 0, 0, 0, 100,
640 100, 100, 100, 0, 0, 0, 0, 0, 0, 0,
641 0, 0, 0, 0, 100, 100, 100, 100, 107, 107,
642 0, 0, 0, 107, 107, 107, 107, 0, 107, 0,
643 0, 107, 0, 0, 0, 0, 0, 0, 107, 107,
645 107, 107, 0, 0, 0, 107, 0, 0, 0, 0,
646 107, 109, 109, 0, 0, 0, 109, 109, 109, 109,
647 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
648 0, 109, 109, 109, 109, 117, 117, 0, 0, 0,
649 117, 117, 117, 117, 0, 117, 0, 0, 117, 0,
650 0, 0, 0, 0, 0, 117, 117, 117, 117, 0,
651 0, 0, 117, 0, 0, 0, 0, 117, 119, 119,
652 0, 0, 0, 119, 119, 119, 119, 0, 0, 0,
653 0, 0, 0, 0, 0, 0, 0, 0, 119, 119,
654 119, 119, 123, 123, 0, 0, 0, 123, 123, 123,
656 123, 0, 123, 0, 0, 123, 0, 0, 0, 0,
657 0, 0, 123, 123, 123, 123, 0, 0, 0, 123,
658 0, 0, 0, 0, 123, 125, 125, 0, 0, 0,
659 125, 125, 125, 125, 0, 0, 0, 0, 0, 0,
660 0, 0, 0, 0, 0, 125, 125, 125, 125, 129,
661 129, 0, 0, 0, 129, 129, 129, 129, 0, 129,
662 0, 0, 129, 0, 0, 0, 0, 0, 0, 129,
663 129, 129, 129, 0, 0, 0, 129, 0, 0, 0,
664 0, 129, 131, 131, 0, 0, 0, 131, 131, 131,
665 131, 0, 0, 0, 0, 0, 0, 0, 0, 0,
667 0, 0, 131, 131, 131, 131, 174, 174, 174, 174,
668 175, 175, 175, 175, 176, 176, 176, 176, 177, 177,
669 178, 0, 178, 178, 179, 179, 180, 0, 180, 180,
670 181, 0, 181, 181, 190, 0, 190, 190, 173, 173,
671 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
672 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
673 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
674 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
675 173, 173, 173, 173, 173, 173
678 static yy_state_type yy_last_accepting_state
;
679 static char *yy_last_accepting_cpos
;
681 extern int parser__flex_debug
;
682 int parser__flex_debug
= 0;
684 /* The intent behind this definition is that it'll catch
685 * any uses of REJECT which flex missed.
687 #define REJECT reject_used_but_not_detected
688 #define yymore() yymore_used_but_not_detected
689 #define YY_MORE_ADJ 0
690 #define YY_RESTORE_YY_MORE_OFFSET
696 * Copyright 2002 Ove Kaaven
698 * This library is free software; you can redistribute it and/or
699 * modify it under the terms of the GNU Lesser General Public
700 * License as published by the Free Software Foundation; either
701 * version 2.1 of the License, or (at your option) any later version.
703 * This library is distributed in the hope that it will be useful,
704 * but WITHOUT ANY WARRANTY; without even the implied warranty of
705 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
706 * Lesser General Public License for more details.
708 * You should have received a copy of the GNU Lesser General Public
709 * License along with this library; if not, write to the Free Software
710 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
712 #define YY_NO_INPUT 1
722 #include "wine/port.h"
735 #define YY_NO_UNISTD_H
741 #include "wine/wpp.h"
743 #include "parser.tab.h"
745 static void addcchar(char c
);
746 static char *get_buffered_cstring(void);
748 static char *cbuffer
;
750 static int cbufalloc
= 0;
752 static int kw_token(const char *kw
);
753 static int attr_token(const char *kw
);
755 #define MAX_IMPORT_DEPTH 10
757 YY_BUFFER_STATE state
;
761 } import_stack
[MAX_IMPORT_DEPTH
];
762 int import_stack_ptr
= 0;
764 /* converts an integer in string form to an unsigned long and prints an error
766 static unsigned int xstrtoul(const char *nptr
, char **endptr
, int base
)
771 val
= strtoul(nptr
, endptr
, base
);
772 if ((val
== ULONG_MAX
&& errno
== ERANGE
) || ((unsigned int)val
!= val
))
773 error_loc("integer constant %s is too large\n", nptr
);
777 UUID
*parse_uuid(const char *u
)
779 UUID
* uuid
= xmalloc(sizeof(UUID
));
781 /* it would be nice to use UuidFromStringA */
782 uuid
->Data1
= strtoul(u
, NULL
, 16);
783 uuid
->Data2
= strtoul(u
+9, NULL
, 16);
784 uuid
->Data3
= strtoul(u
+14, NULL
, 16);
786 memcpy(b
, u
+19, 2); uuid
->Data4
[0] = strtoul(b
, NULL
, 16);
787 memcpy(b
, u
+21, 2); uuid
->Data4
[1] = strtoul(b
, NULL
, 16);
788 memcpy(b
, u
+24, 2); uuid
->Data4
[2] = strtoul(b
, NULL
, 16);
789 memcpy(b
, u
+26, 2); uuid
->Data4
[3] = strtoul(b
, NULL
, 16);
790 memcpy(b
, u
+28, 2); uuid
->Data4
[4] = strtoul(b
, NULL
, 16);
791 memcpy(b
, u
+30, 2); uuid
->Data4
[5] = strtoul(b
, NULL
, 16);
792 memcpy(b
, u
+32, 2); uuid
->Data4
[6] = strtoul(b
, NULL
, 16);
793 memcpy(b
, u
+34, 2); uuid
->Data4
[7] = strtoul(b
, NULL
, 16);
798 **************************************************************************
799 * The flexer starts here
800 **************************************************************************
802 #line 803 "parser.yy.c"
812 #ifndef YY_NO_UNISTD_H
813 /* Special case for "unistd.h", since it is non-ANSI. We include it way
814 * down here because we want the user's section 1 to have been scanned first.
815 * The user has a chance to override it with an option.
820 #ifndef YY_EXTRA_TYPE
821 #define YY_EXTRA_TYPE void *
824 static int yy_init_globals (void );
826 /* Accessor methods to globals.
827 These are made visible to non-reentrant scanners for convenience. */
829 int parser_lex_destroy (void );
831 int parser_get_debug (void );
833 void parser_set_debug (int debug_flag
);
835 YY_EXTRA_TYPE
parser_get_extra (void );
837 void parser_set_extra (YY_EXTRA_TYPE user_defined
);
839 FILE *parser_get_in (void );
841 void parser_set_in (FILE * in_str
);
843 FILE *parser_get_out (void );
845 void parser_set_out (FILE * out_str
);
847 int parser_get_leng (void );
849 char *parser_get_text (void );
851 int parser_get_lineno (void );
853 void parser_set_lineno (int line_number
);
855 /* Macros after this point can all be overridden by user definitions in
859 #ifndef YY_SKIP_YYWRAP
861 extern "C" int parser_wrap (void );
863 extern int parser_wrap (void );
868 static void yy_flex_strncpy (char *,yyconst
char *,int );
871 #ifdef YY_NEED_STRLEN
872 static int yy_flex_strlen (yyconst
char * );
878 static int yyinput (void );
880 static int input (void );
885 static int yy_start_stack_ptr
= 0;
886 static int yy_start_stack_depth
= 0;
887 static int *yy_start_stack
= NULL
;
889 static void yy_push_state (int new_state
);
891 static void yy_pop_state (void );
893 /* Amount of stuff to slurp up with each read. */
894 #ifndef YY_READ_BUF_SIZE
896 /* On IA-64, the buffer size is 16k, not 8k */
897 #define YY_READ_BUF_SIZE 16384
899 #define YY_READ_BUF_SIZE 8192
900 #endif /* __ia64__ */
903 /* Copy whatever the last rule matched to the standard output. */
905 /* This used to be an fputs(), but since the string might contain NUL's,
906 * we now use fwrite().
908 #define ECHO do { if (fwrite( parser_text, parser_leng, 1, parser_out )) {} } while (0)
911 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
912 * is returned in "result".
915 #define YY_INPUT(buf,result,max_size) \
916 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
920 for ( n = 0; n < max_size && \
921 (c = getc( parser_in )) != EOF && c != '\n'; ++n ) \
924 buf[n++] = (char) c; \
925 if ( c == EOF && ferror( parser_in ) ) \
926 YY_FATAL_ERROR( "input in flex scanner failed" ); \
932 while ( (result = fread(buf, 1, max_size, parser_in))==0 && ferror(parser_in)) \
934 if( errno != EINTR) \
936 YY_FATAL_ERROR( "input in flex scanner failed" ); \
940 clearerr(parser_in); \
947 /* No semi-colon after return; correct usage is to write "yyterminate();" -
948 * we don't want an extra ';' after the "return" because that will cause
949 * some compilers to complain about unreachable statements.
952 #define yyterminate() return YY_NULL
955 /* Number of entries by which start-condition stack grows. */
956 #ifndef YY_START_STACK_INCR
957 #define YY_START_STACK_INCR 25
960 /* Report a fatal error. */
961 #ifndef YY_FATAL_ERROR
962 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
965 /* end tables serialization structures and prototypes */
967 /* Default declaration of generated scanner - a define so the user can
968 * easily add parameters.
971 #define YY_DECL_IS_OURS 1
973 extern int parser_lex (void);
975 #define YY_DECL int parser_lex (void)
976 #endif /* !YY_DECL */
978 /* Code executed at the beginning of each rule, after parser_text and parser_leng
981 #ifndef YY_USER_ACTION
982 #define YY_USER_ACTION
985 /* Code executed at the end of each rule. */
987 #define YY_BREAK break;
990 #define YY_RULE_SETUP \
991 if ( parser_leng > 0 ) \
992 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
993 (parser_text[parser_leng - 1] == '\n'); \
996 /** The main scanner function which does all the work.
1000 register yy_state_type yy_current_state
;
1001 register char *yy_cp
, *yy_bp
;
1002 register int yy_act
;
1004 #line 128 "parser.l"
1006 #line 1007 "parser.yy.c"
1017 (yy_start
) = 1; /* first start state */
1023 parser_out
= stdout
;
1025 if ( ! YY_CURRENT_BUFFER
) {
1026 parser_ensure_buffer_stack ();
1027 YY_CURRENT_BUFFER_LVALUE
=
1028 parser__create_buffer(parser_in
,YY_BUF_SIZE
);
1031 parser__load_buffer_state( );
1034 while ( 1 ) /* loops until end-of-file is reached */
1036 yy_cp
= (yy_c_buf_p
);
1038 /* Support of parser_text. */
1039 *yy_cp
= (yy_hold_char
);
1041 /* yy_bp points to the position in yy_ch_buf of the start of
1046 yy_current_state
= (yy_start
);
1047 yy_current_state
+= YY_AT_BOL();
1051 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
1052 if ( yy_accept
[yy_current_state
] )
1054 (yy_last_accepting_state
) = yy_current_state
;
1055 (yy_last_accepting_cpos
) = yy_cp
;
1057 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1059 yy_current_state
= (int) yy_def
[yy_current_state
];
1060 if ( yy_current_state
>= 174 )
1061 yy_c
= yy_meta
[(unsigned int) yy_c
];
1063 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1066 while ( yy_current_state
!= 173 );
1067 yy_cp
= (yy_last_accepting_cpos
);
1068 yy_current_state
= (yy_last_accepting_state
);
1071 yy_act
= yy_accept
[yy_current_state
];
1073 YY_DO_BEFORE_ACTION
;
1075 do_action
: /* This label is used only to access EOF actions. */
1078 { /* beginning of action switch */
1079 case 0: /* must back up */
1080 /* undo the effects of YY_DO_BEFORE_ACTION */
1081 *yy_cp
= (yy_hold_char
);
1082 yy_cp
= (yy_last_accepting_cpos
);
1083 yy_current_state
= (yy_last_accepting_state
);
1084 goto yy_find_action
;
1088 #line 129 "parser.l"
1089 yy_push_state(PP_PRAGMA
);
1093 #line 130 "parser.l"
1094 yy_push_state(PP_LINE
);
1098 #line 131 "parser.l"
1103 lineno
= (int)strtol(parser_text
, &cptr
, 10);
1105 error_loc("Malformed '#...' line-directive; invalid linenumber\n");
1106 fname
= strchr(cptr
, '"');
1108 error_loc("Malformed '#...' line-directive; missing filename\n");
1110 cptr
= strchr(fname
, '"');
1112 error_loc("Malformed '#...' line-directive; missing terminating \"\n");
1114 line_number
= lineno
- 1; /* We didn't read the newline */
1115 input_name
= xstrdup(fname
);
1120 #line 149 "parser.l"
1121 yyless(9); yy_pop_state(); return tCPPQUOTE
;
1125 #line 150 "parser.l"
1126 parser_lval
.str
= xstrdup(parser_text
); yy_pop_state(); return aPRAGMA
;
1130 #line 151 "parser.l"
1131 yy_push_state(QUOTE
); cbufidx
= 0;
1135 #line 152 "parser.l"
1138 parser_lval
.str
= get_buffered_cstring();
1144 #line 157 "parser.l"
1145 yy_push_state(WSTRQUOTE
); cbufidx
= 0;
1149 #line 158 "parser.l"
1152 parser_lval
.str
= get_buffered_cstring();
1158 #line 163 "parser.l"
1159 yy_push_state(SQUOTE
); cbufidx
= 0;
1163 #line 164 "parser.l"
1166 parser_lval
.str
= get_buffered_cstring();
1171 #line 170 "parser.l"
1174 #line 170 "parser.l"
1175 addcchar(parser_text
[1]);
1179 #line 171 "parser.l"
1180 addcchar(parser_text
[1]);
1184 #line 172 "parser.l"
1185 addcchar('\\'); addcchar(parser_text
[1]);
1189 #line 173 "parser.l"
1190 addcchar(parser_text
[0]);
1194 #line 174 "parser.l"
1195 yy_push_state(ATTR
); return '[';
1199 #line 175 "parser.l"
1200 yy_pop_state(); return ']';
1204 #line 176 "parser.l"
1205 return attr_token(parser_text
);
1209 #line 177 "parser.l"
1211 parser_lval
.uuid
= parse_uuid(parser_text
);
1217 #line 181 "parser.l"
1219 parser_lval
.num
= xstrtoul(parser_text
, NULL
, 0);
1225 #line 185 "parser.l"
1227 parser_lval
.num
= xstrtoul(parser_text
, NULL
, 0);
1233 #line 189 "parser.l"
1235 parser_lval
.dbl
= strtod(parser_text
, NULL
);
1240 *yy_cp
= (yy_hold_char
); /* undo effects of setting up parser_text */
1241 (yy_c_buf_p
) = yy_cp
-= 1;
1242 YY_DO_BEFORE_ACTION
; /* set up parser_text again */
1244 #line 193 "parser.l"
1249 #line 194 "parser.l"
1250 return kw_token(parser_text
);
1253 /* rule 26 can match eol */
1255 #line 195 "parser.l"
1260 #line 196 "parser.l"
1265 #line 197 "parser.l"
1270 #line 198 "parser.l"
1275 #line 199 "parser.l"
1280 #line 200 "parser.l"
1285 #line 201 "parser.l"
1290 #line 202 "parser.l"
1291 return GREATEREQUAL
;
1295 #line 203 "parser.l"
1300 #line 204 "parser.l"
1305 #line 205 "parser.l"
1310 #line 206 "parser.l"
1315 #line 207 "parser.l"
1316 return parser_text
[0];
1318 case YY_STATE_EOF(INITIAL
):
1319 case YY_STATE_EOF(QUOTE
):
1320 case YY_STATE_EOF(WSTRQUOTE
):
1321 case YY_STATE_EOF(ATTR
):
1322 case YY_STATE_EOF(PP_LINE
):
1323 case YY_STATE_EOF(PP_PRAGMA
):
1324 case YY_STATE_EOF(SQUOTE
):
1325 #line 208 "parser.l"
1327 if (import_stack_ptr
)
1334 #line 213 "parser.l"
1337 #line 1338 "parser.yy.c"
1339 case YY_END_OF_BUFFER
:
1341 /* Amount of text matched not including the EOB char. */
1342 int yy_amount_of_matched_text
= (int) (yy_cp
- (yytext_ptr
)) - 1;
1344 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1345 *yy_cp
= (yy_hold_char
);
1346 YY_RESTORE_YY_MORE_OFFSET
1348 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_NEW
)
1350 /* We're scanning a new file or input source. It's
1351 * possible that this happened because the user
1352 * just pointed parser_in at a new source and called
1353 * parser_lex(). If so, then we have to assure
1354 * consistency between YY_CURRENT_BUFFER and our
1355 * globals. Here is the right place to do so, because
1356 * this is the first action (other than possibly a
1357 * back-up) that will match for the new input source.
1359 (yy_n_chars
) = YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
1360 YY_CURRENT_BUFFER_LVALUE
->yy_input_file
= parser_in
;
1361 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
= YY_BUFFER_NORMAL
;
1364 /* Note that here we test for yy_c_buf_p "<=" to the position
1365 * of the first EOB in the buffer, since yy_c_buf_p will
1366 * already have been incremented past the NUL character
1367 * (since all states make transitions on EOB to the
1368 * end-of-buffer state). Contrast this with the test
1371 if ( (yy_c_buf_p
) <= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
)] )
1372 { /* This was really a NUL. */
1373 yy_state_type yy_next_state
;
1375 (yy_c_buf_p
) = (yytext_ptr
) + yy_amount_of_matched_text
;
1377 yy_current_state
= yy_get_previous_state( );
1379 /* Okay, we're now positioned to make the NUL
1380 * transition. We couldn't have
1381 * yy_get_previous_state() go ahead and do it
1382 * for us because it doesn't know how to deal
1383 * with the possibility of jamming (and we don't
1384 * want to build jamming into it because then it
1385 * will run more slowly).
1388 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
1390 yy_bp
= (yytext_ptr
) + YY_MORE_ADJ
;
1392 if ( yy_next_state
)
1394 /* Consume the NUL. */
1395 yy_cp
= ++(yy_c_buf_p
);
1396 yy_current_state
= yy_next_state
;
1402 yy_cp
= (yy_last_accepting_cpos
);
1403 yy_current_state
= (yy_last_accepting_state
);
1404 goto yy_find_action
;
1408 else switch ( yy_get_next_buffer( ) )
1410 case EOB_ACT_END_OF_FILE
:
1412 (yy_did_buffer_switch_on_eof
) = 0;
1414 if ( parser_wrap( ) )
1416 /* Note: because we've taken care in
1417 * yy_get_next_buffer() to have set up
1418 * parser_text, we can now set up
1419 * yy_c_buf_p so that if some total
1420 * hoser (like flex itself) wants to
1421 * call the scanner after we return the
1422 * YY_NULL, it'll still work - another
1423 * YY_NULL will get returned.
1425 (yy_c_buf_p
) = (yytext_ptr
) + YY_MORE_ADJ
;
1427 yy_act
= YY_STATE_EOF(YY_START
);
1433 if ( ! (yy_did_buffer_switch_on_eof
) )
1439 case EOB_ACT_CONTINUE_SCAN
:
1441 (yytext_ptr
) + yy_amount_of_matched_text
;
1443 yy_current_state
= yy_get_previous_state( );
1445 yy_cp
= (yy_c_buf_p
);
1446 yy_bp
= (yytext_ptr
) + YY_MORE_ADJ
;
1449 case EOB_ACT_LAST_MATCH
:
1451 &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
)];
1453 yy_current_state
= yy_get_previous_state( );
1455 yy_cp
= (yy_c_buf_p
);
1456 yy_bp
= (yytext_ptr
) + YY_MORE_ADJ
;
1457 goto yy_find_action
;
1464 "fatal flex scanner internal error--no action found" );
1465 } /* end of action switch */
1466 } /* end of scanning one token */
1467 } /* end of parser_lex */
1469 /* yy_get_next_buffer - try to read in a new buffer
1471 * Returns a code representing an action:
1472 * EOB_ACT_LAST_MATCH -
1473 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1474 * EOB_ACT_END_OF_FILE - end of file
1476 static int yy_get_next_buffer (void)
1478 register char *dest
= YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
;
1479 register char *source
= (yytext_ptr
);
1480 register int number_to_move
, i
;
1483 if ( (yy_c_buf_p
) > &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
) + 1] )
1485 "fatal flex scanner internal error--end of buffer missed" );
1487 if ( YY_CURRENT_BUFFER_LVALUE
->yy_fill_buffer
== 0 )
1488 { /* Don't try to fill the buffer, so this is an EOF. */
1489 if ( (yy_c_buf_p
) - (yytext_ptr
) - YY_MORE_ADJ
== 1 )
1491 /* We matched a single character, the EOB, so
1492 * treat this as a final EOF.
1494 return EOB_ACT_END_OF_FILE
;
1499 /* We matched some text prior to the EOB, first
1502 return EOB_ACT_LAST_MATCH
;
1506 /* Try to read more data. */
1508 /* First move last chars to start of buffer. */
1509 number_to_move
= (int) ((yy_c_buf_p
) - (yytext_ptr
)) - 1;
1511 for ( i
= 0; i
< number_to_move
; ++i
)
1512 *(dest
++) = *(source
++);
1514 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
1515 /* don't do the read, it's not guaranteed to return an EOF,
1518 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
) = 0;
1523 YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
- number_to_move
- 1;
1525 while ( num_to_read
<= 0 )
1526 { /* Not enough room in the buffer - grow it. */
1528 /* just a shorter name for the current buffer */
1529 YY_BUFFER_STATE b
= YY_CURRENT_BUFFER
;
1531 int yy_c_buf_p_offset
=
1532 (int) ((yy_c_buf_p
) - b
->yy_ch_buf
);
1534 if ( b
->yy_is_our_buffer
)
1536 int new_size
= b
->yy_buf_size
* 2;
1538 if ( new_size
<= 0 )
1539 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
1541 b
->yy_buf_size
*= 2;
1543 b
->yy_ch_buf
= (char *)
1544 /* Include room in for 2 EOB chars. */
1545 parser_realloc((void *) b
->yy_ch_buf
,b
->yy_buf_size
+ 2 );
1548 /* Can't grow it, we don't own it. */
1551 if ( ! b
->yy_ch_buf
)
1553 "fatal error - scanner input buffer overflow" );
1555 (yy_c_buf_p
) = &b
->yy_ch_buf
[yy_c_buf_p_offset
];
1557 num_to_read
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
-
1562 if ( num_to_read
> YY_READ_BUF_SIZE
)
1563 num_to_read
= YY_READ_BUF_SIZE
;
1565 /* Read in more data. */
1566 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[number_to_move
]),
1567 (yy_n_chars
), (size_t) num_to_read
);
1569 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
);
1572 if ( (yy_n_chars
) == 0 )
1574 if ( number_to_move
== YY_MORE_ADJ
)
1576 ret_val
= EOB_ACT_END_OF_FILE
;
1577 parser_restart(parser_in
);
1582 ret_val
= EOB_ACT_LAST_MATCH
;
1583 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
=
1584 YY_BUFFER_EOF_PENDING
;
1589 ret_val
= EOB_ACT_CONTINUE_SCAN
;
1591 if ((yy_size_t
) ((yy_n_chars
) + number_to_move
) > YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
) {
1592 /* Extend the array by 50%, plus the number we really need. */
1593 yy_size_t new_size
= (yy_n_chars
) + number_to_move
+ ((yy_n_chars
) >> 1);
1594 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
= (char *) parser_realloc((void *) YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
,new_size
);
1595 if ( ! YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
)
1596 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1599 (yy_n_chars
) += number_to_move
;
1600 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
)] = YY_END_OF_BUFFER_CHAR
;
1601 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
) + 1] = YY_END_OF_BUFFER_CHAR
;
1603 (yytext_ptr
) = &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[0];
1608 /* yy_get_previous_state - get the state just before the EOB char was reached */
1610 static yy_state_type
yy_get_previous_state (void)
1612 register yy_state_type yy_current_state
;
1613 register char *yy_cp
;
1615 yy_current_state
= (yy_start
);
1616 yy_current_state
+= YY_AT_BOL();
1618 for ( yy_cp
= (yytext_ptr
) + YY_MORE_ADJ
; yy_cp
< (yy_c_buf_p
); ++yy_cp
)
1620 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
1621 if ( yy_accept
[yy_current_state
] )
1623 (yy_last_accepting_state
) = yy_current_state
;
1624 (yy_last_accepting_cpos
) = yy_cp
;
1626 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1628 yy_current_state
= (int) yy_def
[yy_current_state
];
1629 if ( yy_current_state
>= 174 )
1630 yy_c
= yy_meta
[(unsigned int) yy_c
];
1632 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1635 return yy_current_state
;
1638 /* yy_try_NUL_trans - try to make a transition on the NUL character
1641 * next_state = yy_try_NUL_trans( current_state );
1643 static yy_state_type
yy_try_NUL_trans (yy_state_type yy_current_state
)
1645 register int yy_is_jam
;
1646 register char *yy_cp
= (yy_c_buf_p
);
1648 register YY_CHAR yy_c
= 1;
1649 if ( yy_accept
[yy_current_state
] )
1651 (yy_last_accepting_state
) = yy_current_state
;
1652 (yy_last_accepting_cpos
) = yy_cp
;
1654 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1656 yy_current_state
= (int) yy_def
[yy_current_state
];
1657 if ( yy_current_state
>= 174 )
1658 yy_c
= yy_meta
[(unsigned int) yy_c
];
1660 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1661 yy_is_jam
= (yy_current_state
== 173);
1663 return yy_is_jam
? 0 : yy_current_state
;
1668 static int yyinput (void)
1670 static int input (void)
1676 *(yy_c_buf_p
) = (yy_hold_char
);
1678 if ( *(yy_c_buf_p
) == YY_END_OF_BUFFER_CHAR
)
1680 /* yy_c_buf_p now points to the character we want to return.
1681 * If this occurs *before* the EOB characters, then it's a
1682 * valid NUL; if not, then we've hit the end of the buffer.
1684 if ( (yy_c_buf_p
) < &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
)] )
1685 /* This was really a NUL. */
1686 *(yy_c_buf_p
) = '\0';
1689 { /* need more input */
1690 int offset
= (yy_c_buf_p
) - (yytext_ptr
);
1693 switch ( yy_get_next_buffer( ) )
1695 case EOB_ACT_LAST_MATCH
:
1696 /* This happens because yy_g_n_b()
1697 * sees that we've accumulated a
1698 * token and flags that we need to
1699 * try matching the token before
1700 * proceeding. But for input(),
1701 * there's no matching to consider.
1702 * So convert the EOB_ACT_LAST_MATCH
1703 * to EOB_ACT_END_OF_FILE.
1706 /* Reset buffer status. */
1707 parser_restart(parser_in
);
1711 case EOB_ACT_END_OF_FILE
:
1713 if ( parser_wrap( ) )
1716 if ( ! (yy_did_buffer_switch_on_eof
) )
1725 case EOB_ACT_CONTINUE_SCAN
:
1726 (yy_c_buf_p
) = (yytext_ptr
) + offset
;
1732 c
= *(unsigned char *) (yy_c_buf_p
); /* cast for 8-bit char's */
1733 *(yy_c_buf_p
) = '\0'; /* preserve parser_text */
1734 (yy_hold_char
) = *++(yy_c_buf_p
);
1736 YY_CURRENT_BUFFER_LVALUE
->yy_at_bol
= (c
== '\n');
1740 #endif /* ifndef YY_NO_INPUT */
1742 /** Immediately switch to a different input stream.
1743 * @param input_file A readable stream.
1745 * @note This function does not reset the start condition to @c INITIAL .
1747 void parser_restart (FILE * input_file
)
1750 if ( ! YY_CURRENT_BUFFER
){
1751 parser_ensure_buffer_stack ();
1752 YY_CURRENT_BUFFER_LVALUE
=
1753 parser__create_buffer(parser_in
,YY_BUF_SIZE
);
1756 parser__init_buffer(YY_CURRENT_BUFFER
,input_file
);
1757 parser__load_buffer_state( );
1760 /** Switch to a different input buffer.
1761 * @param new_buffer The new input buffer.
1764 void parser__switch_to_buffer (YY_BUFFER_STATE new_buffer
)
1767 /* TODO. We should be able to replace this entire function body
1769 * parser_pop_buffer_state();
1770 * parser_push_buffer_state(new_buffer);
1772 parser_ensure_buffer_stack ();
1773 if ( YY_CURRENT_BUFFER
== new_buffer
)
1776 if ( YY_CURRENT_BUFFER
)
1778 /* Flush out information for old buffer. */
1779 *(yy_c_buf_p
) = (yy_hold_char
);
1780 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= (yy_c_buf_p
);
1781 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
);
1784 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
1785 parser__load_buffer_state( );
1787 /* We don't actually know whether we did this switch during
1788 * EOF (parser_wrap()) processing, but the only time this flag
1789 * is looked at is after parser_wrap() is called, so it's safe
1790 * to go ahead and always set it.
1792 (yy_did_buffer_switch_on_eof
) = 1;
1795 static void parser__load_buffer_state (void)
1797 (yy_n_chars
) = YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
1798 (yytext_ptr
) = (yy_c_buf_p
) = YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
;
1799 parser_in
= YY_CURRENT_BUFFER_LVALUE
->yy_input_file
;
1800 (yy_hold_char
) = *(yy_c_buf_p
);
1803 /** Allocate and initialize an input buffer state.
1804 * @param file A readable stream.
1805 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1807 * @return the allocated buffer state.
1809 YY_BUFFER_STATE
parser__create_buffer (FILE * file
, int size
)
1813 b
= (YY_BUFFER_STATE
) parser_alloc(sizeof( struct yy_buffer_state
) );
1815 YY_FATAL_ERROR( "out of dynamic memory in parser__create_buffer()" );
1817 b
->yy_buf_size
= size
;
1819 /* yy_ch_buf has to be 2 characters longer than the size given because
1820 * we need to put in 2 end-of-buffer characters.
1822 b
->yy_ch_buf
= (char *) parser_alloc(b
->yy_buf_size
+ 2 );
1823 if ( ! b
->yy_ch_buf
)
1824 YY_FATAL_ERROR( "out of dynamic memory in parser__create_buffer()" );
1826 b
->yy_is_our_buffer
= 1;
1828 parser__init_buffer(b
,file
);
1833 /** Destroy the buffer.
1834 * @param b a buffer created with parser__create_buffer()
1837 void parser__delete_buffer (YY_BUFFER_STATE b
)
1843 if ( b
== YY_CURRENT_BUFFER
) /* Not sure if we should pop here. */
1844 YY_CURRENT_BUFFER_LVALUE
= (YY_BUFFER_STATE
) 0;
1846 if ( b
->yy_is_our_buffer
)
1847 parser_free((void *) b
->yy_ch_buf
);
1849 parser_free((void *) b
);
1852 /* Initializes or reinitializes a buffer.
1853 * This function is sometimes called more than once on the same buffer,
1854 * such as during a parser_restart() or at EOF.
1856 static void parser__init_buffer (YY_BUFFER_STATE b
, FILE * file
)
1861 parser__flush_buffer(b
);
1863 b
->yy_input_file
= file
;
1864 b
->yy_fill_buffer
= 1;
1866 /* If b is the current buffer, then parser__init_buffer was _probably_
1867 * called from parser_restart() or through yy_get_next_buffer.
1868 * In that case, we don't want to reset the lineno or column.
1870 if (b
!= YY_CURRENT_BUFFER
){
1871 b
->yy_bs_lineno
= 1;
1872 b
->yy_bs_column
= 0;
1875 b
->yy_is_interactive
= 0;
1880 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1881 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1884 void parser__flush_buffer (YY_BUFFER_STATE b
)
1891 /* We always need two end-of-buffer characters. The first causes
1892 * a transition to the end-of-buffer state. The second causes
1893 * a jam in that state.
1895 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
1896 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1898 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
1901 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1903 if ( b
== YY_CURRENT_BUFFER
)
1904 parser__load_buffer_state( );
1907 /** Pushes the new state onto the stack. The new state becomes
1908 * the current state. This function will allocate the stack
1910 * @param new_buffer The new state.
1913 void parser_push_buffer_state (YY_BUFFER_STATE new_buffer
)
1915 if (new_buffer
== NULL
)
1918 parser_ensure_buffer_stack();
1920 /* This block is copied from parser__switch_to_buffer. */
1921 if ( YY_CURRENT_BUFFER
)
1923 /* Flush out information for old buffer. */
1924 *(yy_c_buf_p
) = (yy_hold_char
);
1925 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= (yy_c_buf_p
);
1926 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
);
1929 /* Only push if top exists. Otherwise, replace top. */
1930 if (YY_CURRENT_BUFFER
)
1931 (yy_buffer_stack_top
)++;
1932 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
1934 /* copied from parser__switch_to_buffer. */
1935 parser__load_buffer_state( );
1936 (yy_did_buffer_switch_on_eof
) = 1;
1939 /** Removes and deletes the top of the stack, if present.
1940 * The next element becomes the new top.
1943 void parser_pop_buffer_state (void)
1945 if (!YY_CURRENT_BUFFER
)
1948 parser__delete_buffer(YY_CURRENT_BUFFER
);
1949 YY_CURRENT_BUFFER_LVALUE
= NULL
;
1950 if ((yy_buffer_stack_top
) > 0)
1951 --(yy_buffer_stack_top
);
1953 if (YY_CURRENT_BUFFER
) {
1954 parser__load_buffer_state( );
1955 (yy_did_buffer_switch_on_eof
) = 1;
1959 /* Allocates the stack if it does not exist.
1960 * Guarantees space for at least one push.
1962 static void parser_ensure_buffer_stack (void)
1966 if (!(yy_buffer_stack
)) {
1968 /* First allocation is just for 2 elements, since we don't know if this
1969 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1970 * immediate realloc on the next call.
1973 (yy_buffer_stack
) = (struct yy_buffer_state
**)parser_alloc
1974 (num_to_alloc
* sizeof(struct yy_buffer_state
*)
1976 if ( ! (yy_buffer_stack
) )
1977 YY_FATAL_ERROR( "out of dynamic memory in parser_ensure_buffer_stack()" );
1979 memset((yy_buffer_stack
), 0, num_to_alloc
* sizeof(struct yy_buffer_state
*));
1981 (yy_buffer_stack_max
) = num_to_alloc
;
1982 (yy_buffer_stack_top
) = 0;
1986 if ((yy_buffer_stack_top
) >= ((yy_buffer_stack_max
)) - 1){
1988 /* Increase the buffer to prepare for a possible push. */
1989 int grow_size
= 8 /* arbitrary grow size */;
1991 num_to_alloc
= (yy_buffer_stack_max
) + grow_size
;
1992 (yy_buffer_stack
) = (struct yy_buffer_state
**)parser_realloc
1994 num_to_alloc
* sizeof(struct yy_buffer_state
*)
1996 if ( ! (yy_buffer_stack
) )
1997 YY_FATAL_ERROR( "out of dynamic memory in parser_ensure_buffer_stack()" );
1999 /* zero only the new slots.*/
2000 memset((yy_buffer_stack
) + (yy_buffer_stack_max
), 0, grow_size
* sizeof(struct yy_buffer_state
*));
2001 (yy_buffer_stack_max
) = num_to_alloc
;
2005 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2006 * @param base the character buffer
2007 * @param size the size in bytes of the character buffer
2009 * @return the newly allocated buffer state object.
2011 YY_BUFFER_STATE
parser__scan_buffer (char * base
, yy_size_t size
)
2016 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
2017 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
2018 /* They forgot to leave room for the EOB's. */
2021 b
= (YY_BUFFER_STATE
) parser_alloc(sizeof( struct yy_buffer_state
) );
2023 YY_FATAL_ERROR( "out of dynamic memory in parser__scan_buffer()" );
2025 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
2026 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
2027 b
->yy_is_our_buffer
= 0;
2028 b
->yy_input_file
= 0;
2029 b
->yy_n_chars
= b
->yy_buf_size
;
2030 b
->yy_is_interactive
= 0;
2032 b
->yy_fill_buffer
= 0;
2033 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2035 parser__switch_to_buffer(b
);
2040 /** Setup the input buffer state to scan a string. The next call to parser_lex() will
2041 * scan from a @e copy of @a str.
2042 * @param yystr a NUL-terminated string to scan
2044 * @return the newly allocated buffer state object.
2045 * @note If you want to scan bytes that may contain NUL values, then use
2046 * parser__scan_bytes() instead.
2048 YY_BUFFER_STATE
parser__scan_string (yyconst
char * yystr
)
2051 return parser__scan_bytes(yystr
,strlen(yystr
) );
2054 /** Setup the input buffer state to scan the given bytes. The next call to parser_lex() will
2055 * scan from a @e copy of @a bytes.
2056 * @param yybytes the byte buffer to scan
2057 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2059 * @return the newly allocated buffer state object.
2061 YY_BUFFER_STATE
parser__scan_bytes (yyconst
char * yybytes
, int _yybytes_len
)
2068 /* Get memory for full buffer, including space for trailing EOB's. */
2069 n
= _yybytes_len
+ 2;
2070 buf
= (char *) parser_alloc(n
);
2072 YY_FATAL_ERROR( "out of dynamic memory in parser__scan_bytes()" );
2074 for ( i
= 0; i
< _yybytes_len
; ++i
)
2075 buf
[i
] = yybytes
[i
];
2077 buf
[_yybytes_len
] = buf
[_yybytes_len
+1] = YY_END_OF_BUFFER_CHAR
;
2079 b
= parser__scan_buffer(buf
,n
);
2081 YY_FATAL_ERROR( "bad buffer in parser__scan_bytes()" );
2083 /* It's okay to grow etc. this buffer, and we should throw it
2084 * away when we're done.
2086 b
->yy_is_our_buffer
= 1;
2091 static void yy_push_state (int new_state
)
2093 if ( (yy_start_stack_ptr
) >= (yy_start_stack_depth
) )
2097 (yy_start_stack_depth
) += YY_START_STACK_INCR
;
2098 new_size
= (yy_start_stack_depth
) * sizeof( int );
2100 if ( ! (yy_start_stack
) )
2101 (yy_start_stack
) = (int *) parser_alloc(new_size
);
2104 (yy_start_stack
) = (int *) parser_realloc((void *) (yy_start_stack
),new_size
);
2106 if ( ! (yy_start_stack
) )
2107 YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
2110 (yy_start_stack
)[(yy_start_stack_ptr
)++] = YY_START
;
2115 static void yy_pop_state (void)
2117 if ( --(yy_start_stack_ptr
) < 0 )
2118 YY_FATAL_ERROR( "start-condition stack underflow" );
2120 BEGIN((yy_start_stack
)[(yy_start_stack_ptr
)]);
2123 #ifndef YY_EXIT_FAILURE
2124 #define YY_EXIT_FAILURE 2
2127 static void yy_fatal_error (yyconst
char* msg
)
2129 (void) fprintf( stderr
, "%s\n", msg
);
2130 exit( YY_EXIT_FAILURE
);
2133 /* Redefine yyless() so it works in section 3 code. */
2139 /* Undo effects of setting up parser_text. */ \
2140 int yyless_macro_arg = (n); \
2141 YY_LESS_LINENO(yyless_macro_arg);\
2142 parser_text[parser_leng] = (yy_hold_char); \
2143 (yy_c_buf_p) = parser_text + yyless_macro_arg; \
2144 (yy_hold_char) = *(yy_c_buf_p); \
2145 *(yy_c_buf_p) = '\0'; \
2146 parser_leng = yyless_macro_arg; \
2150 /* Accessor methods (get/set functions) to struct members. */
2152 /** Get the current line number.
2155 int parser_get_lineno (void)
2158 return parser_lineno
;
2161 /** Get the input stream.
2164 FILE *parser_get_in (void)
2169 /** Get the output stream.
2172 FILE *parser_get_out (void)
2177 /** Get the length of the current token.
2180 int parser_get_leng (void)
2185 /** Get the current token.
2189 char *parser_get_text (void)
2194 /** Set the current line number.
2195 * @param line_number
2198 void parser_set_lineno (int line_number
)
2201 parser_lineno
= line_number
;
2204 /** Set the input stream. This does not discard the current
2206 * @param in_str A readable stream.
2208 * @see parser__switch_to_buffer
2210 void parser_set_in (FILE * in_str
)
2212 parser_in
= in_str
;
2215 void parser_set_out (FILE * out_str
)
2217 parser_out
= out_str
;
2220 int parser_get_debug (void)
2222 return parser__flex_debug
;
2225 void parser_set_debug (int bdebug
)
2227 parser__flex_debug
= bdebug
;
2230 static int yy_init_globals (void)
2232 /* Initialization is the same as for the non-reentrant scanner.
2233 * This function is called from parser_lex_destroy(), so don't allocate here.
2236 (yy_buffer_stack
) = 0;
2237 (yy_buffer_stack_top
) = 0;
2238 (yy_buffer_stack_max
) = 0;
2239 (yy_c_buf_p
) = (char *) 0;
2243 (yy_start_stack_ptr
) = 0;
2244 (yy_start_stack_depth
) = 0;
2245 (yy_start_stack
) = NULL
;
2247 /* Defined in main.c */
2250 parser_out
= stdout
;
2252 parser_in
= (FILE *) 0;
2253 parser_out
= (FILE *) 0;
2256 /* For future reference: Set errno on error, since we are called by
2262 /* parser_lex_destroy is for both reentrant and non-reentrant scanners. */
2263 int parser_lex_destroy (void)
2266 /* Pop the buffer stack, destroying each element. */
2267 while(YY_CURRENT_BUFFER
){
2268 parser__delete_buffer(YY_CURRENT_BUFFER
);
2269 YY_CURRENT_BUFFER_LVALUE
= NULL
;
2270 parser_pop_buffer_state();
2273 /* Destroy the stack itself. */
2274 parser_free((yy_buffer_stack
) );
2275 (yy_buffer_stack
) = NULL
;
2277 /* Destroy the start condition stack. */
2278 parser_free((yy_start_stack
) );
2279 (yy_start_stack
) = NULL
;
2281 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2282 * parser_lex() is called, initialization will occur. */
2289 * Internal utility routines.
2293 static void yy_flex_strncpy (char* s1
, yyconst
char * s2
, int n
)
2296 for ( i
= 0; i
< n
; ++i
)
2301 #ifdef YY_NEED_STRLEN
2302 static int yy_flex_strlen (yyconst
char * s
)
2305 for ( n
= 0; s
[n
]; ++n
)
2312 void *parser_alloc (yy_size_t size
)
2314 return (void *) malloc( size
);
2317 void *parser_realloc (void * ptr
, yy_size_t size
)
2319 /* The cast to (char *) in the following accommodates both
2320 * implementations that use char* generic pointers, and those
2321 * that use void* generic pointers. It works with the latter
2322 * because both ANSI C and C++ allow castless assignment from
2323 * any pointer type to void*, and deal with argument conversions
2324 * as though doing an assignment.
2326 return (void *) realloc( (char *) ptr
, size
);
2329 void parser_free (void * ptr
)
2331 free( (char *) ptr
); /* see parser_realloc() for (char *) cast */
2334 #define YYTABLES_NAME "yytables"
2336 #line 213 "parser.l"
2341 int parser_wrap(void)
2352 /* This table MUST be alphabetically sorted on the kw field */
2353 static const struct keyword keywords
[] = {
2357 {"__cdecl", tCDECL
},
2358 {"__fastcall", tFASTCALL
},
2359 {"__int3264", tINT3264
},
2360 {"__int64", tINT64
},
2361 {"__pascal", tPASCAL
},
2362 {"__stdcall", tSTDCALL
},
2364 {"_fastcall", tFASTCALL
},
2365 {"_pascal", tPASCAL
},
2366 {"_stdcall", tSTDCALL
},
2367 {"boolean", tBOOLEAN
},
2372 {"coclass", tCOCLASS
},
2374 {"cpp_quote", tCPPQUOTE
},
2375 {"default", tDEFAULT
},
2376 {"dispinterface", tDISPINTERFACE
},
2377 {"double", tDOUBLE
},
2379 {"error_status_t", tERRORSTATUST
},
2380 {"extern", tEXTERN
},
2382 {"handle_t", tHANDLET
},
2384 {"import", tIMPORT
},
2385 {"importlib", tIMPORTLIB
},
2386 {"inline", tINLINE
},
2388 {"interface", tINTERFACE
},
2389 {"library", tLIBRARY
},
2391 {"methods", tMETHODS
},
2392 {"module", tMODULE
},
2393 {"namespace", tNAMESPACE
},
2394 {"pascal", tPASCAL
},
2395 {"properties", tPROPERTIES
},
2396 {"register", tREGISTER
},
2398 {"signed", tSIGNED
},
2399 {"sizeof", tSIZEOF
},
2401 {"static", tSTATIC
},
2402 {"stdcall", tSTDCALL
},
2403 {"struct", tSTRUCT
},
2404 {"switch", tSWITCH
},
2405 {"typedef", tTYPEDEF
},
2407 {"unsigned", tUNSIGNED
},
2409 {"wchar_t", tWCHAR
},
2411 #define NKEYWORDS (sizeof(keywords)/sizeof(keywords[0]))
2413 /* keywords only recognized in attribute lists
2414 * This table MUST be alphabetically sorted on the kw field
2416 static const struct keyword attr_keywords
[] =
2418 {"aggregatable", tAGGREGATABLE
},
2419 {"allocate", tALLOCATE
},
2420 {"annotation", tANNOTATION
},
2421 {"apartment", tAPARTMENT
},
2422 {"appobject", tAPPOBJECT
},
2424 {"async_uuid", tASYNCUUID
},
2425 {"auto_handle", tAUTOHANDLE
},
2426 {"bindable", tBINDABLE
},
2428 {"broadcast", tBROADCAST
},
2429 {"byte_count", tBYTECOUNT
},
2430 {"call_as", tCALLAS
},
2431 {"callback", tCALLBACK
},
2433 {"comm_status", tCOMMSTATUS
},
2434 {"context_handle", tCONTEXTHANDLE
},
2435 {"context_handle_noserialize", tCONTEXTHANDLENOSERIALIZE
},
2436 {"context_handle_serialize", tCONTEXTHANDLENOSERIALIZE
},
2437 {"control", tCONTROL
},
2438 {"decode", tDECODE
},
2439 {"defaultbind", tDEFAULTBIND
},
2440 {"defaultcollelem", tDEFAULTCOLLELEM
},
2441 {"defaultvalue", tDEFAULTVALUE
},
2442 {"defaultvtable", tDEFAULTVTABLE
},
2443 {"disable_consistency_check", tDISABLECONSISTENCYCHECK
},
2444 {"displaybind", tDISPLAYBIND
},
2445 {"dllname", tDLLNAME
},
2447 {"enable_allocate", tENABLEALLOCATE
},
2448 {"encode", tENCODE
},
2449 {"endpoint", tENDPOINT
},
2451 {"explicit_handle", tEXPLICITHANDLE
},
2452 {"fault_status", tFAULTSTATUS
},
2453 {"force_allocate", tFORCEALLOCATE
},
2455 {"handle", tHANDLE
},
2456 {"helpcontext", tHELPCONTEXT
},
2457 {"helpfile", tHELPFILE
},
2458 {"helpstring", tHELPSTRING
},
2459 {"helpstringcontext", tHELPSTRINGCONTEXT
},
2460 {"helpstringdll", tHELPSTRINGDLL
},
2461 {"hidden", tHIDDEN
},
2463 {"idempotent", tIDEMPOTENT
},
2464 {"ignore", tIGNORE
},
2466 {"immediatebind", tIMMEDIATEBIND
},
2467 {"implicit_handle", tIMPLICITHANDLE
},
2469 {"in_line", tIN_LINE
},
2470 {"input_sync", tINPUTSYNC
},
2472 {"length_is", tLENGTHIS
},
2473 {"licensed", tLICENSED
},
2476 {"message", tMESSAGE
},
2477 {"neutral", tNEUTRAL
},
2478 {"nocode", tNOCODE
},
2479 {"nonbrowsable", tNONBROWSABLE
},
2480 {"noncreatable", tNONCREATABLE
},
2481 {"nonextensible", tNONEXTENSIBLE
},
2482 {"notify", tNOTIFY
},
2483 {"notify_flag", tNOTIFYFLAG
},
2484 {"object", tOBJECT
},
2486 {"oleautomation", tOLEAUTOMATION
},
2487 {"optimize", tOPTIMIZE
},
2488 {"optional", tOPTIONAL
},
2490 {"partial_ignore", tPARTIALIGNORE
},
2491 {"pointer_default", tPOINTERDEFAULT
},
2492 {"progid", tPROGID
},
2493 {"propget", tPROPGET
},
2494 {"propput", tPROPPUT
},
2495 {"propputref", tPROPPUTREF
},
2498 {"public", tPUBLIC
},
2500 {"readonly", tREADONLY
},
2502 {"represent_as", tREPRESENTAS
},
2503 {"requestedit", tREQUESTEDIT
},
2504 {"restricted", tRESTRICTED
},
2505 {"retval", tRETVAL
},
2506 {"single", tSINGLE
},
2507 {"size_is", tSIZEIS
},
2508 {"source", tSOURCE
},
2509 {"strict_context_handle", tSTRICTCONTEXTHANDLE
},
2510 {"string", tSTRING
},
2511 {"switch_is", tSWITCHIS
},
2512 {"switch_type", tSWITCHTYPE
},
2513 {"threading", tTHREADING
},
2514 {"transmit_as", tTRANSMITAS
},
2515 {"uidefault", tUIDEFAULT
},
2516 {"unique", tUNIQUE
},
2517 {"user_marshal", tUSERMARSHAL
},
2518 {"usesgetlasterror", tUSESGETLASTERROR
},
2520 {"v1_enum", tV1ENUM
},
2521 {"vararg", tVARARG
},
2522 {"version", tVERSION
},
2523 {"vi_progid", tVIPROGID
},
2524 {"wire_marshal", tWIREMARSHAL
},
2535 #define KWP(p) ((const struct keyword *)(p))
2537 static int kw_cmp_func(const void *s1
, const void *s2
)
2539 return strcmp(KWP(s1
)->kw
, KWP(s2
)->kw
);
2542 static int kw_token(const char *kw
)
2544 struct keyword key
, *kwp
;
2546 kwp
= bsearch(&key
, keywords
, NKEYWORDS
, sizeof(keywords
[0]), kw_cmp_func
);
2547 if (kwp
&& (do_rt_extension
|| kwp
->token
!= tNAMESPACE
)) {
2548 parser_lval
.str
= xstrdup(kwp
->kw
);
2551 parser_lval
.str
= xstrdup(kw
);
2552 return is_type(kw
) ? aKNOWNTYPE
: aIDENTIFIER
;
2555 static int attr_token(const char *kw
)
2557 struct keyword key
, *kwp
;
2559 kwp
= bsearch(&key
, attr_keywords
, sizeof(attr_keywords
)/sizeof(attr_keywords
[0]),
2560 sizeof(attr_keywords
[0]), kw_cmp_func
);
2562 parser_lval
.str
= xstrdup(kwp
->kw
);
2565 return kw_token(kw
);
2568 static void addcchar(char c
)
2570 if(cbufidx
>= cbufalloc
)
2573 cbuffer
= xrealloc(cbuffer
, cbufalloc
* sizeof(cbuffer
[0]));
2574 if(cbufalloc
> 65536)
2575 parser_warning("Reallocating string buffer larger than 64kB\n");
2577 cbuffer
[cbufidx
++] = c
;
2580 static char *get_buffered_cstring(void)
2583 return xstrdup(cbuffer
);
2586 void pop_import(void)
2588 int ptr
= import_stack_ptr
-1;
2591 parser__delete_buffer(YY_CURRENT_BUFFER
);
2592 parser__switch_to_buffer(import_stack
[ptr
].state
);
2597 temp_name
= import_stack
[ptr
].temp_name
;
2598 input_name
= import_stack
[ptr
].input_name
;
2599 line_number
= import_stack
[ptr
].line_number
;
2605 struct imports
*next
;
2608 int do_import(char *fname
)
2612 struct imports
*import
;
2613 int ptr
= import_stack_ptr
;
2616 import
= first_import
;
2617 while (import
&& strcmp(import
->name
, fname
))
2618 import
= import
->next
;
2619 if (import
) return 0; /* already imported */
2621 import
= xmalloc(sizeof(struct imports
));
2622 import
->name
= xstrdup(fname
);
2623 import
->next
= first_import
;
2624 first_import
= import
;
2626 /* don't search for a file name with a path in the include directories,
2627 * for compatibility with MIDL */
2628 if (strchr( fname
, '/' ) || strchr( fname
, '\\' ))
2629 path
= xstrdup( fname
);
2630 else if (!(path
= wpp_find_include( fname
, input_name
)))
2631 error_loc("Unable to open include file %s\n", fname
);
2633 import_stack
[ptr
].temp_name
= temp_name
;
2634 import_stack
[ptr
].input_name
= input_name
;
2635 import_stack
[ptr
].line_number
= line_number
;
2640 name
= xstrdup( "widl.XXXXXX" );
2641 if((fd
= mkstemps( name
, 0 )) == -1)
2642 error("Could not generate a temp name from %s\n", name
);
2645 if (!(f
= fdopen(fd
, "wt")))
2646 error("Could not open fd %s for writing\n", name
);
2648 ret
= wpp_parse( path
, f
);
2652 if((f
= fopen(temp_name
, "r")) == NULL
)
2653 error_loc("Unable to open %s\n", temp_name
);
2655 import_stack
[ptr
].state
= YY_CURRENT_BUFFER
;
2656 parser__switch_to_buffer(parser__create_buffer(f
,YY_BUF_SIZE
));
2660 void abort_import(void)
2664 for (ptr
=0; ptr
<import_stack_ptr
; ptr
++)
2665 unlink(import_stack
[ptr
].temp_name
);