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 23
305 #define YY_END_OF_BUFFER 24
306 static yyconst
short int yy_accept
[113] =
308 0, 0, 0, 0, 0, 0, 2, 2, 24, 22,
309 19, 18, 3, 14, 14, 22, 22, 17, 17, 9,
310 19, 1, 8, 23, 4, 8, 14, 14, 11, 11,
311 10, 2, 0, 14, 0, 20, 21, 17, 17, 0,
312 1, 1, 7, 6, 5, 14, 0, 11, 11, 2,
313 15, 13, 17, 14, 0, 11, 0, 17, 14, 0,
314 11, 0, 15, 17, 14, 0, 11, 17, 14, 0,
315 11, 17, 14, 0, 11, 17, 14, 0, 11, 17,
316 0, 14, 0, 16, 0, 0, 0, 0, 0, 0,
317 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
319 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
323 static yyconst
int yy_ec
[256] =
325 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
326 1, 2, 2, 1, 1, 1, 1, 1, 1, 1,
327 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
328 1, 2, 1, 4, 5, 1, 1, 1, 1, 6,
329 1, 1, 7, 1, 8, 9, 1, 10, 11, 11,
330 11, 11, 11, 11, 11, 11, 11, 1, 1, 12,
331 1, 13, 1, 1, 14, 15, 15, 15, 16, 17,
332 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
333 18, 19, 20, 18, 18, 18, 18, 18, 21, 18,
334 22, 23, 24, 1, 18, 1, 15, 15, 15, 15,
336 25, 15, 18, 18, 18, 18, 18, 18, 18, 18,
337 18, 18, 18, 18, 18, 18, 18, 18, 18, 26,
338 18, 18, 1, 1, 1, 1, 1, 1, 1, 1,
339 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
340 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
341 1, 1, 1, 1, 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,
347 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
348 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
349 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,
355 static yyconst
int yy_meta
[27] =
357 1, 1, 2, 1, 1, 1, 1, 1, 1, 3,
358 3, 1, 1, 3, 3, 3, 3, 4, 4, 4,
362 static yyconst
short int yy_base
[151] =
364 0, 25, 25, 28, 42, 31, 265, 264, 266, 269,
365 269, 269, 269, 60, 28, 253, 251, 0, 249, 269,
366 38, 260, 269, 269, 269, 31, 39, 62, 79, 0,
367 269, 0, 31, 35, 0, 269, 269, 0, 244, 72,
368 258, 257, 269, 269, 269, 65, 0, 96, 0, 0,
369 113, 0, 242, 68, 0, 129, 149, 240, 70, 0,
370 151, 72, 74, 229, 81, 0, 168, 224, 91, 0,
371 185, 212, 98, 0, 202, 204, 117, 216, 207, 124,
372 0, 108, 129, 269, 0, 0, 0, 206, 0, 0,
373 0, 0, 201, 0, 0, 0, 0, 200, 0, 0,
375 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
376 269, 269, 228, 233, 236, 241, 244, 247, 252, 204,
377 195, 194, 189, 188, 187, 178, 177, 172, 171, 170,
378 161, 160, 155, 150, 149, 148, 139, 138, 134, 133,
379 131, 130, 129, 117, 100, 84, 61, 52, 44, 31
382 static yyconst
short int yy_def
[151] =
384 112, 1, 113, 113, 1, 5, 114, 114, 112, 112,
385 112, 112, 112, 112, 112, 112, 112, 115, 115, 112,
386 112, 112, 112, 112, 112, 116, 117, 117, 112, 118,
387 112, 119, 112, 112, 120, 112, 112, 115, 115, 112,
388 112, 112, 112, 112, 112, 121, 121, 112, 118, 119,
389 112, 120, 115, 122, 122, 112, 112, 115, 123, 123,
390 112, 112, 51, 115, 124, 124, 112, 115, 125, 125,
391 112, 115, 126, 126, 112, 115, 112, 112, 118, 115,
392 127, 112, 112, 112, 128, 129, 130, 112, 131, 132,
393 133, 134, 112, 135, 136, 137, 138, 112, 139, 140,
395 141, 142, 143, 144, 145, 146, 147, 148, 149, 150,
396 112, 0, 112, 112, 112, 112, 112, 112, 112, 112,
397 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
398 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
399 112, 112, 112, 112, 112, 112, 112, 112, 112, 112
402 static yyconst
short int yy_nxt
[296] =
404 10, 11, 12, 13, 10, 10, 10, 10, 10, 14,
405 15, 16, 17, 18, 18, 18, 18, 18, 18, 19,
406 18, 20, 10, 10, 18, 18, 21, 24, 25, 22,
407 24, 25, 21, 111, 44, 22, 33, 34, 34, 40,
408 51, 51, 41, 33, 34, 34, 110, 26, 46, 46,
409 26, 27, 28, 45, 109, 29, 29, 29, 29, 30,
410 30, 30, 30, 108, 35, 31, 29, 30, 33, 34,
411 34, 46, 46, 40, 54, 54, 41, 59, 59, 65,
412 65, 63, 63, 63, 63, 35, 107, 112, 48, 48,
413 69, 69, 48, 48, 48, 48, 49, 49, 49, 49,
415 73, 73, 106, 48, 49, 56, 56, 77, 77, 56,
416 56, 56, 56, 49, 49, 49, 49, 82, 82, 105,
417 56, 49, 51, 51, 81, 83, 82, 82, 57, 84,
418 83, 104, 103, 102, 84, 101, 100, 57, 61, 61,
419 98, 97, 61, 61, 61, 61, 49, 49, 49, 49,
420 96, 95, 93, 61, 49, 62, 62, 92, 63, 63,
421 67, 67, 91, 90, 67, 67, 67, 67, 49, 49,
422 49, 49, 88, 87, 86, 67, 49, 71, 71, 85,
423 78, 71, 71, 71, 71, 49, 49, 49, 49, 74,
424 70, 66, 71, 49, 75, 75, 60, 55, 75, 75,
426 75, 75, 49, 49, 49, 49, 52, 99, 94, 75,
427 49, 79, 79, 89, 81, 79, 79, 79, 79, 49,
428 49, 49, 49, 81, 80, 76, 79, 49, 23, 23,
429 23, 23, 23, 32, 32, 32, 32, 32, 38, 38,
430 38, 43, 72, 43, 43, 43, 47, 68, 47, 49,
431 49, 49, 50, 64, 50, 50, 50, 58, 42, 42,
432 53, 42, 39, 37, 36, 112, 24, 24, 9, 112,
433 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
434 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
435 112, 112, 112, 112, 112
439 static yyconst
short int yy_chk
[296] =
441 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
442 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
443 1, 1, 1, 1, 1, 1, 2, 3, 3, 2,
444 4, 4, 6, 150, 26, 6, 15, 15, 15, 21,
445 33, 33, 21, 34, 34, 34, 149, 3, 27, 27,
446 4, 5, 5, 26, 148, 5, 5, 5, 5, 5,
447 5, 5, 5, 147, 27, 5, 5, 5, 14, 14,
448 14, 28, 28, 40, 46, 46, 40, 54, 54, 59,
449 59, 62, 62, 63, 63, 14, 146, 28, 29, 29,
450 65, 65, 29, 29, 29, 29, 29, 29, 29, 29,
452 69, 69, 145, 29, 29, 48, 48, 73, 73, 48,
453 48, 48, 48, 48, 48, 48, 48, 82, 82, 144,
454 48, 48, 51, 51, 77, 80, 77, 77, 51, 80,
455 83, 143, 142, 141, 83, 140, 139, 51, 56, 56,
456 138, 137, 56, 56, 56, 56, 56, 56, 56, 56,
457 136, 135, 134, 56, 56, 57, 57, 133, 57, 57,
458 61, 61, 132, 131, 61, 61, 61, 61, 61, 61,
459 61, 61, 130, 129, 128, 61, 61, 67, 67, 127,
460 126, 67, 67, 67, 67, 67, 67, 67, 67, 125,
461 124, 123, 67, 67, 71, 71, 122, 121, 71, 71,
463 71, 71, 71, 71, 71, 71, 120, 98, 93, 71,
464 71, 75, 75, 88, 79, 75, 75, 75, 75, 75,
465 75, 75, 75, 78, 76, 72, 75, 75, 113, 113,
466 113, 113, 113, 114, 114, 114, 114, 114, 115, 115,
467 115, 116, 68, 116, 116, 116, 117, 64, 117, 118,
468 118, 118, 119, 58, 119, 119, 119, 53, 42, 41,
469 39, 22, 19, 17, 16, 9, 8, 7, 112, 112,
470 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
471 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
472 112, 112, 112, 112, 112
476 static yy_state_type yy_last_accepting_state
;
477 static char *yy_last_accepting_cpos
;
479 /* The intent behind this definition is that it'll catch
480 * any uses of REJECT which flex missed.
482 #define REJECT reject_used_but_not_detected
483 #define yymore() yymore_used_but_not_detected
484 #define YY_MORE_ADJ 0
485 #define YY_RESTORE_YY_MORE_OFFSET
492 * Copyright 2002 Ove Kaaven
494 * This library is free software; you can redistribute it and/or
495 * modify it under the terms of the GNU Lesser General Public
496 * License as published by the Free Software Foundation; either
497 * version 2.1 of the License, or (at your option) any later version.
499 * This library is distributed in the hope that it will be useful,
500 * but WITHOUT ANY WARRANTY; without even the implied warranty of
501 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
502 * Lesser General Public License for more details.
504 * You should have received a copy of the GNU Lesser General Public
505 * License along with this library; if not, write to the Free Software
506 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
508 #define YY_STACK_USED 1
509 #define YY_NO_UNPUT 1
510 #define YY_NO_TOP_STATE 1
511 #define YY_NEVER_INTERACTIVE 1
531 #define YY_NO_UNISTD_H
537 #include "wine/wpp.h"
539 #include "parser.tab.h"
541 extern char *temp_name
;
543 static void addcchar(char c
);
544 static char *get_buffered_cstring(void);
546 static char *cbuffer
;
548 static int cbufalloc
= 0;
550 static int kw_token(const char *kw
);
551 static int attr_token(const char *kw
);
553 #define MAX_IMPORT_DEPTH 10
555 YY_BUFFER_STATE state
;
559 } import_stack
[MAX_IMPORT_DEPTH
];
560 int import_stack_ptr
= 0;
562 static void pop_import(void);
564 UUID
*parse_uuid(const char *u
)
566 UUID
* uuid
= xmalloc(sizeof(UUID
));
568 /* it would be nice to use UuidFromStringA */
569 uuid
->Data1
= strtoul(u
, NULL
, 16);
570 uuid
->Data2
= strtoul(u
+9, NULL
, 16);
571 uuid
->Data3
= strtoul(u
+14, NULL
, 16);
573 memcpy(b
, u
+19, 2); uuid
->Data4
[0] = strtoul(b
, NULL
, 16);
574 memcpy(b
, u
+21, 2); uuid
->Data4
[1] = strtoul(b
, NULL
, 16);
575 memcpy(b
, u
+24, 2); uuid
->Data4
[2] = strtoul(b
, NULL
, 16);
576 memcpy(b
, u
+26, 2); uuid
->Data4
[3] = strtoul(b
, NULL
, 16);
577 memcpy(b
, u
+28, 2); uuid
->Data4
[4] = strtoul(b
, NULL
, 16);
578 memcpy(b
, u
+30, 2); uuid
->Data4
[5] = strtoul(b
, NULL
, 16);
579 memcpy(b
, u
+32, 2); uuid
->Data4
[6] = strtoul(b
, NULL
, 16);
580 memcpy(b
, u
+34, 2); uuid
->Data4
[7] = strtoul(b
, NULL
, 16);
585 **************************************************************************
586 * The flexer starts here
587 **************************************************************************
589 #line 590 "parser.yy.c"
591 /* Macros after this point can all be overridden by user definitions in
595 #ifndef YY_SKIP_YYWRAP
597 extern "C" int yywrap
YY_PROTO(( void ));
599 extern int yywrap
YY_PROTO(( void ));
604 static void yyunput
YY_PROTO(( int c
, char *buf_ptr
));
608 static void yy_flex_strncpy
YY_PROTO(( char *, yyconst
char *, int ));
611 #ifdef YY_NEED_STRLEN
612 static int yy_flex_strlen
YY_PROTO(( yyconst
char * ));
617 static int yyinput
YY_PROTO(( void ));
619 static int input
YY_PROTO(( void ));
624 static int yy_start_stack_ptr
= 0;
625 static int yy_start_stack_depth
= 0;
626 static int *yy_start_stack
= 0;
627 #ifndef YY_NO_PUSH_STATE
628 static void yy_push_state
YY_PROTO(( int new_state
));
630 #ifndef YY_NO_POP_STATE
631 static void yy_pop_state
YY_PROTO(( void ));
633 #ifndef YY_NO_TOP_STATE
634 static int yy_top_state
YY_PROTO(( void ));
638 #define YY_NO_PUSH_STATE 1
639 #define YY_NO_POP_STATE 1
640 #define YY_NO_TOP_STATE 1
643 #ifdef YY_MALLOC_DECL
651 /* Just try to get by without declaring the routines. This will fail
652 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
653 * or sizeof(void*) != sizeof(int).
658 /* Amount of stuff to slurp up with each read. */
659 #ifndef YY_READ_BUF_SIZE
660 #define YY_READ_BUF_SIZE 8192
663 /* Copy whatever the last rule matched to the standard output. */
666 /* This used to be an fputs(), but since the string might contain NUL's,
667 * we now use fwrite().
669 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
672 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
673 * is returned in "result".
676 #define YY_INPUT(buf,result,max_size) \
677 if ( yy_current_buffer->yy_is_interactive ) \
680 for ( n = 0; n < max_size && \
681 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
684 buf[n++] = (char) c; \
685 if ( c == EOF && ferror( yyin ) ) \
686 YY_FATAL_ERROR( "input in flex scanner failed" ); \
689 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
690 && ferror( yyin ) ) \
691 YY_FATAL_ERROR( "input in flex scanner failed" );
694 /* No semi-colon after return; correct usage is to write "yyterminate();" -
695 * we don't want an extra ';' after the "return" because that will cause
696 * some compilers to complain about unreachable statements.
699 #define yyterminate() return YY_NULL
702 /* Number of entries by which start-condition stack grows. */
703 #ifndef YY_START_STACK_INCR
704 #define YY_START_STACK_INCR 25
707 /* Report a fatal error. */
708 #ifndef YY_FATAL_ERROR
709 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
712 /* Default declaration of generated scanner - a define so the user can
713 * easily add parameters.
716 #define YY_DECL int yylex YY_PROTO(( void ))
719 /* Code executed at the beginning of each rule, after yytext and yyleng
722 #ifndef YY_USER_ACTION
723 #define YY_USER_ACTION
726 /* Code executed at the end of each rule. */
728 #define YY_BREAK break;
731 #define YY_RULE_SETUP \
733 yy_current_buffer->yy_at_bol = \
734 (yytext[yyleng - 1] == '\n'); \
739 register yy_state_type yy_current_state
;
740 register char *yy_cp
, *yy_bp
;
745 #line 746 "parser.yy.c"
756 yy_start
= 1; /* first start state */
764 if ( ! yy_current_buffer
)
766 yy_create_buffer( yyin
, YY_BUF_SIZE
);
768 yy_load_buffer_state();
771 while ( 1 ) /* loops until end-of-file is reached */
775 /* Support of yytext. */
776 *yy_cp
= yy_hold_char
;
778 /* yy_bp points to the position in yy_ch_buf of the start of
783 yy_current_state
= yy_start
;
784 yy_current_state
+= YY_AT_BOL();
788 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
789 if ( yy_accept
[yy_current_state
] )
791 yy_last_accepting_state
= yy_current_state
;
792 yy_last_accepting_cpos
= yy_cp
;
794 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
796 yy_current_state
= (int) yy_def
[yy_current_state
];
797 if ( yy_current_state
>= 113 )
798 yy_c
= yy_meta
[(unsigned int) yy_c
];
800 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
803 while ( yy_base
[yy_current_state
] != 269 );
806 yy_act
= yy_accept
[yy_current_state
];
808 { /* have to back up */
809 yy_cp
= yy_last_accepting_cpos
;
810 yy_current_state
= yy_last_accepting_state
;
811 yy_act
= yy_accept
[yy_current_state
];
817 do_action
: /* This label is used only to access EOF actions. */
821 { /* beginning of action switch */
822 case 0: /* must back up */
823 /* undo the effects of YY_DO_BEFORE_ACTION */
824 *yy_cp
= yy_hold_char
;
825 yy_cp
= yy_last_accepting_cpos
;
826 yy_current_state
= yy_last_accepting_state
;
832 yy_push_state(PP_LINE
);
841 lineno
= (int)strtol(yytext
, &cptr
, 10);
843 error_loc("Malformed '#...' line-directive; invalid linenumber\n");
844 fname
= strchr(cptr
, '"');
846 error_loc("Malformed '#...' line-directive; missing filename\n");
848 cptr
= strchr(fname
, '"');
850 error_loc("Malformed '#...' line-directive; missing terminating \"\n");
852 line_number
= lineno
- 1; /* We didn't read the newline */
854 input_name
= xstrdup(fname
);
860 yy_push_state(QUOTE
); cbufidx
= 0;
867 parser_lval
.str
= get_buffered_cstring();
881 addcchar('\\'); addcchar(yytext
[1]);
891 yy_push_state(ATTR
); return '[';
896 yy_pop_state(); return ']';
901 return attr_token(yytext
);
907 parser_lval
.uuid
= parse_uuid(yytext
);
915 parser_lval
.num
= strtoul(yytext
, NULL
, 0);
923 parser_lval
.num
= strtoul(yytext
, NULL
, 0);
931 parser_lval
.dbl
= strtod(yytext
, NULL
);
936 *yy_cp
= yy_hold_char
; /* undo effects of setting up yytext */
937 yy_c_buf_p
= yy_cp
-= 1;
938 YY_DO_BEFORE_ACTION
; /* set up yytext again */
946 return kw_token(yytext
);
973 case YY_STATE_EOF(INITIAL
):
974 case YY_STATE_EOF(QUOTE
):
975 case YY_STATE_EOF(ATTR
):
976 case YY_STATE_EOF(PP_LINE
):
979 if (import_stack_ptr
) {
991 #line 992 "parser.yy.c"
993 case YY_END_OF_BUFFER
:
995 /* Amount of text matched not including the EOB char. */
996 int yy_amount_of_matched_text
= (int) (yy_cp
- yytext_ptr
) - 1;
998 /* Undo the effects of YY_DO_BEFORE_ACTION. */
999 *yy_cp
= yy_hold_char
;
1000 YY_RESTORE_YY_MORE_OFFSET
1002 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_NEW
)
1004 /* We're scanning a new file or input source. It's
1005 * possible that this happened because the user
1006 * just pointed yyin at a new source and called
1007 * yylex(). If so, then we have to assure
1008 * consistency between yy_current_buffer and our
1009 * globals. Here is the right place to do so, because
1010 * this is the first action (other than possibly a
1011 * back-up) that will match for the new input source.
1013 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1014 yy_current_buffer
->yy_input_file
= yyin
;
1015 yy_current_buffer
->yy_buffer_status
= YY_BUFFER_NORMAL
;
1018 /* Note that here we test for yy_c_buf_p "<=" to the position
1019 * of the first EOB in the buffer, since yy_c_buf_p will
1020 * already have been incremented past the NUL character
1021 * (since all states make transitions on EOB to the
1022 * end-of-buffer state). Contrast this with the test
1025 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1026 { /* This was really a NUL. */
1027 yy_state_type yy_next_state
;
1029 yy_c_buf_p
= yytext_ptr
+ yy_amount_of_matched_text
;
1031 yy_current_state
= yy_get_previous_state();
1033 /* Okay, we're now positioned to make the NUL
1034 * transition. We couldn't have
1035 * yy_get_previous_state() go ahead and do it
1036 * for us because it doesn't know how to deal
1037 * with the possibility of jamming (and we don't
1038 * want to build jamming into it because then it
1039 * will run more slowly).
1042 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
1044 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1046 if ( yy_next_state
)
1048 /* Consume the NUL. */
1049 yy_cp
= ++yy_c_buf_p
;
1050 yy_current_state
= yy_next_state
;
1057 goto yy_find_action
;
1061 else switch ( yy_get_next_buffer() )
1063 case EOB_ACT_END_OF_FILE
:
1065 yy_did_buffer_switch_on_eof
= 0;
1069 /* Note: because we've taken care in
1070 * yy_get_next_buffer() to have set up
1071 * yytext, we can now set up
1072 * yy_c_buf_p so that if some total
1073 * hoser (like flex itself) wants to
1074 * call the scanner after we return the
1075 * YY_NULL, it'll still work - another
1076 * YY_NULL will get returned.
1078 yy_c_buf_p
= yytext_ptr
+ YY_MORE_ADJ
;
1080 yy_act
= YY_STATE_EOF(YY_START
);
1086 if ( ! yy_did_buffer_switch_on_eof
)
1092 case EOB_ACT_CONTINUE_SCAN
:
1094 yytext_ptr
+ yy_amount_of_matched_text
;
1096 yy_current_state
= yy_get_previous_state();
1099 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1102 case EOB_ACT_LAST_MATCH
:
1104 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
1106 yy_current_state
= yy_get_previous_state();
1109 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1110 goto yy_find_action
;
1117 "fatal flex scanner internal error--no action found" );
1118 } /* end of action switch */
1119 } /* end of scanning one token */
1120 } /* end of yylex */
1123 /* yy_get_next_buffer - try to read in a new buffer
1125 * Returns a code representing an action:
1126 * EOB_ACT_LAST_MATCH -
1127 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1128 * EOB_ACT_END_OF_FILE - end of file
1131 static int yy_get_next_buffer()
1133 register char *dest
= yy_current_buffer
->yy_ch_buf
;
1134 register char *source
= yytext_ptr
;
1135 register int number_to_move
, i
;
1138 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
1140 "fatal flex scanner internal error--end of buffer missed" );
1142 if ( yy_current_buffer
->yy_fill_buffer
== 0 )
1143 { /* Don't try to fill the buffer, so this is an EOF. */
1144 if ( yy_c_buf_p
- yytext_ptr
- YY_MORE_ADJ
== 1 )
1146 /* We matched a single character, the EOB, so
1147 * treat this as a final EOF.
1149 return EOB_ACT_END_OF_FILE
;
1154 /* We matched some text prior to the EOB, first
1157 return EOB_ACT_LAST_MATCH
;
1161 /* Try to read more data. */
1163 /* First move last chars to start of buffer. */
1164 number_to_move
= (int) (yy_c_buf_p
- yytext_ptr
) - 1;
1166 for ( i
= 0; i
< number_to_move
; ++i
)
1167 *(dest
++) = *(source
++);
1169 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
1170 /* don't do the read, it's not guaranteed to return an EOF,
1173 yy_current_buffer
->yy_n_chars
= yy_n_chars
= 0;
1178 yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
1180 while ( num_to_read
<= 0 )
1181 { /* Not enough room in the buffer - grow it. */
1182 #ifdef YY_USES_REJECT
1184 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1187 /* just a shorter name for the current buffer */
1188 YY_BUFFER_STATE b
= yy_current_buffer
;
1190 int yy_c_buf_p_offset
=
1191 (int) (yy_c_buf_p
- b
->yy_ch_buf
);
1193 if ( b
->yy_is_our_buffer
)
1195 int new_size
= b
->yy_buf_size
* 2;
1197 if ( new_size
<= 0 )
1198 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
1200 b
->yy_buf_size
*= 2;
1202 b
->yy_ch_buf
= (char *)
1203 /* Include room in for 2 EOB chars. */
1204 yy_flex_realloc( (void *) b
->yy_ch_buf
,
1205 b
->yy_buf_size
+ 2 );
1208 /* Can't grow it, we don't own it. */
1211 if ( ! b
->yy_ch_buf
)
1213 "fatal error - scanner input buffer overflow" );
1215 yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
1217 num_to_read
= yy_current_buffer
->yy_buf_size
-
1222 if ( num_to_read
> YY_READ_BUF_SIZE
)
1223 num_to_read
= YY_READ_BUF_SIZE
;
1225 /* Read in more data. */
1226 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
1227 yy_n_chars
, num_to_read
);
1229 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
1232 if ( yy_n_chars
== 0 )
1234 if ( number_to_move
== YY_MORE_ADJ
)
1236 ret_val
= EOB_ACT_END_OF_FILE
;
1242 ret_val
= EOB_ACT_LAST_MATCH
;
1243 yy_current_buffer
->yy_buffer_status
=
1244 YY_BUFFER_EOF_PENDING
;
1249 ret_val
= EOB_ACT_CONTINUE_SCAN
;
1251 yy_n_chars
+= number_to_move
;
1252 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
1253 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
1255 yytext_ptr
= &yy_current_buffer
->yy_ch_buf
[0];
1261 /* yy_get_previous_state - get the state just before the EOB char was reached */
1263 static yy_state_type
yy_get_previous_state()
1265 register yy_state_type yy_current_state
;
1266 register char *yy_cp
;
1268 yy_current_state
= yy_start
;
1269 yy_current_state
+= YY_AT_BOL();
1271 for ( yy_cp
= yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
1273 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
1274 if ( yy_accept
[yy_current_state
] )
1276 yy_last_accepting_state
= yy_current_state
;
1277 yy_last_accepting_cpos
= yy_cp
;
1279 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1281 yy_current_state
= (int) yy_def
[yy_current_state
];
1282 if ( yy_current_state
>= 113 )
1283 yy_c
= yy_meta
[(unsigned int) yy_c
];
1285 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1288 return yy_current_state
;
1292 /* yy_try_NUL_trans - try to make a transition on the NUL character
1295 * next_state = yy_try_NUL_trans( current_state );
1298 #ifdef YY_USE_PROTOS
1299 static yy_state_type
yy_try_NUL_trans( yy_state_type yy_current_state
)
1301 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
1302 yy_state_type yy_current_state
;
1305 register int yy_is_jam
;
1306 register char *yy_cp
= yy_c_buf_p
;
1308 register YY_CHAR yy_c
= 1;
1309 if ( yy_accept
[yy_current_state
] )
1311 yy_last_accepting_state
= yy_current_state
;
1312 yy_last_accepting_cpos
= yy_cp
;
1314 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1316 yy_current_state
= (int) yy_def
[yy_current_state
];
1317 if ( yy_current_state
>= 113 )
1318 yy_c
= yy_meta
[(unsigned int) yy_c
];
1320 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1321 yy_is_jam
= (yy_current_state
== 112);
1323 return yy_is_jam
? 0 : yy_current_state
;
1328 #ifdef YY_USE_PROTOS
1329 static void yyunput( int c
, register char *yy_bp
)
1331 static void yyunput( c
, yy_bp
)
1333 register char *yy_bp
;
1336 register char *yy_cp
= yy_c_buf_p
;
1338 /* undo effects of setting up yytext */
1339 *yy_cp
= yy_hold_char
;
1341 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
1342 { /* need to shift things up to make room */
1343 /* +2 for EOB chars. */
1344 register int number_to_move
= yy_n_chars
+ 2;
1345 register char *dest
= &yy_current_buffer
->yy_ch_buf
[
1346 yy_current_buffer
->yy_buf_size
+ 2];
1347 register char *source
=
1348 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
1350 while ( source
> yy_current_buffer
->yy_ch_buf
)
1351 *--dest
= *--source
;
1353 yy_cp
+= (int) (dest
- source
);
1354 yy_bp
+= (int) (dest
- source
);
1355 yy_current_buffer
->yy_n_chars
=
1356 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
1358 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
1359 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1362 *--yy_cp
= (char) c
;
1366 yy_hold_char
= *yy_cp
;
1369 #endif /* ifndef YY_NO_UNPUT */
1373 static int yyinput()
1380 *yy_c_buf_p
= yy_hold_char
;
1382 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
1384 /* yy_c_buf_p now points to the character we want to return.
1385 * If this occurs *before* the EOB characters, then it's a
1386 * valid NUL; if not, then we've hit the end of the buffer.
1388 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1389 /* This was really a NUL. */
1393 { /* need more input */
1394 int offset
= yy_c_buf_p
- yytext_ptr
;
1397 switch ( yy_get_next_buffer() )
1399 case EOB_ACT_LAST_MATCH
:
1400 /* This happens because yy_g_n_b()
1401 * sees that we've accumulated a
1402 * token and flags that we need to
1403 * try matching the token before
1404 * proceeding. But for input(),
1405 * there's no matching to consider.
1406 * So convert the EOB_ACT_LAST_MATCH
1407 * to EOB_ACT_END_OF_FILE.
1410 /* Reset buffer status. */
1415 case EOB_ACT_END_OF_FILE
:
1420 if ( ! yy_did_buffer_switch_on_eof
)
1429 case EOB_ACT_CONTINUE_SCAN
:
1430 yy_c_buf_p
= yytext_ptr
+ offset
;
1436 c
= *(unsigned char *) yy_c_buf_p
; /* cast for 8-bit char's */
1437 *yy_c_buf_p
= '\0'; /* preserve yytext */
1438 yy_hold_char
= *++yy_c_buf_p
;
1440 yy_current_buffer
->yy_at_bol
= (c
== '\n');
1446 #ifdef YY_USE_PROTOS
1447 void yyrestart( FILE *input_file
)
1449 void yyrestart( input_file
)
1453 if ( ! yy_current_buffer
)
1454 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
1456 yy_init_buffer( yy_current_buffer
, input_file
);
1457 yy_load_buffer_state();
1461 #ifdef YY_USE_PROTOS
1462 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
1464 void yy_switch_to_buffer( new_buffer
)
1465 YY_BUFFER_STATE new_buffer
;
1468 if ( yy_current_buffer
== new_buffer
)
1471 if ( yy_current_buffer
)
1473 /* Flush out information for old buffer. */
1474 *yy_c_buf_p
= yy_hold_char
;
1475 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
1476 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
1479 yy_current_buffer
= new_buffer
;
1480 yy_load_buffer_state();
1482 /* We don't actually know whether we did this switch during
1483 * EOF (yywrap()) processing, but the only time this flag
1484 * is looked at is after yywrap() is called, so it's safe
1485 * to go ahead and always set it.
1487 yy_did_buffer_switch_on_eof
= 1;
1491 #ifdef YY_USE_PROTOS
1492 void yy_load_buffer_state( void )
1494 void yy_load_buffer_state()
1497 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1498 yytext_ptr
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
1499 yyin
= yy_current_buffer
->yy_input_file
;
1500 yy_hold_char
= *yy_c_buf_p
;
1504 #ifdef YY_USE_PROTOS
1505 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
1507 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
1514 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
1516 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1518 b
->yy_buf_size
= size
;
1520 /* yy_ch_buf has to be 2 characters longer than the size given because
1521 * we need to put in 2 end-of-buffer characters.
1523 b
->yy_ch_buf
= (char *) yy_flex_alloc( b
->yy_buf_size
+ 2 );
1524 if ( ! b
->yy_ch_buf
)
1525 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1527 b
->yy_is_our_buffer
= 1;
1529 yy_init_buffer( b
, file
);
1535 #ifdef YY_USE_PROTOS
1536 void yy_delete_buffer( YY_BUFFER_STATE b
)
1538 void yy_delete_buffer( b
)
1545 if ( b
== yy_current_buffer
)
1546 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
1548 if ( b
->yy_is_our_buffer
)
1549 yy_flex_free( (void *) b
->yy_ch_buf
);
1551 yy_flex_free( (void *) b
);
1555 #ifndef YY_ALWAYS_INTERACTIVE
1556 #ifndef YY_NEVER_INTERACTIVE
1557 extern int isatty
YY_PROTO(( int ));
1561 #ifdef YY_USE_PROTOS
1562 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
1564 void yy_init_buffer( b
, file
)
1571 yy_flush_buffer( b
);
1573 b
->yy_input_file
= file
;
1574 b
->yy_fill_buffer
= 1;
1576 #if YY_ALWAYS_INTERACTIVE
1577 b
->yy_is_interactive
= 1;
1579 #if YY_NEVER_INTERACTIVE
1580 b
->yy_is_interactive
= 0;
1582 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
1588 #ifdef YY_USE_PROTOS
1589 void yy_flush_buffer( YY_BUFFER_STATE b
)
1591 void yy_flush_buffer( b
)
1601 /* We always need two end-of-buffer characters. The first causes
1602 * a transition to the end-of-buffer state. The second causes
1603 * a jam in that state.
1605 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
1606 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1608 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
1611 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1613 if ( b
== yy_current_buffer
)
1614 yy_load_buffer_state();
1618 #ifndef YY_NO_SCAN_BUFFER
1619 #ifdef YY_USE_PROTOS
1620 YY_BUFFER_STATE
yy_scan_buffer( char *base
, yy_size_t size
)
1622 YY_BUFFER_STATE
yy_scan_buffer( base
, size
)
1630 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
1631 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
1632 /* They forgot to leave room for the EOB's. */
1635 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
1637 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1639 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
1640 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
1641 b
->yy_is_our_buffer
= 0;
1642 b
->yy_input_file
= 0;
1643 b
->yy_n_chars
= b
->yy_buf_size
;
1644 b
->yy_is_interactive
= 0;
1646 b
->yy_fill_buffer
= 0;
1647 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1649 yy_switch_to_buffer( b
);
1656 #ifndef YY_NO_SCAN_STRING
1657 #ifdef YY_USE_PROTOS
1658 YY_BUFFER_STATE
yy_scan_string( yyconst
char *yy_str
)
1660 YY_BUFFER_STATE
yy_scan_string( yy_str
)
1661 yyconst
char *yy_str
;
1665 for ( len
= 0; yy_str
[len
]; ++len
)
1668 return yy_scan_bytes( yy_str
, len
);
1673 #ifndef YY_NO_SCAN_BYTES
1674 #ifdef YY_USE_PROTOS
1675 YY_BUFFER_STATE
yy_scan_bytes( yyconst
char *bytes
, int len
)
1677 YY_BUFFER_STATE
yy_scan_bytes( bytes
, len
)
1678 yyconst
char *bytes
;
1687 /* Get memory for full buffer, including space for trailing EOB's. */
1689 buf
= (char *) yy_flex_alloc( n
);
1691 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1693 for ( i
= 0; i
< len
; ++i
)
1696 buf
[len
] = buf
[len
+1] = YY_END_OF_BUFFER_CHAR
;
1698 b
= yy_scan_buffer( buf
, n
);
1700 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1702 /* It's okay to grow etc. this buffer, and we should throw it
1703 * away when we're done.
1705 b
->yy_is_our_buffer
= 1;
1712 #ifndef YY_NO_PUSH_STATE
1713 #ifdef YY_USE_PROTOS
1714 static void yy_push_state( int new_state
)
1716 static void yy_push_state( new_state
)
1720 if ( yy_start_stack_ptr
>= yy_start_stack_depth
)
1724 yy_start_stack_depth
+= YY_START_STACK_INCR
;
1725 new_size
= yy_start_stack_depth
* sizeof( int );
1727 if ( ! yy_start_stack
)
1728 yy_start_stack
= (int *) yy_flex_alloc( new_size
);
1731 yy_start_stack
= (int *) yy_flex_realloc(
1732 (void *) yy_start_stack
, new_size
);
1734 if ( ! yy_start_stack
)
1736 "out of memory expanding start-condition stack" );
1739 yy_start_stack
[yy_start_stack_ptr
++] = YY_START
;
1746 #ifndef YY_NO_POP_STATE
1747 static void yy_pop_state()
1749 if ( --yy_start_stack_ptr
< 0 )
1750 YY_FATAL_ERROR( "start-condition stack underflow" );
1752 BEGIN(yy_start_stack
[yy_start_stack_ptr
]);
1757 #ifndef YY_NO_TOP_STATE
1758 static int yy_top_state()
1760 return yy_start_stack
[yy_start_stack_ptr
- 1];
1764 #ifndef YY_EXIT_FAILURE
1765 #define YY_EXIT_FAILURE 2
1768 #ifdef YY_USE_PROTOS
1769 static void yy_fatal_error( yyconst
char msg
[] )
1771 static void yy_fatal_error( msg
)
1775 (void) fprintf( stderr
, "%s\n", msg
);
1776 exit( YY_EXIT_FAILURE
);
1781 /* Redefine yyless() so it works in section 3 code. */
1787 /* Undo effects of setting up yytext. */ \
1788 yytext[yyleng] = yy_hold_char; \
1789 yy_c_buf_p = yytext + n; \
1790 yy_hold_char = *yy_c_buf_p; \
1791 *yy_c_buf_p = '\0'; \
1797 /* Internal utility routines. */
1800 #ifdef YY_USE_PROTOS
1801 static void yy_flex_strncpy( char *s1
, yyconst
char *s2
, int n
)
1803 static void yy_flex_strncpy( s1
, s2
, n
)
1810 for ( i
= 0; i
< n
; ++i
)
1815 #ifdef YY_NEED_STRLEN
1816 #ifdef YY_USE_PROTOS
1817 static int yy_flex_strlen( yyconst
char *s
)
1819 static int yy_flex_strlen( s
)
1824 for ( n
= 0; s
[n
]; ++n
)
1832 #ifdef YY_USE_PROTOS
1833 static void *yy_flex_alloc( yy_size_t size
)
1835 static void *yy_flex_alloc( size
)
1839 return (void *) malloc( size
);
1842 #ifdef YY_USE_PROTOS
1843 static void *yy_flex_realloc( void *ptr
, yy_size_t size
)
1845 static void *yy_flex_realloc( ptr
, size
)
1850 /* The cast to (char *) in the following accommodates both
1851 * implementations that use char* generic pointers, and those
1852 * that use void* generic pointers. It works with the latter
1853 * because both ANSI C and C++ allow castless assignment from
1854 * any pointer type to void*, and deal with argument conversions
1855 * as though doing an assignment.
1857 return (void *) realloc( (char *) ptr
, size
);
1860 #ifdef YY_USE_PROTOS
1861 static void yy_flex_free( void *ptr
)
1863 static void yy_flex_free( ptr
)
1877 #line 175 "parser.l"
1881 int parser_wrap(void)
1892 static const struct keyword keywords
[] = {
1895 {"__cdecl", tCDECL
},
1896 {"__int64", tINT64
},
1897 {"__stdcall", tSTDCALL
},
1898 {"_stdcall", tSTDCALL
},
1899 {"boolean", tBOOLEAN
},
1901 {"callback", tCALLBACK
},
1904 {"coclass", tCOCLASS
},
1906 {"comm_status", tCOMMSTATUS
},
1908 {"cpp_quote", tCPPQUOTE
},
1909 {"default", tDEFAULT
},
1910 {"dispinterface", tDISPINTERFACE
},
1911 {"double", tDOUBLE
},
1913 {"error_status_t", tERRORSTATUST
},
1914 {"extern", tEXTERN
},
1916 {"handle_t", tHANDLET
},
1918 {"import", tIMPORT
},
1919 {"importlib", tIMPORTLIB
},
1920 {"in_line", tINLINE
},
1922 {"interface", tINTERFACE
},
1923 {"library", tLIBRARY
},
1925 {"methods", tMETHODS
},
1926 {"module", tMODULE
},
1927 {"properties", tPROPERTIES
},
1929 {"signed", tSIGNED
},
1930 {"sizeof", tSIZEOF
},
1932 {"struct", tSTRUCT
},
1933 {"switch", tSWITCH
},
1934 {"typedef", tTYPEDEF
},
1936 {"unsigned", tUNSIGNED
},
1938 {"wchar_t", tWCHAR
},
1940 #define NKEYWORDS (sizeof(keywords)/sizeof(keywords[0]))
1942 /* keywords only recognized in attribute lists */
1943 static const struct keyword attr_keywords
[] =
1945 {"aggregatable", tAGGREGATABLE
},
1946 {"allocate", tALLOCATE
},
1947 {"appobject", tAPPOBJECT
},
1949 {"async_uuid", tASYNCUUID
},
1950 {"auto_handle", tAUTOHANDLE
},
1951 {"bindable", tBINDABLE
},
1952 {"broadcast", tBROADCAST
},
1953 {"byte_count", tBYTECOUNT
},
1954 {"call_as", tCALLAS
},
1955 {"context_handle", tCONTEXTHANDLE
},
1956 {"context_handle_noserialize", tCONTEXTHANDLENOSERIALIZE
},
1957 {"context_handle_serialize", tCONTEXTHANDLENOSERIALIZE
},
1958 {"control", tCONTROL
},
1959 {"defaultcollelem", tDEFAULTCOLLELEM
},
1960 {"defaultvalue", tDEFAULTVALUE
},
1961 {"defaultvtable", tDEFAULTVTABLE
},
1962 {"displaybind", tDISPLAYBIND
},
1963 {"dllname", tDLLNAME
},
1965 {"endpoint", tENDPOINT
},
1967 {"explicit_handle", tEXPLICITHANDLE
},
1968 {"handle", tHANDLE
},
1969 {"helpcontext", tHELPCONTEXT
},
1970 {"helpfile", tHELPFILE
},
1971 {"helpstring", tHELPSTRING
},
1972 {"helpstringcontext", tHELPSTRINGCONTEXT
},
1973 {"helpstringdll", tHELPSTRINGDLL
},
1974 {"hidden", tHIDDEN
},
1976 {"idempotent", tIDEMPOTENT
},
1978 {"immediatebind", tIMMEDIATEBIND
},
1979 {"implicit_handle", tIMPLICITHANDLE
},
1981 {"input_sync", tINPUTSYNC
},
1983 {"length_is", tLENGTHIS
},
1985 {"nonbrowsable", tNONBROWSABLE
},
1986 {"noncreatable", tNONCREATABLE
},
1987 {"nonextensible", tNONEXTENSIBLE
},
1988 {"object", tOBJECT
},
1990 {"oleautomation", tOLEAUTOMATION
},
1991 {"optional", tOPTIONAL
},
1993 {"pointer_default", tPOINTERDEFAULT
},
1994 {"propget", tPROPGET
},
1995 {"propput", tPROPPUT
},
1996 {"propputref", tPROPPUTREF
},
1998 {"public", tPUBLIC
},
2000 {"readonly", tREADONLY
},
2002 {"requestedit", tREQUESTEDIT
},
2003 {"restricted", tRESTRICTED
},
2004 {"retval", tRETVAL
},
2005 {"single", tSINGLE
},
2006 {"size_is", tSIZEIS
},
2007 {"source", tSOURCE
},
2008 {"strict_context_handle", tSTRICTCONTEXTHANDLE
},
2009 {"string", tSTRING
},
2010 {"switch_is", tSWITCHIS
},
2011 {"switch_type", tSWITCHTYPE
},
2012 {"transmit_as", tTRANSMITAS
},
2013 {"unique", tUNIQUE
},
2015 {"v1_enum", tV1ENUM
},
2016 {"vararg", tVARARG
},
2017 {"version", tVERSION
},
2018 {"wire_marshal", tWIREMARSHAL
},
2022 #define KWP(p) ((const struct keyword *)(p))
2024 static int kw_cmp_func(const void *s1
, const void *s2
)
2026 return strcmp(KWP(s1
)->kw
, KWP(s2
)->kw
);
2029 static int kw_token(const char *kw
)
2031 struct keyword key
, *kwp
;
2033 kwp
= bsearch(&key
, keywords
, NKEYWORDS
, sizeof(keywords
[0]), kw_cmp_func
);
2035 parser_lval
.str
= xstrdup(kwp
->kw
);
2038 parser_lval
.str
= xstrdup(kw
);
2039 return is_type(kw
) ? aKNOWNTYPE
: aIDENTIFIER
;
2042 static int attr_token(const char *kw
)
2044 struct keyword key
, *kwp
;
2046 kwp
= bsearch(&key
, attr_keywords
, sizeof(attr_keywords
)/sizeof(attr_keywords
[0]),
2047 sizeof(attr_keywords
[0]), kw_cmp_func
);
2049 parser_lval
.str
= xstrdup(kwp
->kw
);
2052 return kw_token(kw
);
2055 static void addcchar(char c
)
2057 if(cbufidx
>= cbufalloc
)
2060 cbuffer
= xrealloc(cbuffer
, cbufalloc
* sizeof(cbuffer
[0]));
2061 if(cbufalloc
> 65536)
2062 parser_warning("Reallocating string buffer larger than 64kB\n");
2064 cbuffer
[cbufidx
++] = c
;
2067 static char *get_buffered_cstring(void)
2070 return xstrdup(cbuffer
);
2073 static void pop_import(void)
2075 int ptr
= import_stack_ptr
-1;
2078 yy_delete_buffer( YY_CURRENT_BUFFER
);
2079 yy_switch_to_buffer( import_stack
[ptr
].state
);
2084 temp_name
= import_stack
[ptr
].temp_name
;
2086 input_name
= import_stack
[ptr
].input_name
;
2087 line_number
= import_stack
[ptr
].line_number
;
2093 struct imports
*next
;
2096 int do_import(char *fname
)
2099 char *hname
, *path
, *p
;
2100 struct imports
*import
;
2101 int ptr
= import_stack_ptr
;
2104 if (!parse_only
&& do_header
) {
2105 hname
= dup_basename(fname
, ".idl");
2106 p
= hname
+ strlen(hname
) - 2;
2107 if (p
<= hname
|| strcmp( p
, ".h" )) strcat(hname
, ".h");
2109 fprintf(header
, "#include <%s>\n", hname
);
2113 import
= first_import
;
2114 while (import
&& strcmp(import
->name
, fname
))
2115 import
= import
->next
;
2116 if (import
) return 0; /* already imported */
2118 import
= xmalloc(sizeof(struct imports
));
2119 import
->name
= xstrdup(fname
);
2120 import
->next
= first_import
;
2121 first_import
= import
;
2123 /* don't search for a file name with a path in the include directories,
2124 * for compatibility with MIDL */
2125 if (strchr( fname
, '/' ) || strchr( fname
, '\\' ))
2126 path
= strdup( fname
);
2127 else if (!(path
= wpp_find_include( fname
, input_name
)))
2128 error_loc("Unable to open include file %s\n", fname
);
2130 import_stack
[ptr
].temp_name
= temp_name
;
2131 import_stack
[ptr
].input_name
= input_name
;
2132 import_stack
[ptr
].line_number
= line_number
;
2137 ret
= wpp_parse_temp( path
, NULL
, &temp_name
);
2140 if((f
= fopen(temp_name
, "r")) == NULL
)
2141 error_loc("Unable to open %s\n", temp_name
);
2143 import_stack
[ptr
].state
= YY_CURRENT_BUFFER
;
2144 yy_switch_to_buffer(yy_create_buffer(f
, YY_BUF_SIZE
));
2148 void abort_import(void)
2152 for (ptr
=0; ptr
<import_stack_ptr
; ptr
++)
2153 unlink(import_stack
[ptr
].temp_name
);