rclex.c revision 99461
1/* A lexical scanner generated by flex */
2
3/* Scanner skeleton version:
4 * $Header: /cvs/src/src/binutils/Attic/rclex.c,v 1.1.6.2 2002/05/11 20:00:49 drow Exp $
5 */
6
7#define FLEX_SCANNER
8#define YY_FLEX_MAJOR_VERSION 2
9#define YY_FLEX_MINOR_VERSION 5
10
11#include <stdio.h>
12#include <errno.h>
13
14/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
15#ifdef c_plusplus
16#ifndef __cplusplus
17#define __cplusplus
18#endif
19#endif
20
21
22#ifdef __cplusplus
23
24#include <stdlib.h>
25#ifndef _WIN32
26#include <unistd.h>
27#else
28#ifndef YY_ALWAYS_INTERACTIVE
29#ifndef YY_NEVER_INTERACTIVE
30extern int isatty YY_PROTO(( int ));
31#endif
32#endif
33#endif
34
35/* Use prototypes in function declarations. */
36#define YY_USE_PROTOS
37
38/* The "const" storage-class-modifier is valid. */
39#define YY_USE_CONST
40
41#else	/* ! __cplusplus */
42
43#if __STDC__
44
45#define YY_USE_PROTOS
46#define YY_USE_CONST
47
48#endif	/* __STDC__ */
49#endif	/* ! __cplusplus */
50
51#ifdef __TURBOC__
52 #pragma warn -rch
53 #pragma warn -use
54#include <io.h>
55#include <stdlib.h>
56#define YY_USE_CONST
57#define YY_USE_PROTOS
58#endif
59
60#ifdef YY_USE_CONST
61#define yyconst const
62#else
63#define yyconst
64#endif
65
66
67#ifdef YY_USE_PROTOS
68#define YY_PROTO(proto) proto
69#else
70#define YY_PROTO(proto) ()
71#endif
72
73/* Returned upon end-of-file. */
74#define YY_NULL 0
75
76/* Promotes a possibly negative, possibly signed char to an unsigned
77 * integer for use as an array index.  If the signed char is negative,
78 * we want to instead treat it as an 8-bit unsigned char, hence the
79 * double cast.
80 */
81#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
82
83/* Enter a start condition.  This macro really ought to take a parameter,
84 * but we do it the disgusting crufty way forced on us by the ()-less
85 * definition of BEGIN.
86 */
87#define BEGIN yy_start = 1 + 2 *
88
89/* Translate the current start state into a value that can be later handed
90 * to BEGIN to return to the state.  The YYSTATE alias is for lex
91 * compatibility.
92 */
93#define YY_START ((yy_start - 1) / 2)
94#define YYSTATE YY_START
95
96/* Action number for EOF rule of a given start state. */
97#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
98
99/* Special action meaning "start processing a new file". */
100#define YY_NEW_FILE yyrestart( yyin )
101
102#define YY_END_OF_BUFFER_CHAR 0
103
104/* Size of default input buffer. */
105#define YY_BUF_SIZE 16384
106
107typedef struct yy_buffer_state *YY_BUFFER_STATE;
108
109extern int yyleng;
110extern FILE *yyin, *yyout;
111
112#define EOB_ACT_CONTINUE_SCAN 0
113#define EOB_ACT_END_OF_FILE 1
114#define EOB_ACT_LAST_MATCH 2
115
116/* The funky do-while in the following #define is used to turn the definition
117 * int a single C statement (which needs a semi-colon terminator).  This
118 * avoids problems with code like:
119 *
120 * 	if ( condition_holds )
121 *		yyless( 5 );
122 *	else
123 *		do_something_else();
124 *
125 * Prior to using the do-while the compiler would get upset at the
126 * "else" because it interpreted the "if" statement as being all
127 * done when it reached the ';' after the yyless() call.
128 */
129
130/* Return all but the first 'n' matched characters back to the input stream. */
131
132#define yyless(n) \
133	do \
134		{ \
135		/* Undo effects of setting up yytext. */ \
136		*yy_cp = yy_hold_char; \
137		YY_RESTORE_YY_MORE_OFFSET \
138		yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
139		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
140		} \
141	while ( 0 )
142
143#define unput(c) yyunput( c, yytext_ptr )
144
145/* The following is because we cannot portably get our hands on size_t
146 * (without autoconf's help, which isn't available because we want
147 * flex-generated scanners to compile on their own).
148 */
149typedef unsigned int yy_size_t;
150
151
152struct yy_buffer_state
153	{
154	FILE *yy_input_file;
155
156	char *yy_ch_buf;		/* input buffer */
157	char *yy_buf_pos;		/* current position in input buffer */
158
159	/* Size of input buffer in bytes, not including room for EOB
160	 * characters.
161	 */
162	yy_size_t yy_buf_size;
163
164	/* Number of characters read into yy_ch_buf, not including EOB
165	 * characters.
166	 */
167	int yy_n_chars;
168
169	/* Whether we "own" the buffer - i.e., we know we created it,
170	 * and can realloc() it to grow it, and should free() it to
171	 * delete it.
172	 */
173	int yy_is_our_buffer;
174
175	/* Whether this is an "interactive" input source; if so, and
176	 * if we're using stdio for input, then we want to use getc()
177	 * instead of fread(), to make sure we stop fetching input after
178	 * each newline.
179	 */
180	int yy_is_interactive;
181
182	/* Whether we're considered to be at the beginning of a line.
183	 * If so, '^' rules will be active on the next match, otherwise
184	 * not.
185	 */
186	int yy_at_bol;
187
188	/* Whether to try to fill the input buffer when we reach the
189	 * end of it.
190	 */
191	int yy_fill_buffer;
192
193	int yy_buffer_status;
194#define YY_BUFFER_NEW 0
195#define YY_BUFFER_NORMAL 1
196	/* When an EOF's been seen but there's still some text to process
197	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
198	 * shouldn't try reading from the input source any more.  We might
199	 * still have a bunch of tokens to match, though, because of
200	 * possible backing-up.
201	 *
202	 * When we actually see the EOF, we change the status to "new"
203	 * (via yyrestart()), so that the user can continue scanning by
204	 * just pointing yyin at a new input file.
205	 */
206#define YY_BUFFER_EOF_PENDING 2
207	};
208
209static YY_BUFFER_STATE yy_current_buffer = 0;
210
211/* We provide macros for accessing buffer states in case in the
212 * future we want to put the buffer states in a more general
213 * "scanner state".
214 */
215#define YY_CURRENT_BUFFER yy_current_buffer
216
217
218/* yy_hold_char holds the character lost when yytext is formed. */
219static char yy_hold_char;
220
221static int yy_n_chars;		/* number of characters read into yy_ch_buf */
222
223
224int yyleng;
225
226/* Points to current character in buffer. */
227static char *yy_c_buf_p = (char *) 0;
228static int yy_init = 1;		/* whether we need to initialize */
229static int yy_start = 0;	/* start state number */
230
231/* Flag which is used to allow yywrap()'s to do buffer switches
232 * instead of setting up a fresh yyin.  A bit of a hack ...
233 */
234static int yy_did_buffer_switch_on_eof;
235
236void yyrestart YY_PROTO(( FILE *input_file ));
237
238void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
239void yy_load_buffer_state YY_PROTO(( void ));
240YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
241void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
242void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
243void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
244#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
245
246YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
247YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
248YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
249
250static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
251static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
252static void yy_flex_free YY_PROTO(( void * ));
253
254#define yy_new_buffer yy_create_buffer
255
256#define yy_set_interactive(is_interactive) \
257	{ \
258	if ( ! yy_current_buffer ) \
259		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
260	yy_current_buffer->yy_is_interactive = is_interactive; \
261	}
262
263#define yy_set_bol(at_bol) \
264	{ \
265	if ( ! yy_current_buffer ) \
266		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
267	yy_current_buffer->yy_at_bol = at_bol; \
268	}
269
270#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
271
272typedef unsigned char YY_CHAR;
273FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
274typedef int yy_state_type;
275extern char *yytext;
276#define yytext_ptr yytext
277
278static yy_state_type yy_get_previous_state YY_PROTO(( void ));
279static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
280static int yy_get_next_buffer YY_PROTO(( void ));
281static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
282
283/* Done after the current pattern has been matched and before the
284 * corresponding action - sets up yytext.
285 */
286#define YY_DO_BEFORE_ACTION \
287	yytext_ptr = yy_bp; \
288	yyleng = (int) (yy_cp - yy_bp); \
289	yy_hold_char = *yy_cp; \
290	*yy_cp = '\0'; \
291	yy_c_buf_p = yy_cp;
292
293#define YY_NUM_RULES 86
294#define YY_END_OF_BUFFER 87
295static yyconst short int yy_accept[470] =
296    {   0,
297        0,    0,   87,   85,   84,   83,   85,   78,   80,   82,
298       82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
299       82,   82,   82,   82,   82,   82,   82,    2,    4,   84,
300        0,   81,   78,   80,   79,   82,   82,   82,   82,   82,
301       82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
302       82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
303       82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
304       82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
305       82,   82,   82,   81,    0,   82,   11,   82,   82,   82,
306       82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
307
308       82,   82,   82,   82,   82,    3,   82,   82,   82,   82,
309       82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
310       82,   82,   82,   82,   82,   82,   76,   82,   82,   82,
311       82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
312       82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
313       82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
314       82,   82,   82,   82,   82,   82,   82,   41,   82,   82,
315       82,   53,   42,   82,   82,   82,   82,   82,   82,   82,
316       46,   82,   82,   82,   82,   82,   82,   71,   82,   82,
317       82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
318
319       82,   82,   82,    7,   82,   82,   82,   38,    1,   82,
320       82,   82,   82,   82,   18,   82,   82,   25,   82,   82,
321       82,   82,   82,   82,   82,   82,   82,   82,   82,   70,
322       82,   82,   39,   40,   82,   82,   82,   82,   82,   30,
323       82,   82,   82,   82,   82,   82,   50,   82,   82,   82,
324       82,   82,   34,   82,   82,    9,   82,   82,   19,   82,
325       68,   82,   82,   82,   82,   82,   82,   12,    0,   82,
326       82,   82,   82,   82,   82,   82,   13,   82,   14,   82,
327       82,   82,   82,   65,   82,   82,   82,   52,   82,   72,
328       82,   82,   82,   82,   82,   82,   47,   82,   82,   82,
329
330       82,   82,   82,   82,   82,   82,   58,   82,   82,   36,
331       82,   82,   82,   82,   82,   82,   82,   82,    0,   82,
332        0,   77,   17,   82,   82,   51,   82,   10,   82,   82,
333       82,   82,   16,   82,   82,   82,   82,   82,   82,   82,
334       29,   82,   82,   82,   82,   82,   82,   82,   73,   82,
335       31,   82,   82,   82,   82,   82,   82,   45,    6,   82,
336       82,   82,   82,   77,   82,   23,   24,   82,   15,   82,
337       27,   82,   82,   66,   82,   28,   54,   43,   82,   82,
338       82,   48,   82,   69,    8,   82,   82,   82,   82,   82,
339       82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
340
341       64,   82,   82,   82,   82,   56,   82,   82,   82,   82,
342       35,   49,   82,   82,   82,   82,   20,   82,   82,   82,
343       82,   82,   82,   82,   82,   74,   82,   82,   82,   32,
344       82,   82,   37,   82,   82,   82,   82,   82,   82,   75,
345       82,   67,   61,   82,   82,   82,   33,   59,   60,    5,
346       21,   82,   82,   82,   82,   55,   57,   82,   82,   82,
347       26,   63,   82,   82,   82,   62,   22,   44,    0
348    } ;
349
350static yyconst int yy_ec[256] =
351    {   0,
352        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
353        1,    1,    4,    1,    1,    1,    1,    1,    1,    1,
354        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
355        1,    2,    1,    5,    6,    1,    1,    1,    1,    1,
356        1,    1,    1,    7,    1,    1,    1,    8,    8,    8,
357        9,    8,    8,    8,    8,    8,    8,    1,    1,    1,
358        1,    1,    1,    1,   10,   11,   12,   13,   14,   15,
359       16,   17,   18,   19,   20,   21,   22,   23,   24,   25,
360       19,   26,   27,   28,   29,   30,   19,   31,   32,   19,
361        1,    1,    1,    1,    1,    1,   33,   33,   33,   33,
362
363       33,   33,   19,   19,   19,   19,   19,   19,   19,   19,
364       19,   19,   19,   19,   19,   19,   19,   19,   19,   33,
365       19,   19,   34,    1,   35,    1,    1,    1,    1,    1,
366        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
367        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
368        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
369        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
370        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
371        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
372        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
373
374        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
375        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
376        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
377        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
378        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
379        1,    1,    1,    1,    1
380    } ;
381
382static yyconst int yy_meta[36] =
383    {   0,
384        1,    2,    3,    2,    1,    4,    2,    5,    5,    5,
385        5,    5,    5,    5,    5,    1,    1,    1,    1,    1,
386        5,    1,    1,    1,    1,    1,    1,    1,    1,    1,
387        1,    1,    5,    1,    1
388    } ;
389
390static yyconst short int yy_base[476] =
391    {   0,
392        0,    0,  515,  516,   34,  516,  509,    0,  492,   25,
393       26,   45,   25,   28,   24,  486,  497,   49,    0,   40,
394       43,  486,   51,   66,   67,  482,   35,  516,  516,   81,
395      503,   84,    0,  486,  516,    0,  494,  477,  492,  475,
396       74,  474,  477,  475,   46,  489,   69,  484,  471,  481,
397       55,  477,  481,  466,   67,  469,   83,   83,  467,  477,
398      464,  478,  464,  459,  475,  470,   74,  453,   81,  457,
399       86,   76,  468,  467,  465,  452,  452,  458,   95,  461,
400      453,  447,  446,  106,  466,  456,    0,  451,  444,  449,
401      448,  443,  452,  435,  436,  449,  433,  448,  430,  426,
402
403      429,  430,  433,  441,  424,    0,  423,  436,  435,  420,
404      415,  417,  427,  419,  420,  424,  412,  428,  423,  410,
405      424,  405,  406,  407,  419,  409,    0,  402,  409,  416,
406      414,  410,  408,  415,  393,  399,  412,  406,  392,  401,
407      397,  391,  387,  388,  386,  392,  394,  103,  383,  387,
408      399,  388,  389,  396,  385,  377,  379,  376,  373,  376,
409      370,  374,  387,  368,  363,   98,  381,    0,  379,  367,
410      363,    0,    0,  362,  363,  360,  358,  375,  361,  356,
411      105,  373,  372,  351,  355,  355,  349,    0,  366,  352,
412      347,  346,  352,  346,  343,  356,  346,  354,  356,  352,
413
414      347,  344,  349,    0,  335,  344,  350,    0,    0,  334,
415      115,  334,  345,  119,    0,  345,  331,    0,  328,  326,
416      336,  325,  336,  328,  327,  320,  317,  313,  330,    0,
417      330,  331,    0,    0,  327,  322,  329,  314,  314,    0,
418      114,  305,  307,  318,  322,  318,    0,  321,  318,  107,
419      318,  318,    0,  306,  316,    0,  316,  308,    0,  294,
420        0,  298,  307,  294,  291,  304,  304,    0,  132,  137,
421      293,  287,  290,  300,  288,  290,    0,  293,  295,  295,
422      276,  292,  295,    0,  293,  278,  276,    0,  277,    0,
423      270,  283,  267,  285,  270,  281,    0,  280,  279,  271,
424
425      265,  277,  261,  257,  259,  257,    0,  274,  256,    0,
426      255,  254,  258,  248,  269,  268,  265,  258,  270,  143,
427      269,  149,    0,  259,  241,    0,  240,    0,  259,  238,
428      258,  239,    0,  250,  237,  250,  236,  231,  247,  246,
429        0,  249,  247,  247,  234,  227,  240,  225,    0,  222,
430        0,  223,  222,  239,  224,  237,  218,  227,    0,  216,
431      215,  222,  217,  235,  213,    0,    0,  209,    0,  226,
432        0,  209,  203,    0,  216,    0,    0,    0,  212,  206,
433      211,    0,  220,    0,    0,  215,  204,  199,  200,  199,
434      213,  199,  199,  197,  206,  208,  207,  199,  188,  194,
435
436      192,  188,  188,  190,  196,    0,  198,  182,  184,  182,
437        0,    0,  184,  181,  188,  176,    0,  177,  171,  172,
438      170,  183,  186,  181,  171,    0,  183,  171,  164,    0,
439      167,  175,    0,  164,  160,  155,  157,  156,  159,    0,
440      155,    0,    0,  160,  165,  156,    0,    0,    0,    0,
441        0,  141,  150,  141,  139,    0,    0,  128,  122,  126,
442        0,    0,  109,   91,   79,    0,    0,    0,  516,  156,
443      161,   65,  166,  171,  176
444    } ;
445
446static yyconst short int yy_def[476] =
447    {   0,
448      469,    1,  469,  469,  469,  469,  470,  471,  472,  473,
449      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
450      473,  473,  473,  473,  473,  473,  473,  469,  469,  469,
451      470,  469,  471,  472,  469,  473,  473,  473,  473,  473,
452      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
453      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
454      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
455      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
456      473,  473,  473,  469,  470,  473,  473,  473,  473,  473,
457      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
458
459      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
460      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
461      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
462      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
463      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
464      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
465      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
466      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
467      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
468      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
469
470      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
471      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
472      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
473      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
474      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
475      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
476      473,  473,  473,  473,  473,  473,  473,  473,  469,  474,
477      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
478      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
479      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
480
481      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
482      473,  473,  473,  473,  473,  473,  473,  473,  475,  474,
483      475,  474,  473,  473,  473,  473,  473,  473,  473,  473,
484      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
485      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
486      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
487      473,  473,  473,  475,  473,  473,  473,  473,  473,  473,
488      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
489      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
490      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
491
492      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
493      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
494      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
495      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
496      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
497      473,  473,  473,  473,  473,  473,  473,  473,  473,  473,
498      473,  473,  473,  473,  473,  473,  473,  473,    0,  469,
499      469,  469,  469,  469,  469
500    } ;
501
502static yyconst short int yy_nxt[552] =
503    {   0,
504        4,    5,    6,    5,    7,    8,    4,    9,    9,   10,
505       11,   12,   13,   14,   15,   16,   17,   18,   19,   19,
506       20,   21,   22,   19,   23,   24,   25,   19,   26,   27,
507       19,   19,   19,   28,   29,   30,   37,   30,   50,   41,
508       52,   55,   51,   42,   81,   38,   43,   56,   82,   63,
509       53,   39,   83,   40,   44,   95,   67,   64,   54,   96,
510       59,   45,   60,   65,  103,   46,   68,   66,   47,   34,
511       61,   62,   48,   49,   70,   73,   71,   74,   76,   72,
512       77,  104,   30,   78,   30,   84,   90,  108,   85,   91,
513       98,   99,  111,   75,   79,  113,  123,  109,  126,  129,
514
515      124,  131,  132,  114,  139,  468,  112,   84,  127,  130,
516       85,  205,  225,  467,  206,  241,  269,  269,  242,  270,
517      140,  226,  243,  295,  227,  228,  141,  229,  207,  273,
518      304,  466,  274,  269,  269,  305,  319,  465,  321,  296,
519      321,  322,   36,  321,  321,  464,  321,  322,   36,  321,
520      321,  463,  321,  322,   36,  321,   31,   31,  462,   31,
521       31,   33,   33,  461,   33,   33,   36,  460,  459,   36,
522       36,  320,  320,  458,  320,  320,  321,  321,  457,  456,
523      321,  455,  454,  453,  452,  451,  450,  449,  448,  447,
524      446,  445,  444,  443,  442,  441,  440,  439,  438,  437,
525
526      436,  435,  434,  433,  432,  431,  430,  429,  428,  427,
527      426,  425,  424,  423,  422,  421,  420,  419,  418,  417,
528      416,  415,  414,  413,  412,  411,  410,  409,  408,  407,
529      406,  405,  404,  403,  402,  401,  400,  399,  398,  364,
530      397,  396,  395,  394,  393,  392,  391,  390,  389,  388,
531      387,  386,  385,  384,  383,  382,  381,  380,  379,  378,
532      377,  376,  375,  374,  373,  372,  371,  370,  369,  368,
533      367,  366,  365,  364,  364,  363,  362,  361,  360,  359,
534      358,  357,  356,  355,  354,  353,  352,  351,  350,  349,
535      348,  347,  346,  345,  344,  343,  342,  341,  340,  339,
536
537      338,  337,  336,  335,  334,  333,  332,  331,  330,  329,
538      328,  327,  326,  325,  324,  323,  318,  317,  316,  315,
539      314,  313,  312,  311,  310,  309,  308,  307,  306,  303,
540      302,  301,  300,  299,  298,  297,  294,  293,  292,  291,
541      290,  289,  288,  287,  286,  285,  284,  283,  282,  281,
542      280,  279,  278,  277,  276,  275,  272,  271,  268,  267,
543      266,  265,  264,  263,  262,  261,  260,  259,  258,  257,
544      256,  255,  254,  253,  252,  251,  250,  249,  248,  247,
545      246,  245,  244,  240,  239,  238,  237,  236,  235,  234,
546      233,  232,  231,  230,  224,  223,  222,  221,  220,  219,
547
548      218,  217,  216,  215,  214,  213,  212,  211,  210,  209,
549      208,  204,  203,  202,  201,  200,  199,  198,  197,  196,
550      195,  194,  193,  192,  191,  190,  189,  188,  187,  186,
551      185,  184,  183,  182,  181,  180,  179,  178,  177,  176,
552      175,  174,  173,  172,  171,  170,  169,  168,  167,  166,
553      165,  164,  163,  162,  161,  160,  159,  158,  157,  156,
554      155,  154,  153,  152,  151,  150,  149,  148,  147,  146,
555       32,  145,  144,  143,  142,  138,  137,  136,  135,  134,
556      133,  128,  125,  122,  121,  120,  119,  118,  117,  116,
557      115,  110,  107,  106,  105,  102,  101,  100,   97,   94,
558
559       93,   92,   89,   88,   87,   86,   35,   32,   80,   69,
560       58,   57,   35,   32,  469,    3,  469,  469,  469,  469,
561      469,  469,  469,  469,  469,  469,  469,  469,  469,  469,
562      469,  469,  469,  469,  469,  469,  469,  469,  469,  469,
563      469,  469,  469,  469,  469,  469,  469,  469,  469,  469,
564      469
565    } ;
566
567static yyconst short int yy_chk[552] =
568    {   0,
569        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
570        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
571        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
572        1,    1,    1,    1,    1,    5,   10,    5,   13,   11,
573       14,   15,   13,   11,   27,   10,   11,   15,   27,   20,
574       14,   10,   27,   10,   12,   45,   21,   20,   14,   45,
575       18,   12,   18,   20,   51,   12,   21,   20,   12,  472,
576       18,   18,   12,   12,   23,   24,   23,   24,   25,   23,
577       25,   51,   30,   25,   30,   32,   41,   55,   32,   41,
578       47,   47,   57,   24,   25,   58,   67,   55,   69,   71,
579
580       67,   72,   72,   58,   79,  465,   57,   84,   69,   71,
581       84,  148,  166,  464,  148,  181,  211,  211,  181,  211,
582       79,  166,  181,  241,  166,  166,   79,  166,  148,  214,
583      250,  463,  214,  269,  269,  250,  269,  460,  270,  241,
584      270,  270,  270,  270,  320,  459,  320,  320,  320,  320,
585      322,  458,  322,  322,  322,  322,  470,  470,  455,  470,
586      470,  471,  471,  454,  471,  471,  473,  453,  452,  473,
587      473,  474,  474,  446,  474,  474,  475,  475,  445,  444,
588      475,  441,  439,  438,  437,  436,  435,  434,  432,  431,
589      429,  428,  427,  425,  424,  423,  422,  421,  420,  419,
590
591      418,  416,  415,  414,  413,  410,  409,  408,  407,  405,
592      404,  403,  402,  401,  400,  399,  398,  397,  396,  395,
593      394,  393,  392,  391,  390,  389,  388,  387,  386,  383,
594      381,  380,  379,  375,  373,  372,  370,  368,  365,  364,
595      363,  362,  361,  360,  358,  357,  356,  355,  354,  353,
596      352,  350,  348,  347,  346,  345,  344,  343,  342,  340,
597      339,  338,  337,  336,  335,  334,  332,  331,  330,  329,
598      327,  325,  324,  321,  319,  318,  317,  316,  315,  314,
599      313,  312,  311,  309,  308,  306,  305,  304,  303,  302,
600      301,  300,  299,  298,  296,  295,  294,  293,  292,  291,
601
602      289,  287,  286,  285,  283,  282,  281,  280,  279,  278,
603      276,  275,  274,  273,  272,  271,  267,  266,  265,  264,
604      263,  262,  260,  258,  257,  255,  254,  252,  251,  249,
605      248,  246,  245,  244,  243,  242,  239,  238,  237,  236,
606      235,  232,  231,  229,  228,  227,  226,  225,  224,  223,
607      222,  221,  220,  219,  217,  216,  213,  212,  210,  207,
608      206,  205,  203,  202,  201,  200,  199,  198,  197,  196,
609      195,  194,  193,  192,  191,  190,  189,  187,  186,  185,
610      184,  183,  182,  180,  179,  178,  177,  176,  175,  174,
611      171,  170,  169,  167,  165,  164,  163,  162,  161,  160,
612
613      159,  158,  157,  156,  155,  154,  153,  152,  151,  150,
614      149,  147,  146,  145,  144,  143,  142,  141,  140,  139,
615      138,  137,  136,  135,  134,  133,  132,  131,  130,  129,
616      128,  126,  125,  124,  123,  122,  121,  120,  119,  118,
617      117,  116,  115,  114,  113,  112,  111,  110,  109,  108,
618      107,  105,  104,  103,  102,  101,  100,   99,   98,   97,
619       96,   95,   94,   93,   92,   91,   90,   89,   88,   86,
620       85,   83,   82,   81,   80,   78,   77,   76,   75,   74,
621       73,   70,   68,   66,   65,   64,   63,   62,   61,   60,
622       59,   56,   54,   53,   52,   50,   49,   48,   46,   44,
623
624       43,   42,   40,   39,   38,   37,   34,   31,   26,   22,
625       17,   16,    9,    7,    3,  469,  469,  469,  469,  469,
626      469,  469,  469,  469,  469,  469,  469,  469,  469,  469,
627      469,  469,  469,  469,  469,  469,  469,  469,  469,  469,
628      469,  469,  469,  469,  469,  469,  469,  469,  469,  469,
629      469
630    } ;
631
632static yy_state_type yy_last_accepting_state;
633static char *yy_last_accepting_cpos;
634
635/* The intent behind this definition is that it'll catch
636 * any uses of REJECT which flex missed.
637 */
638#define REJECT reject_used_but_not_detected
639#define yymore() yymore_used_but_not_detected
640#define YY_MORE_ADJ 0
641#define YY_RESTORE_YY_MORE_OFFSET
642char *yytext;
643#line 1 "rclex.l"
644#define INITIAL 0
645#line 2 "rclex.l"
646/* Copyright 1997, 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
647   Written by Ian Lance Taylor, Cygnus Support.
648
649   This file is part of GNU Binutils.
650
651   This program is free software; you can redistribute it and/or modify
652   it under the terms of the GNU General Public License as published by
653   the Free Software Foundation; either version 2 of the License, or
654   (at your option) any later version.
655
656   This program is distributed in the hope that it will be useful,
657   but WITHOUT ANY WARRANTY; without even the implied warranty of
658   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
659   GNU General Public License for more details.
660
661   You should have received a copy of the GNU General Public License
662   along with this program; if not, write to the Free Software
663   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
664   02111-1307, USA.  */
665
666/* This is a lex input file which generates a lexer used by the
667   Windows rc file parser.  It basically just recognized a bunch of
668   keywords.  */
669
670#include "bfd.h"
671#include "bucomm.h"
672#include "libiberty.h"
673#include "safe-ctype.h"
674#include "windres.h"
675#include "rcparse.h"
676
677#include <assert.h>
678
679/* Whether we are in rcdata mode, in which we returns the lengths of
680   strings.  */
681
682static int rcdata_mode;
683
684/* Whether we are supressing lines from cpp (including windows.h or
685   headers from your C sources may bring in externs and typedefs).
686   When active, we return IGNORED_TOKEN, which lets us ignore these
687   outside of resource constructs.  Thus, it isn't required to protect
688   all the non-preprocessor lines in your header files with #ifdef
689   RC_INVOKED.  It also means your RC file can't include other RC
690   files if they're named "*.h".  Sorry.  Name them *.rch or whatever.  */
691
692static int suppress_cpp_data;
693
694#define MAYBE_RETURN(x) return suppress_cpp_data ? IGNORED_TOKEN : (x)
695
696/* The first filename we detect in the cpp output.  We use this to
697   tell included files from the original file.  */
698
699static char *initial_fn;
700
701/* List of allocated strings.  */
702
703struct alloc_string
704{
705  struct alloc_string *next;
706  char *s;
707};
708
709static struct alloc_string *strings;
710
711/* Local functions.  */
712
713static void cpp_line PARAMS ((const char *));
714static char *handle_quotes PARAMS ((const char *, unsigned long *));
715static char *get_string PARAMS ((int));
716
717#line 718 "lex.yy.c"
718
719/* Macros after this point can all be overridden by user definitions in
720 * section 1.
721 */
722
723#ifndef YY_SKIP_YYWRAP
724#ifdef __cplusplus
725extern "C" int yywrap YY_PROTO(( void ));
726#else
727extern int yywrap YY_PROTO(( void ));
728#endif
729#endif
730
731#ifndef YY_NO_UNPUT
732static void yyunput YY_PROTO(( int c, char *buf_ptr ));
733#endif
734
735#ifndef yytext_ptr
736static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
737#endif
738
739#ifdef YY_NEED_STRLEN
740static int yy_flex_strlen YY_PROTO(( yyconst char * ));
741#endif
742
743#ifndef YY_NO_INPUT
744#ifdef __cplusplus
745static int yyinput YY_PROTO(( void ));
746#else
747static int input YY_PROTO(( void ));
748#endif
749#endif
750
751#if YY_STACK_USED
752static int yy_start_stack_ptr = 0;
753static int yy_start_stack_depth = 0;
754static int *yy_start_stack = 0;
755#ifndef YY_NO_PUSH_STATE
756static void yy_push_state YY_PROTO(( int new_state ));
757#endif
758#ifndef YY_NO_POP_STATE
759static void yy_pop_state YY_PROTO(( void ));
760#endif
761#ifndef YY_NO_TOP_STATE
762static int yy_top_state YY_PROTO(( void ));
763#endif
764
765#else
766#define YY_NO_PUSH_STATE 1
767#define YY_NO_POP_STATE 1
768#define YY_NO_TOP_STATE 1
769#endif
770
771#ifdef YY_MALLOC_DECL
772YY_MALLOC_DECL
773#else
774#if __STDC__
775#ifndef __cplusplus
776#include <stdlib.h>
777#endif
778#else
779/* Just try to get by without declaring the routines.  This will fail
780 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
781 * or sizeof(void*) != sizeof(int).
782 */
783#endif
784#endif
785
786/* Amount of stuff to slurp up with each read. */
787#ifndef YY_READ_BUF_SIZE
788#define YY_READ_BUF_SIZE 8192
789#endif
790
791/* Copy whatever the last rule matched to the standard output. */
792
793#ifndef ECHO
794/* This used to be an fputs(), but since the string might contain NUL's,
795 * we now use fwrite().
796 */
797#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
798#endif
799
800/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
801 * is returned in "result".
802 */
803#ifndef YY_INPUT
804#define YY_INPUT(buf,result,max_size) \
805	if ( yy_current_buffer->yy_is_interactive ) \
806		{ \
807		int c = '*', n; \
808		for ( n = 0; n < max_size && \
809			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
810			buf[n] = (char) c; \
811		if ( c == '\n' ) \
812			buf[n++] = (char) c; \
813		if ( c == EOF && ferror( yyin ) ) \
814			YY_FATAL_ERROR( "input in flex scanner failed" ); \
815		result = n; \
816		} \
817	else \
818		{ \
819		errno=0; \
820		while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
821			{ \
822			if( errno != EINTR) \
823				{ \
824				YY_FATAL_ERROR( "input in flex scanner failed" ); \
825				break; \
826				} \
827			errno=0; \
828			clearerr(yyin); \
829			} \
830		}
831#endif
832
833/* No semi-colon after return; correct usage is to write "yyterminate();" -
834 * we don't want an extra ';' after the "return" because that will cause
835 * some compilers to complain about unreachable statements.
836 */
837#ifndef yyterminate
838#define yyterminate() return YY_NULL
839#endif
840
841/* Number of entries by which start-condition stack grows. */
842#ifndef YY_START_STACK_INCR
843#define YY_START_STACK_INCR 25
844#endif
845
846/* Report a fatal error. */
847#ifndef YY_FATAL_ERROR
848#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
849#endif
850
851/* Default declaration of generated scanner - a define so the user can
852 * easily add parameters.
853 */
854#ifndef YY_DECL
855#define YY_DECL int yylex YY_PROTO(( void ))
856#endif
857
858/* Code executed at the beginning of each rule, after yytext and yyleng
859 * have been set up.
860 */
861#ifndef YY_USER_ACTION
862#define YY_USER_ACTION
863#endif
864
865/* Code executed at the end of each rule. */
866#ifndef YY_BREAK
867#define YY_BREAK break;
868#endif
869
870#define YY_RULE_SETUP \
871	YY_USER_ACTION
872
873YY_DECL
874	{
875	register yy_state_type yy_current_state;
876	register char *yy_cp, *yy_bp;
877	register int yy_act;
878
879#line 75 "rclex.l"
880
881
882#line 883 "lex.yy.c"
883
884	if ( yy_init )
885		{
886		yy_init = 0;
887
888#ifdef YY_USER_INIT
889		YY_USER_INIT;
890#endif
891
892		if ( ! yy_start )
893			yy_start = 1;	/* first start state */
894
895		if ( ! yyin )
896			yyin = stdin;
897
898		if ( ! yyout )
899			yyout = stdout;
900
901		if ( ! yy_current_buffer )
902			yy_current_buffer =
903				yy_create_buffer( yyin, YY_BUF_SIZE );
904
905		yy_load_buffer_state();
906		}
907
908	while ( 1 )		/* loops until end-of-file is reached */
909		{
910		yy_cp = yy_c_buf_p;
911
912		/* Support of yytext. */
913		*yy_cp = yy_hold_char;
914
915		/* yy_bp points to the position in yy_ch_buf of the start of
916		 * the current run.
917		 */
918		yy_bp = yy_cp;
919
920		yy_current_state = yy_start;
921yy_match:
922		do
923			{
924			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
925			if ( yy_accept[yy_current_state] )
926				{
927				yy_last_accepting_state = yy_current_state;
928				yy_last_accepting_cpos = yy_cp;
929				}
930			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
931				{
932				yy_current_state = (int) yy_def[yy_current_state];
933				if ( yy_current_state >= 470 )
934					yy_c = yy_meta[(unsigned int) yy_c];
935				}
936			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
937			++yy_cp;
938			}
939		while ( yy_base[yy_current_state] != 516 );
940
941yy_find_action:
942		yy_act = yy_accept[yy_current_state];
943		if ( yy_act == 0 )
944			{ /* have to back up */
945			yy_cp = yy_last_accepting_cpos;
946			yy_current_state = yy_last_accepting_state;
947			yy_act = yy_accept[yy_current_state];
948			}
949
950		YY_DO_BEFORE_ACTION;
951
952
953do_action:	/* This label is used only to access EOF actions. */
954
955
956		switch ( yy_act )
957	{ /* beginning of action switch */
958			case 0: /* must back up */
959			/* undo the effects of YY_DO_BEFORE_ACTION */
960			*yy_cp = yy_hold_char;
961			yy_cp = yy_last_accepting_cpos;
962			yy_current_state = yy_last_accepting_state;
963			goto yy_find_action;
964
965case 1:
966YY_RULE_SETUP
967#line 77 "rclex.l"
968{ MAYBE_RETURN (BEG); }
969	YY_BREAK
970case 2:
971YY_RULE_SETUP
972#line 78 "rclex.l"
973{ MAYBE_RETURN (BEG); }
974	YY_BREAK
975case 3:
976YY_RULE_SETUP
977#line 79 "rclex.l"
978{ MAYBE_RETURN (END); }
979	YY_BREAK
980case 4:
981YY_RULE_SETUP
982#line 80 "rclex.l"
983{ MAYBE_RETURN (END); }
984	YY_BREAK
985case 5:
986YY_RULE_SETUP
987#line 81 "rclex.l"
988{ MAYBE_RETURN (ACCELERATORS); }
989	YY_BREAK
990case 6:
991YY_RULE_SETUP
992#line 82 "rclex.l"
993{ MAYBE_RETURN (VIRTKEY); }
994	YY_BREAK
995case 7:
996YY_RULE_SETUP
997#line 83 "rclex.l"
998{ MAYBE_RETURN (ASCII); }
999	YY_BREAK
1000case 8:
1001YY_RULE_SETUP
1002#line 84 "rclex.l"
1003{ MAYBE_RETURN (NOINVERT); }
1004	YY_BREAK
1005case 9:
1006YY_RULE_SETUP
1007#line 85 "rclex.l"
1008{ MAYBE_RETURN (SHIFT); }
1009	YY_BREAK
1010case 10:
1011YY_RULE_SETUP
1012#line 86 "rclex.l"
1013{ MAYBE_RETURN (CONTROL); }
1014	YY_BREAK
1015case 11:
1016YY_RULE_SETUP
1017#line 87 "rclex.l"
1018{ MAYBE_RETURN (ALT); }
1019	YY_BREAK
1020case 12:
1021YY_RULE_SETUP
1022#line 88 "rclex.l"
1023{ MAYBE_RETURN (BITMAP); }
1024	YY_BREAK
1025case 13:
1026YY_RULE_SETUP
1027#line 89 "rclex.l"
1028{ MAYBE_RETURN (CURSOR); }
1029	YY_BREAK
1030case 14:
1031YY_RULE_SETUP
1032#line 90 "rclex.l"
1033{ MAYBE_RETURN (DIALOG); }
1034	YY_BREAK
1035case 15:
1036YY_RULE_SETUP
1037#line 91 "rclex.l"
1038{ MAYBE_RETURN (DIALOGEX); }
1039	YY_BREAK
1040case 16:
1041YY_RULE_SETUP
1042#line 92 "rclex.l"
1043{ MAYBE_RETURN (EXSTYLE); }
1044	YY_BREAK
1045case 17:
1046YY_RULE_SETUP
1047#line 93 "rclex.l"
1048{ MAYBE_RETURN (CAPTION); }
1049	YY_BREAK
1050case 18:
1051YY_RULE_SETUP
1052#line 94 "rclex.l"
1053{ MAYBE_RETURN (CLASS); }
1054	YY_BREAK
1055case 19:
1056YY_RULE_SETUP
1057#line 95 "rclex.l"
1058{ MAYBE_RETURN (STYLE); }
1059	YY_BREAK
1060case 20:
1061YY_RULE_SETUP
1062#line 96 "rclex.l"
1063{ MAYBE_RETURN (AUTO3STATE); }
1064	YY_BREAK
1065case 21:
1066YY_RULE_SETUP
1067#line 97 "rclex.l"
1068{ MAYBE_RETURN (AUTOCHECKBOX); }
1069	YY_BREAK
1070case 22:
1071YY_RULE_SETUP
1072#line 98 "rclex.l"
1073{ MAYBE_RETURN (AUTORADIOBUTTON); }
1074	YY_BREAK
1075case 23:
1076YY_RULE_SETUP
1077#line 99 "rclex.l"
1078{ MAYBE_RETURN (CHECKBOX); }
1079	YY_BREAK
1080case 24:
1081YY_RULE_SETUP
1082#line 100 "rclex.l"
1083{ MAYBE_RETURN (COMBOBOX); }
1084	YY_BREAK
1085case 25:
1086YY_RULE_SETUP
1087#line 101 "rclex.l"
1088{ MAYBE_RETURN (CTEXT); }
1089	YY_BREAK
1090case 26:
1091YY_RULE_SETUP
1092#line 102 "rclex.l"
1093{ MAYBE_RETURN (DEFPUSHBUTTON); }
1094	YY_BREAK
1095case 27:
1096YY_RULE_SETUP
1097#line 103 "rclex.l"
1098{ MAYBE_RETURN (EDITTEXT); }
1099	YY_BREAK
1100case 28:
1101YY_RULE_SETUP
1102#line 104 "rclex.l"
1103{ MAYBE_RETURN (GROUPBOX); }
1104	YY_BREAK
1105case 29:
1106YY_RULE_SETUP
1107#line 105 "rclex.l"
1108{ MAYBE_RETURN (LISTBOX); }
1109	YY_BREAK
1110case 30:
1111YY_RULE_SETUP
1112#line 106 "rclex.l"
1113{ MAYBE_RETURN (LTEXT); }
1114	YY_BREAK
1115case 31:
1116YY_RULE_SETUP
1117#line 107 "rclex.l"
1118{ MAYBE_RETURN (PUSHBOX); }
1119	YY_BREAK
1120case 32:
1121YY_RULE_SETUP
1122#line 108 "rclex.l"
1123{ MAYBE_RETURN (PUSHBUTTON); }
1124	YY_BREAK
1125case 33:
1126YY_RULE_SETUP
1127#line 109 "rclex.l"
1128{ MAYBE_RETURN (RADIOBUTTON); }
1129	YY_BREAK
1130case 34:
1131YY_RULE_SETUP
1132#line 110 "rclex.l"
1133{ MAYBE_RETURN (RTEXT); }
1134	YY_BREAK
1135case 35:
1136YY_RULE_SETUP
1137#line 111 "rclex.l"
1138{ MAYBE_RETURN (SCROLLBAR); }
1139	YY_BREAK
1140case 36:
1141YY_RULE_SETUP
1142#line 112 "rclex.l"
1143{ MAYBE_RETURN (STATE3); }
1144	YY_BREAK
1145case 37:
1146YY_RULE_SETUP
1147#line 113 "rclex.l"
1148{ MAYBE_RETURN (USERBUTTON); }
1149	YY_BREAK
1150case 38:
1151YY_RULE_SETUP
1152#line 114 "rclex.l"
1153{ MAYBE_RETURN (BEDIT); }
1154	YY_BREAK
1155case 39:
1156YY_RULE_SETUP
1157#line 115 "rclex.l"
1158{ MAYBE_RETURN (HEDIT); }
1159	YY_BREAK
1160case 40:
1161YY_RULE_SETUP
1162#line 116 "rclex.l"
1163{ MAYBE_RETURN (IEDIT); }
1164	YY_BREAK
1165case 41:
1166YY_RULE_SETUP
1167#line 117 "rclex.l"
1168{ MAYBE_RETURN (FONT); }
1169	YY_BREAK
1170case 42:
1171YY_RULE_SETUP
1172#line 118 "rclex.l"
1173{ MAYBE_RETURN (ICON); }
1174	YY_BREAK
1175case 43:
1176YY_RULE_SETUP
1177#line 119 "rclex.l"
1178{ MAYBE_RETURN (LANGUAGE); }
1179	YY_BREAK
1180case 44:
1181YY_RULE_SETUP
1182#line 120 "rclex.l"
1183{ MAYBE_RETURN (CHARACTERISTICS); }
1184	YY_BREAK
1185case 45:
1186YY_RULE_SETUP
1187#line 121 "rclex.l"
1188{ MAYBE_RETURN (VERSIONK); }
1189	YY_BREAK
1190case 46:
1191YY_RULE_SETUP
1192#line 122 "rclex.l"
1193{ MAYBE_RETURN (MENU); }
1194	YY_BREAK
1195case 47:
1196YY_RULE_SETUP
1197#line 123 "rclex.l"
1198{ MAYBE_RETURN (MENUEX); }
1199	YY_BREAK
1200case 48:
1201YY_RULE_SETUP
1202#line 124 "rclex.l"
1203{ MAYBE_RETURN (MENUITEM); }
1204	YY_BREAK
1205case 49:
1206YY_RULE_SETUP
1207#line 125 "rclex.l"
1208{ MAYBE_RETURN (SEPARATOR); }
1209	YY_BREAK
1210case 50:
1211YY_RULE_SETUP
1212#line 126 "rclex.l"
1213{ MAYBE_RETURN (POPUP); }
1214	YY_BREAK
1215case 51:
1216YY_RULE_SETUP
1217#line 127 "rclex.l"
1218{ MAYBE_RETURN (CHECKED); }
1219	YY_BREAK
1220case 52:
1221YY_RULE_SETUP
1222#line 128 "rclex.l"
1223{ MAYBE_RETURN (GRAYED); }
1224	YY_BREAK
1225case 53:
1226YY_RULE_SETUP
1227#line 129 "rclex.l"
1228{ MAYBE_RETURN (HELP); }
1229	YY_BREAK
1230case 54:
1231YY_RULE_SETUP
1232#line 130 "rclex.l"
1233{ MAYBE_RETURN (INACTIVE); }
1234	YY_BREAK
1235case 55:
1236YY_RULE_SETUP
1237#line 131 "rclex.l"
1238{ MAYBE_RETURN (MENUBARBREAK); }
1239	YY_BREAK
1240case 56:
1241YY_RULE_SETUP
1242#line 132 "rclex.l"
1243{ MAYBE_RETURN (MENUBREAK); }
1244	YY_BREAK
1245case 57:
1246YY_RULE_SETUP
1247#line 133 "rclex.l"
1248{ MAYBE_RETURN (MESSAGETABLE); }
1249	YY_BREAK
1250case 58:
1251YY_RULE_SETUP
1252#line 134 "rclex.l"
1253{ MAYBE_RETURN (RCDATA); }
1254	YY_BREAK
1255case 59:
1256YY_RULE_SETUP
1257#line 135 "rclex.l"
1258{ MAYBE_RETURN (STRINGTABLE); }
1259	YY_BREAK
1260case 60:
1261YY_RULE_SETUP
1262#line 136 "rclex.l"
1263{ MAYBE_RETURN (VERSIONINFO); }
1264	YY_BREAK
1265case 61:
1266YY_RULE_SETUP
1267#line 137 "rclex.l"
1268{ MAYBE_RETURN (FILEVERSION); }
1269	YY_BREAK
1270case 62:
1271YY_RULE_SETUP
1272#line 138 "rclex.l"
1273{ MAYBE_RETURN (PRODUCTVERSION); }
1274	YY_BREAK
1275case 63:
1276YY_RULE_SETUP
1277#line 139 "rclex.l"
1278{ MAYBE_RETURN (FILEFLAGSMASK); }
1279	YY_BREAK
1280case 64:
1281YY_RULE_SETUP
1282#line 140 "rclex.l"
1283{ MAYBE_RETURN (FILEFLAGS); }
1284	YY_BREAK
1285case 65:
1286YY_RULE_SETUP
1287#line 141 "rclex.l"
1288{ MAYBE_RETURN (FILEOS); }
1289	YY_BREAK
1290case 66:
1291YY_RULE_SETUP
1292#line 142 "rclex.l"
1293{ MAYBE_RETURN (FILETYPE); }
1294	YY_BREAK
1295case 67:
1296YY_RULE_SETUP
1297#line 143 "rclex.l"
1298{ MAYBE_RETURN (FILESUBTYPE); }
1299	YY_BREAK
1300case 68:
1301YY_RULE_SETUP
1302#line 144 "rclex.l"
1303{ MAYBE_RETURN (VALUE); }
1304	YY_BREAK
1305case 69:
1306YY_RULE_SETUP
1307#line 145 "rclex.l"
1308{ MAYBE_RETURN (MOVEABLE); }
1309	YY_BREAK
1310case 70:
1311YY_RULE_SETUP
1312#line 146 "rclex.l"
1313{ MAYBE_RETURN (FIXED); }
1314	YY_BREAK
1315case 71:
1316YY_RULE_SETUP
1317#line 147 "rclex.l"
1318{ MAYBE_RETURN (PURE); }
1319	YY_BREAK
1320case 72:
1321YY_RULE_SETUP
1322#line 148 "rclex.l"
1323{ MAYBE_RETURN (IMPURE); }
1324	YY_BREAK
1325case 73:
1326YY_RULE_SETUP
1327#line 149 "rclex.l"
1328{ MAYBE_RETURN (PRELOAD); }
1329	YY_BREAK
1330case 74:
1331YY_RULE_SETUP
1332#line 150 "rclex.l"
1333{ MAYBE_RETURN (LOADONCALL); }
1334	YY_BREAK
1335case 75:
1336YY_RULE_SETUP
1337#line 151 "rclex.l"
1338{ MAYBE_RETURN (DISCARDABLE); }
1339	YY_BREAK
1340case 76:
1341YY_RULE_SETUP
1342#line 152 "rclex.l"
1343{ MAYBE_RETURN (NOT); }
1344	YY_BREAK
1345case 77:
1346YY_RULE_SETUP
1347#line 154 "rclex.l"
1348{
1349			  char *s, *send;
1350
1351			  /* This is a hack to let us parse version
1352                             information easily.  */
1353
1354			  s = strchr (yytext, '"');
1355			  ++s;
1356			  send = strchr (s, '"');
1357			  if (strncmp (s, "StringFileInfo",
1358				       sizeof "StringFileInfo" - 1) == 0
1359			      && s + sizeof "StringFileInfo" - 1 == send)
1360			    MAYBE_RETURN (BLOCKSTRINGFILEINFO);
1361			  else if (strncmp (s, "VarFileInfo",
1362					    sizeof "VarFileInfo" - 1) == 0
1363				   && s + sizeof "VarFileInfo" - 1 == send)
1364			    MAYBE_RETURN (BLOCKVARFILEINFO);
1365			  else
1366			    {
1367			      char *r;
1368
1369			      r = get_string (send - s + 1);
1370			      strncpy (r, s, send - s);
1371			      r[send - s] = '\0';
1372			      yylval.s = r;
1373			      MAYBE_RETURN (BLOCK);
1374			    }
1375			}
1376	YY_BREAK
1377case 78:
1378YY_RULE_SETUP
1379#line 183 "rclex.l"
1380{
1381			  cpp_line (yytext);
1382			}
1383	YY_BREAK
1384case 79:
1385YY_RULE_SETUP
1386#line 187 "rclex.l"
1387{
1388			  yylval.i.val = strtoul (yytext, 0, 0);
1389			  yylval.i.dword = 1;
1390			  MAYBE_RETURN (NUMBER);
1391			}
1392	YY_BREAK
1393case 80:
1394YY_RULE_SETUP
1395#line 193 "rclex.l"
1396{
1397			  yylval.i.val = strtoul (yytext, 0, 0);
1398			  yylval.i.dword = 0;
1399			  MAYBE_RETURN (NUMBER);
1400			}
1401	YY_BREAK
1402case 81:
1403YY_RULE_SETUP
1404#line 199 "rclex.l"
1405{
1406			  char *s;
1407			  unsigned long length;
1408
1409			  s = handle_quotes (yytext, &length);
1410			  if (! rcdata_mode)
1411			    {
1412			      yylval.s = s;
1413			      MAYBE_RETURN (QUOTEDSTRING);
1414			    }
1415			  else
1416			    {
1417			      yylval.ss.length = length;
1418			      yylval.ss.s = s;
1419			      MAYBE_RETURN (SIZEDSTRING);
1420			    }
1421			}
1422	YY_BREAK
1423case 82:
1424YY_RULE_SETUP
1425#line 217 "rclex.l"
1426{
1427			  char *s;
1428
1429			  /* I rejected comma in a string in order to
1430			     handle VIRTKEY, CONTROL in an accelerator
1431			     resource.  This means that an unquoted
1432			     file name can not contain a comma.  I
1433			     don't know what rc permits.  */
1434
1435			  s = get_string (strlen (yytext) + 1);
1436			  strcpy (s, yytext);
1437			  yylval.s = s;
1438			  MAYBE_RETURN (STRING);
1439			}
1440	YY_BREAK
1441case 83:
1442YY_RULE_SETUP
1443#line 232 "rclex.l"
1444{ ++rc_lineno; }
1445	YY_BREAK
1446case 84:
1447YY_RULE_SETUP
1448#line 233 "rclex.l"
1449{ /* ignore whitespace */ }
1450	YY_BREAK
1451case 85:
1452YY_RULE_SETUP
1453#line 234 "rclex.l"
1454{ MAYBE_RETURN (*yytext); }
1455	YY_BREAK
1456case 86:
1457YY_RULE_SETUP
1458#line 236 "rclex.l"
1459ECHO;
1460	YY_BREAK
1461#line 1462 "lex.yy.c"
1462case YY_STATE_EOF(INITIAL):
1463	yyterminate();
1464
1465	case YY_END_OF_BUFFER:
1466		{
1467		/* Amount of text matched not including the EOB char. */
1468		int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1469
1470		/* Undo the effects of YY_DO_BEFORE_ACTION. */
1471		*yy_cp = yy_hold_char;
1472		YY_RESTORE_YY_MORE_OFFSET
1473
1474		if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1475			{
1476			/* We're scanning a new file or input source.  It's
1477			 * possible that this happened because the user
1478			 * just pointed yyin at a new source and called
1479			 * yylex().  If so, then we have to assure
1480			 * consistency between yy_current_buffer and our
1481			 * globals.  Here is the right place to do so, because
1482			 * this is the first action (other than possibly a
1483			 * back-up) that will match for the new input source.
1484			 */
1485			yy_n_chars = yy_current_buffer->yy_n_chars;
1486			yy_current_buffer->yy_input_file = yyin;
1487			yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1488			}
1489
1490		/* Note that here we test for yy_c_buf_p "<=" to the position
1491		 * of the first EOB in the buffer, since yy_c_buf_p will
1492		 * already have been incremented past the NUL character
1493		 * (since all states make transitions on EOB to the
1494		 * end-of-buffer state).  Contrast this with the test
1495		 * in input().
1496		 */
1497		if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1498			{ /* This was really a NUL. */
1499			yy_state_type yy_next_state;
1500
1501			yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1502
1503			yy_current_state = yy_get_previous_state();
1504
1505			/* Okay, we're now positioned to make the NUL
1506			 * transition.  We couldn't have
1507			 * yy_get_previous_state() go ahead and do it
1508			 * for us because it doesn't know how to deal
1509			 * with the possibility of jamming (and we don't
1510			 * want to build jamming into it because then it
1511			 * will run more slowly).
1512			 */
1513
1514			yy_next_state = yy_try_NUL_trans( yy_current_state );
1515
1516			yy_bp = yytext_ptr + YY_MORE_ADJ;
1517
1518			if ( yy_next_state )
1519				{
1520				/* Consume the NUL. */
1521				yy_cp = ++yy_c_buf_p;
1522				yy_current_state = yy_next_state;
1523				goto yy_match;
1524				}
1525
1526			else
1527				{
1528				yy_cp = yy_c_buf_p;
1529				goto yy_find_action;
1530				}
1531			}
1532
1533		else switch ( yy_get_next_buffer() )
1534			{
1535			case EOB_ACT_END_OF_FILE:
1536				{
1537				yy_did_buffer_switch_on_eof = 0;
1538
1539				if ( yywrap() )
1540					{
1541					/* Note: because we've taken care in
1542					 * yy_get_next_buffer() to have set up
1543					 * yytext, we can now set up
1544					 * yy_c_buf_p so that if some total
1545					 * hoser (like flex itself) wants to
1546					 * call the scanner after we return the
1547					 * YY_NULL, it'll still work - another
1548					 * YY_NULL will get returned.
1549					 */
1550					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1551
1552					yy_act = YY_STATE_EOF(YY_START);
1553					goto do_action;
1554					}
1555
1556				else
1557					{
1558					if ( ! yy_did_buffer_switch_on_eof )
1559						YY_NEW_FILE;
1560					}
1561				break;
1562				}
1563
1564			case EOB_ACT_CONTINUE_SCAN:
1565				yy_c_buf_p =
1566					yytext_ptr + yy_amount_of_matched_text;
1567
1568				yy_current_state = yy_get_previous_state();
1569
1570				yy_cp = yy_c_buf_p;
1571				yy_bp = yytext_ptr + YY_MORE_ADJ;
1572				goto yy_match;
1573
1574			case EOB_ACT_LAST_MATCH:
1575				yy_c_buf_p =
1576				&yy_current_buffer->yy_ch_buf[yy_n_chars];
1577
1578				yy_current_state = yy_get_previous_state();
1579
1580				yy_cp = yy_c_buf_p;
1581				yy_bp = yytext_ptr + YY_MORE_ADJ;
1582				goto yy_find_action;
1583			}
1584		break;
1585		}
1586
1587	default:
1588		YY_FATAL_ERROR(
1589			"fatal flex scanner internal error--no action found" );
1590	} /* end of action switch */
1591		} /* end of scanning one token */
1592	} /* end of yylex */
1593
1594
1595/* yy_get_next_buffer - try to read in a new buffer
1596 *
1597 * Returns a code representing an action:
1598 *	EOB_ACT_LAST_MATCH -
1599 *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1600 *	EOB_ACT_END_OF_FILE - end of file
1601 */
1602
1603static int yy_get_next_buffer()
1604	{
1605	register char *dest = yy_current_buffer->yy_ch_buf;
1606	register char *source = yytext_ptr;
1607	register int number_to_move, i;
1608	int ret_val;
1609
1610	if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1611		YY_FATAL_ERROR(
1612		"fatal flex scanner internal error--end of buffer missed" );
1613
1614	if ( yy_current_buffer->yy_fill_buffer == 0 )
1615		{ /* Don't try to fill the buffer, so this is an EOF. */
1616		if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1617			{
1618			/* We matched a single character, the EOB, so
1619			 * treat this as a final EOF.
1620			 */
1621			return EOB_ACT_END_OF_FILE;
1622			}
1623
1624		else
1625			{
1626			/* We matched some text prior to the EOB, first
1627			 * process it.
1628			 */
1629			return EOB_ACT_LAST_MATCH;
1630			}
1631		}
1632
1633	/* Try to read more data. */
1634
1635	/* First move last chars to start of buffer. */
1636	number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1637
1638	for ( i = 0; i < number_to_move; ++i )
1639		*(dest++) = *(source++);
1640
1641	if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1642		/* don't do the read, it's not guaranteed to return an EOF,
1643		 * just force an EOF
1644		 */
1645		yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1646
1647	else
1648		{
1649		int num_to_read =
1650			yy_current_buffer->yy_buf_size - number_to_move - 1;
1651
1652		while ( num_to_read <= 0 )
1653			{ /* Not enough room in the buffer - grow it. */
1654#ifdef YY_USES_REJECT
1655			YY_FATAL_ERROR(
1656"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1657#else
1658
1659			/* just a shorter name for the current buffer */
1660			YY_BUFFER_STATE b = yy_current_buffer;
1661
1662			int yy_c_buf_p_offset =
1663				(int) (yy_c_buf_p - b->yy_ch_buf);
1664
1665			if ( b->yy_is_our_buffer )
1666				{
1667				int new_size = b->yy_buf_size * 2;
1668
1669				if ( new_size <= 0 )
1670					b->yy_buf_size += b->yy_buf_size / 8;
1671				else
1672					b->yy_buf_size *= 2;
1673
1674				b->yy_ch_buf = (char *)
1675					/* Include room in for 2 EOB chars. */
1676					yy_flex_realloc( (void *) b->yy_ch_buf,
1677							 b->yy_buf_size + 2 );
1678				}
1679			else
1680				/* Can't grow it, we don't own it. */
1681				b->yy_ch_buf = 0;
1682
1683			if ( ! b->yy_ch_buf )
1684				YY_FATAL_ERROR(
1685				"fatal error - scanner input buffer overflow" );
1686
1687			yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1688
1689			num_to_read = yy_current_buffer->yy_buf_size -
1690						number_to_move - 1;
1691#endif
1692			}
1693
1694		if ( num_to_read > YY_READ_BUF_SIZE )
1695			num_to_read = YY_READ_BUF_SIZE;
1696
1697		/* Read in more data. */
1698		YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1699			yy_n_chars, num_to_read );
1700
1701		yy_current_buffer->yy_n_chars = yy_n_chars;
1702		}
1703
1704	if ( yy_n_chars == 0 )
1705		{
1706		if ( number_to_move == YY_MORE_ADJ )
1707			{
1708			ret_val = EOB_ACT_END_OF_FILE;
1709			yyrestart( yyin );
1710			}
1711
1712		else
1713			{
1714			ret_val = EOB_ACT_LAST_MATCH;
1715			yy_current_buffer->yy_buffer_status =
1716				YY_BUFFER_EOF_PENDING;
1717			}
1718		}
1719
1720	else
1721		ret_val = EOB_ACT_CONTINUE_SCAN;
1722
1723	yy_n_chars += number_to_move;
1724	yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1725	yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1726
1727	yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1728
1729	return ret_val;
1730	}
1731
1732
1733/* yy_get_previous_state - get the state just before the EOB char was reached */
1734
1735static yy_state_type yy_get_previous_state()
1736	{
1737	register yy_state_type yy_current_state;
1738	register char *yy_cp;
1739
1740	yy_current_state = yy_start;
1741
1742	for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1743		{
1744		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1745		if ( yy_accept[yy_current_state] )
1746			{
1747			yy_last_accepting_state = yy_current_state;
1748			yy_last_accepting_cpos = yy_cp;
1749			}
1750		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1751			{
1752			yy_current_state = (int) yy_def[yy_current_state];
1753			if ( yy_current_state >= 470 )
1754				yy_c = yy_meta[(unsigned int) yy_c];
1755			}
1756		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1757		}
1758
1759	return yy_current_state;
1760	}
1761
1762
1763/* yy_try_NUL_trans - try to make a transition on the NUL character
1764 *
1765 * synopsis
1766 *	next_state = yy_try_NUL_trans( current_state );
1767 */
1768
1769#ifdef YY_USE_PROTOS
1770static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1771#else
1772static yy_state_type yy_try_NUL_trans( yy_current_state )
1773yy_state_type yy_current_state;
1774#endif
1775	{
1776	register int yy_is_jam;
1777	register char *yy_cp = yy_c_buf_p;
1778
1779	register YY_CHAR yy_c = 1;
1780	if ( yy_accept[yy_current_state] )
1781		{
1782		yy_last_accepting_state = yy_current_state;
1783		yy_last_accepting_cpos = yy_cp;
1784		}
1785	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1786		{
1787		yy_current_state = (int) yy_def[yy_current_state];
1788		if ( yy_current_state >= 470 )
1789			yy_c = yy_meta[(unsigned int) yy_c];
1790		}
1791	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1792	yy_is_jam = (yy_current_state == 469);
1793
1794	return yy_is_jam ? 0 : yy_current_state;
1795	}
1796
1797
1798#ifndef YY_NO_UNPUT
1799#ifdef YY_USE_PROTOS
1800static void yyunput( int c, register char *yy_bp )
1801#else
1802static void yyunput( c, yy_bp )
1803int c;
1804register char *yy_bp;
1805#endif
1806	{
1807	register char *yy_cp = yy_c_buf_p;
1808
1809	/* undo effects of setting up yytext */
1810	*yy_cp = yy_hold_char;
1811
1812	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1813		{ /* need to shift things up to make room */
1814		/* +2 for EOB chars. */
1815		register int number_to_move = yy_n_chars + 2;
1816		register char *dest = &yy_current_buffer->yy_ch_buf[
1817					yy_current_buffer->yy_buf_size + 2];
1818		register char *source =
1819				&yy_current_buffer->yy_ch_buf[number_to_move];
1820
1821		while ( source > yy_current_buffer->yy_ch_buf )
1822			*--dest = *--source;
1823
1824		yy_cp += (int) (dest - source);
1825		yy_bp += (int) (dest - source);
1826		yy_current_buffer->yy_n_chars =
1827			yy_n_chars = yy_current_buffer->yy_buf_size;
1828
1829		if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1830			YY_FATAL_ERROR( "flex scanner push-back overflow" );
1831		}
1832
1833	*--yy_cp = (char) c;
1834
1835
1836	yytext_ptr = yy_bp;
1837	yy_hold_char = *yy_cp;
1838	yy_c_buf_p = yy_cp;
1839	}
1840#endif	/* ifndef YY_NO_UNPUT */
1841
1842
1843#ifdef __cplusplus
1844static int yyinput()
1845#else
1846static int input()
1847#endif
1848	{
1849	int c;
1850
1851	*yy_c_buf_p = yy_hold_char;
1852
1853	if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1854		{
1855		/* yy_c_buf_p now points to the character we want to return.
1856		 * If this occurs *before* the EOB characters, then it's a
1857		 * valid NUL; if not, then we've hit the end of the buffer.
1858		 */
1859		if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1860			/* This was really a NUL. */
1861			*yy_c_buf_p = '\0';
1862
1863		else
1864			{ /* need more input */
1865			int offset = yy_c_buf_p - yytext_ptr;
1866			++yy_c_buf_p;
1867
1868			switch ( yy_get_next_buffer() )
1869				{
1870				case EOB_ACT_LAST_MATCH:
1871					/* This happens because yy_g_n_b()
1872					 * sees that we've accumulated a
1873					 * token and flags that we need to
1874					 * try matching the token before
1875					 * proceeding.  But for input(),
1876					 * there's no matching to consider.
1877					 * So convert the EOB_ACT_LAST_MATCH
1878					 * to EOB_ACT_END_OF_FILE.
1879					 */
1880
1881					/* Reset buffer status. */
1882					yyrestart( yyin );
1883
1884					/* fall through */
1885
1886				case EOB_ACT_END_OF_FILE:
1887					{
1888					if ( yywrap() )
1889						return EOF;
1890
1891					if ( ! yy_did_buffer_switch_on_eof )
1892						YY_NEW_FILE;
1893#ifdef __cplusplus
1894					return yyinput();
1895#else
1896					return input();
1897#endif
1898					}
1899
1900				case EOB_ACT_CONTINUE_SCAN:
1901					yy_c_buf_p = yytext_ptr + offset;
1902					break;
1903				}
1904			}
1905		}
1906
1907	c = *(unsigned char *) yy_c_buf_p;	/* cast for 8-bit char's */
1908	*yy_c_buf_p = '\0';	/* preserve yytext */
1909	yy_hold_char = *++yy_c_buf_p;
1910
1911
1912	return c;
1913	}
1914
1915
1916#ifdef YY_USE_PROTOS
1917void yyrestart( FILE *input_file )
1918#else
1919void yyrestart( input_file )
1920FILE *input_file;
1921#endif
1922	{
1923	if ( ! yy_current_buffer )
1924		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1925
1926	yy_init_buffer( yy_current_buffer, input_file );
1927	yy_load_buffer_state();
1928	}
1929
1930
1931#ifdef YY_USE_PROTOS
1932void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1933#else
1934void yy_switch_to_buffer( new_buffer )
1935YY_BUFFER_STATE new_buffer;
1936#endif
1937	{
1938	if ( yy_current_buffer == new_buffer )
1939		return;
1940
1941	if ( yy_current_buffer )
1942		{
1943		/* Flush out information for old buffer. */
1944		*yy_c_buf_p = yy_hold_char;
1945		yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1946		yy_current_buffer->yy_n_chars = yy_n_chars;
1947		}
1948
1949	yy_current_buffer = new_buffer;
1950	yy_load_buffer_state();
1951
1952	/* We don't actually know whether we did this switch during
1953	 * EOF (yywrap()) processing, but the only time this flag
1954	 * is looked at is after yywrap() is called, so it's safe
1955	 * to go ahead and always set it.
1956	 */
1957	yy_did_buffer_switch_on_eof = 1;
1958	}
1959
1960
1961#ifdef YY_USE_PROTOS
1962void yy_load_buffer_state( void )
1963#else
1964void yy_load_buffer_state()
1965#endif
1966	{
1967	yy_n_chars = yy_current_buffer->yy_n_chars;
1968	yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1969	yyin = yy_current_buffer->yy_input_file;
1970	yy_hold_char = *yy_c_buf_p;
1971	}
1972
1973
1974#ifdef YY_USE_PROTOS
1975YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1976#else
1977YY_BUFFER_STATE yy_create_buffer( file, size )
1978FILE *file;
1979int size;
1980#endif
1981	{
1982	YY_BUFFER_STATE b;
1983
1984	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1985	if ( ! b )
1986		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1987
1988	b->yy_buf_size = size;
1989
1990	/* yy_ch_buf has to be 2 characters longer than the size given because
1991	 * we need to put in 2 end-of-buffer characters.
1992	 */
1993	b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1994	if ( ! b->yy_ch_buf )
1995		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1996
1997	b->yy_is_our_buffer = 1;
1998
1999	yy_init_buffer( b, file );
2000
2001	return b;
2002	}
2003
2004
2005#ifdef YY_USE_PROTOS
2006void yy_delete_buffer( YY_BUFFER_STATE b )
2007#else
2008void yy_delete_buffer( b )
2009YY_BUFFER_STATE b;
2010#endif
2011	{
2012	if ( ! b )
2013		return;
2014
2015	if ( b == yy_current_buffer )
2016		yy_current_buffer = (YY_BUFFER_STATE) 0;
2017
2018	if ( b->yy_is_our_buffer )
2019		yy_flex_free( (void *) b->yy_ch_buf );
2020
2021	yy_flex_free( (void *) b );
2022	}
2023
2024
2025#ifndef _WIN32
2026#include <unistd.h>
2027#else
2028#ifndef YY_ALWAYS_INTERACTIVE
2029#ifndef YY_NEVER_INTERACTIVE
2030extern int isatty YY_PROTO(( int ));
2031#endif
2032#endif
2033#endif
2034
2035#ifdef YY_USE_PROTOS
2036void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
2037#else
2038void yy_init_buffer( b, file )
2039YY_BUFFER_STATE b;
2040FILE *file;
2041#endif
2042
2043
2044	{
2045	yy_flush_buffer( b );
2046
2047	b->yy_input_file = file;
2048	b->yy_fill_buffer = 1;
2049
2050#if YY_ALWAYS_INTERACTIVE
2051	b->yy_is_interactive = 1;
2052#else
2053#if YY_NEVER_INTERACTIVE
2054	b->yy_is_interactive = 0;
2055#else
2056	b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2057#endif
2058#endif
2059	}
2060
2061
2062#ifdef YY_USE_PROTOS
2063void yy_flush_buffer( YY_BUFFER_STATE b )
2064#else
2065void yy_flush_buffer( b )
2066YY_BUFFER_STATE b;
2067#endif
2068
2069	{
2070	if ( ! b )
2071		return;
2072
2073	b->yy_n_chars = 0;
2074
2075	/* We always need two end-of-buffer characters.  The first causes
2076	 * a transition to the end-of-buffer state.  The second causes
2077	 * a jam in that state.
2078	 */
2079	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2080	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2081
2082	b->yy_buf_pos = &b->yy_ch_buf[0];
2083
2084	b->yy_at_bol = 1;
2085	b->yy_buffer_status = YY_BUFFER_NEW;
2086
2087	if ( b == yy_current_buffer )
2088		yy_load_buffer_state();
2089	}
2090
2091
2092#ifndef YY_NO_SCAN_BUFFER
2093#ifdef YY_USE_PROTOS
2094YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
2095#else
2096YY_BUFFER_STATE yy_scan_buffer( base, size )
2097char *base;
2098yy_size_t size;
2099#endif
2100	{
2101	YY_BUFFER_STATE b;
2102
2103	if ( size < 2 ||
2104	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
2105	     base[size-1] != YY_END_OF_BUFFER_CHAR )
2106		/* They forgot to leave room for the EOB's. */
2107		return 0;
2108
2109	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2110	if ( ! b )
2111		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2112
2113	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
2114	b->yy_buf_pos = b->yy_ch_buf = base;
2115	b->yy_is_our_buffer = 0;
2116	b->yy_input_file = 0;
2117	b->yy_n_chars = b->yy_buf_size;
2118	b->yy_is_interactive = 0;
2119	b->yy_at_bol = 1;
2120	b->yy_fill_buffer = 0;
2121	b->yy_buffer_status = YY_BUFFER_NEW;
2122
2123	yy_switch_to_buffer( b );
2124
2125	return b;
2126	}
2127#endif
2128
2129
2130#ifndef YY_NO_SCAN_STRING
2131#ifdef YY_USE_PROTOS
2132YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
2133#else
2134YY_BUFFER_STATE yy_scan_string( yy_str )
2135yyconst char *yy_str;
2136#endif
2137	{
2138	int len;
2139	for ( len = 0; yy_str[len]; ++len )
2140		;
2141
2142	return yy_scan_bytes( yy_str, len );
2143	}
2144#endif
2145
2146
2147#ifndef YY_NO_SCAN_BYTES
2148#ifdef YY_USE_PROTOS
2149YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
2150#else
2151YY_BUFFER_STATE yy_scan_bytes( bytes, len )
2152yyconst char *bytes;
2153int len;
2154#endif
2155	{
2156	YY_BUFFER_STATE b;
2157	char *buf;
2158	yy_size_t n;
2159	int i;
2160
2161	/* Get memory for full buffer, including space for trailing EOB's. */
2162	n = len + 2;
2163	buf = (char *) yy_flex_alloc( n );
2164	if ( ! buf )
2165		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2166
2167	for ( i = 0; i < len; ++i )
2168		buf[i] = bytes[i];
2169
2170	buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
2171
2172	b = yy_scan_buffer( buf, n );
2173	if ( ! b )
2174		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2175
2176	/* It's okay to grow etc. this buffer, and we should throw it
2177	 * away when we're done.
2178	 */
2179	b->yy_is_our_buffer = 1;
2180
2181	return b;
2182	}
2183#endif
2184
2185
2186#ifndef YY_NO_PUSH_STATE
2187#ifdef YY_USE_PROTOS
2188static void yy_push_state( int new_state )
2189#else
2190static void yy_push_state( new_state )
2191int new_state;
2192#endif
2193	{
2194	if ( yy_start_stack_ptr >= yy_start_stack_depth )
2195		{
2196		yy_size_t new_size;
2197
2198		yy_start_stack_depth += YY_START_STACK_INCR;
2199		new_size = yy_start_stack_depth * sizeof( int );
2200
2201		if ( ! yy_start_stack )
2202			yy_start_stack = (int *) yy_flex_alloc( new_size );
2203
2204		else
2205			yy_start_stack = (int *) yy_flex_realloc(
2206					(void *) yy_start_stack, new_size );
2207
2208		if ( ! yy_start_stack )
2209			YY_FATAL_ERROR(
2210			"out of memory expanding start-condition stack" );
2211		}
2212
2213	yy_start_stack[yy_start_stack_ptr++] = YY_START;
2214
2215	BEGIN(new_state);
2216	}
2217#endif
2218
2219
2220#ifndef YY_NO_POP_STATE
2221static void yy_pop_state()
2222	{
2223	if ( --yy_start_stack_ptr < 0 )
2224		YY_FATAL_ERROR( "start-condition stack underflow" );
2225
2226	BEGIN(yy_start_stack[yy_start_stack_ptr]);
2227	}
2228#endif
2229
2230
2231#ifndef YY_NO_TOP_STATE
2232static int yy_top_state()
2233	{
2234	return yy_start_stack[yy_start_stack_ptr - 1];
2235	}
2236#endif
2237
2238#ifndef YY_EXIT_FAILURE
2239#define YY_EXIT_FAILURE 2
2240#endif
2241
2242#ifdef YY_USE_PROTOS
2243static void yy_fatal_error( yyconst char msg[] )
2244#else
2245static void yy_fatal_error( msg )
2246char msg[];
2247#endif
2248	{
2249	(void) fprintf( stderr, "%s\n", msg );
2250	exit( YY_EXIT_FAILURE );
2251	}
2252
2253
2254
2255/* Redefine yyless() so it works in section 3 code. */
2256
2257#undef yyless
2258#define yyless(n) \
2259	do \
2260		{ \
2261		/* Undo effects of setting up yytext. */ \
2262		yytext[yyleng] = yy_hold_char; \
2263		yy_c_buf_p = yytext + n; \
2264		yy_hold_char = *yy_c_buf_p; \
2265		*yy_c_buf_p = '\0'; \
2266		yyleng = n; \
2267		} \
2268	while ( 0 )
2269
2270
2271/* Internal utility routines. */
2272
2273#ifndef yytext_ptr
2274#ifdef YY_USE_PROTOS
2275static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
2276#else
2277static void yy_flex_strncpy( s1, s2, n )
2278char *s1;
2279yyconst char *s2;
2280int n;
2281#endif
2282	{
2283	register int i;
2284	for ( i = 0; i < n; ++i )
2285		s1[i] = s2[i];
2286	}
2287#endif
2288
2289#ifdef YY_NEED_STRLEN
2290#ifdef YY_USE_PROTOS
2291static int yy_flex_strlen( yyconst char *s )
2292#else
2293static int yy_flex_strlen( s )
2294yyconst char *s;
2295#endif
2296	{
2297	register int n;
2298	for ( n = 0; s[n]; ++n )
2299		;
2300
2301	return n;
2302	}
2303#endif
2304
2305
2306#ifdef YY_USE_PROTOS
2307static void *yy_flex_alloc( yy_size_t size )
2308#else
2309static void *yy_flex_alloc( size )
2310yy_size_t size;
2311#endif
2312	{
2313	return (void *) malloc( size );
2314	}
2315
2316#ifdef YY_USE_PROTOS
2317static void *yy_flex_realloc( void *ptr, yy_size_t size )
2318#else
2319static void *yy_flex_realloc( ptr, size )
2320void *ptr;
2321yy_size_t size;
2322#endif
2323	{
2324	/* The cast to (char *) in the following accommodates both
2325	 * implementations that use char* generic pointers, and those
2326	 * that use void* generic pointers.  It works with the latter
2327	 * because both ANSI C and C++ allow castless assignment from
2328	 * any pointer type to void*, and deal with argument conversions
2329	 * as though doing an assignment.
2330	 */
2331	return (void *) realloc( (char *) ptr, size );
2332	}
2333
2334#ifdef YY_USE_PROTOS
2335static void yy_flex_free( void *ptr )
2336#else
2337static void yy_flex_free( ptr )
2338void *ptr;
2339#endif
2340	{
2341	free( ptr );
2342	}
2343
2344#if YY_MAIN
2345int main()
2346	{
2347	yylex();
2348	return 0;
2349	}
2350#endif
2351#line 236 "rclex.l"
2352
2353#ifndef yywrap
2354/* This is needed for some versions of lex.  */
2355int yywrap ()
2356{
2357  return 1;
2358}
2359#endif
2360
2361/* Handle a C preprocessor line.  */
2362
2363static void
2364cpp_line (s)
2365     const char *s;
2366{
2367  int line;
2368  char *send, *fn;
2369
2370  ++s;
2371  while (ISSPACE (*s))
2372    ++s;
2373
2374  line = strtol (s, &send, 0);
2375  if (*send != '\0' && ! ISSPACE (*send))
2376    return;
2377
2378  /* Subtract 1 because we are about to count the newline.  */
2379  rc_lineno = line - 1;
2380
2381  s = send;
2382  while (ISSPACE (*s))
2383    ++s;
2384
2385  if (*s != '"')
2386    return;
2387
2388  ++s;
2389  send = strchr (s, '"');
2390  if (send == NULL)
2391    return;
2392
2393  fn = (char *) xmalloc (send - s + 1);
2394  strncpy (fn, s, send - s);
2395  fn[send - s] = '\0';
2396
2397  free (rc_filename);
2398  rc_filename = fn;
2399
2400  if (!initial_fn)
2401    {
2402      initial_fn = xmalloc (strlen (fn) + 1);
2403      strcpy (initial_fn, fn);
2404    }
2405
2406  /* Allow the initial file, regardless of name.  Suppress all other
2407     files if they end in ".h" (this allows included "*.rc").  */
2408  if (strcmp (initial_fn, fn) == 0
2409      || strcmp (fn + strlen (fn) - 2, ".h") != 0)
2410    suppress_cpp_data = 0;
2411  else
2412    suppress_cpp_data = 1;
2413}
2414
2415/* Handle a quoted string.  The quotes are stripped.  A pair of quotes
2416   in a string are turned into a single quote.  Adjacent strings are
2417   merged separated by whitespace are merged, as in C.  */
2418
2419static char *
2420handle_quotes (input, len)
2421     const char *input;
2422     unsigned long *len;
2423{
2424  char *ret, *s;
2425  const char *t;
2426  int ch;
2427
2428  ret = get_string (strlen (input) + 1);
2429
2430  s = ret;
2431  t = input;
2432  if (*t == '"')
2433    ++t;
2434  while (*t != '\0')
2435    {
2436      if (*t == '\\')
2437	{
2438	  ++t;
2439	  switch (*t)
2440	    {
2441	    case '\0':
2442	      rcparse_warning ("backslash at end of string");
2443	      break;
2444
2445	    case '\"':
2446	      rcparse_warning ("use \"\" to put \" in a string");
2447	      break;
2448
2449	    case 'a':
2450	      *s++ = ESCAPE_B; /* Strange, but true...  */
2451	      ++t;
2452	      break;
2453
2454	    case 'b':
2455	      *s++ = ESCAPE_B;
2456	      ++t;
2457	      break;
2458
2459	    case 'f':
2460	      *s++ = ESCAPE_F;
2461	      ++t;
2462	      break;
2463
2464	    case 'n':
2465	      *s++ = ESCAPE_N;
2466	      ++t;
2467	      break;
2468
2469	    case 'r':
2470	      *s++ = ESCAPE_R;
2471	      ++t;
2472	      break;
2473
2474	    case 't':
2475	      *s++ = ESCAPE_T;
2476	      ++t;
2477	      break;
2478
2479	    case 'v':
2480	      *s++ = ESCAPE_V;
2481	      ++t;
2482	      break;
2483
2484	    case '\\':
2485	      *s++ = *t++;
2486	      break;
2487
2488	    case '0': case '1': case '2': case '3':
2489	    case '4': case '5': case '6': case '7':
2490	      ch = *t - '0';
2491	      ++t;
2492	      if (*t >= '0' && *t <= '7')
2493		{
2494		  ch = (ch << 3) | (*t - '0');
2495		  ++t;
2496		  if (*t >= '0' && *t <= '7')
2497		    {
2498		      ch = (ch << 3) | (*t - '0');
2499		      ++t;
2500		    }
2501		}
2502	      *s++ = ch;
2503	      break;
2504
2505	    case 'x':
2506	      ++t;
2507	      ch = 0;
2508	      while (1)
2509		{
2510		  if (*t >= '0' && *t <= '9')
2511		    ch = (ch << 4) | (*t - '0');
2512		  else if (*t >= 'a' && *t <= 'f')
2513		    ch = (ch << 4) | (*t - 'a' + 10);
2514		  else if (*t >= 'A' && *t <= 'F')
2515		    ch = (ch << 4) | (*t - 'A' + 10);
2516		  else
2517		    break;
2518		  ++t;
2519		}
2520	      *s++ = ch;
2521	      break;
2522
2523	    default:
2524	      rcparse_warning ("unrecognized escape sequence");
2525	      *s++ = '\\';
2526	      *s++ = *t++;
2527	      break;
2528	    }
2529	}
2530      else if (*t != '"')
2531	*s++ = *t++;
2532      else if (t[1] == '\0')
2533	break;
2534      else if (t[1] == '"')
2535	{
2536	  *s++ = '"';
2537	  t += 2;
2538	}
2539      else
2540	{
2541	  ++t;
2542	  assert (ISSPACE (*t));
2543	  while (ISSPACE (*t))
2544	    ++t;
2545	  if (*t == '\0')
2546	    break;
2547	  assert (*t == '"');
2548	  ++t;
2549	}
2550    }
2551
2552  *s = '\0';
2553
2554  *len = s - ret;
2555
2556  return ret;
2557}
2558
2559/* Allocate a string of a given length.  */
2560
2561static char *
2562get_string (len)
2563     int len;
2564{
2565  struct alloc_string *as;
2566
2567  as = (struct alloc_string *) xmalloc (sizeof *as);
2568  as->s = xmalloc (len);
2569
2570  as->next = strings;
2571  strings = as;
2572
2573  return as->s;
2574}
2575
2576/* Discard all the strings we have allocated.  The parser calls this
2577   when it no longer needs them.  */
2578
2579void
2580rcparse_discard_strings ()
2581{
2582  struct alloc_string *as;
2583
2584  as = strings;
2585  while (as != NULL)
2586    {
2587      struct alloc_string *n;
2588
2589      free (as->s);
2590      n = as->next;
2591      free (as);
2592      as = n;
2593    }
2594
2595  strings = NULL;
2596}
2597
2598/* Enter rcdata mode.  */
2599
2600void
2601rcparse_rcdata ()
2602{
2603  rcdata_mode = 1;
2604}
2605
2606/* Go back to normal mode from rcdata mode.  */
2607
2608void
2609rcparse_normal ()
2610{
2611  rcdata_mode = 0;
2612}
2613