Chameleon

Chameleon Svn Source Tree

Root/branches/Chimera/i386/config/lex.zconf.c

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

Archive Download this file

Revision: HEAD