xenomai: new package, only mercury for now supported
[openadk.git] / adk / config / lex.zconf.c_shipped
blob069e44b77dd659467aa890dcde0fbcd18b36da19
1 #line 2 "lex.zconf.c"
3 #line 4 "lex.zconf.c"
5 #define  YY_INT_ALIGNED short int
7 /* A lexical scanner generated by flex */
9 #define yy_create_buffer zconf_create_buffer
10 #define yy_delete_buffer zconf_delete_buffer
11 #define yy_flex_debug zconf_flex_debug
12 #define yy_init_buffer zconf_init_buffer
13 #define yy_flush_buffer zconf_flush_buffer
14 #define yy_load_buffer_state zconf_load_buffer_state
15 #define yy_switch_to_buffer zconf_switch_to_buffer
16 #define yyin zconfin
17 #define yyleng zconfleng
18 #define yylex zconflex
19 #define yylineno zconflineno
20 #define yyout zconfout
21 #define yyrestart zconfrestart
22 #define yytext zconftext
23 #define yywrap zconfwrap
24 #define yyalloc zconfalloc
25 #define yyrealloc zconfrealloc
26 #define yyfree zconffree
28 #define FLEX_SCANNER
29 #define YY_FLEX_MAJOR_VERSION 2
30 #define YY_FLEX_MINOR_VERSION 5
31 #define YY_FLEX_SUBMINOR_VERSION 35
32 #if YY_FLEX_SUBMINOR_VERSION > 0
33 #define FLEX_BETA
34 #endif
36 /* First, we deal with  platform-specific or compiler-specific issues. */
38 /* begin standard C headers. */
39 #include <stdio.h>
40 #include <string.h>
41 #include <errno.h>
42 #include <stdlib.h>
44 /* end standard C headers. */
46 /* flex integer type definitions */
48 #ifndef FLEXINT_H
49 #define FLEXINT_H
51 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
53 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
55 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
56  * if you want the limit (max/min) macros for int types. 
57  */
58 #ifndef __STDC_LIMIT_MACROS
59 #define __STDC_LIMIT_MACROS 1
60 #endif
62 #include <inttypes.h>
63 typedef int8_t flex_int8_t;
64 typedef uint8_t flex_uint8_t;
65 typedef int16_t flex_int16_t;
66 typedef uint16_t flex_uint16_t;
67 typedef int32_t flex_int32_t;
68 typedef uint32_t flex_uint32_t;
69 #else
70 typedef signed char flex_int8_t;
71 typedef short int flex_int16_t;
72 typedef int flex_int32_t;
73 typedef unsigned char flex_uint8_t; 
74 typedef unsigned short int flex_uint16_t;
75 typedef unsigned int flex_uint32_t;
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 /* ! C99 */
108 #endif /* ! FLEXINT_H */
110 #ifdef __cplusplus
112 /* The "const" storage-class-modifier is valid. */
113 #define YY_USE_CONST
115 #else   /* ! __cplusplus */
117 /* C99 requires __STDC__ to be defined as 1. */
118 #if defined (__STDC__)
120 #define YY_USE_CONST
122 #endif  /* defined (__STDC__) */
123 #endif  /* ! __cplusplus */
125 #ifdef YY_USE_CONST
126 #define yyconst const
127 #else
128 #define yyconst
129 #endif
131 /* Returned upon end-of-file. */
132 #define YY_NULL 0
134 /* Promotes a possibly negative, possibly signed char to an unsigned
135  * integer for use as an array index.  If the signed char is negative,
136  * we want to instead treat it as an 8-bit unsigned char, hence the
137  * double cast.
138  */
139 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
141 /* Enter a start condition.  This macro really ought to take a parameter,
142  * but we do it the disgusting crufty way forced on us by the ()-less
143  * definition of BEGIN.
144  */
145 #define BEGIN (yy_start) = 1 + 2 *
147 /* Translate the current start state into a value that can be later handed
148  * to BEGIN to return to the state.  The YYSTATE alias is for lex
149  * compatibility.
150  */
151 #define YY_START (((yy_start) - 1) / 2)
152 #define YYSTATE YY_START
154 /* Action number for EOF rule of a given start state. */
155 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
157 /* Special action meaning "start processing a new file". */
158 #define YY_NEW_FILE zconfrestart(zconfin  )
160 #define YY_END_OF_BUFFER_CHAR 0
162 /* Size of default input buffer. */
163 #ifndef YY_BUF_SIZE
164 #ifdef __ia64__
165 /* On IA-64, the buffer size is 16k, not 8k.
166  * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
167  * Ditto for the __ia64__ case accordingly.
168  */
169 #define YY_BUF_SIZE 32768
170 #else
171 #define YY_BUF_SIZE 16384
172 #endif /* __ia64__ */
173 #endif
175 /* The state buf must be large enough to hold one state per character in the main buffer.
176  */
177 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
179 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
180 #define YY_TYPEDEF_YY_BUFFER_STATE
181 typedef struct yy_buffer_state *YY_BUFFER_STATE;
182 #endif
184 extern int zconfleng;
186 extern FILE *zconfin, *zconfout;
188 #define EOB_ACT_CONTINUE_SCAN 0
189 #define EOB_ACT_END_OF_FILE 1
190 #define EOB_ACT_LAST_MATCH 2
192     #define YY_LESS_LINENO(n)
193     
194 /* Return all but the first "n" matched characters back to the input stream. */
195 #define yyless(n) \
196         do \
197                 { \
198                 /* Undo effects of setting up zconftext. */ \
199         int yyless_macro_arg = (n); \
200         YY_LESS_LINENO(yyless_macro_arg);\
201                 *yy_cp = (yy_hold_char); \
202                 YY_RESTORE_YY_MORE_OFFSET \
203                 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
204                 YY_DO_BEFORE_ACTION; /* set up zconftext again */ \
205                 } \
206         while ( 0 )
208 #define unput(c) yyunput( c, (yytext_ptr)  )
210 #ifndef YY_TYPEDEF_YY_SIZE_T
211 #define YY_TYPEDEF_YY_SIZE_T
212 typedef size_t yy_size_t;
213 #endif
215 #ifndef YY_STRUCT_YY_BUFFER_STATE
216 #define YY_STRUCT_YY_BUFFER_STATE
217 struct yy_buffer_state
218         {
219         FILE *yy_input_file;
221         char *yy_ch_buf;                /* input buffer */
222         char *yy_buf_pos;               /* current position in input buffer */
224         /* Size of input buffer in bytes, not including room for EOB
225          * characters.
226          */
227         yy_size_t yy_buf_size;
229         /* Number of characters read into yy_ch_buf, not including EOB
230          * characters.
231          */
232         int yy_n_chars;
234         /* Whether we "own" the buffer - i.e., we know we created it,
235          * and can realloc() it to grow it, and should free() it to
236          * delete it.
237          */
238         int yy_is_our_buffer;
240         /* Whether this is an "interactive" input source; if so, and
241          * if we're using stdio for input, then we want to use getc()
242          * instead of fread(), to make sure we stop fetching input after
243          * each newline.
244          */
245         int yy_is_interactive;
247         /* Whether we're considered to be at the beginning of a line.
248          * If so, '^' rules will be active on the next match, otherwise
249          * not.
250          */
251         int yy_at_bol;
253     int yy_bs_lineno; /**< The line count. */
254     int yy_bs_column; /**< The column count. */
255     
256         /* Whether to try to fill the input buffer when we reach the
257          * end of it.
258          */
259         int yy_fill_buffer;
261         int yy_buffer_status;
263 #define YY_BUFFER_NEW 0
264 #define YY_BUFFER_NORMAL 1
265         /* When an EOF's been seen but there's still some text to process
266          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
267          * shouldn't try reading from the input source any more.  We might
268          * still have a bunch of tokens to match, though, because of
269          * possible backing-up.
270          *
271          * When we actually see the EOF, we change the status to "new"
272          * (via zconfrestart()), so that the user can continue scanning by
273          * just pointing zconfin at a new input file.
274          */
275 #define YY_BUFFER_EOF_PENDING 2
277         };
278 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
280 /* Stack of input buffers. */
281 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
282 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
283 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
285 /* We provide macros for accessing buffer states in case in the
286  * future we want to put the buffer states in a more general
287  * "scanner state".
289  * Returns the top of the stack, or NULL.
290  */
291 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
292                           ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
293                           : NULL)
295 /* Same as previous macro, but useful when we know that the buffer stack is not
296  * NULL or when we need an lvalue. For internal use only.
297  */
298 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
300 /* yy_hold_char holds the character lost when zconftext is formed. */
301 static char yy_hold_char;
302 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
303 int zconfleng;
305 /* Points to current character in buffer. */
306 static char *yy_c_buf_p = (char *) 0;
307 static int yy_init = 0;         /* whether we need to initialize */
308 static int yy_start = 0;        /* start state number */
310 /* Flag which is used to allow zconfwrap()'s to do buffer switches
311  * instead of setting up a fresh zconfin.  A bit of a hack ...
312  */
313 static int yy_did_buffer_switch_on_eof;
315 void zconfrestart (FILE *input_file  );
316 void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
317 YY_BUFFER_STATE zconf_create_buffer (FILE *file,int size  );
318 void zconf_delete_buffer (YY_BUFFER_STATE b  );
319 void zconf_flush_buffer (YY_BUFFER_STATE b  );
320 void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer  );
321 void zconfpop_buffer_state (void );
323 static void zconfensure_buffer_stack (void );
324 static void zconf_load_buffer_state (void );
325 static void zconf_init_buffer (YY_BUFFER_STATE b,FILE *file  );
327 #define YY_FLUSH_BUFFER zconf_flush_buffer(YY_CURRENT_BUFFER )
329 YY_BUFFER_STATE zconf_scan_buffer (char *base,yy_size_t size  );
330 YY_BUFFER_STATE zconf_scan_string (yyconst char *yy_str  );
331 YY_BUFFER_STATE zconf_scan_bytes (yyconst char *bytes,int len  );
333 void *zconfalloc (yy_size_t  );
334 void *zconfrealloc (void *,yy_size_t  );
335 void zconffree (void *  );
337 #define yy_new_buffer zconf_create_buffer
339 #define yy_set_interactive(is_interactive) \
340         { \
341         if ( ! YY_CURRENT_BUFFER ){ \
342         zconfensure_buffer_stack (); \
343                 YY_CURRENT_BUFFER_LVALUE =    \
344             zconf_create_buffer(zconfin,YY_BUF_SIZE ); \
345         } \
346         YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
347         }
349 #define yy_set_bol(at_bol) \
350         { \
351         if ( ! YY_CURRENT_BUFFER ){\
352         zconfensure_buffer_stack (); \
353                 YY_CURRENT_BUFFER_LVALUE =    \
354             zconf_create_buffer(zconfin,YY_BUF_SIZE ); \
355         } \
356         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
357         }
359 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
361 /* Begin user sect3 */
363 #define zconfwrap(n) 1
364 #define YY_SKIP_YYWRAP
366 typedef unsigned char YY_CHAR;
368 FILE *zconfin = (FILE *) 0, *zconfout = (FILE *) 0;
370 typedef int yy_state_type;
372 extern int zconflineno;
374 int zconflineno = 1;
376 extern char *zconftext;
377 #define yytext_ptr zconftext
378 static yyconst flex_int16_t yy_nxt[][17] =
379     {
380     {
381         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
382         0,    0,    0,    0,    0,    0,    0
383     },
385     {
386        11,   12,   13,   14,   12,   12,   15,   12,   12,   12,
387        12,   12,   12,   12,   12,   12,   12
388     },
390     {
391        11,   12,   13,   14,   12,   12,   15,   12,   12,   12,
392        12,   12,   12,   12,   12,   12,   12
393     },
395     {
396        11,   16,   16,   17,   16,   16,   16,   16,   16,   16,
397        16,   16,   16,   18,   16,   16,   16
398     },
400     {
401        11,   16,   16,   17,   16,   16,   16,   16,   16,   16,
402        16,   16,   16,   18,   16,   16,   16
404     },
406     {
407        11,   19,   20,   21,   19,   19,   19,   19,   19,   19,
408        19,   19,   19,   19,   19,   19,   19
409     },
411     {
412        11,   19,   20,   21,   19,   19,   19,   19,   19,   19,
413        19,   19,   19,   19,   19,   19,   19
414     },
416     {
417        11,   22,   22,   23,   22,   24,   22,   22,   24,   22,
418        22,   22,   22,   22,   22,   25,   22
419     },
421     {
422        11,   22,   22,   23,   22,   24,   22,   22,   24,   22,
423        22,   22,   22,   22,   22,   25,   22
424     },
426     {
427        11,   26,   26,   27,   28,   29,   30,   31,   29,   32,
428        33,   34,   35,   35,   36,   37,   38
430     },
432     {
433        11,   26,   26,   27,   28,   29,   30,   31,   29,   32,
434        33,   34,   35,   35,   36,   37,   38
435     },
437     {
438       -11,  -11,  -11,  -11,  -11,  -11,  -11,  -11,  -11,  -11,
439       -11,  -11,  -11,  -11,  -11,  -11,  -11
440     },
442     {
443        11,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,
444       -12,  -12,  -12,  -12,  -12,  -12,  -12
445     },
447     {
448        11,  -13,   39,   40,  -13,  -13,   41,  -13,  -13,  -13,
449       -13,  -13,  -13,  -13,  -13,  -13,  -13
450     },
452     {
453        11,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,
454       -14,  -14,  -14,  -14,  -14,  -14,  -14
456     },
458     {
459        11,   42,   42,   43,   42,   42,   42,   42,   42,   42,
460        42,   42,   42,   42,   42,   42,   42
461     },
463     {
464        11,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,
465       -16,  -16,  -16,  -16,  -16,  -16,  -16
466     },
468     {
469        11,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,
470       -17,  -17,  -17,  -17,  -17,  -17,  -17
471     },
473     {
474        11,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,
475       -18,  -18,  -18,   44,  -18,  -18,  -18
476     },
478     {
479        11,   45,   45,  -19,   45,   45,   45,   45,   45,   45,
480        45,   45,   45,   45,   45,   45,   45
482     },
484     {
485        11,  -20,   46,   47,  -20,  -20,  -20,  -20,  -20,  -20,
486       -20,  -20,  -20,  -20,  -20,  -20,  -20
487     },
489     {
490        11,   48,  -21,  -21,   48,   48,   48,   48,   48,   48,
491        48,   48,   48,   48,   48,   48,   48
492     },
494     {
495        11,   49,   49,   50,   49,  -22,   49,   49,  -22,   49,
496        49,   49,   49,   49,   49,  -22,   49
497     },
499     {
500        11,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,
501       -23,  -23,  -23,  -23,  -23,  -23,  -23
502     },
504     {
505        11,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,
506       -24,  -24,  -24,  -24,  -24,  -24,  -24
508     },
510     {
511        11,   51,   51,   52,   51,   51,   51,   51,   51,   51,
512        51,   51,   51,   51,   51,   51,   51
513     },
515     {
516        11,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,
517       -26,  -26,  -26,  -26,  -26,  -26,  -26
518     },
520     {
521        11,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,
522       -27,  -27,  -27,  -27,  -27,  -27,  -27
523     },
525     {
526        11,  -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28,
527       -28,  -28,  -28,  -28,   53,  -28,  -28
528     },
530     {
531        11,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,
532       -29,  -29,  -29,  -29,  -29,  -29,  -29
534     },
536     {
537        11,   54,   54,  -30,   54,   54,   54,   54,   54,   54,
538        54,   54,   54,   54,   54,   54,   54
539     },
541     {
542        11,  -31,  -31,  -31,  -31,  -31,  -31,   55,  -31,  -31,
543       -31,  -31,  -31,  -31,  -31,  -31,  -31
544     },
546     {
547        11,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,
548       -32,  -32,  -32,  -32,  -32,  -32,  -32
549     },
551     {
552        11,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,
553       -33,  -33,  -33,  -33,  -33,  -33,  -33
554     },
556     {
557        11,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,
558       -34,   56,   57,   57,  -34,  -34,  -34
560     },
562     {
563        11,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,
564       -35,   57,   57,   57,  -35,  -35,  -35
565     },
567     {
568        11,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,
569       -36,  -36,  -36,  -36,  -36,  -36,  -36
570     },
572     {
573        11,  -37,  -37,   58,  -37,  -37,  -37,  -37,  -37,  -37,
574       -37,  -37,  -37,  -37,  -37,  -37,  -37
575     },
577     {
578        11,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,
579       -38,  -38,  -38,  -38,  -38,  -38,   59
580     },
582     {
583        11,  -39,   39,   40,  -39,  -39,   41,  -39,  -39,  -39,
584       -39,  -39,  -39,  -39,  -39,  -39,  -39
586     },
588     {
589        11,  -40,  -40,  -40,  -40,  -40,  -40,  -40,  -40,  -40,
590       -40,  -40,  -40,  -40,  -40,  -40,  -40
591     },
593     {
594        11,   42,   42,   43,   42,   42,   42,   42,   42,   42,
595        42,   42,   42,   42,   42,   42,   42
596     },
598     {
599        11,   42,   42,   43,   42,   42,   42,   42,   42,   42,
600        42,   42,   42,   42,   42,   42,   42
601     },
603     {
604        11,  -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,
605       -43,  -43,  -43,  -43,  -43,  -43,  -43
606     },
608     {
609        11,  -44,  -44,  -44,  -44,  -44,  -44,  -44,  -44,  -44,
610       -44,  -44,  -44,   44,  -44,  -44,  -44
612     },
614     {
615        11,   45,   45,  -45,   45,   45,   45,   45,   45,   45,
616        45,   45,   45,   45,   45,   45,   45
617     },
619     {
620        11,  -46,   46,   47,  -46,  -46,  -46,  -46,  -46,  -46,
621       -46,  -46,  -46,  -46,  -46,  -46,  -46
622     },
624     {
625        11,   48,  -47,  -47,   48,   48,   48,   48,   48,   48,
626        48,   48,   48,   48,   48,   48,   48
627     },
629     {
630        11,  -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48,
631       -48,  -48,  -48,  -48,  -48,  -48,  -48
632     },
634     {
635        11,   49,   49,   50,   49,  -49,   49,   49,  -49,   49,
636        49,   49,   49,   49,   49,  -49,   49
638     },
640     {
641        11,  -50,  -50,  -50,  -50,  -50,  -50,  -50,  -50,  -50,
642       -50,  -50,  -50,  -50,  -50,  -50,  -50
643     },
645     {
646        11,  -51,  -51,   52,  -51,  -51,  -51,  -51,  -51,  -51,
647       -51,  -51,  -51,  -51,  -51,  -51,  -51
648     },
650     {
651        11,  -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52,
652       -52,  -52,  -52,  -52,  -52,  -52,  -52
653     },
655     {
656        11,  -53,  -53,  -53,  -53,  -53,  -53,  -53,  -53,  -53,
657       -53,  -53,  -53,  -53,  -53,  -53,  -53
658     },
660     {
661        11,   54,   54,  -54,   54,   54,   54,   54,   54,   54,
662        54,   54,   54,   54,   54,   54,   54
664     },
666     {
667        11,  -55,  -55,  -55,  -55,  -55,  -55,  -55,  -55,  -55,
668       -55,  -55,  -55,  -55,  -55,  -55,  -55
669     },
671     {
672        11,  -56,  -56,  -56,  -56,  -56,  -56,  -56,  -56,  -56,
673       -56,   60,   57,   57,  -56,  -56,  -56
674     },
676     {
677        11,  -57,  -57,  -57,  -57,  -57,  -57,  -57,  -57,  -57,
678       -57,   57,   57,   57,  -57,  -57,  -57
679     },
681     {
682        11,  -58,  -58,  -58,  -58,  -58,  -58,  -58,  -58,  -58,
683       -58,  -58,  -58,  -58,  -58,  -58,  -58
684     },
686     {
687        11,  -59,  -59,  -59,  -59,  -59,  -59,  -59,  -59,  -59,
688       -59,  -59,  -59,  -59,  -59,  -59,  -59
690     },
692     {
693        11,  -60,  -60,  -60,  -60,  -60,  -60,  -60,  -60,  -60,
694       -60,   57,   57,   57,  -60,  -60,  -60
695     },
697     } ;
699 static yy_state_type yy_get_previous_state (void );
700 static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
701 static int yy_get_next_buffer (void );
702 static void yy_fatal_error (yyconst char msg[]  );
704 /* Done after the current pattern has been matched and before the
705  * corresponding action - sets up zconftext.
706  */
707 #define YY_DO_BEFORE_ACTION \
708         (yytext_ptr) = yy_bp; \
709         zconfleng = (size_t) (yy_cp - yy_bp); \
710         (yy_hold_char) = *yy_cp; \
711         *yy_cp = '\0'; \
712         (yy_c_buf_p) = yy_cp;
714 #define YY_NUM_RULES 33
715 #define YY_END_OF_BUFFER 34
716 /* This struct is not used in this scanner,
717    but its presence is necessary. */
718 struct yy_trans_info
719         {
720         flex_int32_t yy_verify;
721         flex_int32_t yy_nxt;
722         };
723 static yyconst flex_int16_t yy_accept[61] =
724     {   0,
725         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
726        34,    5,    4,    2,    3,    7,    8,    6,   32,   29,
727        31,   24,   28,   27,   26,   22,   17,   13,   16,   20,
728        22,   11,   12,   19,   19,   14,   22,   22,    4,    2,
729         3,    3,    1,    6,   32,   29,   31,   30,   24,   23,
730        26,   25,   15,   20,    9,   19,   19,   21,   10,   18
731     } ;
733 static yyconst flex_int32_t yy_ec[256] =
734     {   0,
735         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
736         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
737         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
738         1,    2,    4,    5,    6,    1,    1,    7,    8,    9,
739        10,    1,    1,    1,   11,   12,   12,   13,   13,   13,
740        13,   13,   13,   13,   13,   13,   13,    1,    1,    1,
741        14,    1,    1,    1,   13,   13,   13,   13,   13,   13,
742        13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
743        13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
744         1,   15,    1,    1,   13,    1,   13,   13,   13,   13,
746        13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
747        13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
748        13,   13,    1,   16,    1,    1,    1,    1,    1,    1,
749         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
750         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,
757         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
758         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
759         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
760         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
761         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
762         1,    1,    1,    1,    1
763     } ;
765 extern int zconf_flex_debug;
766 int zconf_flex_debug = 0;
768 /* The intent behind this definition is that it'll catch
769  * any uses of REJECT which flex missed.
770  */
771 #define REJECT reject_used_but_not_detected
772 #define yymore() yymore_used_but_not_detected
773 #define YY_MORE_ADJ 0
774 #define YY_RESTORE_YY_MORE_OFFSET
775 char *zconftext;
776 #line 1 "zconf.l"
777 #define YY_NO_INPUT 1
779 #line 6 "zconf.l"
781  * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
782  * Released under the terms of the GNU GPL v2.0.
783  */
785 #include <limits.h>
786 #include <stdio.h>
787 #include <stdlib.h>
788 #include <string.h>
789 #include <unistd.h>
791 #include "lkc.h"
793 #define START_STRSIZE   16
795 static struct {
796         struct file *file;
797         int lineno;
798 } current_pos;
800 static char *text;
801 static int text_size, text_asize;
803 struct buffer {
804         struct buffer *parent;
805         YY_BUFFER_STATE state;
808 struct buffer *current_buf;
810 static int last_ts, first_ts;
812 static void zconf_endhelp(void);
813 static void zconf_endfile(void);
815 static void new_string(void)
817         text = xmalloc(START_STRSIZE);
818         text_asize = START_STRSIZE;
819         text_size = 0;
820         *text = 0;
823 static void append_string(const char *str, int size)
825         int new_size = text_size + size + 1;
826         if (new_size > text_asize) {
827                 new_size += START_STRSIZE - 1;
828                 new_size &= -START_STRSIZE;
829                 text = realloc(text, new_size);
830                 text_asize = new_size;
831         }
832         memcpy(text + text_size, str, size);
833         text_size += size;
834         text[text_size] = 0;
837 static void alloc_string(const char *str, int size)
839         text = xmalloc(size + 1);
840         memcpy(text, str, size);
841         text[size] = 0;
843 #line 844 "lex.zconf.c"
845 #define INITIAL 0
846 #define COMMAND 1
847 #define HELP 2
848 #define STRING 3
849 #define PARAM 4
851 #ifndef YY_NO_UNISTD_H
852 /* Special case for "unistd.h", since it is non-ANSI. We include it way
853  * down here because we want the user's section 1 to have been scanned first.
854  * The user has a chance to override it with an option.
855  */
856 #include <unistd.h>
857 #endif
859 #ifndef YY_EXTRA_TYPE
860 #define YY_EXTRA_TYPE void *
861 #endif
863 static int yy_init_globals (void );
865 /* Accessor methods to globals.
866    These are made visible to non-reentrant scanners for convenience. */
868 int zconflex_destroy (void );
870 int zconfget_debug (void );
872 void zconfset_debug (int debug_flag  );
874 YY_EXTRA_TYPE zconfget_extra (void );
876 void zconfset_extra (YY_EXTRA_TYPE user_defined  );
878 FILE *zconfget_in (void );
880 void zconfset_in  (FILE * in_str  );
882 FILE *zconfget_out (void );
884 void zconfset_out  (FILE * out_str  );
886 int zconfget_leng (void );
888 char *zconfget_text (void );
890 int zconfget_lineno (void );
892 void zconfset_lineno (int line_number  );
894 /* Macros after this point can all be overridden by user definitions in
895  * section 1.
896  */
898 #ifndef YY_SKIP_YYWRAP
899 #ifdef __cplusplus
900 extern "C" int zconfwrap (void );
901 #else
902 extern int zconfwrap (void );
903 #endif
904 #endif
906     static void yyunput (int c,char *buf_ptr  );
907     
908 #ifndef yytext_ptr
909 static void yy_flex_strncpy (char *,yyconst char *,int );
910 #endif
912 #ifdef YY_NEED_STRLEN
913 static int yy_flex_strlen (yyconst char * );
914 #endif
916 #ifndef YY_NO_INPUT
918 #ifdef __cplusplus
919 static int yyinput (void );
920 #else
921 static int input (void );
922 #endif
924 #endif
926 /* Amount of stuff to slurp up with each read. */
927 #ifndef YY_READ_BUF_SIZE
928 #ifdef __ia64__
929 /* On IA-64, the buffer size is 16k, not 8k */
930 #define YY_READ_BUF_SIZE 16384
931 #else
932 #define YY_READ_BUF_SIZE 8192
933 #endif /* __ia64__ */
934 #endif
936 /* Copy whatever the last rule matched to the standard output. */
937 #ifndef ECHO
938 /* This used to be an fputs(), but since the string might contain NUL's,
939  * we now use fwrite().
940  */
941 #define ECHO do { if (fwrite( zconftext, zconfleng, 1, zconfout )) {} } while (0)
942 #endif
944 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
945  * is returned in "result".
946  */
947 #ifndef YY_INPUT
948 #define YY_INPUT(buf,result,max_size) \
949         errno=0; \
950         while ( (result = read( fileno(zconfin), (char *) buf, max_size )) < 0 ) \
951         { \
952                 if( errno != EINTR) \
953                 { \
954                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
955                         break; \
956                 } \
957                 errno=0; \
958                 clearerr(zconfin); \
959         }\
962 #endif
964 /* No semi-colon after return; correct usage is to write "yyterminate();" -
965  * we don't want an extra ';' after the "return" because that will cause
966  * some compilers to complain about unreachable statements.
967  */
968 #ifndef yyterminate
969 #define yyterminate() return YY_NULL
970 #endif
972 /* Number of entries by which start-condition stack grows. */
973 #ifndef YY_START_STACK_INCR
974 #define YY_START_STACK_INCR 25
975 #endif
977 /* Report a fatal error. */
978 #ifndef YY_FATAL_ERROR
979 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
980 #endif
982 /* end tables serialization structures and prototypes */
984 /* Default declaration of generated scanner - a define so the user can
985  * easily add parameters.
986  */
987 #ifndef YY_DECL
988 #define YY_DECL_IS_OURS 1
990 extern int zconflex (void);
992 #define YY_DECL int zconflex (void)
993 #endif /* !YY_DECL */
995 /* Code executed at the beginning of each rule, after zconftext and zconfleng
996  * have been set up.
997  */
998 #ifndef YY_USER_ACTION
999 #define YY_USER_ACTION
1000 #endif
1002 /* Code executed at the end of each rule. */
1003 #ifndef YY_BREAK
1004 #define YY_BREAK break;
1005 #endif
1007 #define YY_RULE_SETUP \
1008         YY_USER_ACTION
1010 /** The main scanner function which does all the work.
1011  */
1012 YY_DECL
1014         register yy_state_type yy_current_state;
1015         register char *yy_cp, *yy_bp;
1016         register int yy_act;
1017     
1018 #line 73 "zconf.l"
1020         int str = 0;
1021         int ts, i;
1023 #line 1024 "lex.zconf.c"
1025         if ( !(yy_init) )
1026                 {
1027                 (yy_init) = 1;
1029 #ifdef YY_USER_INIT
1030                 YY_USER_INIT;
1031 #endif
1033                 if ( ! (yy_start) )
1034                         (yy_start) = 1; /* first start state */
1036                 if ( ! zconfin )
1037                         zconfin = stdin;
1039                 if ( ! zconfout )
1040                         zconfout = stdout;
1042                 if ( ! YY_CURRENT_BUFFER ) {
1043                         zconfensure_buffer_stack ();
1044                         YY_CURRENT_BUFFER_LVALUE =
1045                                 zconf_create_buffer(zconfin,YY_BUF_SIZE );
1046                 }
1048                 zconf_load_buffer_state( );
1049                 }
1051         while ( 1 )             /* loops until end-of-file is reached */
1052                 {
1053                 yy_cp = (yy_c_buf_p);
1055                 /* Support of zconftext. */
1056                 *yy_cp = (yy_hold_char);
1058                 /* yy_bp points to the position in yy_ch_buf of the start of
1059                  * the current run.
1060                  */
1061                 yy_bp = yy_cp;
1063                 yy_current_state = (yy_start);
1064 yy_match:
1065                 while ( (yy_current_state = yy_nxt[yy_current_state][ yy_ec[YY_SC_TO_UI(*yy_cp)]  ]) > 0 )
1066                         ++yy_cp;
1068                 yy_current_state = -yy_current_state;
1070 yy_find_action:
1071                 yy_act = yy_accept[yy_current_state];
1073                 YY_DO_BEFORE_ACTION;
1075 do_action:      /* This label is used only to access EOF actions. */
1077                 switch ( yy_act )
1078         { /* beginning of action switch */
1079 case 1:
1080 /* rule 1 can match eol */
1081 #line 78 "zconf.l"
1082 case 2:
1083 /* rule 2 can match eol */
1084 YY_RULE_SETUP
1085 #line 78 "zconf.l"
1087         current_file->lineno++;
1088         return T_EOL;
1090         YY_BREAK
1091 case 3:
1092 YY_RULE_SETUP
1093 #line 82 "zconf.l"
1095         YY_BREAK
1096 case 4:
1097 YY_RULE_SETUP
1098 #line 85 "zconf.l"
1100         BEGIN(COMMAND);
1102         YY_BREAK
1103 case 5:
1104 YY_RULE_SETUP
1105 #line 89 "zconf.l"
1107         unput(zconftext[0]);
1108         BEGIN(COMMAND);
1110         YY_BREAK
1112 case 6:
1113 YY_RULE_SETUP
1114 #line 96 "zconf.l"
1116                 const struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng);
1117                 BEGIN(PARAM);
1118                 current_pos.file = current_file;
1119                 current_pos.lineno = current_file->lineno;
1120                 if (id && id->flags & TF_COMMAND) {
1121                         zconflval.id = id;
1122                         return id->token;
1123                 }
1124                 alloc_string(zconftext, zconfleng);
1125                 zconflval.string = text;
1126                 return T_WORD;
1127         }
1128         YY_BREAK
1129 case 7:
1130 YY_RULE_SETUP
1131 #line 109 "zconf.l"
1133         YY_BREAK
1134 case 8:
1135 /* rule 8 can match eol */
1136 YY_RULE_SETUP
1137 #line 110 "zconf.l"
1139                 BEGIN(INITIAL);
1140                 current_file->lineno++;
1141                 return T_EOL;
1142         }
1143         YY_BREAK
1146 case 9:
1147 YY_RULE_SETUP
1148 #line 118 "zconf.l"
1149 return T_AND;
1150         YY_BREAK
1151 case 10:
1152 YY_RULE_SETUP
1153 #line 119 "zconf.l"
1154 return T_OR;
1155         YY_BREAK
1156 case 11:
1157 YY_RULE_SETUP
1158 #line 120 "zconf.l"
1159 return T_OPEN_PAREN;
1160         YY_BREAK
1161 case 12:
1162 YY_RULE_SETUP
1163 #line 121 "zconf.l"
1164 return T_CLOSE_PAREN;
1165         YY_BREAK
1166 case 13:
1167 YY_RULE_SETUP
1168 #line 122 "zconf.l"
1169 return T_NOT;
1170         YY_BREAK
1171 case 14:
1172 YY_RULE_SETUP
1173 #line 123 "zconf.l"
1174 return T_EQUAL;
1175         YY_BREAK
1176 case 15:
1177 YY_RULE_SETUP
1178 #line 124 "zconf.l"
1179 return T_UNEQUAL;
1180         YY_BREAK
1181 case 16:
1182 YY_RULE_SETUP
1183 #line 125 "zconf.l"
1185                 str = zconftext[0];
1186                 new_string();
1187                 BEGIN(STRING);
1188         }
1189         YY_BREAK
1190 case 17:
1191 /* rule 17 can match eol */
1192 YY_RULE_SETUP
1193 #line 130 "zconf.l"
1194 BEGIN(INITIAL); current_file->lineno++; return T_EOL;
1195         YY_BREAK
1196 case 18:
1197 YY_RULE_SETUP
1198 #line 131 "zconf.l"
1199 /* ignore */
1200         YY_BREAK
1201 case 19:
1202 YY_RULE_SETUP
1203 #line 132 "zconf.l"
1205                 const struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng);
1206                 if (id && id->flags & TF_PARAM) {
1207                         zconflval.id = id;
1208                         return id->token;
1209                 }
1210                 alloc_string(zconftext, zconfleng);
1211                 zconflval.string = text;
1212                 return T_WORD;
1213         }
1214         YY_BREAK
1215 case 20:
1216 YY_RULE_SETUP
1217 #line 142 "zconf.l"
1218 /* comment */
1219         YY_BREAK
1220 case 21:
1221 /* rule 21 can match eol */
1222 YY_RULE_SETUP
1223 #line 143 "zconf.l"
1224 current_file->lineno++;
1225         YY_BREAK
1226 case 22:
1227 YY_RULE_SETUP
1228 #line 144 "zconf.l"
1230         YY_BREAK
1231 case YY_STATE_EOF(PARAM):
1232 #line 145 "zconf.l"
1234                 BEGIN(INITIAL);
1235         }
1236         YY_BREAK
1239 case 23:
1240 /* rule 23 can match eol */
1241 *yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */
1242 (yy_c_buf_p) = yy_cp -= 1;
1243 YY_DO_BEFORE_ACTION; /* set up zconftext again */
1244 YY_RULE_SETUP
1245 #line 151 "zconf.l"
1247                 append_string(zconftext, zconfleng);
1248                 zconflval.string = text;
1249                 return T_WORD_QUOTE;
1250         }
1251         YY_BREAK
1252 case 24:
1253 YY_RULE_SETUP
1254 #line 156 "zconf.l"
1256                 append_string(zconftext, zconfleng);
1257         }
1258         YY_BREAK
1259 case 25:
1260 /* rule 25 can match eol */
1261 *yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */
1262 (yy_c_buf_p) = yy_cp -= 1;
1263 YY_DO_BEFORE_ACTION; /* set up zconftext again */
1264 YY_RULE_SETUP
1265 #line 159 "zconf.l"
1267                 append_string(zconftext + 1, zconfleng - 1);
1268                 zconflval.string = text;
1269                 return T_WORD_QUOTE;
1270         }
1271         YY_BREAK
1272 case 26:
1273 YY_RULE_SETUP
1274 #line 164 "zconf.l"
1276                 append_string(zconftext + 1, zconfleng - 1);
1277         }
1278         YY_BREAK
1279 case 27:
1280 YY_RULE_SETUP
1281 #line 167 "zconf.l"
1283                 if (str == zconftext[0]) {
1284                         BEGIN(PARAM);
1285                         zconflval.string = text;
1286                         return T_WORD_QUOTE;
1287                 } else
1288                         append_string(zconftext, 1);
1289         }
1290         YY_BREAK
1291 case 28:
1292 /* rule 28 can match eol */
1293 YY_RULE_SETUP
1294 #line 175 "zconf.l"
1296                 printf("%s:%d:warning: multi-line strings not supported\n", zconf_curname(), zconf_lineno());
1297                 current_file->lineno++;
1298                 BEGIN(INITIAL);
1299                 return T_EOL;
1300         }
1301         YY_BREAK
1302 case YY_STATE_EOF(STRING):
1303 #line 181 "zconf.l"
1305                 BEGIN(INITIAL);
1306         }
1307         YY_BREAK
1310 case 29:
1311 YY_RULE_SETUP
1312 #line 187 "zconf.l"
1314                 ts = 0;
1315                 for (i = 0; i < zconfleng; i++) {
1316                         if (zconftext[i] == '\t')
1317                                 ts = (ts & ~7) + 8;
1318                         else
1319                                 ts++;
1320                 }
1321                 last_ts = ts;
1322                 if (first_ts) {
1323                         if (ts < first_ts) {
1324                                 zconf_endhelp();
1325                                 return T_HELPTEXT;
1326                         }
1327                         ts -= first_ts;
1328                         while (ts > 8) {
1329                                 append_string("        ", 8);
1330                                 ts -= 8;
1331                         }
1332                         append_string("        ", ts);
1333                 }
1334         }
1335         YY_BREAK
1336 case 30:
1337 /* rule 30 can match eol */
1338 *yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */
1339 (yy_c_buf_p) = yy_cp -= 1;
1340 YY_DO_BEFORE_ACTION; /* set up zconftext again */
1341 YY_RULE_SETUP
1342 #line 209 "zconf.l"
1344                 current_file->lineno++;
1345                 zconf_endhelp();
1346                 return T_HELPTEXT;
1347         }
1348         YY_BREAK
1349 case 31:
1350 /* rule 31 can match eol */
1351 YY_RULE_SETUP
1352 #line 214 "zconf.l"
1354                 current_file->lineno++;
1355                 append_string("\n", 1);
1356         }
1357         YY_BREAK
1358 case 32:
1359 YY_RULE_SETUP
1360 #line 218 "zconf.l"
1362                 while (zconfleng) {
1363                         if ((zconftext[zconfleng-1] != ' ') && (zconftext[zconfleng-1] != '\t'))
1364                                 break;
1365                         zconfleng--;
1366                 }
1367                 append_string(zconftext, zconfleng);
1368                 if (!first_ts)
1369                         first_ts = last_ts;
1370         }
1371         YY_BREAK
1372 case YY_STATE_EOF(HELP):
1373 #line 228 "zconf.l"
1375                 zconf_endhelp();
1376                 return T_HELPTEXT;
1377         }
1378         YY_BREAK
1380 case YY_STATE_EOF(INITIAL):
1381 case YY_STATE_EOF(COMMAND):
1382 #line 234 "zconf.l"
1384         if (current_file) {
1385                 zconf_endfile();
1386                 return T_EOL;
1387         }
1388         fclose(zconfin);
1389         yyterminate();
1391         YY_BREAK
1392 case 33:
1393 YY_RULE_SETUP
1394 #line 243 "zconf.l"
1395 YY_FATAL_ERROR( "flex scanner jammed" );
1396         YY_BREAK
1397 #line 1398 "lex.zconf.c"
1399         case YY_END_OF_BUFFER:
1400                 {
1401                 /* Amount of text matched not including the EOB char. */
1402                 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1404                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1405                 *yy_cp = (yy_hold_char);
1406                 YY_RESTORE_YY_MORE_OFFSET
1408                 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1409                         {
1410                         /* We're scanning a new file or input source.  It's
1411                          * possible that this happened because the user
1412                          * just pointed zconfin at a new source and called
1413                          * zconflex().  If so, then we have to assure
1414                          * consistency between YY_CURRENT_BUFFER and our
1415                          * globals.  Here is the right place to do so, because
1416                          * this is the first action (other than possibly a
1417                          * back-up) that will match for the new input source.
1418                          */
1419                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1420                         YY_CURRENT_BUFFER_LVALUE->yy_input_file = zconfin;
1421                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1422                         }
1424                 /* Note that here we test for yy_c_buf_p "<=" to the position
1425                  * of the first EOB in the buffer, since yy_c_buf_p will
1426                  * already have been incremented past the NUL character
1427                  * (since all states make transitions on EOB to the
1428                  * end-of-buffer state).  Contrast this with the test
1429                  * in input().
1430                  */
1431                 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1432                         { /* This was really a NUL. */
1433                         yy_state_type yy_next_state;
1435                         (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1437                         yy_current_state = yy_get_previous_state(  );
1439                         /* Okay, we're now positioned to make the NUL
1440                          * transition.  We couldn't have
1441                          * yy_get_previous_state() go ahead and do it
1442                          * for us because it doesn't know how to deal
1443                          * with the possibility of jamming (and we don't
1444                          * want to build jamming into it because then it
1445                          * will run more slowly).
1446                          */
1448                         yy_next_state = yy_try_NUL_trans( yy_current_state );
1450                         yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1452                         if ( yy_next_state )
1453                                 {
1454                                 /* Consume the NUL. */
1455                                 yy_cp = ++(yy_c_buf_p);
1456                                 yy_current_state = yy_next_state;
1457                                 goto yy_match;
1458                                 }
1460                         else
1461                                 {
1462                                 yy_cp = (yy_c_buf_p);
1463                                 goto yy_find_action;
1464                                 }
1465                         }
1467                 else switch ( yy_get_next_buffer(  ) )
1468                         {
1469                         case EOB_ACT_END_OF_FILE:
1470                                 {
1471                                 (yy_did_buffer_switch_on_eof) = 0;
1473                                 if ( zconfwrap( ) )
1474                                         {
1475                                         /* Note: because we've taken care in
1476                                          * yy_get_next_buffer() to have set up
1477                                          * zconftext, we can now set up
1478                                          * yy_c_buf_p so that if some total
1479                                          * hoser (like flex itself) wants to
1480                                          * call the scanner after we return the
1481                                          * YY_NULL, it'll still work - another
1482                                          * YY_NULL will get returned.
1483                                          */
1484                                         (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1486                                         yy_act = YY_STATE_EOF(YY_START);
1487                                         goto do_action;
1488                                         }
1490                                 else
1491                                         {
1492                                         if ( ! (yy_did_buffer_switch_on_eof) )
1493                                                 YY_NEW_FILE;
1494                                         }
1495                                 break;
1496                                 }
1498                         case EOB_ACT_CONTINUE_SCAN:
1499                                 (yy_c_buf_p) =
1500                                         (yytext_ptr) + yy_amount_of_matched_text;
1502                                 yy_current_state = yy_get_previous_state(  );
1504                                 yy_cp = (yy_c_buf_p);
1505                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1506                                 goto yy_match;
1508                         case EOB_ACT_LAST_MATCH:
1509                                 (yy_c_buf_p) =
1510                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1512                                 yy_current_state = yy_get_previous_state(  );
1514                                 yy_cp = (yy_c_buf_p);
1515                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1516                                 goto yy_find_action;
1517                         }
1518                 break;
1519                 }
1521         default:
1522                 YY_FATAL_ERROR(
1523                         "fatal flex scanner internal error--no action found" );
1524         } /* end of action switch */
1525                 } /* end of scanning one token */
1526 } /* end of zconflex */
1528 /* yy_get_next_buffer - try to read in a new buffer
1530  * Returns a code representing an action:
1531  *      EOB_ACT_LAST_MATCH -
1532  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1533  *      EOB_ACT_END_OF_FILE - end of file
1534  */
1535 static int yy_get_next_buffer (void)
1537         register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1538         register char *source = (yytext_ptr);
1539         register int number_to_move, i;
1540         int ret_val;
1542         if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1543                 YY_FATAL_ERROR(
1544                 "fatal flex scanner internal error--end of buffer missed" );
1546         if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1547                 { /* Don't try to fill the buffer, so this is an EOF. */
1548                 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1549                         {
1550                         /* We matched a single character, the EOB, so
1551                          * treat this as a final EOF.
1552                          */
1553                         return EOB_ACT_END_OF_FILE;
1554                         }
1556                 else
1557                         {
1558                         /* We matched some text prior to the EOB, first
1559                          * process it.
1560                          */
1561                         return EOB_ACT_LAST_MATCH;
1562                         }
1563                 }
1565         /* Try to read more data. */
1567         /* First move last chars to start of buffer. */
1568         number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1570         for ( i = 0; i < number_to_move; ++i )
1571                 *(dest++) = *(source++);
1573         if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1574                 /* don't do the read, it's not guaranteed to return an EOF,
1575                  * just force an EOF
1576                  */
1577                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1579         else
1580                 {
1581                         int num_to_read =
1582                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1584                 while ( num_to_read <= 0 )
1585                         { /* Not enough room in the buffer - grow it. */
1587                         /* just a shorter name for the current buffer */
1588                         YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1590                         int yy_c_buf_p_offset =
1591                                 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1593                         if ( b->yy_is_our_buffer )
1594                                 {
1595                                 int new_size = b->yy_buf_size * 2;
1597                                 if ( new_size <= 0 )
1598                                         b->yy_buf_size += b->yy_buf_size / 8;
1599                                 else
1600                                         b->yy_buf_size *= 2;
1602                                 b->yy_ch_buf = (char *)
1603                                         /* Include room in for 2 EOB chars. */
1604                                         zconfrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
1605                                 }
1606                         else
1607                                 /* Can't grow it, we don't own it. */
1608                                 b->yy_ch_buf = 0;
1610                         if ( ! b->yy_ch_buf )
1611                                 YY_FATAL_ERROR(
1612                                 "fatal error - scanner input buffer overflow" );
1614                         (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1616                         num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1617                                                 number_to_move - 1;
1619                         }
1621                 if ( num_to_read > YY_READ_BUF_SIZE )
1622                         num_to_read = YY_READ_BUF_SIZE;
1624                 /* Read in more data. */
1625                 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1626                         (yy_n_chars), (size_t) num_to_read );
1628                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1629                 }
1631         if ( (yy_n_chars) == 0 )
1632                 {
1633                 if ( number_to_move == YY_MORE_ADJ )
1634                         {
1635                         ret_val = EOB_ACT_END_OF_FILE;
1636                         zconfrestart(zconfin  );
1637                         }
1639                 else
1640                         {
1641                         ret_val = EOB_ACT_LAST_MATCH;
1642                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1643                                 YY_BUFFER_EOF_PENDING;
1644                         }
1645                 }
1647         else
1648                 ret_val = EOB_ACT_CONTINUE_SCAN;
1650         if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1651                 /* Extend the array by 50%, plus the number we really need. */
1652                 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1653                 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) zconfrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
1654                 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1655                         YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1656         }
1658         (yy_n_chars) += number_to_move;
1659         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1660         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1662         (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1664         return ret_val;
1667 /* yy_get_previous_state - get the state just before the EOB char was reached */
1669     static yy_state_type yy_get_previous_state (void)
1671         register yy_state_type yy_current_state;
1672         register char *yy_cp;
1673     
1674         yy_current_state = (yy_start);
1676         for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1677                 {
1678                 yy_current_state = yy_nxt[yy_current_state][(*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1)];
1679                 }
1681         return yy_current_state;
1684 /* yy_try_NUL_trans - try to make a transition on the NUL character
1686  * synopsis
1687  *      next_state = yy_try_NUL_trans( current_state );
1688  */
1689     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
1691         register int yy_is_jam;
1692     
1693         yy_current_state = yy_nxt[yy_current_state][1];
1694         yy_is_jam = (yy_current_state <= 0);
1696         return yy_is_jam ? 0 : yy_current_state;
1699     static void yyunput (int c, register char * yy_bp )
1701         register char *yy_cp;
1702     
1703     yy_cp = (yy_c_buf_p);
1705         /* undo effects of setting up zconftext */
1706         *yy_cp = (yy_hold_char);
1708         if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1709                 { /* need to shift things up to make room */
1710                 /* +2 for EOB chars. */
1711                 register int number_to_move = (yy_n_chars) + 2;
1712                 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1713                                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1714                 register char *source =
1715                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1717                 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1718                         *--dest = *--source;
1720                 yy_cp += (int) (dest - source);
1721                 yy_bp += (int) (dest - source);
1722                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1723                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1725                 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1726                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
1727                 }
1729         *--yy_cp = (char) c;
1731         (yytext_ptr) = yy_bp;
1732         (yy_hold_char) = *yy_cp;
1733         (yy_c_buf_p) = yy_cp;
1736 #ifndef YY_NO_INPUT
1737 #ifdef __cplusplus
1738     static int yyinput (void)
1739 #else
1740     static int input  (void)
1741 #endif
1744         int c;
1745     
1746         *(yy_c_buf_p) = (yy_hold_char);
1748         if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1749                 {
1750                 /* yy_c_buf_p now points to the character we want to return.
1751                  * If this occurs *before* the EOB characters, then it's a
1752                  * valid NUL; if not, then we've hit the end of the buffer.
1753                  */
1754                 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1755                         /* This was really a NUL. */
1756                         *(yy_c_buf_p) = '\0';
1758                 else
1759                         { /* need more input */
1760                         int offset = (yy_c_buf_p) - (yytext_ptr);
1761                         ++(yy_c_buf_p);
1763                         switch ( yy_get_next_buffer(  ) )
1764                                 {
1765                                 case EOB_ACT_LAST_MATCH:
1766                                         /* This happens because yy_g_n_b()
1767                                          * sees that we've accumulated a
1768                                          * token and flags that we need to
1769                                          * try matching the token before
1770                                          * proceeding.  But for input(),
1771                                          * there's no matching to consider.
1772                                          * So convert the EOB_ACT_LAST_MATCH
1773                                          * to EOB_ACT_END_OF_FILE.
1774                                          */
1776                                         /* Reset buffer status. */
1777                                         zconfrestart(zconfin );
1779                                         /*FALLTHROUGH*/
1781                                 case EOB_ACT_END_OF_FILE:
1782                                         {
1783                                         if ( zconfwrap( ) )
1784                                                 return EOF;
1786                                         if ( ! (yy_did_buffer_switch_on_eof) )
1787                                                 YY_NEW_FILE;
1788 #ifdef __cplusplus
1789                                         return yyinput();
1790 #else
1791                                         return input();
1792 #endif
1793                                         }
1795                                 case EOB_ACT_CONTINUE_SCAN:
1796                                         (yy_c_buf_p) = (yytext_ptr) + offset;
1797                                         break;
1798                                 }
1799                         }
1800                 }
1802         c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
1803         *(yy_c_buf_p) = '\0';   /* preserve zconftext */
1804         (yy_hold_char) = *++(yy_c_buf_p);
1806         return c;
1808 #endif  /* ifndef YY_NO_INPUT */
1810 /** Immediately switch to a different input stream.
1811  * @param input_file A readable stream.
1812  * 
1813  * @note This function does not reset the start condition to @c INITIAL .
1814  */
1815     void zconfrestart  (FILE * input_file )
1817     
1818         if ( ! YY_CURRENT_BUFFER ){
1819         zconfensure_buffer_stack ();
1820                 YY_CURRENT_BUFFER_LVALUE =
1821             zconf_create_buffer(zconfin,YY_BUF_SIZE );
1822         }
1824         zconf_init_buffer(YY_CURRENT_BUFFER,input_file );
1825         zconf_load_buffer_state( );
1828 /** Switch to a different input buffer.
1829  * @param new_buffer The new input buffer.
1830  * 
1831  */
1832     void zconf_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
1834     
1835         /* TODO. We should be able to replace this entire function body
1836          * with
1837          *              zconfpop_buffer_state();
1838          *              zconfpush_buffer_state(new_buffer);
1839      */
1840         zconfensure_buffer_stack ();
1841         if ( YY_CURRENT_BUFFER == new_buffer )
1842                 return;
1844         if ( YY_CURRENT_BUFFER )
1845                 {
1846                 /* Flush out information for old buffer. */
1847                 *(yy_c_buf_p) = (yy_hold_char);
1848                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1849                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1850                 }
1852         YY_CURRENT_BUFFER_LVALUE = new_buffer;
1853         zconf_load_buffer_state( );
1855         /* We don't actually know whether we did this switch during
1856          * EOF (zconfwrap()) processing, but the only time this flag
1857          * is looked at is after zconfwrap() is called, so it's safe
1858          * to go ahead and always set it.
1859          */
1860         (yy_did_buffer_switch_on_eof) = 1;
1863 static void zconf_load_buffer_state  (void)
1865         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1866         (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1867         zconfin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1868         (yy_hold_char) = *(yy_c_buf_p);
1871 /** Allocate and initialize an input buffer state.
1872  * @param file A readable stream.
1873  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1874  * 
1875  * @return the allocated buffer state.
1876  */
1877     YY_BUFFER_STATE zconf_create_buffer  (FILE * file, int  size )
1879         YY_BUFFER_STATE b;
1880     
1881         b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state )  );
1882         if ( ! b )
1883                 YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" );
1885         b->yy_buf_size = size;
1887         /* yy_ch_buf has to be 2 characters longer than the size given because
1888          * we need to put in 2 end-of-buffer characters.
1889          */
1890         b->yy_ch_buf = (char *) zconfalloc(b->yy_buf_size + 2  );
1891         if ( ! b->yy_ch_buf )
1892                 YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" );
1894         b->yy_is_our_buffer = 1;
1896         zconf_init_buffer(b,file );
1898         return b;
1901 /** Destroy the buffer.
1902  * @param b a buffer created with zconf_create_buffer()
1903  * 
1904  */
1905     void zconf_delete_buffer (YY_BUFFER_STATE  b )
1907     
1908         if ( ! b )
1909                 return;
1911         if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1912                 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1914         if ( b->yy_is_our_buffer )
1915                 zconffree((void *) b->yy_ch_buf  );
1917         zconffree((void *) b  );
1920 /* Initializes or reinitializes a buffer.
1921  * This function is sometimes called more than once on the same buffer,
1922  * such as during a zconfrestart() or at EOF.
1923  */
1924     static void zconf_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
1927         int oerrno = errno;
1928     
1929         zconf_flush_buffer(b );
1931         b->yy_input_file = file;
1932         b->yy_fill_buffer = 1;
1934     /* If b is the current buffer, then zconf_init_buffer was _probably_
1935      * called from zconfrestart() or through yy_get_next_buffer.
1936      * In that case, we don't want to reset the lineno or column.
1937      */
1938     if (b != YY_CURRENT_BUFFER){
1939         b->yy_bs_lineno = 1;
1940         b->yy_bs_column = 0;
1941     }
1943         b->yy_is_interactive = 0;
1944     
1945         errno = oerrno;
1948 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1949  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1950  * 
1951  */
1952     void zconf_flush_buffer (YY_BUFFER_STATE  b )
1954         if ( ! b )
1955                 return;
1957         b->yy_n_chars = 0;
1959         /* We always need two end-of-buffer characters.  The first causes
1960          * a transition to the end-of-buffer state.  The second causes
1961          * a jam in that state.
1962          */
1963         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1964         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1966         b->yy_buf_pos = &b->yy_ch_buf[0];
1968         b->yy_at_bol = 1;
1969         b->yy_buffer_status = YY_BUFFER_NEW;
1971         if ( b == YY_CURRENT_BUFFER )
1972                 zconf_load_buffer_state( );
1975 /** Pushes the new state onto the stack. The new state becomes
1976  *  the current state. This function will allocate the stack
1977  *  if necessary.
1978  *  @param new_buffer The new state.
1979  *  
1980  */
1981 void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
1983         if (new_buffer == NULL)
1984                 return;
1986         zconfensure_buffer_stack();
1988         /* This block is copied from zconf_switch_to_buffer. */
1989         if ( YY_CURRENT_BUFFER )
1990                 {
1991                 /* Flush out information for old buffer. */
1992                 *(yy_c_buf_p) = (yy_hold_char);
1993                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1994                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1995                 }
1997         /* Only push if top exists. Otherwise, replace top. */
1998         if (YY_CURRENT_BUFFER)
1999                 (yy_buffer_stack_top)++;
2000         YY_CURRENT_BUFFER_LVALUE = new_buffer;
2002         /* copied from zconf_switch_to_buffer. */
2003         zconf_load_buffer_state( );
2004         (yy_did_buffer_switch_on_eof) = 1;
2007 /** Removes and deletes the top of the stack, if present.
2008  *  The next element becomes the new top.
2009  *  
2010  */
2011 void zconfpop_buffer_state (void)
2013         if (!YY_CURRENT_BUFFER)
2014                 return;
2016         zconf_delete_buffer(YY_CURRENT_BUFFER );
2017         YY_CURRENT_BUFFER_LVALUE = NULL;
2018         if ((yy_buffer_stack_top) > 0)
2019                 --(yy_buffer_stack_top);
2021         if (YY_CURRENT_BUFFER) {
2022                 zconf_load_buffer_state( );
2023                 (yy_did_buffer_switch_on_eof) = 1;
2024         }
2027 /* Allocates the stack if it does not exist.
2028  *  Guarantees space for at least one push.
2029  */
2030 static void zconfensure_buffer_stack (void)
2032         int num_to_alloc;
2033     
2034         if (!(yy_buffer_stack)) {
2036                 /* First allocation is just for 2 elements, since we don't know if this
2037                  * scanner will even need a stack. We use 2 instead of 1 to avoid an
2038                  * immediate realloc on the next call.
2039          */
2040                 num_to_alloc = 1;
2041                 (yy_buffer_stack) = (struct yy_buffer_state**)zconfalloc
2042                                                                 (num_to_alloc * sizeof(struct yy_buffer_state*)
2043                                                                 );
2044                 if ( ! (yy_buffer_stack) )
2045                         YY_FATAL_ERROR( "out of dynamic memory in zconfensure_buffer_stack()" );
2046                                                                   
2047                 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2048                                 
2049                 (yy_buffer_stack_max) = num_to_alloc;
2050                 (yy_buffer_stack_top) = 0;
2051                 return;
2052         }
2054         if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2056                 /* Increase the buffer to prepare for a possible push. */
2057                 int grow_size = 8 /* arbitrary grow size */;
2059                 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2060                 (yy_buffer_stack) = (struct yy_buffer_state**)zconfrealloc
2061                                                                 ((yy_buffer_stack),
2062                                                                 num_to_alloc * sizeof(struct yy_buffer_state*)
2063                                                                 );
2064                 if ( ! (yy_buffer_stack) )
2065                         YY_FATAL_ERROR( "out of dynamic memory in zconfensure_buffer_stack()" );
2067                 /* zero only the new slots.*/
2068                 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2069                 (yy_buffer_stack_max) = num_to_alloc;
2070         }
2073 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2074  * @param base the character buffer
2075  * @param size the size in bytes of the character buffer
2076  * 
2077  * @return the newly allocated buffer state object. 
2078  */
2079 YY_BUFFER_STATE zconf_scan_buffer  (char * base, yy_size_t  size )
2081         YY_BUFFER_STATE b;
2082     
2083         if ( size < 2 ||
2084              base[size-2] != YY_END_OF_BUFFER_CHAR ||
2085              base[size-1] != YY_END_OF_BUFFER_CHAR )
2086                 /* They forgot to leave room for the EOB's. */
2087                 return 0;
2089         b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state )  );
2090         if ( ! b )
2091                 YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_buffer()" );
2093         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
2094         b->yy_buf_pos = b->yy_ch_buf = base;
2095         b->yy_is_our_buffer = 0;
2096         b->yy_input_file = 0;
2097         b->yy_n_chars = b->yy_buf_size;
2098         b->yy_is_interactive = 0;
2099         b->yy_at_bol = 1;
2100         b->yy_fill_buffer = 0;
2101         b->yy_buffer_status = YY_BUFFER_NEW;
2103         zconf_switch_to_buffer(b  );
2105         return b;
2108 /** Setup the input buffer state to scan a string. The next call to zconflex() will
2109  * scan from a @e copy of @a str.
2110  * @param yystr a NUL-terminated string to scan
2111  * 
2112  * @return the newly allocated buffer state object.
2113  * @note If you want to scan bytes that may contain NUL values, then use
2114  *       zconf_scan_bytes() instead.
2115  */
2116 YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr )
2118     
2119         return zconf_scan_bytes(yystr,strlen(yystr) );
2122 /** Setup the input buffer state to scan the given bytes. The next call to zconflex() will
2123  * scan from a @e copy of @a bytes.
2124  * @param yybytes the byte buffer to scan
2125  * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2126  * 
2127  * @return the newly allocated buffer state object.
2128  */
2129 YY_BUFFER_STATE zconf_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
2131         YY_BUFFER_STATE b;
2132         char *buf;
2133         yy_size_t n;
2134         int i;
2135     
2136         /* Get memory for full buffer, including space for trailing EOB's. */
2137         n = _yybytes_len + 2;
2138         buf = (char *) zconfalloc(n  );
2139         if ( ! buf )
2140                 YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_bytes()" );
2142         for ( i = 0; i < _yybytes_len; ++i )
2143                 buf[i] = yybytes[i];
2145         buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2147         b = zconf_scan_buffer(buf,n );
2148         if ( ! b )
2149                 YY_FATAL_ERROR( "bad buffer in zconf_scan_bytes()" );
2151         /* It's okay to grow etc. this buffer, and we should throw it
2152          * away when we're done.
2153          */
2154         b->yy_is_our_buffer = 1;
2156         return b;
2159 #ifndef YY_EXIT_FAILURE
2160 #define YY_EXIT_FAILURE 2
2161 #endif
2163 static void yy_fatal_error (yyconst char* msg )
2165         (void) fprintf( stderr, "%s\n", msg );
2166         exit( YY_EXIT_FAILURE );
2169 /* Redefine yyless() so it works in section 3 code. */
2171 #undef yyless
2172 #define yyless(n) \
2173         do \
2174                 { \
2175                 /* Undo effects of setting up zconftext. */ \
2176         int yyless_macro_arg = (n); \
2177         YY_LESS_LINENO(yyless_macro_arg);\
2178                 zconftext[zconfleng] = (yy_hold_char); \
2179                 (yy_c_buf_p) = zconftext + yyless_macro_arg; \
2180                 (yy_hold_char) = *(yy_c_buf_p); \
2181                 *(yy_c_buf_p) = '\0'; \
2182                 zconfleng = yyless_macro_arg; \
2183                 } \
2184         while ( 0 )
2186 /* Accessor  methods (get/set functions) to struct members. */
2188 /** Get the current line number.
2189  * 
2190  */
2191 int zconfget_lineno  (void)
2193         
2194     return zconflineno;
2197 /** Get the input stream.
2198  * 
2199  */
2200 FILE *zconfget_in  (void)
2202         return zconfin;
2205 /** Get the output stream.
2206  * 
2207  */
2208 FILE *zconfget_out  (void)
2210         return zconfout;
2213 /** Get the length of the current token.
2214  * 
2215  */
2216 int zconfget_leng  (void)
2218         return zconfleng;
2221 /** Get the current token.
2222  * 
2223  */
2225 char *zconfget_text  (void)
2227         return zconftext;
2230 /** Set the current line number.
2231  * @param line_number
2232  * 
2233  */
2234 void zconfset_lineno (int  line_number )
2236     
2237     zconflineno = line_number;
2240 /** Set the input stream. This does not discard the current
2241  * input buffer.
2242  * @param in_str A readable stream.
2243  * 
2244  * @see zconf_switch_to_buffer
2245  */
2246 void zconfset_in (FILE *  in_str )
2248         zconfin = in_str ;
2251 void zconfset_out (FILE *  out_str )
2253         zconfout = out_str ;
2256 int zconfget_debug  (void)
2258         return zconf_flex_debug;
2261 void zconfset_debug (int  bdebug )
2263         zconf_flex_debug = bdebug ;
2266 static int yy_init_globals (void)
2268         /* Initialization is the same as for the non-reentrant scanner.
2269      * This function is called from zconflex_destroy(), so don't allocate here.
2270      */
2272     (yy_buffer_stack) = 0;
2273     (yy_buffer_stack_top) = 0;
2274     (yy_buffer_stack_max) = 0;
2275     (yy_c_buf_p) = (char *) 0;
2276     (yy_init) = 0;
2277     (yy_start) = 0;
2279 /* Defined in main.c */
2280 #ifdef YY_STDINIT
2281     zconfin = stdin;
2282     zconfout = stdout;
2283 #else
2284     zconfin = (FILE *) 0;
2285     zconfout = (FILE *) 0;
2286 #endif
2288     /* For future reference: Set errno on error, since we are called by
2289      * zconflex_init()
2290      */
2291     return 0;
2294 /* zconflex_destroy is for both reentrant and non-reentrant scanners. */
2295 int zconflex_destroy  (void)
2297     
2298     /* Pop the buffer stack, destroying each element. */
2299         while(YY_CURRENT_BUFFER){
2300                 zconf_delete_buffer(YY_CURRENT_BUFFER  );
2301                 YY_CURRENT_BUFFER_LVALUE = NULL;
2302                 zconfpop_buffer_state();
2303         }
2305         /* Destroy the stack itself. */
2306         zconffree((yy_buffer_stack) );
2307         (yy_buffer_stack) = NULL;
2309     /* Reset the globals. This is important in a non-reentrant scanner so the next time
2310      * zconflex() is called, initialization will occur. */
2311     yy_init_globals( );
2313     return 0;
2317  * Internal utility routines.
2318  */
2320 #ifndef yytext_ptr
2321 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2323         register int i;
2324         for ( i = 0; i < n; ++i )
2325                 s1[i] = s2[i];
2327 #endif
2329 #ifdef YY_NEED_STRLEN
2330 static int yy_flex_strlen (yyconst char * s )
2332         register int n;
2333         for ( n = 0; s[n]; ++n )
2334                 ;
2336         return n;
2338 #endif
2340 void *zconfalloc (yy_size_t  size )
2342         return (void *) malloc( size );
2345 void *zconfrealloc  (void * ptr, yy_size_t  size )
2347         /* The cast to (char *) in the following accommodates both
2348          * implementations that use char* generic pointers, and those
2349          * that use void* generic pointers.  It works with the latter
2350          * because both ANSI C and C++ allow castless assignment from
2351          * any pointer type to void*, and deal with argument conversions
2352          * as though doing an assignment.
2353          */
2354         return (void *) realloc( (char *) ptr, size );
2357 void zconffree (void * ptr )
2359         free( (char *) ptr );   /* see zconfrealloc() for (char *) cast */
2362 #define YYTABLES_NAME "yytables"
2364 #line 243 "zconf.l"
2367 void zconf_starthelp(void)
2369         new_string();
2370         last_ts = first_ts = 0;
2371         BEGIN(HELP);
2374 static void zconf_endhelp(void)
2376         zconflval.string = text;
2377         BEGIN(INITIAL);
2382  * Try to open specified file with following names:
2383  * ./name
2384  * $(srctree)/name
2385  * The latter is used when srctree is separate from objtree
2386  * when compiling the kernel.
2387  * Return NULL if file is not found.
2388  */
2389 FILE *zconf_fopen(const char *name)
2391         char *env, fullname[PATH_MAX+1];
2392         FILE *f;
2394         f = fopen(name, "r");
2395         if (!f && name != NULL && name[0] != '/') {
2396                 env = getenv(SRCTREE);
2397                 if (env) {
2398                         sprintf(fullname, "%s/%s", env, name);
2399                         f = fopen(fullname, "r");
2400                 }
2401         }
2402         return f;
2405 void zconf_initscan(const char *name)
2407         zconfin = zconf_fopen(name);
2408         if (!zconfin) {
2409                 printf("can't find file %s\n", name);
2410                 exit(1);
2411         }
2413         current_buf = xmalloc(sizeof(*current_buf));
2414         memset(current_buf, 0, sizeof(*current_buf));
2416         current_file = file_lookup(name);
2417         current_file->lineno = 1;
2420 void zconf_nextfile(const char *name)
2422         struct file *iter;
2423         struct file *file = file_lookup(name);
2424         struct buffer *buf = xmalloc(sizeof(*buf));
2425         memset(buf, 0, sizeof(*buf));
2427         current_buf->state = YY_CURRENT_BUFFER;
2428         zconfin = zconf_fopen(file->name);
2429         if (!zconfin) {
2430                 printf("%s:%d: can't open file \"%s\"\n",
2431                     zconf_curname(), zconf_lineno(), file->name);
2432                 exit(1);
2433         }
2434         zconf_switch_to_buffer(zconf_create_buffer(zconfin,YY_BUF_SIZE));
2435         buf->parent = current_buf;
2436         current_buf = buf;
2438         for (iter = current_file->parent; iter; iter = iter->parent ) {
2439                 if (!strcmp(current_file->name,iter->name) ) {
2440                         printf("%s:%d: recursive inclusion detected. "
2441                                "Inclusion path:\n  current file : '%s'\n",
2442                                zconf_curname(), zconf_lineno(),
2443                                zconf_curname());
2444                         iter = current_file->parent;
2445                         while (iter && \
2446                                strcmp(iter->name,current_file->name)) {
2447                                 printf("  included from: '%s:%d'\n",
2448                                        iter->name, iter->lineno-1);
2449                                 iter = iter->parent;
2450                         }
2451                         if (iter)
2452                                 printf("  included from: '%s:%d'\n",
2453                                        iter->name, iter->lineno+1);
2454                         exit(1);
2455                 }
2456         }
2457         file->lineno = 1;
2458         file->parent = current_file;
2459         current_file = file;
2462 static void zconf_endfile(void)
2464         struct buffer *parent;
2466         current_file = current_file->parent;
2468         parent = current_buf->parent;
2469         if (parent) {
2470                 fclose(zconfin);
2471                 zconf_delete_buffer(YY_CURRENT_BUFFER);
2472                 zconf_switch_to_buffer(parent->state);
2473         }
2474         free(current_buf);
2475         current_buf = parent;
2478 int zconf_lineno(void)
2480         return current_pos.lineno;
2483 const char *zconf_curname(void)
2485         return current_pos.file ? current_pos.file->name : "<none>";