10 #define YY_INT_ALIGNED short int
12 /* A lexical scanner generated by flex */
14 #define yy_create_buffer ppy__create_buffer
15 #define yy_delete_buffer ppy__delete_buffer
16 #define yy_flex_debug ppy__flex_debug
17 #define yy_init_buffer ppy__init_buffer
18 #define yy_flush_buffer ppy__flush_buffer
19 #define yy_load_buffer_state ppy__load_buffer_state
20 #define yy_switch_to_buffer ppy__switch_to_buffer
22 #define yyleng ppy_leng
24 #define yylineno ppy_lineno
26 #define yyrestart ppy_restart
27 #define yytext ppy_text
28 #define yywrap ppy_wrap
29 #define yyalloc ppy_alloc
30 #define yyrealloc ppy_realloc
31 #define yyfree ppy_free
34 #define YY_FLEX_MAJOR_VERSION 2
35 #define YY_FLEX_MINOR_VERSION 5
36 #define YY_FLEX_SUBMINOR_VERSION 35
37 #if YY_FLEX_SUBMINOR_VERSION > 0
41 /* First, we deal with platform-specific or compiler-specific issues. */
43 /* begin standard C headers. */
49 /* end standard C headers. */
51 /* flex integer type definitions */
56 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
58 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
60 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
61 * if you want the limit (max/min) macros for int types.
63 #ifndef __STDC_LIMIT_MACROS
64 #define __STDC_LIMIT_MACROS 1
68 typedef int8_t flex_int8_t
;
69 typedef uint8_t flex_uint8_t
;
70 typedef int16_t flex_int16_t
;
71 typedef uint16_t flex_uint16_t
;
72 typedef int32_t flex_int32_t
;
73 typedef uint32_t flex_uint32_t
;
75 typedef signed char flex_int8_t
;
76 typedef short int flex_int16_t
;
77 typedef int flex_int32_t
;
78 typedef unsigned char flex_uint8_t
;
79 typedef unsigned short int flex_uint16_t
;
80 typedef unsigned int flex_uint32_t
;
82 /* Limits of integral types. */
84 #define INT8_MIN (-128)
87 #define INT16_MIN (-32767-1)
90 #define INT32_MIN (-2147483647-1)
93 #define INT8_MAX (127)
96 #define INT16_MAX (32767)
99 #define INT32_MAX (2147483647)
102 #define UINT8_MAX (255U)
105 #define UINT16_MAX (65535U)
108 #define UINT32_MAX (4294967295U)
113 #endif /* ! FLEXINT_H */
117 /* The "const" storage-class-modifier is valid. */
120 #else /* ! __cplusplus */
122 /* C99 requires __STDC__ to be defined as 1. */
123 #if defined (__STDC__)
127 #endif /* defined (__STDC__) */
128 #endif /* ! __cplusplus */
131 #define yyconst const
136 /* Returned upon end-of-file. */
139 /* Promotes a possibly negative, possibly signed char to an unsigned
140 * integer for use as an array index. If the signed char is negative,
141 * we want to instead treat it as an 8-bit unsigned char, hence the
144 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
146 /* Enter a start condition. This macro really ought to take a parameter,
147 * but we do it the disgusting crufty way forced on us by the ()-less
148 * definition of BEGIN.
150 #define BEGIN (yy_start) = 1 + 2 *
152 /* Translate the current start state into a value that can be later handed
153 * to BEGIN to return to the state. The YYSTATE alias is for lex
156 #define YY_START (((yy_start) - 1) / 2)
157 #define YYSTATE YY_START
159 /* Action number for EOF rule of a given start state. */
160 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
162 /* Special action meaning "start processing a new file". */
163 #define YY_NEW_FILE ppy_restart(ppy_in )
165 #define YY_END_OF_BUFFER_CHAR 0
167 /* Size of default input buffer. */
170 /* On IA-64, the buffer size is 16k, not 8k.
171 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
172 * Ditto for the __ia64__ case accordingly.
174 #define YY_BUF_SIZE 32768
176 #define YY_BUF_SIZE 16384
177 #endif /* __ia64__ */
180 /* The state buf must be large enough to hold one state per character in the main buffer.
182 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
184 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
185 #define YY_TYPEDEF_YY_BUFFER_STATE
186 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
191 extern FILE *ppy_in
, *ppy_out
;
193 #define EOB_ACT_CONTINUE_SCAN 0
194 #define EOB_ACT_END_OF_FILE 1
195 #define EOB_ACT_LAST_MATCH 2
197 #define YY_LESS_LINENO(n)
199 /* Return all but the first "n" matched characters back to the input stream. */
203 /* Undo effects of setting up ppy_text. */ \
204 int yyless_macro_arg = (n); \
205 YY_LESS_LINENO(yyless_macro_arg);\
206 *yy_cp = (yy_hold_char); \
207 YY_RESTORE_YY_MORE_OFFSET \
208 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
209 YY_DO_BEFORE_ACTION; /* set up ppy_text again */ \
213 #define unput(c) yyunput( c, (yytext_ptr) )
215 #ifndef YY_TYPEDEF_YY_SIZE_T
216 #define YY_TYPEDEF_YY_SIZE_T
217 typedef size_t yy_size_t
;
220 #ifndef YY_STRUCT_YY_BUFFER_STATE
221 #define YY_STRUCT_YY_BUFFER_STATE
222 struct yy_buffer_state
226 char *yy_ch_buf
; /* input buffer */
227 char *yy_buf_pos
; /* current position in input buffer */
229 /* Size of input buffer in bytes, not including room for EOB
232 yy_size_t yy_buf_size
;
234 /* Number of characters read into yy_ch_buf, not including EOB
239 /* Whether we "own" the buffer - i.e., we know we created it,
240 * and can realloc() it to grow it, and should free() it to
243 int yy_is_our_buffer
;
245 /* Whether this is an "interactive" input source; if so, and
246 * if we're using stdio for input, then we want to use getc()
247 * instead of fread(), to make sure we stop fetching input after
250 int yy_is_interactive
;
252 /* Whether we're considered to be at the beginning of a line.
253 * If so, '^' rules will be active on the next match, otherwise
258 int yy_bs_lineno
; /**< The line count. */
259 int yy_bs_column
; /**< The column count. */
261 /* Whether to try to fill the input buffer when we reach the
266 int yy_buffer_status
;
268 #define YY_BUFFER_NEW 0
269 #define YY_BUFFER_NORMAL 1
270 /* When an EOF's been seen but there's still some text to process
271 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
272 * shouldn't try reading from the input source any more. We might
273 * still have a bunch of tokens to match, though, because of
274 * possible backing-up.
276 * When we actually see the EOF, we change the status to "new"
277 * (via ppy_restart()), so that the user can continue scanning by
278 * just pointing ppy_in at a new input file.
280 #define YY_BUFFER_EOF_PENDING 2
283 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
285 /* Stack of input buffers. */
286 static size_t yy_buffer_stack_top
= 0; /**< index of top of stack. */
287 static size_t yy_buffer_stack_max
= 0; /**< capacity of stack. */
288 static YY_BUFFER_STATE
* yy_buffer_stack
= 0; /**< Stack as an array. */
290 /* We provide macros for accessing buffer states in case in the
291 * future we want to put the buffer states in a more general
294 * Returns the top of the stack, or NULL.
296 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
297 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
300 /* Same as previous macro, but useful when we know that the buffer stack is not
301 * NULL or when we need an lvalue. For internal use only.
303 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
305 /* yy_hold_char holds the character lost when ppy_text is formed. */
306 static char yy_hold_char
;
307 static int yy_n_chars
; /* number of characters read into yy_ch_buf */
310 /* Points to current character in buffer. */
311 static char *yy_c_buf_p
= (char *) 0;
312 static int yy_init
= 0; /* whether we need to initialize */
313 static int yy_start
= 0; /* start state number */
315 /* Flag which is used to allow ppy_wrap()'s to do buffer switches
316 * instead of setting up a fresh ppy_in. A bit of a hack ...
318 static int yy_did_buffer_switch_on_eof
;
320 void ppy_restart (FILE *input_file
);
321 void ppy__switch_to_buffer (YY_BUFFER_STATE new_buffer
);
322 YY_BUFFER_STATE
ppy__create_buffer (FILE *file
,int size
);
323 void ppy__delete_buffer (YY_BUFFER_STATE b
);
324 void ppy__flush_buffer (YY_BUFFER_STATE b
);
325 void ppy_push_buffer_state (YY_BUFFER_STATE new_buffer
);
326 void ppy_pop_buffer_state (void );
328 static void ppy_ensure_buffer_stack (void );
329 static void ppy__load_buffer_state (void );
330 static void ppy__init_buffer (YY_BUFFER_STATE b
,FILE *file
);
332 #define YY_FLUSH_BUFFER ppy__flush_buffer(YY_CURRENT_BUFFER )
334 YY_BUFFER_STATE
ppy__scan_buffer (char *base
,yy_size_t size
);
335 YY_BUFFER_STATE
ppy__scan_string (yyconst
char *yy_str
);
336 YY_BUFFER_STATE
ppy__scan_bytes (yyconst
char *bytes
,int len
);
338 void *ppy_alloc (yy_size_t
);
339 void *ppy_realloc (void *,yy_size_t
);
340 void ppy_free (void * );
342 #define yy_new_buffer ppy__create_buffer
344 #define yy_set_interactive(is_interactive) \
346 if ( ! YY_CURRENT_BUFFER ){ \
347 ppy_ensure_buffer_stack (); \
348 YY_CURRENT_BUFFER_LVALUE = \
349 ppy__create_buffer(ppy_in,YY_BUF_SIZE ); \
351 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
354 #define yy_set_bol(at_bol) \
356 if ( ! YY_CURRENT_BUFFER ){\
357 ppy_ensure_buffer_stack (); \
358 YY_CURRENT_BUFFER_LVALUE = \
359 ppy__create_buffer(ppy_in,YY_BUF_SIZE ); \
361 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
364 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
366 /* Begin user sect3 */
368 typedef unsigned char YY_CHAR
;
370 FILE *ppy_in
= (FILE *) 0, *ppy_out
= (FILE *) 0;
372 typedef int yy_state_type
;
374 extern int ppy_lineno
;
378 extern char *ppy_text
;
379 #define yytext_ptr ppy_text
381 static yy_state_type
yy_get_previous_state (void );
382 static yy_state_type
yy_try_NUL_trans (yy_state_type current_state
);
383 static int yy_get_next_buffer (void );
384 static void yy_fatal_error (yyconst
char msg
[] );
386 /* Done after the current pattern has been matched and before the
387 * corresponding action - sets up ppy_text.
389 #define YY_DO_BEFORE_ACTION \
390 (yytext_ptr) = yy_bp; \
391 ppy_leng = (size_t) (yy_cp - yy_bp); \
392 (yy_hold_char) = *yy_cp; \
394 (yy_c_buf_p) = yy_cp;
396 #define YY_NUM_RULES 143
397 #define YY_END_OF_BUFFER 144
398 /* This struct is not used in this scanner,
399 but its presence is necessary. */
402 flex_int32_t yy_verify
;
405 static yyconst flex_int16_t yy_accept
[416] =
407 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
408 0, 0, 0, 0, 117, 117, 0, 0, 0, 0,
409 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
410 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
411 0, 0, 0, 0, 144, 133, 134, 135, 121, 142,
412 122, 133, 132, 133, 134, 1, 21, 16, 18, 16,
413 21, 20, 17, 17, 17, 17, 17, 17, 17, 17,
414 68, 71, 69, 70, 28, 25, 26, 24, 28, 23,
415 28, 28, 123, 131, 124, 142, 125, 126, 142, 127,
416 128, 117, 118, 117, 77, 75, 77, 77, 74, 77,
418 78, 82, 84, 83, 142, 79, 90, 86, 90, 85,
419 88, 90, 90, 87, 90, 92, 100, 102, 95, 101,
420 97, 96, 93, 97, 92, 106, 106, 104, 103, 106,
421 114, 113, 110, 111, 107, 108, 109, 114, 114, 133,
422 134, 138, 121, 138, 122, 133, 132, 133, 53, 50,
423 47, 53, 52, 53, 51, 53, 33, 35, 53, 53,
424 53, 53, 49, 53, 53, 58, 55, 56, 58, 54,
425 58, 62, 59, 60, 62, 62, 22, 67, 64, 67,
426 65, 67, 63, 67, 29, 30, 32, 32, 32, 29,
427 1, 140, 143, 141, 139, 139, 133, 134, 133, 116,
429 120, 132, 136, 137, 134, 1, 16, 17, 17, 17,
430 17, 17, 17, 17, 17, 18, 19, 20, 17, 17,
431 17, 17, 17, 11, 17, 17, 17, 17, 17, 68,
432 69, 70, 72, 70, 25, 27, 28, 123, 130, 129,
433 130, 125, 127, 117, 117, 117, 119, 75, 73, 74,
434 76, 77, 78, 79, 81, 79, 86, 85, 90, 87,
435 91, 90, 92, 94, 97, 96, 96, 93, 99, 97,
436 92, 106, 104, 103, 106, 105, 106, 114, 114, 112,
437 115, 114, 133, 138, 138, 50, 44, 41, 33, 34,
438 33, 33, 37, 35, 35, 35, 39, 45, 43, 46,
440 40, 48, 49, 132, 42, 55, 54, 57, 58, 59,
441 61, 0, 22, 64, 63, 67, 66, 67, 29, 31,
442 32, 29, 140, 139, 120, 120, 17, 17, 17, 17,
443 17, 17, 11, 17, 17, 17, 17, 17, 17, 17,
444 69, 80, 89, 98, 34, 34, 33, 33, 33, 36,
445 35, 35, 35, 132, 120, 17, 12, 13, 17, 17,
446 17, 17, 17, 17, 15, 17, 17, 17, 34, 34,
447 34, 33, 36, 36, 35, 132, 17, 12, 13, 14,
448 4, 7, 9, 17, 17, 15, 17, 8, 17, 34,
449 36, 36, 36, 132, 3, 14, 4, 7, 9, 10,
451 17, 6, 8, 17, 36, 132, 3, 10, 2, 6,
455 static yyconst flex_int32_t yy_ec
[256] =
457 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
458 2, 2, 4, 1, 1, 1, 1, 1, 1, 1,
459 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
460 1, 2, 5, 6, 7, 1, 1, 8, 9, 10,
461 11, 12, 1, 13, 1, 14, 15, 16, 17, 17,
462 17, 17, 17, 17, 17, 18, 18, 1, 1, 19,
463 20, 21, 1, 1, 22, 22, 22, 22, 22, 22,
464 23, 23, 23, 23, 23, 24, 23, 23, 23, 23,
465 23, 23, 23, 23, 25, 23, 23, 26, 23, 23,
466 1, 27, 1, 1, 28, 1, 29, 30, 31, 32,
468 33, 34, 35, 36, 37, 36, 36, 38, 39, 40,
469 41, 42, 36, 43, 44, 45, 46, 36, 47, 48,
470 36, 36, 1, 49, 1, 1, 1, 1, 1, 1,
471 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
472 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
473 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
474 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
475 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
476 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
477 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
479 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
480 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
481 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
482 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
483 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
487 static yyconst flex_int32_t yy_meta
[50] =
489 1, 2, 3, 2, 1, 4, 5, 1, 6, 7,
490 8, 9, 8, 10, 11, 12, 12, 12, 1, 1,
491 13, 14, 15, 15, 15, 15, 16, 17, 14, 14,
492 14, 14, 14, 14, 15, 15, 15, 15, 15, 15,
493 15, 15, 15, 15, 15, 15, 15, 15, 1
496 static yyconst flex_int16_t yy_base
[460] =
498 0, 48, 55, 0, 102, 103, 130, 0, 177, 178,
499 179, 182, 186, 187, 104, 107, 214, 0, 261, 262,
500 289, 0, 338, 0, 386, 389, 414, 439, 466, 0,
501 515, 0, 564, 0, 399, 403, 612, 638, 665, 0,
502 428, 618, 714, 763, 1130, 0, 49, 1886, 1886, 1886,
503 1886, 96, 0, 109, 118, 1886, 1886, 811, 1886, 1126,
504 111, 111, 858, 1095, 154, 161, 1090, 1083, 1085, 1095,
505 0, 1886, 184, 124, 1886, 196, 1886, 1886, 254, 1886,
506 0, 199, 0, 1886, 1886, 269, 0, 1886, 1120, 0,
507 1886, 0, 1886, 263, 1886, 208, 1886, 267, 1112, 277,
509 0, 1886, 1886, 1886, 271, 281, 1886, 393, 1886, 396,
510 1886, 1107, 396, 0, 406, 0, 1886, 1886, 1113, 1886,
511 400, 905, 0, 418, 954, 1886, 430, 1886, 1886, 433,
512 0, 1886, 1886, 1886, 1886, 1886, 1886, 432, 435, 0,
513 449, 1886, 1886, 1886, 1886, 444, 0, 1003, 1886, 456,
514 1886, 1099, 1886, 1110, 1886, 449, 1037, 714, 443, 1097,
515 603, 0, 623, 1083, 1066, 1886, 615, 1886, 619, 0,
516 632, 1886, 644, 1886, 635, 634, 635, 1886, 655, 1886,
517 1886, 646, 0, 659, 0, 1886, 1886, 725, 738, 741,
518 1886, 742, 1886, 1886, 0, 735, 0, 747, 741, 1886,
520 0, 0, 1886, 1111, 755, 1886, 0, 0, 1079, 747,
521 754, 1074, 1067, 1069, 1079, 1886, 1886, 1104, 1069, 717,
522 1070, 1058, 1067, 777, 1063, 1052, 1062, 1056, 1041, 0,
523 0, 1886, 1886, 1079, 787, 1886, 1078, 0, 1886, 1886,
524 1077, 0, 0, 0, 743, 765, 1886, 791, 1886, 1069,
525 1886, 1075, 0, 1886, 794, 1074, 795, 798, 1062, 0,
526 1886, 1071, 0, 1886, 789, 0, 1085, 0, 801, 1070,
527 0, 804, 1886, 1886, 807, 1886, 1069, 0, 804, 1886,
528 1886, 1068, 806, 1886, 0, 818, 1886, 1886, 847, 843,
529 874, 799, 0, 905, 903, 800, 1886, 1886, 1886, 1886,
531 1886, 1886, 1066, 1026, 1886, 823, 0, 1886, 1048, 824,
532 1886, 1047, 816, 871, 0, 1886, 1886, 1027, 0, 1886,
533 1006, 872, 876, 0, 1134, 0, 969, 971, 948, 943,
534 906, 897, 880, 875, 871, 864, 844, 835, 833, 799,
535 0, 884, 1886, 890, 907, 845, 618, 863, 873, 914,
536 889, 910, 912, 799, 1183, 795, 938, 942, 796, 786,
537 747, 702, 695, 614, 959, 610, 598, 428, 932, 945,
538 946, 1886, 947, 952, 1886, 406, 395, 975, 984, 985,
539 990, 993, 994, 385, 372, 997, 365, 998, 247, 1886,
540 966, 991, 994, 241, 1023, 1024, 1029, 1032, 1033, 1036,
542 153, 1037, 1040, 74, 1886, 22, 1041, 1044, 1045, 1054,
543 1055, 0, 1062, 1063, 1886, 1232, 1249, 1266, 1283, 1300,
544 1317, 1334, 1351, 1368, 1385, 1402, 1419, 1436, 1449, 1451,
545 1468, 1485, 1502, 1519, 1536, 1553, 1570, 1587, 1598, 1615,
546 1632, 1638, 1655, 1672, 1689, 1695, 1712, 1729, 1746, 1752,
547 1758, 1775, 1792, 1800, 1817, 1834, 1851, 1056, 1868
550 static yyconst flex_int16_t yy_def
[460] =
552 415, 1, 415, 3, 416, 416, 415, 7, 417, 417,
553 418, 418, 419, 419, 420, 420, 415, 17, 421, 421,
554 415, 21, 415, 23, 422, 422, 423, 423, 415, 29,
555 415, 31, 415, 33, 424, 424, 425, 425, 415, 39,
556 426, 426, 427, 427, 415, 428, 415, 415, 415, 415,
557 415, 429, 430, 429, 415, 415, 415, 415, 415, 58,
558 415, 415, 58, 63, 63, 63, 63, 63, 63, 63,
559 431, 415, 432, 415, 415, 415, 415, 415, 415, 415,
560 430, 415, 433, 415, 415, 434, 435, 415, 434, 436,
561 415, 437, 415, 438, 415, 415, 415, 415, 439, 415,
563 440, 415, 415, 415, 441, 415, 415, 415, 415, 415,
564 415, 415, 415, 442, 415, 443, 415, 415, 415, 415,
565 444, 445, 446, 415, 446, 415, 415, 415, 415, 415,
566 447, 415, 415, 415, 415, 415, 415, 448, 415, 428,
567 415, 415, 415, 415, 415, 429, 430, 449, 415, 415,
568 415, 415, 415, 415, 415, 415, 415, 415, 415, 415,
569 415, 430, 415, 430, 415, 415, 415, 415, 415, 450,
570 415, 415, 415, 415, 415, 415, 415, 415, 415, 415,
571 415, 415, 451, 452, 453, 415, 415, 415, 415, 453,
572 415, 415, 415, 415, 454, 454, 428, 415, 429, 415,
574 455, 430, 415, 415, 415, 415, 58, 63, 63, 63,
575 63, 63, 63, 63, 63, 415, 415, 415, 63, 63,
576 63, 63, 63, 63, 63, 63, 63, 63, 63, 431,
577 456, 415, 415, 415, 415, 415, 415, 433, 415, 415,
578 415, 435, 436, 437, 438, 438, 415, 415, 415, 439,
579 415, 415, 440, 415, 415, 415, 415, 415, 415, 442,
580 415, 415, 443, 415, 444, 457, 445, 446, 415, 415,
581 125, 415, 415, 415, 415, 415, 415, 447, 448, 415,
582 415, 415, 429, 415, 449, 415, 415, 415, 415, 415,
583 415, 415, 458, 415, 415, 415, 415, 415, 415, 415,
585 415, 415, 415, 430, 415, 415, 450, 415, 415, 415,
586 415, 415, 415, 415, 451, 415, 415, 415, 453, 415,
587 415, 453, 415, 454, 459, 455, 63, 63, 63, 63,
588 63, 63, 415, 63, 63, 63, 63, 63, 63, 63,
589 456, 415, 415, 415, 415, 415, 415, 415, 415, 458,
590 415, 415, 415, 430, 459, 63, 63, 63, 63, 63,
591 63, 63, 63, 63, 63, 63, 63, 63, 415, 415,
592 415, 415, 415, 415, 415, 430, 63, 415, 415, 63,
593 63, 63, 63, 63, 63, 415, 63, 63, 63, 415,
594 415, 415, 415, 430, 63, 415, 415, 415, 415, 63,
596 63, 63, 415, 63, 415, 430, 415, 415, 63, 415,
597 63, 430, 415, 415, 0, 415, 415, 415, 415, 415,
598 415, 415, 415, 415, 415, 415, 415, 415, 415, 415,
599 415, 415, 415, 415, 415, 415, 415, 415, 415, 415,
600 415, 415, 415, 415, 415, 415, 415, 415, 415, 415,
601 415, 415, 415, 415, 415, 415, 415, 415, 415
604 static yyconst flex_int16_t yy_nxt
[1936] =
606 46, 47, 48, 47, 46, 49, 50, 46, 51, 46,
607 46, 46, 46, 46, 52, 46, 46, 46, 46, 46,
608 46, 53, 53, 53, 53, 53, 54, 53, 53, 53,
609 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
610 53, 53, 53, 53, 53, 53, 53, 53, 46, 55,
611 198, 55, 198, 412, 56, 57, 58, 59, 60, 57,
612 57, 57, 57, 57, 57, 57, 57, 57, 57, 61,
613 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
614 57, 62, 57, 63, 63, 63, 64, 65, 63, 63,
615 63, 66, 67, 63, 63, 63, 68, 63, 63, 63,
617 69, 70, 63, 57, 72, 72, 93, 200, 411, 93,
618 201, 203, 204, 217, 218, 94, 73, 73, 94, 205,
619 415, 205, 200, 415, 206, 201, 233, 234, 74, 74,
620 75, 76, 77, 76, 75, 78, 75, 75, 75, 75,
621 75, 75, 75, 75, 79, 75, 75, 75, 80, 75,
622 75, 81, 81, 81, 81, 81, 82, 81, 81, 81,
623 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
624 81, 81, 81, 81, 81, 81, 81, 81, 75, 84,
625 84, 84, 85, 85, 84, 409, 232, 88, 84, 84,
626 88, 220, 223, 221, 224, 200, 222, 235, 201, 235,
628 225, 236, 237, 86, 86, 89, 91, 91, 89, 248,
629 232, 248, 89, 89, 95, 96, 97, 96, 95, 95,
630 95, 95, 95, 95, 95, 95, 95, 95, 98, 95,
631 95, 95, 95, 95, 95, 99, 99, 99, 99, 99,
632 100, 99, 99, 99, 99, 99, 99, 99, 99, 99,
633 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
634 99, 99, 95, 102, 102, 200, 103, 103, 201, 104,
635 104, 240, 241, 406, 246, 105, 105, 247, 200, 251,
636 252, 201, 200, 255, 256, 201, 404, 106, 106, 107,
637 108, 109, 108, 107, 107, 107, 107, 107, 107, 110,
639 107, 111, 112, 113, 107, 107, 107, 107, 107, 107,
640 114, 114, 114, 114, 114, 115, 114, 114, 114, 114,
641 114, 114, 114, 114, 114, 114, 114, 114, 114, 114,
642 114, 114, 114, 114, 114, 114, 114, 107, 116, 116,
643 117, 116, 116, 118, 119, 116, 120, 116, 116, 116,
644 116, 116, 121, 122, 122, 122, 116, 116, 116, 123,
645 123, 123, 123, 123, 124, 125, 123, 123, 123, 123,
646 123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
647 123, 123, 123, 123, 123, 123, 116, 127, 128, 127,
648 127, 128, 127, 402, 257, 129, 257, 258, 129, 258,
650 173, 174, 173, 401, 173, 174, 173, 200, 261, 262,
651 201, 200, 130, 175, 201, 130, 132, 175, 400, 133,
652 269, 270, 134, 135, 136, 176, 137, 395, 138, 176,
653 186, 272, 273, 272, 187, 276, 277, 281, 282, 274,
654 139, 132, 188, 280, 133, 394, 201, 134, 135, 136,
655 198, 137, 198, 138, 189, 415, 275, 286, 415, 286,
656 200, 297, 298, 201, 389, 139, 140, 141, 142, 141,
657 140, 143, 144, 140, 145, 140, 140, 140, 140, 140,
658 146, 140, 140, 140, 140, 140, 140, 147, 147, 147,
659 147, 147, 148, 147, 147, 147, 147, 147, 147, 147,
661 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
662 147, 147, 147, 147, 140, 149, 150, 151, 150, 152,
663 153, 149, 154, 155, 149, 149, 149, 149, 149, 156,
664 157, 158, 158, 159, 160, 161, 162, 162, 162, 162,
665 162, 163, 162, 162, 162, 162, 164, 162, 162, 162,
666 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
667 162, 162, 162, 165, 166, 167, 168, 167, 166, 166,
668 166, 166, 166, 166, 166, 166, 166, 166, 169, 166,
669 166, 166, 166, 166, 166, 170, 170, 170, 170, 170,
670 171, 170, 170, 170, 170, 170, 170, 170, 170, 170,
672 170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
673 170, 170, 166, 76, 77, 76, 306, 78, 306, 190,
674 186, 190, 300, 301, 191, 302, 303, 177, 177, 177,
675 200, 388, 188, 201, 308, 309, 311, 312, 82, 76,
676 77, 76, 372, 78, 189, 310, 200, 310, 387, 201,
677 313, 313, 313, 177, 177, 177, 314, 200, 314, 385,
678 201, 317, 318, 372, 82, 178, 179, 180, 179, 178,
679 178, 178, 178, 178, 181, 181, 178, 178, 178, 182,
680 178, 178, 178, 178, 178, 178, 183, 183, 183, 183,
681 183, 184, 183, 183, 183, 183, 183, 183, 183, 183,
683 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
684 183, 183, 183, 178, 50, 192, 193, 192, 50, 194,
685 50, 50, 50, 50, 50, 50, 50, 384, 196, 294,
686 294, 294, 50, 50, 50, 383, 200, 295, 296, 201,
687 320, 321, 322, 323, 322, 323, 200, 206, 198, 325,
688 198, 295, 415, 328, 415, 415, 205, 415, 205, 296,
689 329, 206, 50, 50, 192, 193, 192, 50, 194, 50,
690 50, 50, 50, 50, 50, 50, 246, 196, 333, 247,
691 333, 50, 50, 50, 220, 223, 221, 224, 235, 222,
692 235, 382, 248, 225, 248, 342, 257, 342, 257, 258,
694 415, 258, 344, 415, 344, 272, 273, 272, 334, 276,
695 277, 50, 207, 274, 207, 415, 335, 415, 415, 286,
696 415, 286, 349, 353, 306, 310, 306, 310, 381, 380,
697 275, 313, 313, 313, 377, 376, 349, 353, 368, 208,
698 208, 208, 209, 210, 208, 208, 208, 211, 212, 208,
699 208, 208, 213, 208, 208, 208, 214, 215, 208, 415,
700 290, 415, 289, 289, 290, 367, 345, 346, 371, 366,
701 291, 292, 314, 322, 314, 322, 365, 323, 206, 323,
702 345, 333, 371, 333, 291, 342, 372, 342, 346, 208,
703 208, 344, 292, 344, 208, 208, 372, 347, 348, 208,
705 372, 364, 363, 208, 208, 266, 266, 362, 266, 266,
706 372, 347, 266, 375, 266, 266, 266, 266, 266, 348,
707 294, 294, 294, 266, 266, 266, 351, 352, 295, 296,
708 369, 370, 266, 375, 375, 375, 361, 373, 374, 378,
709 351, 378, 295, 379, 369, 379, 360, 375, 352, 375,
710 296, 373, 370, 266, 263, 263, 390, 263, 263, 374,
711 386, 263, 386, 263, 263, 263, 263, 263, 390, 390,
712 391, 392, 263, 263, 263, 393, 378, 390, 378, 359,
713 358, 271, 390, 390, 391, 379, 396, 379, 396, 393,
714 405, 397, 392, 397, 398, 399, 398, 399, 386, 403,
716 386, 403, 263, 283, 357, 356, 285, 283, 320, 283,
717 283, 405, 283, 283, 405, 283, 283, 405, 283, 283,
718 283, 283, 283, 283, 407, 396, 407, 396, 405, 317,
719 397, 405, 397, 398, 399, 398, 399, 408, 410, 408,
720 410, 403, 407, 403, 407, 408, 413, 408, 413, 311,
721 308, 283, 289, 289, 290, 410, 414, 410, 414, 354,
722 291, 292, 293, 413, 414, 413, 414, 350, 302, 350,
723 281, 276, 269, 261, 291, 343, 255, 251, 249, 240,
724 236, 233, 292, 340, 293, 266, 266, 339, 266, 266,
725 338, 337, 266, 336, 266, 266, 266, 266, 266, 332,
727 331, 330, 327, 266, 266, 266, 217, 229, 228, 227,
728 226, 219, 266, 203, 305, 304, 299, 288, 287, 264,
729 259, 249, 415, 229, 228, 227, 226, 219, 216, 415,
730 415, 415, 415, 266, 326, 326, 415, 326, 326, 326,
731 326, 326, 326, 326, 326, 326, 326, 415, 415, 415,
732 415, 415, 326, 326, 326, 415, 415, 415, 415, 415,
733 415, 415, 415, 415, 415, 415, 415, 415, 415, 415,
734 415, 415, 415, 415, 415, 415, 415, 415, 415, 415,
735 415, 415, 326, 326, 326, 415, 326, 326, 326, 326,
736 326, 326, 326, 326, 326, 326, 415, 415, 415, 415,
738 415, 326, 326, 326, 415, 415, 415, 415, 415, 415,
739 415, 415, 415, 415, 415, 415, 415, 415, 415, 415,
740 415, 415, 415, 415, 415, 415, 415, 415, 415, 415,
741 415, 326, 71, 71, 71, 71, 71, 71, 71, 71,
742 71, 71, 71, 71, 71, 71, 71, 71, 71, 83,
743 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
744 83, 83, 83, 83, 83, 83, 87, 87, 87, 87,
745 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
746 87, 87, 87, 90, 90, 90, 90, 90, 90, 90,
747 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
749 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
750 92, 92, 92, 92, 92, 92, 92, 101, 101, 101,
751 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
752 101, 101, 101, 101, 126, 126, 126, 126, 126, 126,
753 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
754 126, 131, 131, 131, 131, 131, 131, 131, 131, 131,
755 131, 131, 131, 131, 131, 131, 131, 131, 172, 172,
756 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
757 172, 172, 172, 172, 172, 75, 75, 75, 75, 75,
758 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
760 75, 75, 185, 185, 185, 185, 185, 185, 185, 185,
761 185, 185, 185, 185, 185, 185, 185, 185, 185, 195,
762 195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
763 195, 195, 195, 195, 195, 195, 197, 415, 415, 415,
764 415, 415, 197, 197, 197, 197, 415, 197, 197, 199,
765 415, 415, 415, 199, 415, 199, 199, 199, 199, 199,
766 199, 199, 202, 415, 202, 202, 415, 202, 230, 230,
767 415, 230, 230, 230, 230, 230, 230, 230, 415, 230,
768 230, 230, 230, 415, 230, 231, 231, 231, 231, 231,
769 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
771 231, 231, 238, 238, 415, 415, 238, 238, 238, 238,
772 238, 238, 238, 238, 238, 238, 238, 415, 238, 239,
773 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
774 239, 239, 239, 239, 239, 239, 242, 242, 415, 242,
775 242, 415, 242, 242, 242, 242, 242, 242, 242, 242,
776 242, 415, 242, 243, 243, 415, 243, 243, 243, 243,
777 243, 243, 243, 243, 243, 415, 243, 243, 415, 243,
778 244, 244, 415, 244, 244, 244, 244, 244, 415, 244,
779 244, 244, 244, 244, 244, 244, 244, 245, 245, 415,
780 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
782 245, 245, 245, 245, 250, 415, 415, 415, 415, 250,
783 415, 250, 250, 415, 250, 253, 253, 415, 415, 253,
784 415, 253, 253, 253, 253, 415, 253, 253, 253, 253,
785 415, 253, 254, 254, 254, 254, 254, 254, 254, 254,
786 254, 254, 254, 254, 254, 254, 254, 254, 254, 260,
787 415, 260, 260, 415, 260, 263, 263, 415, 415, 415,
788 415, 263, 263, 263, 263, 415, 415, 263, 415, 415,
789 415, 263, 265, 265, 415, 415, 415, 415, 265, 265,
790 265, 265, 265, 265, 265, 265, 265, 415, 265, 267,
791 267, 415, 415, 415, 415, 267, 267, 267, 267, 415,
793 267, 267, 267, 267, 415, 267, 268, 415, 268, 268,
794 415, 268, 278, 278, 415, 415, 278, 415, 415, 415,
795 278, 278, 415, 278, 278, 278, 278, 415, 278, 279,
796 279, 415, 415, 279, 415, 415, 415, 279, 279, 279,
797 279, 279, 279, 279, 415, 279, 284, 284, 284, 284,
798 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
799 284, 284, 284, 307, 415, 307, 307, 415, 307, 315,
800 415, 315, 315, 415, 315, 316, 316, 316, 316, 316,
801 316, 316, 316, 316, 316, 316, 316, 316, 316, 316,
802 316, 316, 319, 319, 415, 319, 415, 319, 319, 319,
804 319, 319, 415, 319, 319, 319, 319, 415, 319, 324,
805 324, 324, 415, 324, 324, 324, 324, 326, 326, 415,
806 326, 326, 326, 326, 326, 326, 326, 326, 326, 326,
807 326, 326, 326, 326, 341, 341, 415, 341, 341, 341,
808 341, 341, 415, 341, 415, 341, 341, 341, 341, 415,
809 341, 266, 266, 415, 415, 415, 415, 266, 266, 266,
810 266, 415, 415, 266, 415, 415, 415, 266, 355, 355,
811 415, 355, 355, 355, 355, 355, 355, 355, 355, 355,
812 355, 355, 355, 355, 355, 45, 415, 415, 415, 415,
813 415, 415, 415, 415, 415, 415, 415, 415, 415, 415,
815 415, 415, 415, 415, 415, 415, 415, 415, 415, 415,
816 415, 415, 415, 415, 415, 415, 415, 415, 415, 415,
817 415, 415, 415, 415, 415, 415, 415, 415, 415, 415,
818 415, 415, 415, 415, 415
821 static yyconst flex_int16_t yy_chk
[1936] =
823 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
824 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
825 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
826 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
827 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
828 47, 2, 47, 406, 2, 3, 3, 3, 3, 3,
829 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
830 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
831 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
832 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
834 3, 3, 3, 3, 5, 6, 15, 52, 404, 16,
835 52, 54, 54, 62, 62, 15, 5, 6, 16, 55,
836 54, 55, 61, 54, 55, 61, 74, 74, 5, 6,
837 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
838 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
839 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
840 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
841 7, 7, 7, 7, 7, 7, 7, 7, 7, 9,
842 10, 11, 9, 10, 12, 401, 73, 11, 13, 14,
843 12, 65, 66, 65, 66, 73, 65, 76, 73, 76,
845 66, 82, 82, 9, 10, 11, 13, 14, 12, 96,
846 73, 96, 13, 14, 17, 17, 17, 17, 17, 17,
847 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
848 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
849 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
850 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
851 17, 17, 17, 19, 20, 79, 19, 20, 79, 19,
852 20, 86, 86, 394, 94, 19, 20, 94, 98, 100,
853 100, 98, 105, 106, 106, 105, 389, 19, 20, 21,
854 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
856 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
857 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
858 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
859 21, 21, 21, 21, 21, 21, 21, 21, 23, 23,
860 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
861 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
862 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
863 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
864 23, 23, 23, 23, 23, 23, 23, 25, 25, 25,
865 26, 26, 26, 387, 108, 25, 108, 110, 26, 110,
867 35, 35, 35, 385, 36, 36, 36, 113, 115, 115,
868 113, 121, 25, 35, 121, 26, 27, 36, 384, 27,
869 124, 124, 27, 27, 27, 35, 27, 377, 27, 36,
870 41, 127, 127, 127, 41, 130, 130, 139, 139, 127,
871 27, 28, 41, 138, 28, 376, 138, 28, 28, 28,
872 141, 28, 141, 28, 41, 146, 127, 150, 146, 150,
873 156, 159, 159, 156, 368, 28, 29, 29, 29, 29,
874 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
875 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
876 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
878 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
879 29, 29, 29, 29, 29, 31, 31, 31, 31, 31,
880 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
881 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
882 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
883 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
884 31, 31, 31, 31, 33, 33, 33, 33, 33, 33,
885 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
886 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
887 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
889 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
890 33, 33, 33, 37, 37, 37, 167, 37, 167, 42,
891 42, 42, 161, 161, 42, 163, 163, 37, 37, 37,
892 169, 367, 42, 169, 171, 171, 176, 176, 37, 38,
893 38, 38, 347, 38, 42, 173, 175, 173, 366, 175,
894 177, 177, 177, 38, 38, 38, 179, 182, 179, 364,
895 182, 184, 184, 347, 38, 39, 39, 39, 39, 39,
896 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
897 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
898 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
900 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
901 39, 39, 39, 39, 43, 43, 43, 43, 43, 43,
902 43, 43, 43, 43, 43, 43, 43, 363, 43, 158,
903 158, 158, 43, 43, 43, 362, 188, 158, 158, 188,
904 189, 189, 190, 192, 190, 192, 196, 190, 198, 196,
905 198, 158, 199, 220, 245, 199, 205, 245, 205, 158,
906 220, 205, 43, 44, 44, 44, 44, 44, 44, 44,
907 44, 44, 44, 44, 44, 44, 246, 44, 224, 246,
908 224, 44, 44, 44, 210, 211, 210, 211, 235, 210,
909 235, 361, 248, 211, 248, 255, 257, 255, 257, 258,
911 265, 258, 269, 265, 269, 272, 272, 272, 224, 275,
912 275, 44, 58, 272, 58, 279, 224, 283, 279, 286,
913 283, 286, 292, 296, 306, 310, 306, 310, 360, 359,
914 272, 313, 313, 313, 356, 354, 292, 296, 340, 58,
915 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
916 58, 58, 58, 58, 58, 58, 58, 58, 58, 63,
917 290, 63, 289, 289, 289, 339, 290, 290, 346, 338,
918 289, 289, 314, 322, 314, 322, 337, 323, 322, 323,
919 290, 333, 346, 333, 289, 342, 348, 342, 290, 63,
920 63, 344, 289, 344, 63, 63, 349, 291, 291, 63,
922 348, 336, 335, 63, 63, 122, 122, 334, 122, 122,
923 349, 291, 122, 351, 122, 122, 122, 122, 122, 291,
924 294, 294, 294, 122, 122, 122, 295, 295, 294, 294,
925 345, 345, 122, 352, 351, 353, 332, 350, 350, 357,
926 295, 357, 294, 358, 345, 358, 331, 352, 295, 353,
927 294, 350, 345, 122, 125, 125, 369, 125, 125, 350,
928 365, 125, 365, 125, 125, 125, 125, 125, 370, 371,
929 373, 373, 125, 125, 125, 374, 378, 369, 378, 330,
930 329, 125, 370, 371, 373, 379, 380, 379, 380, 374,
931 391, 381, 373, 381, 382, 383, 382, 383, 386, 388,
933 386, 388, 125, 148, 328, 327, 148, 148, 321, 148,
934 148, 391, 148, 148, 392, 148, 148, 393, 148, 148,
935 148, 148, 148, 148, 395, 396, 395, 396, 392, 318,
936 397, 393, 397, 398, 399, 398, 399, 400, 402, 400,
937 402, 403, 407, 403, 407, 408, 409, 408, 409, 312,
938 309, 148, 157, 157, 157, 410, 411, 410, 411, 304,
939 157, 157, 157, 413, 414, 413, 414, 458, 303, 458,
940 282, 277, 270, 262, 157, 259, 256, 252, 250, 241,
941 237, 234, 157, 229, 157, 267, 267, 228, 267, 267,
942 227, 226, 267, 225, 267, 267, 267, 267, 267, 223,
944 222, 221, 219, 267, 267, 267, 218, 215, 214, 213,
945 212, 209, 267, 204, 165, 164, 160, 154, 152, 119,
946 112, 99, 89, 70, 69, 68, 67, 64, 60, 45,
947 0, 0, 0, 267, 325, 325, 0, 325, 325, 325,
948 325, 325, 325, 325, 325, 325, 325, 0, 0, 0,
949 0, 0, 325, 325, 325, 0, 0, 0, 0, 0,
950 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
951 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
952 0, 0, 325, 355, 355, 0, 355, 355, 355, 355,
953 355, 355, 355, 355, 355, 355, 0, 0, 0, 0,
955 0, 355, 355, 355, 0, 0, 0, 0, 0, 0,
956 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
957 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
958 0, 355, 416, 416, 416, 416, 416, 416, 416, 416,
959 416, 416, 416, 416, 416, 416, 416, 416, 416, 417,
960 417, 417, 417, 417, 417, 417, 417, 417, 417, 417,
961 417, 417, 417, 417, 417, 417, 418, 418, 418, 418,
962 418, 418, 418, 418, 418, 418, 418, 418, 418, 418,
963 418, 418, 418, 419, 419, 419, 419, 419, 419, 419,
964 419, 419, 419, 419, 419, 419, 419, 419, 419, 419,
966 420, 420, 420, 420, 420, 420, 420, 420, 420, 420,
967 420, 420, 420, 420, 420, 420, 420, 421, 421, 421,
968 421, 421, 421, 421, 421, 421, 421, 421, 421, 421,
969 421, 421, 421, 421, 422, 422, 422, 422, 422, 422,
970 422, 422, 422, 422, 422, 422, 422, 422, 422, 422,
971 422, 423, 423, 423, 423, 423, 423, 423, 423, 423,
972 423, 423, 423, 423, 423, 423, 423, 423, 424, 424,
973 424, 424, 424, 424, 424, 424, 424, 424, 424, 424,
974 424, 424, 424, 424, 424, 425, 425, 425, 425, 425,
975 425, 425, 425, 425, 425, 425, 425, 425, 425, 425,
977 425, 425, 426, 426, 426, 426, 426, 426, 426, 426,
978 426, 426, 426, 426, 426, 426, 426, 426, 426, 427,
979 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
980 427, 427, 427, 427, 427, 427, 428, 0, 0, 0,
981 0, 0, 428, 428, 428, 428, 0, 428, 428, 429,
982 0, 0, 0, 429, 0, 429, 429, 429, 429, 429,
983 429, 429, 430, 0, 430, 430, 0, 430, 431, 431,
984 0, 431, 431, 431, 431, 431, 431, 431, 0, 431,
985 431, 431, 431, 0, 431, 432, 432, 432, 432, 432,
986 432, 432, 432, 432, 432, 432, 432, 432, 432, 432,
988 432, 432, 433, 433, 0, 0, 433, 433, 433, 433,
989 433, 433, 433, 433, 433, 433, 433, 0, 433, 434,
990 434, 434, 434, 434, 434, 434, 434, 434, 434, 434,
991 434, 434, 434, 434, 434, 434, 435, 435, 0, 435,
992 435, 0, 435, 435, 435, 435, 435, 435, 435, 435,
993 435, 0, 435, 436, 436, 0, 436, 436, 436, 436,
994 436, 436, 436, 436, 436, 0, 436, 436, 0, 436,
995 437, 437, 0, 437, 437, 437, 437, 437, 0, 437,
996 437, 437, 437, 437, 437, 437, 437, 438, 438, 0,
997 438, 438, 438, 438, 438, 438, 438, 438, 438, 438,
999 438, 438, 438, 438, 439, 0, 0, 0, 0, 439,
1000 0, 439, 439, 0, 439, 440, 440, 0, 0, 440,
1001 0, 440, 440, 440, 440, 0, 440, 440, 440, 440,
1002 0, 440, 441, 441, 441, 441, 441, 441, 441, 441,
1003 441, 441, 441, 441, 441, 441, 441, 441, 441, 442,
1004 0, 442, 442, 0, 442, 443, 443, 0, 0, 0,
1005 0, 443, 443, 443, 443, 0, 0, 443, 0, 0,
1006 0, 443, 444, 444, 0, 0, 0, 0, 444, 444,
1007 444, 444, 444, 444, 444, 444, 444, 0, 444, 445,
1008 445, 0, 0, 0, 0, 445, 445, 445, 445, 0,
1010 445, 445, 445, 445, 0, 445, 446, 0, 446, 446,
1011 0, 446, 447, 447, 0, 0, 447, 0, 0, 0,
1012 447, 447, 0, 447, 447, 447, 447, 0, 447, 448,
1013 448, 0, 0, 448, 0, 0, 0, 448, 448, 448,
1014 448, 448, 448, 448, 0, 448, 449, 449, 449, 449,
1015 449, 449, 449, 449, 449, 449, 449, 449, 449, 449,
1016 449, 449, 449, 450, 0, 450, 450, 0, 450, 451,
1017 0, 451, 451, 0, 451, 452, 452, 452, 452, 452,
1018 452, 452, 452, 452, 452, 452, 452, 452, 452, 452,
1019 452, 452, 453, 453, 0, 453, 0, 453, 453, 453,
1021 453, 453, 0, 453, 453, 453, 453, 0, 453, 454,
1022 454, 454, 0, 454, 454, 454, 454, 455, 455, 0,
1023 455, 455, 455, 455, 455, 455, 455, 455, 455, 455,
1024 455, 455, 455, 455, 456, 456, 0, 456, 456, 456,
1025 456, 456, 0, 456, 0, 456, 456, 456, 456, 0,
1026 456, 457, 457, 0, 0, 0, 0, 457, 457, 457,
1027 457, 0, 0, 457, 0, 0, 0, 457, 459, 459,
1028 0, 459, 459, 459, 459, 459, 459, 459, 459, 459,
1029 459, 459, 459, 459, 459, 415, 415, 415, 415, 415,
1030 415, 415, 415, 415, 415, 415, 415, 415, 415, 415,
1032 415, 415, 415, 415, 415, 415, 415, 415, 415, 415,
1033 415, 415, 415, 415, 415, 415, 415, 415, 415, 415,
1034 415, 415, 415, 415, 415, 415, 415, 415, 415, 415,
1035 415, 415, 415, 415, 415
1038 static yy_state_type yy_last_accepting_state
;
1039 static char *yy_last_accepting_cpos
;
1041 extern int ppy__flex_debug
;
1042 int ppy__flex_debug
= 0;
1044 /* The intent behind this definition is that it'll catch
1045 * any uses of REJECT which flex missed.
1047 #define REJECT reject_used_but_not_detected
1048 #define yymore() yymore_used_but_not_detected
1049 #define YY_MORE_ADJ 0
1050 #define YY_RESTORE_YY_MORE_OFFSET
1054 * Wrc preprocessor lexical analysis
1056 * Copyright 1999-2000 Bertho A. Stultiens (BS)
1058 * This library is free software; you can redistribute it and/or
1059 * modify it under the terms of the GNU Lesser General Public
1060 * License as published by the Free Software Foundation; either
1061 * version 2.1 of the License, or (at your option) any later version.
1063 * This library is distributed in the hope that it will be useful,
1064 * but WITHOUT ANY WARRANTY; without even the implied warranty of
1065 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1066 * Lesser General Public License for more details.
1068 * You should have received a copy of the GNU Lesser General Public
1069 * License along with this library; if not, write to the Free Software
1070 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
1073 * 24-Apr-2000 BS - Started from scratch to restructure everything
1074 * and reintegrate the source into the wine-tree.
1075 * 04-Jan-2000 BS - Added comments about the lexicographical
1076 * grammar to give some insight in the complexity.
1077 * 28-Dec-1999 BS - Eliminated backing-up of the flexer by running
1078 * `flex -b' on the source. This results in some
1079 * weirdo extra rules, but a much faster scanner.
1080 * 23-Dec-1999 BS - Started this file
1082 *-------------------------------------------------------------------------
1083 * The preprocessor's lexographical grammar (approximately):
1085 * pp := {ws} # {ws} if {ws} {expr} {ws} \n
1086 * | {ws} # {ws} ifdef {ws} {id} {ws} \n
1087 * | {ws} # {ws} ifndef {ws} {id} {ws} \n
1088 * | {ws} # {ws} elif {ws} {expr} {ws} \n
1089 * | {ws} # {ws} else {ws} \n
1090 * | {ws} # {ws} endif {ws} \n
1091 * | {ws} # {ws} include {ws} < {anytext} > \n
1092 * | {ws} # {ws} include {ws} " {anytext} " \n
1093 * | {ws} # {ws} define {ws} {anytext} \n
1094 * | {ws} # {ws} define( {arglist} ) {ws} {expansion} \n
1095 * | {ws} # {ws} pragma {ws} {anytext} \n
1096 * | {ws} # {ws} ident {ws} {anytext} \n
1097 * | {ws} # {ws} error {ws} {anytext} \n
1098 * | {ws} # {ws} warning {ws} {anytext} \n
1099 * | {ws} # {ws} line {ws} " {anytext} " {number} \n
1100 * | {ws} # {ws} {number} " {anytext} " {number} [ {number} [{number}] ] \n
1103 * ws := [ \t\r\f\v]*
1105 * expr := {expr} [+-*%^/|&] {expr}
1106 * | {expr} {logor|logand} {expr}
1108 * | {expr} ? {expr} : {expr}
1114 * id := [a-zA-Z_][a-zA-Z0-9_]*
1116 * anytext := [^\n]* (see note)
1120 * | {arglist} , {id}
1121 * | {arglist} , {id} ...
1126 * | {anytext} ## {anytext}
1130 * Note: "anytext" is not always "[^\n]*". This is because the
1131 * trailing context must be considered as well.
1133 * The only certain assumption for the preprocessor to make is that
1134 * directives start at the beginning of the line, followed by a '#'
1135 * and end with a newline.
1136 * Any directive may be suffixed with a line-continuation. Also
1137 * classical comment / *...* / (note: no comments within comments,
1138 * therefore spaces) is considered to be a line-continuation
1139 * (according to gcc and egcs AFAIK, ANSI is a bit vague).
1140 * Comments have not been added to the above grammar for simplicity
1141 * reasons. However, it is allowed to enter comment anywhere within
1142 * the directives as long as they do not interfere with the context.
1143 * All comments are considered to be deletable whitespace (both
1144 * classical form "/ *...* /" and C++ form "//...\n").
1146 * All recursive scans, except for macro-expansion, are done by the
1147 * parser, whereas the simple state transitions of non-recursive
1148 * directives are done in the scanner. This results in the many
1149 * exclusive start-conditions of the scanner.
1151 * Macro expansions are slightly more difficult because they have to
1152 * prescan the arguments. Parameter substitution is literal if the
1153 * substitution is # or ## (either side). This enables new identifiers
1154 * to be created (see 'info cpp' node Macro|Pitfalls|Prescan for more
1157 * FIXME: Variable macro parameters is recognized, but not yet
1158 * expanded. I have to reread the ANSI standard on the subject (yes,
1161 * The following special defines are supported:
1162 * __FILE__ -> "thissource.c"
1164 * __DATE__ -> "May 1 2000"
1165 * __TIME__ -> "23:59:59"
1166 * These macros expand, as expected, into their ANSI defined values.
1168 * The same include prevention is implemented as gcc and egcs does.
1169 * This results in faster processing because we do not read the text
1170 * at all. Some wine-sources attempt to include the same file 4 or 5
1171 * times. This strategy also saves a lot blank output-lines, which in
1172 * its turn improves the real resource scanner/parser.
1177 * Special flex options and exclusive scanner start-conditions
1179 #define YY_NO_INPUT 1
1211 # define LLONG_MAX ((long long)0x7fffffff << 32 | 0xffffffff)
1212 # define LLONG_MIN (-LLONG_MAX - 1)
1215 # define ULLONG_MAX ((long long)0xffffffff << 32 | 0xffffffff)
1218 #ifndef HAVE_UNISTD_H
1219 #define YY_NO_UNISTD_H
1222 #include "wine/wpp.h"
1223 #include "wpp_private.h"
1224 #include "ppy.tab.h"
1227 * Make sure that we are running an appropriate version of flex.
1229 #if !defined(YY_FLEX_MAJOR_VERSION) || (1000 * YY_FLEX_MAJOR_VERSION + YY_FLEX_MINOR_VERSION < 2005)
1230 #error Must use flex version 2.5.1 or higher (yy_scan_* routines are required).
1233 #define YY_READ_BUF_SIZE 65536 /* So we read most of a file at once */
1235 #define yy_current_state() YY_START
1236 #define yy_pp_state(x) yy_pop_state(); yy_push_state(x)
1239 * Always update the current character position within a line
1241 #define YY_USER_ACTION pp_status.char_number+=ppy_leng;
1244 * Buffer management for includes and expansions
1246 #define MAXBUFFERSTACK 128 /* Nesting more than 128 includes or macro expansion textss is insane */
1248 typedef struct bufferstackentry
{
1249 YY_BUFFER_STATE bufferstate
; /* Buffer to switch back to */
1250 void *filehandle
; /* Handle to be used with wpp_callbacks->read */
1251 pp_entry_t
*define
; /* Points to expanding define or NULL if handling includes */
1252 int line_number
; /* Line that we were handling */
1253 int char_number
; /* The current position on that line */
1254 char *filename
; /* Filename that we were handling */
1255 int if_depth
; /* How many #if:s deep to check matching #endif:s */
1256 int ncontinuations
; /* Remember the continuation state */
1257 int should_pop
; /* Set if we must pop the start-state on EOF */
1258 /* Include management */
1259 include_state_t incl
;
1260 char *include_filename
;
1261 } bufferstackentry_t
;
1263 #define ALLOCBLOCKSIZE (1 << 10) /* Allocate these chunks at a time for string-buffers */
1266 * Macro expansion nesting
1267 * We need the stack to handle expansions while scanning
1268 * a macro's arguments. The TOS must always be the macro
1269 * that receives the current expansion from the scanner.
1271 #define MAXMACEXPSTACK 128 /* Nesting more than 128 macro expansions is insane */
1273 typedef struct macexpstackentry
{
1274 pp_entry_t
*ppp
; /* This macro we are scanning */
1275 char **args
; /* With these arguments */
1276 char **ppargs
; /* Resulting in these preprocessed arguments */
1277 int *nnls
; /* Number of newlines per argument */
1278 int nargs
; /* And this many arguments scanned */
1279 int parentheses
; /* Nesting level of () */
1280 int curargsize
; /* Current scanning argument's size */
1281 int curargalloc
; /* Current scanning argument's block allocated */
1282 char *curarg
; /* Current scanning argument's content */
1283 } macexpstackentry_t
;
1285 #define MACROPARENTHESES() (top_macro()->parentheses)
1290 static void newline(int);
1291 static int make_number(int radix
, YYSTYPE
*val
, const char *str
, int len
);
1292 static void put_buffer(const char *s
, int len
);
1293 /* Buffer management */
1294 static void push_buffer(pp_entry_t
*ppp
, char *filename
, char *incname
, int pop
);
1295 static bufferstackentry_t
*pop_buffer(void);
1296 /* String functions */
1297 static void new_string(void);
1298 static void add_string(const char *str
, int len
);
1299 static char *get_string(void);
1300 static void put_string(void);
1301 static int string_start(void);
1302 /* Macro functions */
1303 static void push_macro(pp_entry_t
*ppp
);
1304 static macexpstackentry_t
*top_macro(void);
1305 static macexpstackentry_t
*pop_macro(void);
1306 static void free_macro(macexpstackentry_t
*mep
);
1307 static void add_text_to_macro(const char *text
, int len
);
1308 static void macro_add_arg(int last
);
1309 static void macro_add_expansion(void);
1311 static void expand_special(pp_entry_t
*ppp
);
1312 static void expand_define(pp_entry_t
*ppp
);
1313 static void expand_macro(macexpstackentry_t
*mep
);
1318 static int ncontinuations
;
1320 static int strbuf_idx
= 0;
1321 static int strbuf_alloc
= 0;
1322 static char *strbuffer
= NULL
;
1323 static int str_startline
;
1325 static macexpstackentry_t
*macexpstack
[MAXMACEXPSTACK
];
1326 static int macexpstackidx
= 0;
1328 static bufferstackentry_t bufferstack
[MAXBUFFERSTACK
];
1329 static int bufferstackidx
= 0;
1334 include_state_t pp_incl_state
=
1342 includelogicentry_t
*pp_includelogiclist
= NULL
;
1344 #define YY_INPUT(buf,result,max_size) \
1346 result = wpp_callbacks->read(pp_status.file, buf, max_size); \
1349 #define BUFFERINITIALCAPACITY 256
1351 void pp_writestring(const char *format
, ...)
1355 static char *buffer
;
1356 static int buffercapacity
;
1359 if(buffercapacity
== 0)
1361 buffer
= pp_xmalloc(BUFFERINITIALCAPACITY
);
1364 buffercapacity
= BUFFERINITIALCAPACITY
;
1367 va_start(valist
, format
);
1368 len
= vsnprintf(buffer
, buffercapacity
,
1371 /* If the string is longer than buffersize, vsnprintf returns
1372 * the string length with glibc >= 2.1, -1 with glibc < 2.1 */
1373 while(len
> buffercapacity
|| len
< 0)
1377 buffercapacity
*= 2;
1378 } while(len
> buffercapacity
);
1380 new_buffer
= pp_xrealloc(buffer
, buffercapacity
);
1381 if(new_buffer
== NULL
)
1386 buffer
= new_buffer
;
1387 va_start(valist
, format
);
1388 len
= vsnprintf(buffer
, buffercapacity
,
1393 wpp_callbacks
->write(buffer
, len
);
1397 **************************************************************************
1398 * The scanner starts here
1399 **************************************************************************
1401 #line 1402 "ppl.yy.c"
1410 #define pp_comment 7
1415 #define pp_macign 12
1416 #define pp_macscan 13
1417 #define pp_macexp 14
1422 #define pp_defined 19
1423 #define pp_ignore 20
1426 #ifndef YY_NO_UNISTD_H
1427 /* Special case for "unistd.h", since it is non-ANSI. We include it way
1428 * down here because we want the user's section 1 to have been scanned first.
1429 * The user has a chance to override it with an option.
1434 #ifndef YY_EXTRA_TYPE
1435 #define YY_EXTRA_TYPE void *
1438 static int yy_init_globals (void );
1440 /* Accessor methods to globals.
1441 These are made visible to non-reentrant scanners for convenience. */
1443 int ppy_lex_destroy (void );
1445 int ppy_get_debug (void );
1447 void ppy_set_debug (int debug_flag
);
1449 YY_EXTRA_TYPE
ppy_get_extra (void );
1451 void ppy_set_extra (YY_EXTRA_TYPE user_defined
);
1453 FILE *ppy_get_in (void );
1455 void ppy_set_in (FILE * in_str
);
1457 FILE *ppy_get_out (void );
1459 void ppy_set_out (FILE * out_str
);
1461 int ppy_get_leng (void );
1463 char *ppy_get_text (void );
1465 int ppy_get_lineno (void );
1467 void ppy_set_lineno (int line_number
);
1469 /* Macros after this point can all be overridden by user definitions in
1473 #ifndef YY_SKIP_YYWRAP
1475 extern "C" int ppy_wrap (void );
1477 extern int ppy_wrap (void );
1482 static void yy_flex_strncpy (char *,yyconst
char *,int );
1485 #ifdef YY_NEED_STRLEN
1486 static int yy_flex_strlen (yyconst
char * );
1492 static int yyinput (void );
1494 static int input (void );
1499 static int yy_start_stack_ptr
= 0;
1500 static int yy_start_stack_depth
= 0;
1501 static int *yy_start_stack
= NULL
;
1503 static void yy_push_state (int new_state
);
1505 static void yy_pop_state (void );
1507 static int yy_top_state (void );
1509 /* Amount of stuff to slurp up with each read. */
1510 #ifndef YY_READ_BUF_SIZE
1512 /* On IA-64, the buffer size is 16k, not 8k */
1513 #define YY_READ_BUF_SIZE 16384
1515 #define YY_READ_BUF_SIZE 8192
1516 #endif /* __ia64__ */
1519 /* Copy whatever the last rule matched to the standard output. */
1521 /* This used to be an fputs(), but since the string might contain NUL's,
1522 * we now use fwrite().
1524 #define ECHO do { if (fwrite( ppy_text, ppy_leng, 1, ppy_out )) {} } while (0)
1527 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1528 * is returned in "result".
1531 #define YY_INPUT(buf,result,max_size) \
1532 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1536 for ( n = 0; n < max_size && \
1537 (c = getc( ppy_in )) != EOF && c != '\n'; ++n ) \
1538 buf[n] = (char) c; \
1540 buf[n++] = (char) c; \
1541 if ( c == EOF && ferror( ppy_in ) ) \
1542 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1548 while ( (result = fread(buf, 1, max_size, ppy_in))==0 && ferror(ppy_in)) \
1550 if( errno != EINTR) \
1552 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1563 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1564 * we don't want an extra ';' after the "return" because that will cause
1565 * some compilers to complain about unreachable statements.
1568 #define yyterminate() return YY_NULL
1571 /* Number of entries by which start-condition stack grows. */
1572 #ifndef YY_START_STACK_INCR
1573 #define YY_START_STACK_INCR 25
1576 /* Report a fatal error. */
1577 #ifndef YY_FATAL_ERROR
1578 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1581 /* end tables serialization structures and prototypes */
1583 /* Default declaration of generated scanner - a define so the user can
1584 * easily add parameters.
1587 #define YY_DECL_IS_OURS 1
1589 extern int ppy_lex (void);
1591 #define YY_DECL int ppy_lex (void)
1592 #endif /* !YY_DECL */
1594 /* Code executed at the beginning of each rule, after ppy_text and ppy_leng
1597 #ifndef YY_USER_ACTION
1598 #define YY_USER_ACTION
1601 /* Code executed at the end of each rule. */
1603 #define YY_BREAK break;
1606 #define YY_RULE_SETUP \
1607 if ( ppy_leng > 0 ) \
1608 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1609 (ppy_text[ppy_leng - 1] == '\n'); \
1612 /** The main scanner function which does all the work.
1616 register yy_state_type yy_current_state
;
1617 register char *yy_cp
, *yy_bp
;
1618 register int yy_act
;
1623 * Catch line-continuations.
1624 * Note: Gcc keeps the line-continuations in, for example, strings
1625 * intact. However, I prefer to remove them all so that the next
1626 * scanner will not need to reduce the continuation state.
1628 * <*>\\\n newline(0);
1632 * Detect the leading # of a preprocessor directive.
1634 #line 1635 "ppl.yy.c"
1645 (yy_start
) = 1; /* first start state */
1653 if ( ! YY_CURRENT_BUFFER
) {
1654 ppy_ensure_buffer_stack ();
1655 YY_CURRENT_BUFFER_LVALUE
=
1656 ppy__create_buffer(ppy_in
,YY_BUF_SIZE
);
1659 ppy__load_buffer_state( );
1662 while ( 1 ) /* loops until end-of-file is reached */
1664 yy_cp
= (yy_c_buf_p
);
1666 /* Support of ppy_text. */
1667 *yy_cp
= (yy_hold_char
);
1669 /* yy_bp points to the position in yy_ch_buf of the start of
1674 yy_current_state
= (yy_start
);
1675 yy_current_state
+= YY_AT_BOL();
1679 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
1680 if ( yy_accept
[yy_current_state
] )
1682 (yy_last_accepting_state
) = yy_current_state
;
1683 (yy_last_accepting_cpos
) = yy_cp
;
1685 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1687 yy_current_state
= (int) yy_def
[yy_current_state
];
1688 if ( yy_current_state
>= 416 )
1689 yy_c
= yy_meta
[(unsigned int) yy_c
];
1691 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1694 while ( yy_current_state
!= 415 );
1695 yy_cp
= (yy_last_accepting_cpos
);
1696 yy_current_state
= (yy_last_accepting_state
);
1699 yy_act
= yy_accept
[yy_current_state
];
1701 YY_DO_BEFORE_ACTION
;
1703 do_action
: /* This label is used only to access EOF actions. */
1706 { /* beginning of action switch */
1707 case 0: /* must back up */
1708 /* undo the effects of YY_DO_BEFORE_ACTION */
1709 *yy_cp
= (yy_hold_char
);
1710 yy_cp
= (yy_last_accepting_cpos
);
1711 yy_current_state
= (yy_last_accepting_state
);
1712 goto yy_find_action
;
1717 pp_incl_state
.seen_junk
++; yy_push_state(pp_pp
);
1720 * Scan for the preprocessor directives
1725 if(yy_top_state() != pp_ignore
) {yy_pp_state(pp_inc
); return tINCLUDE
;} else {yy_pp_state(pp_eol
);}
1730 yy_pp_state(yy_current_state() != pp_ignore
? pp_def
: pp_eol
);
1735 yy_pp_state(pp_eol
); if(yy_top_state() != pp_ignore
) return tERROR
;
1740 yy_pp_state(pp_eol
); if(yy_top_state() != pp_ignore
) return tWARNING
;
1745 yy_pp_state(pp_eol
); if(yy_top_state() != pp_ignore
) return tPRAGMA
;
1750 yy_pp_state(pp_eol
); if(yy_top_state() != pp_ignore
) return tPPIDENT
;
1755 if(yy_top_state() != pp_ignore
) {yy_pp_state(pp_ifd
); return tUNDEF
;} else {yy_pp_state(pp_eol
);}
1760 yy_pp_state(pp_ifd
); return tIFDEF
;
1765 pp_incl_state
.seen_junk
--; yy_pp_state(pp_ifd
); return tIFNDEF
;
1770 yy_pp_state(pp_if
); return tIF
;
1775 yy_pp_state(pp_if
); return tELIF
;
1780 yy_pp_state(pp_endif
); return tELSE
;
1785 yy_pp_state(pp_endif
); return tENDIF
;
1790 if(yy_top_state() != pp_ignore
) {yy_pp_state(pp_line
); return tLINE
;} else {yy_pp_state(pp_eol
);}
1795 if(yy_top_state() != pp_ignore
) {yy_pp_state(pp_line
); return tGCCLINE
;} else {yy_pp_state(pp_eol
);}
1800 ppy_error("Invalid preprocessor token '%s'", ppy_text
);
1803 /* rule 18 can match eol */
1806 newline(1); yy_pop_state(); return tNL
; /* This could be the null-token */
1809 /* rule 19 can match eol */
1817 ppy_error("Preprocessor junk '%s'", ppy_text
);
1825 * Handle #include and #line
1830 return make_number(10, &ppy_lval
, ppy_text
, ppy_leng
);
1835 new_string(); add_string(ppy_text
, ppy_leng
); yy_push_state(pp_iqs
);
1840 new_string(); add_string(ppy_text
, ppy_leng
); yy_push_state(pp_dqs
);
1848 /* rule 26 can match eol */
1851 newline(1); yy_pop_state(); return tNL
;
1854 /* rule 27 can match eol */
1862 ppy_error(yy_current_state() == pp_inc
? "Trailing junk in #include" : "Trailing junk in #line");
1865 * Ignore all input when a false clause is parsed
1873 /* rule 30 can match eol */
1879 /* rule 31 can match eol */
1890 * Handle #if and #elif.
1891 * These require conditionals to be evaluated, but we do not
1892 * want to jam the scanner normally when we see these tokens.
1893 * Note: tIDENT is handled below.
1898 return make_number(8, &ppy_lval
, ppy_text
, ppy_leng
);
1903 ppy_error("Invalid octal digit");
1908 return make_number(10, &ppy_lval
, ppy_text
, ppy_leng
);
1913 return make_number(16, &ppy_lval
, ppy_text
, ppy_leng
);
1918 ppy_error("Invalid hex number");
1923 yy_push_state(pp_defined
); return tDEFINED
;
1966 /* rule 47 can match eol */
1969 newline(1); yy_pop_state(); return tNL
;
1972 /* rule 48 can match eol */
1980 ppy_error("Junk in conditional expression");
1990 new_string(); add_string(ppy_text
, ppy_leng
); yy_push_state(pp_sqs
);
1995 ppy_error("String constants not allowed in conditionals");
2003 * Handle #ifdef, #ifndef and #undef
2004 * to get only an untranslated/unexpanded identifier
2009 ppy_lval
.cptr
= pp_xstrdup(ppy_text
); return tIDENT
;
2017 /* rule 56 can match eol */
2020 newline(1); yy_pop_state(); return tNL
;
2023 /* rule 57 can match eol */
2031 ppy_error("Identifier expected");
2034 * Handle #else and #endif.
2042 /* rule 60 can match eol */
2045 newline(1); yy_pop_state(); return tNL
;
2048 /* rule 61 can match eol */
2056 ppy_error("Garbage after #else or #endif.");
2059 * Handle the special 'defined' keyword.
2060 * This is necessary to get the identifier prior to any
2066 yy_pop_state(); ppy_lval
.cptr
= pp_xstrdup(ppy_text
); return tIDENT
;
2079 /* rule 66 can match eol */
2085 /* rule 67 can match eol */
2088 ppy_error("Identifier expected");
2091 * Handle #error, #warning, #pragma and #ident.
2092 * Pass everything literally to the parser, which
2093 * will act appropriately.
2094 * Comments are stripped from the literal text.
2099 if(yy_top_state() != pp_ignore
) { ppy_lval
.cptr
= pp_xstrdup(ppy_text
); return tLITERAL
; }
2104 if(yy_top_state() != pp_ignore
) { ppy_lval
.cptr
= pp_xstrdup(ppy_text
); return tLITERAL
; }
2107 /* rule 70 can match eol */
2110 if(yy_top_state() != pp_ignore
) { ppy_lval
.cptr
= pp_xstrdup(ppy_text
); return tLITERAL
; }
2113 /* rule 71 can match eol */
2116 newline(1); yy_pop_state(); if(yy_current_state() != pp_ignore
) { return tNL
; }
2119 /* rule 72 can match eol */
2125 * Handle left side of #define
2130 ppy_lval
.cptr
= pp_xstrdup(ppy_text
); if(ppy_lval
.cptr
) ppy_lval
.cptr
[ppy_leng
-1] = '\0'; yy_pp_state(pp_macro
); return tMACRO
;
2135 ppy_lval
.cptr
= pp_xstrdup(ppy_text
); yy_pp_state(pp_define
); return tDEFINE
;
2143 /* rule 76 can match eol */
2149 /* rule 77 can match eol */
2152 perror("Identifier expected");
2155 * Scan the substitution of a define
2160 ppy_lval
.cptr
= pp_xstrdup(ppy_text
); return tLITERAL
;
2163 /* rule 79 can match eol */
2166 ppy_lval
.cptr
= pp_xstrdup(ppy_text
); return tLITERAL
;
2169 /* rule 80 can match eol */
2172 newline(0); ppy_lval
.cptr
= pp_xstrdup(" "); return tLITERAL
;
2175 /* rule 81 can match eol */
2181 /* rule 82 can match eol */
2184 newline(1); yy_pop_state(); return tNL
;
2189 new_string(); add_string(ppy_text
, ppy_leng
); yy_push_state(pp_sqs
);
2194 new_string(); add_string(ppy_text
, ppy_leng
); yy_push_state(pp_dqs
);
2197 * Scan the definition macro arguments
2202 yy_pp_state(pp_mbody
); return tMACROEND
;
2212 ppy_lval
.cptr
= pp_xstrdup(ppy_text
); return tIDENT
;
2225 /* rule 90 can match eol */
2228 ppy_error("Argument identifier expected");
2231 /* rule 91 can match eol */
2237 * Scan the substitution of a macro
2242 ppy_lval
.cptr
= pp_xstrdup(ppy_text
); return tLITERAL
;
2247 ppy_lval
.cptr
= pp_xstrdup(ppy_text
); return tIDENT
;
2262 ppy_lval
.cptr
= pp_xstrdup(ppy_text
); return tLITERAL
;
2267 ppy_lval
.cptr
= pp_xstrdup(ppy_text
); return tLITERAL
;
2270 /* rule 98 can match eol */
2273 newline(0); ppy_lval
.cptr
= pp_xstrdup(" "); return tLITERAL
;
2276 /* rule 99 can match eol */
2282 /* rule 100 can match eol */
2285 newline(1); yy_pop_state(); return tNL
;
2290 new_string(); add_string(ppy_text
, ppy_leng
); yy_push_state(pp_sqs
);
2295 new_string(); add_string(ppy_text
, ppy_leng
); yy_push_state(pp_dqs
);
2298 * Macro expansion text scanning.
2299 * This state is active just after the identifier is scanned
2300 * that triggers an expansion. We *must* delete the leading
2301 * whitespace before we can start scanning for arguments.
2303 * If we do not see a '(' as next trailing token, then we have
2304 * a false alarm. We just continue with a nose-bleed...
2307 *yy_cp
= (yy_hold_char
); /* undo effects of setting up ppy_text */
2308 (yy_c_buf_p
) = yy_cp
-= 1;
2309 YY_DO_BEFORE_ACTION
; /* set up ppy_text again */
2312 yy_pp_state(pp_macscan
);
2315 /* rule 104 can match eol */
2319 if(yy_top_state() != pp_macscan
)
2324 /* rule 105 can match eol */
2333 macexpstackentry_t
*mac
= pop_macro();
2335 put_buffer(mac
->ppp
->ident
, strlen(mac
->ppp
->ident
));
2336 put_buffer(ppy_text
, ppy_leng
);
2341 * Macro expansion argument text scanning.
2342 * This state is active when a macro's arguments are being read for expansion.
2348 if(++MACROPARENTHESES() > 1)
2349 add_text_to_macro(ppy_text
, ppy_leng
);
2356 if(--MACROPARENTHESES() == 0)
2362 add_text_to_macro(ppy_text
, ppy_leng
);
2369 if(MACROPARENTHESES() > 1)
2370 add_text_to_macro(ppy_text
, ppy_leng
);
2378 new_string(); add_string(ppy_text
, ppy_leng
); yy_push_state(pp_dqs
);
2383 new_string(); add_string(ppy_text
, ppy_leng
); yy_push_state(pp_sqs
);
2388 yy_push_state(pp_comment
); add_text_to_macro(" ", 1);
2391 /* rule 113 can match eol */
2394 pp_status
.line_number
++; pp_status
.char_number
= 1; add_text_to_macro(ppy_text
, ppy_leng
);
2399 add_text_to_macro(ppy_text
, ppy_leng
);
2402 /* rule 115 can match eol */
2408 * Comment handling (almost all start-conditions)
2413 yy_push_state(pp_comment
);
2421 /* rule 118 can match eol */
2432 * Remove C++ style comment (almost all start-conditions)
2438 if(ppy_text
[ppy_leng
-1] == '\\')
2439 ppy_warning("C++ style comment ends with an escaped newline (escape ignored)");
2443 * Single, double and <> quoted constants
2448 pp_incl_state
.seen_junk
++; new_string(); add_string(ppy_text
, ppy_leng
); yy_push_state(pp_dqs
);
2453 pp_incl_state
.seen_junk
++; new_string(); add_string(ppy_text
, ppy_leng
); yy_push_state(pp_sqs
);
2458 add_string(ppy_text
, ppy_leng
);
2464 add_string(ppy_text
, ppy_leng
);
2466 switch(yy_current_state())
2473 if (yy_current_state()==RCINCL
) yy_pop_state();
2474 ppy_lval
.cptr
= get_string();
2477 ppy_lval
.cptr
= get_string();
2487 add_string(ppy_text
, ppy_leng
);
2493 add_string(ppy_text
, ppy_leng
);
2495 switch(yy_current_state())
2500 ppy_lval
.cptr
= get_string();
2510 add_string(ppy_text
, ppy_leng
);
2516 add_string(ppy_text
, ppy_leng
);
2518 ppy_lval
.cptr
= get_string();
2523 /* rule 129 can match eol */
2528 * This is tricky; we need to remove the line-continuation
2529 * from preprocessor strings, but OTOH retain them in all
2530 * other strings. This is because the resource grammar is
2531 * even more braindead than initially analysed and line-
2532 * continuations in strings introduce, sigh, newlines in
2533 * the output. There goes the concept of non-breaking, non-
2534 * spacing whitespace.
2536 switch(yy_top_state())
2546 add_string(ppy_text
, ppy_leng
);
2554 add_string(ppy_text
, ppy_leng
);
2557 /* rule 131 can match eol */
2562 add_string(ppy_text
, ppy_leng
);
2563 ppy_warning("Newline in string constant encountered (started line %d)", string_start());
2567 * Identifier scanning
2574 pp_incl_state
.seen_junk
++;
2575 if(!(ppp
= pplookup(ppy_text
)))
2577 if(yy_current_state() == pp_inc
)
2578 ppy_error("Expected include filename");
2580 else if(yy_current_state() == pp_if
)
2582 ppy_lval
.cptr
= pp_xstrdup(ppy_text
);
2586 if((yy_current_state()==INITIAL
) && (strcasecmp(ppy_text
,"RCINCLUDE")==0)){
2587 yy_push_state(RCINCL
);
2590 else put_buffer(ppy_text
, ppy_leng
);
2593 else if(!ppp
->expanding
)
2598 expand_special(ppp
);
2604 yy_push_state(pp_macign
);
2608 pp_internal_error(__FILE__
, __LINE__
, "Invalid define type %d\n", ppp
->type
);
2611 else put_buffer(ppy_text
, ppy_leng
);
2615 * Everything else that needs to be passed and
2616 * newline and continuation handling
2621 pp_incl_state
.seen_junk
++; put_buffer(ppy_text
, ppy_leng
);
2626 put_buffer(ppy_text
, ppy_leng
);
2629 /* rule 135 can match eol */
2635 /* rule 136 can match eol */
2643 pp_incl_state
.seen_junk
++; put_buffer(ppy_text
, ppy_leng
);
2646 * Special catcher for macro argmument expansion to prevent
2647 * newlines to propagate to the output or admin.
2650 /* rule 138 can match eol */
2653 put_buffer(ppy_text
, ppy_leng
);
2659 ppy_lval
.cptr
=pp_xstrdup(ppy_text
);
2661 return tRCINCLUDEPATH
;
2673 new_string(); add_string(ppy_text
,ppy_leng
);yy_push_state(pp_dqs
);
2677 * This is a 'catch-all' rule to discover errors in the scanner
2678 * in an orderly manner.
2683 pp_incl_state
.seen_junk
++; ppy_warning("Unmatched text '%c' (0x%02x); please report\n", isprint(*ppy_text
& 0xff) ? *ppy_text
: ' ', *ppy_text
);
2685 case YY_STATE_EOF(INITIAL
):
2686 case YY_STATE_EOF(pp_pp
):
2687 case YY_STATE_EOF(pp_eol
):
2688 case YY_STATE_EOF(pp_inc
):
2689 case YY_STATE_EOF(pp_dqs
):
2690 case YY_STATE_EOF(pp_sqs
):
2691 case YY_STATE_EOF(pp_iqs
):
2692 case YY_STATE_EOF(pp_comment
):
2693 case YY_STATE_EOF(pp_def
):
2694 case YY_STATE_EOF(pp_define
):
2695 case YY_STATE_EOF(pp_macro
):
2696 case YY_STATE_EOF(pp_mbody
):
2697 case YY_STATE_EOF(pp_macign
):
2698 case YY_STATE_EOF(pp_macscan
):
2699 case YY_STATE_EOF(pp_macexp
):
2700 case YY_STATE_EOF(pp_if
):
2701 case YY_STATE_EOF(pp_ifd
):
2702 case YY_STATE_EOF(pp_endif
):
2703 case YY_STATE_EOF(pp_line
):
2704 case YY_STATE_EOF(pp_defined
):
2705 case YY_STATE_EOF(pp_ignore
):
2706 case YY_STATE_EOF(RCINCL
):
2709 YY_BUFFER_STATE b
= YY_CURRENT_BUFFER
;
2710 bufferstackentry_t
*bep
= pop_buffer();
2712 if((!bep
&& pp_get_if_depth()) || (bep
&& pp_get_if_depth() != bep
->if_depth
))
2713 ppy_warning("Unmatched #if/#endif at end of file");
2717 if(YY_START
!= INITIAL
)
2719 ppy_error("Unexpected end of file during preprocessing");
2724 else if(bep
->should_pop
== 2)
2726 macexpstackentry_t
*mac
;
2730 ppy__delete_buffer(b
);
2738 #line 2739 "ppl.yy.c"
2740 case YY_END_OF_BUFFER
:
2742 /* Amount of text matched not including the EOB char. */
2743 int yy_amount_of_matched_text
= (int) (yy_cp
- (yytext_ptr
)) - 1;
2745 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2746 *yy_cp
= (yy_hold_char
);
2747 YY_RESTORE_YY_MORE_OFFSET
2749 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_NEW
)
2751 /* We're scanning a new file or input source. It's
2752 * possible that this happened because the user
2753 * just pointed ppy_in at a new source and called
2754 * ppy_lex(). If so, then we have to assure
2755 * consistency between YY_CURRENT_BUFFER and our
2756 * globals. Here is the right place to do so, because
2757 * this is the first action (other than possibly a
2758 * back-up) that will match for the new input source.
2760 (yy_n_chars
) = YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
2761 YY_CURRENT_BUFFER_LVALUE
->yy_input_file
= ppy_in
;
2762 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
= YY_BUFFER_NORMAL
;
2765 /* Note that here we test for yy_c_buf_p "<=" to the position
2766 * of the first EOB in the buffer, since yy_c_buf_p will
2767 * already have been incremented past the NUL character
2768 * (since all states make transitions on EOB to the
2769 * end-of-buffer state). Contrast this with the test
2772 if ( (yy_c_buf_p
) <= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
)] )
2773 { /* This was really a NUL. */
2774 yy_state_type yy_next_state
;
2776 (yy_c_buf_p
) = (yytext_ptr
) + yy_amount_of_matched_text
;
2778 yy_current_state
= yy_get_previous_state( );
2780 /* Okay, we're now positioned to make the NUL
2781 * transition. We couldn't have
2782 * yy_get_previous_state() go ahead and do it
2783 * for us because it doesn't know how to deal
2784 * with the possibility of jamming (and we don't
2785 * want to build jamming into it because then it
2786 * will run more slowly).
2789 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
2791 yy_bp
= (yytext_ptr
) + YY_MORE_ADJ
;
2793 if ( yy_next_state
)
2795 /* Consume the NUL. */
2796 yy_cp
= ++(yy_c_buf_p
);
2797 yy_current_state
= yy_next_state
;
2803 yy_cp
= (yy_last_accepting_cpos
);
2804 yy_current_state
= (yy_last_accepting_state
);
2805 goto yy_find_action
;
2809 else switch ( yy_get_next_buffer( ) )
2811 case EOB_ACT_END_OF_FILE
:
2813 (yy_did_buffer_switch_on_eof
) = 0;
2817 /* Note: because we've taken care in
2818 * yy_get_next_buffer() to have set up
2819 * ppy_text, we can now set up
2820 * yy_c_buf_p so that if some total
2821 * hoser (like flex itself) wants to
2822 * call the scanner after we return the
2823 * YY_NULL, it'll still work - another
2824 * YY_NULL will get returned.
2826 (yy_c_buf_p
) = (yytext_ptr
) + YY_MORE_ADJ
;
2828 yy_act
= YY_STATE_EOF(YY_START
);
2834 if ( ! (yy_did_buffer_switch_on_eof
) )
2840 case EOB_ACT_CONTINUE_SCAN
:
2842 (yytext_ptr
) + yy_amount_of_matched_text
;
2844 yy_current_state
= yy_get_previous_state( );
2846 yy_cp
= (yy_c_buf_p
);
2847 yy_bp
= (yytext_ptr
) + YY_MORE_ADJ
;
2850 case EOB_ACT_LAST_MATCH
:
2852 &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
)];
2854 yy_current_state
= yy_get_previous_state( );
2856 yy_cp
= (yy_c_buf_p
);
2857 yy_bp
= (yytext_ptr
) + YY_MORE_ADJ
;
2858 goto yy_find_action
;
2865 "fatal flex scanner internal error--no action found" );
2866 } /* end of action switch */
2867 } /* end of scanning one token */
2868 } /* end of ppy_lex */
2870 /* yy_get_next_buffer - try to read in a new buffer
2872 * Returns a code representing an action:
2873 * EOB_ACT_LAST_MATCH -
2874 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2875 * EOB_ACT_END_OF_FILE - end of file
2877 static int yy_get_next_buffer (void)
2879 register char *dest
= YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
;
2880 register char *source
= (yytext_ptr
);
2881 register int number_to_move
, i
;
2884 if ( (yy_c_buf_p
) > &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
) + 1] )
2886 "fatal flex scanner internal error--end of buffer missed" );
2888 if ( YY_CURRENT_BUFFER_LVALUE
->yy_fill_buffer
== 0 )
2889 { /* Don't try to fill the buffer, so this is an EOF. */
2890 if ( (yy_c_buf_p
) - (yytext_ptr
) - YY_MORE_ADJ
== 1 )
2892 /* We matched a single character, the EOB, so
2893 * treat this as a final EOF.
2895 return EOB_ACT_END_OF_FILE
;
2900 /* We matched some text prior to the EOB, first
2903 return EOB_ACT_LAST_MATCH
;
2907 /* Try to read more data. */
2909 /* First move last chars to start of buffer. */
2910 number_to_move
= (int) ((yy_c_buf_p
) - (yytext_ptr
)) - 1;
2912 for ( i
= 0; i
< number_to_move
; ++i
)
2913 *(dest
++) = *(source
++);
2915 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
2916 /* don't do the read, it's not guaranteed to return an EOF,
2919 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
) = 0;
2924 YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
- number_to_move
- 1;
2926 while ( num_to_read
<= 0 )
2927 { /* Not enough room in the buffer - grow it. */
2929 /* just a shorter name for the current buffer */
2930 YY_BUFFER_STATE b
= YY_CURRENT_BUFFER
;
2932 int yy_c_buf_p_offset
=
2933 (int) ((yy_c_buf_p
) - b
->yy_ch_buf
);
2935 if ( b
->yy_is_our_buffer
)
2937 int new_size
= b
->yy_buf_size
* 2;
2939 if ( new_size
<= 0 )
2940 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
2942 b
->yy_buf_size
*= 2;
2944 b
->yy_ch_buf
= (char *)
2945 /* Include room in for 2 EOB chars. */
2946 ppy_realloc((void *) b
->yy_ch_buf
,b
->yy_buf_size
+ 2 );
2949 /* Can't grow it, we don't own it. */
2952 if ( ! b
->yy_ch_buf
)
2954 "fatal error - scanner input buffer overflow" );
2956 (yy_c_buf_p
) = &b
->yy_ch_buf
[yy_c_buf_p_offset
];
2958 num_to_read
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
-
2963 if ( num_to_read
> YY_READ_BUF_SIZE
)
2964 num_to_read
= YY_READ_BUF_SIZE
;
2966 /* Read in more data. */
2967 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[number_to_move
]),
2968 (yy_n_chars
), (size_t) num_to_read
);
2970 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
);
2973 if ( (yy_n_chars
) == 0 )
2975 if ( number_to_move
== YY_MORE_ADJ
)
2977 ret_val
= EOB_ACT_END_OF_FILE
;
2978 ppy_restart(ppy_in
);
2983 ret_val
= EOB_ACT_LAST_MATCH
;
2984 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
=
2985 YY_BUFFER_EOF_PENDING
;
2990 ret_val
= EOB_ACT_CONTINUE_SCAN
;
2992 if ((yy_size_t
) ((yy_n_chars
) + number_to_move
) > YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
) {
2993 /* Extend the array by 50%, plus the number we really need. */
2994 yy_size_t new_size
= (yy_n_chars
) + number_to_move
+ ((yy_n_chars
) >> 1);
2995 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
= (char *) ppy_realloc((void *) YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
,new_size
);
2996 if ( ! YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
)
2997 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
3000 (yy_n_chars
) += number_to_move
;
3001 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
)] = YY_END_OF_BUFFER_CHAR
;
3002 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
) + 1] = YY_END_OF_BUFFER_CHAR
;
3004 (yytext_ptr
) = &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[0];
3009 /* yy_get_previous_state - get the state just before the EOB char was reached */
3011 static yy_state_type
yy_get_previous_state (void)
3013 register yy_state_type yy_current_state
;
3014 register char *yy_cp
;
3016 yy_current_state
= (yy_start
);
3017 yy_current_state
+= YY_AT_BOL();
3019 for ( yy_cp
= (yytext_ptr
) + YY_MORE_ADJ
; yy_cp
< (yy_c_buf_p
); ++yy_cp
)
3021 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
3022 if ( yy_accept
[yy_current_state
] )
3024 (yy_last_accepting_state
) = yy_current_state
;
3025 (yy_last_accepting_cpos
) = yy_cp
;
3027 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
3029 yy_current_state
= (int) yy_def
[yy_current_state
];
3030 if ( yy_current_state
>= 416 )
3031 yy_c
= yy_meta
[(unsigned int) yy_c
];
3033 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
3036 return yy_current_state
;
3039 /* yy_try_NUL_trans - try to make a transition on the NUL character
3042 * next_state = yy_try_NUL_trans( current_state );
3044 static yy_state_type
yy_try_NUL_trans (yy_state_type yy_current_state
)
3046 register int yy_is_jam
;
3047 register char *yy_cp
= (yy_c_buf_p
);
3049 register YY_CHAR yy_c
= 1;
3050 if ( yy_accept
[yy_current_state
] )
3052 (yy_last_accepting_state
) = yy_current_state
;
3053 (yy_last_accepting_cpos
) = yy_cp
;
3055 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
3057 yy_current_state
= (int) yy_def
[yy_current_state
];
3058 if ( yy_current_state
>= 416 )
3059 yy_c
= yy_meta
[(unsigned int) yy_c
];
3061 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
3062 yy_is_jam
= (yy_current_state
== 415);
3064 return yy_is_jam
? 0 : yy_current_state
;
3069 static int yyinput (void)
3071 static int input (void)
3077 *(yy_c_buf_p
) = (yy_hold_char
);
3079 if ( *(yy_c_buf_p
) == YY_END_OF_BUFFER_CHAR
)
3081 /* yy_c_buf_p now points to the character we want to return.
3082 * If this occurs *before* the EOB characters, then it's a
3083 * valid NUL; if not, then we've hit the end of the buffer.
3085 if ( (yy_c_buf_p
) < &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
)] )
3086 /* This was really a NUL. */
3087 *(yy_c_buf_p
) = '\0';
3090 { /* need more input */
3091 int offset
= (yy_c_buf_p
) - (yytext_ptr
);
3094 switch ( yy_get_next_buffer( ) )
3096 case EOB_ACT_LAST_MATCH
:
3097 /* This happens because yy_g_n_b()
3098 * sees that we've accumulated a
3099 * token and flags that we need to
3100 * try matching the token before
3101 * proceeding. But for input(),
3102 * there's no matching to consider.
3103 * So convert the EOB_ACT_LAST_MATCH
3104 * to EOB_ACT_END_OF_FILE.
3107 /* Reset buffer status. */
3108 ppy_restart(ppy_in
);
3112 case EOB_ACT_END_OF_FILE
:
3117 if ( ! (yy_did_buffer_switch_on_eof
) )
3126 case EOB_ACT_CONTINUE_SCAN
:
3127 (yy_c_buf_p
) = (yytext_ptr
) + offset
;
3133 c
= *(unsigned char *) (yy_c_buf_p
); /* cast for 8-bit char's */
3134 *(yy_c_buf_p
) = '\0'; /* preserve ppy_text */
3135 (yy_hold_char
) = *++(yy_c_buf_p
);
3137 YY_CURRENT_BUFFER_LVALUE
->yy_at_bol
= (c
== '\n');
3141 #endif /* ifndef YY_NO_INPUT */
3143 /** Immediately switch to a different input stream.
3144 * @param input_file A readable stream.
3146 * @note This function does not reset the start condition to @c INITIAL .
3148 void ppy_restart (FILE * input_file
)
3151 if ( ! YY_CURRENT_BUFFER
){
3152 ppy_ensure_buffer_stack ();
3153 YY_CURRENT_BUFFER_LVALUE
=
3154 ppy__create_buffer(ppy_in
,YY_BUF_SIZE
);
3157 ppy__init_buffer(YY_CURRENT_BUFFER
,input_file
);
3158 ppy__load_buffer_state( );
3161 /** Switch to a different input buffer.
3162 * @param new_buffer The new input buffer.
3165 void ppy__switch_to_buffer (YY_BUFFER_STATE new_buffer
)
3168 /* TODO. We should be able to replace this entire function body
3170 * ppy_pop_buffer_state();
3171 * ppy_push_buffer_state(new_buffer);
3173 ppy_ensure_buffer_stack ();
3174 if ( YY_CURRENT_BUFFER
== new_buffer
)
3177 if ( YY_CURRENT_BUFFER
)
3179 /* Flush out information for old buffer. */
3180 *(yy_c_buf_p
) = (yy_hold_char
);
3181 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= (yy_c_buf_p
);
3182 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
);
3185 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
3186 ppy__load_buffer_state( );
3188 /* We don't actually know whether we did this switch during
3189 * EOF (ppy_wrap()) processing, but the only time this flag
3190 * is looked at is after ppy_wrap() is called, so it's safe
3191 * to go ahead and always set it.
3193 (yy_did_buffer_switch_on_eof
) = 1;
3196 static void ppy__load_buffer_state (void)
3198 (yy_n_chars
) = YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
3199 (yytext_ptr
) = (yy_c_buf_p
) = YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
;
3200 ppy_in
= YY_CURRENT_BUFFER_LVALUE
->yy_input_file
;
3201 (yy_hold_char
) = *(yy_c_buf_p
);
3204 /** Allocate and initialize an input buffer state.
3205 * @param file A readable stream.
3206 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
3208 * @return the allocated buffer state.
3210 YY_BUFFER_STATE
ppy__create_buffer (FILE * file
, int size
)
3214 b
= (YY_BUFFER_STATE
) ppy_alloc(sizeof( struct yy_buffer_state
) );
3216 YY_FATAL_ERROR( "out of dynamic memory in ppy__create_buffer()" );
3218 b
->yy_buf_size
= size
;
3220 /* yy_ch_buf has to be 2 characters longer than the size given because
3221 * we need to put in 2 end-of-buffer characters.
3223 b
->yy_ch_buf
= (char *) ppy_alloc(b
->yy_buf_size
+ 2 );
3224 if ( ! b
->yy_ch_buf
)
3225 YY_FATAL_ERROR( "out of dynamic memory in ppy__create_buffer()" );
3227 b
->yy_is_our_buffer
= 1;
3229 ppy__init_buffer(b
,file
);
3234 /** Destroy the buffer.
3235 * @param b a buffer created with ppy__create_buffer()
3238 void ppy__delete_buffer (YY_BUFFER_STATE b
)
3244 if ( b
== YY_CURRENT_BUFFER
) /* Not sure if we should pop here. */
3245 YY_CURRENT_BUFFER_LVALUE
= (YY_BUFFER_STATE
) 0;
3247 if ( b
->yy_is_our_buffer
)
3248 ppy_free((void *) b
->yy_ch_buf
);
3250 ppy_free((void *) b
);
3253 /* Initializes or reinitializes a buffer.
3254 * This function is sometimes called more than once on the same buffer,
3255 * such as during a ppy_restart() or at EOF.
3257 static void ppy__init_buffer (YY_BUFFER_STATE b
, FILE * file
)
3262 ppy__flush_buffer(b
);
3264 b
->yy_input_file
= file
;
3265 b
->yy_fill_buffer
= 1;
3267 /* If b is the current buffer, then ppy__init_buffer was _probably_
3268 * called from ppy_restart() or through yy_get_next_buffer.
3269 * In that case, we don't want to reset the lineno or column.
3271 if (b
!= YY_CURRENT_BUFFER
){
3272 b
->yy_bs_lineno
= 1;
3273 b
->yy_bs_column
= 0;
3276 b
->yy_is_interactive
= 0;
3281 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
3282 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
3285 void ppy__flush_buffer (YY_BUFFER_STATE b
)
3292 /* We always need two end-of-buffer characters. The first causes
3293 * a transition to the end-of-buffer state. The second causes
3294 * a jam in that state.
3296 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
3297 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
3299 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
3302 b
->yy_buffer_status
= YY_BUFFER_NEW
;
3304 if ( b
== YY_CURRENT_BUFFER
)
3305 ppy__load_buffer_state( );
3308 /** Pushes the new state onto the stack. The new state becomes
3309 * the current state. This function will allocate the stack
3311 * @param new_buffer The new state.
3314 void ppy_push_buffer_state (YY_BUFFER_STATE new_buffer
)
3316 if (new_buffer
== NULL
)
3319 ppy_ensure_buffer_stack();
3321 /* This block is copied from ppy__switch_to_buffer. */
3322 if ( YY_CURRENT_BUFFER
)
3324 /* Flush out information for old buffer. */
3325 *(yy_c_buf_p
) = (yy_hold_char
);
3326 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= (yy_c_buf_p
);
3327 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
);
3330 /* Only push if top exists. Otherwise, replace top. */
3331 if (YY_CURRENT_BUFFER
)
3332 (yy_buffer_stack_top
)++;
3333 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
3335 /* copied from ppy__switch_to_buffer. */
3336 ppy__load_buffer_state( );
3337 (yy_did_buffer_switch_on_eof
) = 1;
3340 /** Removes and deletes the top of the stack, if present.
3341 * The next element becomes the new top.
3344 void ppy_pop_buffer_state (void)
3346 if (!YY_CURRENT_BUFFER
)
3349 ppy__delete_buffer(YY_CURRENT_BUFFER
);
3350 YY_CURRENT_BUFFER_LVALUE
= NULL
;
3351 if ((yy_buffer_stack_top
) > 0)
3352 --(yy_buffer_stack_top
);
3354 if (YY_CURRENT_BUFFER
) {
3355 ppy__load_buffer_state( );
3356 (yy_did_buffer_switch_on_eof
) = 1;
3360 /* Allocates the stack if it does not exist.
3361 * Guarantees space for at least one push.
3363 static void ppy_ensure_buffer_stack (void)
3367 if (!(yy_buffer_stack
)) {
3369 /* First allocation is just for 2 elements, since we don't know if this
3370 * scanner will even need a stack. We use 2 instead of 1 to avoid an
3371 * immediate realloc on the next call.
3374 (yy_buffer_stack
) = (struct yy_buffer_state
**)ppy_alloc
3375 (num_to_alloc
* sizeof(struct yy_buffer_state
*)
3377 if ( ! (yy_buffer_stack
) )
3378 YY_FATAL_ERROR( "out of dynamic memory in ppy_ensure_buffer_stack()" );
3380 memset((yy_buffer_stack
), 0, num_to_alloc
* sizeof(struct yy_buffer_state
*));
3382 (yy_buffer_stack_max
) = num_to_alloc
;
3383 (yy_buffer_stack_top
) = 0;
3387 if ((yy_buffer_stack_top
) >= ((yy_buffer_stack_max
)) - 1){
3389 /* Increase the buffer to prepare for a possible push. */
3390 int grow_size
= 8 /* arbitrary grow size */;
3392 num_to_alloc
= (yy_buffer_stack_max
) + grow_size
;
3393 (yy_buffer_stack
) = (struct yy_buffer_state
**)ppy_realloc
3395 num_to_alloc
* sizeof(struct yy_buffer_state
*)
3397 if ( ! (yy_buffer_stack
) )
3398 YY_FATAL_ERROR( "out of dynamic memory in ppy_ensure_buffer_stack()" );
3400 /* zero only the new slots.*/
3401 memset((yy_buffer_stack
) + (yy_buffer_stack_max
), 0, grow_size
* sizeof(struct yy_buffer_state
*));
3402 (yy_buffer_stack_max
) = num_to_alloc
;
3406 /** Setup the input buffer state to scan directly from a user-specified character buffer.
3407 * @param base the character buffer
3408 * @param size the size in bytes of the character buffer
3410 * @return the newly allocated buffer state object.
3412 YY_BUFFER_STATE
ppy__scan_buffer (char * base
, yy_size_t size
)
3417 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
3418 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
3419 /* They forgot to leave room for the EOB's. */
3422 b
= (YY_BUFFER_STATE
) ppy_alloc(sizeof( struct yy_buffer_state
) );
3424 YY_FATAL_ERROR( "out of dynamic memory in ppy__scan_buffer()" );
3426 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
3427 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
3428 b
->yy_is_our_buffer
= 0;
3429 b
->yy_input_file
= 0;
3430 b
->yy_n_chars
= b
->yy_buf_size
;
3431 b
->yy_is_interactive
= 0;
3433 b
->yy_fill_buffer
= 0;
3434 b
->yy_buffer_status
= YY_BUFFER_NEW
;
3436 ppy__switch_to_buffer(b
);
3441 /** Setup the input buffer state to scan a string. The next call to ppy_lex() will
3442 * scan from a @e copy of @a str.
3443 * @param yystr a NUL-terminated string to scan
3445 * @return the newly allocated buffer state object.
3446 * @note If you want to scan bytes that may contain NUL values, then use
3447 * ppy__scan_bytes() instead.
3449 YY_BUFFER_STATE
ppy__scan_string (yyconst
char * yystr
)
3452 return ppy__scan_bytes(yystr
,strlen(yystr
) );
3455 /** Setup the input buffer state to scan the given bytes. The next call to ppy_lex() will
3456 * scan from a @e copy of @a bytes.
3457 * @param yybytes the byte buffer to scan
3458 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
3460 * @return the newly allocated buffer state object.
3462 YY_BUFFER_STATE
ppy__scan_bytes (yyconst
char * yybytes
, int _yybytes_len
)
3469 /* Get memory for full buffer, including space for trailing EOB's. */
3470 n
= _yybytes_len
+ 2;
3471 buf
= (char *) ppy_alloc(n
);
3473 YY_FATAL_ERROR( "out of dynamic memory in ppy__scan_bytes()" );
3475 for ( i
= 0; i
< _yybytes_len
; ++i
)
3476 buf
[i
] = yybytes
[i
];
3478 buf
[_yybytes_len
] = buf
[_yybytes_len
+1] = YY_END_OF_BUFFER_CHAR
;
3480 b
= ppy__scan_buffer(buf
,n
);
3482 YY_FATAL_ERROR( "bad buffer in ppy__scan_bytes()" );
3484 /* It's okay to grow etc. this buffer, and we should throw it
3485 * away when we're done.
3487 b
->yy_is_our_buffer
= 1;
3492 static void yy_push_state (int new_state
)
3494 if ( (yy_start_stack_ptr
) >= (yy_start_stack_depth
) )
3498 (yy_start_stack_depth
) += YY_START_STACK_INCR
;
3499 new_size
= (yy_start_stack_depth
) * sizeof( int );
3501 if ( ! (yy_start_stack
) )
3502 (yy_start_stack
) = (int *) ppy_alloc(new_size
);
3505 (yy_start_stack
) = (int *) ppy_realloc((void *) (yy_start_stack
),new_size
);
3507 if ( ! (yy_start_stack
) )
3508 YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
3511 (yy_start_stack
)[(yy_start_stack_ptr
)++] = YY_START
;
3516 static void yy_pop_state (void)
3518 if ( --(yy_start_stack_ptr
) < 0 )
3519 YY_FATAL_ERROR( "start-condition stack underflow" );
3521 BEGIN((yy_start_stack
)[(yy_start_stack_ptr
)]);
3524 static int yy_top_state (void)
3526 return (yy_start_stack
)[(yy_start_stack_ptr
) - 1];
3529 #ifndef YY_EXIT_FAILURE
3530 #define YY_EXIT_FAILURE 2
3533 static void yy_fatal_error (yyconst
char* msg
)
3535 (void) fprintf( stderr
, "%s\n", msg
);
3536 exit( YY_EXIT_FAILURE
);
3539 /* Redefine yyless() so it works in section 3 code. */
3545 /* Undo effects of setting up ppy_text. */ \
3546 int yyless_macro_arg = (n); \
3547 YY_LESS_LINENO(yyless_macro_arg);\
3548 ppy_text[ppy_leng] = (yy_hold_char); \
3549 (yy_c_buf_p) = ppy_text + yyless_macro_arg; \
3550 (yy_hold_char) = *(yy_c_buf_p); \
3551 *(yy_c_buf_p) = '\0'; \
3552 ppy_leng = yyless_macro_arg; \
3556 /* Accessor methods (get/set functions) to struct members. */
3558 /** Get the current line number.
3561 int ppy_get_lineno (void)
3567 /** Get the input stream.
3570 FILE *ppy_get_in (void)
3575 /** Get the output stream.
3578 FILE *ppy_get_out (void)
3583 /** Get the length of the current token.
3586 int ppy_get_leng (void)
3591 /** Get the current token.
3595 char *ppy_get_text (void)
3600 /** Set the current line number.
3601 * @param line_number
3604 void ppy_set_lineno (int line_number
)
3607 ppy_lineno
= line_number
;
3610 /** Set the input stream. This does not discard the current
3612 * @param in_str A readable stream.
3614 * @see ppy__switch_to_buffer
3616 void ppy_set_in (FILE * in_str
)
3621 void ppy_set_out (FILE * out_str
)
3626 int ppy_get_debug (void)
3628 return ppy__flex_debug
;
3631 void ppy_set_debug (int bdebug
)
3633 ppy__flex_debug
= bdebug
;
3636 static int yy_init_globals (void)
3638 /* Initialization is the same as for the non-reentrant scanner.
3639 * This function is called from ppy_lex_destroy(), so don't allocate here.
3642 (yy_buffer_stack
) = 0;
3643 (yy_buffer_stack_top
) = 0;
3644 (yy_buffer_stack_max
) = 0;
3645 (yy_c_buf_p
) = (char *) 0;
3649 (yy_start_stack_ptr
) = 0;
3650 (yy_start_stack_depth
) = 0;
3651 (yy_start_stack
) = NULL
;
3653 /* Defined in main.c */
3658 ppy_in
= (FILE *) 0;
3659 ppy_out
= (FILE *) 0;
3662 /* For future reference: Set errno on error, since we are called by
3668 /* ppy_lex_destroy is for both reentrant and non-reentrant scanners. */
3669 int ppy_lex_destroy (void)
3672 /* Pop the buffer stack, destroying each element. */
3673 while(YY_CURRENT_BUFFER
){
3674 ppy__delete_buffer(YY_CURRENT_BUFFER
);
3675 YY_CURRENT_BUFFER_LVALUE
= NULL
;
3676 ppy_pop_buffer_state();
3679 /* Destroy the stack itself. */
3680 ppy_free((yy_buffer_stack
) );
3681 (yy_buffer_stack
) = NULL
;
3683 /* Destroy the start condition stack. */
3684 ppy_free((yy_start_stack
) );
3685 (yy_start_stack
) = NULL
;
3687 /* Reset the globals. This is important in a non-reentrant scanner so the next time
3688 * ppy_lex() is called, initialization will occur. */
3695 * Internal utility routines.
3699 static void yy_flex_strncpy (char* s1
, yyconst
char * s2
, int n
)
3702 for ( i
= 0; i
< n
; ++i
)
3707 #ifdef YY_NEED_STRLEN
3708 static int yy_flex_strlen (yyconst
char * s
)
3711 for ( n
= 0; s
[n
]; ++n
)
3718 void *ppy_alloc (yy_size_t size
)
3720 return (void *) malloc( size
);
3723 void *ppy_realloc (void * ptr
, yy_size_t size
)
3725 /* The cast to (char *) in the following accommodates both
3726 * implementations that use char* generic pointers, and those
3727 * that use void* generic pointers. It works with the latter
3728 * because both ANSI C and C++ allow castless assignment from
3729 * any pointer type to void*, and deal with argument conversions
3730 * as though doing an assignment.
3732 return (void *) realloc( (char *) ptr
, size
);
3735 void ppy_free (void * ptr
)
3737 free( (char *) ptr
); /* see ppy_realloc() for (char *) cast */
3740 #define YYTABLES_NAME "yytables"
3746 **************************************************************************
3748 **************************************************************************
3760 *-------------------------------------------------------------------------
3761 * Output newlines or set them as continuations
3763 * Input: -1 - Don't count this one, but update local position (see pp_dqs)
3764 * 0 - Line-continuation seen and cache output
3765 * 1 - Newline seen and flush output
3766 *-------------------------------------------------------------------------
3768 static void newline(int dowrite
)
3770 pp_status
.line_number
++;
3771 pp_status
.char_number
= 1;
3779 for(;ncontinuations
; ncontinuations
--)
3780 put_buffer("\n", 1);
3786 *-------------------------------------------------------------------------
3787 * Make a number out of an any-base and suffixed string
3789 * Possible number extensions:
3792 * - "LL" long long int
3793 * - "U" unsigned int
3794 * - "UL" unsigned long int
3795 * - "ULL" unsigned long long int
3796 * - "LU" unsigned long int
3797 * - "LLU" unsigned long long int
3801 * The sizes of resulting 'int' and 'long' are compiler specific.
3802 * I depend on sizeof(int) > 2 here (although a relatively safe
3804 * Long longs are not yet implemented because this is very compiler
3805 * specific and I don't want to think too much about the problems.
3807 *-------------------------------------------------------------------------
3809 static int make_number(int radix
, YYSTYPE
*val
, const char *str
, int len
)
3818 ext
[2] = toupper(str
[len
-1]);
3819 ext
[1] = len
> 1 ? toupper(str
[len
-2]) : ' ';
3820 ext
[0] = len
> 2 ? toupper(str
[len
-3]) : ' ';
3822 if(!strcmp(ext
, "LUL"))
3824 ppy_error("Invalid constant suffix");
3827 else if(!strcmp(ext
, "LLU") || !strcmp(ext
, "ULL"))
3832 else if(!strcmp(ext
+1, "LU") || !strcmp(ext
+1, "UL"))
3837 else if(!strcmp(ext
+1, "LL"))
3841 else if(!strcmp(ext
+2, "L"))
3845 else if(!strcmp(ext
+2, "U"))
3852 /* Assume as in the declaration of wrc_ull_t and wrc_sll_t */
3853 #ifdef HAVE_LONG_LONG
3857 val
->ull
= strtoull(str
, NULL
, radix
);
3858 if (val
->ull
== ULLONG_MAX
&& errno
== ERANGE
)
3859 ppy_error("integer constant %s is too large\n", str
);
3865 val
->sll
= strtoll(str
, NULL
, radix
);
3866 if ((val
->sll
== LLONG_MIN
|| val
->sll
== LLONG_MAX
) && errno
== ERANGE
)
3867 ppy_error("integer constant %s is too large\n", str
);
3871 pp_internal_error(__FILE__
, __LINE__
, "long long constants not supported on this platform");
3874 else if(is_u
&& is_l
)
3877 val
->ulong
= strtoul(str
, NULL
, radix
);
3878 if (val
->ulong
== ULONG_MAX
&& errno
== ERANGE
)
3879 ppy_error("integer constant %s is too large\n", str
);
3882 else if(!is_u
&& is_l
)
3885 val
->slong
= strtol(str
, NULL
, radix
);
3886 if ((val
->slong
== LONG_MIN
|| val
->slong
== LONG_MAX
) && errno
== ERANGE
)
3887 ppy_error("integer constant %s is too large\n", str
);
3890 else if(is_u
&& !is_l
)
3894 ul
= strtoul(str
, NULL
, radix
);
3895 if ((ul
== ULONG_MAX
&& errno
== ERANGE
) || (ul
> UINT_MAX
))
3896 ppy_error("integer constant %s is too large\n", str
);
3897 val
->uint
= (unsigned int)ul
;
3901 /* Else it must be an int... */
3903 l
= strtol(str
, NULL
, radix
);
3904 if (((l
== LONG_MIN
|| l
== LONG_MAX
) && errno
== ERANGE
) ||
3905 (l
> INT_MAX
) || (l
< INT_MIN
))
3906 ppy_error("integer constant %s is too large\n", str
);
3913 *-------------------------------------------------------------------------
3914 * Macro and define expansion support
3916 * FIXME: Variable macro arguments.
3917 *-------------------------------------------------------------------------
3919 static void expand_special(pp_entry_t
*ppp
)
3921 static char *buf
= NULL
;
3924 assert(ppp
->type
== def_special
);
3926 if(!strcmp(ppp
->ident
, "__LINE__"))
3928 new_buf
= pp_xrealloc(buf
, 32);
3932 sprintf(buf
, "%d", pp_status
.line_number
);
3934 else if(!strcmp(ppp
->ident
, "__FILE__"))
3936 new_buf
= pp_xrealloc(buf
, strlen(pp_status
.input
) + 3);
3940 sprintf(buf
, "\"%s\"", pp_status
.input
);
3943 pp_internal_error(__FILE__
, __LINE__
, "Special macro '%s' not found...\n", ppp
->ident
);
3946 fprintf(stderr
, "expand_special(%d): %s:%d: '%s' -> '%s'\n",
3949 pp_status
.line_number
,
3955 push_buffer(ppp
, NULL
, NULL
, 0);
3956 ppy__scan_string(buf
);
3960 static void expand_define(pp_entry_t
*ppp
)
3962 assert(ppp
->type
== def_define
);
3965 fprintf(stderr
, "expand_define(%d): %s:%d: '%s' -> '%s'\n",
3968 pp_status
.line_number
,
3971 if(ppp
->subst
.text
&& ppp
->subst
.text
[0])
3973 push_buffer(ppp
, NULL
, NULL
, 0);
3974 ppy__scan_string(ppp
->subst
.text
);
3978 static int curdef_idx
= 0;
3979 static int curdef_alloc
= 0;
3980 static char *curdef_text
= NULL
;
3982 static void add_text(const char *str
, int len
)
3989 if(curdef_idx
>= curdef_alloc
|| curdef_alloc
- curdef_idx
< len
)
3991 new_alloc
= curdef_alloc
+ ((len
+ ALLOCBLOCKSIZE
-1) & ~(ALLOCBLOCKSIZE
-1));
3992 new_text
= pp_xrealloc(curdef_text
, new_alloc
* sizeof(curdef_text
[0]));
3995 curdef_text
= new_text
;
3996 curdef_alloc
= new_alloc
;
3997 if(curdef_alloc
> 65536)
3998 ppy_warning("Reallocating macro-expansion buffer larger than 64kB");
4000 memcpy(&curdef_text
[curdef_idx
], str
, len
);
4004 static mtext_t
*add_expand_text(mtext_t
*mtp
, macexpstackentry_t
*mep
, int *nnl
)
4018 fprintf(stderr
, "add_expand_text: exp_text: '%s'\n", mtp
->subst
.text
);
4019 add_text(mtp
->subst
.text
, strlen(mtp
->subst
.text
));
4024 fprintf(stderr
, "add_expand_text: exp_stringize(%d): '%s'\n",
4026 mep
->args
[mtp
->subst
.argidx
]);
4027 cptr
= mep
->args
[mtp
->subst
.argidx
];
4031 if(*cptr
== '"' || *cptr
== '\\')
4041 fprintf(stderr
, "add_expand_text: exp_concat\n");
4042 /* Remove trailing whitespace from current expansion text */
4045 if(isspace(curdef_text
[curdef_idx
-1] & 0xff))
4050 /* tag current position and recursively expand the next part */
4052 mtp
= add_expand_text(mtp
->next
, mep
, nnl
);
4054 /* Now get rid of the leading space of the expansion */
4055 cptr
= &curdef_text
[tag
];
4056 n
= curdef_idx
- tag
;
4059 if(isspace(*cptr
& 0xff))
4067 if(cptr
!= &curdef_text
[tag
])
4069 memmove(&curdef_text
[tag
], cptr
, n
);
4070 curdef_idx
-= (curdef_idx
- tag
) - n
;
4075 if((mtp
->next
&& mtp
->next
->type
== exp_concat
) || (mtp
->prev
&& mtp
->prev
->type
== exp_concat
))
4076 exp
= mep
->args
[mtp
->subst
.argidx
];
4078 exp
= mep
->ppargs
[mtp
->subst
.argidx
];
4081 add_text(exp
, strlen(exp
));
4082 *nnl
-= mep
->nnls
[mtp
->subst
.argidx
];
4083 cptr
= strchr(exp
, '\n');
4087 cptr
= strchr(cptr
+1, '\n');
4089 mep
->nnls
[mtp
->subst
.argidx
] = 0;
4092 fprintf(stderr
, "add_expand_text: exp_subst(%d): '%s'\n", mtp
->subst
.argidx
, exp
);
4096 pp_internal_error(__FILE__
, __LINE__
, "Invalid expansion type (%d) in macro expansion\n", mtp
->type
);
4101 static void expand_macro(macexpstackentry_t
*mep
)
4107 pp_entry_t
*ppp
= mep
->ppp
;
4108 int nargs
= mep
->nargs
;
4110 assert(ppp
->type
== def_macro
);
4111 assert(ppp
->expanding
== 0);
4113 if((ppp
->nargs
>= 0 && nargs
!= ppp
->nargs
) || (ppp
->nargs
< 0 && nargs
< -ppp
->nargs
))
4115 ppy_error("Too %s macro arguments (%d)", nargs
< abs(ppp
->nargs
) ? "few" : "many", nargs
);
4119 for(n
= 0; n
< nargs
; n
++)
4120 nnl
+= mep
->nnls
[n
];
4123 fprintf(stderr
, "expand_macro(%d): %s:%d: '%s'(%d,%d) -> ...\n",
4126 pp_status
.line_number
,
4133 for(mtp
= ppp
->subst
.mtext
; mtp
; mtp
= mtp
->next
)
4135 if(!(mtp
= add_expand_text(mtp
, mep
, &nnl
)))
4139 for(n
= 0; n
< nnl
; n
++)
4142 /* To make sure there is room and termination (see below) */
4145 /* Strip trailing whitespace from expansion */
4146 for(k
= curdef_idx
, cptr
= &curdef_text
[curdef_idx
-1]; k
> 0; k
--, cptr
--)
4148 if(!isspace(*cptr
& 0xff))
4153 * We must add *one* whitespace to make sure that there
4154 * is a token-separation after the expansion.
4160 /* Strip leading whitespace from expansion */
4161 for(n
= 0, cptr
= curdef_text
; n
< k
; n
++, cptr
++)
4163 if(!isspace(*cptr
& 0xff))
4170 fprintf(stderr
, "expand_text: '%s'\n", curdef_text
+ n
);
4171 push_buffer(ppp
, NULL
, NULL
, 0);
4172 /*ppy__scan_bytes(curdef_text + n,k - n);*/
4173 ppy__scan_string(curdef_text
+ n
);
4178 *-------------------------------------------------------------------------
4179 * String collection routines
4180 *-------------------------------------------------------------------------
4182 static void new_string(void)
4186 ppy_warning("new_string: strbuf_idx != 0");
4189 str_startline
= pp_status
.line_number
;
4192 static void add_string(const char *str
, int len
)
4199 if(strbuf_idx
>= strbuf_alloc
|| strbuf_alloc
- strbuf_idx
< len
)
4201 new_alloc
= strbuf_alloc
+ ((len
+ ALLOCBLOCKSIZE
-1) & ~(ALLOCBLOCKSIZE
-1));
4202 new_buffer
= pp_xrealloc(strbuffer
, new_alloc
* sizeof(strbuffer
[0]));
4205 strbuffer
= new_buffer
;
4206 strbuf_alloc
= new_alloc
;
4207 if(strbuf_alloc
> 65536)
4208 ppy_warning("Reallocating string buffer larger than 64kB");
4210 memcpy(&strbuffer
[strbuf_idx
], str
, len
);
4214 static char *get_string(void)
4216 char *str
= pp_xmalloc(strbuf_idx
+ 1);
4219 memcpy(str
, strbuffer
, strbuf_idx
);
4220 str
[strbuf_idx
] = '\0';
4227 static void put_string(void)
4229 put_buffer(strbuffer
, strbuf_idx
);
4235 static int string_start(void)
4237 return str_startline
;
4242 *-------------------------------------------------------------------------
4244 *-------------------------------------------------------------------------
4246 static void push_buffer(pp_entry_t
*ppp
, char *filename
, char *incname
, int pop
)
4249 printf("push_buffer(%d): %p %p %p %d\n", bufferstackidx
, ppp
, filename
, incname
, pop
);
4250 if(bufferstackidx
>= MAXBUFFERSTACK
)
4251 pp_internal_error(__FILE__
, __LINE__
, "Buffer stack overflow");
4253 memset(&bufferstack
[bufferstackidx
], 0, sizeof(bufferstack
[0]));
4254 bufferstack
[bufferstackidx
].bufferstate
= YY_CURRENT_BUFFER
;
4255 bufferstack
[bufferstackidx
].filehandle
= pp_status
.file
;
4256 bufferstack
[bufferstackidx
].define
= ppp
;
4257 bufferstack
[bufferstackidx
].line_number
= pp_status
.line_number
;
4258 bufferstack
[bufferstackidx
].char_number
= pp_status
.char_number
;
4259 bufferstack
[bufferstackidx
].if_depth
= pp_get_if_depth();
4260 bufferstack
[bufferstackidx
].should_pop
= pop
;
4261 bufferstack
[bufferstackidx
].filename
= pp_status
.input
;
4262 bufferstack
[bufferstackidx
].ncontinuations
= ncontinuations
;
4263 bufferstack
[bufferstackidx
].incl
= pp_incl_state
;
4264 bufferstack
[bufferstackidx
].include_filename
= incname
;
4270 /* These will track the ppy_error to the correct file and line */
4271 pp_status
.line_number
= 1;
4272 pp_status
.char_number
= 1;
4273 pp_status
.input
= filename
;
4277 pp_internal_error(__FILE__
, __LINE__
, "Pushing buffer without knowing where to go to");
4281 static bufferstackentry_t
*pop_buffer(void)
4283 if(bufferstackidx
< 0)
4284 pp_internal_error(__FILE__
, __LINE__
, "Bufferstack underflow?");
4286 if(bufferstackidx
== 0)
4291 if(bufferstack
[bufferstackidx
].define
)
4292 bufferstack
[bufferstackidx
].define
->expanding
= 0;
4295 includelogicentry_t
*iep
= NULL
;
4297 if(!bufferstack
[bufferstackidx
].should_pop
)
4299 wpp_callbacks
->close(pp_status
.file
);
4300 pp_writestring("# %d \"%s\" 2\n", bufferstack
[bufferstackidx
].line_number
, bufferstack
[bufferstackidx
].filename
);
4302 /* We have EOF, check the include logic */
4303 if(pp_incl_state
.state
== 2 && !pp_incl_state
.seen_junk
&& pp_incl_state
.ppp
)
4305 pp_entry_t
*ppp
= pplookup(pp_incl_state
.ppp
);
4308 iep
= pp_xmalloc(sizeof(includelogicentry_t
));
4313 iep
->filename
= bufferstack
[bufferstackidx
].include_filename
;
4315 iep
->next
= pp_includelogiclist
;
4317 iep
->next
->prev
= iep
;
4318 pp_includelogiclist
= iep
;
4320 fprintf(stderr
, "pop_buffer: %s:%d: includelogic added, include_ppp='%s', file='%s'\n",
4321 bufferstack
[bufferstackidx
].filename
, bufferstack
[bufferstackidx
].line_number
, pp_incl_state
.ppp
, iep
->filename
);
4325 free(pp_incl_state
.ppp
);
4326 pp_incl_state
= bufferstack
[bufferstackidx
].incl
;
4329 if (bufferstack
[bufferstackidx
].include_filename
)
4331 free(pp_status
.input
);
4332 pp_status
.input
= bufferstack
[bufferstackidx
].filename
;
4334 pp_status
.line_number
= bufferstack
[bufferstackidx
].line_number
;
4335 pp_status
.char_number
= bufferstack
[bufferstackidx
].char_number
;
4336 ncontinuations
= bufferstack
[bufferstackidx
].ncontinuations
;
4338 free(bufferstack
[bufferstackidx
].include_filename
);
4342 printf("pop_buffer(%d): %p %p (%d, %d, %d) %p %d\n",
4344 bufferstack
[bufferstackidx
].bufferstate
,
4345 bufferstack
[bufferstackidx
].define
,
4346 bufferstack
[bufferstackidx
].line_number
,
4347 bufferstack
[bufferstackidx
].char_number
,
4348 bufferstack
[bufferstackidx
].if_depth
,
4349 bufferstack
[bufferstackidx
].filename
,
4350 bufferstack
[bufferstackidx
].should_pop
);
4352 pp_status
.file
= bufferstack
[bufferstackidx
].filehandle
;
4353 ppy__switch_to_buffer(bufferstack
[bufferstackidx
].bufferstate
);
4355 if(bufferstack
[bufferstackidx
].should_pop
)
4357 if(yy_current_state() == pp_macexp
)
4358 macro_add_expansion();
4360 pp_internal_error(__FILE__
, __LINE__
, "Pop buffer and state without macro expansion state");
4364 return &bufferstack
[bufferstackidx
];
4369 *-------------------------------------------------------------------------
4370 * Macro nestng support
4371 *-------------------------------------------------------------------------
4373 static void push_macro(pp_entry_t
*ppp
)
4375 if(macexpstackidx
>= MAXMACEXPSTACK
)
4377 ppy_error("Too many nested macros");
4381 macexpstack
[macexpstackidx
] = pp_xmalloc(sizeof(macexpstack
[0][0]));
4382 if(!macexpstack
[macexpstackidx
])
4384 memset( macexpstack
[macexpstackidx
], 0, sizeof(macexpstack
[0][0]));
4385 macexpstack
[macexpstackidx
]->ppp
= ppp
;
4389 static macexpstackentry_t
*top_macro(void)
4391 return macexpstackidx
> 0 ? macexpstack
[macexpstackidx
-1] : NULL
;
4394 static macexpstackentry_t
*pop_macro(void)
4396 if(macexpstackidx
<= 0)
4397 pp_internal_error(__FILE__
, __LINE__
, "Macro expansion stack underflow\n");
4398 return macexpstack
[--macexpstackidx
];
4401 static void free_macro(macexpstackentry_t
*mep
)
4405 for(i
= 0; i
< mep
->nargs
; i
++)
4413 static void add_text_to_macro(const char *text
, int len
)
4415 macexpstackentry_t
*mep
= top_macro();
4417 assert(mep
->ppp
->expanding
== 0);
4419 if(mep
->curargalloc
- mep
->curargsize
<= len
+1) /* +1 for '\0' */
4422 int new_alloc
= mep
->curargalloc
+ ((ALLOCBLOCKSIZE
> len
+1) ? ALLOCBLOCKSIZE
: len
+1);
4423 new_curarg
= pp_xrealloc(mep
->curarg
, new_alloc
* sizeof(mep
->curarg
[0]));
4426 mep
->curarg
= new_curarg
;
4427 mep
->curargalloc
= new_alloc
;
4429 memcpy(mep
->curarg
+ mep
->curargsize
, text
, len
);
4430 mep
->curargsize
+= len
;
4431 mep
->curarg
[mep
->curargsize
] = '\0';
4434 static void macro_add_arg(int last
)
4438 char **new_args
, **new_ppargs
;
4440 macexpstackentry_t
*mep
= top_macro();
4442 assert(mep
->ppp
->expanding
== 0);
4444 new_args
= pp_xrealloc(mep
->args
, (mep
->nargs
+1) * sizeof(mep
->args
[0]));
4447 mep
->args
= new_args
;
4449 new_ppargs
= pp_xrealloc(mep
->ppargs
, (mep
->nargs
+1) * sizeof(mep
->ppargs
[0]));
4452 mep
->ppargs
= new_ppargs
;
4454 new_nnls
= pp_xrealloc(mep
->nnls
, (mep
->nargs
+1) * sizeof(mep
->nnls
[0]));
4457 mep
->nnls
= new_nnls
;
4459 mep
->args
[mep
->nargs
] = pp_xstrdup(mep
->curarg
? mep
->curarg
: "");
4460 if(!mep
->args
[mep
->nargs
])
4462 cptr
= mep
->args
[mep
->nargs
]-1;
4463 while((cptr
= strchr(cptr
+1, '\n')))
4467 mep
->nnls
[mep
->nargs
] = nnl
;
4470 mep
->curargalloc
= mep
->curargsize
= 0;
4474 fprintf(stderr
, "macro_add_arg: %s:%d: %d -> '%s'\n",
4476 pp_status
.line_number
,
4478 mep
->args
[mep
->nargs
-1]);
4480 /* Each macro argument must be expanded to cope with stingize */
4481 if(last
|| mep
->args
[mep
->nargs
-1][0])
4483 yy_push_state(pp_macexp
);
4484 push_buffer(NULL
, NULL
, NULL
, last
? 2 : 1);
4485 ppy__scan_string(mep
->args
[mep
->nargs
-1]);
4486 /*mep->bufferstackidx = bufferstackidx; But not nested! */
4490 static void macro_add_expansion(void)
4492 macexpstackentry_t
*mep
= top_macro();
4494 assert(mep
->ppp
->expanding
== 0);
4496 mep
->ppargs
[mep
->nargs
-1] = pp_xstrdup(mep
->curarg
? mep
->curarg
: "");
4498 mep
->curargalloc
= mep
->curargsize
= 0;
4502 fprintf(stderr
, "macro_add_expansion: %s:%d: %d -> '%s'\n",
4504 pp_status
.line_number
,
4506 mep
->ppargs
[mep
->nargs
-1] ? mep
->ppargs
[mep
->nargs
-1] : "");
4511 *-------------------------------------------------------------------------
4513 *-------------------------------------------------------------------------
4515 static void put_buffer(const char *s
, int len
)
4518 add_text_to_macro(s
, len
);
4520 wpp_callbacks
->write(s
, len
);
4525 *-------------------------------------------------------------------------
4526 * Include management
4527 *-------------------------------------------------------------------------
4529 void pp_do_include(char *fname
, int type
)
4533 includelogicentry_t
*iep
;
4539 for(iep
= pp_includelogiclist
; iep
; iep
= iep
->next
)
4541 if(!strcmp(iep
->filename
, fname
))
4544 * We are done. The file was included before.
4545 * If the define was deleted, then this entry would have
4557 ppy_error("Empty include filename");
4562 /* Undo the effect of the quotation */
4565 if((fp
= pp_open_include(fname
+1, type
, pp_status
.input
, &newpath
)) == NULL
)
4567 ppy_error("Unable to open include file %s", fname
+1);
4572 fname
[n
-1] = *fname
; /* Redo the quotes */
4573 push_buffer(NULL
, newpath
, fname
, 0);
4574 pp_incl_state
.seen_junk
= 0;
4575 pp_incl_state
.state
= 0;
4576 pp_incl_state
.ppp
= NULL
;
4579 fprintf(stderr
, "pp_do_include: %s:%d: include_state=%d, include_ppp='%s', include_ifdepth=%d\n",
4580 pp_status
.input
, pp_status
.line_number
, pp_incl_state
.state
, pp_incl_state
.ppp
, pp_incl_state
.ifdepth
);
4581 pp_status
.file
= fp
;
4582 ppy__switch_to_buffer(ppy__create_buffer(NULL
, YY_BUF_SIZE
));
4584 pp_writestring("# 1 \"%s\" 1%s\n", newpath
, type
? "" : " 3");
4588 *-------------------------------------------------------------------------
4589 * Push/pop preprocessor ignore state when processing conditionals
4591 *-------------------------------------------------------------------------
4593 void pp_push_ignore_state(void)
4595 yy_push_state(pp_ignore
);
4598 void pp_pop_ignore_state(void)