1 #define yy_create_buffer pp_create_buffer
2 #define yy_delete_buffer pp_delete_buffer
3 #define yy_scan_buffer pp_scan_buffer
4 #define yy_scan_string pp_scan_string
5 #define yy_scan_bytes pp_scan_bytes
6 #define yy_flex_debug pp_flex_debug
7 #define yy_init_buffer pp_init_buffer
8 #define yy_flush_buffer pp_flush_buffer
9 #define yy_load_buffer_state pp_load_buffer_state
10 #define yy_switch_to_buffer pp_switch_to_buffer
15 #define yyrestart pprestart
19 #line 20 "tools/wpp/lex.yy.c"
20 /* A lexical scanner generated by flex */
22 /* Scanner skeleton version:
23 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
27 #define YY_FLEX_MAJOR_VERSION 2
28 #define YY_FLEX_MINOR_VERSION 5
34 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
46 /* Use prototypes in function declarations. */
49 /* The "const" storage-class-modifier is valid. */
52 #else /* ! __cplusplus */
60 #endif /* ! __cplusplus */
79 #define YY_PROTO(proto) proto
81 #define YY_PROTO(proto) ()
84 /* Returned upon end-of-file. */
87 /* Promotes a possibly negative, possibly signed char to an unsigned
88 * integer for use as an array index. If the signed char is negative,
89 * we want to instead treat it as an 8-bit unsigned char, hence the
92 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
94 /* Enter a start condition. This macro really ought to take a parameter,
95 * but we do it the disgusting crufty way forced on us by the ()-less
96 * definition of BEGIN.
98 #define BEGIN yy_start = 1 + 2 *
100 /* Translate the current start state into a value that can be later handed
101 * to BEGIN to return to the state. The YYSTATE alias is for lex
104 #define YY_START ((yy_start - 1) / 2)
105 #define YYSTATE YY_START
107 /* Action number for EOF rule of a given start state. */
108 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
110 /* Special action meaning "start processing a new file". */
111 #define YY_NEW_FILE yyrestart( yyin )
113 #define YY_END_OF_BUFFER_CHAR 0
115 /* Size of default input buffer. */
116 #define YY_BUF_SIZE 16384
118 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
121 extern FILE *yyin
, *yyout
;
123 #define EOB_ACT_CONTINUE_SCAN 0
124 #define EOB_ACT_END_OF_FILE 1
125 #define EOB_ACT_LAST_MATCH 2
127 /* The funky do-while in the following #define is used to turn the definition
128 * int a single C statement (which needs a semi-colon terminator). This
129 * avoids problems with code like:
131 * if ( condition_holds )
134 * do_something_else();
136 * Prior to using the do-while the compiler would get upset at the
137 * "else" because it interpreted the "if" statement as being all
138 * done when it reached the ';' after the yyless() call.
141 /* Return all but the first 'n' matched characters back to the input stream. */
146 /* Undo effects of setting up yytext. */ \
147 *yy_cp = yy_hold_char; \
148 YY_RESTORE_YY_MORE_OFFSET \
149 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
150 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
154 #define unput(c) yyunput( c, yytext_ptr )
156 /* The following is because we cannot portably get our hands on size_t
157 * (without autoconf's help, which isn't available because we want
158 * flex-generated scanners to compile on their own).
160 typedef unsigned int yy_size_t
;
163 struct yy_buffer_state
167 char *yy_ch_buf
; /* input buffer */
168 char *yy_buf_pos
; /* current position in input buffer */
170 /* Size of input buffer in bytes, not including room for EOB
173 yy_size_t yy_buf_size
;
175 /* Number of characters read into yy_ch_buf, not including EOB
180 /* Whether we "own" the buffer - i.e., we know we created it,
181 * and can realloc() it to grow it, and should free() it to
184 int yy_is_our_buffer
;
186 /* Whether this is an "interactive" input source; if so, and
187 * if we're using stdio for input, then we want to use getc()
188 * instead of fread(), to make sure we stop fetching input after
191 int yy_is_interactive
;
193 /* Whether we're considered to be at the beginning of a line.
194 * If so, '^' rules will be active on the next match, otherwise
199 /* Whether to try to fill the input buffer when we reach the
204 int yy_buffer_status
;
205 #define YY_BUFFER_NEW 0
206 #define YY_BUFFER_NORMAL 1
207 /* When an EOF's been seen but there's still some text to process
208 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
209 * shouldn't try reading from the input source any more. We might
210 * still have a bunch of tokens to match, though, because of
211 * possible backing-up.
213 * When we actually see the EOF, we change the status to "new"
214 * (via yyrestart()), so that the user can continue scanning by
215 * just pointing yyin at a new input file.
217 #define YY_BUFFER_EOF_PENDING 2
220 static YY_BUFFER_STATE yy_current_buffer
= 0;
222 /* We provide macros for accessing buffer states in case in the
223 * future we want to put the buffer states in a more general
226 #define YY_CURRENT_BUFFER yy_current_buffer
229 /* yy_hold_char holds the character lost when yytext is formed. */
230 static char yy_hold_char
;
232 static int yy_n_chars
; /* number of characters read into yy_ch_buf */
237 /* Points to current character in buffer. */
238 static char *yy_c_buf_p
= (char *) 0;
239 static int yy_init
= 1; /* whether we need to initialize */
240 static int yy_start
= 0; /* start state number */
242 /* Flag which is used to allow yywrap()'s to do buffer switches
243 * instead of setting up a fresh yyin. A bit of a hack ...
245 static int yy_did_buffer_switch_on_eof
;
247 void yyrestart
YY_PROTO(( FILE *input_file
));
249 void yy_switch_to_buffer
YY_PROTO(( YY_BUFFER_STATE new_buffer
));
250 void yy_load_buffer_state
YY_PROTO(( void ));
251 YY_BUFFER_STATE yy_create_buffer
YY_PROTO(( FILE *file
, int size
));
252 void yy_delete_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
253 void yy_init_buffer
YY_PROTO(( YY_BUFFER_STATE b
, FILE *file
));
254 void yy_flush_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
255 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
257 YY_BUFFER_STATE yy_scan_buffer
YY_PROTO(( char *base
, yy_size_t size
));
258 YY_BUFFER_STATE yy_scan_string
YY_PROTO(( yyconst
char *yy_str
));
259 YY_BUFFER_STATE yy_scan_bytes
YY_PROTO(( yyconst
char *bytes
, int len
));
261 static void *yy_flex_alloc
YY_PROTO(( yy_size_t
));
262 static void *yy_flex_realloc
YY_PROTO(( void *, yy_size_t
));
263 static void yy_flex_free
YY_PROTO(( void * ));
265 #define yy_new_buffer yy_create_buffer
267 #define yy_set_interactive(is_interactive) \
269 if ( ! yy_current_buffer ) \
270 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
271 yy_current_buffer->yy_is_interactive = is_interactive; \
274 #define yy_set_bol(at_bol) \
276 if ( ! yy_current_buffer ) \
277 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
278 yy_current_buffer->yy_at_bol = at_bol; \
281 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
283 typedef unsigned char YY_CHAR
;
284 FILE *yyin
= (FILE *) 0, *yyout
= (FILE *) 0;
285 typedef int yy_state_type
;
287 #define yytext_ptr yytext
289 static yy_state_type yy_get_previous_state
YY_PROTO(( void ));
290 static yy_state_type yy_try_NUL_trans
YY_PROTO(( yy_state_type current_state
));
291 static int yy_get_next_buffer
YY_PROTO(( void ));
292 static void yy_fatal_error
YY_PROTO(( yyconst
char msg
[] ));
294 /* Done after the current pattern has been matched and before the
295 * corresponding action - sets up yytext.
297 #define YY_DO_BEFORE_ACTION \
298 yytext_ptr = yy_bp; \
299 yyleng = (int) (yy_cp - yy_bp); \
300 yy_hold_char = *yy_cp; \
304 #define YY_NUM_RULES 144
305 #define YY_END_OF_BUFFER 145
306 static yyconst
short int yy_accept
[421] =
308 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
309 0, 0, 0, 0, 118, 118, 0, 0, 0, 0,
310 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
311 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
312 0, 0, 0, 0, 145, 134, 135, 136, 122, 143,
313 123, 134, 133, 134, 135, 1, 22, 17, 19, 17,
314 22, 21, 18, 18, 18, 18, 18, 18, 18, 18,
315 69, 72, 70, 71, 29, 26, 27, 25, 29, 24,
316 29, 29, 124, 132, 125, 143, 126, 127, 143, 128,
317 129, 118, 119, 118, 78, 76, 78, 78, 75, 78,
319 79, 83, 85, 84, 143, 80, 91, 87, 91, 86,
320 89, 91, 91, 88, 91, 93, 101, 103, 96, 102,
321 98, 97, 94, 98, 93, 107, 107, 105, 104, 107,
322 115, 114, 111, 112, 108, 109, 110, 115, 115, 134,
323 135, 139, 122, 139, 123, 134, 133, 134, 54, 51,
324 48, 54, 53, 54, 52, 54, 34, 36, 54, 54,
325 54, 54, 50, 54, 54, 59, 56, 57, 59, 55,
326 59, 63, 60, 61, 63, 63, 23, 68, 65, 68,
327 66, 68, 64, 68, 30, 31, 33, 33, 33, 30,
328 1, 141, 144, 142, 140, 140, 134, 135, 134, 117,
330 121, 133, 137, 138, 135, 1, 17, 18, 18, 18,
331 18, 18, 18, 18, 18, 19, 20, 21, 18, 18,
332 18, 18, 18, 12, 18, 18, 18, 18, 18, 69,
333 70, 71, 73, 71, 26, 28, 29, 124, 131, 130,
334 131, 126, 128, 118, 118, 118, 120, 76, 74, 75,
335 77, 78, 79, 80, 82, 80, 87, 86, 91, 88,
336 92, 91, 93, 95, 98, 97, 94, 100, 98, 93,
337 107, 105, 104, 107, 106, 107, 115, 115, 113, 116,
338 115, 134, 139, 139, 51, 45, 42, 34, 35, 34,
339 34, 38, 36, 36, 36, 40, 46, 44, 47, 41,
341 49, 50, 133, 43, 56, 55, 58, 59, 60, 62,
342 0, 23, 65, 64, 68, 67, 68, 30, 32, 33,
343 30, 141, 140, 121, 121, 18, 18, 18, 18, 18,
344 18, 12, 18, 18, 18, 18, 18, 18, 18, 70,
345 81, 90, 99, 35, 35, 34, 34, 34, 37, 36,
346 36, 36, 133, 121, 18, 13, 14, 18, 18, 18,
347 18, 18, 18, 16, 18, 18, 18, 35, 35, 35,
348 34, 37, 37, 36, 133, 18, 13, 14, 15, 5,
349 8, 10, 18, 18, 16, 18, 9, 18, 35, 37,
350 37, 37, 133, 4, 15, 5, 8, 10, 11, 18,
352 7, 9, 18, 37, 133, 4, 11, 2, 7, 6,
353 39, 2, 0, 6, 0, 0, 0, 3, 3, 0
356 static yyconst
int yy_ec
[256] =
358 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
359 2, 2, 4, 1, 1, 1, 1, 1, 1, 1,
360 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
361 1, 2, 5, 6, 7, 1, 1, 8, 9, 10,
362 11, 12, 1, 13, 1, 14, 15, 16, 17, 17,
363 17, 17, 17, 17, 17, 18, 18, 1, 1, 19,
364 20, 21, 1, 1, 22, 22, 22, 22, 22, 22,
365 23, 23, 23, 23, 23, 24, 23, 23, 23, 23,
366 23, 23, 23, 23, 25, 23, 23, 26, 23, 23,
367 1, 27, 1, 1, 28, 1, 29, 30, 31, 32,
369 33, 34, 35, 36, 37, 36, 36, 38, 39, 40,
370 41, 42, 36, 43, 44, 45, 46, 36, 47, 48,
371 36, 36, 1, 49, 1, 1, 1, 1, 1, 1,
372 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
373 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
374 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
375 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
376 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
377 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
378 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
380 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
381 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
382 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
383 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
384 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
388 static yyconst
int yy_meta
[50] =
390 1, 2, 3, 2, 1, 4, 5, 1, 6, 7,
391 8, 9, 8, 10, 11, 12, 12, 12, 1, 1,
392 13, 14, 15, 15, 15, 15, 16, 17, 14, 14,
393 14, 14, 14, 14, 15, 15, 15, 15, 15, 15,
394 15, 15, 15, 15, 15, 15, 15, 15, 1
397 static yyconst
short int yy_base
[464] =
399 0, 48, 55, 0, 102, 103, 130, 0, 177, 178,
400 179, 182, 186, 187, 104, 107, 214, 0, 261, 262,
401 289, 0, 338, 0, 386, 389, 414, 439, 466, 0,
402 515, 0, 564, 0, 399, 403, 612, 638, 665, 0,
403 428, 618, 714, 763, 1354, 0, 49, 1771, 1771, 1771,
404 1771, 96, 0, 109, 118, 1771, 1771, 811, 1771, 1350,
405 111, 111, 858, 1316, 154, 161, 1307, 1300, 1302, 1312,
406 0, 1771, 184, 124, 1771, 196, 1771, 1771, 254, 1771,
407 0, 199, 0, 1771, 1771, 269, 0, 1771, 1337, 0,
408 1771, 0, 1771, 263, 1771, 208, 1771, 267, 1123, 277,
410 0, 1771, 1771, 1771, 271, 281, 1771, 393, 1771, 396,
411 1771, 1118, 396, 0, 406, 0, 1771, 1771, 1124, 1771,
412 400, 0, 0, 418, 905, 1771, 430, 1771, 1771, 433,
413 0, 1771, 1771, 1771, 1771, 1771, 1771, 432, 435, 0,
414 449, 1771, 1771, 1771, 1771, 444, 0, 954, 1771, 456,
415 1771, 1110, 1771, 1121, 1771, 449, 988, 714, 443, 1108,
416 603, 0, 623, 1094, 1077, 1771, 615, 1771, 619, 0,
417 632, 1771, 644, 1771, 635, 634, 635, 1771, 655, 1771,
418 1771, 646, 0, 659, 0, 1771, 1771, 725, 738, 741,
419 1771, 742, 1771, 1771, 0, 735, 0, 747, 741, 1771,
421 0, 0, 1771, 1122, 755, 1771, 0, 0, 1091, 747,
422 754, 1086, 1079, 1081, 1091, 1771, 1771, 1116, 1084, 717,
423 1085, 1073, 1082, 777, 1083, 1073, 1083, 1079, 1067, 0,
424 0, 1771, 1771, 1106, 787, 1771, 1105, 0, 1771, 1771,
425 1104, 0, 0, 0, 743, 765, 1771, 791, 1771, 1093,
426 1771, 1099, 0, 1771, 794, 1098, 795, 798, 1086, 0,
427 1771, 1096, 0, 1771, 789, 0, 0, 801, 1081, 0,
428 804, 1771, 1771, 807, 1771, 1080, 0, 804, 1771, 1771,
429 1079, 806, 1771, 0, 818, 1771, 1771, 847, 843, 874,
430 799, 0, 905, 903, 800, 1771, 1771, 1771, 1771, 1771,
432 1771, 1078, 1046, 1771, 823, 0, 1771, 1076, 824, 1771,
433 1075, 816, 871, 0, 1771, 1771, 1051, 0, 1771, 1036,
434 872, 876, 0, 1036, 0, 995, 990, 988, 979, 970,
435 942, 880, 917, 915, 906, 881, 873, 870, 862, 0,
436 884, 1771, 890, 907, 845, 618, 863, 873, 910, 911,
437 914, 922, 840, 1085, 830, 935, 938, 832, 796, 791,
438 801, 797, 783, 974, 753, 702, 691, 938, 942, 945,
439 1771, 961, 953, 1771, 620, 616, 977, 985, 986, 990,
440 991, 994, 598, 433, 998, 417, 1006, 388, 1771, 972,
441 977, 985, 386, 1015, 1018, 1023, 1026, 1027, 1031, 371,
443 1048, 1049, 359, 1771, 255, 1056, 1057, 1060, 1061, 1064,
444 0, 1065, 234, 1068, 153, 61, 9, 1069, 1072, 1771,
445 1134, 1151, 1168, 1185, 1202, 1219, 1236, 1253, 1270, 1287,
446 1304, 1321, 1338, 1351, 1353, 1370, 1387, 1404, 1421, 1438,
447 1455, 1472, 1489, 1500, 1517, 1534, 1540, 1557, 1574, 1591,
448 1597, 1614, 1631, 1648, 1654, 1660, 1677, 1694, 1702, 1719,
452 static yyconst
short int yy_def
[464] =
454 420, 1, 420, 3, 421, 421, 420, 7, 422, 422,
455 423, 423, 424, 424, 425, 425, 420, 17, 426, 426,
456 420, 21, 420, 23, 427, 427, 428, 428, 420, 29,
457 420, 31, 420, 33, 429, 429, 430, 430, 420, 39,
458 431, 431, 432, 432, 420, 433, 420, 420, 420, 420,
459 420, 434, 435, 434, 420, 420, 420, 420, 420, 58,
460 420, 420, 58, 63, 63, 63, 63, 63, 63, 63,
461 436, 420, 437, 420, 420, 420, 420, 420, 420, 420,
462 435, 420, 438, 420, 420, 439, 440, 420, 439, 441,
463 420, 442, 420, 443, 420, 420, 420, 420, 444, 420,
465 445, 420, 420, 420, 446, 420, 420, 420, 420, 420,
466 420, 420, 420, 447, 420, 448, 420, 420, 420, 420,
467 449, 450, 451, 420, 451, 420, 420, 420, 420, 420,
468 452, 420, 420, 420, 420, 420, 420, 453, 420, 433,
469 420, 420, 420, 420, 420, 434, 435, 454, 420, 420,
470 420, 420, 420, 420, 420, 420, 420, 420, 420, 420,
471 420, 435, 420, 435, 420, 420, 420, 420, 420, 455,
472 420, 420, 420, 420, 420, 420, 420, 420, 420, 420,
473 420, 420, 456, 457, 458, 420, 420, 420, 420, 458,
474 420, 420, 420, 420, 459, 459, 433, 420, 434, 420,
476 460, 435, 420, 420, 420, 420, 58, 63, 63, 63,
477 63, 63, 63, 63, 63, 420, 420, 420, 63, 63,
478 63, 63, 63, 63, 63, 63, 63, 63, 63, 436,
479 461, 420, 420, 420, 420, 420, 420, 438, 420, 420,
480 420, 440, 441, 442, 443, 443, 420, 420, 420, 444,
481 420, 420, 445, 420, 420, 420, 420, 420, 420, 447,
482 420, 420, 448, 420, 449, 450, 451, 420, 420, 125,
483 420, 420, 420, 420, 420, 420, 452, 453, 420, 420,
484 420, 434, 420, 454, 420, 420, 420, 420, 420, 420,
485 420, 462, 420, 420, 420, 420, 420, 420, 420, 420,
487 420, 420, 435, 420, 420, 455, 420, 420, 420, 420,
488 420, 420, 420, 456, 420, 420, 420, 458, 420, 420,
489 458, 420, 459, 463, 460, 63, 63, 63, 63, 63,
490 63, 420, 63, 63, 63, 63, 63, 63, 63, 461,
491 420, 420, 420, 420, 420, 420, 420, 420, 462, 420,
492 420, 420, 435, 463, 63, 63, 63, 63, 63, 63,
493 63, 63, 63, 63, 63, 63, 63, 420, 420, 420,
494 420, 420, 420, 420, 435, 63, 420, 420, 63, 63,
495 63, 63, 63, 63, 420, 63, 63, 63, 420, 420,
496 420, 420, 435, 63, 420, 420, 420, 420, 63, 63,
498 63, 420, 63, 420, 435, 420, 420, 63, 420, 63,
499 435, 420, 420, 420, 420, 420, 420, 420, 420, 0,
500 420, 420, 420, 420, 420, 420, 420, 420, 420, 420,
501 420, 420, 420, 420, 420, 420, 420, 420, 420, 420,
502 420, 420, 420, 420, 420, 420, 420, 420, 420, 420,
503 420, 420, 420, 420, 420, 420, 420, 420, 420, 420,
507 static yyconst
short int yy_nxt
[1821] =
509 46, 47, 48, 47, 46, 49, 50, 46, 51, 46,
510 46, 46, 46, 46, 52, 46, 46, 46, 46, 46,
511 46, 53, 53, 53, 53, 53, 54, 53, 53, 53,
512 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
513 53, 53, 53, 53, 53, 53, 53, 53, 46, 55,
514 198, 55, 198, 418, 56, 57, 58, 59, 60, 57,
515 57, 57, 57, 57, 57, 57, 57, 57, 57, 61,
516 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
517 57, 62, 57, 63, 63, 63, 64, 65, 63, 63,
518 63, 66, 67, 63, 63, 63, 68, 63, 63, 63,
520 69, 70, 63, 57, 72, 72, 93, 200, 417, 93,
521 201, 203, 204, 217, 218, 94, 73, 73, 94, 205,
522 420, 205, 200, 420, 206, 201, 233, 234, 74, 74,
523 75, 76, 77, 76, 75, 78, 75, 75, 75, 75,
524 75, 75, 75, 75, 79, 75, 75, 75, 80, 75,
525 75, 81, 81, 81, 81, 81, 82, 81, 81, 81,
526 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
527 81, 81, 81, 81, 81, 81, 81, 81, 75, 84,
528 84, 84, 85, 85, 84, 416, 232, 88, 84, 84,
529 88, 220, 223, 221, 224, 200, 222, 235, 201, 235,
531 225, 236, 237, 86, 86, 89, 91, 91, 89, 248,
532 232, 248, 89, 89, 95, 96, 97, 96, 95, 95,
533 95, 95, 95, 95, 95, 95, 95, 95, 98, 95,
534 95, 95, 95, 95, 95, 99, 99, 99, 99, 99,
535 100, 99, 99, 99, 99, 99, 99, 99, 99, 99,
536 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
537 99, 99, 95, 102, 102, 200, 103, 103, 201, 104,
538 104, 240, 241, 415, 246, 105, 105, 247, 200, 251,
539 252, 201, 200, 255, 256, 201, 411, 106, 106, 107,
540 108, 109, 108, 107, 107, 107, 107, 107, 107, 110,
542 107, 111, 112, 113, 107, 107, 107, 107, 107, 107,
543 114, 114, 114, 114, 114, 115, 114, 114, 114, 114,
544 114, 114, 114, 114, 114, 114, 114, 114, 114, 114,
545 114, 114, 114, 114, 114, 114, 114, 107, 116, 116,
546 117, 116, 116, 118, 119, 116, 120, 116, 116, 116,
547 116, 116, 121, 122, 122, 122, 116, 116, 116, 123,
548 123, 123, 123, 123, 124, 125, 123, 123, 123, 123,
549 123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
550 123, 123, 123, 123, 123, 123, 116, 127, 128, 127,
551 127, 128, 127, 410, 257, 129, 257, 258, 129, 258,
553 173, 174, 173, 408, 173, 174, 173, 200, 261, 262,
554 201, 200, 130, 175, 201, 130, 132, 175, 405, 133,
555 268, 269, 134, 135, 136, 176, 137, 403, 138, 176,
556 186, 271, 272, 271, 187, 275, 276, 280, 281, 273,
557 139, 132, 188, 279, 133, 401, 201, 134, 135, 136,
558 198, 137, 198, 138, 189, 420, 274, 285, 420, 285,
559 200, 296, 297, 201, 400, 139, 140, 141, 142, 141,
560 140, 143, 144, 140, 145, 140, 140, 140, 140, 140,
561 146, 140, 140, 140, 140, 140, 140, 147, 147, 147,
562 147, 147, 148, 147, 147, 147, 147, 147, 147, 147,
564 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
565 147, 147, 147, 147, 140, 149, 150, 151, 150, 152,
566 153, 149, 154, 155, 149, 149, 149, 149, 149, 156,
567 157, 158, 158, 159, 160, 161, 162, 162, 162, 162,
568 162, 163, 162, 162, 162, 162, 164, 162, 162, 162,
569 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
570 162, 162, 162, 165, 166, 167, 168, 167, 166, 166,
571 166, 166, 166, 166, 166, 166, 166, 166, 169, 166,
572 166, 166, 166, 166, 166, 170, 170, 170, 170, 170,
573 171, 170, 170, 170, 170, 170, 170, 170, 170, 170,
575 170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
576 170, 170, 166, 76, 77, 76, 305, 78, 305, 190,
577 186, 190, 299, 300, 191, 301, 302, 177, 177, 177,
578 200, 399, 188, 201, 307, 308, 310, 311, 82, 76,
579 77, 76, 371, 78, 189, 309, 200, 309, 394, 201,
580 312, 312, 312, 177, 177, 177, 313, 200, 313, 393,
581 201, 316, 317, 371, 82, 178, 179, 180, 179, 178,
582 178, 178, 178, 178, 181, 181, 178, 178, 178, 182,
583 178, 178, 178, 178, 178, 178, 183, 183, 183, 183,
584 183, 184, 183, 183, 183, 183, 183, 183, 183, 183,
586 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
587 183, 183, 183, 178, 50, 192, 193, 192, 50, 194,
588 50, 50, 50, 50, 50, 50, 50, 388, 196, 293,
589 293, 293, 50, 50, 50, 387, 200, 294, 295, 201,
590 319, 320, 321, 322, 321, 322, 200, 206, 198, 324,
591 198, 294, 420, 327, 420, 420, 205, 420, 205, 295,
592 328, 206, 50, 50, 192, 193, 192, 50, 194, 50,
593 50, 50, 50, 50, 50, 50, 246, 196, 332, 247,
594 332, 50, 50, 50, 220, 223, 221, 224, 235, 222,
595 235, 386, 248, 225, 248, 341, 257, 341, 257, 258,
597 420, 258, 343, 420, 343, 271, 272, 271, 333, 275,
598 276, 50, 207, 273, 207, 420, 334, 420, 420, 285,
599 420, 285, 348, 352, 305, 309, 305, 309, 384, 383,
600 274, 312, 312, 312, 382, 381, 348, 352, 380, 208,
601 208, 208, 209, 210, 208, 208, 208, 211, 212, 208,
602 208, 208, 213, 208, 208, 208, 214, 215, 208, 420,
603 289, 420, 288, 288, 289, 379, 344, 345, 370, 376,
604 290, 291, 313, 321, 313, 321, 375, 322, 206, 322,
605 344, 332, 370, 332, 290, 341, 371, 341, 345, 208,
606 208, 343, 291, 343, 208, 208, 371, 346, 347, 208,
608 371, 367, 366, 208, 208, 263, 263, 365, 263, 263,
609 371, 346, 263, 364, 263, 263, 263, 263, 263, 347,
610 293, 293, 293, 263, 263, 263, 350, 351, 294, 295,
611 368, 369, 270, 372, 373, 374, 377, 374, 377, 378,
612 350, 378, 294, 363, 368, 374, 362, 372, 351, 361,
613 295, 374, 369, 263, 282, 373, 374, 284, 282, 374,
614 282, 282, 389, 282, 282, 389, 282, 282, 389, 282,
615 282, 282, 282, 282, 282, 385, 392, 385, 377, 389,
616 377, 360, 389, 389, 390, 391, 378, 395, 378, 395,
617 392, 396, 397, 396, 397, 398, 404, 398, 390, 385,
619 404, 385, 282, 288, 288, 289, 391, 402, 404, 402,
620 359, 290, 291, 292, 404, 358, 406, 404, 406, 395,
621 357, 395, 404, 356, 396, 290, 396, 397, 398, 397,
622 398, 355, 407, 291, 407, 292, 325, 325, 319, 325,
623 325, 325, 325, 325, 325, 325, 325, 325, 325, 409,
624 402, 409, 402, 316, 325, 325, 325, 406, 407, 406,
625 407, 412, 409, 412, 409, 414, 412, 414, 412, 414,
626 419, 414, 419, 419, 349, 419, 349, 310, 307, 353,
627 301, 280, 275, 268, 325, 325, 325, 413, 325, 325,
628 325, 325, 325, 325, 325, 325, 325, 325, 261, 342,
630 255, 251, 249, 325, 325, 325, 240, 236, 233, 339,
631 338, 337, 336, 335, 331, 330, 329, 326, 217, 229,
632 228, 227, 226, 219, 203, 304, 303, 298, 287, 286,
633 264, 259, 249, 325, 71, 71, 71, 71, 71, 71,
634 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
635 71, 83, 83, 83, 83, 83, 83, 83, 83, 83,
636 83, 83, 83, 83, 83, 83, 83, 83, 87, 87,
637 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
638 87, 87, 87, 87, 87, 90, 90, 90, 90, 90,
639 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
641 90, 90, 92, 92, 92, 92, 92, 92, 92, 92,
642 92, 92, 92, 92, 92, 92, 92, 92, 92, 101,
643 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
644 101, 101, 101, 101, 101, 101, 126, 126, 126, 126,
645 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
646 126, 126, 126, 131, 131, 131, 131, 131, 131, 131,
647 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
648 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
649 172, 172, 172, 172, 172, 172, 172, 75, 75, 75,
650 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
652 75, 75, 75, 75, 185, 185, 185, 185, 185, 185,
653 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
654 185, 195, 195, 195, 195, 195, 195, 195, 195, 195,
655 195, 195, 195, 195, 195, 195, 195, 195, 197, 420,
656 229, 228, 227, 226, 197, 197, 197, 197, 219, 197,
657 197, 199, 216, 420, 420, 199, 420, 199, 199, 199,
658 199, 199, 199, 199, 202, 420, 202, 202, 420, 202,
659 230, 230, 420, 230, 230, 230, 230, 230, 230, 230,
660 420, 230, 230, 230, 230, 420, 230, 231, 231, 231,
661 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
663 231, 231, 231, 231, 238, 238, 420, 420, 238, 238,
664 238, 238, 238, 238, 238, 238, 238, 238, 238, 420,
665 238, 239, 239, 239, 239, 239, 239, 239, 239, 239,
666 239, 239, 239, 239, 239, 239, 239, 239, 242, 242,
667 420, 242, 242, 420, 242, 242, 242, 242, 242, 242,
668 242, 242, 242, 420, 242, 243, 243, 420, 243, 243,
669 243, 243, 243, 243, 243, 243, 243, 420, 243, 243,
670 420, 243, 244, 244, 420, 244, 244, 244, 244, 244,
671 420, 244, 244, 244, 244, 244, 244, 244, 244, 245,
672 245, 420, 245, 245, 245, 245, 245, 245, 245, 245,
674 245, 245, 245, 245, 245, 245, 250, 420, 420, 420,
675 420, 250, 420, 250, 250, 420, 250, 253, 253, 420,
676 420, 253, 420, 253, 253, 253, 253, 420, 253, 253,
677 253, 253, 420, 253, 254, 254, 254, 254, 254, 254,
678 254, 254, 254, 254, 254, 254, 254, 254, 254, 254,
679 254, 260, 420, 260, 260, 420, 260, 263, 263, 420,
680 420, 420, 420, 263, 263, 263, 263, 420, 420, 263,
681 420, 420, 420, 263, 265, 265, 420, 420, 420, 420,
682 265, 265, 265, 265, 265, 265, 265, 265, 265, 420,
683 265, 266, 266, 420, 420, 420, 420, 266, 266, 266,
685 266, 420, 266, 266, 266, 266, 420, 266, 267, 420,
686 267, 267, 420, 267, 277, 277, 420, 420, 277, 420,
687 420, 420, 277, 277, 420, 277, 277, 277, 277, 420,
688 277, 278, 278, 420, 420, 278, 420, 420, 420, 278,
689 278, 278, 278, 278, 278, 278, 420, 278, 283, 283,
690 283, 283, 283, 283, 283, 283, 283, 283, 283, 283,
691 283, 283, 283, 283, 283, 306, 420, 306, 306, 420,
692 306, 314, 420, 314, 314, 420, 314, 315, 315, 315,
693 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
694 315, 315, 315, 315, 318, 318, 420, 318, 420, 318,
696 318, 318, 318, 318, 420, 318, 318, 318, 318, 420,
697 318, 323, 323, 323, 420, 323, 323, 323, 323, 325,
698 325, 420, 325, 325, 325, 325, 325, 325, 325, 325,
699 325, 325, 325, 325, 325, 325, 340, 340, 420, 340,
700 340, 340, 340, 340, 420, 340, 420, 340, 340, 340,
701 340, 420, 340, 354, 354, 420, 354, 354, 354, 354,
702 354, 354, 354, 354, 354, 354, 354, 354, 354, 354,
703 45, 420, 420, 420, 420, 420, 420, 420, 420, 420,
704 420, 420, 420, 420, 420, 420, 420, 420, 420, 420,
705 420, 420, 420, 420, 420, 420, 420, 420, 420, 420,
707 420, 420, 420, 420, 420, 420, 420, 420, 420, 420,
708 420, 420, 420, 420, 420, 420, 420, 420, 420, 420
711 static yyconst
short int yy_chk
[1821] =
713 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
714 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
715 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
716 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
717 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
718 47, 2, 47, 417, 2, 3, 3, 3, 3, 3,
719 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
720 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
721 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
722 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
724 3, 3, 3, 3, 5, 6, 15, 52, 416, 16,
725 52, 54, 54, 62, 62, 15, 5, 6, 16, 55,
726 54, 55, 61, 54, 55, 61, 74, 74, 5, 6,
727 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
728 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
729 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
730 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
731 7, 7, 7, 7, 7, 7, 7, 7, 7, 9,
732 10, 11, 9, 10, 12, 415, 73, 11, 13, 14,
733 12, 65, 66, 65, 66, 73, 65, 76, 73, 76,
735 66, 82, 82, 9, 10, 11, 13, 14, 12, 96,
736 73, 96, 13, 14, 17, 17, 17, 17, 17, 17,
737 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
738 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
739 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
740 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
741 17, 17, 17, 19, 20, 79, 19, 20, 79, 19,
742 20, 86, 86, 413, 94, 19, 20, 94, 98, 100,
743 100, 98, 105, 106, 106, 105, 405, 19, 20, 21,
744 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
746 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
747 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
748 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
749 21, 21, 21, 21, 21, 21, 21, 21, 23, 23,
750 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
751 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
752 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
753 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
754 23, 23, 23, 23, 23, 23, 23, 25, 25, 25,
755 26, 26, 26, 403, 108, 25, 108, 110, 26, 110,
757 35, 35, 35, 400, 36, 36, 36, 113, 115, 115,
758 113, 121, 25, 35, 121, 26, 27, 36, 393, 27,
759 124, 124, 27, 27, 27, 35, 27, 388, 27, 36,
760 41, 127, 127, 127, 41, 130, 130, 139, 139, 127,
761 27, 28, 41, 138, 28, 386, 138, 28, 28, 28,
762 141, 28, 141, 28, 41, 146, 127, 150, 146, 150,
763 156, 159, 159, 156, 384, 28, 29, 29, 29, 29,
764 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
765 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
766 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
768 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
769 29, 29, 29, 29, 29, 31, 31, 31, 31, 31,
770 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
771 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
772 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
773 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
774 31, 31, 31, 31, 33, 33, 33, 33, 33, 33,
775 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
776 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
777 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
779 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
780 33, 33, 33, 37, 37, 37, 167, 37, 167, 42,
781 42, 42, 161, 161, 42, 163, 163, 37, 37, 37,
782 169, 383, 42, 169, 171, 171, 176, 176, 37, 38,
783 38, 38, 346, 38, 42, 173, 175, 173, 376, 175,
784 177, 177, 177, 38, 38, 38, 179, 182, 179, 375,
785 182, 184, 184, 346, 38, 39, 39, 39, 39, 39,
786 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
787 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
788 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
790 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
791 39, 39, 39, 39, 43, 43, 43, 43, 43, 43,
792 43, 43, 43, 43, 43, 43, 43, 367, 43, 158,
793 158, 158, 43, 43, 43, 366, 188, 158, 158, 188,
794 189, 189, 190, 192, 190, 192, 196, 190, 198, 196,
795 198, 158, 199, 220, 245, 199, 205, 245, 205, 158,
796 220, 205, 43, 44, 44, 44, 44, 44, 44, 44,
797 44, 44, 44, 44, 44, 44, 246, 44, 224, 246,
798 224, 44, 44, 44, 210, 211, 210, 211, 235, 210,
799 235, 365, 248, 211, 248, 255, 257, 255, 257, 258,
801 265, 258, 268, 265, 268, 271, 271, 271, 224, 274,
802 274, 44, 58, 271, 58, 278, 224, 282, 278, 285,
803 282, 285, 291, 295, 305, 309, 305, 309, 363, 362,
804 271, 312, 312, 312, 361, 360, 291, 295, 359, 58,
805 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
806 58, 58, 58, 58, 58, 58, 58, 58, 58, 63,
807 289, 63, 288, 288, 288, 358, 289, 289, 345, 355,
808 288, 288, 313, 321, 313, 321, 353, 322, 321, 322,
809 289, 332, 345, 332, 288, 341, 347, 341, 289, 63,
810 63, 343, 288, 343, 63, 63, 348, 290, 290, 63,
812 347, 339, 338, 63, 63, 125, 125, 337, 125, 125,
813 348, 290, 125, 336, 125, 125, 125, 125, 125, 290,
814 293, 293, 293, 125, 125, 125, 294, 294, 293, 293,
815 344, 344, 125, 349, 349, 350, 356, 351, 356, 357,
816 294, 357, 293, 335, 344, 352, 334, 349, 294, 333,
817 293, 351, 344, 125, 148, 349, 350, 148, 148, 352,
818 148, 148, 368, 148, 148, 369, 148, 148, 370, 148,
819 148, 148, 148, 148, 148, 364, 373, 364, 377, 369,
820 377, 331, 370, 368, 372, 372, 378, 379, 378, 379,
821 373, 380, 381, 380, 381, 382, 390, 382, 372, 385,
823 391, 385, 148, 157, 157, 157, 372, 387, 392, 387,
824 330, 157, 157, 157, 391, 329, 394, 390, 394, 395,
825 328, 395, 392, 327, 396, 157, 396, 397, 398, 397,
826 398, 326, 399, 157, 399, 157, 324, 324, 320, 324,
827 324, 324, 324, 324, 324, 324, 324, 324, 324, 401,
828 402, 401, 402, 317, 324, 324, 324, 406, 407, 406,
829 407, 408, 409, 408, 409, 410, 412, 410, 412, 414,
830 418, 414, 418, 419, 462, 419, 462, 311, 308, 303,
831 302, 281, 276, 269, 324, 354, 354, 408, 354, 354,
832 354, 354, 354, 354, 354, 354, 354, 354, 262, 259,
834 256, 252, 250, 354, 354, 354, 241, 237, 234, 229,
835 228, 227, 226, 225, 223, 222, 221, 219, 218, 215,
836 214, 213, 212, 209, 204, 165, 164, 160, 154, 152,
837 119, 112, 99, 354, 421, 421, 421, 421, 421, 421,
838 421, 421, 421, 421, 421, 421, 421, 421, 421, 421,
839 421, 422, 422, 422, 422, 422, 422, 422, 422, 422,
840 422, 422, 422, 422, 422, 422, 422, 422, 423, 423,
841 423, 423, 423, 423, 423, 423, 423, 423, 423, 423,
842 423, 423, 423, 423, 423, 424, 424, 424, 424, 424,
843 424, 424, 424, 424, 424, 424, 424, 424, 424, 424,
845 424, 424, 425, 425, 425, 425, 425, 425, 425, 425,
846 425, 425, 425, 425, 425, 425, 425, 425, 425, 426,
847 426, 426, 426, 426, 426, 426, 426, 426, 426, 426,
848 426, 426, 426, 426, 426, 426, 427, 427, 427, 427,
849 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
850 427, 427, 427, 428, 428, 428, 428, 428, 428, 428,
851 428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
852 429, 429, 429, 429, 429, 429, 429, 429, 429, 429,
853 429, 429, 429, 429, 429, 429, 429, 430, 430, 430,
854 430, 430, 430, 430, 430, 430, 430, 430, 430, 430,
856 430, 430, 430, 430, 431, 431, 431, 431, 431, 431,
857 431, 431, 431, 431, 431, 431, 431, 431, 431, 431,
858 431, 432, 432, 432, 432, 432, 432, 432, 432, 432,
859 432, 432, 432, 432, 432, 432, 432, 432, 433, 89,
860 70, 69, 68, 67, 433, 433, 433, 433, 64, 433,
861 433, 434, 60, 45, 0, 434, 0, 434, 434, 434,
862 434, 434, 434, 434, 435, 0, 435, 435, 0, 435,
863 436, 436, 0, 436, 436, 436, 436, 436, 436, 436,
864 0, 436, 436, 436, 436, 0, 436, 437, 437, 437,
865 437, 437, 437, 437, 437, 437, 437, 437, 437, 437,
867 437, 437, 437, 437, 438, 438, 0, 0, 438, 438,
868 438, 438, 438, 438, 438, 438, 438, 438, 438, 0,
869 438, 439, 439, 439, 439, 439, 439, 439, 439, 439,
870 439, 439, 439, 439, 439, 439, 439, 439, 440, 440,
871 0, 440, 440, 0, 440, 440, 440, 440, 440, 440,
872 440, 440, 440, 0, 440, 441, 441, 0, 441, 441,
873 441, 441, 441, 441, 441, 441, 441, 0, 441, 441,
874 0, 441, 442, 442, 0, 442, 442, 442, 442, 442,
875 0, 442, 442, 442, 442, 442, 442, 442, 442, 443,
876 443, 0, 443, 443, 443, 443, 443, 443, 443, 443,
878 443, 443, 443, 443, 443, 443, 444, 0, 0, 0,
879 0, 444, 0, 444, 444, 0, 444, 445, 445, 0,
880 0, 445, 0, 445, 445, 445, 445, 0, 445, 445,
881 445, 445, 0, 445, 446, 446, 446, 446, 446, 446,
882 446, 446, 446, 446, 446, 446, 446, 446, 446, 446,
883 446, 447, 0, 447, 447, 0, 447, 448, 448, 0,
884 0, 0, 0, 448, 448, 448, 448, 0, 0, 448,
885 0, 0, 0, 448, 449, 449, 0, 0, 0, 0,
886 449, 449, 449, 449, 449, 449, 449, 449, 449, 0,
887 449, 450, 450, 0, 0, 0, 0, 450, 450, 450,
889 450, 0, 450, 450, 450, 450, 0, 450, 451, 0,
890 451, 451, 0, 451, 452, 452, 0, 0, 452, 0,
891 0, 0, 452, 452, 0, 452, 452, 452, 452, 0,
892 452, 453, 453, 0, 0, 453, 0, 0, 0, 453,
893 453, 453, 453, 453, 453, 453, 0, 453, 454, 454,
894 454, 454, 454, 454, 454, 454, 454, 454, 454, 454,
895 454, 454, 454, 454, 454, 455, 0, 455, 455, 0,
896 455, 456, 0, 456, 456, 0, 456, 457, 457, 457,
897 457, 457, 457, 457, 457, 457, 457, 457, 457, 457,
898 457, 457, 457, 457, 458, 458, 0, 458, 0, 458,
900 458, 458, 458, 458, 0, 458, 458, 458, 458, 0,
901 458, 459, 459, 459, 0, 459, 459, 459, 459, 460,
902 460, 0, 460, 460, 460, 460, 460, 460, 460, 460,
903 460, 460, 460, 460, 460, 460, 461, 461, 0, 461,
904 461, 461, 461, 461, 0, 461, 0, 461, 461, 461,
905 461, 0, 461, 463, 463, 0, 463, 463, 463, 463,
906 463, 463, 463, 463, 463, 463, 463, 463, 463, 463,
907 420, 420, 420, 420, 420, 420, 420, 420, 420, 420,
908 420, 420, 420, 420, 420, 420, 420, 420, 420, 420,
909 420, 420, 420, 420, 420, 420, 420, 420, 420, 420,
911 420, 420, 420, 420, 420, 420, 420, 420, 420, 420,
912 420, 420, 420, 420, 420, 420, 420, 420, 420, 420
915 static yy_state_type yy_last_accepting_state
;
916 static char *yy_last_accepting_cpos
;
918 /* The intent behind this definition is that it'll catch
919 * any uses of REJECT which flex missed.
921 #define REJECT reject_used_but_not_detected
922 #define yymore() yymore_used_but_not_detected
923 #define YY_MORE_ADJ 0
924 #define YY_RESTORE_YY_MORE_OFFSET
926 #line 1 "tools/wpp/ppl.l"
929 * Wrc preprocessor lexical analysis
931 * Copyright 1999-2000 Bertho A. Stultiens (BS)
933 * This library is free software; you can redistribute it and/or
934 * modify it under the terms of the GNU Lesser General Public
935 * License as published by the Free Software Foundation; either
936 * version 2.1 of the License, or (at your option) any later version.
938 * This library is distributed in the hope that it will be useful,
939 * but WITHOUT ANY WARRANTY; without even the implied warranty of
940 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
941 * Lesser General Public License for more details.
943 * You should have received a copy of the GNU Lesser General Public
944 * License along with this library; if not, write to the Free Software
945 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
948 * 24-Apr-2000 BS - Started from scratch to restructure everything
949 * and reintegrate the source into the wine-tree.
950 * 04-Jan-2000 BS - Added comments about the lexicographical
951 * grammar to give some insight in the complexity.
952 * 28-Dec-1999 BS - Eliminated backing-up of the flexer by running
953 * `flex -b' on the source. This results in some
954 * weirdo extra rules, but a much faster scanner.
955 * 23-Dec-1999 BS - Started this file
957 *-------------------------------------------------------------------------
958 * The preprocessor's lexographical grammar (approximately):
960 * pp := {ws} # {ws} if {ws} {expr} {ws} \n
961 * | {ws} # {ws} ifdef {ws} {id} {ws} \n
962 * | {ws} # {ws} ifndef {ws} {id} {ws} \n
963 * | {ws} # {ws} elif {ws} {expr} {ws} \n
964 * | {ws} # {ws} else {ws} \n
965 * | {ws} # {ws} endif {ws} \n
966 * | {ws} # {ws} include {ws} < {anytext} > \n
967 * | {ws} # {ws} include {ws} " {anytext} " \n
968 * | {ws} # {ws} include_next {ws} < {anytext} > \n
969 * | {ws} # {ws} include_next {ws} " {anytext} " \n
970 * | {ws} # {ws} define {ws} {anytext} \n
971 * | {ws} # {ws} define( {arglist} ) {ws} {expansion} \n
972 * | {ws} # {ws} pragma {ws} {anytext} \n
973 * | {ws} # {ws} ident {ws} {anytext} \n
974 * | {ws} # {ws} error {ws} {anytext} \n
975 * | {ws} # {ws} warning {ws} {anytext} \n
976 * | {ws} # {ws} line {ws} " {anytext} " {number} \n
977 * | {ws} # {ws} {number} " {anytext} " {number} [ {number} [{number}] ] \n
982 * expr := {expr} [+-*%^/|&] {expr}
983 * | {expr} {logor|logand} {expr}
985 * | {expr} ? {expr} : {expr}
991 * id := [a-zA-Z_][a-zA-Z0-9_]*
993 * anytext := [^\n]* (see note)
998 * | {arglist} , {id} ...
1003 * | {anytext} ## {anytext}
1007 * Note: "anytext" is not always "[^\n]*". This is because the
1008 * trailing context must be considered as well.
1010 * The only certain assumption for the preprocessor to make is that
1011 * directives start at the beginning of the line, followed by a '#'
1012 * and end with a newline.
1013 * Any directive may be suffixed with a line-continuation. Also
1014 * classical comment / *...* / (note: no comments within comments,
1015 * therefore spaces) is considered to be a line-continuation
1016 * (according to gcc and egcs AFAIK, ANSI is a bit vague).
1017 * Comments have not been added to the above grammar for simplicity
1018 * reasons. However, it is allowed to enter comment anywhere within
1019 * the directives as long as they do not interfere with the context.
1020 * All comments are considered to be deletable whitespace (both
1021 * classical form "/ *...* /" and C++ form "//...\n").
1023 * All recursive scans, except for macro-expansion, are done by the
1024 * parser, whereas the simple state transitions of non-recursive
1025 * directives are done in the scanner. This results in the many
1026 * exclusive start-conditions of the scanner.
1028 * Macro expansions are slightly more difficult because they have to
1029 * prescan the arguments. Parameter substitution is literal if the
1030 * substitution is # or ## (either side). This enables new identifiers
1031 * to be created (see 'info cpp' node Macro|Pitfalls|Prescan for more
1034 * FIXME: Variable macro parameters is recognized, but not yet
1035 * expanded. I have to reread the ANSI standard on the subject (yes,
1038 * The following special defines are supported:
1039 * __FILE__ -> "thissource.c"
1041 * __DATE__ -> "May 1 2000"
1042 * __TIME__ -> "23:59:59"
1043 * These macros expand, as expected, into their ANSI defined values.
1045 * The same include prevention is implemented as gcc and egcs does.
1046 * This results in faster processing because we do not read the text
1047 * at all. Some wine-sources attempt to include the same file 4 or 5
1048 * times. This strategy also saves a lot blank output-lines, which in
1049 * its turn improves the real resource scanner/parser.
1053 * Special flex options and exclusive scanner start-conditions
1055 #define YY_STACK_USED 1
1056 #define YY_NEVER_INTERACTIVE 1
1057 #define YY_NO_UNPUT 1
1070 #define pp_comment 7
1080 #define pp_macign 12
1082 #define pp_macscan 13
1084 #define pp_macexp 14
1094 #define pp_defined 19
1096 #define pp_ignore 20
1100 #line 161 "tools/wpp/ppl.l"
1107 #include "wpp_private.h"
1108 #include "ppy.tab.h"
1111 * Make sure that we are running an appropriate version of flex.
1113 #if !defined(YY_FLEX_MAJOR_VERSION) || (1000 * YY_FLEX_MAJOR_VERSION + YY_FLEX_MINOR_VERSION < 2005)
1114 #error Must use flex version 2.5.1 or higher (yy_scan_* routines are required).
1117 #define YY_READ_BUF_SIZE 65536 /* So we read most of a file at once */
1119 #define yy_current_state() YY_START
1120 #define yy_pp_state(x) yy_pop_state(); yy_push_state(x)
1123 * Always update the current character position within a line
1125 #define YY_USER_ACTION pp_status.char_number+=ppleng;
1128 * Buffer management for includes and expansions
1130 #define MAXBUFFERSTACK 128 /* Nesting more than 128 includes or macro expansion textss is insane */
1132 typedef struct bufferstackentry
{
1133 YY_BUFFER_STATE bufferstate
; /* Buffer to switch back to */
1134 pp_entry_t
*define
; /* Points to expanding define or NULL if handling includes */
1135 int line_number
; /* Line that we were handling */
1136 int char_number
; /* The current position on that line */
1137 const char *filename
; /* Filename that we were handling */
1138 int if_depth
; /* How many #if:s deep to check matching #endif:s */
1139 int ncontinuations
; /* Remember the continuation state */
1140 int should_pop
; /* Set if we must pop the start-state on EOF */
1141 /* Include management */
1142 include_state_t incl
;
1143 char *include_filename
;
1145 } bufferstackentry_t
;
1147 #define ALLOCBLOCKSIZE (1 << 10) /* Allocate these chunks at a time for string-buffers */
1150 * Macro expansion nesting
1151 * We need the stack to handle expansions while scanning
1152 * a macro's arguments. The TOS must always be the macro
1153 * that receives the current expansion from the scanner.
1155 #define MAXMACEXPSTACK 128 /* Nesting more than 128 macro expansions is insane */
1157 typedef struct macexpstackentry
{
1158 pp_entry_t
*ppp
; /* This macro we are scanning */
1159 char **args
; /* With these arguments */
1160 char **ppargs
; /* Resulting in these preprocessed arguments */
1161 int *nnls
; /* Number of newlines per argument */
1162 int nargs
; /* And this many arguments scanned */
1163 int parentheses
; /* Nesting level of () */
1164 int curargsize
; /* Current scanning argument's size */
1165 int curargalloc
; /* Current scanning argument's block allocated */
1166 char *curarg
; /* Current scanning argument's content */
1167 } macexpstackentry_t
;
1169 #define MACROPARENTHESES() (top_macro()->parentheses)
1174 static void newline(int);
1175 static int make_number(int radix
, YYSTYPE
*val
, const char *str
, int len
);
1176 static void put_buffer(const char *s
, int len
);
1177 static int is_c_h_include(char *fname
, int quoted
);
1178 /* Buffer management */
1179 static void push_buffer(pp_entry_t
*ppp
, char *filename
, char *incname
, int pop
);
1180 static bufferstackentry_t
*pop_buffer(void);
1181 /* String functions */
1182 static void new_string(void);
1183 static void add_string(const char *str
, int len
);
1184 static char *get_string(void);
1185 static void put_string(void);
1186 static int string_start(void);
1187 /* Macro functions */
1188 static void push_macro(pp_entry_t
*ppp
);
1189 static macexpstackentry_t
*top_macro(void);
1190 static macexpstackentry_t
*pop_macro(void);
1191 static void free_macro(macexpstackentry_t
*mep
);
1192 static void add_text_to_macro(const char *text
, int len
);
1193 static void macro_add_arg(int last
);
1194 static void macro_add_expansion(void);
1196 static void expand_special(pp_entry_t
*ppp
);
1197 static void expand_define(pp_entry_t
*ppp
);
1198 static void expand_macro(macexpstackentry_t
*mep
);
1203 static int ncontinuations
;
1205 static int strbuf_idx
= 0;
1206 static int strbuf_alloc
= 0;
1207 static char *strbuffer
= NULL
;
1208 static int str_startline
;
1210 static macexpstackentry_t
*macexpstack
[MAXMACEXPSTACK
];
1211 static int macexpstackidx
= 0;
1213 static bufferstackentry_t bufferstack
[MAXBUFFERSTACK
];
1214 static int bufferstackidx
= 0;
1216 static int pass_data
=1;
1221 include_state_t pp_incl_state
=
1229 includelogicentry_t
*pp_includelogiclist
= NULL
;
1232 **************************************************************************
1233 * The scanner starts here
1234 **************************************************************************
1236 #line 1237 "tools/wpp/lex.yy.c"
1238 /* Macros after this point can all be overridden by user definitions in
1242 #ifndef YY_SKIP_YYWRAP
1244 extern "C" int yywrap
YY_PROTO(( void ));
1246 extern int yywrap
YY_PROTO(( void ));
1251 static void yyunput
YY_PROTO(( int c
, char *buf_ptr
));
1255 static void yy_flex_strncpy
YY_PROTO(( char *, yyconst
char *, int ));
1258 #ifdef YY_NEED_STRLEN
1259 static int yy_flex_strlen
YY_PROTO(( yyconst
char * ));
1264 static int yyinput
YY_PROTO(( void ));
1266 static int input
YY_PROTO(( void ));
1271 static int yy_start_stack_ptr
= 0;
1272 static int yy_start_stack_depth
= 0;
1273 static int *yy_start_stack
= 0;
1274 #ifndef YY_NO_PUSH_STATE
1275 static void yy_push_state
YY_PROTO(( int new_state
));
1277 #ifndef YY_NO_POP_STATE
1278 static void yy_pop_state
YY_PROTO(( void ));
1280 #ifndef YY_NO_TOP_STATE
1281 static int yy_top_state
YY_PROTO(( void ));
1285 #define YY_NO_PUSH_STATE 1
1286 #define YY_NO_POP_STATE 1
1287 #define YY_NO_TOP_STATE 1
1290 #ifdef YY_MALLOC_DECL
1298 /* Just try to get by without declaring the routines. This will fail
1299 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
1300 * or sizeof(void*) != sizeof(int).
1305 /* Amount of stuff to slurp up with each read. */
1306 #ifndef YY_READ_BUF_SIZE
1307 #define YY_READ_BUF_SIZE 8192
1310 /* Copy whatever the last rule matched to the standard output. */
1313 /* This used to be an fputs(), but since the string might contain NUL's,
1314 * we now use fwrite().
1316 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
1319 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1320 * is returned in "result".
1323 #define YY_INPUT(buf,result,max_size) \
1324 if ( yy_current_buffer->yy_is_interactive ) \
1327 for ( n = 0; n < max_size && \
1328 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1329 buf[n] = (char) c; \
1331 buf[n++] = (char) c; \
1332 if ( c == EOF && ferror( yyin ) ) \
1333 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1336 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
1337 && ferror( yyin ) ) \
1338 YY_FATAL_ERROR( "input in flex scanner failed" );
1341 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1342 * we don't want an extra ';' after the "return" because that will cause
1343 * some compilers to complain about unreachable statements.
1346 #define yyterminate() return YY_NULL
1349 /* Number of entries by which start-condition stack grows. */
1350 #ifndef YY_START_STACK_INCR
1351 #define YY_START_STACK_INCR 25
1354 /* Report a fatal error. */
1355 #ifndef YY_FATAL_ERROR
1356 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1359 /* Default declaration of generated scanner - a define so the user can
1360 * easily add parameters.
1363 #define YY_DECL int yylex YY_PROTO(( void ))
1366 /* Code executed at the beginning of each rule, after yytext and yyleng
1369 #ifndef YY_USER_ACTION
1370 #define YY_USER_ACTION
1373 /* Code executed at the end of each rule. */
1375 #define YY_BREAK break;
1378 #define YY_RULE_SETUP \
1380 yy_current_buffer->yy_at_bol = \
1381 (yytext[yyleng - 1] == '\n'); \
1386 register yy_state_type yy_current_state
;
1387 register char *yy_cp
= NULL
, *yy_bp
= NULL
;
1388 register int yy_act
;
1390 #line 299 "tools/wpp/ppl.l"
1393 * Catch line-continuations.
1394 * Note: Gcc keeps the line-continuations in, for example, strings
1395 * intact. However, I prefer to remove them all so that the next
1396 * scanner will not need to reduce the continuation state.
1398 * <*>\\\n newline(0);
1402 * Detect the leading # of a preprocessor directive.
1404 #line 1405 "tools/wpp/lex.yy.c"
1415 yy_start
= 1; /* first start state */
1423 if ( ! yy_current_buffer
)
1425 yy_create_buffer( yyin
, YY_BUF_SIZE
);
1427 yy_load_buffer_state();
1430 while ( 1 ) /* loops until end-of-file is reached */
1434 /* Support of yytext. */
1435 *yy_cp
= yy_hold_char
;
1437 /* yy_bp points to the position in yy_ch_buf of the start of
1442 yy_current_state
= yy_start
;
1443 yy_current_state
+= YY_AT_BOL();
1447 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
1448 if ( yy_accept
[yy_current_state
] )
1450 yy_last_accepting_state
= yy_current_state
;
1451 yy_last_accepting_cpos
= yy_cp
;
1453 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1455 yy_current_state
= (int) yy_def
[yy_current_state
];
1456 if ( yy_current_state
>= 421 )
1457 yy_c
= yy_meta
[(unsigned int) yy_c
];
1459 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1462 while ( yy_base
[yy_current_state
] != 1771 );
1465 yy_act
= yy_accept
[yy_current_state
];
1467 { /* have to back up */
1468 yy_cp
= yy_last_accepting_cpos
;
1469 yy_current_state
= yy_last_accepting_state
;
1470 yy_act
= yy_accept
[yy_current_state
];
1473 YY_DO_BEFORE_ACTION
;
1476 do_action
: /* This label is used only to access EOF actions. */
1480 { /* beginning of action switch */
1481 case 0: /* must back up */
1482 /* undo the effects of YY_DO_BEFORE_ACTION */
1483 *yy_cp
= yy_hold_char
;
1484 yy_cp
= yy_last_accepting_cpos
;
1485 yy_current_state
= yy_last_accepting_state
;
1486 goto yy_find_action
;
1490 #line 312 "tools/wpp/ppl.l"
1491 pp_incl_state
.seen_junk
++; yy_push_state(pp_pp
);
1494 * Scan for the preprocessor directives
1498 #line 317 "tools/wpp/ppl.l"
1499 if(yy_top_state() != pp_ignore
) {yy_pp_state(pp_inc
); return tINCLUDE
;} else {yy_pp_state(pp_eol
);}
1503 #line 318 "tools/wpp/ppl.l"
1504 if(yy_top_state() != pp_ignore
) {yy_pp_state(pp_inc
); return tINCLUDE_NEXT
;} else {yy_pp_state(pp_eol
);}
1508 #line 319 "tools/wpp/ppl.l"
1509 yy_pp_state(yy_current_state() != pp_ignore
? pp_def
: pp_eol
);
1513 #line 320 "tools/wpp/ppl.l"
1514 yy_pp_state(pp_eol
); if(yy_top_state() != pp_ignore
) return tERROR
;
1518 #line 321 "tools/wpp/ppl.l"
1519 yy_pp_state(pp_eol
); if(yy_top_state() != pp_ignore
) return tWARNING
;
1523 #line 322 "tools/wpp/ppl.l"
1524 yy_pp_state(pp_eol
); if(yy_top_state() != pp_ignore
) return tPRAGMA
;
1528 #line 323 "tools/wpp/ppl.l"
1529 yy_pp_state(pp_eol
); if(yy_top_state() != pp_ignore
) return tPPIDENT
;
1533 #line 324 "tools/wpp/ppl.l"
1534 if(yy_top_state() != pp_ignore
) {yy_pp_state(pp_ifd
); return tUNDEF
;} else {yy_pp_state(pp_eol
);}
1538 #line 325 "tools/wpp/ppl.l"
1539 yy_pp_state(pp_ifd
); return tIFDEF
;
1543 #line 326 "tools/wpp/ppl.l"
1544 pp_incl_state
.seen_junk
--; yy_pp_state(pp_ifd
); return tIFNDEF
;
1548 #line 327 "tools/wpp/ppl.l"
1549 yy_pp_state(pp_if
); return tIF
;
1553 #line 328 "tools/wpp/ppl.l"
1554 yy_pp_state(pp_if
); return tELIF
;
1558 #line 329 "tools/wpp/ppl.l"
1559 yy_pp_state(pp_endif
); return tELSE
;
1563 #line 330 "tools/wpp/ppl.l"
1564 yy_pp_state(pp_endif
); return tENDIF
;
1568 #line 331 "tools/wpp/ppl.l"
1569 if(yy_top_state() != pp_ignore
) {yy_pp_state(pp_line
); return tLINE
;} else {yy_pp_state(pp_eol
);}
1573 #line 332 "tools/wpp/ppl.l"
1574 if(yy_top_state() != pp_ignore
) {yy_pp_state(pp_line
); return tGCCLINE
;} else {yy_pp_state(pp_eol
);}
1578 #line 333 "tools/wpp/ppl.l"
1579 pperror("Invalid preprocessor token '%s'", pptext
);
1583 #line 334 "tools/wpp/ppl.l"
1584 newline(1); yy_pop_state(); return tNL
; /* This could be the null-token */
1588 #line 335 "tools/wpp/ppl.l"
1593 #line 336 "tools/wpp/ppl.l"
1594 pperror("Preprocessor junk '%s'", pptext
);
1598 #line 337 "tools/wpp/ppl.l"
1602 * Handle #include and #line
1606 #line 342 "tools/wpp/ppl.l"
1607 return make_number(10, &pplval
, pptext
, ppleng
);
1611 #line 343 "tools/wpp/ppl.l"
1612 new_string(); add_string(pptext
, ppleng
); yy_push_state(pp_iqs
);
1616 #line 344 "tools/wpp/ppl.l"
1617 new_string(); add_string(pptext
, ppleng
); yy_push_state(pp_dqs
);
1621 #line 345 "tools/wpp/ppl.l"
1626 #line 346 "tools/wpp/ppl.l"
1627 newline(1); yy_pop_state(); return tNL
;
1631 #line 347 "tools/wpp/ppl.l"
1636 #line 348 "tools/wpp/ppl.l"
1637 pperror(yy_current_state() == pp_inc
? "Trailing junk in #include" : "Trailing junk in #line");
1640 * Ignore all input when a false clause is parsed
1644 #line 353 "tools/wpp/ppl.l"
1649 #line 354 "tools/wpp/ppl.l"
1654 #line 355 "tools/wpp/ppl.l"
1659 #line 356 "tools/wpp/ppl.l"
1663 * Handle #if and #elif.
1664 * These require conditionals to be evaluated, but we do not
1665 * want to jam the scanner normally when we see these tokens.
1666 * Note: tIDENT is handled below.
1670 #line 365 "tools/wpp/ppl.l"
1671 return make_number(8, &pplval
, pptext
, ppleng
);
1675 #line 366 "tools/wpp/ppl.l"
1676 pperror("Invalid octal digit");
1680 #line 367 "tools/wpp/ppl.l"
1681 return make_number(10, &pplval
, pptext
, ppleng
);
1685 #line 368 "tools/wpp/ppl.l"
1686 return make_number(16, &pplval
, pptext
, ppleng
);
1690 #line 369 "tools/wpp/ppl.l"
1691 pperror("Invalid hex number");
1695 #line 370 "tools/wpp/ppl.l"
1696 yy_push_state(pp_defined
); return tDEFINED
;
1700 #line 371 "tools/wpp/ppl.l"
1705 #line 372 "tools/wpp/ppl.l"
1710 #line 373 "tools/wpp/ppl.l"
1715 #line 374 "tools/wpp/ppl.l"
1720 #line 375 "tools/wpp/ppl.l"
1725 #line 376 "tools/wpp/ppl.l"
1730 #line 377 "tools/wpp/ppl.l"
1735 #line 378 "tools/wpp/ppl.l"
1740 #line 379 "tools/wpp/ppl.l"
1741 newline(1); yy_pop_state(); return tNL
;
1745 #line 380 "tools/wpp/ppl.l"
1750 #line 381 "tools/wpp/ppl.l"
1751 pperror("Junk in conditional expression");
1755 #line 382 "tools/wpp/ppl.l"
1760 #line 383 "tools/wpp/ppl.l"
1761 new_string(); add_string(pptext
, ppleng
); yy_push_state(pp_sqs
);
1765 #line 384 "tools/wpp/ppl.l"
1766 pperror("String constants not allowed in conditionals");
1770 #line 385 "tools/wpp/ppl.l"
1774 * Handle #ifdef, #ifndef and #undef
1775 * to get only an untranslated/unexpanded identifier
1779 #line 391 "tools/wpp/ppl.l"
1780 pplval
.cptr
= pp_xstrdup(pptext
); return tIDENT
;
1784 #line 392 "tools/wpp/ppl.l"
1789 #line 393 "tools/wpp/ppl.l"
1790 newline(1); yy_pop_state(); return tNL
;
1794 #line 394 "tools/wpp/ppl.l"
1799 #line 395 "tools/wpp/ppl.l"
1800 pperror("Identifier expected");
1803 * Handle #else and #endif.
1807 #line 400 "tools/wpp/ppl.l"
1812 #line 401 "tools/wpp/ppl.l"
1813 newline(1); yy_pop_state(); return tNL
;
1817 #line 402 "tools/wpp/ppl.l"
1822 #line 403 "tools/wpp/ppl.l"
1823 pperror("Garbage after #else or #endif.");
1826 * Handle the special 'defined' keyword.
1827 * This is necessary to get the identifier prior to any
1832 #line 410 "tools/wpp/ppl.l"
1833 yy_pop_state(); pplval
.cptr
= pp_xstrdup(pptext
); return tIDENT
;
1837 #line 411 "tools/wpp/ppl.l"
1842 #line 412 "tools/wpp/ppl.l"
1847 #line 413 "tools/wpp/ppl.l"
1852 #line 414 "tools/wpp/ppl.l"
1853 pperror("Identifier expected");
1856 * Handle #error, #warning, #pragma and #ident.
1857 * Pass everything literally to the parser, which
1858 * will act appropriately.
1859 * Comments are stripped from the literal text.
1863 #line 422 "tools/wpp/ppl.l"
1864 if(yy_top_state() != pp_ignore
) { pplval
.cptr
= pp_xstrdup(pptext
); return tLITERAL
; }
1868 #line 423 "tools/wpp/ppl.l"
1869 if(yy_top_state() != pp_ignore
) { pplval
.cptr
= pp_xstrdup(pptext
); return tLITERAL
; }
1873 #line 424 "tools/wpp/ppl.l"
1874 if(yy_top_state() != pp_ignore
) { pplval
.cptr
= pp_xstrdup(pptext
); return tLITERAL
; }
1878 #line 425 "tools/wpp/ppl.l"
1879 newline(1); yy_pop_state(); if(yy_current_state() != pp_ignore
) { return tNL
; }
1883 #line 426 "tools/wpp/ppl.l"
1887 * Handle left side of #define
1891 #line 431 "tools/wpp/ppl.l"
1892 pplval
.cptr
= pp_xstrdup(pptext
); pplval
.cptr
[ppleng
-1] = '\0'; yy_pp_state(pp_macro
); return tMACRO
;
1896 #line 432 "tools/wpp/ppl.l"
1897 pplval
.cptr
= pp_xstrdup(pptext
); yy_pp_state(pp_define
); return tDEFINE
;
1901 #line 433 "tools/wpp/ppl.l"
1906 #line 434 "tools/wpp/ppl.l"
1911 #line 435 "tools/wpp/ppl.l"
1912 perror("Identifier expected");
1915 * Scan the substitution of a define
1919 #line 440 "tools/wpp/ppl.l"
1920 pplval
.cptr
= pp_xstrdup(pptext
); return tLITERAL
;
1924 #line 441 "tools/wpp/ppl.l"
1925 pplval
.cptr
= pp_xstrdup(pptext
); return tLITERAL
;
1929 #line 442 "tools/wpp/ppl.l"
1930 newline(0); pplval
.cptr
= pp_xstrdup(" "); return tLITERAL
;
1934 #line 443 "tools/wpp/ppl.l"
1939 #line 444 "tools/wpp/ppl.l"
1940 newline(1); yy_pop_state(); return tNL
;
1944 #line 445 "tools/wpp/ppl.l"
1945 new_string(); add_string(pptext
, ppleng
); yy_push_state(pp_sqs
);
1949 #line 446 "tools/wpp/ppl.l"
1950 new_string(); add_string(pptext
, ppleng
); yy_push_state(pp_dqs
);
1953 * Scan the definition macro arguments
1957 #line 451 "tools/wpp/ppl.l"
1958 yy_pp_state(pp_mbody
); return tMACROEND
;
1962 #line 452 "tools/wpp/ppl.l"
1967 #line 453 "tools/wpp/ppl.l"
1968 pplval
.cptr
= pp_xstrdup(pptext
); return tIDENT
;
1972 #line 454 "tools/wpp/ppl.l"
1977 #line 455 "tools/wpp/ppl.l"
1982 #line 456 "tools/wpp/ppl.l"
1983 pperror("Argument identifier expected");
1987 #line 457 "tools/wpp/ppl.l"
1991 * Scan the substitution of a macro
1995 #line 462 "tools/wpp/ppl.l"
1996 pplval
.cptr
= pp_xstrdup(pptext
); return tLITERAL
;
2000 #line 463 "tools/wpp/ppl.l"
2001 pplval
.cptr
= pp_xstrdup(pptext
); return tIDENT
;
2005 #line 464 "tools/wpp/ppl.l"
2010 #line 465 "tools/wpp/ppl.l"
2015 #line 466 "tools/wpp/ppl.l"
2016 pplval
.cptr
= pp_xstrdup(pptext
); return tLITERAL
;
2020 #line 467 "tools/wpp/ppl.l"
2021 pplval
.cptr
= pp_xstrdup(pptext
); return tLITERAL
;
2025 #line 468 "tools/wpp/ppl.l"
2026 newline(0); pplval
.cptr
= pp_xstrdup(" "); return tLITERAL
;
2030 #line 469 "tools/wpp/ppl.l"
2035 #line 470 "tools/wpp/ppl.l"
2036 newline(1); yy_pop_state(); return tNL
;
2040 #line 471 "tools/wpp/ppl.l"
2041 new_string(); add_string(pptext
, ppleng
); yy_push_state(pp_sqs
);
2045 #line 472 "tools/wpp/ppl.l"
2046 new_string(); add_string(pptext
, ppleng
); yy_push_state(pp_dqs
);
2049 * Macro expansion text scanning.
2050 * This state is active just after the identifier is scanned
2051 * that triggers an expansion. We *must* delete the leading
2052 * whitespace before we can start scanning for arguments.
2054 * If we do not see a '(' as next trailing token, then we have
2055 * a false alarm. We just continue with a nose-bleed...
2058 *yy_cp
= yy_hold_char
; /* undo effects of setting up yytext */
2059 yy_c_buf_p
= yy_cp
-= 1;
2060 YY_DO_BEFORE_ACTION
; /* set up yytext again */
2062 #line 483 "tools/wpp/ppl.l"
2063 yy_pp_state(pp_macscan
);
2067 #line 484 "tools/wpp/ppl.l"
2069 if(yy_top_state() != pp_macscan
)
2075 #line 488 "tools/wpp/ppl.l"
2080 #line 489 "tools/wpp/ppl.l"
2082 macexpstackentry_t
*mac
= pop_macro();
2084 put_buffer(mac
->ppp
->ident
, strlen(mac
->ppp
->ident
));
2085 put_buffer(pptext
, ppleng
);
2090 * Macro expansion argument text scanning.
2091 * This state is active when a macro's arguments are being read for expansion.
2095 #line 501 "tools/wpp/ppl.l"
2097 if(++MACROPARENTHESES() > 1)
2098 add_text_to_macro(pptext
, ppleng
);
2103 #line 505 "tools/wpp/ppl.l"
2105 if(--MACROPARENTHESES() == 0)
2111 add_text_to_macro(pptext
, ppleng
);
2116 #line 514 "tools/wpp/ppl.l"
2118 if(MACROPARENTHESES() > 1)
2119 add_text_to_macro(pptext
, ppleng
);
2126 #line 520 "tools/wpp/ppl.l"
2127 new_string(); add_string(pptext
, ppleng
); yy_push_state(pp_dqs
);
2131 #line 521 "tools/wpp/ppl.l"
2132 new_string(); add_string(pptext
, ppleng
); yy_push_state(pp_sqs
);
2136 #line 522 "tools/wpp/ppl.l"
2137 yy_push_state(pp_comment
); add_text_to_macro(" ", 1);
2141 #line 523 "tools/wpp/ppl.l"
2142 pp_status
.line_number
++; pp_status
.char_number
= 1; add_text_to_macro(pptext
, ppleng
);
2146 #line 524 "tools/wpp/ppl.l"
2147 add_text_to_macro(pptext
, ppleng
);
2151 #line 525 "tools/wpp/ppl.l"
2155 * Comment handling (almost all start-conditions)
2159 #line 530 "tools/wpp/ppl.l"
2160 yy_push_state(pp_comment
);
2164 #line 531 "tools/wpp/ppl.l"
2169 #line 532 "tools/wpp/ppl.l"
2174 #line 533 "tools/wpp/ppl.l"
2178 * Remove C++ style comment (almost all start-conditions)
2182 #line 538 "tools/wpp/ppl.l"
2184 if(pptext
[ppleng
-1] == '\\')
2185 ppwarning("C++ style comment ends with an escaped newline (escape ignored)");
2189 * Single, double and <> quoted constants
2193 #line 546 "tools/wpp/ppl.l"
2194 pp_incl_state
.seen_junk
++; new_string(); add_string(pptext
, ppleng
); yy_push_state(pp_dqs
);
2198 #line 547 "tools/wpp/ppl.l"
2199 pp_incl_state
.seen_junk
++; new_string(); add_string(pptext
, ppleng
); yy_push_state(pp_sqs
);
2203 #line 548 "tools/wpp/ppl.l"
2204 add_string(pptext
, ppleng
);
2208 #line 549 "tools/wpp/ppl.l"
2210 add_string(pptext
, ppleng
);
2212 switch(yy_current_state())
2219 if (yy_current_state()==RCINCL
) yy_pop_state();
2220 pplval
.cptr
= get_string();
2223 pplval
.cptr
= get_string();
2224 if (is_c_h_include(pplval
.cptr
, 1)) pass_data
=0;
2234 #line 571 "tools/wpp/ppl.l"
2235 add_string(pptext
, ppleng
);
2239 #line 572 "tools/wpp/ppl.l"
2241 add_string(pptext
, ppleng
);
2243 switch(yy_current_state())
2248 pplval
.cptr
= get_string();
2257 #line 586 "tools/wpp/ppl.l"
2258 add_string(pptext
, ppleng
);
2262 #line 587 "tools/wpp/ppl.l"
2264 add_string(pptext
, ppleng
);
2266 pplval
.cptr
= get_string();
2272 #line 593 "tools/wpp/ppl.l"
2275 * This is tricky; we need to remove the line-continuation
2276 * from preprocessor strings, but OTOH retain them in all
2277 * other strings. This is because the resource grammar is
2278 * even more braindead than initially analysed and line-
2279 * continuations in strings introduce, sigh, newlines in
2280 * the output. There goes the concept of non-breaking, non-
2281 * spacing whitespace.
2283 switch(yy_top_state())
2293 add_string(pptext
, ppleng
);
2300 #line 617 "tools/wpp/ppl.l"
2301 add_string(pptext
, ppleng
);
2305 #line 618 "tools/wpp/ppl.l"
2308 add_string(pptext
, ppleng
);
2309 ppwarning("Newline in string constant encounterd (started line %d)", string_start());
2313 * Identifier scanning
2317 #line 627 "tools/wpp/ppl.l"
2320 pp_incl_state
.seen_junk
++;
2321 if(!(ppp
= pplookup(pptext
)))
2323 if(yy_current_state() == pp_inc
)
2324 pperror("Expected include filename");
2326 if(yy_current_state() == pp_if
)
2328 pplval
.cptr
= pp_xstrdup(pptext
);
2332 if((yy_current_state()==INITIAL
) && (strcasecmp(pptext
,"RCINCLUDE")==0)){
2333 yy_push_state(RCINCL
);
2336 else put_buffer(pptext
, ppleng
);
2339 else if(!ppp
->expanding
)
2344 expand_special(ppp
);
2350 yy_push_state(pp_macign
);
2354 pp_internal_error(__FILE__
, __LINE__
, "Invalid define type %d\n", ppp
->type
);
2360 * Everything else that needs to be passed and
2361 * newline and continuation handling
2365 #line 672 "tools/wpp/ppl.l"
2366 pp_incl_state
.seen_junk
++; put_buffer(pptext
, ppleng
);
2370 #line 673 "tools/wpp/ppl.l"
2371 put_buffer(pptext
, ppleng
);
2375 #line 674 "tools/wpp/ppl.l"
2380 #line 675 "tools/wpp/ppl.l"
2385 #line 676 "tools/wpp/ppl.l"
2386 pp_incl_state
.seen_junk
++; put_buffer(pptext
, ppleng
);
2389 * Special catcher for macro argmument expansion to prevent
2390 * newlines to propagate to the output or admin.
2394 #line 682 "tools/wpp/ppl.l"
2395 put_buffer(pptext
, ppleng
);
2399 #line 684 "tools/wpp/ppl.l"
2401 pplval
.cptr
=pp_xstrdup(pptext
);
2403 return tRCINCLUDEPATH
;
2408 #line 690 "tools/wpp/ppl.l"
2413 #line 692 "tools/wpp/ppl.l"
2415 new_string(); add_string(pptext
,ppleng
);yy_push_state(pp_dqs
);
2419 * This is a 'catch-all' rule to discover errors in the scanner
2420 * in an orderly manner.
2424 #line 700 "tools/wpp/ppl.l"
2425 pp_incl_state
.seen_junk
++; ppwarning("Unmatched text '%c' (0x%02x); please report\n", isprint(*pptext
& 0xff) ? *pptext
: ' ', *pptext
);
2427 case YY_STATE_EOF(INITIAL
):
2428 case YY_STATE_EOF(pp_pp
):
2429 case YY_STATE_EOF(pp_eol
):
2430 case YY_STATE_EOF(pp_inc
):
2431 case YY_STATE_EOF(pp_dqs
):
2432 case YY_STATE_EOF(pp_sqs
):
2433 case YY_STATE_EOF(pp_iqs
):
2434 case YY_STATE_EOF(pp_comment
):
2435 case YY_STATE_EOF(pp_def
):
2436 case YY_STATE_EOF(pp_define
):
2437 case YY_STATE_EOF(pp_macro
):
2438 case YY_STATE_EOF(pp_mbody
):
2439 case YY_STATE_EOF(pp_macign
):
2440 case YY_STATE_EOF(pp_macscan
):
2441 case YY_STATE_EOF(pp_macexp
):
2442 case YY_STATE_EOF(pp_if
):
2443 case YY_STATE_EOF(pp_ifd
):
2444 case YY_STATE_EOF(pp_endif
):
2445 case YY_STATE_EOF(pp_line
):
2446 case YY_STATE_EOF(pp_defined
):
2447 case YY_STATE_EOF(pp_ignore
):
2448 case YY_STATE_EOF(RCINCL
):
2449 #line 702 "tools/wpp/ppl.l"
2451 YY_BUFFER_STATE b
= YY_CURRENT_BUFFER
;
2452 bufferstackentry_t
*bep
= pop_buffer();
2454 if((!bep
&& pp_get_if_depth()) || (bep
&& pp_get_if_depth() != bep
->if_depth
))
2455 ppwarning("Unmatched #if/#endif at end of file");
2459 if(YY_START
!= INITIAL
)
2460 pperror("Unexpected end of file during preprocessing");
2463 else if(bep
->should_pop
== 2)
2465 macexpstackentry_t
*mac
;
2469 pp_delete_buffer(b
);
2474 #line 724 "tools/wpp/ppl.l"
2477 #line 2478 "tools/wpp/lex.yy.c"
2479 case YY_END_OF_BUFFER
:
2481 /* Amount of text matched not including the EOB char. */
2482 int yy_amount_of_matched_text
= (int) (yy_cp
- yytext_ptr
) - 1;
2484 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2485 *yy_cp
= yy_hold_char
;
2486 YY_RESTORE_YY_MORE_OFFSET
2488 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_NEW
)
2490 /* We're scanning a new file or input source. It's
2491 * possible that this happened because the user
2492 * just pointed yyin at a new source and called
2493 * yylex(). If so, then we have to assure
2494 * consistency between yy_current_buffer and our
2495 * globals. Here is the right place to do so, because
2496 * this is the first action (other than possibly a
2497 * back-up) that will match for the new input source.
2499 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
2500 yy_current_buffer
->yy_input_file
= yyin
;
2501 yy_current_buffer
->yy_buffer_status
= YY_BUFFER_NORMAL
;
2504 /* Note that here we test for yy_c_buf_p "<=" to the position
2505 * of the first EOB in the buffer, since yy_c_buf_p will
2506 * already have been incremented past the NUL character
2507 * (since all states make transitions on EOB to the
2508 * end-of-buffer state). Contrast this with the test
2511 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
2512 { /* This was really a NUL. */
2513 yy_state_type yy_next_state
;
2515 yy_c_buf_p
= yytext_ptr
+ yy_amount_of_matched_text
;
2517 yy_current_state
= yy_get_previous_state();
2519 /* Okay, we're now positioned to make the NUL
2520 * transition. We couldn't have
2521 * yy_get_previous_state() go ahead and do it
2522 * for us because it doesn't know how to deal
2523 * with the possibility of jamming (and we don't
2524 * want to build jamming into it because then it
2525 * will run more slowly).
2528 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
2530 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2532 if ( yy_next_state
)
2534 /* Consume the NUL. */
2535 yy_cp
= ++yy_c_buf_p
;
2536 yy_current_state
= yy_next_state
;
2543 goto yy_find_action
;
2547 else switch ( yy_get_next_buffer() )
2549 case EOB_ACT_END_OF_FILE
:
2551 yy_did_buffer_switch_on_eof
= 0;
2555 /* Note: because we've taken care in
2556 * yy_get_next_buffer() to have set up
2557 * yytext, we can now set up
2558 * yy_c_buf_p so that if some total
2559 * hoser (like flex itself) wants to
2560 * call the scanner after we return the
2561 * YY_NULL, it'll still work - another
2562 * YY_NULL will get returned.
2564 yy_c_buf_p
= yytext_ptr
+ YY_MORE_ADJ
;
2566 yy_act
= YY_STATE_EOF(YY_START
);
2572 if ( ! yy_did_buffer_switch_on_eof
)
2578 case EOB_ACT_CONTINUE_SCAN
:
2580 yytext_ptr
+ yy_amount_of_matched_text
;
2582 yy_current_state
= yy_get_previous_state();
2585 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2588 case EOB_ACT_LAST_MATCH
:
2590 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
2592 yy_current_state
= yy_get_previous_state();
2595 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2596 goto yy_find_action
;
2603 "fatal flex scanner internal error--no action found" );
2604 } /* end of action switch */
2605 } /* end of scanning one token */
2606 } /* end of yylex */
2609 /* yy_get_next_buffer - try to read in a new buffer
2611 * Returns a code representing an action:
2612 * EOB_ACT_LAST_MATCH -
2613 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2614 * EOB_ACT_END_OF_FILE - end of file
2617 static int yy_get_next_buffer()
2619 register char *dest
= yy_current_buffer
->yy_ch_buf
;
2620 register char *source
= yytext_ptr
;
2621 register int number_to_move
, i
;
2624 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
2626 "fatal flex scanner internal error--end of buffer missed" );
2628 if ( yy_current_buffer
->yy_fill_buffer
== 0 )
2629 { /* Don't try to fill the buffer, so this is an EOF. */
2630 if ( yy_c_buf_p
- yytext_ptr
- YY_MORE_ADJ
== 1 )
2632 /* We matched a single character, the EOB, so
2633 * treat this as a final EOF.
2635 return EOB_ACT_END_OF_FILE
;
2640 /* We matched some text prior to the EOB, first
2643 return EOB_ACT_LAST_MATCH
;
2647 /* Try to read more data. */
2649 /* First move last chars to start of buffer. */
2650 number_to_move
= (int) (yy_c_buf_p
- yytext_ptr
) - 1;
2652 for ( i
= 0; i
< number_to_move
; ++i
)
2653 *(dest
++) = *(source
++);
2655 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
2656 /* don't do the read, it's not guaranteed to return an EOF,
2659 yy_current_buffer
->yy_n_chars
= yy_n_chars
= 0;
2664 yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
2666 while ( num_to_read
<= 0 )
2667 { /* Not enough room in the buffer - grow it. */
2668 #ifdef YY_USES_REJECT
2670 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
2673 /* just a shorter name for the current buffer */
2674 YY_BUFFER_STATE b
= yy_current_buffer
;
2676 int yy_c_buf_p_offset
=
2677 (int) (yy_c_buf_p
- b
->yy_ch_buf
);
2679 if ( b
->yy_is_our_buffer
)
2681 int new_size
= b
->yy_buf_size
* 2;
2683 if ( new_size
<= 0 )
2684 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
2686 b
->yy_buf_size
*= 2;
2688 b
->yy_ch_buf
= (char *)
2689 /* Include room in for 2 EOB chars. */
2690 yy_flex_realloc( (void *) b
->yy_ch_buf
,
2691 b
->yy_buf_size
+ 2 );
2694 /* Can't grow it, we don't own it. */
2697 if ( ! b
->yy_ch_buf
)
2699 "fatal error - scanner input buffer overflow" );
2701 yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
2703 num_to_read
= yy_current_buffer
->yy_buf_size
-
2708 if ( num_to_read
> YY_READ_BUF_SIZE
)
2709 num_to_read
= YY_READ_BUF_SIZE
;
2711 /* Read in more data. */
2712 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
2713 yy_n_chars
, num_to_read
);
2715 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2718 if ( yy_n_chars
== 0 )
2720 if ( number_to_move
== YY_MORE_ADJ
)
2722 ret_val
= EOB_ACT_END_OF_FILE
;
2728 ret_val
= EOB_ACT_LAST_MATCH
;
2729 yy_current_buffer
->yy_buffer_status
=
2730 YY_BUFFER_EOF_PENDING
;
2735 ret_val
= EOB_ACT_CONTINUE_SCAN
;
2737 yy_n_chars
+= number_to_move
;
2738 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
2739 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
2741 yytext_ptr
= &yy_current_buffer
->yy_ch_buf
[0];
2747 /* yy_get_previous_state - get the state just before the EOB char was reached */
2749 static yy_state_type
yy_get_previous_state()
2751 register yy_state_type yy_current_state
;
2752 register char *yy_cp
;
2754 yy_current_state
= yy_start
;
2755 yy_current_state
+= YY_AT_BOL();
2757 for ( yy_cp
= yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
2759 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
2760 if ( yy_accept
[yy_current_state
] )
2762 yy_last_accepting_state
= yy_current_state
;
2763 yy_last_accepting_cpos
= yy_cp
;
2765 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2767 yy_current_state
= (int) yy_def
[yy_current_state
];
2768 if ( yy_current_state
>= 421 )
2769 yy_c
= yy_meta
[(unsigned int) yy_c
];
2771 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2774 return yy_current_state
;
2778 /* yy_try_NUL_trans - try to make a transition on the NUL character
2781 * next_state = yy_try_NUL_trans( current_state );
2784 #ifdef YY_USE_PROTOS
2785 static yy_state_type
yy_try_NUL_trans( yy_state_type yy_current_state
)
2787 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
2788 yy_state_type yy_current_state
;
2791 register int yy_is_jam
;
2792 register char *yy_cp
= yy_c_buf_p
;
2794 register YY_CHAR yy_c
= 1;
2795 if ( yy_accept
[yy_current_state
] )
2797 yy_last_accepting_state
= yy_current_state
;
2798 yy_last_accepting_cpos
= yy_cp
;
2800 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2802 yy_current_state
= (int) yy_def
[yy_current_state
];
2803 if ( yy_current_state
>= 421 )
2804 yy_c
= yy_meta
[(unsigned int) yy_c
];
2806 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2807 yy_is_jam
= (yy_current_state
== 420);
2809 return yy_is_jam
? 0 : yy_current_state
;
2814 #ifdef YY_USE_PROTOS
2815 static void yyunput( int c
, register char *yy_bp
)
2817 static void yyunput( c
, yy_bp
)
2819 register char *yy_bp
;
2822 register char *yy_cp
= yy_c_buf_p
;
2824 /* undo effects of setting up yytext */
2825 *yy_cp
= yy_hold_char
;
2827 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2828 { /* need to shift things up to make room */
2829 /* +2 for EOB chars. */
2830 register int number_to_move
= yy_n_chars
+ 2;
2831 register char *dest
= &yy_current_buffer
->yy_ch_buf
[
2832 yy_current_buffer
->yy_buf_size
+ 2];
2833 register char *source
=
2834 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
2836 while ( source
> yy_current_buffer
->yy_ch_buf
)
2837 *--dest
= *--source
;
2839 yy_cp
+= (int) (dest
- source
);
2840 yy_bp
+= (int) (dest
- source
);
2841 yy_current_buffer
->yy_n_chars
=
2842 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
2844 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2845 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2848 *--yy_cp
= (char) c
;
2852 yy_hold_char
= *yy_cp
;
2855 #endif /* ifndef YY_NO_UNPUT */
2860 static int yyinput()
2867 *yy_c_buf_p
= yy_hold_char
;
2869 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
2871 /* yy_c_buf_p now points to the character we want to return.
2872 * If this occurs *before* the EOB characters, then it's a
2873 * valid NUL; if not, then we've hit the end of the buffer.
2875 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
2876 /* This was really a NUL. */
2880 { /* need more input */
2881 int offset
= yy_c_buf_p
- yytext_ptr
;
2884 switch ( yy_get_next_buffer() )
2886 case EOB_ACT_LAST_MATCH
:
2887 /* This happens because yy_g_n_b()
2888 * sees that we've accumulated a
2889 * token and flags that we need to
2890 * try matching the token before
2891 * proceeding. But for input(),
2892 * there's no matching to consider.
2893 * So convert the EOB_ACT_LAST_MATCH
2894 * to EOB_ACT_END_OF_FILE.
2897 /* Reset buffer status. */
2902 case EOB_ACT_END_OF_FILE
:
2907 if ( ! yy_did_buffer_switch_on_eof
)
2916 case EOB_ACT_CONTINUE_SCAN
:
2917 yy_c_buf_p
= yytext_ptr
+ offset
;
2923 c
= *(unsigned char *) yy_c_buf_p
; /* cast for 8-bit char's */
2924 *yy_c_buf_p
= '\0'; /* preserve yytext */
2925 yy_hold_char
= *++yy_c_buf_p
;
2927 yy_current_buffer
->yy_at_bol
= (c
== '\n');
2931 #endif /* YY_NO_INPUT */
2933 #ifdef YY_USE_PROTOS
2934 void yyrestart( FILE *input_file
)
2936 void yyrestart( input_file
)
2940 if ( ! yy_current_buffer
)
2941 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
2943 yy_init_buffer( yy_current_buffer
, input_file
);
2944 yy_load_buffer_state();
2948 #ifdef YY_USE_PROTOS
2949 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
2951 void yy_switch_to_buffer( new_buffer
)
2952 YY_BUFFER_STATE new_buffer
;
2955 if ( yy_current_buffer
== new_buffer
)
2958 if ( yy_current_buffer
)
2960 /* Flush out information for old buffer. */
2961 *yy_c_buf_p
= yy_hold_char
;
2962 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
2963 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2966 yy_current_buffer
= new_buffer
;
2967 yy_load_buffer_state();
2969 /* We don't actually know whether we did this switch during
2970 * EOF (yywrap()) processing, but the only time this flag
2971 * is looked at is after yywrap() is called, so it's safe
2972 * to go ahead and always set it.
2974 yy_did_buffer_switch_on_eof
= 1;
2978 #ifdef YY_USE_PROTOS
2979 void yy_load_buffer_state( void )
2981 void yy_load_buffer_state()
2984 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
2985 yytext_ptr
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
2986 yyin
= yy_current_buffer
->yy_input_file
;
2987 yy_hold_char
= *yy_c_buf_p
;
2991 #ifdef YY_USE_PROTOS
2992 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
2994 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
3001 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
3003 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
3005 b
->yy_buf_size
= size
;
3007 /* yy_ch_buf has to be 2 characters longer than the size given because
3008 * we need to put in 2 end-of-buffer characters.
3010 b
->yy_ch_buf
= (char *) yy_flex_alloc( b
->yy_buf_size
+ 2 );
3011 if ( ! b
->yy_ch_buf
)
3012 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
3014 b
->yy_is_our_buffer
= 1;
3016 yy_init_buffer( b
, file
);
3022 #ifdef YY_USE_PROTOS
3023 void yy_delete_buffer( YY_BUFFER_STATE b
)
3025 void yy_delete_buffer( b
)
3032 if ( b
== yy_current_buffer
)
3033 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
3035 if ( b
->yy_is_our_buffer
)
3036 yy_flex_free( (void *) b
->yy_ch_buf
);
3038 yy_flex_free( (void *) b
);
3043 #ifdef YY_USE_PROTOS
3044 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
3046 void yy_init_buffer( b
, file
)
3053 yy_flush_buffer( b
);
3055 b
->yy_input_file
= file
;
3056 b
->yy_fill_buffer
= 1;
3058 #if YY_ALWAYS_INTERACTIVE
3059 b
->yy_is_interactive
= 1;
3061 #if YY_NEVER_INTERACTIVE
3062 b
->yy_is_interactive
= 0;
3064 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
3070 #ifdef YY_USE_PROTOS
3071 void yy_flush_buffer( YY_BUFFER_STATE b
)
3073 void yy_flush_buffer( b
)
3083 /* We always need two end-of-buffer characters. The first causes
3084 * a transition to the end-of-buffer state. The second causes
3085 * a jam in that state.
3087 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
3088 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
3090 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
3093 b
->yy_buffer_status
= YY_BUFFER_NEW
;
3095 if ( b
== yy_current_buffer
)
3096 yy_load_buffer_state();
3100 #ifndef YY_NO_SCAN_BUFFER
3101 #ifdef YY_USE_PROTOS
3102 YY_BUFFER_STATE
yy_scan_buffer( char *base
, yy_size_t size
)
3104 YY_BUFFER_STATE
yy_scan_buffer( base
, size
)
3112 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
3113 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
3114 /* They forgot to leave room for the EOB's. */
3117 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
3119 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
3121 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
3122 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
3123 b
->yy_is_our_buffer
= 0;
3124 b
->yy_input_file
= 0;
3125 b
->yy_n_chars
= b
->yy_buf_size
;
3126 b
->yy_is_interactive
= 0;
3128 b
->yy_fill_buffer
= 0;
3129 b
->yy_buffer_status
= YY_BUFFER_NEW
;
3131 yy_switch_to_buffer( b
);
3138 #ifndef YY_NO_SCAN_STRING
3139 #ifdef YY_USE_PROTOS
3140 YY_BUFFER_STATE
yy_scan_string( yyconst
char *yy_str
)
3142 YY_BUFFER_STATE
yy_scan_string( yy_str
)
3143 yyconst
char *yy_str
;
3147 for ( len
= 0; yy_str
[len
]; ++len
)
3150 return yy_scan_bytes( yy_str
, len
);
3155 #ifndef YY_NO_SCAN_BYTES
3156 #ifdef YY_USE_PROTOS
3157 YY_BUFFER_STATE
yy_scan_bytes( yyconst
char *bytes
, int len
)
3159 YY_BUFFER_STATE
yy_scan_bytes( bytes
, len
)
3160 yyconst
char *bytes
;
3169 /* Get memory for full buffer, including space for trailing EOB's. */
3171 buf
= (char *) yy_flex_alloc( n
);
3173 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
3175 for ( i
= 0; i
< len
; ++i
)
3178 buf
[len
] = buf
[len
+1] = YY_END_OF_BUFFER_CHAR
;
3180 b
= yy_scan_buffer( buf
, n
);
3182 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
3184 /* It's okay to grow etc. this buffer, and we should throw it
3185 * away when we're done.
3187 b
->yy_is_our_buffer
= 1;
3194 #ifndef YY_NO_PUSH_STATE
3195 #ifdef YY_USE_PROTOS
3196 static void yy_push_state( int new_state
)
3198 static void yy_push_state( new_state
)
3202 if ( yy_start_stack_ptr
>= yy_start_stack_depth
)
3206 yy_start_stack_depth
+= YY_START_STACK_INCR
;
3207 new_size
= yy_start_stack_depth
* sizeof( int );
3209 if ( ! yy_start_stack
)
3210 yy_start_stack
= (int *) yy_flex_alloc( new_size
);
3213 yy_start_stack
= (int *) yy_flex_realloc(
3214 (void *) yy_start_stack
, new_size
);
3216 if ( ! yy_start_stack
)
3218 "out of memory expanding start-condition stack" );
3221 yy_start_stack
[yy_start_stack_ptr
++] = YY_START
;
3228 #ifndef YY_NO_POP_STATE
3229 static void yy_pop_state()
3231 if ( --yy_start_stack_ptr
< 0 )
3232 YY_FATAL_ERROR( "start-condition stack underflow" );
3234 BEGIN(yy_start_stack
[yy_start_stack_ptr
]);
3239 #ifndef YY_NO_TOP_STATE
3240 static int yy_top_state()
3242 return yy_start_stack
[yy_start_stack_ptr
- 1];
3246 #ifndef YY_EXIT_FAILURE
3247 #define YY_EXIT_FAILURE 2
3250 #ifdef YY_USE_PROTOS
3251 static void yy_fatal_error( yyconst
char msg
[] )
3253 static void yy_fatal_error( msg
)
3257 (void) fprintf( stderr
, "%s\n", msg
);
3258 exit( YY_EXIT_FAILURE
);
3263 /* Redefine yyless() so it works in section 3 code. */
3269 /* Undo effects of setting up yytext. */ \
3270 yytext[yyleng] = yy_hold_char; \
3271 yy_c_buf_p = yytext + n; \
3272 yy_hold_char = *yy_c_buf_p; \
3273 *yy_c_buf_p = '\0'; \
3279 /* Internal utility routines. */
3282 #ifdef YY_USE_PROTOS
3283 static void yy_flex_strncpy( char *s1
, yyconst
char *s2
, int n
)
3285 static void yy_flex_strncpy( s1
, s2
, n
)
3292 for ( i
= 0; i
< n
; ++i
)
3297 #ifdef YY_NEED_STRLEN
3298 #ifdef YY_USE_PROTOS
3299 static int yy_flex_strlen( yyconst
char *s
)
3301 static int yy_flex_strlen( s
)
3306 for ( n
= 0; s
[n
]; ++n
)
3314 #ifdef YY_USE_PROTOS
3315 static void *yy_flex_alloc( yy_size_t size
)
3317 static void *yy_flex_alloc( size
)
3321 return (void *) malloc( size
);
3324 #ifdef YY_USE_PROTOS
3325 static void *yy_flex_realloc( void *ptr
, yy_size_t size
)
3327 static void *yy_flex_realloc( ptr
, size
)
3332 /* The cast to (char *) in the following accommodates both
3333 * implementations that use char* generic pointers, and those
3334 * that use void* generic pointers. It works with the latter
3335 * because both ANSI C and C++ allow castless assignment from
3336 * any pointer type to void*, and deal with argument conversions
3337 * as though doing an assignment.
3339 return (void *) realloc( (char *) ptr
, size
);
3342 #ifdef YY_USE_PROTOS
3343 static void yy_flex_free( void *ptr
)
3345 static void yy_flex_free( ptr
)
3359 #line 724 "tools/wpp/ppl.l"
3362 **************************************************************************
3364 **************************************************************************
3376 *-------------------------------------------------------------------------
3377 * Output newlines or set them as continuations
3379 * Input: -1 - Don't count this one, but update local position (see pp_dqs)
3380 * 0 - Line-continuation seen and cache output
3381 * 1 - Newline seen and flush output
3382 *-------------------------------------------------------------------------
3384 static void newline(int dowrite
)
3386 pp_status
.line_number
++;
3387 pp_status
.char_number
= 1;
3395 for(;ncontinuations
; ncontinuations
--)
3396 put_buffer("\n", 1);
3402 *-------------------------------------------------------------------------
3403 * Make a number out of an any-base and suffixed string
3405 * Possible number extensions:
3408 * - "LL" long long int
3409 * - "U" unsigned int
3410 * - "UL" unsigned long int
3411 * - "ULL" unsigned long long int
3412 * - "LU" unsigned long int
3413 * - "LLU" unsigned long long int
3417 * The sizes of resulting 'int' and 'long' are compiler specific.
3418 * I depend on sizeof(int) > 2 here (although a relatively safe
3420 * Long longs are not yet implemented because this is very compiler
3421 * specific and I don't want to think too much about the problems.
3423 *-------------------------------------------------------------------------
3425 static int make_number(int radix
, YYSTYPE
*val
, const char *str
, int len
)
3433 ext
[2] = toupper(str
[len
-1]);
3434 ext
[1] = len
> 1 ? toupper(str
[len
-2]) : ' ';
3435 ext
[0] = len
> 2 ? toupper(str
[len
-3]) : ' ';
3437 if(!strcmp(ext
, "LUL"))
3438 pperror("Invalid constant suffix");
3439 else if(!strcmp(ext
, "LLU") || !strcmp(ext
, "ULL"))
3444 else if(!strcmp(ext
+1, "LU") || !strcmp(ext
+1, "UL"))
3449 else if(!strcmp(ext
+1, "LL"))
3453 else if(!strcmp(ext
+2, "L"))
3457 else if(!strcmp(ext
+2, "U"))
3463 pp_internal_error(__FILE__
, __LINE__
, "long long constants not implemented yet");
3467 val
->ulong
= strtoul(str
, NULL
, radix
);
3470 else if(!is_u
&& is_l
)
3472 val
->slong
= strtol(str
, NULL
, radix
);
3475 else if(is_u
&& !is_l
)
3477 val
->uint
= (unsigned int)strtoul(str
, NULL
, radix
);
3481 /* Else it must be an int... */
3482 val
->sint
= (int)strtol(str
, NULL
, radix
);
3488 *-------------------------------------------------------------------------
3489 * Macro and define expansion support
3491 * FIXME: Variable macro arguments.
3492 *-------------------------------------------------------------------------
3494 static void expand_special(pp_entry_t
*ppp
)
3496 const char *dbgtext
= "?";
3497 static char *buf
= NULL
;
3499 assert(ppp
->type
== def_special
);
3501 if(!strcmp(ppp
->ident
, "__LINE__"))
3503 dbgtext
= "def_special(__LINE__)";
3504 buf
= pp_xrealloc(buf
, 32);
3505 sprintf(buf
, "%d", pp_status
.line_number
);
3507 else if(!strcmp(ppp
->ident
, "__FILE__"))
3509 dbgtext
= "def_special(__FILE__)";
3510 buf
= pp_xrealloc(buf
, strlen(pp_status
.input
) + 3);
3511 sprintf(buf
, "\"%s\"", pp_status
.input
);
3514 pp_internal_error(__FILE__
, __LINE__
, "Special macro '%s' not found...\n", ppp
->ident
);
3517 fprintf(stderr
, "expand_special(%d): %s:%d: '%s' -> '%s'\n",
3520 pp_status
.line_number
,
3526 push_buffer(ppp
, NULL
, NULL
, 0);
3527 yy_scan_string(buf
);
3531 static void expand_define(pp_entry_t
*ppp
)
3533 assert(ppp
->type
== def_define
);
3536 fprintf(stderr
, "expand_define(%d): %s:%d: '%s' -> '%s'\n",
3539 pp_status
.line_number
,
3542 if(ppp
->subst
.text
&& ppp
->subst
.text
[0])
3544 push_buffer(ppp
, NULL
, NULL
, 0);
3545 yy_scan_string(ppp
->subst
.text
);
3549 static int curdef_idx
= 0;
3550 static int curdef_alloc
= 0;
3551 static char *curdef_text
= NULL
;
3553 static void add_text(const char *str
, int len
)
3557 if(curdef_idx
>= curdef_alloc
|| curdef_alloc
- curdef_idx
< len
)
3559 curdef_alloc
+= (len
+ ALLOCBLOCKSIZE
-1) & ~(ALLOCBLOCKSIZE
-1);
3560 curdef_text
= pp_xrealloc(curdef_text
, curdef_alloc
* sizeof(curdef_text
[0]));
3561 if(curdef_alloc
> 65536)
3562 ppwarning("Reallocating macro-expansion buffer larger than 64kB");
3564 memcpy(&curdef_text
[curdef_idx
], str
, len
);
3568 static mtext_t
*add_expand_text(mtext_t
*mtp
, macexpstackentry_t
*mep
, int *nnl
)
3582 fprintf(stderr
, "add_expand_text: exp_text: '%s'\n", mtp
->subst
.text
);
3583 add_text(mtp
->subst
.text
, strlen(mtp
->subst
.text
));
3588 fprintf(stderr
, "add_expand_text: exp_stringize(%d): '%s'\n",
3590 mep
->args
[mtp
->subst
.argidx
]);
3591 cptr
= mep
->args
[mtp
->subst
.argidx
];
3595 if(*cptr
== '"' || *cptr
== '\\')
3605 fprintf(stderr
, "add_expand_text: exp_concat\n");
3606 /* Remove trailing whitespace from current expansion text */
3609 if(isspace(curdef_text
[curdef_idx
-1] & 0xff))
3614 /* tag current position and recursively expand the next part */
3616 mtp
= add_expand_text(mtp
->next
, mep
, nnl
);
3618 /* Now get rid of the leading space of the expansion */
3619 cptr
= &curdef_text
[tag
];
3620 n
= curdef_idx
- tag
;
3623 if(isspace(*cptr
& 0xff))
3631 if(cptr
!= &curdef_text
[tag
])
3633 memmove(&curdef_text
[tag
], cptr
, n
);
3634 curdef_idx
-= (curdef_idx
- tag
) - n
;
3639 if((mtp
->next
&& mtp
->next
->type
== exp_concat
) || (mtp
->prev
&& mtp
->prev
->type
== exp_concat
))
3640 exp
= mep
->args
[mtp
->subst
.argidx
];
3642 exp
= mep
->ppargs
[mtp
->subst
.argidx
];
3645 add_text(exp
, strlen(exp
));
3646 *nnl
-= mep
->nnls
[mtp
->subst
.argidx
];
3647 cptr
= strchr(exp
, '\n');
3651 cptr
= strchr(cptr
+1, '\n');
3653 mep
->nnls
[mtp
->subst
.argidx
] = 0;
3656 fprintf(stderr
, "add_expand_text: exp_subst(%d): '%s'\n", mtp
->subst
.argidx
, exp
);
3660 pp_internal_error(__FILE__
, __LINE__
, "Invalid expansion type (%d) in macro expansion\n", mtp
->type
);
3665 static void expand_macro(macexpstackentry_t
*mep
)
3671 pp_entry_t
*ppp
= mep
->ppp
;
3672 int nargs
= mep
->nargs
;
3674 assert(ppp
->type
== def_macro
);
3675 assert(ppp
->expanding
== 0);
3677 if((ppp
->nargs
>= 0 && nargs
!= ppp
->nargs
) || (ppp
->nargs
< 0 && nargs
< -ppp
->nargs
))
3678 pperror("Too %s macro arguments (%d)", nargs
< abs(ppp
->nargs
) ? "few" : "many", nargs
);
3680 for(n
= 0; n
< nargs
; n
++)
3681 nnl
+= mep
->nnls
[n
];
3684 fprintf(stderr
, "expand_macro(%d): %s:%d: '%s'(%d,%d) -> ...\n",
3687 pp_status
.line_number
,
3694 for(mtp
= ppp
->subst
.mtext
; mtp
; mtp
= mtp
->next
)
3696 if(!(mtp
= add_expand_text(mtp
, mep
, &nnl
)))
3700 for(n
= 0; n
< nnl
; n
++)
3703 /* To make sure there is room and termination (see below) */
3706 /* Strip trailing whitespace from expansion */
3707 for(k
= curdef_idx
, cptr
= &curdef_text
[curdef_idx
-1]; k
> 0; k
--, cptr
--)
3709 if(!isspace(*cptr
& 0xff))
3714 * We must add *one* whitespace to make sure that there
3715 * is a token-separation after the expansion.
3721 /* Strip leading whitespace from expansion */
3722 for(n
= 0, cptr
= curdef_text
; n
< k
; n
++, cptr
++)
3724 if(!isspace(*cptr
& 0xff))
3731 fprintf(stderr
, "expand_text: '%s'\n", curdef_text
+ n
);
3732 push_buffer(ppp
, NULL
, NULL
, 0);
3733 /*yy_scan_bytes(curdef_text + n, k - n);*/
3734 yy_scan_string(curdef_text
+ n
);
3739 *-------------------------------------------------------------------------
3740 * String collection routines
3741 *-------------------------------------------------------------------------
3743 static void new_string(void)
3747 ppwarning("new_string: strbuf_idx != 0");
3750 str_startline
= pp_status
.line_number
;
3753 static void add_string(const char *str
, int len
)
3757 if(strbuf_idx
>= strbuf_alloc
|| strbuf_alloc
- strbuf_idx
< len
)
3759 strbuf_alloc
+= (len
+ ALLOCBLOCKSIZE
-1) & ~(ALLOCBLOCKSIZE
-1);
3760 strbuffer
= pp_xrealloc(strbuffer
, strbuf_alloc
* sizeof(strbuffer
[0]));
3761 if(strbuf_alloc
> 65536)
3762 ppwarning("Reallocating string buffer larger than 64kB");
3764 memcpy(&strbuffer
[strbuf_idx
], str
, len
);
3768 static char *get_string(void)
3770 char *str
= pp_xmalloc(strbuf_idx
+ 1);
3771 memcpy(str
, strbuffer
, strbuf_idx
);
3772 str
[strbuf_idx
] = '\0';
3779 static void put_string(void)
3781 put_buffer(strbuffer
, strbuf_idx
);
3787 static int string_start(void)
3789 return str_startline
;
3794 *-------------------------------------------------------------------------
3796 *-------------------------------------------------------------------------
3798 static void push_buffer(pp_entry_t
*ppp
, char *filename
, char *incname
, int pop
)
3801 printf("push_buffer(%d): %p %p %p %d\n", bufferstackidx
, ppp
, filename
, incname
, pop
);
3802 if(bufferstackidx
>= MAXBUFFERSTACK
)
3803 pp_internal_error(__FILE__
, __LINE__
, "Buffer stack overflow");
3805 memset(&bufferstack
[bufferstackidx
], 0, sizeof(bufferstack
[0]));
3806 bufferstack
[bufferstackidx
].bufferstate
= YY_CURRENT_BUFFER
;
3807 bufferstack
[bufferstackidx
].define
= ppp
;
3808 bufferstack
[bufferstackidx
].line_number
= pp_status
.line_number
;
3809 bufferstack
[bufferstackidx
].char_number
= pp_status
.char_number
;
3810 bufferstack
[bufferstackidx
].if_depth
= pp_get_if_depth();
3811 bufferstack
[bufferstackidx
].should_pop
= pop
;
3812 bufferstack
[bufferstackidx
].filename
= pp_status
.input
;
3813 bufferstack
[bufferstackidx
].ncontinuations
= ncontinuations
;
3814 bufferstack
[bufferstackidx
].incl
= pp_incl_state
;
3815 bufferstack
[bufferstackidx
].include_filename
= incname
;
3816 bufferstack
[bufferstackidx
].pass_data
= pass_data
;
3822 /* These will track the pperror to the correct file and line */
3823 pp_status
.line_number
= 1;
3824 pp_status
.char_number
= 1;
3825 pp_status
.input
= filename
;
3829 pp_internal_error(__FILE__
, __LINE__
, "Pushing buffer without knowing where to go to");
3833 static bufferstackentry_t
*pop_buffer(void)
3835 if(bufferstackidx
< 0)
3836 pp_internal_error(__FILE__
, __LINE__
, "Bufferstack underflow?");
3838 if(bufferstackidx
== 0)
3843 if(bufferstack
[bufferstackidx
].define
)
3844 bufferstack
[bufferstackidx
].define
->expanding
= 0;
3847 pp_status
.line_number
= bufferstack
[bufferstackidx
].line_number
;
3848 pp_status
.char_number
= bufferstack
[bufferstackidx
].char_number
;
3849 pp_status
.input
= bufferstack
[bufferstackidx
].filename
;
3850 ncontinuations
= bufferstack
[bufferstackidx
].ncontinuations
;
3851 if(!bufferstack
[bufferstackidx
].should_pop
)
3854 fprintf(ppout
, "# %d \"%s\" 2\n", pp_status
.line_number
, pp_status
.input
);
3856 /* We have EOF, check the include logic */
3857 if(pp_incl_state
.state
== 2 && !pp_incl_state
.seen_junk
&& pp_incl_state
.ppp
)
3859 pp_entry_t
*ppp
= pplookup(pp_incl_state
.ppp
);
3862 includelogicentry_t
*iep
= pp_xmalloc(sizeof(includelogicentry_t
));
3865 iep
->filename
= bufferstack
[bufferstackidx
].include_filename
;
3867 iep
->next
= pp_includelogiclist
;
3869 iep
->next
->prev
= iep
;
3870 pp_includelogiclist
= iep
;
3872 fprintf(stderr
, "pop_buffer: %s:%d: includelogic added, include_ppp='%s', file='%s'\n", pp_status
.input
, pp_status
.line_number
, pp_incl_state
.ppp
, iep
->filename
);
3874 else if(bufferstack
[bufferstackidx
].include_filename
)
3875 free(bufferstack
[bufferstackidx
].include_filename
);
3877 if(pp_incl_state
.ppp
)
3878 free(pp_incl_state
.ppp
);
3879 pp_incl_state
= bufferstack
[bufferstackidx
].incl
;
3880 pass_data
= bufferstack
[bufferstackidx
].pass_data
;
3886 printf("pop_buffer(%d): %p %p (%d, %d, %d) %p %d\n",
3888 bufferstack
[bufferstackidx
].bufferstate
,
3889 bufferstack
[bufferstackidx
].define
,
3890 bufferstack
[bufferstackidx
].line_number
,
3891 bufferstack
[bufferstackidx
].char_number
,
3892 bufferstack
[bufferstackidx
].if_depth
,
3893 bufferstack
[bufferstackidx
].filename
,
3894 bufferstack
[bufferstackidx
].should_pop
);
3896 pp_switch_to_buffer(bufferstack
[bufferstackidx
].bufferstate
);
3898 if(bufferstack
[bufferstackidx
].should_pop
)
3900 if(yy_current_state() == pp_macexp
)
3901 macro_add_expansion();
3903 pp_internal_error(__FILE__
, __LINE__
, "Pop buffer and state without macro expansion state");
3907 return &bufferstack
[bufferstackidx
];
3912 *-------------------------------------------------------------------------
3913 * Macro nestng support
3914 *-------------------------------------------------------------------------
3916 static void push_macro(pp_entry_t
*ppp
)
3918 if(macexpstackidx
>= MAXMACEXPSTACK
)
3919 pperror("Too many nested macros");
3921 macexpstack
[macexpstackidx
] = pp_xmalloc(sizeof(macexpstack
[0][0]));
3922 memset( macexpstack
[macexpstackidx
], 0, sizeof(macexpstack
[0][0]));
3923 macexpstack
[macexpstackidx
]->ppp
= ppp
;
3927 static macexpstackentry_t
*top_macro(void)
3929 return macexpstackidx
> 0 ? macexpstack
[macexpstackidx
-1] : NULL
;
3932 static macexpstackentry_t
*pop_macro(void)
3934 if(macexpstackidx
<= 0)
3935 pp_internal_error(__FILE__
, __LINE__
, "Macro expansion stack underflow\n");
3936 return macexpstack
[--macexpstackidx
];
3939 static void free_macro(macexpstackentry_t
*mep
)
3943 for(i
= 0; i
< mep
->nargs
; i
++)
3954 static void add_text_to_macro(const char *text
, int len
)
3956 macexpstackentry_t
*mep
= top_macro();
3958 assert(mep
->ppp
->expanding
== 0);
3960 if(mep
->curargalloc
- mep
->curargsize
<= len
+1) /* +1 for '\0' */
3962 mep
->curargalloc
+= (ALLOCBLOCKSIZE
> len
+1) ? ALLOCBLOCKSIZE
: len
+1;
3963 mep
->curarg
= pp_xrealloc(mep
->curarg
, mep
->curargalloc
* sizeof(mep
->curarg
[0]));
3965 memcpy(mep
->curarg
+ mep
->curargsize
, text
, len
);
3966 mep
->curargsize
+= len
;
3967 mep
->curarg
[mep
->curargsize
] = '\0';
3970 static void macro_add_arg(int last
)
3974 macexpstackentry_t
*mep
= top_macro();
3976 assert(mep
->ppp
->expanding
== 0);
3978 mep
->args
= pp_xrealloc(mep
->args
, (mep
->nargs
+1) * sizeof(mep
->args
[0]));
3979 mep
->ppargs
= pp_xrealloc(mep
->ppargs
, (mep
->nargs
+1) * sizeof(mep
->ppargs
[0]));
3980 mep
->nnls
= pp_xrealloc(mep
->nnls
, (mep
->nargs
+1) * sizeof(mep
->nnls
[0]));
3981 mep
->args
[mep
->nargs
] = pp_xstrdup(mep
->curarg
? mep
->curarg
: "");
3982 cptr
= mep
->args
[mep
->nargs
]-1;
3983 while((cptr
= strchr(cptr
+1, '\n')))
3987 mep
->nnls
[mep
->nargs
] = nnl
;
3990 mep
->curargalloc
= mep
->curargsize
= 0;
3994 fprintf(stderr
, "macro_add_arg: %s:%d: %d -> '%s'\n",
3996 pp_status
.line_number
,
3998 mep
->args
[mep
->nargs
-1]);
4000 /* Each macro argument must be expanded to cope with stingize */
4001 if(last
|| mep
->args
[mep
->nargs
-1][0])
4003 yy_push_state(pp_macexp
);
4004 push_buffer(NULL
, NULL
, NULL
, last
? 2 : 1);
4005 yy_scan_string(mep
->args
[mep
->nargs
-1]);
4006 /*mep->bufferstackidx = bufferstackidx; But not nested! */
4010 static void macro_add_expansion(void)
4012 macexpstackentry_t
*mep
= top_macro();
4014 assert(mep
->ppp
->expanding
== 0);
4016 mep
->ppargs
[mep
->nargs
-1] = pp_xstrdup(mep
->curarg
? mep
->curarg
: "");
4018 mep
->curargalloc
= mep
->curargsize
= 0;
4022 fprintf(stderr
, "macro_add_expansion: %s:%d: %d -> '%s'\n",
4024 pp_status
.line_number
,
4026 mep
->ppargs
[mep
->nargs
-1]);
4031 *-------------------------------------------------------------------------
4033 *-------------------------------------------------------------------------
4035 static void put_buffer(const char *s
, int len
)
4038 add_text_to_macro(s
, len
);
4041 fwrite(s
, 1, len
, ppout
);
4047 *-------------------------------------------------------------------------
4048 * Include management
4049 *-------------------------------------------------------------------------
4051 static int is_c_h_include(char *fname
, int quoted
)
4053 int sl
=strlen(fname
);
4054 if (sl
< 2 + 2 * quoted
) return 0;
4055 if ((toupper(fname
[sl
-1-quoted
])!='H') && (toupper(fname
[sl
-1-quoted
])!='C')) return 0;
4056 if (fname
[sl
-2-quoted
]!='.') return 0;
4060 void pp_do_include(char *fname
, int type
)
4064 includelogicentry_t
*iep
;
4066 for(iep
= pp_includelogiclist
; iep
; iep
= iep
->next
)
4068 if(!strcmp(iep
->filename
, fname
))
4071 * We are done. The file was included before.
4072 * If the define was deleted, then this entry would have
4082 pperror("Empty include filename");
4084 /* Undo the effect of the quotation */
4087 if((ppin
= pp_open_include(fname
+1, type
? pp_status
.input
: NULL
, &newpath
, type
)) == NULL
)
4088 pperror("Unable to open include file %s", fname
+1);
4090 fname
[n
-1] = *fname
; /* Redo the quotes */
4091 push_buffer(NULL
, newpath
, fname
, 0);
4092 pp_incl_state
.seen_junk
= 0;
4093 pp_incl_state
.state
= 0;
4094 pp_incl_state
.ppp
= NULL
;
4095 if (is_c_h_include(newpath
, 0)) pass_data
=0;
4099 fprintf(stderr
, "pp_do_include: %s:%d: include_state=%d, include_ppp='%s', include_ifdepth=%d ,pass_data=%d\n",
4100 pp_status
.input
, pp_status
.line_number
, pp_incl_state
.state
, pp_incl_state
.ppp
, pp_incl_state
.ifdepth
, pass_data
);
4101 pp_switch_to_buffer(pp_create_buffer(ppin
, YY_BUF_SIZE
));
4103 fprintf(ppout
, "# 1 \"%s\" 1%s\n", newpath
, type
? "" : " 3");
4107 *-------------------------------------------------------------------------
4108 * Push/pop preprocessor ignore state when processing conditionals
4110 *-------------------------------------------------------------------------
4112 void pp_push_ignore_state(void)
4114 yy_push_state(pp_ignore
);
4117 void pp_pop_ignore_state(void)