Committer: Michael Beasley <mike@snafu.setup>
[mikesnafu-overlay.git] / scripts / kconfig / lex.zconf.c_shipped
blobbed0f4e2d2f7e6632518c8577d39afd74462afdc
2 #line 3 "scripts/kconfig/lex.zconf.c"
4 #define  YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
8 #define yy_create_buffer zconf_create_buffer
9 #define yy_delete_buffer zconf_delete_buffer
10 #define yy_flex_debug zconf_flex_debug
11 #define yy_init_buffer zconf_init_buffer
12 #define yy_flush_buffer zconf_flush_buffer
13 #define yy_load_buffer_state zconf_load_buffer_state
14 #define yy_switch_to_buffer zconf_switch_to_buffer
15 #define yyin zconfin
16 #define yyleng zconfleng
17 #define yylex zconflex
18 #define yylineno zconflineno
19 #define yyout zconfout
20 #define yyrestart zconfrestart
21 #define yytext zconftext
22 #define yywrap zconfwrap
23 #define yyalloc zconfalloc
24 #define yyrealloc zconfrealloc
25 #define yyfree zconffree
27 #define FLEX_SCANNER
28 #define YY_FLEX_MAJOR_VERSION 2
29 #define YY_FLEX_MINOR_VERSION 5
30 #define YY_FLEX_SUBMINOR_VERSION 33
31 #if YY_FLEX_SUBMINOR_VERSION > 0
32 #define FLEX_BETA
33 #endif
35 /* First, we deal with  platform-specific or compiler-specific issues. */
37 /* begin standard C headers. */
38 #include <stdio.h>
39 #include <string.h>
40 #include <errno.h>
41 #include <stdlib.h>
43 /* end standard C headers. */
45 /* flex integer type definitions */
47 #ifndef FLEXINT_H
48 #define FLEXINT_H
50 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
52 #if __STDC_VERSION__ >= 199901L
54 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
55  * if you want the limit (max/min) macros for int types. 
56  */
57 #ifndef __STDC_LIMIT_MACROS
58 #define __STDC_LIMIT_MACROS 1
59 #endif
61 #include <inttypes.h>
62 typedef int8_t flex_int8_t;
63 typedef uint8_t flex_uint8_t;
64 typedef int16_t flex_int16_t;
65 typedef uint16_t flex_uint16_t;
66 typedef int32_t flex_int32_t;
67 typedef uint32_t flex_uint32_t;
68 #else
69 typedef signed char flex_int8_t;
70 typedef short int flex_int16_t;
71 typedef int flex_int32_t;
72 typedef unsigned char flex_uint8_t; 
73 typedef unsigned short int flex_uint16_t;
74 typedef unsigned int flex_uint32_t;
75 #endif /* ! C99 */
77 /* Limits of integral types. */
78 #ifndef INT8_MIN
79 #define INT8_MIN               (-128)
80 #endif
81 #ifndef INT16_MIN
82 #define INT16_MIN              (-32767-1)
83 #endif
84 #ifndef INT32_MIN
85 #define INT32_MIN              (-2147483647-1)
86 #endif
87 #ifndef INT8_MAX
88 #define INT8_MAX               (127)
89 #endif
90 #ifndef INT16_MAX
91 #define INT16_MAX              (32767)
92 #endif
93 #ifndef INT32_MAX
94 #define INT32_MAX              (2147483647)
95 #endif
96 #ifndef UINT8_MAX
97 #define UINT8_MAX              (255U)
98 #endif
99 #ifndef UINT16_MAX
100 #define UINT16_MAX             (65535U)
101 #endif
102 #ifndef UINT32_MAX
103 #define UINT32_MAX             (4294967295U)
104 #endif
106 #endif /* ! FLEXINT_H */
108 #ifdef __cplusplus
110 /* The "const" storage-class-modifier is valid. */
111 #define YY_USE_CONST
113 #else   /* ! __cplusplus */
115 #if __STDC__
117 #define YY_USE_CONST
119 #endif  /* __STDC__ */
120 #endif  /* ! __cplusplus */
122 #ifdef YY_USE_CONST
123 #define yyconst const
124 #else
125 #define yyconst
126 #endif
128 /* Returned upon end-of-file. */
129 #define YY_NULL 0
131 /* Promotes a possibly negative, possibly signed char to an unsigned
132  * integer for use as an array index.  If the signed char is negative,
133  * we want to instead treat it as an 8-bit unsigned char, hence the
134  * double cast.
135  */
136 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
138 /* Enter a start condition.  This macro really ought to take a parameter,
139  * but we do it the disgusting crufty way forced on us by the ()-less
140  * definition of BEGIN.
141  */
142 #define BEGIN (yy_start) = 1 + 2 *
144 /* Translate the current start state into a value that can be later handed
145  * to BEGIN to return to the state.  The YYSTATE alias is for lex
146  * compatibility.
147  */
148 #define YY_START (((yy_start) - 1) / 2)
149 #define YYSTATE YY_START
151 /* Action number for EOF rule of a given start state. */
152 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
154 /* Special action meaning "start processing a new file". */
155 #define YY_NEW_FILE zconfrestart(zconfin  )
157 #define YY_END_OF_BUFFER_CHAR 0
159 /* Size of default input buffer. */
160 #ifndef YY_BUF_SIZE
161 #define YY_BUF_SIZE 16384
162 #endif
164 /* The state buf must be large enough to hold one state per character in the main buffer.
165  */
166 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
168 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
169 #define YY_TYPEDEF_YY_BUFFER_STATE
170 typedef struct yy_buffer_state *YY_BUFFER_STATE;
171 #endif
173 extern int zconfleng;
175 extern FILE *zconfin, *zconfout;
177 #define EOB_ACT_CONTINUE_SCAN 0
178 #define EOB_ACT_END_OF_FILE 1
179 #define EOB_ACT_LAST_MATCH 2
181     #define YY_LESS_LINENO(n)
182     
183 /* Return all but the first "n" matched characters back to the input stream. */
184 #define yyless(n) \
185         do \
186                 { \
187                 /* Undo effects of setting up zconftext. */ \
188         int yyless_macro_arg = (n); \
189         YY_LESS_LINENO(yyless_macro_arg);\
190                 *yy_cp = (yy_hold_char); \
191                 YY_RESTORE_YY_MORE_OFFSET \
192                 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
193                 YY_DO_BEFORE_ACTION; /* set up zconftext again */ \
194                 } \
195         while ( 0 )
197 #define unput(c) yyunput( c, (yytext_ptr)  )
199 /* The following is because we cannot portably get our hands on size_t
200  * (without autoconf's help, which isn't available because we want
201  * flex-generated scanners to compile on their own).
202  */
204 #ifndef YY_TYPEDEF_YY_SIZE_T
205 #define YY_TYPEDEF_YY_SIZE_T
206 typedef unsigned int yy_size_t;
207 #endif
209 #ifndef YY_STRUCT_YY_BUFFER_STATE
210 #define YY_STRUCT_YY_BUFFER_STATE
211 struct yy_buffer_state
212         {
213         FILE *yy_input_file;
215         char *yy_ch_buf;                /* input buffer */
216         char *yy_buf_pos;               /* current position in input buffer */
218         /* Size of input buffer in bytes, not including room for EOB
219          * characters.
220          */
221         yy_size_t yy_buf_size;
223         /* Number of characters read into yy_ch_buf, not including EOB
224          * characters.
225          */
226         int yy_n_chars;
228         /* Whether we "own" the buffer - i.e., we know we created it,
229          * and can realloc() it to grow it, and should free() it to
230          * delete it.
231          */
232         int yy_is_our_buffer;
234         /* Whether this is an "interactive" input source; if so, and
235          * if we're using stdio for input, then we want to use getc()
236          * instead of fread(), to make sure we stop fetching input after
237          * each newline.
238          */
239         int yy_is_interactive;
241         /* Whether we're considered to be at the beginning of a line.
242          * If so, '^' rules will be active on the next match, otherwise
243          * not.
244          */
245         int yy_at_bol;
247     int yy_bs_lineno; /**< The line count. */
248     int yy_bs_column; /**< The column count. */
249     
250         /* Whether to try to fill the input buffer when we reach the
251          * end of it.
252          */
253         int yy_fill_buffer;
255         int yy_buffer_status;
257 #define YY_BUFFER_NEW 0
258 #define YY_BUFFER_NORMAL 1
259         /* When an EOF's been seen but there's still some text to process
260          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
261          * shouldn't try reading from the input source any more.  We might
262          * still have a bunch of tokens to match, though, because of
263          * possible backing-up.
264          *
265          * When we actually see the EOF, we change the status to "new"
266          * (via zconfrestart()), so that the user can continue scanning by
267          * just pointing zconfin at a new input file.
268          */
269 #define YY_BUFFER_EOF_PENDING 2
271         };
272 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
274 /* Stack of input buffers. */
275 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
276 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
277 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
279 /* We provide macros for accessing buffer states in case in the
280  * future we want to put the buffer states in a more general
281  * "scanner state".
283  * Returns the top of the stack, or NULL.
284  */
285 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
286                           ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
287                           : NULL)
289 /* Same as previous macro, but useful when we know that the buffer stack is not
290  * NULL or when we need an lvalue. For internal use only.
291  */
292 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
294 /* yy_hold_char holds the character lost when zconftext is formed. */
295 static char yy_hold_char;
296 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
297 int zconfleng;
299 /* Points to current character in buffer. */
300 static char *yy_c_buf_p = (char *) 0;
301 static int yy_init = 0;         /* whether we need to initialize */
302 static int yy_start = 0;        /* start state number */
304 /* Flag which is used to allow zconfwrap()'s to do buffer switches
305  * instead of setting up a fresh zconfin.  A bit of a hack ...
306  */
307 static int yy_did_buffer_switch_on_eof;
309 void zconfrestart (FILE *input_file  );
310 void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
311 YY_BUFFER_STATE zconf_create_buffer (FILE *file,int size  );
312 void zconf_delete_buffer (YY_BUFFER_STATE b  );
313 void zconf_flush_buffer (YY_BUFFER_STATE b  );
314 void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer  );
315 void zconfpop_buffer_state (void );
317 static void zconfensure_buffer_stack (void );
318 static void zconf_load_buffer_state (void );
319 static void zconf_init_buffer (YY_BUFFER_STATE b,FILE *file  );
321 #define YY_FLUSH_BUFFER zconf_flush_buffer(YY_CURRENT_BUFFER )
323 YY_BUFFER_STATE zconf_scan_buffer (char *base,yy_size_t size  );
324 YY_BUFFER_STATE zconf_scan_string (yyconst char *yy_str  );
325 YY_BUFFER_STATE zconf_scan_bytes (yyconst char *bytes,int len  );
327 void *zconfalloc (yy_size_t  );
328 void *zconfrealloc (void *,yy_size_t  );
329 void zconffree (void *  );
331 #define yy_new_buffer zconf_create_buffer
333 #define yy_set_interactive(is_interactive) \
334         { \
335         if ( ! YY_CURRENT_BUFFER ){ \
336         zconfensure_buffer_stack (); \
337                 YY_CURRENT_BUFFER_LVALUE =    \
338             zconf_create_buffer(zconfin,YY_BUF_SIZE ); \
339         } \
340         YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
341         }
343 #define yy_set_bol(at_bol) \
344         { \
345         if ( ! YY_CURRENT_BUFFER ){\
346         zconfensure_buffer_stack (); \
347                 YY_CURRENT_BUFFER_LVALUE =    \
348             zconf_create_buffer(zconfin,YY_BUF_SIZE ); \
349         } \
350         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
351         }
353 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
355 /* Begin user sect3 */
357 #define zconfwrap(n) 1
358 #define YY_SKIP_YYWRAP
360 typedef unsigned char YY_CHAR;
362 FILE *zconfin = (FILE *) 0, *zconfout = (FILE *) 0;
364 typedef int yy_state_type;
366 extern int zconflineno;
368 int zconflineno = 1;
370 extern char *zconftext;
371 #define yytext_ptr zconftext
372 static yyconst flex_int16_t yy_nxt[][17] =
373     {
374     {
375         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
376         0,    0,    0,    0,    0,    0,    0
377     },
379     {
380        11,   12,   13,   14,   12,   12,   15,   12,   12,   12,
381        12,   12,   12,   12,   12,   12,   12
382     },
384     {
385        11,   12,   13,   14,   12,   12,   15,   12,   12,   12,
386        12,   12,   12,   12,   12,   12,   12
387     },
389     {
390        11,   16,   16,   17,   16,   16,   16,   16,   16,   16,
391        16,   16,   16,   18,   16,   16,   16
392     },
394     {
395        11,   16,   16,   17,   16,   16,   16,   16,   16,   16,
396        16,   16,   16,   18,   16,   16,   16
398     },
400     {
401        11,   19,   20,   21,   19,   19,   19,   19,   19,   19,
402        19,   19,   19,   19,   19,   19,   19
403     },
405     {
406        11,   19,   20,   21,   19,   19,   19,   19,   19,   19,
407        19,   19,   19,   19,   19,   19,   19
408     },
410     {
411        11,   22,   22,   23,   22,   24,   22,   22,   24,   22,
412        22,   22,   22,   22,   22,   25,   22
413     },
415     {
416        11,   22,   22,   23,   22,   24,   22,   22,   24,   22,
417        22,   22,   22,   22,   22,   25,   22
418     },
420     {
421        11,   26,   26,   27,   28,   29,   30,   31,   29,   32,
422        33,   34,   35,   35,   36,   37,   38
424     },
426     {
427        11,   26,   26,   27,   28,   29,   30,   31,   29,   32,
428        33,   34,   35,   35,   36,   37,   38
429     },
431     {
432       -11,  -11,  -11,  -11,  -11,  -11,  -11,  -11,  -11,  -11,
433       -11,  -11,  -11,  -11,  -11,  -11,  -11
434     },
436     {
437        11,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,
438       -12,  -12,  -12,  -12,  -12,  -12,  -12
439     },
441     {
442        11,  -13,   39,   40,  -13,  -13,   41,  -13,  -13,  -13,
443       -13,  -13,  -13,  -13,  -13,  -13,  -13
444     },
446     {
447        11,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,
448       -14,  -14,  -14,  -14,  -14,  -14,  -14
450     },
452     {
453        11,   42,   42,   43,   42,   42,   42,   42,   42,   42,
454        42,   42,   42,   42,   42,   42,   42
455     },
457     {
458        11,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,
459       -16,  -16,  -16,  -16,  -16,  -16,  -16
460     },
462     {
463        11,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,
464       -17,  -17,  -17,  -17,  -17,  -17,  -17
465     },
467     {
468        11,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,
469       -18,  -18,  -18,   44,  -18,  -18,  -18
470     },
472     {
473        11,   45,   45,  -19,   45,   45,   45,   45,   45,   45,
474        45,   45,   45,   45,   45,   45,   45
476     },
478     {
479        11,  -20,   46,   47,  -20,  -20,  -20,  -20,  -20,  -20,
480       -20,  -20,  -20,  -20,  -20,  -20,  -20
481     },
483     {
484        11,   48,  -21,  -21,   48,   48,   48,   48,   48,   48,
485        48,   48,   48,   48,   48,   48,   48
486     },
488     {
489        11,   49,   49,   50,   49,  -22,   49,   49,  -22,   49,
490        49,   49,   49,   49,   49,  -22,   49
491     },
493     {
494        11,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,
495       -23,  -23,  -23,  -23,  -23,  -23,  -23
496     },
498     {
499        11,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,
500       -24,  -24,  -24,  -24,  -24,  -24,  -24
502     },
504     {
505        11,   51,   51,   52,   51,   51,   51,   51,   51,   51,
506        51,   51,   51,   51,   51,   51,   51
507     },
509     {
510        11,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,
511       -26,  -26,  -26,  -26,  -26,  -26,  -26
512     },
514     {
515        11,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,
516       -27,  -27,  -27,  -27,  -27,  -27,  -27
517     },
519     {
520        11,  -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28,
521       -28,  -28,  -28,  -28,   53,  -28,  -28
522     },
524     {
525        11,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,
526       -29,  -29,  -29,  -29,  -29,  -29,  -29
528     },
530     {
531        11,   54,   54,  -30,   54,   54,   54,   54,   54,   54,
532        54,   54,   54,   54,   54,   54,   54
533     },
535     {
536        11,  -31,  -31,  -31,  -31,  -31,  -31,   55,  -31,  -31,
537       -31,  -31,  -31,  -31,  -31,  -31,  -31
538     },
540     {
541        11,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,
542       -32,  -32,  -32,  -32,  -32,  -32,  -32
543     },
545     {
546        11,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,
547       -33,  -33,  -33,  -33,  -33,  -33,  -33
548     },
550     {
551        11,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,
552       -34,   56,   57,   57,  -34,  -34,  -34
554     },
556     {
557        11,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,
558       -35,   57,   57,   57,  -35,  -35,  -35
559     },
561     {
562        11,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,
563       -36,  -36,  -36,  -36,  -36,  -36,  -36
564     },
566     {
567        11,  -37,  -37,   58,  -37,  -37,  -37,  -37,  -37,  -37,
568       -37,  -37,  -37,  -37,  -37,  -37,  -37
569     },
571     {
572        11,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,
573       -38,  -38,  -38,  -38,  -38,  -38,   59
574     },
576     {
577        11,  -39,   39,   40,  -39,  -39,   41,  -39,  -39,  -39,
578       -39,  -39,  -39,  -39,  -39,  -39,  -39
580     },
582     {
583        11,  -40,  -40,  -40,  -40,  -40,  -40,  -40,  -40,  -40,
584       -40,  -40,  -40,  -40,  -40,  -40,  -40
585     },
587     {
588        11,   42,   42,   43,   42,   42,   42,   42,   42,   42,
589        42,   42,   42,   42,   42,   42,   42
590     },
592     {
593        11,   42,   42,   43,   42,   42,   42,   42,   42,   42,
594        42,   42,   42,   42,   42,   42,   42
595     },
597     {
598        11,  -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,
599       -43,  -43,  -43,  -43,  -43,  -43,  -43
600     },
602     {
603        11,  -44,  -44,  -44,  -44,  -44,  -44,  -44,  -44,  -44,
604       -44,  -44,  -44,   44,  -44,  -44,  -44
606     },
608     {
609        11,   45,   45,  -45,   45,   45,   45,   45,   45,   45,
610        45,   45,   45,   45,   45,   45,   45
611     },
613     {
614        11,  -46,   46,   47,  -46,  -46,  -46,  -46,  -46,  -46,
615       -46,  -46,  -46,  -46,  -46,  -46,  -46
616     },
618     {
619        11,   48,  -47,  -47,   48,   48,   48,   48,   48,   48,
620        48,   48,   48,   48,   48,   48,   48
621     },
623     {
624        11,  -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48,
625       -48,  -48,  -48,  -48,  -48,  -48,  -48
626     },
628     {
629        11,   49,   49,   50,   49,  -49,   49,   49,  -49,   49,
630        49,   49,   49,   49,   49,  -49,   49
632     },
634     {
635        11,  -50,  -50,  -50,  -50,  -50,  -50,  -50,  -50,  -50,
636       -50,  -50,  -50,  -50,  -50,  -50,  -50
637     },
639     {
640        11,  -51,  -51,   52,  -51,  -51,  -51,  -51,  -51,  -51,
641       -51,  -51,  -51,  -51,  -51,  -51,  -51
642     },
644     {
645        11,  -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52,
646       -52,  -52,  -52,  -52,  -52,  -52,  -52
647     },
649     {
650        11,  -53,  -53,  -53,  -53,  -53,  -53,  -53,  -53,  -53,
651       -53,  -53,  -53,  -53,  -53,  -53,  -53
652     },
654     {
655        11,   54,   54,  -54,   54,   54,   54,   54,   54,   54,
656        54,   54,   54,   54,   54,   54,   54
658     },
660     {
661        11,  -55,  -55,  -55,  -55,  -55,  -55,  -55,  -55,  -55,
662       -55,  -55,  -55,  -55,  -55,  -55,  -55
663     },
665     {
666        11,  -56,  -56,  -56,  -56,  -56,  -56,  -56,  -56,  -56,
667       -56,   60,   57,   57,  -56,  -56,  -56
668     },
670     {
671        11,  -57,  -57,  -57,  -57,  -57,  -57,  -57,  -57,  -57,
672       -57,   57,   57,   57,  -57,  -57,  -57
673     },
675     {
676        11,  -58,  -58,  -58,  -58,  -58,  -58,  -58,  -58,  -58,
677       -58,  -58,  -58,  -58,  -58,  -58,  -58
678     },
680     {
681        11,  -59,  -59,  -59,  -59,  -59,  -59,  -59,  -59,  -59,
682       -59,  -59,  -59,  -59,  -59,  -59,  -59
684     },
686     {
687        11,  -60,  -60,  -60,  -60,  -60,  -60,  -60,  -60,  -60,
688       -60,   57,   57,   57,  -60,  -60,  -60
689     },
691     } ;
693 static yy_state_type yy_get_previous_state (void );
694 static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
695 static int yy_get_next_buffer (void );
696 static void yy_fatal_error (yyconst char msg[]  );
698 /* Done after the current pattern has been matched and before the
699  * corresponding action - sets up zconftext.
700  */
701 #define YY_DO_BEFORE_ACTION \
702         (yytext_ptr) = yy_bp; \
703         zconfleng = (size_t) (yy_cp - yy_bp); \
704         (yy_hold_char) = *yy_cp; \
705         *yy_cp = '\0'; \
706         (yy_c_buf_p) = yy_cp;
708 #define YY_NUM_RULES 33
709 #define YY_END_OF_BUFFER 34
710 /* This struct is not used in this scanner,
711    but its presence is necessary. */
712 struct yy_trans_info
713         {
714         flex_int32_t yy_verify;
715         flex_int32_t yy_nxt;
716         };
717 static yyconst flex_int16_t yy_accept[61] =
718     {   0,
719         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
720        34,    5,    4,    2,    3,    7,    8,    6,   32,   29,
721        31,   24,   28,   27,   26,   22,   17,   13,   16,   20,
722        22,   11,   12,   19,   19,   14,   22,   22,    4,    2,
723         3,    3,    1,    6,   32,   29,   31,   30,   24,   23,
724        26,   25,   15,   20,    9,   19,   19,   21,   10,   18
725     } ;
727 static yyconst flex_int32_t yy_ec[256] =
728     {   0,
729         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
730         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
731         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
732         1,    2,    4,    5,    6,    1,    1,    7,    8,    9,
733        10,    1,    1,    1,   11,   12,   12,   13,   13,   13,
734        13,   13,   13,   13,   13,   13,   13,    1,    1,    1,
735        14,    1,    1,    1,   13,   13,   13,   13,   13,   13,
736        13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
737        13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
738         1,   15,    1,    1,   13,    1,   13,   13,   13,   13,
740        13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
741        13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
742        13,   13,    1,   16,    1,    1,    1,    1,    1,    1,
743         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
744         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
745         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
746         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
747         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
748         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
749         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
751         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
752         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
753         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
754         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
755         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
756         1,    1,    1,    1,    1
757     } ;
759 extern int zconf_flex_debug;
760 int zconf_flex_debug = 0;
762 /* The intent behind this definition is that it'll catch
763  * any uses of REJECT which flex missed.
764  */
765 #define REJECT reject_used_but_not_detected
766 #define yymore() yymore_used_but_not_detected
767 #define YY_MORE_ADJ 0
768 #define YY_RESTORE_YY_MORE_OFFSET
769 char *zconftext;
772  * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
773  * Released under the terms of the GNU GPL v2.0.
774  */
776 #include <limits.h>
777 #include <stdio.h>
778 #include <stdlib.h>
779 #include <string.h>
780 #include <unistd.h>
782 #define LKC_DIRECT_LINK
783 #include "lkc.h"
785 #define START_STRSIZE   16
787 static struct {
788         struct file *file;
789         int lineno;
790 } current_pos;
792 static char *text;
793 static int text_size, text_asize;
795 struct buffer {
796         struct buffer *parent;
797         YY_BUFFER_STATE state;
800 struct buffer *current_buf;
802 static int last_ts, first_ts;
804 static void zconf_endhelp(void);
805 static void zconf_endfile(void);
807 void new_string(void)
809         text = malloc(START_STRSIZE);
810         text_asize = START_STRSIZE;
811         text_size = 0;
812         *text = 0;
815 void append_string(const char *str, int size)
817         int new_size = text_size + size + 1;
818         if (new_size > text_asize) {
819                 new_size += START_STRSIZE - 1;
820                 new_size &= -START_STRSIZE;
821                 text = realloc(text, new_size);
822                 text_asize = new_size;
823         }
824         memcpy(text + text_size, str, size);
825         text_size += size;
826         text[text_size] = 0;
829 void alloc_string(const char *str, int size)
831         text = malloc(size + 1);
832         memcpy(text, str, size);
833         text[size] = 0;
836 #define INITIAL 0
837 #define COMMAND 1
838 #define HELP 2
839 #define STRING 3
840 #define PARAM 4
842 #ifndef YY_NO_UNISTD_H
843 /* Special case for "unistd.h", since it is non-ANSI. We include it way
844  * down here because we want the user's section 1 to have been scanned first.
845  * The user has a chance to override it with an option.
846  */
847 #include <unistd.h>
848 #endif
850 #ifndef YY_EXTRA_TYPE
851 #define YY_EXTRA_TYPE void *
852 #endif
854 static int yy_init_globals (void );
856 /* Macros after this point can all be overridden by user definitions in
857  * section 1.
858  */
860 #ifndef YY_SKIP_YYWRAP
861 #ifdef __cplusplus
862 extern "C" int zconfwrap (void );
863 #else
864 extern int zconfwrap (void );
865 #endif
866 #endif
868     static void yyunput (int c,char *buf_ptr  );
869     
870 #ifndef yytext_ptr
871 static void yy_flex_strncpy (char *,yyconst char *,int );
872 #endif
874 #ifdef YY_NEED_STRLEN
875 static int yy_flex_strlen (yyconst char * );
876 #endif
878 #ifndef YY_NO_INPUT
880 #ifdef __cplusplus
881 static int yyinput (void );
882 #else
883 static int input (void );
884 #endif
886 #endif
888 /* Amount of stuff to slurp up with each read. */
889 #ifndef YY_READ_BUF_SIZE
890 #define YY_READ_BUF_SIZE 8192
891 #endif
893 /* Copy whatever the last rule matched to the standard output. */
894 #ifndef ECHO
895 /* This used to be an fputs(), but since the string might contain NUL's,
896  * we now use fwrite().
897  */
898 #define ECHO (void) fwrite( zconftext, zconfleng, 1, zconfout )
899 #endif
901 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
902  * is returned in "result".
903  */
904 #ifndef YY_INPUT
905 #define YY_INPUT(buf,result,max_size) \
906         errno=0; \
907         while ( (result = read( fileno(zconfin), (char *) buf, max_size )) < 0 ) \
908         { \
909                 if( errno != EINTR) \
910                 { \
911                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
912                         break; \
913                 } \
914                 errno=0; \
915                 clearerr(zconfin); \
916         }\
919 #endif
921 /* No semi-colon after return; correct usage is to write "yyterminate();" -
922  * we don't want an extra ';' after the "return" because that will cause
923  * some compilers to complain about unreachable statements.
924  */
925 #ifndef yyterminate
926 #define yyterminate() return YY_NULL
927 #endif
929 /* Number of entries by which start-condition stack grows. */
930 #ifndef YY_START_STACK_INCR
931 #define YY_START_STACK_INCR 25
932 #endif
934 /* Report a fatal error. */
935 #ifndef YY_FATAL_ERROR
936 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
937 #endif
939 /* end tables serialization structures and prototypes */
941 /* Default declaration of generated scanner - a define so the user can
942  * easily add parameters.
943  */
944 #ifndef YY_DECL
945 #define YY_DECL_IS_OURS 1
947 extern int zconflex (void);
949 #define YY_DECL int zconflex (void)
950 #endif /* !YY_DECL */
952 /* Code executed at the beginning of each rule, after zconftext and zconfleng
953  * have been set up.
954  */
955 #ifndef YY_USER_ACTION
956 #define YY_USER_ACTION
957 #endif
959 /* Code executed at the end of each rule. */
960 #ifndef YY_BREAK
961 #define YY_BREAK break;
962 #endif
964 #define YY_RULE_SETUP \
965         YY_USER_ACTION
967 /** The main scanner function which does all the work.
968  */
969 YY_DECL
971         register yy_state_type yy_current_state;
972         register char *yy_cp, *yy_bp;
973         register int yy_act;
974     
975         int str = 0;
976         int ts, i;
978         if ( !(yy_init) )
979                 {
980                 (yy_init) = 1;
982 #ifdef YY_USER_INIT
983                 YY_USER_INIT;
984 #endif
986                 if ( ! (yy_start) )
987                         (yy_start) = 1; /* first start state */
989                 if ( ! zconfin )
990                         zconfin = stdin;
992                 if ( ! zconfout )
993                         zconfout = stdout;
995                 if ( ! YY_CURRENT_BUFFER ) {
996                         zconfensure_buffer_stack ();
997                         YY_CURRENT_BUFFER_LVALUE =
998                                 zconf_create_buffer(zconfin,YY_BUF_SIZE );
999                 }
1001                 zconf_load_buffer_state( );
1002                 }
1004         while ( 1 )             /* loops until end-of-file is reached */
1005                 {
1006                 yy_cp = (yy_c_buf_p);
1008                 /* Support of zconftext. */
1009                 *yy_cp = (yy_hold_char);
1011                 /* yy_bp points to the position in yy_ch_buf of the start of
1012                  * the current run.
1013                  */
1014                 yy_bp = yy_cp;
1016                 yy_current_state = (yy_start);
1017 yy_match:
1018                 while ( (yy_current_state = yy_nxt[yy_current_state][ yy_ec[YY_SC_TO_UI(*yy_cp)]  ]) > 0 )
1019                         ++yy_cp;
1021                 yy_current_state = -yy_current_state;
1023 yy_find_action:
1024                 yy_act = yy_accept[yy_current_state];
1026                 YY_DO_BEFORE_ACTION;
1028 do_action:      /* This label is used only to access EOF actions. */
1030                 switch ( yy_act )
1031         { /* beginning of action switch */
1032 case 1:
1033 /* rule 1 can match eol */
1034 case 2:
1035 /* rule 2 can match eol */
1036 YY_RULE_SETUP
1038         current_file->lineno++;
1039         return T_EOL;
1041         YY_BREAK
1042 case 3:
1043 YY_RULE_SETUP
1045         YY_BREAK
1046 case 4:
1047 YY_RULE_SETUP
1049         BEGIN(COMMAND);
1051         YY_BREAK
1052 case 5:
1053 YY_RULE_SETUP
1055         unput(zconftext[0]);
1056         BEGIN(COMMAND);
1058         YY_BREAK
1060 case 6:
1061 YY_RULE_SETUP
1063                 struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng);
1064                 BEGIN(PARAM);
1065                 current_pos.file = current_file;
1066                 current_pos.lineno = current_file->lineno;
1067                 if (id && id->flags & TF_COMMAND) {
1068                         zconflval.id = id;
1069                         return id->token;
1070                 }
1071                 alloc_string(zconftext, zconfleng);
1072                 zconflval.string = text;
1073                 return T_WORD;
1074         }
1075         YY_BREAK
1076 case 7:
1077 YY_RULE_SETUP
1079         YY_BREAK
1080 case 8:
1081 /* rule 8 can match eol */
1082 YY_RULE_SETUP
1084                 BEGIN(INITIAL);
1085                 current_file->lineno++;
1086                 return T_EOL;
1087         }
1088         YY_BREAK
1090 case 9:
1091 YY_RULE_SETUP
1092 return T_AND;
1093         YY_BREAK
1094 case 10:
1095 YY_RULE_SETUP
1096 return T_OR;
1097         YY_BREAK
1098 case 11:
1099 YY_RULE_SETUP
1100 return T_OPEN_PAREN;
1101         YY_BREAK
1102 case 12:
1103 YY_RULE_SETUP
1104 return T_CLOSE_PAREN;
1105         YY_BREAK
1106 case 13:
1107 YY_RULE_SETUP
1108 return T_NOT;
1109         YY_BREAK
1110 case 14:
1111 YY_RULE_SETUP
1112 return T_EQUAL;
1113         YY_BREAK
1114 case 15:
1115 YY_RULE_SETUP
1116 return T_UNEQUAL;
1117         YY_BREAK
1118 case 16:
1119 YY_RULE_SETUP
1121                 str = zconftext[0];
1122                 new_string();
1123                 BEGIN(STRING);
1124         }
1125         YY_BREAK
1126 case 17:
1127 /* rule 17 can match eol */
1128 YY_RULE_SETUP
1129 BEGIN(INITIAL); current_file->lineno++; return T_EOL;
1130         YY_BREAK
1131 case 18:
1132 YY_RULE_SETUP
1133 /* ignore */
1134         YY_BREAK
1135 case 19:
1136 YY_RULE_SETUP
1138                 struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng);
1139                 if (id && id->flags & TF_PARAM) {
1140                         zconflval.id = id;
1141                         return id->token;
1142                 }
1143                 alloc_string(zconftext, zconfleng);
1144                 zconflval.string = text;
1145                 return T_WORD;
1146         }
1147         YY_BREAK
1148 case 20:
1149 YY_RULE_SETUP
1150 /* comment */
1151         YY_BREAK
1152 case 21:
1153 /* rule 21 can match eol */
1154 YY_RULE_SETUP
1155 current_file->lineno++;
1156         YY_BREAK
1157 case 22:
1158 YY_RULE_SETUP
1160         YY_BREAK
1161 case YY_STATE_EOF(PARAM):
1163                 BEGIN(INITIAL);
1164         }
1165         YY_BREAK
1167 case 23:
1168 /* rule 23 can match eol */
1169 *yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */
1170 (yy_c_buf_p) = yy_cp -= 1;
1171 YY_DO_BEFORE_ACTION; /* set up zconftext again */
1172 YY_RULE_SETUP
1174                 append_string(zconftext, zconfleng);
1175                 zconflval.string = text;
1176                 return T_WORD_QUOTE;
1177         }
1178         YY_BREAK
1179 case 24:
1180 YY_RULE_SETUP
1182                 append_string(zconftext, zconfleng);
1183         }
1184         YY_BREAK
1185 case 25:
1186 /* rule 25 can match eol */
1187 *yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */
1188 (yy_c_buf_p) = yy_cp -= 1;
1189 YY_DO_BEFORE_ACTION; /* set up zconftext again */
1190 YY_RULE_SETUP
1192                 append_string(zconftext + 1, zconfleng - 1);
1193                 zconflval.string = text;
1194                 return T_WORD_QUOTE;
1195         }
1196         YY_BREAK
1197 case 26:
1198 YY_RULE_SETUP
1200                 append_string(zconftext + 1, zconfleng - 1);
1201         }
1202         YY_BREAK
1203 case 27:
1204 YY_RULE_SETUP
1206                 if (str == zconftext[0]) {
1207                         BEGIN(PARAM);
1208                         zconflval.string = text;
1209                         return T_WORD_QUOTE;
1210                 } else
1211                         append_string(zconftext, 1);
1212         }
1213         YY_BREAK
1214 case 28:
1215 /* rule 28 can match eol */
1216 YY_RULE_SETUP
1218                 printf("%s:%d:warning: multi-line strings not supported\n", zconf_curname(), zconf_lineno());
1219                 current_file->lineno++;
1220                 BEGIN(INITIAL);
1221                 return T_EOL;
1222         }
1223         YY_BREAK
1224 case YY_STATE_EOF(STRING):
1226                 BEGIN(INITIAL);
1227         }
1228         YY_BREAK
1230 case 29:
1231 YY_RULE_SETUP
1233                 ts = 0;
1234                 for (i = 0; i < zconfleng; i++) {
1235                         if (zconftext[i] == '\t')
1236                                 ts = (ts & ~7) + 8;
1237                         else
1238                                 ts++;
1239                 }
1240                 last_ts = ts;
1241                 if (first_ts) {
1242                         if (ts < first_ts) {
1243                                 zconf_endhelp();
1244                                 return T_HELPTEXT;
1245                         }
1246                         ts -= first_ts;
1247                         while (ts > 8) {
1248                                 append_string("        ", 8);
1249                                 ts -= 8;
1250                         }
1251                         append_string("        ", ts);
1252                 }
1253         }
1254         YY_BREAK
1255 case 30:
1256 /* rule 30 can match eol */
1257 *yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */
1258 (yy_c_buf_p) = yy_cp -= 1;
1259 YY_DO_BEFORE_ACTION; /* set up zconftext again */
1260 YY_RULE_SETUP
1262                 current_file->lineno++;
1263                 zconf_endhelp();
1264                 return T_HELPTEXT;
1265         }
1266         YY_BREAK
1267 case 31:
1268 /* rule 31 can match eol */
1269 YY_RULE_SETUP
1271                 current_file->lineno++;
1272                 append_string("\n", 1);
1273         }
1274         YY_BREAK
1275 case 32:
1276 YY_RULE_SETUP
1278                 while (zconfleng) {
1279                         if ((zconftext[zconfleng-1] != ' ') && (zconftext[zconfleng-1] != '\t'))
1280                                 break;
1281                         zconfleng--;
1282                 }
1283                 append_string(zconftext, zconfleng);
1284                 if (!first_ts)
1285                         first_ts = last_ts;
1286         }
1287         YY_BREAK
1288 case YY_STATE_EOF(HELP):
1290                 zconf_endhelp();
1291                 return T_HELPTEXT;
1292         }
1293         YY_BREAK
1295 case YY_STATE_EOF(INITIAL):
1296 case YY_STATE_EOF(COMMAND):
1298         if (current_file) {
1299                 zconf_endfile();
1300                 return T_EOL;
1301         }
1302         fclose(zconfin);
1303         yyterminate();
1305         YY_BREAK
1306 case 33:
1307 YY_RULE_SETUP
1308 YY_FATAL_ERROR( "flex scanner jammed" );
1309         YY_BREAK
1311         case YY_END_OF_BUFFER:
1312                 {
1313                 /* Amount of text matched not including the EOB char. */
1314                 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1316                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1317                 *yy_cp = (yy_hold_char);
1318                 YY_RESTORE_YY_MORE_OFFSET
1320                 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1321                         {
1322                         /* We're scanning a new file or input source.  It's
1323                          * possible that this happened because the user
1324                          * just pointed zconfin at a new source and called
1325                          * zconflex().  If so, then we have to assure
1326                          * consistency between YY_CURRENT_BUFFER and our
1327                          * globals.  Here is the right place to do so, because
1328                          * this is the first action (other than possibly a
1329                          * back-up) that will match for the new input source.
1330                          */
1331                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1332                         YY_CURRENT_BUFFER_LVALUE->yy_input_file = zconfin;
1333                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1334                         }
1336                 /* Note that here we test for yy_c_buf_p "<=" to the position
1337                  * of the first EOB in the buffer, since yy_c_buf_p will
1338                  * already have been incremented past the NUL character
1339                  * (since all states make transitions on EOB to the
1340                  * end-of-buffer state).  Contrast this with the test
1341                  * in input().
1342                  */
1343                 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1344                         { /* This was really a NUL. */
1345                         yy_state_type yy_next_state;
1347                         (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1349                         yy_current_state = yy_get_previous_state(  );
1351                         /* Okay, we're now positioned to make the NUL
1352                          * transition.  We couldn't have
1353                          * yy_get_previous_state() go ahead and do it
1354                          * for us because it doesn't know how to deal
1355                          * with the possibility of jamming (and we don't
1356                          * want to build jamming into it because then it
1357                          * will run more slowly).
1358                          */
1360                         yy_next_state = yy_try_NUL_trans( yy_current_state );
1362                         yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1364                         if ( yy_next_state )
1365                                 {
1366                                 /* Consume the NUL. */
1367                                 yy_cp = ++(yy_c_buf_p);
1368                                 yy_current_state = yy_next_state;
1369                                 goto yy_match;
1370                                 }
1372                         else
1373                                 {
1374                                 yy_cp = (yy_c_buf_p);
1375                                 goto yy_find_action;
1376                                 }
1377                         }
1379                 else switch ( yy_get_next_buffer(  ) )
1380                         {
1381                         case EOB_ACT_END_OF_FILE:
1382                                 {
1383                                 (yy_did_buffer_switch_on_eof) = 0;
1385                                 if ( zconfwrap( ) )
1386                                         {
1387                                         /* Note: because we've taken care in
1388                                          * yy_get_next_buffer() to have set up
1389                                          * zconftext, we can now set up
1390                                          * yy_c_buf_p so that if some total
1391                                          * hoser (like flex itself) wants to
1392                                          * call the scanner after we return the
1393                                          * YY_NULL, it'll still work - another
1394                                          * YY_NULL will get returned.
1395                                          */
1396                                         (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1398                                         yy_act = YY_STATE_EOF(YY_START);
1399                                         goto do_action;
1400                                         }
1402                                 else
1403                                         {
1404                                         if ( ! (yy_did_buffer_switch_on_eof) )
1405                                                 YY_NEW_FILE;
1406                                         }
1407                                 break;
1408                                 }
1410                         case EOB_ACT_CONTINUE_SCAN:
1411                                 (yy_c_buf_p) =
1412                                         (yytext_ptr) + yy_amount_of_matched_text;
1414                                 yy_current_state = yy_get_previous_state(  );
1416                                 yy_cp = (yy_c_buf_p);
1417                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1418                                 goto yy_match;
1420                         case EOB_ACT_LAST_MATCH:
1421                                 (yy_c_buf_p) =
1422                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1424                                 yy_current_state = yy_get_previous_state(  );
1426                                 yy_cp = (yy_c_buf_p);
1427                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1428                                 goto yy_find_action;
1429                         }
1430                 break;
1431                 }
1433         default:
1434                 YY_FATAL_ERROR(
1435                         "fatal flex scanner internal error--no action found" );
1436         } /* end of action switch */
1437                 } /* end of scanning one token */
1438 } /* end of zconflex */
1440 /* yy_get_next_buffer - try to read in a new buffer
1442  * Returns a code representing an action:
1443  *      EOB_ACT_LAST_MATCH -
1444  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1445  *      EOB_ACT_END_OF_FILE - end of file
1446  */
1447 static int yy_get_next_buffer (void)
1449         register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1450         register char *source = (yytext_ptr);
1451         register int number_to_move, i;
1452         int ret_val;
1454         if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1455                 YY_FATAL_ERROR(
1456                 "fatal flex scanner internal error--end of buffer missed" );
1458         if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1459                 { /* Don't try to fill the buffer, so this is an EOF. */
1460                 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1461                         {
1462                         /* We matched a single character, the EOB, so
1463                          * treat this as a final EOF.
1464                          */
1465                         return EOB_ACT_END_OF_FILE;
1466                         }
1468                 else
1469                         {
1470                         /* We matched some text prior to the EOB, first
1471                          * process it.
1472                          */
1473                         return EOB_ACT_LAST_MATCH;
1474                         }
1475                 }
1477         /* Try to read more data. */
1479         /* First move last chars to start of buffer. */
1480         number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1482         for ( i = 0; i < number_to_move; ++i )
1483                 *(dest++) = *(source++);
1485         if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1486                 /* don't do the read, it's not guaranteed to return an EOF,
1487                  * just force an EOF
1488                  */
1489                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1491         else
1492                 {
1493                         int num_to_read =
1494                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1496                 while ( num_to_read <= 0 )
1497                         { /* Not enough room in the buffer - grow it. */
1499                         /* just a shorter name for the current buffer */
1500                         YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1502                         int yy_c_buf_p_offset =
1503                                 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1505                         if ( b->yy_is_our_buffer )
1506                                 {
1507                                 int new_size = b->yy_buf_size * 2;
1509                                 if ( new_size <= 0 )
1510                                         b->yy_buf_size += b->yy_buf_size / 8;
1511                                 else
1512                                         b->yy_buf_size *= 2;
1514                                 b->yy_ch_buf = (char *)
1515                                         /* Include room in for 2 EOB chars. */
1516                                         zconfrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
1517                                 }
1518                         else
1519                                 /* Can't grow it, we don't own it. */
1520                                 b->yy_ch_buf = 0;
1522                         if ( ! b->yy_ch_buf )
1523                                 YY_FATAL_ERROR(
1524                                 "fatal error - scanner input buffer overflow" );
1526                         (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1528                         num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1529                                                 number_to_move - 1;
1531                         }
1533                 if ( num_to_read > YY_READ_BUF_SIZE )
1534                         num_to_read = YY_READ_BUF_SIZE;
1536                 /* Read in more data. */
1537                 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1538                         (yy_n_chars), num_to_read );
1540                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1541                 }
1543         if ( (yy_n_chars) == 0 )
1544                 {
1545                 if ( number_to_move == YY_MORE_ADJ )
1546                         {
1547                         ret_val = EOB_ACT_END_OF_FILE;
1548                         zconfrestart(zconfin  );
1549                         }
1551                 else
1552                         {
1553                         ret_val = EOB_ACT_LAST_MATCH;
1554                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1555                                 YY_BUFFER_EOF_PENDING;
1556                         }
1557                 }
1559         else
1560                 ret_val = EOB_ACT_CONTINUE_SCAN;
1562         (yy_n_chars) += number_to_move;
1563         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1564         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1566         (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1568         return ret_val;
1571 /* yy_get_previous_state - get the state just before the EOB char was reached */
1573     static yy_state_type yy_get_previous_state (void)
1575         register yy_state_type yy_current_state;
1576         register char *yy_cp;
1577     
1578         yy_current_state = (yy_start);
1580         for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1581                 {
1582                 yy_current_state = yy_nxt[yy_current_state][(*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1)];
1583                 }
1585         return yy_current_state;
1588 /* yy_try_NUL_trans - try to make a transition on the NUL character
1590  * synopsis
1591  *      next_state = yy_try_NUL_trans( current_state );
1592  */
1593     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
1595         register int yy_is_jam;
1596     
1597         yy_current_state = yy_nxt[yy_current_state][1];
1598         yy_is_jam = (yy_current_state <= 0);
1600         return yy_is_jam ? 0 : yy_current_state;
1603     static void yyunput (int c, register char * yy_bp )
1605         register char *yy_cp;
1606     
1607     yy_cp = (yy_c_buf_p);
1609         /* undo effects of setting up zconftext */
1610         *yy_cp = (yy_hold_char);
1612         if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1613                 { /* need to shift things up to make room */
1614                 /* +2 for EOB chars. */
1615                 register int number_to_move = (yy_n_chars) + 2;
1616                 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1617                                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1618                 register char *source =
1619                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1621                 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1622                         *--dest = *--source;
1624                 yy_cp += (int) (dest - source);
1625                 yy_bp += (int) (dest - source);
1626                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1627                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1629                 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1630                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
1631                 }
1633         *--yy_cp = (char) c;
1635         (yytext_ptr) = yy_bp;
1636         (yy_hold_char) = *yy_cp;
1637         (yy_c_buf_p) = yy_cp;
1640 #ifndef YY_NO_INPUT
1641 #ifdef __cplusplus
1642     static int yyinput (void)
1643 #else
1644     static int input  (void)
1645 #endif
1648         int c;
1649     
1650         *(yy_c_buf_p) = (yy_hold_char);
1652         if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1653                 {
1654                 /* yy_c_buf_p now points to the character we want to return.
1655                  * If this occurs *before* the EOB characters, then it's a
1656                  * valid NUL; if not, then we've hit the end of the buffer.
1657                  */
1658                 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1659                         /* This was really a NUL. */
1660                         *(yy_c_buf_p) = '\0';
1662                 else
1663                         { /* need more input */
1664                         int offset = (yy_c_buf_p) - (yytext_ptr);
1665                         ++(yy_c_buf_p);
1667                         switch ( yy_get_next_buffer(  ) )
1668                                 {
1669                                 case EOB_ACT_LAST_MATCH:
1670                                         /* This happens because yy_g_n_b()
1671                                          * sees that we've accumulated a
1672                                          * token and flags that we need to
1673                                          * try matching the token before
1674                                          * proceeding.  But for input(),
1675                                          * there's no matching to consider.
1676                                          * So convert the EOB_ACT_LAST_MATCH
1677                                          * to EOB_ACT_END_OF_FILE.
1678                                          */
1680                                         /* Reset buffer status. */
1681                                         zconfrestart(zconfin );
1683                                         /*FALLTHROUGH*/
1685                                 case EOB_ACT_END_OF_FILE:
1686                                         {
1687                                         if ( zconfwrap( ) )
1688                                                 return EOF;
1690                                         if ( ! (yy_did_buffer_switch_on_eof) )
1691                                                 YY_NEW_FILE;
1692 #ifdef __cplusplus
1693                                         return yyinput();
1694 #else
1695                                         return input();
1696 #endif
1697                                         }
1699                                 case EOB_ACT_CONTINUE_SCAN:
1700                                         (yy_c_buf_p) = (yytext_ptr) + offset;
1701                                         break;
1702                                 }
1703                         }
1704                 }
1706         c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
1707         *(yy_c_buf_p) = '\0';   /* preserve zconftext */
1708         (yy_hold_char) = *++(yy_c_buf_p);
1710         return c;
1712 #endif  /* ifndef YY_NO_INPUT */
1714 /** Immediately switch to a different input stream.
1715  * @param input_file A readable stream.
1716  * 
1717  * @note This function does not reset the start condition to @c INITIAL .
1718  */
1719     void zconfrestart  (FILE * input_file )
1721     
1722         if ( ! YY_CURRENT_BUFFER ){
1723         zconfensure_buffer_stack ();
1724                 YY_CURRENT_BUFFER_LVALUE =
1725             zconf_create_buffer(zconfin,YY_BUF_SIZE );
1726         }
1728         zconf_init_buffer(YY_CURRENT_BUFFER,input_file );
1729         zconf_load_buffer_state( );
1732 /** Switch to a different input buffer.
1733  * @param new_buffer The new input buffer.
1734  * 
1735  */
1736     void zconf_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
1738     
1739         /* TODO. We should be able to replace this entire function body
1740          * with
1741          *              zconfpop_buffer_state();
1742          *              zconfpush_buffer_state(new_buffer);
1743      */
1744         zconfensure_buffer_stack ();
1745         if ( YY_CURRENT_BUFFER == new_buffer )
1746                 return;
1748         if ( YY_CURRENT_BUFFER )
1749                 {
1750                 /* Flush out information for old buffer. */
1751                 *(yy_c_buf_p) = (yy_hold_char);
1752                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1753                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1754                 }
1756         YY_CURRENT_BUFFER_LVALUE = new_buffer;
1757         zconf_load_buffer_state( );
1759         /* We don't actually know whether we did this switch during
1760          * EOF (zconfwrap()) processing, but the only time this flag
1761          * is looked at is after zconfwrap() is called, so it's safe
1762          * to go ahead and always set it.
1763          */
1764         (yy_did_buffer_switch_on_eof) = 1;
1767 static void zconf_load_buffer_state  (void)
1769         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1770         (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1771         zconfin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1772         (yy_hold_char) = *(yy_c_buf_p);
1775 /** Allocate and initialize an input buffer state.
1776  * @param file A readable stream.
1777  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1778  * 
1779  * @return the allocated buffer state.
1780  */
1781     YY_BUFFER_STATE zconf_create_buffer  (FILE * file, int  size )
1783         YY_BUFFER_STATE b;
1784     
1785         b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state )  );
1786         if ( ! b )
1787                 YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" );
1789         b->yy_buf_size = size;
1791         /* yy_ch_buf has to be 2 characters longer than the size given because
1792          * we need to put in 2 end-of-buffer characters.
1793          */
1794         b->yy_ch_buf = (char *) zconfalloc(b->yy_buf_size + 2  );
1795         if ( ! b->yy_ch_buf )
1796                 YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" );
1798         b->yy_is_our_buffer = 1;
1800         zconf_init_buffer(b,file );
1802         return b;
1805 /** Destroy the buffer.
1806  * @param b a buffer created with zconf_create_buffer()
1807  * 
1808  */
1809     void zconf_delete_buffer (YY_BUFFER_STATE  b )
1811     
1812         if ( ! b )
1813                 return;
1815         if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1816                 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1818         if ( b->yy_is_our_buffer )
1819                 zconffree((void *) b->yy_ch_buf  );
1821         zconffree((void *) b  );
1824 /* Initializes or reinitializes a buffer.
1825  * This function is sometimes called more than once on the same buffer,
1826  * such as during a zconfrestart() or at EOF.
1827  */
1828     static void zconf_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
1831         int oerrno = errno;
1832     
1833         zconf_flush_buffer(b );
1835         b->yy_input_file = file;
1836         b->yy_fill_buffer = 1;
1838     /* If b is the current buffer, then zconf_init_buffer was _probably_
1839      * called from zconfrestart() or through yy_get_next_buffer.
1840      * In that case, we don't want to reset the lineno or column.
1841      */
1842     if (b != YY_CURRENT_BUFFER){
1843         b->yy_bs_lineno = 1;
1844         b->yy_bs_column = 0;
1845     }
1847         b->yy_is_interactive = 0;
1848     
1849         errno = oerrno;
1852 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1853  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1854  * 
1855  */
1856     void zconf_flush_buffer (YY_BUFFER_STATE  b )
1858         if ( ! b )
1859                 return;
1861         b->yy_n_chars = 0;
1863         /* We always need two end-of-buffer characters.  The first causes
1864          * a transition to the end-of-buffer state.  The second causes
1865          * a jam in that state.
1866          */
1867         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1868         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1870         b->yy_buf_pos = &b->yy_ch_buf[0];
1872         b->yy_at_bol = 1;
1873         b->yy_buffer_status = YY_BUFFER_NEW;
1875         if ( b == YY_CURRENT_BUFFER )
1876                 zconf_load_buffer_state( );
1879 /** Pushes the new state onto the stack. The new state becomes
1880  *  the current state. This function will allocate the stack
1881  *  if necessary.
1882  *  @param new_buffer The new state.
1883  *  
1884  */
1885 void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
1887         if (new_buffer == NULL)
1888                 return;
1890         zconfensure_buffer_stack();
1892         /* This block is copied from zconf_switch_to_buffer. */
1893         if ( YY_CURRENT_BUFFER )
1894                 {
1895                 /* Flush out information for old buffer. */
1896                 *(yy_c_buf_p) = (yy_hold_char);
1897                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1898                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1899                 }
1901         /* Only push if top exists. Otherwise, replace top. */
1902         if (YY_CURRENT_BUFFER)
1903                 (yy_buffer_stack_top)++;
1904         YY_CURRENT_BUFFER_LVALUE = new_buffer;
1906         /* copied from zconf_switch_to_buffer. */
1907         zconf_load_buffer_state( );
1908         (yy_did_buffer_switch_on_eof) = 1;
1911 /** Removes and deletes the top of the stack, if present.
1912  *  The next element becomes the new top.
1913  *  
1914  */
1915 void zconfpop_buffer_state (void)
1917         if (!YY_CURRENT_BUFFER)
1918                 return;
1920         zconf_delete_buffer(YY_CURRENT_BUFFER );
1921         YY_CURRENT_BUFFER_LVALUE = NULL;
1922         if ((yy_buffer_stack_top) > 0)
1923                 --(yy_buffer_stack_top);
1925         if (YY_CURRENT_BUFFER) {
1926                 zconf_load_buffer_state( );
1927                 (yy_did_buffer_switch_on_eof) = 1;
1928         }
1931 /* Allocates the stack if it does not exist.
1932  *  Guarantees space for at least one push.
1933  */
1934 static void zconfensure_buffer_stack (void)
1936         int num_to_alloc;
1937     
1938         if (!(yy_buffer_stack)) {
1940                 /* First allocation is just for 2 elements, since we don't know if this
1941                  * scanner will even need a stack. We use 2 instead of 1 to avoid an
1942                  * immediate realloc on the next call.
1943          */
1944                 num_to_alloc = 1;
1945                 (yy_buffer_stack) = (struct yy_buffer_state**)zconfalloc
1946                                                                 (num_to_alloc * sizeof(struct yy_buffer_state*)
1947                                                                 );
1948                 
1949                 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1950                                 
1951                 (yy_buffer_stack_max) = num_to_alloc;
1952                 (yy_buffer_stack_top) = 0;
1953                 return;
1954         }
1956         if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1958                 /* Increase the buffer to prepare for a possible push. */
1959                 int grow_size = 8 /* arbitrary grow size */;
1961                 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1962                 (yy_buffer_stack) = (struct yy_buffer_state**)zconfrealloc
1963                                                                 ((yy_buffer_stack),
1964                                                                 num_to_alloc * sizeof(struct yy_buffer_state*)
1965                                                                 );
1967                 /* zero only the new slots.*/
1968                 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1969                 (yy_buffer_stack_max) = num_to_alloc;
1970         }
1973 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1974  * @param base the character buffer
1975  * @param size the size in bytes of the character buffer
1976  * 
1977  * @return the newly allocated buffer state object. 
1978  */
1979 YY_BUFFER_STATE zconf_scan_buffer  (char * base, yy_size_t  size )
1981         YY_BUFFER_STATE b;
1982     
1983         if ( size < 2 ||
1984              base[size-2] != YY_END_OF_BUFFER_CHAR ||
1985              base[size-1] != YY_END_OF_BUFFER_CHAR )
1986                 /* They forgot to leave room for the EOB's. */
1987                 return 0;
1989         b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state )  );
1990         if ( ! b )
1991                 YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_buffer()" );
1993         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
1994         b->yy_buf_pos = b->yy_ch_buf = base;
1995         b->yy_is_our_buffer = 0;
1996         b->yy_input_file = 0;
1997         b->yy_n_chars = b->yy_buf_size;
1998         b->yy_is_interactive = 0;
1999         b->yy_at_bol = 1;
2000         b->yy_fill_buffer = 0;
2001         b->yy_buffer_status = YY_BUFFER_NEW;
2003         zconf_switch_to_buffer(b  );
2005         return b;
2008 /** Setup the input buffer state to scan a string. The next call to zconflex() will
2009  * scan from a @e copy of @a str.
2010  * @param str a NUL-terminated string to scan
2011  * 
2012  * @return the newly allocated buffer state object.
2013  * @note If you want to scan bytes that may contain NUL values, then use
2014  *       zconf_scan_bytes() instead.
2015  */
2016 YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr )
2018     
2019         return zconf_scan_bytes(yystr,strlen(yystr) );
2022 /** Setup the input buffer state to scan the given bytes. The next call to zconflex() will
2023  * scan from a @e copy of @a bytes.
2024  * @param bytes the byte buffer to scan
2025  * @param len the number of bytes in the buffer pointed to by @a bytes.
2026  * 
2027  * @return the newly allocated buffer state object.
2028  */
2029 YY_BUFFER_STATE zconf_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
2031         YY_BUFFER_STATE b;
2032         char *buf;
2033         yy_size_t n;
2034         int i;
2035     
2036         /* Get memory for full buffer, including space for trailing EOB's. */
2037         n = _yybytes_len + 2;
2038         buf = (char *) zconfalloc(n  );
2039         if ( ! buf )
2040                 YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_bytes()" );
2042         for ( i = 0; i < _yybytes_len; ++i )
2043                 buf[i] = yybytes[i];
2045         buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2047         b = zconf_scan_buffer(buf,n );
2048         if ( ! b )
2049                 YY_FATAL_ERROR( "bad buffer in zconf_scan_bytes()" );
2051         /* It's okay to grow etc. this buffer, and we should throw it
2052          * away when we're done.
2053          */
2054         b->yy_is_our_buffer = 1;
2056         return b;
2059 #ifndef YY_EXIT_FAILURE
2060 #define YY_EXIT_FAILURE 2
2061 #endif
2063 static void yy_fatal_error (yyconst char* msg )
2065         (void) fprintf( stderr, "%s\n", msg );
2066         exit( YY_EXIT_FAILURE );
2069 /* Redefine yyless() so it works in section 3 code. */
2071 #undef yyless
2072 #define yyless(n) \
2073         do \
2074                 { \
2075                 /* Undo effects of setting up zconftext. */ \
2076         int yyless_macro_arg = (n); \
2077         YY_LESS_LINENO(yyless_macro_arg);\
2078                 zconftext[zconfleng] = (yy_hold_char); \
2079                 (yy_c_buf_p) = zconftext + yyless_macro_arg; \
2080                 (yy_hold_char) = *(yy_c_buf_p); \
2081                 *(yy_c_buf_p) = '\0'; \
2082                 zconfleng = yyless_macro_arg; \
2083                 } \
2084         while ( 0 )
2086 /* Accessor  methods (get/set functions) to struct members. */
2088 /** Get the current line number.
2089  * 
2090  */
2091 int zconfget_lineno  (void)
2093         
2094     return zconflineno;
2097 /** Get the input stream.
2098  * 
2099  */
2100 FILE *zconfget_in  (void)
2102         return zconfin;
2105 /** Get the output stream.
2106  * 
2107  */
2108 FILE *zconfget_out  (void)
2110         return zconfout;
2113 /** Get the length of the current token.
2114  * 
2115  */
2116 int zconfget_leng  (void)
2118         return zconfleng;
2121 /** Get the current token.
2122  * 
2123  */
2125 char *zconfget_text  (void)
2127         return zconftext;
2130 /** Set the current line number.
2131  * @param line_number
2132  * 
2133  */
2134 void zconfset_lineno (int  line_number )
2136     
2137     zconflineno = line_number;
2140 /** Set the input stream. This does not discard the current
2141  * input buffer.
2142  * @param in_str A readable stream.
2143  * 
2144  * @see zconf_switch_to_buffer
2145  */
2146 void zconfset_in (FILE *  in_str )
2148         zconfin = in_str ;
2151 void zconfset_out (FILE *  out_str )
2153         zconfout = out_str ;
2156 int zconfget_debug  (void)
2158         return zconf_flex_debug;
2161 void zconfset_debug (int  bdebug )
2163         zconf_flex_debug = bdebug ;
2166 static int yy_init_globals (void)
2168         /* Initialization is the same as for the non-reentrant scanner.
2169      * This function is called from zconflex_destroy(), so don't allocate here.
2170      */
2172     (yy_buffer_stack) = 0;
2173     (yy_buffer_stack_top) = 0;
2174     (yy_buffer_stack_max) = 0;
2175     (yy_c_buf_p) = (char *) 0;
2176     (yy_init) = 0;
2177     (yy_start) = 0;
2179 /* Defined in main.c */
2180 #ifdef YY_STDINIT
2181     zconfin = stdin;
2182     zconfout = stdout;
2183 #else
2184     zconfin = (FILE *) 0;
2185     zconfout = (FILE *) 0;
2186 #endif
2188     /* For future reference: Set errno on error, since we are called by
2189      * zconflex_init()
2190      */
2191     return 0;
2194 /* zconflex_destroy is for both reentrant and non-reentrant scanners. */
2195 int zconflex_destroy  (void)
2197     
2198     /* Pop the buffer stack, destroying each element. */
2199         while(YY_CURRENT_BUFFER){
2200                 zconf_delete_buffer(YY_CURRENT_BUFFER  );
2201                 YY_CURRENT_BUFFER_LVALUE = NULL;
2202                 zconfpop_buffer_state();
2203         }
2205         /* Destroy the stack itself. */
2206         zconffree((yy_buffer_stack) );
2207         (yy_buffer_stack) = NULL;
2209     /* Reset the globals. This is important in a non-reentrant scanner so the next time
2210      * zconflex() is called, initialization will occur. */
2211     yy_init_globals( );
2213     return 0;
2217  * Internal utility routines.
2218  */
2220 #ifndef yytext_ptr
2221 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2223         register int i;
2224         for ( i = 0; i < n; ++i )
2225                 s1[i] = s2[i];
2227 #endif
2229 #ifdef YY_NEED_STRLEN
2230 static int yy_flex_strlen (yyconst char * s )
2232         register int n;
2233         for ( n = 0; s[n]; ++n )
2234                 ;
2236         return n;
2238 #endif
2240 void *zconfalloc (yy_size_t  size )
2242         return (void *) malloc( size );
2245 void *zconfrealloc  (void * ptr, yy_size_t  size )
2247         /* The cast to (char *) in the following accommodates both
2248          * implementations that use char* generic pointers, and those
2249          * that use void* generic pointers.  It works with the latter
2250          * because both ANSI C and C++ allow castless assignment from
2251          * any pointer type to void*, and deal with argument conversions
2252          * as though doing an assignment.
2253          */
2254         return (void *) realloc( (char *) ptr, size );
2257 void zconffree (void * ptr )
2259         free( (char *) ptr );   /* see zconfrealloc() for (char *) cast */
2262 #define YYTABLES_NAME "yytables"
2264 void zconf_starthelp(void)
2266         new_string();
2267         last_ts = first_ts = 0;
2268         BEGIN(HELP);
2271 static void zconf_endhelp(void)
2273         zconflval.string = text;
2274         BEGIN(INITIAL);
2278  * Try to open specified file with following names:
2279  * ./name
2280  * $(srctree)/name
2281  * The latter is used when srctree is separate from objtree
2282  * when compiling the kernel.
2283  * Return NULL if file is not found.
2284  */
2285 FILE *zconf_fopen(const char *name)
2287         char *env, fullname[PATH_MAX+1];
2288         FILE *f;
2290         f = fopen(name, "r");
2291         if (!f && name != NULL && name[0] != '/') {
2292                 env = getenv(SRCTREE);
2293                 if (env) {
2294                         sprintf(fullname, "%s/%s", env, name);
2295                         f = fopen(fullname, "r");
2296                 }
2297         }
2298         return f;
2301 void zconf_initscan(const char *name)
2303         zconfin = zconf_fopen(name);
2304         if (!zconfin) {
2305                 printf("can't find file %s\n", name);
2306                 exit(1);
2307         }
2309         current_buf = malloc(sizeof(*current_buf));
2310         memset(current_buf, 0, sizeof(*current_buf));
2312         current_file = file_lookup(name);
2313         current_file->lineno = 1;
2314         current_file->flags = FILE_BUSY;
2317 void zconf_nextfile(const char *name)
2319         struct file *file = file_lookup(name);
2320         struct buffer *buf = malloc(sizeof(*buf));
2321         memset(buf, 0, sizeof(*buf));
2323         current_buf->state = YY_CURRENT_BUFFER;
2324         zconfin = zconf_fopen(name);
2325         if (!zconfin) {
2326                 printf("%s:%d: can't open file \"%s\"\n", zconf_curname(), zconf_lineno(), name);
2327                 exit(1);
2328         }
2329         zconf_switch_to_buffer(zconf_create_buffer(zconfin,YY_BUF_SIZE));
2330         buf->parent = current_buf;
2331         current_buf = buf;
2333         if (file->flags & FILE_BUSY) {
2334                 printf("recursive scan (%s)?\n", name);
2335                 exit(1);
2336         }
2337         if (file->flags & FILE_SCANNED) {
2338                 printf("file %s already scanned?\n", name);
2339                 exit(1);
2340         }
2341         file->flags |= FILE_BUSY;
2342         file->lineno = 1;
2343         file->parent = current_file;
2344         current_file = file;
2347 static void zconf_endfile(void)
2349         struct buffer *parent;
2351         current_file->flags |= FILE_SCANNED;
2352         current_file->flags &= ~FILE_BUSY;
2353         current_file = current_file->parent;
2355         parent = current_buf->parent;
2356         if (parent) {
2357                 fclose(zconfin);
2358                 zconf_delete_buffer(YY_CURRENT_BUFFER);
2359                 zconf_switch_to_buffer(parent->state);
2360         }
2361         free(current_buf);
2362         current_buf = parent;
2365 int zconf_lineno(void)
2367         return current_pos.lineno;
2370 char *zconf_curname(void)
2372         return current_pos.file ? current_pos.file->name : "<none>";