1 #define yy_create_buffer parser__create_buffer
2 #define yy_delete_buffer parser__delete_buffer
3 #define yy_scan_buffer parser__scan_buffer
4 #define yy_scan_string parser__scan_string
5 #define yy_scan_bytes parser__scan_bytes
6 #define yy_flex_debug parser__flex_debug
7 #define yy_init_buffer parser__init_buffer
8 #define yy_flush_buffer parser__flush_buffer
9 #define yy_load_buffer_state parser__load_buffer_state
10 #define yy_switch_to_buffer parser__switch_to_buffer
11 #define yyin parser_in
12 #define yyleng parser_leng
13 #define yylex parser_lex
14 #define yyout parser_out
15 #define yyrestart parser_restart
16 #define yytext parser_text
17 #define yywrap parser_wrap
19 #line 20 "parser.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
33 /* 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 36
305 #define YY_END_OF_BUFFER 37
306 static yyconst
short int yy_accept
[148] =
308 0, 0, 0, 0, 0, 0, 0, 0, 2, 2,
309 0, 0, 37, 35, 24, 23, 35, 3, 35, 7,
310 35, 35, 19, 19, 35, 35, 35, 22, 22, 22,
311 14, 35, 24, 1, 13, 36, 4, 13, 6, 19,
312 19, 16, 16, 16, 15, 2, 8, 13, 29, 33,
313 27, 0, 0, 19, 19, 19, 0, 25, 31, 28,
314 30, 26, 22, 5, 22, 32, 0, 1, 1, 12,
315 10, 9, 19, 0, 16, 16, 2, 11, 34, 20,
316 19, 19, 18, 22, 19, 0, 16, 0, 18, 18,
317 22, 19, 0, 16, 0, 20, 18, 18, 22, 19,
319 0, 16, 22, 19, 0, 16, 22, 19, 0, 16,
320 22, 19, 0, 16, 22, 0, 19, 0, 21, 0,
321 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
322 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
326 static yyconst
int yy_ec
[256] =
328 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
329 1, 2, 2, 1, 1, 1, 1, 1, 1, 1,
330 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
331 1, 2, 4, 5, 6, 1, 1, 7, 8, 9,
332 1, 1, 10, 1, 11, 12, 1, 13, 14, 14,
333 14, 14, 14, 14, 14, 14, 14, 1, 1, 15,
334 16, 17, 1, 1, 18, 19, 19, 19, 20, 21,
335 22, 22, 22, 22, 22, 23, 22, 22, 22, 22,
336 22, 24, 25, 22, 26, 22, 22, 27, 28, 22,
337 29, 30, 31, 1, 22, 1, 19, 19, 19, 19,
339 32, 19, 22, 22, 22, 22, 22, 33, 22, 22,
340 22, 22, 22, 22, 22, 22, 34, 22, 22, 35,
341 22, 22, 1, 36, 1, 1, 1, 1, 1, 1,
342 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
343 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
344 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
345 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
346 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
347 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
348 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
350 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
351 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
352 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
353 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
354 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
358 static yyconst
int yy_meta
[37] =
360 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
361 1, 1, 3, 3, 1, 1, 1, 3, 3, 3,
362 3, 4, 4, 4, 4, 4, 4, 4, 1, 1,
366 static yyconst
short int yy_base
[184] =
368 0, 35, 35, 39, 40, 43, 61, 45, 262, 261,
369 46, 47, 263, 481, 481, 481, 246, 481, 254, 481,
370 243, 243, 85, 25, 41, 238, 42, 0, 248, 229,
371 481, 210, 60, 243, 481, 481, 481, 34, 481, 108,
372 26, 131, 154, 239, 481, 0, 481, 60, 481, 481,
373 481, 231, 58, 0, 75, 77, 0, 481, 481, 481,
374 481, 481, 0, 481, 220, 481, 61, 238, 236, 481,
375 481, 481, 174, 0, 196, 0, 0, 481, 481, 93,
376 481, 481, 113, 213, 216, 0, 238, 166, 89, 81,
377 214, 258, 0, 280, 89, 169, 481, 481, 207, 300,
379 0, 322, 203, 342, 0, 364, 208, 384, 0, 406,
380 197, 428, 213, 212, 115, 0, 211, 128, 481, 0,
381 0, 0, 210, 0, 0, 0, 0, 209, 0, 0,
382 0, 0, 208, 0, 0, 0, 0, 0, 0, 0,
383 0, 0, 0, 0, 0, 481, 481, 462, 466, 468,
384 472, 476, 215, 210, 209, 208, 202, 201, 200, 199,
385 196, 195, 193, 188, 187, 182, 181, 178, 175, 168,
386 167, 166, 159, 158, 157, 145, 135, 130, 129, 113,
390 static yyconst
short int yy_def
[184] =
392 147, 1, 148, 148, 148, 148, 1, 7, 149, 149,
393 148, 148, 147, 147, 147, 147, 147, 147, 147, 147,
394 147, 147, 147, 23, 147, 147, 147, 150, 150, 150,
395 147, 147, 147, 147, 147, 147, 147, 151, 147, 147,
396 40, 147, 42, 43, 147, 152, 147, 151, 147, 147,
397 147, 147, 147, 24, 147, 147, 153, 147, 147, 147,
398 147, 147, 150, 147, 150, 147, 147, 147, 147, 147,
399 147, 147, 147, 154, 43, 43, 152, 147, 147, 147,
400 147, 147, 153, 150, 147, 155, 43, 147, 147, 147,
401 150, 147, 156, 43, 147, 147, 147, 147, 150, 147,
403 157, 43, 150, 147, 158, 43, 150, 147, 159, 43,
404 150, 147, 147, 43, 150, 160, 112, 147, 147, 161,
405 162, 163, 147, 164, 165, 166, 167, 147, 168, 169,
406 170, 171, 147, 172, 173, 174, 175, 176, 177, 178,
407 179, 180, 181, 182, 183, 147, 0, 147, 147, 147,
408 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
409 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
410 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
414 static yyconst
short int yy_nxt
[518] =
416 14, 15, 16, 17, 18, 14, 19, 20, 14, 14,
417 21, 22, 23, 24, 25, 26, 27, 28, 28, 28,
418 28, 28, 29, 28, 30, 28, 28, 28, 31, 14,
419 14, 28, 28, 28, 28, 32, 33, 36, 71, 37,
420 34, 36, 36, 37, 39, 36, 33, 39, 36, 36,
421 34, 147, 147, 47, 47, 58, 59, 61, 62, 147,
422 147, 67, 67, 72, 38, 68, 68, 78, 38, 38,
423 80, 80, 38, 40, 41, 48, 48, 146, 42, 42,
424 42, 42, 43, 44, 43, 43, 43, 43, 43, 72,
425 145, 45, 42, 43, 43, 43, 53, 54, 54, 82,
427 81, 96, 96, 98, 144, 80, 80, 55, 81, 82,
428 56, 57, 88, 98, 97, 143, 118, 55, 56, 57,
429 73, 73, 97, 119, 88, 74, 74, 74, 74, 118,
430 55, 142, 141, 56, 57, 89, 119, 140, 90, 74,
431 55, 56, 57, 75, 75, 89, 90, 139, 75, 75,
432 75, 75, 76, 76, 76, 76, 76, 76, 76, 138,
433 137, 136, 75, 76, 76, 76, 76, 76, 135, 133,
434 132, 76, 76, 76, 76, 95, 95, 131, 96, 96,
435 130, 96, 96, 128, 127, 76, 85, 85, 88, 126,
436 125, 86, 86, 86, 86, 123, 55, 122, 121, 56,
438 88, 120, 113, 109, 105, 86, 55, 56, 87, 87,
439 101, 93, 86, 87, 87, 87, 87, 83, 134, 129,
440 124, 147, 116, 116, 115, 111, 107, 87, 92, 92,
441 103, 99, 91, 93, 93, 93, 93, 69, 55, 69,
442 84, 56, 79, 64, 69, 66, 65, 93, 55, 56,
443 94, 94, 64, 60, 52, 94, 94, 94, 94, 51,
444 50, 49, 147, 36, 36, 147, 147, 147, 147, 94,
445 100, 100, 147, 147, 147, 101, 101, 101, 101, 147,
446 55, 147, 147, 56, 147, 147, 147, 147, 147, 101,
447 55, 56, 102, 102, 147, 147, 147, 102, 102, 102,
449 102, 147, 147, 147, 147, 147, 147, 147, 147, 147,
450 147, 102, 104, 104, 147, 147, 147, 105, 105, 105,
451 105, 147, 55, 147, 147, 56, 147, 147, 147, 147,
452 147, 105, 55, 56, 106, 106, 147, 147, 147, 106,
453 106, 106, 106, 147, 147, 147, 147, 147, 147, 147,
454 147, 147, 147, 106, 108, 108, 147, 147, 147, 109,
455 109, 109, 109, 147, 55, 147, 147, 56, 147, 147,
456 147, 147, 147, 109, 55, 56, 110, 110, 147, 147,
457 147, 110, 110, 110, 110, 147, 147, 147, 147, 147,
458 147, 147, 147, 147, 147, 110, 112, 112, 147, 147,
460 147, 113, 113, 113, 113, 147, 55, 147, 147, 56,
461 147, 147, 147, 147, 147, 113, 55, 56, 114, 114,
462 147, 147, 147, 114, 114, 114, 114, 147, 147, 147,
463 147, 147, 147, 147, 147, 147, 147, 114, 116, 147,
464 117, 117, 147, 147, 147, 147, 147, 147, 147, 147,
465 55, 147, 147, 56, 147, 147, 147, 147, 147, 147,
466 55, 56, 35, 35, 35, 35, 46, 46, 46, 46,
467 63, 63, 70, 147, 70, 70, 77, 147, 77, 77,
468 13, 147, 147, 147, 147, 147, 147, 147, 147, 147,
469 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
471 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
472 147, 147, 147, 147, 147, 147, 147
475 static yyconst
short int yy_chk
[518] =
477 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
478 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
479 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
480 1, 1, 1, 1, 1, 1, 2, 3, 38, 3,
481 2, 4, 5, 4, 5, 6, 8, 6, 11, 12,
482 8, 24, 41, 11, 12, 25, 25, 27, 27, 24,
483 41, 33, 67, 38, 3, 33, 67, 48, 4, 5,
484 53, 53, 6, 7, 7, 11, 12, 183, 7, 7,
485 7, 7, 7, 7, 7, 7, 7, 7, 7, 48,
486 182, 7, 7, 7, 7, 7, 23, 23, 23, 56,
488 55, 95, 95, 90, 181, 80, 80, 23, 55, 56,
489 23, 23, 80, 90, 89, 180, 115, 23, 23, 23,
490 40, 40, 89, 115, 80, 40, 40, 40, 40, 118,
491 40, 179, 178, 40, 40, 83, 118, 177, 83, 40,
492 40, 40, 40, 42, 42, 83, 83, 176, 42, 42,
493 42, 42, 42, 42, 42, 42, 42, 42, 42, 175,
494 174, 173, 42, 42, 42, 42, 43, 43, 172, 171,
495 170, 43, 43, 43, 43, 88, 88, 169, 88, 88,
496 168, 96, 96, 167, 166, 43, 73, 73, 96, 165,
497 164, 73, 73, 73, 73, 163, 73, 162, 161, 73,
499 96, 160, 159, 158, 157, 73, 73, 73, 75, 75,
500 156, 155, 154, 75, 75, 75, 75, 153, 133, 128,
501 123, 117, 114, 113, 111, 107, 103, 75, 85, 85,
502 99, 91, 84, 85, 85, 85, 85, 69, 85, 68,
503 65, 85, 52, 44, 34, 32, 30, 85, 85, 85,
504 87, 87, 29, 26, 22, 87, 87, 87, 87, 21,
505 19, 17, 13, 10, 9, 0, 0, 0, 0, 87,
506 92, 92, 0, 0, 0, 92, 92, 92, 92, 0,
507 92, 0, 0, 92, 0, 0, 0, 0, 0, 92,
508 92, 92, 94, 94, 0, 0, 0, 94, 94, 94,
510 94, 0, 0, 0, 0, 0, 0, 0, 0, 0,
511 0, 94, 100, 100, 0, 0, 0, 100, 100, 100,
512 100, 0, 100, 0, 0, 100, 0, 0, 0, 0,
513 0, 100, 100, 100, 102, 102, 0, 0, 0, 102,
514 102, 102, 102, 0, 0, 0, 0, 0, 0, 0,
515 0, 0, 0, 102, 104, 104, 0, 0, 0, 104,
516 104, 104, 104, 0, 104, 0, 0, 104, 0, 0,
517 0, 0, 0, 104, 104, 104, 106, 106, 0, 0,
518 0, 106, 106, 106, 106, 0, 0, 0, 0, 0,
519 0, 0, 0, 0, 0, 106, 108, 108, 0, 0,
521 0, 108, 108, 108, 108, 0, 108, 0, 0, 108,
522 0, 0, 0, 0, 0, 108, 108, 108, 110, 110,
523 0, 0, 0, 110, 110, 110, 110, 0, 0, 0,
524 0, 0, 0, 0, 0, 0, 0, 110, 112, 0,
525 112, 112, 0, 0, 0, 0, 0, 0, 0, 0,
526 112, 0, 0, 112, 0, 0, 0, 0, 0, 0,
527 112, 112, 148, 148, 148, 148, 149, 149, 149, 149,
528 150, 150, 151, 0, 151, 151, 152, 0, 152, 152,
529 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
530 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
532 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
533 147, 147, 147, 147, 147, 147, 147
536 static yy_state_type yy_last_accepting_state
;
537 static char *yy_last_accepting_cpos
;
539 /* The intent behind this definition is that it'll catch
540 * any uses of REJECT which flex missed.
542 #define REJECT reject_used_but_not_detected
543 #define yymore() yymore_used_but_not_detected
544 #define YY_MORE_ADJ 0
545 #define YY_RESTORE_YY_MORE_OFFSET
552 * Copyright 2002 Ove Kaaven
554 * This library is free software; you can redistribute it and/or
555 * modify it under the terms of the GNU Lesser General Public
556 * License as published by the Free Software Foundation; either
557 * version 2.1 of the License, or (at your option) any later version.
559 * This library is distributed in the hope that it will be useful,
560 * but WITHOUT ANY WARRANTY; without even the implied warranty of
561 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
562 * Lesser General Public License for more details.
564 * You should have received a copy of the GNU Lesser General Public
565 * License along with this library; if not, write to the Free Software
566 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
568 #define YY_STACK_USED 1
569 #define YY_NO_INPUT 1
570 #define YY_NO_UNPUT 1
571 #define YY_NO_TOP_STATE 1
572 #define YY_NEVER_INTERACTIVE 1
598 #define YY_NO_UNISTD_H
604 #include "wine/wpp.h"
606 #include "parser.tab.h"
608 static void addcchar(char c
);
609 static char *get_buffered_cstring(void);
611 static char *cbuffer
;
613 static int cbufalloc
= 0;
615 static int kw_token(const char *kw
);
616 static int attr_token(const char *kw
);
618 #define MAX_IMPORT_DEPTH 10
620 YY_BUFFER_STATE state
;
624 } import_stack
[MAX_IMPORT_DEPTH
];
625 int import_stack_ptr
= 0;
627 /* converts an integer in string form to an unsigned long and prints an error
629 static unsigned long xstrtoul(const char *nptr
, char **endptr
, int base
)
634 l
= strtoul(nptr
, endptr
, base
);
635 if (l
== ULONG_MAX
&& errno
== ERANGE
)
636 error_loc("integer constant %s is too large\n", nptr
);
640 UUID
*parse_uuid(const char *u
)
642 UUID
* uuid
= xmalloc(sizeof(UUID
));
644 /* it would be nice to use UuidFromStringA */
645 uuid
->Data1
= strtoul(u
, NULL
, 16);
646 uuid
->Data2
= strtoul(u
+9, NULL
, 16);
647 uuid
->Data3
= strtoul(u
+14, NULL
, 16);
649 memcpy(b
, u
+19, 2); uuid
->Data4
[0] = strtoul(b
, NULL
, 16);
650 memcpy(b
, u
+21, 2); uuid
->Data4
[1] = strtoul(b
, NULL
, 16);
651 memcpy(b
, u
+24, 2); uuid
->Data4
[2] = strtoul(b
, NULL
, 16);
652 memcpy(b
, u
+26, 2); uuid
->Data4
[3] = strtoul(b
, NULL
, 16);
653 memcpy(b
, u
+28, 2); uuid
->Data4
[4] = strtoul(b
, NULL
, 16);
654 memcpy(b
, u
+30, 2); uuid
->Data4
[5] = strtoul(b
, NULL
, 16);
655 memcpy(b
, u
+32, 2); uuid
->Data4
[6] = strtoul(b
, NULL
, 16);
656 memcpy(b
, u
+34, 2); uuid
->Data4
[7] = strtoul(b
, NULL
, 16);
661 **************************************************************************
662 * The flexer starts here
663 **************************************************************************
665 #line 666 "parser.yy.c"
667 /* Macros after this point can all be overridden by user definitions in
671 #ifndef YY_SKIP_YYWRAP
673 extern "C" int yywrap
YY_PROTO(( void ));
675 extern int yywrap
YY_PROTO(( void ));
680 static void yyunput
YY_PROTO(( int c
, char *buf_ptr
));
684 static void yy_flex_strncpy
YY_PROTO(( char *, yyconst
char *, int ));
687 #ifdef YY_NEED_STRLEN
688 static int yy_flex_strlen
YY_PROTO(( yyconst
char * ));
693 static int yyinput
YY_PROTO(( void ));
695 static int input
YY_PROTO(( void ));
700 static int yy_start_stack_ptr
= 0;
701 static int yy_start_stack_depth
= 0;
702 static int *yy_start_stack
= 0;
703 #ifndef YY_NO_PUSH_STATE
704 static void yy_push_state
YY_PROTO(( int new_state
));
706 #ifndef YY_NO_POP_STATE
707 static void yy_pop_state
YY_PROTO(( void ));
709 #ifndef YY_NO_TOP_STATE
710 static int yy_top_state
YY_PROTO(( void ));
714 #define YY_NO_PUSH_STATE 1
715 #define YY_NO_POP_STATE 1
716 #define YY_NO_TOP_STATE 1
719 #ifdef YY_MALLOC_DECL
727 /* Just try to get by without declaring the routines. This will fail
728 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
729 * or sizeof(void*) != sizeof(int).
734 /* Amount of stuff to slurp up with each read. */
735 #ifndef YY_READ_BUF_SIZE
736 #define YY_READ_BUF_SIZE 8192
739 /* Copy whatever the last rule matched to the standard output. */
742 /* This used to be an fputs(), but since the string might contain NUL's,
743 * we now use fwrite().
745 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
748 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
749 * is returned in "result".
752 #define YY_INPUT(buf,result,max_size) \
753 if ( yy_current_buffer->yy_is_interactive ) \
756 for ( n = 0; n < max_size && \
757 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
760 buf[n++] = (char) c; \
761 if ( c == EOF && ferror( yyin ) ) \
762 YY_FATAL_ERROR( "input in flex scanner failed" ); \
765 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
766 && ferror( yyin ) ) \
767 YY_FATAL_ERROR( "input in flex scanner failed" );
770 /* No semi-colon after return; correct usage is to write "yyterminate();" -
771 * we don't want an extra ';' after the "return" because that will cause
772 * some compilers to complain about unreachable statements.
775 #define yyterminate() return YY_NULL
778 /* Number of entries by which start-condition stack grows. */
779 #ifndef YY_START_STACK_INCR
780 #define YY_START_STACK_INCR 25
783 /* Report a fatal error. */
784 #ifndef YY_FATAL_ERROR
785 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
788 /* Default declaration of generated scanner - a define so the user can
789 * easily add parameters.
792 #define YY_DECL int yylex YY_PROTO(( void ))
795 /* Code executed at the beginning of each rule, after yytext and yyleng
798 #ifndef YY_USER_ACTION
799 #define YY_USER_ACTION
802 /* Code executed at the end of each rule. */
804 #define YY_BREAK break;
807 #define YY_RULE_SETUP \
809 yy_current_buffer->yy_at_bol = \
810 (yytext[yyleng - 1] == '\n'); \
815 register yy_state_type yy_current_state
;
816 register char *yy_cp
, *yy_bp
;
821 #line 822 "parser.yy.c"
832 yy_start
= 1; /* first start state */
840 if ( ! yy_current_buffer
)
842 yy_create_buffer( yyin
, YY_BUF_SIZE
);
844 yy_load_buffer_state();
847 while ( 1 ) /* loops until end-of-file is reached */
851 /* Support of yytext. */
852 *yy_cp
= yy_hold_char
;
854 /* yy_bp points to the position in yy_ch_buf of the start of
859 yy_current_state
= yy_start
;
860 yy_current_state
+= YY_AT_BOL();
864 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
865 if ( yy_accept
[yy_current_state
] )
867 yy_last_accepting_state
= yy_current_state
;
868 yy_last_accepting_cpos
= yy_cp
;
870 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
872 yy_current_state
= (int) yy_def
[yy_current_state
];
873 if ( yy_current_state
>= 148 )
874 yy_c
= yy_meta
[(unsigned int) yy_c
];
876 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
879 while ( yy_base
[yy_current_state
] != 481 );
882 yy_act
= yy_accept
[yy_current_state
];
884 { /* have to back up */
885 yy_cp
= yy_last_accepting_cpos
;
886 yy_current_state
= yy_last_accepting_state
;
887 yy_act
= yy_accept
[yy_current_state
];
893 do_action
: /* This label is used only to access EOF actions. */
897 { /* beginning of action switch */
898 case 0: /* must back up */
899 /* undo the effects of YY_DO_BEFORE_ACTION */
900 *yy_cp
= yy_hold_char
;
901 yy_cp
= yy_last_accepting_cpos
;
902 yy_current_state
= yy_last_accepting_state
;
908 yy_push_state(PP_LINE
);
917 lineno
= (int)strtol(yytext
, &cptr
, 10);
919 error_loc("Malformed '#...' line-directive; invalid linenumber\n");
920 fname
= strchr(cptr
, '"');
922 error_loc("Malformed '#...' line-directive; missing filename\n");
924 cptr
= strchr(fname
, '"');
926 error_loc("Malformed '#...' line-directive; missing terminating \"\n");
928 line_number
= lineno
- 1; /* We didn't read the newline */
930 input_name
= xstrdup(fname
);
936 yy_push_state(QUOTE
); cbufidx
= 0;
943 parser_lval
.str
= get_buffered_cstring();
950 yy_push_state(WSTRQUOTE
);
957 parser_lval
.str
= get_buffered_cstring();
964 yy_push_state(SQUOTE
); cbufidx
= 0;
971 parser_lval
.str
= get_buffered_cstring();
990 addcchar('\\'); addcchar(yytext
[1]);
1000 yy_push_state(ATTR
); return '[';
1004 #line 171 "parser.l"
1005 yy_pop_state(); return ']';
1009 #line 172 "parser.l"
1010 return attr_token(yytext
);
1014 #line 173 "parser.l"
1016 parser_lval
.uuid
= parse_uuid(yytext
);
1022 #line 177 "parser.l"
1024 parser_lval
.num
= xstrtoul(yytext
, NULL
, 0);
1030 #line 181 "parser.l"
1032 parser_lval
.num
= xstrtoul(yytext
, NULL
, 0);
1038 #line 185 "parser.l"
1040 parser_lval
.dbl
= strtod(yytext
, NULL
);
1045 *yy_cp
= yy_hold_char
; /* undo effects of setting up yytext */
1046 yy_c_buf_p
= yy_cp
-= 1;
1047 YY_DO_BEFORE_ACTION
; /* set up yytext again */
1049 #line 189 "parser.l"
1054 #line 190 "parser.l"
1055 return kw_token(yytext
);
1059 #line 191 "parser.l"
1064 #line 192 "parser.l"
1069 #line 193 "parser.l"
1074 #line 194 "parser.l"
1079 #line 195 "parser.l"
1084 #line 196 "parser.l"
1089 #line 197 "parser.l"
1094 #line 198 "parser.l"
1095 return GREATEREQUAL
;
1099 #line 199 "parser.l"
1104 #line 200 "parser.l"
1109 #line 201 "parser.l"
1114 #line 202 "parser.l"
1119 #line 203 "parser.l"
1122 case YY_STATE_EOF(INITIAL
):
1123 case YY_STATE_EOF(QUOTE
):
1124 case YY_STATE_EOF(WSTRQUOTE
):
1125 case YY_STATE_EOF(ATTR
):
1126 case YY_STATE_EOF(PP_LINE
):
1127 case YY_STATE_EOF(SQUOTE
):
1128 #line 204 "parser.l"
1130 if (import_stack_ptr
)
1137 #line 209 "parser.l"
1140 #line 1141 "parser.yy.c"
1142 case YY_END_OF_BUFFER
:
1144 /* Amount of text matched not including the EOB char. */
1145 int yy_amount_of_matched_text
= (int) (yy_cp
- yytext_ptr
) - 1;
1147 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1148 *yy_cp
= yy_hold_char
;
1149 YY_RESTORE_YY_MORE_OFFSET
1151 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_NEW
)
1153 /* We're scanning a new file or input source. It's
1154 * possible that this happened because the user
1155 * just pointed yyin at a new source and called
1156 * yylex(). If so, then we have to assure
1157 * consistency between yy_current_buffer and our
1158 * globals. Here is the right place to do so, because
1159 * this is the first action (other than possibly a
1160 * back-up) that will match for the new input source.
1162 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1163 yy_current_buffer
->yy_input_file
= yyin
;
1164 yy_current_buffer
->yy_buffer_status
= YY_BUFFER_NORMAL
;
1167 /* Note that here we test for yy_c_buf_p "<=" to the position
1168 * of the first EOB in the buffer, since yy_c_buf_p will
1169 * already have been incremented past the NUL character
1170 * (since all states make transitions on EOB to the
1171 * end-of-buffer state). Contrast this with the test
1174 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1175 { /* This was really a NUL. */
1176 yy_state_type yy_next_state
;
1178 yy_c_buf_p
= yytext_ptr
+ yy_amount_of_matched_text
;
1180 yy_current_state
= yy_get_previous_state();
1182 /* Okay, we're now positioned to make the NUL
1183 * transition. We couldn't have
1184 * yy_get_previous_state() go ahead and do it
1185 * for us because it doesn't know how to deal
1186 * with the possibility of jamming (and we don't
1187 * want to build jamming into it because then it
1188 * will run more slowly).
1191 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
1193 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1195 if ( yy_next_state
)
1197 /* Consume the NUL. */
1198 yy_cp
= ++yy_c_buf_p
;
1199 yy_current_state
= yy_next_state
;
1206 goto yy_find_action
;
1210 else switch ( yy_get_next_buffer() )
1212 case EOB_ACT_END_OF_FILE
:
1214 yy_did_buffer_switch_on_eof
= 0;
1218 /* Note: because we've taken care in
1219 * yy_get_next_buffer() to have set up
1220 * yytext, we can now set up
1221 * yy_c_buf_p so that if some total
1222 * hoser (like flex itself) wants to
1223 * call the scanner after we return the
1224 * YY_NULL, it'll still work - another
1225 * YY_NULL will get returned.
1227 yy_c_buf_p
= yytext_ptr
+ YY_MORE_ADJ
;
1229 yy_act
= YY_STATE_EOF(YY_START
);
1235 if ( ! yy_did_buffer_switch_on_eof
)
1241 case EOB_ACT_CONTINUE_SCAN
:
1243 yytext_ptr
+ yy_amount_of_matched_text
;
1245 yy_current_state
= yy_get_previous_state();
1248 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1251 case EOB_ACT_LAST_MATCH
:
1253 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
1255 yy_current_state
= yy_get_previous_state();
1258 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1259 goto yy_find_action
;
1266 "fatal flex scanner internal error--no action found" );
1267 } /* end of action switch */
1268 } /* end of scanning one token */
1269 } /* end of yylex */
1272 /* yy_get_next_buffer - try to read in a new buffer
1274 * Returns a code representing an action:
1275 * EOB_ACT_LAST_MATCH -
1276 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1277 * EOB_ACT_END_OF_FILE - end of file
1280 static int yy_get_next_buffer()
1282 register char *dest
= yy_current_buffer
->yy_ch_buf
;
1283 register char *source
= yytext_ptr
;
1284 register int number_to_move
, i
;
1287 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
1289 "fatal flex scanner internal error--end of buffer missed" );
1291 if ( yy_current_buffer
->yy_fill_buffer
== 0 )
1292 { /* Don't try to fill the buffer, so this is an EOF. */
1293 if ( yy_c_buf_p
- yytext_ptr
- YY_MORE_ADJ
== 1 )
1295 /* We matched a single character, the EOB, so
1296 * treat this as a final EOF.
1298 return EOB_ACT_END_OF_FILE
;
1303 /* We matched some text prior to the EOB, first
1306 return EOB_ACT_LAST_MATCH
;
1310 /* Try to read more data. */
1312 /* First move last chars to start of buffer. */
1313 number_to_move
= (int) (yy_c_buf_p
- yytext_ptr
) - 1;
1315 for ( i
= 0; i
< number_to_move
; ++i
)
1316 *(dest
++) = *(source
++);
1318 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
1319 /* don't do the read, it's not guaranteed to return an EOF,
1322 yy_current_buffer
->yy_n_chars
= yy_n_chars
= 0;
1327 yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
1329 while ( num_to_read
<= 0 )
1330 { /* Not enough room in the buffer - grow it. */
1331 #ifdef YY_USES_REJECT
1333 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1336 /* just a shorter name for the current buffer */
1337 YY_BUFFER_STATE b
= yy_current_buffer
;
1339 int yy_c_buf_p_offset
=
1340 (int) (yy_c_buf_p
- b
->yy_ch_buf
);
1342 if ( b
->yy_is_our_buffer
)
1344 int new_size
= b
->yy_buf_size
* 2;
1346 if ( new_size
<= 0 )
1347 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
1349 b
->yy_buf_size
*= 2;
1351 b
->yy_ch_buf
= (char *)
1352 /* Include room in for 2 EOB chars. */
1353 yy_flex_realloc( (void *) b
->yy_ch_buf
,
1354 b
->yy_buf_size
+ 2 );
1357 /* Can't grow it, we don't own it. */
1360 if ( ! b
->yy_ch_buf
)
1362 "fatal error - scanner input buffer overflow" );
1364 yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
1366 num_to_read
= yy_current_buffer
->yy_buf_size
-
1371 if ( num_to_read
> YY_READ_BUF_SIZE
)
1372 num_to_read
= YY_READ_BUF_SIZE
;
1374 /* Read in more data. */
1375 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
1376 yy_n_chars
, num_to_read
);
1378 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
1381 if ( yy_n_chars
== 0 )
1383 if ( number_to_move
== YY_MORE_ADJ
)
1385 ret_val
= EOB_ACT_END_OF_FILE
;
1391 ret_val
= EOB_ACT_LAST_MATCH
;
1392 yy_current_buffer
->yy_buffer_status
=
1393 YY_BUFFER_EOF_PENDING
;
1398 ret_val
= EOB_ACT_CONTINUE_SCAN
;
1400 yy_n_chars
+= number_to_move
;
1401 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
1402 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
1404 yytext_ptr
= &yy_current_buffer
->yy_ch_buf
[0];
1410 /* yy_get_previous_state - get the state just before the EOB char was reached */
1412 static yy_state_type
yy_get_previous_state()
1414 register yy_state_type yy_current_state
;
1415 register char *yy_cp
;
1417 yy_current_state
= yy_start
;
1418 yy_current_state
+= YY_AT_BOL();
1420 for ( yy_cp
= yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
1422 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
1423 if ( yy_accept
[yy_current_state
] )
1425 yy_last_accepting_state
= yy_current_state
;
1426 yy_last_accepting_cpos
= yy_cp
;
1428 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1430 yy_current_state
= (int) yy_def
[yy_current_state
];
1431 if ( yy_current_state
>= 148 )
1432 yy_c
= yy_meta
[(unsigned int) yy_c
];
1434 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1437 return yy_current_state
;
1441 /* yy_try_NUL_trans - try to make a transition on the NUL character
1444 * next_state = yy_try_NUL_trans( current_state );
1447 #ifdef YY_USE_PROTOS
1448 static yy_state_type
yy_try_NUL_trans( yy_state_type yy_current_state
)
1450 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
1451 yy_state_type yy_current_state
;
1454 register int yy_is_jam
;
1455 register char *yy_cp
= yy_c_buf_p
;
1457 register YY_CHAR yy_c
= 1;
1458 if ( yy_accept
[yy_current_state
] )
1460 yy_last_accepting_state
= yy_current_state
;
1461 yy_last_accepting_cpos
= yy_cp
;
1463 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1465 yy_current_state
= (int) yy_def
[yy_current_state
];
1466 if ( yy_current_state
>= 148 )
1467 yy_c
= yy_meta
[(unsigned int) yy_c
];
1469 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1470 yy_is_jam
= (yy_current_state
== 147);
1472 return yy_is_jam
? 0 : yy_current_state
;
1477 #ifdef YY_USE_PROTOS
1478 static void yyunput( int c
, register char *yy_bp
)
1480 static void yyunput( c
, yy_bp
)
1482 register char *yy_bp
;
1485 register char *yy_cp
= yy_c_buf_p
;
1487 /* undo effects of setting up yytext */
1488 *yy_cp
= yy_hold_char
;
1490 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
1491 { /* need to shift things up to make room */
1492 /* +2 for EOB chars. */
1493 register int number_to_move
= yy_n_chars
+ 2;
1494 register char *dest
= &yy_current_buffer
->yy_ch_buf
[
1495 yy_current_buffer
->yy_buf_size
+ 2];
1496 register char *source
=
1497 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
1499 while ( source
> yy_current_buffer
->yy_ch_buf
)
1500 *--dest
= *--source
;
1502 yy_cp
+= (int) (dest
- source
);
1503 yy_bp
+= (int) (dest
- source
);
1504 yy_current_buffer
->yy_n_chars
=
1505 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
1507 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
1508 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1511 *--yy_cp
= (char) c
;
1515 yy_hold_char
= *yy_cp
;
1518 #endif /* ifndef YY_NO_UNPUT */
1522 static int yyinput()
1529 *yy_c_buf_p
= yy_hold_char
;
1531 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
1533 /* yy_c_buf_p now points to the character we want to return.
1534 * If this occurs *before* the EOB characters, then it's a
1535 * valid NUL; if not, then we've hit the end of the buffer.
1537 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1538 /* This was really a NUL. */
1542 { /* need more input */
1543 int offset
= yy_c_buf_p
- yytext_ptr
;
1546 switch ( yy_get_next_buffer() )
1548 case EOB_ACT_LAST_MATCH
:
1549 /* This happens because yy_g_n_b()
1550 * sees that we've accumulated a
1551 * token and flags that we need to
1552 * try matching the token before
1553 * proceeding. But for input(),
1554 * there's no matching to consider.
1555 * So convert the EOB_ACT_LAST_MATCH
1556 * to EOB_ACT_END_OF_FILE.
1559 /* Reset buffer status. */
1564 case EOB_ACT_END_OF_FILE
:
1569 if ( ! yy_did_buffer_switch_on_eof
)
1578 case EOB_ACT_CONTINUE_SCAN
:
1579 yy_c_buf_p
= yytext_ptr
+ offset
;
1585 c
= *(unsigned char *) yy_c_buf_p
; /* cast for 8-bit char's */
1586 *yy_c_buf_p
= '\0'; /* preserve yytext */
1587 yy_hold_char
= *++yy_c_buf_p
;
1589 yy_current_buffer
->yy_at_bol
= (c
== '\n');
1595 #ifdef YY_USE_PROTOS
1596 void yyrestart( FILE *input_file
)
1598 void yyrestart( input_file
)
1602 if ( ! yy_current_buffer
)
1603 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
1605 yy_init_buffer( yy_current_buffer
, input_file
);
1606 yy_load_buffer_state();
1610 #ifdef YY_USE_PROTOS
1611 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
1613 void yy_switch_to_buffer( new_buffer
)
1614 YY_BUFFER_STATE new_buffer
;
1617 if ( yy_current_buffer
== new_buffer
)
1620 if ( yy_current_buffer
)
1622 /* Flush out information for old buffer. */
1623 *yy_c_buf_p
= yy_hold_char
;
1624 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
1625 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
1628 yy_current_buffer
= new_buffer
;
1629 yy_load_buffer_state();
1631 /* We don't actually know whether we did this switch during
1632 * EOF (yywrap()) processing, but the only time this flag
1633 * is looked at is after yywrap() is called, so it's safe
1634 * to go ahead and always set it.
1636 yy_did_buffer_switch_on_eof
= 1;
1640 #ifdef YY_USE_PROTOS
1641 void yy_load_buffer_state( void )
1643 void yy_load_buffer_state()
1646 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1647 yytext_ptr
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
1648 yyin
= yy_current_buffer
->yy_input_file
;
1649 yy_hold_char
= *yy_c_buf_p
;
1653 #ifdef YY_USE_PROTOS
1654 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
1656 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
1663 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
1665 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1667 b
->yy_buf_size
= size
;
1669 /* yy_ch_buf has to be 2 characters longer than the size given because
1670 * we need to put in 2 end-of-buffer characters.
1672 b
->yy_ch_buf
= (char *) yy_flex_alloc( b
->yy_buf_size
+ 2 );
1673 if ( ! b
->yy_ch_buf
)
1674 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1676 b
->yy_is_our_buffer
= 1;
1678 yy_init_buffer( b
, file
);
1684 #ifdef YY_USE_PROTOS
1685 void yy_delete_buffer( YY_BUFFER_STATE b
)
1687 void yy_delete_buffer( b
)
1694 if ( b
== yy_current_buffer
)
1695 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
1697 if ( b
->yy_is_our_buffer
)
1698 yy_flex_free( (void *) b
->yy_ch_buf
);
1700 yy_flex_free( (void *) b
);
1704 #ifndef YY_ALWAYS_INTERACTIVE
1705 #ifndef YY_NEVER_INTERACTIVE
1706 extern int isatty
YY_PROTO(( int ));
1710 #ifdef YY_USE_PROTOS
1711 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
1713 void yy_init_buffer( b
, file
)
1720 yy_flush_buffer( b
);
1722 b
->yy_input_file
= file
;
1723 b
->yy_fill_buffer
= 1;
1725 #if YY_ALWAYS_INTERACTIVE
1726 b
->yy_is_interactive
= 1;
1728 #if YY_NEVER_INTERACTIVE
1729 b
->yy_is_interactive
= 0;
1731 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
1737 #ifdef YY_USE_PROTOS
1738 void yy_flush_buffer( YY_BUFFER_STATE b
)
1740 void yy_flush_buffer( b
)
1750 /* We always need two end-of-buffer characters. The first causes
1751 * a transition to the end-of-buffer state. The second causes
1752 * a jam in that state.
1754 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
1755 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1757 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
1760 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1762 if ( b
== yy_current_buffer
)
1763 yy_load_buffer_state();
1767 #ifndef YY_NO_SCAN_BUFFER
1768 #ifdef YY_USE_PROTOS
1769 YY_BUFFER_STATE
yy_scan_buffer( char *base
, yy_size_t size
)
1771 YY_BUFFER_STATE
yy_scan_buffer( base
, size
)
1779 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
1780 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
1781 /* They forgot to leave room for the EOB's. */
1784 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
1786 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1788 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
1789 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
1790 b
->yy_is_our_buffer
= 0;
1791 b
->yy_input_file
= 0;
1792 b
->yy_n_chars
= b
->yy_buf_size
;
1793 b
->yy_is_interactive
= 0;
1795 b
->yy_fill_buffer
= 0;
1796 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1798 yy_switch_to_buffer( b
);
1805 #ifndef YY_NO_SCAN_STRING
1806 #ifdef YY_USE_PROTOS
1807 YY_BUFFER_STATE
yy_scan_string( yyconst
char *yy_str
)
1809 YY_BUFFER_STATE
yy_scan_string( yy_str
)
1810 yyconst
char *yy_str
;
1814 for ( len
= 0; yy_str
[len
]; ++len
)
1817 return yy_scan_bytes( yy_str
, len
);
1822 #ifndef YY_NO_SCAN_BYTES
1823 #ifdef YY_USE_PROTOS
1824 YY_BUFFER_STATE
yy_scan_bytes( yyconst
char *bytes
, int len
)
1826 YY_BUFFER_STATE
yy_scan_bytes( bytes
, len
)
1827 yyconst
char *bytes
;
1836 /* Get memory for full buffer, including space for trailing EOB's. */
1838 buf
= (char *) yy_flex_alloc( n
);
1840 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1842 for ( i
= 0; i
< len
; ++i
)
1845 buf
[len
] = buf
[len
+1] = YY_END_OF_BUFFER_CHAR
;
1847 b
= yy_scan_buffer( buf
, n
);
1849 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1851 /* It's okay to grow etc. this buffer, and we should throw it
1852 * away when we're done.
1854 b
->yy_is_our_buffer
= 1;
1861 #ifndef YY_NO_PUSH_STATE
1862 #ifdef YY_USE_PROTOS
1863 static void yy_push_state( int new_state
)
1865 static void yy_push_state( new_state
)
1869 if ( yy_start_stack_ptr
>= yy_start_stack_depth
)
1873 yy_start_stack_depth
+= YY_START_STACK_INCR
;
1874 new_size
= yy_start_stack_depth
* sizeof( int );
1876 if ( ! yy_start_stack
)
1877 yy_start_stack
= (int *) yy_flex_alloc( new_size
);
1880 yy_start_stack
= (int *) yy_flex_realloc(
1881 (void *) yy_start_stack
, new_size
);
1883 if ( ! yy_start_stack
)
1885 "out of memory expanding start-condition stack" );
1888 yy_start_stack
[yy_start_stack_ptr
++] = YY_START
;
1895 #ifndef YY_NO_POP_STATE
1896 static void yy_pop_state()
1898 if ( --yy_start_stack_ptr
< 0 )
1899 YY_FATAL_ERROR( "start-condition stack underflow" );
1901 BEGIN(yy_start_stack
[yy_start_stack_ptr
]);
1906 #ifndef YY_NO_TOP_STATE
1907 static int yy_top_state()
1909 return yy_start_stack
[yy_start_stack_ptr
- 1];
1913 #ifndef YY_EXIT_FAILURE
1914 #define YY_EXIT_FAILURE 2
1917 #ifdef YY_USE_PROTOS
1918 static void yy_fatal_error( yyconst
char msg
[] )
1920 static void yy_fatal_error( msg
)
1924 (void) fprintf( stderr
, "%s\n", msg
);
1925 exit( YY_EXIT_FAILURE
);
1930 /* Redefine yyless() so it works in section 3 code. */
1936 /* Undo effects of setting up yytext. */ \
1937 yytext[yyleng] = yy_hold_char; \
1938 yy_c_buf_p = yytext + n; \
1939 yy_hold_char = *yy_c_buf_p; \
1940 *yy_c_buf_p = '\0'; \
1946 /* Internal utility routines. */
1949 #ifdef YY_USE_PROTOS
1950 static void yy_flex_strncpy( char *s1
, yyconst
char *s2
, int n
)
1952 static void yy_flex_strncpy( s1
, s2
, n
)
1959 for ( i
= 0; i
< n
; ++i
)
1964 #ifdef YY_NEED_STRLEN
1965 #ifdef YY_USE_PROTOS
1966 static int yy_flex_strlen( yyconst
char *s
)
1968 static int yy_flex_strlen( s
)
1973 for ( n
= 0; s
[n
]; ++n
)
1981 #ifdef YY_USE_PROTOS
1982 static void *yy_flex_alloc( yy_size_t size
)
1984 static void *yy_flex_alloc( size
)
1988 return (void *) malloc( size
);
1991 #ifdef YY_USE_PROTOS
1992 static void *yy_flex_realloc( void *ptr
, yy_size_t size
)
1994 static void *yy_flex_realloc( ptr
, size
)
1999 /* The cast to (char *) in the following accommodates both
2000 * implementations that use char* generic pointers, and those
2001 * that use void* generic pointers. It works with the latter
2002 * because both ANSI C and C++ allow castless assignment from
2003 * any pointer type to void*, and deal with argument conversions
2004 * as though doing an assignment.
2006 return (void *) realloc( (char *) ptr
, size
);
2009 #ifdef YY_USE_PROTOS
2010 static void yy_flex_free( void *ptr
)
2012 static void yy_flex_free( ptr
)
2026 #line 209 "parser.l"
2030 int parser_wrap(void)
2041 /* This table MUST be alphabetically sorted on the kw field */
2042 static const struct keyword keywords
[] = {
2046 {"__cdecl", tCDECL
},
2047 {"__fastcall", tFASTCALL
},
2048 {"__int3264", tINT3264
},
2049 {"__int64", tINT64
},
2050 {"__pascal", tPASCAL
},
2051 {"__stdcall", tSTDCALL
},
2053 {"_fastcall", tFASTCALL
},
2054 {"_pascal", tPASCAL
},
2055 {"_stdcall", tSTDCALL
},
2056 {"boolean", tBOOLEAN
},
2061 {"coclass", tCOCLASS
},
2063 {"cpp_quote", tCPPQUOTE
},
2064 {"default", tDEFAULT
},
2065 {"dispinterface", tDISPINTERFACE
},
2066 {"double", tDOUBLE
},
2068 {"error_status_t", tERRORSTATUST
},
2069 {"extern", tEXTERN
},
2071 {"handle_t", tHANDLET
},
2073 {"import", tIMPORT
},
2074 {"importlib", tIMPORTLIB
},
2075 {"inline", tINLINE
},
2077 {"interface", tINTERFACE
},
2078 {"library", tLIBRARY
},
2080 {"methods", tMETHODS
},
2081 {"module", tMODULE
},
2082 {"pascal", tPASCAL
},
2083 {"properties", tPROPERTIES
},
2084 {"register", tREGISTER
},
2086 {"signed", tSIGNED
},
2087 {"sizeof", tSIZEOF
},
2089 {"static", tSTATIC
},
2090 {"stdcall", tSTDCALL
},
2091 {"struct", tSTRUCT
},
2092 {"switch", tSWITCH
},
2093 {"typedef", tTYPEDEF
},
2095 {"unsigned", tUNSIGNED
},
2097 {"wchar_t", tWCHAR
},
2099 #define NKEYWORDS (sizeof(keywords)/sizeof(keywords[0]))
2101 /* keywords only recognized in attribute lists
2102 * This table MUST be alphabetically sorted on the kw field
2104 static const struct keyword attr_keywords
[] =
2106 {"aggregatable", tAGGREGATABLE
},
2107 {"allocate", tALLOCATE
},
2108 {"annotation", tANNOTATION
},
2109 {"appobject", tAPPOBJECT
},
2111 {"async_uuid", tASYNCUUID
},
2112 {"auto_handle", tAUTOHANDLE
},
2113 {"bindable", tBINDABLE
},
2114 {"broadcast", tBROADCAST
},
2115 {"byte_count", tBYTECOUNT
},
2116 {"call_as", tCALLAS
},
2117 {"callback", tCALLBACK
},
2119 {"comm_status", tCOMMSTATUS
},
2120 {"context_handle", tCONTEXTHANDLE
},
2121 {"context_handle_noserialize", tCONTEXTHANDLENOSERIALIZE
},
2122 {"context_handle_serialize", tCONTEXTHANDLENOSERIALIZE
},
2123 {"control", tCONTROL
},
2124 {"defaultcollelem", tDEFAULTCOLLELEM
},
2125 {"defaultvalue", tDEFAULTVALUE
},
2126 {"defaultvtable", tDEFAULTVTABLE
},
2127 {"displaybind", tDISPLAYBIND
},
2128 {"dllname", tDLLNAME
},
2130 {"endpoint", tENDPOINT
},
2132 {"explicit_handle", tEXPLICITHANDLE
},
2133 {"handle", tHANDLE
},
2134 {"helpcontext", tHELPCONTEXT
},
2135 {"helpfile", tHELPFILE
},
2136 {"helpstring", tHELPSTRING
},
2137 {"helpstringcontext", tHELPSTRINGCONTEXT
},
2138 {"helpstringdll", tHELPSTRINGDLL
},
2139 {"hidden", tHIDDEN
},
2141 {"idempotent", tIDEMPOTENT
},
2143 {"immediatebind", tIMMEDIATEBIND
},
2144 {"implicit_handle", tIMPLICITHANDLE
},
2146 {"in_line", tIN_LINE
},
2147 {"input_sync", tINPUTSYNC
},
2149 {"length_is", tLENGTHIS
},
2151 {"nonbrowsable", tNONBROWSABLE
},
2152 {"noncreatable", tNONCREATABLE
},
2153 {"nonextensible", tNONEXTENSIBLE
},
2154 {"object", tOBJECT
},
2156 {"oleautomation", tOLEAUTOMATION
},
2157 {"optional", tOPTIONAL
},
2159 {"pointer_default", tPOINTERDEFAULT
},
2160 {"propget", tPROPGET
},
2161 {"propput", tPROPPUT
},
2162 {"propputref", tPROPPUTREF
},
2164 {"public", tPUBLIC
},
2166 {"readonly", tREADONLY
},
2168 {"requestedit", tREQUESTEDIT
},
2169 {"restricted", tRESTRICTED
},
2170 {"retval", tRETVAL
},
2171 {"size_is", tSIZEIS
},
2172 {"source", tSOURCE
},
2173 {"strict_context_handle", tSTRICTCONTEXTHANDLE
},
2174 {"string", tSTRING
},
2175 {"switch_is", tSWITCHIS
},
2176 {"switch_type", tSWITCHTYPE
},
2177 {"transmit_as", tTRANSMITAS
},
2178 {"unique", tUNIQUE
},
2180 {"v1_enum", tV1ENUM
},
2181 {"vararg", tVARARG
},
2182 {"version", tVERSION
},
2183 {"wire_marshal", tWIREMARSHAL
},
2187 #define KWP(p) ((const struct keyword *)(p))
2189 static int kw_cmp_func(const void *s1
, const void *s2
)
2191 return strcmp(KWP(s1
)->kw
, KWP(s2
)->kw
);
2194 static int kw_token(const char *kw
)
2196 struct keyword key
, *kwp
;
2198 kwp
= bsearch(&key
, keywords
, NKEYWORDS
, sizeof(keywords
[0]), kw_cmp_func
);
2200 parser_lval
.str
= xstrdup(kwp
->kw
);
2203 parser_lval
.str
= xstrdup(kw
);
2204 return is_type(kw
) ? aKNOWNTYPE
: aIDENTIFIER
;
2207 static int attr_token(const char *kw
)
2209 struct keyword key
, *kwp
;
2211 kwp
= bsearch(&key
, attr_keywords
, sizeof(attr_keywords
)/sizeof(attr_keywords
[0]),
2212 sizeof(attr_keywords
[0]), kw_cmp_func
);
2214 parser_lval
.str
= xstrdup(kwp
->kw
);
2217 return kw_token(kw
);
2220 static void addcchar(char c
)
2222 if(cbufidx
>= cbufalloc
)
2225 cbuffer
= xrealloc(cbuffer
, cbufalloc
* sizeof(cbuffer
[0]));
2226 if(cbufalloc
> 65536)
2227 parser_warning("Reallocating string buffer larger than 64kB\n");
2229 cbuffer
[cbufidx
++] = c
;
2232 static char *get_buffered_cstring(void)
2235 return xstrdup(cbuffer
);
2238 void pop_import(void)
2240 int ptr
= import_stack_ptr
-1;
2243 yy_delete_buffer( YY_CURRENT_BUFFER
);
2244 yy_switch_to_buffer( import_stack
[ptr
].state
);
2249 temp_name
= import_stack
[ptr
].temp_name
;
2250 input_name
= import_stack
[ptr
].input_name
;
2251 line_number
= import_stack
[ptr
].line_number
;
2257 struct imports
*next
;
2260 int do_import(char *fname
)
2264 struct imports
*import
;
2265 int ptr
= import_stack_ptr
;
2268 import
= first_import
;
2269 while (import
&& strcmp(import
->name
, fname
))
2270 import
= import
->next
;
2271 if (import
) return 0; /* already imported */
2273 import
= xmalloc(sizeof(struct imports
));
2274 import
->name
= xstrdup(fname
);
2275 import
->next
= first_import
;
2276 first_import
= import
;
2278 /* don't search for a file name with a path in the include directories,
2279 * for compatibility with MIDL */
2280 if (strchr( fname
, '/' ) || strchr( fname
, '\\' ))
2281 path
= strdup( fname
);
2282 else if (!(path
= wpp_find_include( fname
, input_name
)))
2283 error_loc("Unable to open include file %s\n", fname
);
2285 import_stack
[ptr
].temp_name
= temp_name
;
2286 import_stack
[ptr
].input_name
= input_name
;
2287 import_stack
[ptr
].line_number
= line_number
;
2292 ret
= wpp_parse_temp( path
, NULL
, &temp_name
);
2295 if((f
= fopen(temp_name
, "r")) == NULL
)
2296 error_loc("Unable to open %s\n", temp_name
);
2298 import_stack
[ptr
].state
= YY_CURRENT_BUFFER
;
2299 yy_switch_to_buffer(yy_create_buffer(f
, YY_BUF_SIZE
));
2303 void abort_import(void)
2307 for (ptr
=0; ptr
<import_stack_ptr
; ptr
++)
2308 unlink(import_stack
[ptr
].temp_name
);