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