bump version
[buildroot.git] / package / config / lex.zconf.c_shipped
bloba065d5a57c01c131694d6da73ce5591063b34e9b
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                 append_string(zconftext, zconfleng);
1279                 if (!first_ts)
1280                         first_ts = last_ts;
1281         }
1282         YY_BREAK
1283 case YY_STATE_EOF(HELP):
1285                 zconf_endhelp();
1286                 return T_HELPTEXT;
1287         }
1288         YY_BREAK
1290 case YY_STATE_EOF(INITIAL):
1291 case YY_STATE_EOF(COMMAND):
1293         if (current_file) {
1294                 zconf_endfile();
1295                 return T_EOL;
1296         }
1297         fclose(zconfin);
1298         yyterminate();
1300         YY_BREAK
1301 case 33:
1302 YY_RULE_SETUP
1303 YY_FATAL_ERROR( "flex scanner jammed" );
1304         YY_BREAK
1306         case YY_END_OF_BUFFER:
1307                 {
1308                 /* Amount of text matched not including the EOB char. */
1309                 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1311                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1312                 *yy_cp = (yy_hold_char);
1313                 YY_RESTORE_YY_MORE_OFFSET
1315                 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1316                         {
1317                         /* We're scanning a new file or input source.  It's
1318                          * possible that this happened because the user
1319                          * just pointed zconfin at a new source and called
1320                          * zconflex().  If so, then we have to assure
1321                          * consistency between YY_CURRENT_BUFFER and our
1322                          * globals.  Here is the right place to do so, because
1323                          * this is the first action (other than possibly a
1324                          * back-up) that will match for the new input source.
1325                          */
1326                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1327                         YY_CURRENT_BUFFER_LVALUE->yy_input_file = zconfin;
1328                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1329                         }
1331                 /* Note that here we test for yy_c_buf_p "<=" to the position
1332                  * of the first EOB in the buffer, since yy_c_buf_p will
1333                  * already have been incremented past the NUL character
1334                  * (since all states make transitions on EOB to the
1335                  * end-of-buffer state).  Contrast this with the test
1336                  * in input().
1337                  */
1338                 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1339                         { /* This was really a NUL. */
1340                         yy_state_type yy_next_state;
1342                         (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1344                         yy_current_state = yy_get_previous_state(  );
1346                         /* Okay, we're now positioned to make the NUL
1347                          * transition.  We couldn't have
1348                          * yy_get_previous_state() go ahead and do it
1349                          * for us because it doesn't know how to deal
1350                          * with the possibility of jamming (and we don't
1351                          * want to build jamming into it because then it
1352                          * will run more slowly).
1353                          */
1355                         yy_next_state = yy_try_NUL_trans( yy_current_state );
1357                         yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1359                         if ( yy_next_state )
1360                                 {
1361                                 /* Consume the NUL. */
1362                                 yy_cp = ++(yy_c_buf_p);
1363                                 yy_current_state = yy_next_state;
1364                                 goto yy_match;
1365                                 }
1367                         else
1368                                 {
1369                                 yy_cp = (yy_c_buf_p);
1370                                 goto yy_find_action;
1371                                 }
1372                         }
1374                 else switch ( yy_get_next_buffer(  ) )
1375                         {
1376                         case EOB_ACT_END_OF_FILE:
1377                                 {
1378                                 (yy_did_buffer_switch_on_eof) = 0;
1380                                 if ( zconfwrap( ) )
1381                                         {
1382                                         /* Note: because we've taken care in
1383                                          * yy_get_next_buffer() to have set up
1384                                          * zconftext, we can now set up
1385                                          * yy_c_buf_p so that if some total
1386                                          * hoser (like flex itself) wants to
1387                                          * call the scanner after we return the
1388                                          * YY_NULL, it'll still work - another
1389                                          * YY_NULL will get returned.
1390                                          */
1391                                         (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1393                                         yy_act = YY_STATE_EOF(YY_START);
1394                                         goto do_action;
1395                                         }
1397                                 else
1398                                         {
1399                                         if ( ! (yy_did_buffer_switch_on_eof) )
1400                                                 YY_NEW_FILE;
1401                                         }
1402                                 break;
1403                                 }
1405                         case EOB_ACT_CONTINUE_SCAN:
1406                                 (yy_c_buf_p) =
1407                                         (yytext_ptr) + yy_amount_of_matched_text;
1409                                 yy_current_state = yy_get_previous_state(  );
1411                                 yy_cp = (yy_c_buf_p);
1412                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1413                                 goto yy_match;
1415                         case EOB_ACT_LAST_MATCH:
1416                                 (yy_c_buf_p) =
1417                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1419                                 yy_current_state = yy_get_previous_state(  );
1421                                 yy_cp = (yy_c_buf_p);
1422                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1423                                 goto yy_find_action;
1424                         }
1425                 break;
1426                 }
1428         default:
1429                 YY_FATAL_ERROR(
1430                         "fatal flex scanner internal error--no action found" );
1431         } /* end of action switch */
1432                 } /* end of scanning one token */
1433 } /* end of zconflex */
1435 /* yy_get_next_buffer - try to read in a new buffer
1437  * Returns a code representing an action:
1438  *      EOB_ACT_LAST_MATCH -
1439  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1440  *      EOB_ACT_END_OF_FILE - end of file
1441  */
1442 static int yy_get_next_buffer (void)
1444         register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1445         register char *source = (yytext_ptr);
1446         register int number_to_move, i;
1447         int ret_val;
1449         if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1450                 YY_FATAL_ERROR(
1451                 "fatal flex scanner internal error--end of buffer missed" );
1453         if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1454                 { /* Don't try to fill the buffer, so this is an EOF. */
1455                 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1456                         {
1457                         /* We matched a single character, the EOB, so
1458                          * treat this as a final EOF.
1459                          */
1460                         return EOB_ACT_END_OF_FILE;
1461                         }
1463                 else
1464                         {
1465                         /* We matched some text prior to the EOB, first
1466                          * process it.
1467                          */
1468                         return EOB_ACT_LAST_MATCH;
1469                         }
1470                 }
1472         /* Try to read more data. */
1474         /* First move last chars to start of buffer. */
1475         number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1477         for ( i = 0; i < number_to_move; ++i )
1478                 *(dest++) = *(source++);
1480         if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1481                 /* don't do the read, it's not guaranteed to return an EOF,
1482                  * just force an EOF
1483                  */
1484                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1486         else
1487                 {
1488                         int num_to_read =
1489                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1491                 while ( num_to_read <= 0 )
1492                         { /* Not enough room in the buffer - grow it. */
1494                         /* just a shorter name for the current buffer */
1495                         YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1497                         int yy_c_buf_p_offset =
1498                                 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1500                         if ( b->yy_is_our_buffer )
1501                                 {
1502                                 int new_size = b->yy_buf_size * 2;
1504                                 if ( new_size <= 0 )
1505                                         b->yy_buf_size += b->yy_buf_size / 8;
1506                                 else
1507                                         b->yy_buf_size *= 2;
1509                                 b->yy_ch_buf = (char *)
1510                                         /* Include room in for 2 EOB chars. */
1511                                         zconfrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
1512                                 }
1513                         else
1514                                 /* Can't grow it, we don't own it. */
1515                                 b->yy_ch_buf = 0;
1517                         if ( ! b->yy_ch_buf )
1518                                 YY_FATAL_ERROR(
1519                                 "fatal error - scanner input buffer overflow" );
1521                         (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1523                         num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1524                                                 number_to_move - 1;
1526                         }
1528                 if ( num_to_read > YY_READ_BUF_SIZE )
1529                         num_to_read = YY_READ_BUF_SIZE;
1531                 /* Read in more data. */
1532                 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1533                         (yy_n_chars), num_to_read );
1535                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1536                 }
1538         if ( (yy_n_chars) == 0 )
1539                 {
1540                 if ( number_to_move == YY_MORE_ADJ )
1541                         {
1542                         ret_val = EOB_ACT_END_OF_FILE;
1543                         zconfrestart(zconfin  );
1544                         }
1546                 else
1547                         {
1548                         ret_val = EOB_ACT_LAST_MATCH;
1549                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1550                                 YY_BUFFER_EOF_PENDING;
1551                         }
1552                 }
1554         else
1555                 ret_val = EOB_ACT_CONTINUE_SCAN;
1557         (yy_n_chars) += number_to_move;
1558         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1559         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1561         (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1563         return ret_val;
1566 /* yy_get_previous_state - get the state just before the EOB char was reached */
1568     static yy_state_type yy_get_previous_state (void)
1570         register yy_state_type yy_current_state;
1571         register char *yy_cp;
1572     
1573         yy_current_state = (yy_start);
1575         for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1576                 {
1577                 yy_current_state = yy_nxt[yy_current_state][(*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1)];
1578                 }
1580         return yy_current_state;
1583 /* yy_try_NUL_trans - try to make a transition on the NUL character
1585  * synopsis
1586  *      next_state = yy_try_NUL_trans( current_state );
1587  */
1588     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
1590         register int yy_is_jam;
1591     
1592         yy_current_state = yy_nxt[yy_current_state][1];
1593         yy_is_jam = (yy_current_state <= 0);
1595         return yy_is_jam ? 0 : yy_current_state;
1598     static void yyunput (int c, register char * yy_bp )
1600         register char *yy_cp;
1601     
1602     yy_cp = (yy_c_buf_p);
1604         /* undo effects of setting up zconftext */
1605         *yy_cp = (yy_hold_char);
1607         if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1608                 { /* need to shift things up to make room */
1609                 /* +2 for EOB chars. */
1610                 register int number_to_move = (yy_n_chars) + 2;
1611                 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1612                                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1613                 register char *source =
1614                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1616                 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1617                         *--dest = *--source;
1619                 yy_cp += (int) (dest - source);
1620                 yy_bp += (int) (dest - source);
1621                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1622                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1624                 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1625                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
1626                 }
1628         *--yy_cp = (char) c;
1630         (yytext_ptr) = yy_bp;
1631         (yy_hold_char) = *yy_cp;
1632         (yy_c_buf_p) = yy_cp;
1635 #ifndef YY_NO_INPUT
1636 #ifdef __cplusplus
1637     static int yyinput (void)
1638 #else
1639     static int input  (void)
1640 #endif
1643         int c;
1644     
1645         *(yy_c_buf_p) = (yy_hold_char);
1647         if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1648                 {
1649                 /* yy_c_buf_p now points to the character we want to return.
1650                  * If this occurs *before* the EOB characters, then it's a
1651                  * valid NUL; if not, then we've hit the end of the buffer.
1652                  */
1653                 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1654                         /* This was really a NUL. */
1655                         *(yy_c_buf_p) = '\0';
1657                 else
1658                         { /* need more input */
1659                         int offset = (yy_c_buf_p) - (yytext_ptr);
1660                         ++(yy_c_buf_p);
1662                         switch ( yy_get_next_buffer(  ) )
1663                                 {
1664                                 case EOB_ACT_LAST_MATCH:
1665                                         /* This happens because yy_g_n_b()
1666                                          * sees that we've accumulated a
1667                                          * token and flags that we need to
1668                                          * try matching the token before
1669                                          * proceeding.  But for input(),
1670                                          * there's no matching to consider.
1671                                          * So convert the EOB_ACT_LAST_MATCH
1672                                          * to EOB_ACT_END_OF_FILE.
1673                                          */
1675                                         /* Reset buffer status. */
1676                                         zconfrestart(zconfin );
1678                                         /*FALLTHROUGH*/
1680                                 case EOB_ACT_END_OF_FILE:
1681                                         {
1682                                         if ( zconfwrap( ) )
1683                                                 return EOF;
1685                                         if ( ! (yy_did_buffer_switch_on_eof) )
1686                                                 YY_NEW_FILE;
1687 #ifdef __cplusplus
1688                                         return yyinput();
1689 #else
1690                                         return input();
1691 #endif
1692                                         }
1694                                 case EOB_ACT_CONTINUE_SCAN:
1695                                         (yy_c_buf_p) = (yytext_ptr) + offset;
1696                                         break;
1697                                 }
1698                         }
1699                 }
1701         c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
1702         *(yy_c_buf_p) = '\0';   /* preserve zconftext */
1703         (yy_hold_char) = *++(yy_c_buf_p);
1705         return c;
1707 #endif  /* ifndef YY_NO_INPUT */
1709 /** Immediately switch to a different input stream.
1710  * @param input_file A readable stream.
1711  * 
1712  * @note This function does not reset the start condition to @c INITIAL .
1713  */
1714     void zconfrestart  (FILE * input_file )
1716     
1717         if ( ! YY_CURRENT_BUFFER ){
1718         zconfensure_buffer_stack ();
1719                 YY_CURRENT_BUFFER_LVALUE =
1720             zconf_create_buffer(zconfin,YY_BUF_SIZE );
1721         }
1723         zconf_init_buffer(YY_CURRENT_BUFFER,input_file );
1724         zconf_load_buffer_state( );
1727 /** Switch to a different input buffer.
1728  * @param new_buffer The new input buffer.
1729  * 
1730  */
1731     void zconf_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
1733     
1734         /* TODO. We should be able to replace this entire function body
1735          * with
1736          *              zconfpop_buffer_state();
1737          *              zconfpush_buffer_state(new_buffer);
1738      */
1739         zconfensure_buffer_stack ();
1740         if ( YY_CURRENT_BUFFER == new_buffer )
1741                 return;
1743         if ( YY_CURRENT_BUFFER )
1744                 {
1745                 /* Flush out information for old buffer. */
1746                 *(yy_c_buf_p) = (yy_hold_char);
1747                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1748                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1749                 }
1751         YY_CURRENT_BUFFER_LVALUE = new_buffer;
1752         zconf_load_buffer_state( );
1754         /* We don't actually know whether we did this switch during
1755          * EOF (zconfwrap()) processing, but the only time this flag
1756          * is looked at is after zconfwrap() is called, so it's safe
1757          * to go ahead and always set it.
1758          */
1759         (yy_did_buffer_switch_on_eof) = 1;
1762 static void zconf_load_buffer_state  (void)
1764         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1765         (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1766         zconfin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1767         (yy_hold_char) = *(yy_c_buf_p);
1770 /** Allocate and initialize an input buffer state.
1771  * @param file A readable stream.
1772  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1773  * 
1774  * @return the allocated buffer state.
1775  */
1776     YY_BUFFER_STATE zconf_create_buffer  (FILE * file, int  size )
1778         YY_BUFFER_STATE b;
1779     
1780         b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state )  );
1781         if ( ! b )
1782                 YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" );
1784         b->yy_buf_size = size;
1786         /* yy_ch_buf has to be 2 characters longer than the size given because
1787          * we need to put in 2 end-of-buffer characters.
1788          */
1789         b->yy_ch_buf = (char *) zconfalloc(b->yy_buf_size + 2  );
1790         if ( ! b->yy_ch_buf )
1791                 YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" );
1793         b->yy_is_our_buffer = 1;
1795         zconf_init_buffer(b,file );
1797         return b;
1800 /** Destroy the buffer.
1801  * @param b a buffer created with zconf_create_buffer()
1802  * 
1803  */
1804     void zconf_delete_buffer (YY_BUFFER_STATE  b )
1806     
1807         if ( ! b )
1808                 return;
1810         if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1811                 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1813         if ( b->yy_is_our_buffer )
1814                 zconffree((void *) b->yy_ch_buf  );
1816         zconffree((void *) b  );
1819 /* Initializes or reinitializes a buffer.
1820  * This function is sometimes called more than once on the same buffer,
1821  * such as during a zconfrestart() or at EOF.
1822  */
1823     static void zconf_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
1826         int oerrno = errno;
1827     
1828         zconf_flush_buffer(b );
1830         b->yy_input_file = file;
1831         b->yy_fill_buffer = 1;
1833     /* If b is the current buffer, then zconf_init_buffer was _probably_
1834      * called from zconfrestart() or through yy_get_next_buffer.
1835      * In that case, we don't want to reset the lineno or column.
1836      */
1837     if (b != YY_CURRENT_BUFFER){
1838         b->yy_bs_lineno = 1;
1839         b->yy_bs_column = 0;
1840     }
1842         b->yy_is_interactive = 0;
1843     
1844         errno = oerrno;
1847 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1848  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1849  * 
1850  */
1851     void zconf_flush_buffer (YY_BUFFER_STATE  b )
1853         if ( ! b )
1854                 return;
1856         b->yy_n_chars = 0;
1858         /* We always need two end-of-buffer characters.  The first causes
1859          * a transition to the end-of-buffer state.  The second causes
1860          * a jam in that state.
1861          */
1862         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1863         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1865         b->yy_buf_pos = &b->yy_ch_buf[0];
1867         b->yy_at_bol = 1;
1868         b->yy_buffer_status = YY_BUFFER_NEW;
1870         if ( b == YY_CURRENT_BUFFER )
1871                 zconf_load_buffer_state( );
1874 /** Pushes the new state onto the stack. The new state becomes
1875  *  the current state. This function will allocate the stack
1876  *  if necessary.
1877  *  @param new_buffer The new state.
1878  *  
1879  */
1880 void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
1882         if (new_buffer == NULL)
1883                 return;
1885         zconfensure_buffer_stack();
1887         /* This block is copied from zconf_switch_to_buffer. */
1888         if ( YY_CURRENT_BUFFER )
1889                 {
1890                 /* Flush out information for old buffer. */
1891                 *(yy_c_buf_p) = (yy_hold_char);
1892                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1893                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1894                 }
1896         /* Only push if top exists. Otherwise, replace top. */
1897         if (YY_CURRENT_BUFFER)
1898                 (yy_buffer_stack_top)++;
1899         YY_CURRENT_BUFFER_LVALUE = new_buffer;
1901         /* copied from zconf_switch_to_buffer. */
1902         zconf_load_buffer_state( );
1903         (yy_did_buffer_switch_on_eof) = 1;
1906 /** Removes and deletes the top of the stack, if present.
1907  *  The next element becomes the new top.
1908  *  
1909  */
1910 void zconfpop_buffer_state (void)
1912         if (!YY_CURRENT_BUFFER)
1913                 return;
1915         zconf_delete_buffer(YY_CURRENT_BUFFER );
1916         YY_CURRENT_BUFFER_LVALUE = NULL;
1917         if ((yy_buffer_stack_top) > 0)
1918                 --(yy_buffer_stack_top);
1920         if (YY_CURRENT_BUFFER) {
1921                 zconf_load_buffer_state( );
1922                 (yy_did_buffer_switch_on_eof) = 1;
1923         }
1926 /* Allocates the stack if it does not exist.
1927  *  Guarantees space for at least one push.
1928  */
1929 static void zconfensure_buffer_stack (void)
1931         int num_to_alloc;
1932     
1933         if (!(yy_buffer_stack)) {
1935                 /* First allocation is just for 2 elements, since we don't know if this
1936                  * scanner will even need a stack. We use 2 instead of 1 to avoid an
1937                  * immediate realloc on the next call.
1938          */
1939                 num_to_alloc = 1;
1940                 (yy_buffer_stack) = (struct yy_buffer_state**)zconfalloc
1941                                                                 (num_to_alloc * sizeof(struct yy_buffer_state*)
1942                                                                 );
1943                 
1944                 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1945                                 
1946                 (yy_buffer_stack_max) = num_to_alloc;
1947                 (yy_buffer_stack_top) = 0;
1948                 return;
1949         }
1951         if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1953                 /* Increase the buffer to prepare for a possible push. */
1954                 int grow_size = 8 /* arbitrary grow size */;
1956                 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1957                 (yy_buffer_stack) = (struct yy_buffer_state**)zconfrealloc
1958                                                                 ((yy_buffer_stack),
1959                                                                 num_to_alloc * sizeof(struct yy_buffer_state*)
1960                                                                 );
1962                 /* zero only the new slots.*/
1963                 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1964                 (yy_buffer_stack_max) = num_to_alloc;
1965         }
1968 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1969  * @param base the character buffer
1970  * @param size the size in bytes of the character buffer
1971  * 
1972  * @return the newly allocated buffer state object. 
1973  */
1974 YY_BUFFER_STATE zconf_scan_buffer  (char * base, yy_size_t  size )
1976         YY_BUFFER_STATE b;
1977     
1978         if ( size < 2 ||
1979              base[size-2] != YY_END_OF_BUFFER_CHAR ||
1980              base[size-1] != YY_END_OF_BUFFER_CHAR )
1981                 /* They forgot to leave room for the EOB's. */
1982                 return 0;
1984         b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state )  );
1985         if ( ! b )
1986                 YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_buffer()" );
1988         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
1989         b->yy_buf_pos = b->yy_ch_buf = base;
1990         b->yy_is_our_buffer = 0;
1991         b->yy_input_file = 0;
1992         b->yy_n_chars = b->yy_buf_size;
1993         b->yy_is_interactive = 0;
1994         b->yy_at_bol = 1;
1995         b->yy_fill_buffer = 0;
1996         b->yy_buffer_status = YY_BUFFER_NEW;
1998         zconf_switch_to_buffer(b  );
2000         return b;
2003 /** Setup the input buffer state to scan a string. The next call to zconflex() will
2004  * scan from a @e copy of @a str.
2005  * @param str a NUL-terminated string to scan
2006  * 
2007  * @return the newly allocated buffer state object.
2008  * @note If you want to scan bytes that may contain NUL values, then use
2009  *       zconf_scan_bytes() instead.
2010  */
2011 YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr )
2013     
2014         return zconf_scan_bytes(yystr,strlen(yystr) );
2017 /** Setup the input buffer state to scan the given bytes. The next call to zconflex() will
2018  * scan from a @e copy of @a bytes.
2019  * @param bytes the byte buffer to scan
2020  * @param len the number of bytes in the buffer pointed to by @a bytes.
2021  * 
2022  * @return the newly allocated buffer state object.
2023  */
2024 YY_BUFFER_STATE zconf_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
2026         YY_BUFFER_STATE b;
2027         char *buf;
2028         yy_size_t n;
2029         int i;
2030     
2031         /* Get memory for full buffer, including space for trailing EOB's. */
2032         n = _yybytes_len + 2;
2033         buf = (char *) zconfalloc(n  );
2034         if ( ! buf )
2035                 YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_bytes()" );
2037         for ( i = 0; i < _yybytes_len; ++i )
2038                 buf[i] = yybytes[i];
2040         buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2042         b = zconf_scan_buffer(buf,n );
2043         if ( ! b )
2044                 YY_FATAL_ERROR( "bad buffer in zconf_scan_bytes()" );
2046         /* It's okay to grow etc. this buffer, and we should throw it
2047          * away when we're done.
2048          */
2049         b->yy_is_our_buffer = 1;
2051         return b;
2054 #ifndef YY_EXIT_FAILURE
2055 #define YY_EXIT_FAILURE 2
2056 #endif
2058 static void yy_fatal_error (yyconst char* msg )
2060         (void) fprintf( stderr, "%s\n", msg );
2061         exit( YY_EXIT_FAILURE );
2064 /* Redefine yyless() so it works in section 3 code. */
2066 #undef yyless
2067 #define yyless(n) \
2068         do \
2069                 { \
2070                 /* Undo effects of setting up zconftext. */ \
2071         int yyless_macro_arg = (n); \
2072         YY_LESS_LINENO(yyless_macro_arg);\
2073                 zconftext[zconfleng] = (yy_hold_char); \
2074                 (yy_c_buf_p) = zconftext + yyless_macro_arg; \
2075                 (yy_hold_char) = *(yy_c_buf_p); \
2076                 *(yy_c_buf_p) = '\0'; \
2077                 zconfleng = yyless_macro_arg; \
2078                 } \
2079         while ( 0 )
2081 /* Accessor  methods (get/set functions) to struct members. */
2083 /** Get the current line number.
2084  * 
2085  */
2086 int zconfget_lineno  (void)
2088         
2089     return zconflineno;
2092 /** Get the input stream.
2093  * 
2094  */
2095 FILE *zconfget_in  (void)
2097         return zconfin;
2100 /** Get the output stream.
2101  * 
2102  */
2103 FILE *zconfget_out  (void)
2105         return zconfout;
2108 /** Get the length of the current token.
2109  * 
2110  */
2111 int zconfget_leng  (void)
2113         return zconfleng;
2116 /** Get the current token.
2117  * 
2118  */
2120 char *zconfget_text  (void)
2122         return zconftext;
2125 /** Set the current line number.
2126  * @param line_number
2127  * 
2128  */
2129 void zconfset_lineno (int  line_number )
2131     
2132     zconflineno = line_number;
2135 /** Set the input stream. This does not discard the current
2136  * input buffer.
2137  * @param in_str A readable stream.
2138  * 
2139  * @see zconf_switch_to_buffer
2140  */
2141 void zconfset_in (FILE *  in_str )
2143         zconfin = in_str ;
2146 void zconfset_out (FILE *  out_str )
2148         zconfout = out_str ;
2151 int zconfget_debug  (void)
2153         return zconf_flex_debug;
2156 void zconfset_debug (int  bdebug )
2158         zconf_flex_debug = bdebug ;
2161 static int yy_init_globals (void)
2163         /* Initialization is the same as for the non-reentrant scanner.
2164      * This function is called from zconflex_destroy(), so don't allocate here.
2165      */
2167     (yy_buffer_stack) = 0;
2168     (yy_buffer_stack_top) = 0;
2169     (yy_buffer_stack_max) = 0;
2170     (yy_c_buf_p) = (char *) 0;
2171     (yy_init) = 0;
2172     (yy_start) = 0;
2174 /* Defined in main.c */
2175 #ifdef YY_STDINIT
2176     zconfin = stdin;
2177     zconfout = stdout;
2178 #else
2179     zconfin = (FILE *) 0;
2180     zconfout = (FILE *) 0;
2181 #endif
2183     /* For future reference: Set errno on error, since we are called by
2184      * zconflex_init()
2185      */
2186     return 0;
2189 /* zconflex_destroy is for both reentrant and non-reentrant scanners. */
2190 int zconflex_destroy  (void)
2192     
2193     /* Pop the buffer stack, destroying each element. */
2194         while(YY_CURRENT_BUFFER){
2195                 zconf_delete_buffer(YY_CURRENT_BUFFER  );
2196                 YY_CURRENT_BUFFER_LVALUE = NULL;
2197                 zconfpop_buffer_state();
2198         }
2200         /* Destroy the stack itself. */
2201         zconffree((yy_buffer_stack) );
2202         (yy_buffer_stack) = NULL;
2204     /* Reset the globals. This is important in a non-reentrant scanner so the next time
2205      * zconflex() is called, initialization will occur. */
2206     yy_init_globals( );
2208     return 0;
2212  * Internal utility routines.
2213  */
2215 #ifndef yytext_ptr
2216 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2218         register int i;
2219         for ( i = 0; i < n; ++i )
2220                 s1[i] = s2[i];
2222 #endif
2224 #ifdef YY_NEED_STRLEN
2225 static int yy_flex_strlen (yyconst char * s )
2227         register int n;
2228         for ( n = 0; s[n]; ++n )
2229                 ;
2231         return n;
2233 #endif
2235 void *zconfalloc (yy_size_t  size )
2237         return (void *) malloc( size );
2240 void *zconfrealloc  (void * ptr, yy_size_t  size )
2242         /* The cast to (char *) in the following accommodates both
2243          * implementations that use char* generic pointers, and those
2244          * that use void* generic pointers.  It works with the latter
2245          * because both ANSI C and C++ allow castless assignment from
2246          * any pointer type to void*, and deal with argument conversions
2247          * as though doing an assignment.
2248          */
2249         return (void *) realloc( (char *) ptr, size );
2252 void zconffree (void * ptr )
2254         free( (char *) ptr );   /* see zconfrealloc() for (char *) cast */
2257 #define YYTABLES_NAME "yytables"
2259 void zconf_starthelp(void)
2261         new_string();
2262         last_ts = first_ts = 0;
2263         BEGIN(HELP);
2266 static void zconf_endhelp(void)
2268         zconflval.string = text;
2269         BEGIN(INITIAL);
2273  * Try to open specified file with following names:
2274  * ./name
2275  * $(srctree)/name
2276  * The latter is used when srctree is separate from objtree
2277  * when compiling the kernel.
2278  * Return NULL if file is not found.
2279  */
2280 FILE *zconf_fopen(const char *name)
2282         char *env, fullname[PATH_MAX+1];
2283         FILE *f;
2285         f = fopen(name, "r");
2286         if (!f && name != NULL && name[0] != '/') {
2287                 env = getenv(SRCTREE);
2288                 if (env) {
2289                         sprintf(fullname, "%s/%s", env, name);
2290                         f = fopen(fullname, "r");
2291                 }
2292         }
2293         return f;
2296 void zconf_initscan(const char *name)
2298         zconfin = zconf_fopen(name);
2299         if (!zconfin) {
2300                 printf("can't find file %s\n", name);
2301                 exit(1);
2302         }
2304         current_buf = malloc(sizeof(*current_buf));
2305         memset(current_buf, 0, sizeof(*current_buf));
2307         current_file = file_lookup(name);
2308         current_file->lineno = 1;
2309         current_file->flags = FILE_BUSY;
2312 void zconf_nextfile(const char *name)
2314         struct file *file = file_lookup(name);
2315         struct buffer *buf = malloc(sizeof(*buf));
2316         memset(buf, 0, sizeof(*buf));
2318         current_buf->state = YY_CURRENT_BUFFER;
2319         zconfin = zconf_fopen(name);
2320         if (!zconfin) {
2321                 printf("%s:%d: can't open file \"%s\"\n", zconf_curname(), zconf_lineno(), name);
2322                 exit(1);
2323         }
2324         zconf_switch_to_buffer(zconf_create_buffer(zconfin,YY_BUF_SIZE));
2325         buf->parent = current_buf;
2326         current_buf = buf;
2328         if (file->flags & FILE_BUSY) {
2329                 printf("recursive scan (%s)?\n", name);
2330                 exit(1);
2331         }
2332         if (file->flags & FILE_SCANNED) {
2333                 printf("file %s already scanned?\n", name);
2334                 exit(1);
2335         }
2336         file->flags |= FILE_BUSY;
2337         file->lineno = 1;
2338         file->parent = current_file;
2339         current_file = file;
2342 static void zconf_endfile(void)
2344         struct buffer *parent;
2346         current_file->flags |= FILE_SCANNED;
2347         current_file->flags &= ~FILE_BUSY;
2348         current_file = current_file->parent;
2350         parent = current_buf->parent;
2351         if (parent) {
2352                 fclose(zconfin);
2353                 zconf_delete_buffer(YY_CURRENT_BUFFER);
2354                 zconf_switch_to_buffer(parent->state);
2355         }
2356         free(current_buf);
2357         current_buf = parent;
2360 int zconf_lineno(void)
2362         return current_pos.lineno;
2365 char *zconf_curname(void)
2367         return current_pos.file ? current_pos.file->name : "<none>";