]> icculus.org git repositories - dana/openbox.git/blob - openbox/cparse.c
start the config system, add the config file parser
[dana/openbox.git] / openbox / cparse.c
1 /* A lexical scanner generated by flex */
2
3 /* Scanner skeleton version:
4  * $Header$
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 /* Returned upon end-of-file. */
68 #define YY_NULL 0
69
70 /* Promotes a possibly negative, possibly signed char to an unsigned
71  * integer for use as an array index.  If the signed char is negative,
72  * we want to instead treat it as an 8-bit unsigned char, hence the
73  * double cast.
74  */
75 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
76
77 /* Enter a start condition.  This macro really ought to take a parameter,
78  * but we do it the disgusting crufty way forced on us by the ()-less
79  * definition of BEGIN.
80  */
81 #define BEGIN yy_start = 1 + 2 *
82
83 /* Translate the current start state into a value that can be later handed
84  * to BEGIN to return to the state.  The YYSTATE alias is for lex
85  * compatibility.
86  */
87 #define YY_START ((yy_start - 1) / 2)
88 #define YYSTATE YY_START
89
90 /* Action number for EOF rule of a given start state. */
91 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
92
93 /* Special action meaning "start processing a new file". */
94 #define YY_NEW_FILE yyrestart( yyin )
95
96 #define YY_END_OF_BUFFER_CHAR 0
97
98 /* Size of default input buffer. */
99 #define YY_BUF_SIZE 16384
100
101 typedef struct yy_buffer_state *YY_BUFFER_STATE;
102
103 extern int yyleng;
104 extern FILE *yyin, *yyout;
105
106 #define EOB_ACT_CONTINUE_SCAN 0
107 #define EOB_ACT_END_OF_FILE 1
108 #define EOB_ACT_LAST_MATCH 2
109
110 /* The funky do-while in the following #define is used to turn the definition
111  * int a single C statement (which needs a semi-colon terminator).  This
112  * avoids problems with code like:
113  *
114  *      if ( condition_holds )
115  *              yyless( 5 );
116  *      else
117  *              do_something_else();
118  *
119  * Prior to using the do-while the compiler would get upset at the
120  * "else" because it interpreted the "if" statement as being all
121  * done when it reached the ';' after the yyless() call.
122  */
123
124 /* Return all but the first 'n' matched characters back to the input stream. */
125
126 #define yyless(n) \
127         do \
128                 { \
129                 /* Undo effects of setting up yytext. */ \
130                 *yy_cp = yy_hold_char; \
131                 YY_RESTORE_YY_MORE_OFFSET \
132                 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
133                 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
134                 } \
135         while ( 0 )
136
137 #define unput(c) yyunput( c, yytext_ptr )
138
139 /* The following is because we cannot portably get our hands on size_t
140  * (without autoconf's help, which isn't available because we want
141  * flex-generated scanners to compile on their own).
142  */
143 typedef unsigned int yy_size_t;
144
145
146 struct yy_buffer_state
147         {
148         FILE *yy_input_file;
149
150         char *yy_ch_buf;                /* input buffer */
151         char *yy_buf_pos;               /* current position in input buffer */
152
153         /* Size of input buffer in bytes, not including room for EOB
154          * characters.
155          */
156         yy_size_t yy_buf_size;
157
158         /* Number of characters read into yy_ch_buf, not including EOB
159          * characters.
160          */
161         int yy_n_chars;
162
163         /* Whether we "own" the buffer - i.e., we know we created it,
164          * and can realloc() it to grow it, and should free() it to
165          * delete it.
166          */
167         int yy_is_our_buffer;
168
169         /* Whether this is an "interactive" input source; if so, and
170          * if we're using stdio for input, then we want to use getc()
171          * instead of fread(), to make sure we stop fetching input after
172          * each newline.
173          */
174         int yy_is_interactive;
175
176         /* Whether we're considered to be at the beginning of a line.
177          * If so, '^' rules will be active on the next match, otherwise
178          * not.
179          */
180         int yy_at_bol;
181
182         /* Whether to try to fill the input buffer when we reach the
183          * end of it.
184          */
185         int yy_fill_buffer;
186
187         int yy_buffer_status;
188 #define YY_BUFFER_NEW 0
189 #define YY_BUFFER_NORMAL 1
190         /* When an EOF's been seen but there's still some text to process
191          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
192          * shouldn't try reading from the input source any more.  We might
193          * still have a bunch of tokens to match, though, because of
194          * possible backing-up.
195          *
196          * When we actually see the EOF, we change the status to "new"
197          * (via yyrestart()), so that the user can continue scanning by
198          * just pointing yyin at a new input file.
199          */
200 #define YY_BUFFER_EOF_PENDING 2
201         };
202
203 static YY_BUFFER_STATE yy_current_buffer = 0;
204
205 /* We provide macros for accessing buffer states in case in the
206  * future we want to put the buffer states in a more general
207  * "scanner state".
208  */
209 #define YY_CURRENT_BUFFER yy_current_buffer
210
211
212 /* yy_hold_char holds the character lost when yytext is formed. */
213 static char yy_hold_char;
214
215 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
216
217
218 int yyleng;
219
220 /* Points to current character in buffer. */
221 static char *yy_c_buf_p = (char *) 0;
222 static int yy_init = 1;         /* whether we need to initialize */
223 static int yy_start = 0;        /* start state number */
224
225 /* Flag which is used to allow yywrap()'s to do buffer switches
226  * instead of setting up a fresh yyin.  A bit of a hack ...
227  */
228 static int yy_did_buffer_switch_on_eof;
229
230 void yyrestart YY_PROTO(( FILE *input_file ));
231
232 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
233 void yy_load_buffer_state YY_PROTO(( void ));
234 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
235 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
236 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
237 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
238 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
239
240 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
241 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
242 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
243
244 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
245 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
246 static void yy_flex_free YY_PROTO(( void * ));
247
248 #define yy_new_buffer yy_create_buffer
249
250 #define yy_set_interactive(is_interactive) \
251         { \
252         if ( ! yy_current_buffer ) \
253                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
254         yy_current_buffer->yy_is_interactive = is_interactive; \
255         }
256
257 #define yy_set_bol(at_bol) \
258         { \
259         if ( ! yy_current_buffer ) \
260                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
261         yy_current_buffer->yy_at_bol = at_bol; \
262         }
263
264 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
265
266
267 #define YY_USES_REJECT
268 typedef unsigned char YY_CHAR;
269 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
270 typedef int yy_state_type;
271 extern char *yytext;
272 #define yytext_ptr yytext
273
274 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
275 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
276 static int yy_get_next_buffer YY_PROTO(( void ));
277 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
278
279 /* Done after the current pattern has been matched and before the
280  * corresponding action - sets up yytext.
281  */
282 #define YY_DO_BEFORE_ACTION \
283         yytext_ptr = yy_bp; \
284         yyleng = (int) (yy_cp - yy_bp); \
285         yy_hold_char = *yy_cp; \
286         *yy_cp = '\0'; \
287         yy_c_buf_p = yy_cp;
288
289 #define YY_NUM_RULES 8
290 #define YY_END_OF_BUFFER 9
291 static yyconst short int yy_acclist[27] =
292     {   0,
293         9,    7,    8,    6,    7,    8,    4,    8,    7,    8,
294         7,    8,16386,    5,    7,    8,    7,    8,16387,16385,
295      8194,16386,16387, 8195, 8193, 8195
296     } ;
297
298 static yyconst short int yy_accept[24] =
299     {   0,
300         1,    1,    1,    2,    4,    7,    9,   11,   14,   17,
301        20,   20,   21,   21,   22,   23,   23,   24,   25,   25,
302        26,   27,   27
303     } ;
304
305 static yyconst int yy_ec[256] =
306     {   0,
307         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
308         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
309         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
310         1,    2,    1,    4,    1,    1,    1,    1,    1,    1,
311         1,    1,    1,    1,    1,    1,    1,    5,    5,    5,
312         5,    5,    5,    5,    5,    5,    5,    1,    1,    1,
313         6,    1,    1,    1,    7,    7,    7,    7,    7,    7,
314         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
315         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
316         1,    1,    1,    1,    8,    1,    7,    7,    7,    7,
317
318         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
319         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
320         7,    7,    1,    1,    1,    1,    1,    1,    1,    1,
321         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
322         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
323         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
324         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
325         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
326         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
327         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
328
329         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
330         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
331         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
332         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
333         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
334         1,    1,    1,    1,    1
335     } ;
336
337 static yyconst int yy_meta[9] =
338     {   0,
339         1,    2,    3,    1,    2,    2,    2,    2
340     } ;
341
342 static yyconst short int yy_base[25] =
343     {   0,
344         0,   19,   23,   32,   32,   32,   18,    7,   32,   11,
345        17,   16,   11,   32,    0,   18,   23,   13,    0,   32,
346        12,   32,   29,    9
347     } ;
348
349 static yyconst short int yy_def[25] =
350     {   0,
351        22,    1,   22,   22,   22,   22,   23,   22,   22,   24,
352        23,   22,    8,   22,    8,   22,   24,   22,   12,   22,
353        22,    0,   22,   22
354     } ;
355
356 static yyconst short int yy_nxt[41] =
357     {   0,
358         4,    5,    6,    7,    8,    9,    4,    4,   13,   14,
359        17,   15,   16,   21,   21,   22,   18,   19,   20,   16,
360        12,   12,   22,   18,   16,   10,   22,   22,   18,   11,
361        11,    3,   22,   22,   22,   22,   22,   22,   22,   22
362     } ;
363
364 static yyconst short int yy_chk[41] =
365     {   0,
366         1,    1,    1,    1,    1,    1,    1,    1,    8,    8,
367        24,    8,   10,   21,   18,   13,   10,   12,   12,   16,
368        11,    7,    3,   16,   17,    2,    0,    0,   17,   23,
369        23,   22,   22,   22,   22,   22,   22,   22,   22,   22
370     } ;
371
372 static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
373 static char *yy_full_match;
374 static int yy_lp;
375 static int yy_looking_for_trail_begin = 0;
376 static int yy_full_lp;
377 static int *yy_full_state;
378 #define YY_TRAILING_MASK 0x2000
379 #define YY_TRAILING_HEAD_MASK 0x4000
380 #define REJECT \
381 { \
382 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
383 yy_cp = yy_full_match; /* restore poss. backed-over text */ \
384 yy_lp = yy_full_lp; /* restore orig. accepting pos. */ \
385 yy_state_ptr = yy_full_state; /* restore orig. state */ \
386 yy_current_state = *yy_state_ptr; /* restore curr. state */ \
387 ++yy_lp; \
388 goto find_rule; \
389 }
390 #define yymore() yymore_used_but_not_detected
391 #define YY_MORE_ADJ 0
392 #define YY_RESTORE_YY_MORE_OFFSET
393 char *yytext;
394 #line 1 "cparse.l"
395 #define INITIAL 0
396 #line 2 "cparse.l"
397 #include <glib.h>
398 #include "config.h"
399
400 static int yylineno = 1;
401 static gboolean haserror = FALSE;
402 static ConfigEntry entry = { NULL, -1 };
403
404 static void stringvalue();
405 static void numbervalue();
406 static void identifier();
407 static void newline();
408 static int yywrap();
409 #line 410 "cparse.c"
410
411 /* Macros after this point can all be overridden by user definitions in
412  * section 1.
413  */
414
415 #ifndef YY_SKIP_YYWRAP
416 #ifdef __cplusplus
417 extern "C" int yywrap YY_PROTO(( void ));
418 #else
419 extern int yywrap YY_PROTO(( void ));
420 #endif
421 #endif
422
423 #ifndef YY_NO_UNPUT
424 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
425 #endif
426
427 #ifndef yytext_ptr
428 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
429 #endif
430
431 #ifdef YY_NEED_STRLEN
432 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
433 #endif
434
435 #ifndef YY_NO_INPUT
436 #ifdef __cplusplus
437 static int yyinput YY_PROTO(( void ));
438 #else
439 static int input YY_PROTO(( void ));
440 #endif
441 #endif
442
443 #if YY_STACK_USED
444 static int yy_start_stack_ptr = 0;
445 static int yy_start_stack_depth = 0;
446 static int *yy_start_stack = 0;
447 #ifndef YY_NO_PUSH_STATE
448 static void yy_push_state YY_PROTO(( int new_state ));
449 #endif
450 #ifndef YY_NO_POP_STATE
451 static void yy_pop_state YY_PROTO(( void ));
452 #endif
453 #ifndef YY_NO_TOP_STATE
454 static int yy_top_state YY_PROTO(( void ));
455 #endif
456
457 #else
458 #define YY_NO_PUSH_STATE 1
459 #define YY_NO_POP_STATE 1
460 #define YY_NO_TOP_STATE 1
461 #endif
462
463 #ifdef YY_MALLOC_DECL
464 YY_MALLOC_DECL
465 #else
466 #if __STDC__
467 #ifndef __cplusplus
468 #include <stdlib.h>
469 #endif
470 #else
471 /* Just try to get by without declaring the routines.  This will fail
472  * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
473  * or sizeof(void*) != sizeof(int).
474  */
475 #endif
476 #endif
477
478 /* Amount of stuff to slurp up with each read. */
479 #ifndef YY_READ_BUF_SIZE
480 #define YY_READ_BUF_SIZE 8192
481 #endif
482
483 /* Copy whatever the last rule matched to the standard output. */
484
485 #ifndef ECHO
486 /* This used to be an fputs(), but since the string might contain NUL's,
487  * we now use fwrite().
488  */
489 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
490 #endif
491
492 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
493  * is returned in "result".
494  */
495 #ifndef YY_INPUT
496 #define YY_INPUT(buf,result,max_size) \
497         if ( yy_current_buffer->yy_is_interactive ) \
498                 { \
499                 int c = '*', n; \
500                 for ( n = 0; n < max_size && \
501                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
502                         buf[n] = (char) c; \
503                 if ( c == '\n' ) \
504                         buf[n++] = (char) c; \
505                 if ( c == EOF && ferror( yyin ) ) \
506                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
507                 result = n; \
508                 } \
509         else \
510                 { \
511                 errno=0; \
512                 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
513                         { \
514                         if( errno != EINTR) \
515                                 { \
516                                 YY_FATAL_ERROR( "input in flex scanner failed" ); \
517                                 break; \
518                                 } \
519                         errno=0; \
520                         clearerr(yyin); \
521                         } \
522                 }
523 #endif
524
525 /* No semi-colon after return; correct usage is to write "yyterminate();" -
526  * we don't want an extra ';' after the "return" because that will cause
527  * some compilers to complain about unreachable statements.
528  */
529 #ifndef yyterminate
530 #define yyterminate() return YY_NULL
531 #endif
532
533 /* Number of entries by which start-condition stack grows. */
534 #ifndef YY_START_STACK_INCR
535 #define YY_START_STACK_INCR 25
536 #endif
537
538 /* Report a fatal error. */
539 #ifndef YY_FATAL_ERROR
540 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
541 #endif
542
543 /* Default declaration of generated scanner - a define so the user can
544  * easily add parameters.
545  */
546 #ifndef YY_DECL
547 #define YY_DECL int yylex YY_PROTO(( void ))
548 #endif
549
550 /* Code executed at the beginning of each rule, after yytext and yyleng
551  * have been set up.
552  */
553 #ifndef YY_USER_ACTION
554 #define YY_USER_ACTION
555 #endif
556
557 /* Code executed at the end of each rule. */
558 #ifndef YY_BREAK
559 #define YY_BREAK break;
560 #endif
561
562 #define YY_RULE_SETUP \
563         if ( yyleng > 0 ) \
564                 yy_current_buffer->yy_at_bol = \
565                                 (yytext[yyleng - 1] == '\n'); \
566         YY_USER_ACTION
567
568 YY_DECL
569         {
570         register yy_state_type yy_current_state;
571         register char *yy_cp, *yy_bp;
572         register int yy_act;
573
574 #line 22 "cparse.l"
575
576
577 #line 578 "cparse.c"
578
579         if ( yy_init )
580                 {
581                 yy_init = 0;
582
583 #ifdef YY_USER_INIT
584                 YY_USER_INIT;
585 #endif
586
587                 if ( ! yy_start )
588                         yy_start = 1;   /* first start state */
589
590                 if ( ! yyin )
591                         yyin = stdin;
592
593                 if ( ! yyout )
594                         yyout = stdout;
595
596                 if ( ! yy_current_buffer )
597                         yy_current_buffer =
598                                 yy_create_buffer( yyin, YY_BUF_SIZE );
599
600                 yy_load_buffer_state();
601                 }
602
603         while ( 1 )             /* loops until end-of-file is reached */
604                 {
605                 yy_cp = yy_c_buf_p;
606
607                 /* Support of yytext. */
608                 *yy_cp = yy_hold_char;
609
610                 /* yy_bp points to the position in yy_ch_buf of the start of
611                  * the current run.
612                  */
613                 yy_bp = yy_cp;
614
615                 yy_current_state = yy_start;
616                 yy_current_state += YY_AT_BOL();
617                 yy_state_ptr = yy_state_buf;
618                 *yy_state_ptr++ = yy_current_state;
619 yy_match:
620                 do
621                         {
622                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
623                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
624                                 {
625                                 yy_current_state = (int) yy_def[yy_current_state];
626                                 if ( yy_current_state >= 23 )
627                                         yy_c = yy_meta[(unsigned int) yy_c];
628                                 }
629                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
630                         *yy_state_ptr++ = yy_current_state;
631                         ++yy_cp;
632                         }
633                 while ( yy_base[yy_current_state] != 32 );
634
635 yy_find_action:
636                 yy_current_state = *--yy_state_ptr;
637                 yy_lp = yy_accept[yy_current_state];
638 find_rule: /* we branch to this label when backing up */
639                 for ( ; ; ) /* until we find what rule we matched */
640                         {
641                         if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
642                                 {
643                                 yy_act = yy_acclist[yy_lp];
644                                 if ( yy_act & YY_TRAILING_HEAD_MASK ||
645                                      yy_looking_for_trail_begin )
646                                         {
647                                         if ( yy_act == yy_looking_for_trail_begin )
648                                                 {
649                                                 yy_looking_for_trail_begin = 0;
650                                                 yy_act &= ~YY_TRAILING_HEAD_MASK;
651                                                 break;
652                                                 }
653                                         }
654                                 else if ( yy_act & YY_TRAILING_MASK )
655                                         {
656                                         yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK;
657                                         yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK;
658                                         }
659                                 else
660                                         {
661                                         yy_full_match = yy_cp;
662                                         yy_full_state = yy_state_ptr;
663                                         yy_full_lp = yy_lp;
664                                         break;
665                                         }
666                                 ++yy_lp;
667                                 goto find_rule;
668                                 }
669                         --yy_cp;
670                         yy_current_state = *--yy_state_ptr;
671                         yy_lp = yy_accept[yy_current_state];
672                         }
673
674                 YY_DO_BEFORE_ACTION;
675
676
677 do_action:      /* This label is used only to access EOF actions. */
678
679
680                 switch ( yy_act )
681         { /* beginning of action switch */
682 case 1:
683 YY_RULE_SETUP
684 #line 24 "cparse.l"
685 stringvalue();
686         YY_BREAK
687 case 2:
688 YY_RULE_SETUP
689 #line 25 "cparse.l"
690 numbervalue();
691         YY_BREAK
692 case 3:
693 YY_RULE_SETUP
694 #line 26 "cparse.l"
695 identifier();
696         YY_BREAK
697 case 4:
698 YY_RULE_SETUP
699 #line 27 "cparse.l"
700 newline();
701         YY_BREAK
702 case 5:
703 YY_RULE_SETUP
704 #line 28 "cparse.l"
705
706         YY_BREAK
707 case 6:
708 YY_RULE_SETUP
709 #line 29 "cparse.l"
710
711         YY_BREAK
712 case 7:
713 YY_RULE_SETUP
714 #line 30 "cparse.l"
715 haserror = TRUE;
716         YY_BREAK
717 case 8:
718 YY_RULE_SETUP
719 #line 32 "cparse.l"
720 ECHO;
721         YY_BREAK
722 #line 723 "cparse.c"
723                         case YY_STATE_EOF(INITIAL):
724                                 yyterminate();
725
726         case YY_END_OF_BUFFER:
727                 {
728                 /* Amount of text matched not including the EOB char. */
729                 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
730
731                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
732                 *yy_cp = yy_hold_char;
733                 YY_RESTORE_YY_MORE_OFFSET
734
735                 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
736                         {
737                         /* We're scanning a new file or input source.  It's
738                          * possible that this happened because the user
739                          * just pointed yyin at a new source and called
740                          * yylex().  If so, then we have to assure
741                          * consistency between yy_current_buffer and our
742                          * globals.  Here is the right place to do so, because
743                          * this is the first action (other than possibly a
744                          * back-up) that will match for the new input source.
745                          */
746                         yy_n_chars = yy_current_buffer->yy_n_chars;
747                         yy_current_buffer->yy_input_file = yyin;
748                         yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
749                         }
750
751                 /* Note that here we test for yy_c_buf_p "<=" to the position
752                  * of the first EOB in the buffer, since yy_c_buf_p will
753                  * already have been incremented past the NUL character
754                  * (since all states make transitions on EOB to the
755                  * end-of-buffer state).  Contrast this with the test
756                  * in input().
757                  */
758                 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
759                         { /* This was really a NUL. */
760                         yy_state_type yy_next_state;
761
762                         yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
763
764                         yy_current_state = yy_get_previous_state();
765
766                         /* Okay, we're now positioned to make the NUL
767                          * transition.  We couldn't have
768                          * yy_get_previous_state() go ahead and do it
769                          * for us because it doesn't know how to deal
770                          * with the possibility of jamming (and we don't
771                          * want to build jamming into it because then it
772                          * will run more slowly).
773                          */
774
775                         yy_next_state = yy_try_NUL_trans( yy_current_state );
776
777                         yy_bp = yytext_ptr + YY_MORE_ADJ;
778
779                         if ( yy_next_state )
780                                 {
781                                 /* Consume the NUL. */
782                                 yy_cp = ++yy_c_buf_p;
783                                 yy_current_state = yy_next_state;
784                                 goto yy_match;
785                                 }
786
787                         else
788                                 {
789                                 yy_cp = yy_c_buf_p;
790                                 goto yy_find_action;
791                                 }
792                         }
793
794                 else switch ( yy_get_next_buffer() )
795                         {
796                         case EOB_ACT_END_OF_FILE:
797                                 {
798                                 yy_did_buffer_switch_on_eof = 0;
799
800                                 if ( yywrap() )
801                                         {
802                                         /* Note: because we've taken care in
803                                          * yy_get_next_buffer() to have set up
804                                          * yytext, we can now set up
805                                          * yy_c_buf_p so that if some total
806                                          * hoser (like flex itself) wants to
807                                          * call the scanner after we return the
808                                          * YY_NULL, it'll still work - another
809                                          * YY_NULL will get returned.
810                                          */
811                                         yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
812
813                                         yy_act = YY_STATE_EOF(YY_START);
814                                         goto do_action;
815                                         }
816
817                                 else
818                                         {
819                                         if ( ! yy_did_buffer_switch_on_eof )
820                                                 YY_NEW_FILE;
821                                         }
822                                 break;
823                                 }
824
825                         case EOB_ACT_CONTINUE_SCAN:
826                                 yy_c_buf_p =
827                                         yytext_ptr + yy_amount_of_matched_text;
828
829                                 yy_current_state = yy_get_previous_state();
830
831                                 yy_cp = yy_c_buf_p;
832                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
833                                 goto yy_match;
834
835                         case EOB_ACT_LAST_MATCH:
836                                 yy_c_buf_p =
837                                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
838
839                                 yy_current_state = yy_get_previous_state();
840
841                                 yy_cp = yy_c_buf_p;
842                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
843                                 goto yy_find_action;
844                         }
845                 break;
846                 }
847
848         default:
849                 YY_FATAL_ERROR(
850                         "fatal flex scanner internal error--no action found" );
851         } /* end of action switch */
852                 } /* end of scanning one token */
853         } /* end of yylex */
854
855
856 /* yy_get_next_buffer - try to read in a new buffer
857  *
858  * Returns a code representing an action:
859  *      EOB_ACT_LAST_MATCH -
860  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
861  *      EOB_ACT_END_OF_FILE - end of file
862  */
863
864 static int yy_get_next_buffer()
865         {
866         register char *dest = yy_current_buffer->yy_ch_buf;
867         register char *source = yytext_ptr;
868         register int number_to_move, i;
869         int ret_val;
870
871         if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
872                 YY_FATAL_ERROR(
873                 "fatal flex scanner internal error--end of buffer missed" );
874
875         if ( yy_current_buffer->yy_fill_buffer == 0 )
876                 { /* Don't try to fill the buffer, so this is an EOF. */
877                 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
878                         {
879                         /* We matched a single character, the EOB, so
880                          * treat this as a final EOF.
881                          */
882                         return EOB_ACT_END_OF_FILE;
883                         }
884
885                 else
886                         {
887                         /* We matched some text prior to the EOB, first
888                          * process it.
889                          */
890                         return EOB_ACT_LAST_MATCH;
891                         }
892                 }
893
894         /* Try to read more data. */
895
896         /* First move last chars to start of buffer. */
897         number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
898
899         for ( i = 0; i < number_to_move; ++i )
900                 *(dest++) = *(source++);
901
902         if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
903                 /* don't do the read, it's not guaranteed to return an EOF,
904                  * just force an EOF
905                  */
906                 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
907
908         else
909                 {
910                 int num_to_read =
911                         yy_current_buffer->yy_buf_size - number_to_move - 1;
912
913                 while ( num_to_read <= 0 )
914                         { /* Not enough room in the buffer - grow it. */
915 #ifdef YY_USES_REJECT
916                         YY_FATAL_ERROR(
917 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
918 #else
919
920                         /* just a shorter name for the current buffer */
921                         YY_BUFFER_STATE b = yy_current_buffer;
922
923                         int yy_c_buf_p_offset =
924                                 (int) (yy_c_buf_p - b->yy_ch_buf);
925
926                         if ( b->yy_is_our_buffer )
927                                 {
928                                 int new_size = b->yy_buf_size * 2;
929
930                                 if ( new_size <= 0 )
931                                         b->yy_buf_size += b->yy_buf_size / 8;
932                                 else
933                                         b->yy_buf_size *= 2;
934
935                                 b->yy_ch_buf = (char *)
936                                         /* Include room in for 2 EOB chars. */
937                                         yy_flex_realloc( (void *) b->yy_ch_buf,
938                                                          b->yy_buf_size + 2 );
939                                 }
940                         else
941                                 /* Can't grow it, we don't own it. */
942                                 b->yy_ch_buf = 0;
943
944                         if ( ! b->yy_ch_buf )
945                                 YY_FATAL_ERROR(
946                                 "fatal error - scanner input buffer overflow" );
947
948                         yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
949
950                         num_to_read = yy_current_buffer->yy_buf_size -
951                                                 number_to_move - 1;
952 #endif
953                         }
954
955                 if ( num_to_read > YY_READ_BUF_SIZE )
956                         num_to_read = YY_READ_BUF_SIZE;
957
958                 /* Read in more data. */
959                 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
960                         yy_n_chars, num_to_read );
961
962                 yy_current_buffer->yy_n_chars = yy_n_chars;
963                 }
964
965         if ( yy_n_chars == 0 )
966                 {
967                 if ( number_to_move == YY_MORE_ADJ )
968                         {
969                         ret_val = EOB_ACT_END_OF_FILE;
970                         yyrestart( yyin );
971                         }
972
973                 else
974                         {
975                         ret_val = EOB_ACT_LAST_MATCH;
976                         yy_current_buffer->yy_buffer_status =
977                                 YY_BUFFER_EOF_PENDING;
978                         }
979                 }
980
981         else
982                 ret_val = EOB_ACT_CONTINUE_SCAN;
983
984         yy_n_chars += number_to_move;
985         yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
986         yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
987
988         yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
989
990         return ret_val;
991         }
992
993
994 /* yy_get_previous_state - get the state just before the EOB char was reached */
995
996 static yy_state_type yy_get_previous_state()
997         {
998         register yy_state_type yy_current_state;
999         register char *yy_cp;
1000
1001         yy_current_state = yy_start;
1002         yy_current_state += YY_AT_BOL();
1003         yy_state_ptr = yy_state_buf;
1004         *yy_state_ptr++ = yy_current_state;
1005
1006         for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1007                 {
1008                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1009                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1010                         {
1011                         yy_current_state = (int) yy_def[yy_current_state];
1012                         if ( yy_current_state >= 23 )
1013                                 yy_c = yy_meta[(unsigned int) yy_c];
1014                         }
1015                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1016                 *yy_state_ptr++ = yy_current_state;
1017                 }
1018
1019         return yy_current_state;
1020         }
1021
1022
1023 /* yy_try_NUL_trans - try to make a transition on the NUL character
1024  *
1025  * synopsis
1026  *      next_state = yy_try_NUL_trans( current_state );
1027  */
1028
1029 #ifdef YY_USE_PROTOS
1030 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1031 #else
1032 static yy_state_type yy_try_NUL_trans( yy_current_state )
1033 yy_state_type yy_current_state;
1034 #endif
1035         {
1036         register int yy_is_jam;
1037
1038         register YY_CHAR yy_c = 1;
1039         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1040                 {
1041                 yy_current_state = (int) yy_def[yy_current_state];
1042                 if ( yy_current_state >= 23 )
1043                         yy_c = yy_meta[(unsigned int) yy_c];
1044                 }
1045         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1046         yy_is_jam = (yy_current_state == 22);
1047         if ( ! yy_is_jam )
1048                 *yy_state_ptr++ = yy_current_state;
1049
1050         return yy_is_jam ? 0 : yy_current_state;
1051         }
1052
1053
1054 #ifndef YY_NO_UNPUT
1055 #ifdef YY_USE_PROTOS
1056 static void yyunput( int c, register char *yy_bp )
1057 #else
1058 static void yyunput( c, yy_bp )
1059 int c;
1060 register char *yy_bp;
1061 #endif
1062         {
1063         register char *yy_cp = yy_c_buf_p;
1064
1065         /* undo effects of setting up yytext */
1066         *yy_cp = yy_hold_char;
1067
1068         if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1069                 { /* need to shift things up to make room */
1070                 /* +2 for EOB chars. */
1071                 register int number_to_move = yy_n_chars + 2;
1072                 register char *dest = &yy_current_buffer->yy_ch_buf[
1073                                         yy_current_buffer->yy_buf_size + 2];
1074                 register char *source =
1075                                 &yy_current_buffer->yy_ch_buf[number_to_move];
1076
1077                 while ( source > yy_current_buffer->yy_ch_buf )
1078                         *--dest = *--source;
1079
1080                 yy_cp += (int) (dest - source);
1081                 yy_bp += (int) (dest - source);
1082                 yy_current_buffer->yy_n_chars =
1083                         yy_n_chars = yy_current_buffer->yy_buf_size;
1084
1085                 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1086                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
1087                 }
1088
1089         *--yy_cp = (char) c;
1090
1091
1092         yytext_ptr = yy_bp;
1093         yy_hold_char = *yy_cp;
1094         yy_c_buf_p = yy_cp;
1095         }
1096 #endif  /* ifndef YY_NO_UNPUT */
1097
1098
1099 #ifdef __cplusplus
1100 static int yyinput()
1101 #else
1102 static int input()
1103 #endif
1104         {
1105         int c;
1106
1107         *yy_c_buf_p = yy_hold_char;
1108
1109         if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1110                 {
1111                 /* yy_c_buf_p now points to the character we want to return.
1112                  * If this occurs *before* the EOB characters, then it's a
1113                  * valid NUL; if not, then we've hit the end of the buffer.
1114                  */
1115                 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1116                         /* This was really a NUL. */
1117                         *yy_c_buf_p = '\0';
1118
1119                 else
1120                         { /* need more input */
1121                         int offset = yy_c_buf_p - yytext_ptr;
1122                         ++yy_c_buf_p;
1123
1124                         switch ( yy_get_next_buffer() )
1125                                 {
1126                                 case EOB_ACT_LAST_MATCH:
1127                                         /* This happens because yy_g_n_b()
1128                                          * sees that we've accumulated a
1129                                          * token and flags that we need to
1130                                          * try matching the token before
1131                                          * proceeding.  But for input(),
1132                                          * there's no matching to consider.
1133                                          * So convert the EOB_ACT_LAST_MATCH
1134                                          * to EOB_ACT_END_OF_FILE.
1135                                          */
1136
1137                                         /* Reset buffer status. */
1138                                         yyrestart( yyin );
1139
1140                                         /* fall through */
1141
1142                                 case EOB_ACT_END_OF_FILE:
1143                                         {
1144                                         if ( yywrap() )
1145                                                 return EOF;
1146
1147                                         if ( ! yy_did_buffer_switch_on_eof )
1148                                                 YY_NEW_FILE;
1149 #ifdef __cplusplus
1150                                         return yyinput();
1151 #else
1152                                         return input();
1153 #endif
1154                                         }
1155
1156                                 case EOB_ACT_CONTINUE_SCAN:
1157                                         yy_c_buf_p = yytext_ptr + offset;
1158                                         break;
1159                                 }
1160                         }
1161                 }
1162
1163         c = *(unsigned char *) yy_c_buf_p;      /* cast for 8-bit char's */
1164         *yy_c_buf_p = '\0';     /* preserve yytext */
1165         yy_hold_char = *++yy_c_buf_p;
1166
1167         yy_current_buffer->yy_at_bol = (c == '\n');
1168
1169         return c;
1170         }
1171
1172
1173 #ifdef YY_USE_PROTOS
1174 void yyrestart( FILE *input_file )
1175 #else
1176 void yyrestart( input_file )
1177 FILE *input_file;
1178 #endif
1179         {
1180         if ( ! yy_current_buffer )
1181                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1182
1183         yy_init_buffer( yy_current_buffer, input_file );
1184         yy_load_buffer_state();
1185         }
1186
1187
1188 #ifdef YY_USE_PROTOS
1189 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1190 #else
1191 void yy_switch_to_buffer( new_buffer )
1192 YY_BUFFER_STATE new_buffer;
1193 #endif
1194         {
1195         if ( yy_current_buffer == new_buffer )
1196                 return;
1197
1198         if ( yy_current_buffer )
1199                 {
1200                 /* Flush out information for old buffer. */
1201                 *yy_c_buf_p = yy_hold_char;
1202                 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1203                 yy_current_buffer->yy_n_chars = yy_n_chars;
1204                 }
1205
1206         yy_current_buffer = new_buffer;
1207         yy_load_buffer_state();
1208
1209         /* We don't actually know whether we did this switch during
1210          * EOF (yywrap()) processing, but the only time this flag
1211          * is looked at is after yywrap() is called, so it's safe
1212          * to go ahead and always set it.
1213          */
1214         yy_did_buffer_switch_on_eof = 1;
1215         }
1216
1217
1218 #ifdef YY_USE_PROTOS
1219 void yy_load_buffer_state( void )
1220 #else
1221 void yy_load_buffer_state()
1222 #endif
1223         {
1224         yy_n_chars = yy_current_buffer->yy_n_chars;
1225         yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1226         yyin = yy_current_buffer->yy_input_file;
1227         yy_hold_char = *yy_c_buf_p;
1228         }
1229
1230
1231 #ifdef YY_USE_PROTOS
1232 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1233 #else
1234 YY_BUFFER_STATE yy_create_buffer( file, size )
1235 FILE *file;
1236 int size;
1237 #endif
1238         {
1239         YY_BUFFER_STATE b;
1240
1241         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1242         if ( ! b )
1243                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1244
1245         b->yy_buf_size = size;
1246
1247         /* yy_ch_buf has to be 2 characters longer than the size given because
1248          * we need to put in 2 end-of-buffer characters.
1249          */
1250         b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1251         if ( ! b->yy_ch_buf )
1252                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1253
1254         b->yy_is_our_buffer = 1;
1255
1256         yy_init_buffer( b, file );
1257
1258         return b;
1259         }
1260
1261
1262 #ifdef YY_USE_PROTOS
1263 void yy_delete_buffer( YY_BUFFER_STATE b )
1264 #else
1265 void yy_delete_buffer( b )
1266 YY_BUFFER_STATE b;
1267 #endif
1268         {
1269         if ( ! b )
1270                 return;
1271
1272         if ( b == yy_current_buffer )
1273                 yy_current_buffer = (YY_BUFFER_STATE) 0;
1274
1275         if ( b->yy_is_our_buffer )
1276                 yy_flex_free( (void *) b->yy_ch_buf );
1277
1278         yy_flex_free( (void *) b );
1279         }
1280
1281
1282 #ifndef _WIN32
1283 #include <unistd.h>
1284 #else
1285 #ifndef YY_ALWAYS_INTERACTIVE
1286 #ifndef YY_NEVER_INTERACTIVE
1287 extern int isatty YY_PROTO(( int ));
1288 #endif
1289 #endif
1290 #endif
1291
1292 #ifdef YY_USE_PROTOS
1293 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1294 #else
1295 void yy_init_buffer( b, file )
1296 YY_BUFFER_STATE b;
1297 FILE *file;
1298 #endif
1299
1300
1301         {
1302         yy_flush_buffer( b );
1303
1304         b->yy_input_file = file;
1305         b->yy_fill_buffer = 1;
1306
1307 #if YY_ALWAYS_INTERACTIVE
1308         b->yy_is_interactive = 1;
1309 #else
1310 #if YY_NEVER_INTERACTIVE
1311         b->yy_is_interactive = 0;
1312 #else
1313         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1314 #endif
1315 #endif
1316         }
1317
1318
1319 #ifdef YY_USE_PROTOS
1320 void yy_flush_buffer( YY_BUFFER_STATE b )
1321 #else
1322 void yy_flush_buffer( b )
1323 YY_BUFFER_STATE b;
1324 #endif
1325
1326         {
1327         if ( ! b )
1328                 return;
1329
1330         b->yy_n_chars = 0;
1331
1332         /* We always need two end-of-buffer characters.  The first causes
1333          * a transition to the end-of-buffer state.  The second causes
1334          * a jam in that state.
1335          */
1336         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1337         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1338
1339         b->yy_buf_pos = &b->yy_ch_buf[0];
1340
1341         b->yy_at_bol = 1;
1342         b->yy_buffer_status = YY_BUFFER_NEW;
1343
1344         if ( b == yy_current_buffer )
1345                 yy_load_buffer_state();
1346         }
1347
1348
1349 #ifndef YY_NO_SCAN_BUFFER
1350 #ifdef YY_USE_PROTOS
1351 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1352 #else
1353 YY_BUFFER_STATE yy_scan_buffer( base, size )
1354 char *base;
1355 yy_size_t size;
1356 #endif
1357         {
1358         YY_BUFFER_STATE b;
1359
1360         if ( size < 2 ||
1361              base[size-2] != YY_END_OF_BUFFER_CHAR ||
1362              base[size-1] != YY_END_OF_BUFFER_CHAR )
1363                 /* They forgot to leave room for the EOB's. */
1364                 return 0;
1365
1366         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1367         if ( ! b )
1368                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1369
1370         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
1371         b->yy_buf_pos = b->yy_ch_buf = base;
1372         b->yy_is_our_buffer = 0;
1373         b->yy_input_file = 0;
1374         b->yy_n_chars = b->yy_buf_size;
1375         b->yy_is_interactive = 0;
1376         b->yy_at_bol = 1;
1377         b->yy_fill_buffer = 0;
1378         b->yy_buffer_status = YY_BUFFER_NEW;
1379
1380         yy_switch_to_buffer( b );
1381
1382         return b;
1383         }
1384 #endif
1385
1386
1387 #ifndef YY_NO_SCAN_STRING
1388 #ifdef YY_USE_PROTOS
1389 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1390 #else
1391 YY_BUFFER_STATE yy_scan_string( yy_str )
1392 yyconst char *yy_str;
1393 #endif
1394         {
1395         int len;
1396         for ( len = 0; yy_str[len]; ++len )
1397                 ;
1398
1399         return yy_scan_bytes( yy_str, len );
1400         }
1401 #endif
1402
1403
1404 #ifndef YY_NO_SCAN_BYTES
1405 #ifdef YY_USE_PROTOS
1406 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1407 #else
1408 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1409 yyconst char *bytes;
1410 int len;
1411 #endif
1412         {
1413         YY_BUFFER_STATE b;
1414         char *buf;
1415         yy_size_t n;
1416         int i;
1417
1418         /* Get memory for full buffer, including space for trailing EOB's. */
1419         n = len + 2;
1420         buf = (char *) yy_flex_alloc( n );
1421         if ( ! buf )
1422                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1423
1424         for ( i = 0; i < len; ++i )
1425                 buf[i] = bytes[i];
1426
1427         buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1428
1429         b = yy_scan_buffer( buf, n );
1430         if ( ! b )
1431                 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1432
1433         /* It's okay to grow etc. this buffer, and we should throw it
1434          * away when we're done.
1435          */
1436         b->yy_is_our_buffer = 1;
1437
1438         return b;
1439         }
1440 #endif
1441
1442
1443 #ifndef YY_NO_PUSH_STATE
1444 #ifdef YY_USE_PROTOS
1445 static void yy_push_state( int new_state )
1446 #else
1447 static void yy_push_state( new_state )
1448 int new_state;
1449 #endif
1450         {
1451         if ( yy_start_stack_ptr >= yy_start_stack_depth )
1452                 {
1453                 yy_size_t new_size;
1454
1455                 yy_start_stack_depth += YY_START_STACK_INCR;
1456                 new_size = yy_start_stack_depth * sizeof( int );
1457
1458                 if ( ! yy_start_stack )
1459                         yy_start_stack = (int *) yy_flex_alloc( new_size );
1460
1461                 else
1462                         yy_start_stack = (int *) yy_flex_realloc(
1463                                         (void *) yy_start_stack, new_size );
1464
1465                 if ( ! yy_start_stack )
1466                         YY_FATAL_ERROR(
1467                         "out of memory expanding start-condition stack" );
1468                 }
1469
1470         yy_start_stack[yy_start_stack_ptr++] = YY_START;
1471
1472         BEGIN(new_state);
1473         }
1474 #endif
1475
1476
1477 #ifndef YY_NO_POP_STATE
1478 static void yy_pop_state()
1479         {
1480         if ( --yy_start_stack_ptr < 0 )
1481                 YY_FATAL_ERROR( "start-condition stack underflow" );
1482
1483         BEGIN(yy_start_stack[yy_start_stack_ptr]);
1484         }
1485 #endif
1486
1487
1488 #ifndef YY_NO_TOP_STATE
1489 static int yy_top_state()
1490         {
1491         return yy_start_stack[yy_start_stack_ptr - 1];
1492         }
1493 #endif
1494
1495 #ifndef YY_EXIT_FAILURE
1496 #define YY_EXIT_FAILURE 2
1497 #endif
1498
1499 #ifdef YY_USE_PROTOS
1500 static void yy_fatal_error( yyconst char msg[] )
1501 #else
1502 static void yy_fatal_error( msg )
1503 char msg[];
1504 #endif
1505         {
1506         (void) fprintf( stderr, "%s\n", msg );
1507         exit( YY_EXIT_FAILURE );
1508         }
1509
1510
1511
1512 /* Redefine yyless() so it works in section 3 code. */
1513
1514 #undef yyless
1515 #define yyless(n) \
1516         do \
1517                 { \
1518                 /* Undo effects of setting up yytext. */ \
1519                 yytext[yyleng] = yy_hold_char; \
1520                 yy_c_buf_p = yytext + n; \
1521                 yy_hold_char = *yy_c_buf_p; \
1522                 *yy_c_buf_p = '\0'; \
1523                 yyleng = n; \
1524                 } \
1525         while ( 0 )
1526
1527
1528 /* Internal utility routines. */
1529
1530 #ifndef yytext_ptr
1531 #ifdef YY_USE_PROTOS
1532 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1533 #else
1534 static void yy_flex_strncpy( s1, s2, n )
1535 char *s1;
1536 yyconst char *s2;
1537 int n;
1538 #endif
1539         {
1540         register int i;
1541         for ( i = 0; i < n; ++i )
1542                 s1[i] = s2[i];
1543         }
1544 #endif
1545
1546 #ifdef YY_NEED_STRLEN
1547 #ifdef YY_USE_PROTOS
1548 static int yy_flex_strlen( yyconst char *s )
1549 #else
1550 static int yy_flex_strlen( s )
1551 yyconst char *s;
1552 #endif
1553         {
1554         register int n;
1555         for ( n = 0; s[n]; ++n )
1556                 ;
1557
1558         return n;
1559         }
1560 #endif
1561
1562
1563 #ifdef YY_USE_PROTOS
1564 static void *yy_flex_alloc( yy_size_t size )
1565 #else
1566 static void *yy_flex_alloc( size )
1567 yy_size_t size;
1568 #endif
1569         {
1570         return (void *) malloc( size );
1571         }
1572
1573 #ifdef YY_USE_PROTOS
1574 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1575 #else
1576 static void *yy_flex_realloc( ptr, size )
1577 void *ptr;
1578 yy_size_t size;
1579 #endif
1580         {
1581         /* The cast to (char *) in the following accommodates both
1582          * implementations that use char* generic pointers, and those
1583          * that use void* generic pointers.  It works with the latter
1584          * because both ANSI C and C++ allow castless assignment from
1585          * any pointer type to void*, and deal with argument conversions
1586          * as though doing an assignment.
1587          */
1588         return (void *) realloc( (char *) ptr, size );
1589         }
1590
1591 #ifdef YY_USE_PROTOS
1592 static void yy_flex_free( void *ptr )
1593 #else
1594 static void yy_flex_free( ptr )
1595 void *ptr;
1596 #endif
1597         {
1598         free( ptr );
1599         }
1600
1601 #if YY_MAIN
1602 int main()
1603         {
1604         yylex();
1605         return 0;
1606         }
1607 #endif
1608 #line 32 "cparse.l"
1609
1610
1611 static void stringvalue()
1612 {
1613     if (!haserror && entry.name != NULL && (signed)entry.type < 0) {
1614         entry.type = Config_String;
1615         entry.value.string = g_strdup(yytext+1); /* drop the left quote */
1616         if (entry.value.string[yyleng-2] != '"')
1617             printf("warning: improperly terminated string on line %d\n",
1618                    yylineno);
1619         else
1620             entry.value.string[yyleng-2] = '\0';
1621     } else
1622         haserror = TRUE;
1623 }
1624
1625 static void numbervalue()
1626 {
1627     if (!haserror && entry.name != NULL && (signed)entry.type < 0) {
1628         entry.type = Config_Integer;
1629         entry.value.integer = atoi(yytext);
1630     } else
1631         haserror = TRUE;
1632 }
1633
1634 static void identifier()
1635 {
1636     g_print("identifier: %s\n", yytext);
1637     entry.name = g_strdup(yytext);
1638     entry.type = -1;
1639 }
1640
1641 static void newline()
1642 {
1643     if (!haserror && entry.name != NULL && (signed)entry.type >= 0) {
1644         if (!config_set(entry.name, entry.type, entry.value))
1645             g_warning("Invalid option in config file: '%s'\n", entry.name);
1646     } else {
1647         printf("Parser error in config file on line %d\n", yylineno);
1648     }
1649     g_free(entry.name);
1650     entry.name = NULL;
1651     if (entry.type == Config_String)
1652         g_free(entry.value.string);
1653     entry.type = -1;
1654
1655     haserror = FALSE;
1656     ++yylineno;
1657 }
1658
1659 static int yywrap()
1660 {
1661     g_free(entry.name);
1662     entry.name = NULL;
1663     if (entry.type == Config_String)
1664         g_free(entry.value.string);
1665     return 1;
1666 }
1667
1668 void cparse_go(FILE *file)
1669 {
1670     yyin = file;
1671     yylex();
1672 }