blob: a065d5a57c01c131694d6da73ce5591063b34e9b [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001
Roman Zippel7a884882005-11-08 21:34:51 -08002#line 3 "scripts/kconfig/lex.zconf.c"
Linus Torvalds1da177e2005-04-16 15:20:36 -07003
4#define YY_INT_ALIGNED short int
5
6/* A lexical scanner generated by flex */
7
Sam Ravnborg14f31562007-09-26 20:15:39 +02008#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
Linus Torvalds1da177e2005-04-16 15:20:36 -070027#define FLEX_SCANNER
28#define YY_FLEX_MAJOR_VERSION 2
29#define YY_FLEX_MINOR_VERSION 5
Roman Zippelf6a88aa2006-06-08 22:12:44 -070030#define YY_FLEX_SUBMINOR_VERSION 33
Linus Torvalds1da177e2005-04-16 15:20:36 -070031#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
Roman Zippelf6a88aa2006-06-08 22:12:44 -070052#if __STDC_VERSION__ >= 199901L
53
54/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
Sam Ravnborg14f31562007-09-26 20:15:39 +020055 * if you want the limit (max/min) macros for int types.
Roman Zippelf6a88aa2006-06-08 22:12:44 -070056 */
57#ifndef __STDC_LIMIT_MACROS
58#define __STDC_LIMIT_MACROS 1
59#endif
60
Linus Torvalds1da177e2005-04-16 15:20:36 -070061#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#endif /* ! C99 */
76
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
105
106#endif /* ! FLEXINT_H */
107
108#ifdef __cplusplus
109
110/* The "const" storage-class-modifier is valid. */
111#define YY_USE_CONST
112
113#else /* ! __cplusplus */
114
115#if __STDC__
116
117#define YY_USE_CONST
118
119#endif /* __STDC__ */
120#endif /* ! __cplusplus */
121
122#ifdef YY_USE_CONST
123#define yyconst const
124#else
125#define yyconst
126#endif
127
128/* Returned upon end-of-file. */
129#define YY_NULL 0
130
131/* Promotes a possibly negative, possibly signed char to an unsigned
132 * integer for use as an array index. If the signed char is negative,
133 * we want to instead treat it as an 8-bit unsigned char, hence the
134 * double cast.
135 */
136#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
137
138/* Enter a start condition. This macro really ought to take a parameter,
139 * but we do it the disgusting crufty way forced on us by the ()-less
140 * definition of BEGIN.
141 */
142#define BEGIN (yy_start) = 1 + 2 *
143
144/* Translate the current start state into a value that can be later handed
145 * to BEGIN to return to the state. The YYSTATE alias is for lex
146 * compatibility.
147 */
148#define YY_START (((yy_start) - 1) / 2)
149#define YYSTATE YY_START
150
151/* Action number for EOF rule of a given start state. */
152#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
153
154/* Special action meaning "start processing a new file". */
155#define YY_NEW_FILE zconfrestart(zconfin )
156
157#define YY_END_OF_BUFFER_CHAR 0
158
159/* Size of default input buffer. */
160#ifndef YY_BUF_SIZE
161#define YY_BUF_SIZE 16384
162#endif
163
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700164/* The state buf must be large enough to hold one state per character in the main buffer.
165 */
166#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
167
Linus Torvalds1da177e2005-04-16 15:20:36 -0700168#ifndef YY_TYPEDEF_YY_BUFFER_STATE
169#define YY_TYPEDEF_YY_BUFFER_STATE
170typedef struct yy_buffer_state *YY_BUFFER_STATE;
171#endif
172
173extern int zconfleng;
174
175extern FILE *zconfin, *zconfout;
176
177#define EOB_ACT_CONTINUE_SCAN 0
178#define EOB_ACT_END_OF_FILE 1
179#define EOB_ACT_LAST_MATCH 2
180
181 #define YY_LESS_LINENO(n)
182
183/* Return all but the first "n" matched characters back to the input stream. */
184#define yyless(n) \
185 do \
186 { \
187 /* Undo effects of setting up zconftext. */ \
188 int yyless_macro_arg = (n); \
189 YY_LESS_LINENO(yyless_macro_arg);\
190 *yy_cp = (yy_hold_char); \
191 YY_RESTORE_YY_MORE_OFFSET \
192 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
193 YY_DO_BEFORE_ACTION; /* set up zconftext again */ \
194 } \
195 while ( 0 )
196
197#define unput(c) yyunput( c, (yytext_ptr) )
198
199/* The following is because we cannot portably get our hands on size_t
200 * (without autoconf's help, which isn't available because we want
201 * flex-generated scanners to compile on their own).
202 */
203
204#ifndef YY_TYPEDEF_YY_SIZE_T
205#define YY_TYPEDEF_YY_SIZE_T
206typedef unsigned int yy_size_t;
207#endif
208
209#ifndef YY_STRUCT_YY_BUFFER_STATE
210#define YY_STRUCT_YY_BUFFER_STATE
211struct yy_buffer_state
212 {
213 FILE *yy_input_file;
214
215 char *yy_ch_buf; /* input buffer */
216 char *yy_buf_pos; /* current position in input buffer */
217
218 /* Size of input buffer in bytes, not including room for EOB
219 * characters.
220 */
221 yy_size_t yy_buf_size;
222
223 /* Number of characters read into yy_ch_buf, not including EOB
224 * characters.
225 */
226 int yy_n_chars;
227
228 /* Whether we "own" the buffer - i.e., we know we created it,
229 * and can realloc() it to grow it, and should free() it to
230 * delete it.
231 */
232 int yy_is_our_buffer;
233
234 /* Whether this is an "interactive" input source; if so, and
235 * if we're using stdio for input, then we want to use getc()
236 * instead of fread(), to make sure we stop fetching input after
237 * each newline.
238 */
239 int yy_is_interactive;
240
241 /* Whether we're considered to be at the beginning of a line.
242 * If so, '^' rules will be active on the next match, otherwise
243 * not.
244 */
245 int yy_at_bol;
246
247 int yy_bs_lineno; /**< The line count. */
248 int yy_bs_column; /**< The column count. */
249
250 /* Whether to try to fill the input buffer when we reach the
251 * end of it.
252 */
253 int yy_fill_buffer;
254
255 int yy_buffer_status;
256
257#define YY_BUFFER_NEW 0
258#define YY_BUFFER_NORMAL 1
259 /* When an EOF's been seen but there's still some text to process
260 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
261 * shouldn't try reading from the input source any more. We might
262 * still have a bunch of tokens to match, though, because of
263 * possible backing-up.
264 *
265 * When we actually see the EOF, we change the status to "new"
266 * (via zconfrestart()), so that the user can continue scanning by
267 * just pointing zconfin at a new input file.
268 */
269#define YY_BUFFER_EOF_PENDING 2
270
271 };
272#endif /* !YY_STRUCT_YY_BUFFER_STATE */
273
274/* Stack of input buffers. */
275static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
276static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
277static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
278
279/* We provide macros for accessing buffer states in case in the
280 * future we want to put the buffer states in a more general
281 * "scanner state".
282 *
283 * Returns the top of the stack, or NULL.
284 */
285#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
286 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
287 : NULL)
288
289/* Same as previous macro, but useful when we know that the buffer stack is not
290 * NULL or when we need an lvalue. For internal use only.
291 */
292#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
293
294/* yy_hold_char holds the character lost when zconftext is formed. */
295static char yy_hold_char;
296static int yy_n_chars; /* number of characters read into yy_ch_buf */
297int zconfleng;
298
299/* Points to current character in buffer. */
300static char *yy_c_buf_p = (char *) 0;
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700301static int yy_init = 0; /* whether we need to initialize */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700302static int yy_start = 0; /* start state number */
303
304/* Flag which is used to allow zconfwrap()'s to do buffer switches
305 * instead of setting up a fresh zconfin. A bit of a hack ...
306 */
307static int yy_did_buffer_switch_on_eof;
308
309void zconfrestart (FILE *input_file );
310void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer );
311YY_BUFFER_STATE zconf_create_buffer (FILE *file,int size );
312void zconf_delete_buffer (YY_BUFFER_STATE b );
313void zconf_flush_buffer (YY_BUFFER_STATE b );
314void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer );
315void zconfpop_buffer_state (void );
316
317static void zconfensure_buffer_stack (void );
318static void zconf_load_buffer_state (void );
319static void zconf_init_buffer (YY_BUFFER_STATE b,FILE *file );
320
321#define YY_FLUSH_BUFFER zconf_flush_buffer(YY_CURRENT_BUFFER )
322
323YY_BUFFER_STATE zconf_scan_buffer (char *base,yy_size_t size );
324YY_BUFFER_STATE zconf_scan_string (yyconst char *yy_str );
325YY_BUFFER_STATE zconf_scan_bytes (yyconst char *bytes,int len );
326
327void *zconfalloc (yy_size_t );
328void *zconfrealloc (void *,yy_size_t );
329void zconffree (void * );
330
331#define yy_new_buffer zconf_create_buffer
332
333#define yy_set_interactive(is_interactive) \
334 { \
335 if ( ! YY_CURRENT_BUFFER ){ \
336 zconfensure_buffer_stack (); \
337 YY_CURRENT_BUFFER_LVALUE = \
338 zconf_create_buffer(zconfin,YY_BUF_SIZE ); \
339 } \
340 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
341 }
342
343#define yy_set_bol(at_bol) \
344 { \
345 if ( ! YY_CURRENT_BUFFER ){\
346 zconfensure_buffer_stack (); \
347 YY_CURRENT_BUFFER_LVALUE = \
348 zconf_create_buffer(zconfin,YY_BUF_SIZE ); \
349 } \
350 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
351 }
352
353#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
354
355/* Begin user sect3 */
356
Sam Ravnborg14f31562007-09-26 20:15:39 +0200357#define zconfwrap(n) 1
Linus Torvalds1da177e2005-04-16 15:20:36 -0700358#define YY_SKIP_YYWRAP
359
360typedef unsigned char YY_CHAR;
361
362FILE *zconfin = (FILE *) 0, *zconfout = (FILE *) 0;
363
364typedef int yy_state_type;
365
366extern int zconflineno;
367
368int zconflineno = 1;
369
370extern char *zconftext;
371#define yytext_ptr zconftext
Roman Zippel7a884882005-11-08 21:34:51 -0800372static yyconst flex_int16_t yy_nxt[][17] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700373 {
374 {
375 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Roman Zippel7a884882005-11-08 21:34:51 -0800376 0, 0, 0, 0, 0, 0, 0
Linus Torvalds1da177e2005-04-16 15:20:36 -0700377 },
378
379 {
380 11, 12, 13, 14, 12, 12, 15, 12, 12, 12,
Roman Zippel7a884882005-11-08 21:34:51 -0800381 12, 12, 12, 12, 12, 12, 12
Linus Torvalds1da177e2005-04-16 15:20:36 -0700382 },
383
384 {
385 11, 12, 13, 14, 12, 12, 15, 12, 12, 12,
Roman Zippel7a884882005-11-08 21:34:51 -0800386 12, 12, 12, 12, 12, 12, 12
Linus Torvalds1da177e2005-04-16 15:20:36 -0700387 },
388
389 {
390 11, 16, 16, 17, 16, 16, 16, 16, 16, 16,
Roman Zippel7a884882005-11-08 21:34:51 -0800391 16, 16, 16, 18, 16, 16, 16
Linus Torvalds1da177e2005-04-16 15:20:36 -0700392 },
393
394 {
395 11, 16, 16, 17, 16, 16, 16, 16, 16, 16,
Roman Zippel7a884882005-11-08 21:34:51 -0800396 16, 16, 16, 18, 16, 16, 16
Linus Torvalds1da177e2005-04-16 15:20:36 -0700397
398 },
399
400 {
Roman Zippel7a884882005-11-08 21:34:51 -0800401 11, 19, 20, 21, 19, 19, 19, 19, 19, 19,
402 19, 19, 19, 19, 19, 19, 19
Linus Torvalds1da177e2005-04-16 15:20:36 -0700403 },
404
405 {
Roman Zippel7a884882005-11-08 21:34:51 -0800406 11, 19, 20, 21, 19, 19, 19, 19, 19, 19,
407 19, 19, 19, 19, 19, 19, 19
Linus Torvalds1da177e2005-04-16 15:20:36 -0700408 },
409
410 {
Roman Zippel7a884882005-11-08 21:34:51 -0800411 11, 22, 22, 23, 22, 24, 22, 22, 24, 22,
412 22, 22, 22, 22, 22, 25, 22
Linus Torvalds1da177e2005-04-16 15:20:36 -0700413 },
414
415 {
Roman Zippel7a884882005-11-08 21:34:51 -0800416 11, 22, 22, 23, 22, 24, 22, 22, 24, 22,
417 22, 22, 22, 22, 22, 25, 22
Linus Torvalds1da177e2005-04-16 15:20:36 -0700418 },
419
420 {
Roman Zippel7a884882005-11-08 21:34:51 -0800421 11, 26, 26, 27, 28, 29, 30, 31, 29, 32,
422 33, 34, 35, 35, 36, 37, 38
Linus Torvalds1da177e2005-04-16 15:20:36 -0700423
424 },
425
426 {
Roman Zippel7a884882005-11-08 21:34:51 -0800427 11, 26, 26, 27, 28, 29, 30, 31, 29, 32,
428 33, 34, 35, 35, 36, 37, 38
Linus Torvalds1da177e2005-04-16 15:20:36 -0700429 },
430
431 {
432 -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
Roman Zippel7a884882005-11-08 21:34:51 -0800433 -11, -11, -11, -11, -11, -11, -11
Linus Torvalds1da177e2005-04-16 15:20:36 -0700434 },
435
436 {
437 11, -12, -12, -12, -12, -12, -12, -12, -12, -12,
Roman Zippel7a884882005-11-08 21:34:51 -0800438 -12, -12, -12, -12, -12, -12, -12
Linus Torvalds1da177e2005-04-16 15:20:36 -0700439 },
440
441 {
Roman Zippel7a884882005-11-08 21:34:51 -0800442 11, -13, 39, 40, -13, -13, 41, -13, -13, -13,
443 -13, -13, -13, -13, -13, -13, -13
Linus Torvalds1da177e2005-04-16 15:20:36 -0700444 },
445
446 {
447 11, -14, -14, -14, -14, -14, -14, -14, -14, -14,
Roman Zippel7a884882005-11-08 21:34:51 -0800448 -14, -14, -14, -14, -14, -14, -14
Linus Torvalds1da177e2005-04-16 15:20:36 -0700449
450 },
451
452 {
Roman Zippel7a884882005-11-08 21:34:51 -0800453 11, 42, 42, 43, 42, 42, 42, 42, 42, 42,
454 42, 42, 42, 42, 42, 42, 42
Linus Torvalds1da177e2005-04-16 15:20:36 -0700455 },
456
457 {
458 11, -16, -16, -16, -16, -16, -16, -16, -16, -16,
Roman Zippel7a884882005-11-08 21:34:51 -0800459 -16, -16, -16, -16, -16, -16, -16
Linus Torvalds1da177e2005-04-16 15:20:36 -0700460 },
461
462 {
463 11, -17, -17, -17, -17, -17, -17, -17, -17, -17,
Roman Zippel7a884882005-11-08 21:34:51 -0800464 -17, -17, -17, -17, -17, -17, -17
Linus Torvalds1da177e2005-04-16 15:20:36 -0700465 },
466
467 {
468 11, -18, -18, -18, -18, -18, -18, -18, -18, -18,
Roman Zippel7a884882005-11-08 21:34:51 -0800469 -18, -18, -18, 44, -18, -18, -18
Linus Torvalds1da177e2005-04-16 15:20:36 -0700470 },
471
472 {
Roman Zippel7a884882005-11-08 21:34:51 -0800473 11, 45, 45, -19, 45, 45, 45, 45, 45, 45,
474 45, 45, 45, 45, 45, 45, 45
Linus Torvalds1da177e2005-04-16 15:20:36 -0700475
476 },
477
478 {
Roman Zippel7a884882005-11-08 21:34:51 -0800479 11, -20, 46, 47, -20, -20, -20, -20, -20, -20,
480 -20, -20, -20, -20, -20, -20, -20
Linus Torvalds1da177e2005-04-16 15:20:36 -0700481 },
482
483 {
Roman Zippel7a884882005-11-08 21:34:51 -0800484 11, 48, -21, -21, 48, 48, 48, 48, 48, 48,
485 48, 48, 48, 48, 48, 48, 48
Linus Torvalds1da177e2005-04-16 15:20:36 -0700486 },
487
488 {
Roman Zippel7a884882005-11-08 21:34:51 -0800489 11, 49, 49, 50, 49, -22, 49, 49, -22, 49,
490 49, 49, 49, 49, 49, -22, 49
Linus Torvalds1da177e2005-04-16 15:20:36 -0700491 },
492
493 {
494 11, -23, -23, -23, -23, -23, -23, -23, -23, -23,
Roman Zippel7a884882005-11-08 21:34:51 -0800495 -23, -23, -23, -23, -23, -23, -23
Linus Torvalds1da177e2005-04-16 15:20:36 -0700496 },
497
498 {
499 11, -24, -24, -24, -24, -24, -24, -24, -24, -24,
Roman Zippel7a884882005-11-08 21:34:51 -0800500 -24, -24, -24, -24, -24, -24, -24
Linus Torvalds1da177e2005-04-16 15:20:36 -0700501
502 },
503
504 {
Roman Zippel7a884882005-11-08 21:34:51 -0800505 11, 51, 51, 52, 51, 51, 51, 51, 51, 51,
506 51, 51, 51, 51, 51, 51, 51
Linus Torvalds1da177e2005-04-16 15:20:36 -0700507 },
508
509 {
510 11, -26, -26, -26, -26, -26, -26, -26, -26, -26,
Roman Zippel7a884882005-11-08 21:34:51 -0800511 -26, -26, -26, -26, -26, -26, -26
Linus Torvalds1da177e2005-04-16 15:20:36 -0700512 },
513
514 {
515 11, -27, -27, -27, -27, -27, -27, -27, -27, -27,
Roman Zippel7a884882005-11-08 21:34:51 -0800516 -27, -27, -27, -27, -27, -27, -27
Linus Torvalds1da177e2005-04-16 15:20:36 -0700517 },
518
519 {
520 11, -28, -28, -28, -28, -28, -28, -28, -28, -28,
Roman Zippel7a884882005-11-08 21:34:51 -0800521 -28, -28, -28, -28, 53, -28, -28
Linus Torvalds1da177e2005-04-16 15:20:36 -0700522 },
523
524 {
525 11, -29, -29, -29, -29, -29, -29, -29, -29, -29,
Roman Zippel7a884882005-11-08 21:34:51 -0800526 -29, -29, -29, -29, -29, -29, -29
Linus Torvalds1da177e2005-04-16 15:20:36 -0700527
528 },
529
530 {
Roman Zippel7a884882005-11-08 21:34:51 -0800531 11, 54, 54, -30, 54, 54, 54, 54, 54, 54,
532 54, 54, 54, 54, 54, 54, 54
Linus Torvalds1da177e2005-04-16 15:20:36 -0700533 },
534
535 {
Roman Zippel7a884882005-11-08 21:34:51 -0800536 11, -31, -31, -31, -31, -31, -31, 55, -31, -31,
537 -31, -31, -31, -31, -31, -31, -31
Linus Torvalds1da177e2005-04-16 15:20:36 -0700538 },
539
540 {
Roman Zippel7a884882005-11-08 21:34:51 -0800541 11, -32, -32, -32, -32, -32, -32, -32, -32, -32,
542 -32, -32, -32, -32, -32, -32, -32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700543 },
544
545 {
Roman Zippel7a884882005-11-08 21:34:51 -0800546 11, -33, -33, -33, -33, -33, -33, -33, -33, -33,
547 -33, -33, -33, -33, -33, -33, -33
Linus Torvalds1da177e2005-04-16 15:20:36 -0700548 },
549
550 {
Roman Zippel7a884882005-11-08 21:34:51 -0800551 11, -34, -34, -34, -34, -34, -34, -34, -34, -34,
552 -34, 56, 57, 57, -34, -34, -34
Linus Torvalds1da177e2005-04-16 15:20:36 -0700553
554 },
555
556 {
557 11, -35, -35, -35, -35, -35, -35, -35, -35, -35,
Roman Zippel7a884882005-11-08 21:34:51 -0800558 -35, 57, 57, 57, -35, -35, -35
Linus Torvalds1da177e2005-04-16 15:20:36 -0700559 },
560
561 {
562 11, -36, -36, -36, -36, -36, -36, -36, -36, -36,
Roman Zippel7a884882005-11-08 21:34:51 -0800563 -36, -36, -36, -36, -36, -36, -36
Linus Torvalds1da177e2005-04-16 15:20:36 -0700564 },
565
566 {
Roman Zippel7a884882005-11-08 21:34:51 -0800567 11, -37, -37, 58, -37, -37, -37, -37, -37, -37,
568 -37, -37, -37, -37, -37, -37, -37
Linus Torvalds1da177e2005-04-16 15:20:36 -0700569 },
570
571 {
572 11, -38, -38, -38, -38, -38, -38, -38, -38, -38,
Roman Zippel7a884882005-11-08 21:34:51 -0800573 -38, -38, -38, -38, -38, -38, 59
Linus Torvalds1da177e2005-04-16 15:20:36 -0700574 },
575
576 {
Roman Zippel7a884882005-11-08 21:34:51 -0800577 11, -39, 39, 40, -39, -39, 41, -39, -39, -39,
578 -39, -39, -39, -39, -39, -39, -39
Linus Torvalds1da177e2005-04-16 15:20:36 -0700579
580 },
581
582 {
583 11, -40, -40, -40, -40, -40, -40, -40, -40, -40,
Roman Zippel7a884882005-11-08 21:34:51 -0800584 -40, -40, -40, -40, -40, -40, -40
Linus Torvalds1da177e2005-04-16 15:20:36 -0700585 },
586
587 {
Roman Zippel7a884882005-11-08 21:34:51 -0800588 11, 42, 42, 43, 42, 42, 42, 42, 42, 42,
589 42, 42, 42, 42, 42, 42, 42
Linus Torvalds1da177e2005-04-16 15:20:36 -0700590 },
591
592 {
Roman Zippel7a884882005-11-08 21:34:51 -0800593 11, 42, 42, 43, 42, 42, 42, 42, 42, 42,
594 42, 42, 42, 42, 42, 42, 42
Linus Torvalds1da177e2005-04-16 15:20:36 -0700595 },
596
597 {
Roman Zippel7a884882005-11-08 21:34:51 -0800598 11, -43, -43, -43, -43, -43, -43, -43, -43, -43,
599 -43, -43, -43, -43, -43, -43, -43
Linus Torvalds1da177e2005-04-16 15:20:36 -0700600 },
601
602 {
603 11, -44, -44, -44, -44, -44, -44, -44, -44, -44,
Roman Zippel7a884882005-11-08 21:34:51 -0800604 -44, -44, -44, 44, -44, -44, -44
Linus Torvalds1da177e2005-04-16 15:20:36 -0700605
606 },
607
608 {
Roman Zippel7a884882005-11-08 21:34:51 -0800609 11, 45, 45, -45, 45, 45, 45, 45, 45, 45,
610 45, 45, 45, 45, 45, 45, 45
Linus Torvalds1da177e2005-04-16 15:20:36 -0700611 },
612
613 {
Roman Zippel7a884882005-11-08 21:34:51 -0800614 11, -46, 46, 47, -46, -46, -46, -46, -46, -46,
615 -46, -46, -46, -46, -46, -46, -46
Linus Torvalds1da177e2005-04-16 15:20:36 -0700616 },
617
618 {
Roman Zippel7a884882005-11-08 21:34:51 -0800619 11, 48, -47, -47, 48, 48, 48, 48, 48, 48,
620 48, 48, 48, 48, 48, 48, 48
Linus Torvalds1da177e2005-04-16 15:20:36 -0700621 },
622
623 {
624 11, -48, -48, -48, -48, -48, -48, -48, -48, -48,
Roman Zippel7a884882005-11-08 21:34:51 -0800625 -48, -48, -48, -48, -48, -48, -48
Linus Torvalds1da177e2005-04-16 15:20:36 -0700626 },
627
628 {
Roman Zippel7a884882005-11-08 21:34:51 -0800629 11, 49, 49, 50, 49, -49, 49, 49, -49, 49,
630 49, 49, 49, 49, 49, -49, 49
Linus Torvalds1da177e2005-04-16 15:20:36 -0700631
632 },
633
634 {
635 11, -50, -50, -50, -50, -50, -50, -50, -50, -50,
Roman Zippel7a884882005-11-08 21:34:51 -0800636 -50, -50, -50, -50, -50, -50, -50
Linus Torvalds1da177e2005-04-16 15:20:36 -0700637 },
638
639 {
Roman Zippel7a884882005-11-08 21:34:51 -0800640 11, -51, -51, 52, -51, -51, -51, -51, -51, -51,
641 -51, -51, -51, -51, -51, -51, -51
Linus Torvalds1da177e2005-04-16 15:20:36 -0700642 },
643
644 {
645 11, -52, -52, -52, -52, -52, -52, -52, -52, -52,
Roman Zippel7a884882005-11-08 21:34:51 -0800646 -52, -52, -52, -52, -52, -52, -52
Linus Torvalds1da177e2005-04-16 15:20:36 -0700647 },
648
649 {
Roman Zippel7a884882005-11-08 21:34:51 -0800650 11, -53, -53, -53, -53, -53, -53, -53, -53, -53,
651 -53, -53, -53, -53, -53, -53, -53
Linus Torvalds1da177e2005-04-16 15:20:36 -0700652 },
653
654 {
Roman Zippel7a884882005-11-08 21:34:51 -0800655 11, 54, 54, -54, 54, 54, 54, 54, 54, 54,
656 54, 54, 54, 54, 54, 54, 54
Linus Torvalds1da177e2005-04-16 15:20:36 -0700657
658 },
659
660 {
Roman Zippel7a884882005-11-08 21:34:51 -0800661 11, -55, -55, -55, -55, -55, -55, -55, -55, -55,
662 -55, -55, -55, -55, -55, -55, -55
Linus Torvalds1da177e2005-04-16 15:20:36 -0700663 },
664
665 {
Roman Zippel7a884882005-11-08 21:34:51 -0800666 11, -56, -56, -56, -56, -56, -56, -56, -56, -56,
667 -56, 60, 57, 57, -56, -56, -56
Linus Torvalds1da177e2005-04-16 15:20:36 -0700668 },
669
670 {
671 11, -57, -57, -57, -57, -57, -57, -57, -57, -57,
Roman Zippel7a884882005-11-08 21:34:51 -0800672 -57, 57, 57, 57, -57, -57, -57
Linus Torvalds1da177e2005-04-16 15:20:36 -0700673 },
674
675 {
676 11, -58, -58, -58, -58, -58, -58, -58, -58, -58,
Roman Zippel7a884882005-11-08 21:34:51 -0800677 -58, -58, -58, -58, -58, -58, -58
Linus Torvalds1da177e2005-04-16 15:20:36 -0700678 },
679
680 {
681 11, -59, -59, -59, -59, -59, -59, -59, -59, -59,
Roman Zippel7a884882005-11-08 21:34:51 -0800682 -59, -59, -59, -59, -59, -59, -59
Linus Torvalds1da177e2005-04-16 15:20:36 -0700683
684 },
685
686 {
687 11, -60, -60, -60, -60, -60, -60, -60, -60, -60,
Roman Zippel7a884882005-11-08 21:34:51 -0800688 -60, 57, 57, 57, -60, -60, -60
Linus Torvalds1da177e2005-04-16 15:20:36 -0700689 },
690
691 } ;
692
693static yy_state_type yy_get_previous_state (void );
694static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
695static int yy_get_next_buffer (void );
696static void yy_fatal_error (yyconst char msg[] );
697
698/* Done after the current pattern has been matched and before the
699 * corresponding action - sets up zconftext.
700 */
701#define YY_DO_BEFORE_ACTION \
702 (yytext_ptr) = yy_bp; \
703 zconfleng = (size_t) (yy_cp - yy_bp); \
704 (yy_hold_char) = *yy_cp; \
705 *yy_cp = '\0'; \
706 (yy_c_buf_p) = yy_cp;
707
Roman Zippel7a884882005-11-08 21:34:51 -0800708#define YY_NUM_RULES 33
709#define YY_END_OF_BUFFER 34
Linus Torvalds1da177e2005-04-16 15:20:36 -0700710/* This struct is not used in this scanner,
711 but its presence is necessary. */
712struct yy_trans_info
713 {
714 flex_int32_t yy_verify;
715 flex_int32_t yy_nxt;
716 };
Roman Zippel7a884882005-11-08 21:34:51 -0800717static yyconst flex_int16_t yy_accept[61] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700718 { 0,
719 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Roman Zippela02f0572005-11-08 21:34:53 -0800720 34, 5, 4, 2, 3, 7, 8, 6, 32, 29,
Roman Zippel7a884882005-11-08 21:34:51 -0800721 31, 24, 28, 27, 26, 22, 17, 13, 16, 20,
Roman Zippela02f0572005-11-08 21:34:53 -0800722 22, 11, 12, 19, 19, 14, 22, 22, 4, 2,
723 3, 3, 1, 6, 32, 29, 31, 30, 24, 23,
Roman Zippel7a884882005-11-08 21:34:51 -0800724 26, 25, 15, 20, 9, 19, 19, 21, 10, 18
Linus Torvalds1da177e2005-04-16 15:20:36 -0700725 } ;
726
727static yyconst flex_int32_t yy_ec[256] =
728 { 0,
729 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
730 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
731 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
732 1, 2, 4, 5, 6, 1, 1, 7, 8, 9,
733 10, 1, 1, 1, 11, 12, 12, 13, 13, 13,
734 13, 13, 13, 13, 13, 13, 13, 1, 1, 1,
735 14, 1, 1, 1, 13, 13, 13, 13, 13, 13,
736 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
737 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
Roman Zippel7a884882005-11-08 21:34:51 -0800738 1, 15, 1, 1, 13, 1, 13, 13, 13, 13,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700739
Roman Zippel7a884882005-11-08 21:34:51 -0800740 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
741 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
742 13, 13, 1, 16, 1, 1, 1, 1, 1, 1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700743 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
744 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
745 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
746 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
747 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
748 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
749 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
750
751 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
752 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
753 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
754 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
755 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
756 1, 1, 1, 1, 1
757 } ;
758
759extern int zconf_flex_debug;
760int zconf_flex_debug = 0;
761
762/* The intent behind this definition is that it'll catch
763 * any uses of REJECT which flex missed.
764 */
765#define REJECT reject_used_but_not_detected
766#define yymore() yymore_used_but_not_detected
767#define YY_MORE_ADJ 0
768#define YY_RESTORE_YY_MORE_OFFSET
769char *zconftext;
770
771/*
772 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
773 * Released under the terms of the GNU GPL v2.0.
774 */
775
776#include <limits.h>
777#include <stdio.h>
778#include <stdlib.h>
779#include <string.h>
780#include <unistd.h>
781
782#define LKC_DIRECT_LINK
783#include "lkc.h"
784
785#define START_STRSIZE 16
786
Roman Zippela02f0572005-11-08 21:34:53 -0800787static struct {
788 struct file *file;
789 int lineno;
790} current_pos;
791
Roman Zippel7a884882005-11-08 21:34:51 -0800792static char *text;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700793static int text_size, text_asize;
794
795struct buffer {
796 struct buffer *parent;
797 YY_BUFFER_STATE state;
798};
799
800struct buffer *current_buf;
801
802static int last_ts, first_ts;
803
804static void zconf_endhelp(void);
Roman Zippela02f0572005-11-08 21:34:53 -0800805static void zconf_endfile(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700806
807void new_string(void)
808{
809 text = malloc(START_STRSIZE);
810 text_asize = START_STRSIZE;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700811 text_size = 0;
Roman Zippel7a884882005-11-08 21:34:51 -0800812 *text = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700813}
814
815void append_string(const char *str, int size)
816{
817 int new_size = text_size + size + 1;
818 if (new_size > text_asize) {
Roman Zippel7a884882005-11-08 21:34:51 -0800819 new_size += START_STRSIZE - 1;
820 new_size &= -START_STRSIZE;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700821 text = realloc(text, new_size);
822 text_asize = new_size;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700823 }
Roman Zippel7a884882005-11-08 21:34:51 -0800824 memcpy(text + text_size, str, size);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700825 text_size += size;
Roman Zippel7a884882005-11-08 21:34:51 -0800826 text[text_size] = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700827}
828
829void alloc_string(const char *str, int size)
830{
831 text = malloc(size + 1);
832 memcpy(text, str, size);
833 text[size] = 0;
834}
835
836#define INITIAL 0
837#define COMMAND 1
838#define HELP 2
839#define STRING 3
840#define PARAM 4
841
Roman Zippel7a884882005-11-08 21:34:51 -0800842#ifndef YY_NO_UNISTD_H
Linus Torvalds1da177e2005-04-16 15:20:36 -0700843/* Special case for "unistd.h", since it is non-ANSI. We include it way
844 * down here because we want the user's section 1 to have been scanned first.
845 * The user has a chance to override it with an option.
846 */
847#include <unistd.h>
Roman Zippel7a884882005-11-08 21:34:51 -0800848#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700849
850#ifndef YY_EXTRA_TYPE
851#define YY_EXTRA_TYPE void *
852#endif
853
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700854static int yy_init_globals (void );
855
Linus Torvalds1da177e2005-04-16 15:20:36 -0700856/* Macros after this point can all be overridden by user definitions in
857 * section 1.
858 */
859
860#ifndef YY_SKIP_YYWRAP
861#ifdef __cplusplus
862extern "C" int zconfwrap (void );
863#else
864extern int zconfwrap (void );
865#endif
866#endif
867
868 static void yyunput (int c,char *buf_ptr );
869
870#ifndef yytext_ptr
871static void yy_flex_strncpy (char *,yyconst char *,int );
872#endif
873
874#ifdef YY_NEED_STRLEN
875static int yy_flex_strlen (yyconst char * );
876#endif
877
878#ifndef YY_NO_INPUT
879
880#ifdef __cplusplus
881static int yyinput (void );
882#else
883static int input (void );
884#endif
885
886#endif
887
888/* Amount of stuff to slurp up with each read. */
889#ifndef YY_READ_BUF_SIZE
890#define YY_READ_BUF_SIZE 8192
891#endif
892
893/* Copy whatever the last rule matched to the standard output. */
894#ifndef ECHO
895/* This used to be an fputs(), but since the string might contain NUL's,
896 * we now use fwrite().
897 */
898#define ECHO (void) fwrite( zconftext, zconfleng, 1, zconfout )
899#endif
900
901/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
902 * is returned in "result".
903 */
904#ifndef YY_INPUT
905#define YY_INPUT(buf,result,max_size) \
906 errno=0; \
907 while ( (result = read( fileno(zconfin), (char *) buf, max_size )) < 0 ) \
908 { \
909 if( errno != EINTR) \
910 { \
911 YY_FATAL_ERROR( "input in flex scanner failed" ); \
912 break; \
913 } \
914 errno=0; \
915 clearerr(zconfin); \
916 }\
917\
918
919#endif
920
921/* No semi-colon after return; correct usage is to write "yyterminate();" -
922 * we don't want an extra ';' after the "return" because that will cause
923 * some compilers to complain about unreachable statements.
924 */
925#ifndef yyterminate
926#define yyterminate() return YY_NULL
927#endif
928
929/* Number of entries by which start-condition stack grows. */
930#ifndef YY_START_STACK_INCR
931#define YY_START_STACK_INCR 25
932#endif
933
934/* Report a fatal error. */
935#ifndef YY_FATAL_ERROR
936#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
937#endif
938
939/* end tables serialization structures and prototypes */
940
941/* Default declaration of generated scanner - a define so the user can
942 * easily add parameters.
943 */
944#ifndef YY_DECL
945#define YY_DECL_IS_OURS 1
946
947extern int zconflex (void);
948
949#define YY_DECL int zconflex (void)
950#endif /* !YY_DECL */
951
952/* Code executed at the beginning of each rule, after zconftext and zconfleng
953 * have been set up.
954 */
955#ifndef YY_USER_ACTION
956#define YY_USER_ACTION
957#endif
958
959/* Code executed at the end of each rule. */
960#ifndef YY_BREAK
961#define YY_BREAK break;
962#endif
963
964#define YY_RULE_SETUP \
965 YY_USER_ACTION
966
967/** The main scanner function which does all the work.
968 */
969YY_DECL
970{
971 register yy_state_type yy_current_state;
972 register char *yy_cp, *yy_bp;
973 register int yy_act;
974
975 int str = 0;
976 int ts, i;
977
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700978 if ( !(yy_init) )
Linus Torvalds1da177e2005-04-16 15:20:36 -0700979 {
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700980 (yy_init) = 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700981
982#ifdef YY_USER_INIT
983 YY_USER_INIT;
984#endif
985
986 if ( ! (yy_start) )
987 (yy_start) = 1; /* first start state */
988
989 if ( ! zconfin )
990 zconfin = stdin;
991
992 if ( ! zconfout )
993 zconfout = stdout;
994
995 if ( ! YY_CURRENT_BUFFER ) {
996 zconfensure_buffer_stack ();
997 YY_CURRENT_BUFFER_LVALUE =
998 zconf_create_buffer(zconfin,YY_BUF_SIZE );
999 }
1000
1001 zconf_load_buffer_state( );
1002 }
1003
1004 while ( 1 ) /* loops until end-of-file is reached */
1005 {
1006 yy_cp = (yy_c_buf_p);
1007
1008 /* Support of zconftext. */
1009 *yy_cp = (yy_hold_char);
1010
1011 /* yy_bp points to the position in yy_ch_buf of the start of
1012 * the current run.
1013 */
1014 yy_bp = yy_cp;
1015
1016 yy_current_state = (yy_start);
1017yy_match:
1018 while ( (yy_current_state = yy_nxt[yy_current_state][ yy_ec[YY_SC_TO_UI(*yy_cp)] ]) > 0 )
1019 ++yy_cp;
1020
1021 yy_current_state = -yy_current_state;
1022
1023yy_find_action:
1024 yy_act = yy_accept[yy_current_state];
1025
1026 YY_DO_BEFORE_ACTION;
1027
1028do_action: /* This label is used only to access EOF actions. */
1029
1030 switch ( yy_act )
1031 { /* beginning of action switch */
1032case 1:
1033/* rule 1 can match eol */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001034case 2:
Roman Zippela02f0572005-11-08 21:34:53 -08001035/* rule 2 can match eol */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001036YY_RULE_SETUP
Roman Zippela02f0572005-11-08 21:34:53 -08001037{
1038 current_file->lineno++;
1039 return T_EOL;
1040}
Linus Torvalds1da177e2005-04-16 15:20:36 -07001041 YY_BREAK
1042case 3:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001043YY_RULE_SETUP
Roman Zippela02f0572005-11-08 21:34:53 -08001044
Linus Torvalds1da177e2005-04-16 15:20:36 -07001045 YY_BREAK
1046case 4:
1047YY_RULE_SETUP
1048{
1049 BEGIN(COMMAND);
1050}
1051 YY_BREAK
1052case 5:
1053YY_RULE_SETUP
1054{
1055 unput(zconftext[0]);
1056 BEGIN(COMMAND);
1057}
1058 YY_BREAK
1059
1060case 6:
1061YY_RULE_SETUP
Linus Torvalds1da177e2005-04-16 15:20:36 -07001062{
Roman Zippel7a884882005-11-08 21:34:51 -08001063 struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng);
Roman Zippela02f0572005-11-08 21:34:53 -08001064 BEGIN(PARAM);
1065 current_pos.file = current_file;
1066 current_pos.lineno = current_file->lineno;
Roman Zippel7a884882005-11-08 21:34:51 -08001067 if (id && id->flags & TF_COMMAND) {
Roman Zippel3370f9f2005-11-08 21:34:52 -08001068 zconflval.id = id;
Roman Zippel7a884882005-11-08 21:34:51 -08001069 return id->token;
1070 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07001071 alloc_string(zconftext, zconfleng);
1072 zconflval.string = text;
1073 return T_WORD;
1074 }
1075 YY_BREAK
Roman Zippel7a884882005-11-08 21:34:51 -08001076case 7:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001077YY_RULE_SETUP
1078
1079 YY_BREAK
Roman Zippel7a884882005-11-08 21:34:51 -08001080case 8:
1081/* rule 8 can match eol */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001082YY_RULE_SETUP
Roman Zippela02f0572005-11-08 21:34:53 -08001083{
1084 BEGIN(INITIAL);
1085 current_file->lineno++;
1086 return T_EOL;
1087 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07001088 YY_BREAK
1089
Roman Zippel7a884882005-11-08 21:34:51 -08001090case 9:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001091YY_RULE_SETUP
1092return T_AND;
1093 YY_BREAK
Roman Zippel7a884882005-11-08 21:34:51 -08001094case 10:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001095YY_RULE_SETUP
1096return T_OR;
1097 YY_BREAK
Roman Zippel7a884882005-11-08 21:34:51 -08001098case 11:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001099YY_RULE_SETUP
1100return T_OPEN_PAREN;
1101 YY_BREAK
Roman Zippel7a884882005-11-08 21:34:51 -08001102case 12:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001103YY_RULE_SETUP
1104return T_CLOSE_PAREN;
1105 YY_BREAK
Roman Zippel7a884882005-11-08 21:34:51 -08001106case 13:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001107YY_RULE_SETUP
1108return T_NOT;
1109 YY_BREAK
Roman Zippel7a884882005-11-08 21:34:51 -08001110case 14:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001111YY_RULE_SETUP
1112return T_EQUAL;
1113 YY_BREAK
Roman Zippel7a884882005-11-08 21:34:51 -08001114case 15:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001115YY_RULE_SETUP
1116return T_UNEQUAL;
1117 YY_BREAK
Roman Zippel7a884882005-11-08 21:34:51 -08001118case 16:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001119YY_RULE_SETUP
1120{
1121 str = zconftext[0];
1122 new_string();
1123 BEGIN(STRING);
1124 }
1125 YY_BREAK
Roman Zippel7a884882005-11-08 21:34:51 -08001126case 17:
1127/* rule 17 can match eol */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001128YY_RULE_SETUP
1129BEGIN(INITIAL); current_file->lineno++; return T_EOL;
1130 YY_BREAK
Roman Zippel7a884882005-11-08 21:34:51 -08001131case 18:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001132YY_RULE_SETUP
1133/* ignore */
1134 YY_BREAK
Roman Zippel7a884882005-11-08 21:34:51 -08001135case 19:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001136YY_RULE_SETUP
1137{
Roman Zippel7a884882005-11-08 21:34:51 -08001138 struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng);
Roman Zippel3370f9f2005-11-08 21:34:52 -08001139 if (id && id->flags & TF_PARAM) {
1140 zconflval.id = id;
Roman Zippel7a884882005-11-08 21:34:51 -08001141 return id->token;
Roman Zippel3370f9f2005-11-08 21:34:52 -08001142 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07001143 alloc_string(zconftext, zconfleng);
1144 zconflval.string = text;
1145 return T_WORD;
1146 }
1147 YY_BREAK
Roman Zippel7a884882005-11-08 21:34:51 -08001148case 20:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001149YY_RULE_SETUP
1150/* comment */
1151 YY_BREAK
Roman Zippel7a884882005-11-08 21:34:51 -08001152case 21:
1153/* rule 21 can match eol */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001154YY_RULE_SETUP
1155current_file->lineno++;
1156 YY_BREAK
Roman Zippel7a884882005-11-08 21:34:51 -08001157case 22:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001158YY_RULE_SETUP
1159
1160 YY_BREAK
1161case YY_STATE_EOF(PARAM):
1162{
1163 BEGIN(INITIAL);
1164 }
1165 YY_BREAK
1166
Roman Zippel7a884882005-11-08 21:34:51 -08001167case 23:
1168/* rule 23 can match eol */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001169*yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */
1170(yy_c_buf_p) = yy_cp -= 1;
1171YY_DO_BEFORE_ACTION; /* set up zconftext again */
1172YY_RULE_SETUP
1173{
1174 append_string(zconftext, zconfleng);
1175 zconflval.string = text;
1176 return T_WORD_QUOTE;
1177 }
1178 YY_BREAK
Roman Zippel7a884882005-11-08 21:34:51 -08001179case 24:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001180YY_RULE_SETUP
1181{
1182 append_string(zconftext, zconfleng);
1183 }
1184 YY_BREAK
Roman Zippel7a884882005-11-08 21:34:51 -08001185case 25:
1186/* rule 25 can match eol */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001187*yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */
1188(yy_c_buf_p) = yy_cp -= 1;
1189YY_DO_BEFORE_ACTION; /* set up zconftext again */
1190YY_RULE_SETUP
1191{
1192 append_string(zconftext + 1, zconfleng - 1);
1193 zconflval.string = text;
1194 return T_WORD_QUOTE;
1195 }
1196 YY_BREAK
Roman Zippel7a884882005-11-08 21:34:51 -08001197case 26:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001198YY_RULE_SETUP
1199{
1200 append_string(zconftext + 1, zconfleng - 1);
1201 }
1202 YY_BREAK
Roman Zippel7a884882005-11-08 21:34:51 -08001203case 27:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001204YY_RULE_SETUP
1205{
1206 if (str == zconftext[0]) {
1207 BEGIN(PARAM);
1208 zconflval.string = text;
1209 return T_WORD_QUOTE;
1210 } else
1211 append_string(zconftext, 1);
1212 }
1213 YY_BREAK
Roman Zippel7a884882005-11-08 21:34:51 -08001214case 28:
1215/* rule 28 can match eol */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001216YY_RULE_SETUP
1217{
1218 printf("%s:%d:warning: multi-line strings not supported\n", zconf_curname(), zconf_lineno());
1219 current_file->lineno++;
1220 BEGIN(INITIAL);
1221 return T_EOL;
1222 }
1223 YY_BREAK
1224case YY_STATE_EOF(STRING):
1225{
1226 BEGIN(INITIAL);
1227 }
1228 YY_BREAK
1229
Roman Zippel7a884882005-11-08 21:34:51 -08001230case 29:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001231YY_RULE_SETUP
1232{
1233 ts = 0;
1234 for (i = 0; i < zconfleng; i++) {
1235 if (zconftext[i] == '\t')
1236 ts = (ts & ~7) + 8;
1237 else
1238 ts++;
1239 }
1240 last_ts = ts;
1241 if (first_ts) {
1242 if (ts < first_ts) {
1243 zconf_endhelp();
1244 return T_HELPTEXT;
1245 }
1246 ts -= first_ts;
1247 while (ts > 8) {
1248 append_string(" ", 8);
1249 ts -= 8;
1250 }
1251 append_string(" ", ts);
1252 }
1253 }
1254 YY_BREAK
Roman Zippel7a884882005-11-08 21:34:51 -08001255case 30:
1256/* rule 30 can match eol */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001257*yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */
1258(yy_c_buf_p) = yy_cp -= 1;
1259YY_DO_BEFORE_ACTION; /* set up zconftext again */
1260YY_RULE_SETUP
1261{
1262 current_file->lineno++;
1263 zconf_endhelp();
1264 return T_HELPTEXT;
1265 }
1266 YY_BREAK
Roman Zippel7a884882005-11-08 21:34:51 -08001267case 31:
1268/* rule 31 can match eol */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001269YY_RULE_SETUP
1270{
1271 current_file->lineno++;
1272 append_string("\n", 1);
1273 }
1274 YY_BREAK
Roman Zippel7a884882005-11-08 21:34:51 -08001275case 32:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001276YY_RULE_SETUP
1277{
1278 append_string(zconftext, zconfleng);
1279 if (!first_ts)
1280 first_ts = last_ts;
1281 }
1282 YY_BREAK
1283case YY_STATE_EOF(HELP):
1284{
1285 zconf_endhelp();
1286 return T_HELPTEXT;
1287 }
1288 YY_BREAK
1289
1290case YY_STATE_EOF(INITIAL):
1291case YY_STATE_EOF(COMMAND):
1292{
Roman Zippela02f0572005-11-08 21:34:53 -08001293 if (current_file) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07001294 zconf_endfile();
Roman Zippela02f0572005-11-08 21:34:53 -08001295 return T_EOL;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001296 }
1297 fclose(zconfin);
1298 yyterminate();
1299}
1300 YY_BREAK
Roman Zippel7a884882005-11-08 21:34:51 -08001301case 33:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001302YY_RULE_SETUP
1303YY_FATAL_ERROR( "flex scanner jammed" );
1304 YY_BREAK
1305
1306 case YY_END_OF_BUFFER:
1307 {
1308 /* Amount of text matched not including the EOB char. */
1309 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1310
1311 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1312 *yy_cp = (yy_hold_char);
1313 YY_RESTORE_YY_MORE_OFFSET
1314
1315 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1316 {
1317 /* We're scanning a new file or input source. It's
1318 * possible that this happened because the user
1319 * just pointed zconfin at a new source and called
1320 * zconflex(). If so, then we have to assure
1321 * consistency between YY_CURRENT_BUFFER and our
1322 * globals. Here is the right place to do so, because
1323 * this is the first action (other than possibly a
1324 * back-up) that will match for the new input source.
1325 */
1326 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1327 YY_CURRENT_BUFFER_LVALUE->yy_input_file = zconfin;
1328 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1329 }
1330
1331 /* Note that here we test for yy_c_buf_p "<=" to the position
1332 * of the first EOB in the buffer, since yy_c_buf_p will
1333 * already have been incremented past the NUL character
1334 * (since all states make transitions on EOB to the
1335 * end-of-buffer state). Contrast this with the test
1336 * in input().
1337 */
1338 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1339 { /* This was really a NUL. */
1340 yy_state_type yy_next_state;
1341
1342 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1343
1344 yy_current_state = yy_get_previous_state( );
1345
1346 /* Okay, we're now positioned to make the NUL
1347 * transition. We couldn't have
1348 * yy_get_previous_state() go ahead and do it
1349 * for us because it doesn't know how to deal
1350 * with the possibility of jamming (and we don't
1351 * want to build jamming into it because then it
1352 * will run more slowly).
1353 */
1354
1355 yy_next_state = yy_try_NUL_trans( yy_current_state );
1356
1357 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1358
1359 if ( yy_next_state )
1360 {
1361 /* Consume the NUL. */
1362 yy_cp = ++(yy_c_buf_p);
1363 yy_current_state = yy_next_state;
1364 goto yy_match;
1365 }
1366
1367 else
1368 {
1369 yy_cp = (yy_c_buf_p);
1370 goto yy_find_action;
1371 }
1372 }
1373
1374 else switch ( yy_get_next_buffer( ) )
1375 {
1376 case EOB_ACT_END_OF_FILE:
1377 {
1378 (yy_did_buffer_switch_on_eof) = 0;
1379
1380 if ( zconfwrap( ) )
1381 {
1382 /* Note: because we've taken care in
1383 * yy_get_next_buffer() to have set up
1384 * zconftext, we can now set up
1385 * yy_c_buf_p so that if some total
1386 * hoser (like flex itself) wants to
1387 * call the scanner after we return the
1388 * YY_NULL, it'll still work - another
1389 * YY_NULL will get returned.
1390 */
1391 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1392
1393 yy_act = YY_STATE_EOF(YY_START);
1394 goto do_action;
1395 }
1396
1397 else
1398 {
1399 if ( ! (yy_did_buffer_switch_on_eof) )
1400 YY_NEW_FILE;
1401 }
1402 break;
1403 }
1404
1405 case EOB_ACT_CONTINUE_SCAN:
1406 (yy_c_buf_p) =
1407 (yytext_ptr) + yy_amount_of_matched_text;
1408
1409 yy_current_state = yy_get_previous_state( );
1410
1411 yy_cp = (yy_c_buf_p);
1412 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1413 goto yy_match;
1414
1415 case EOB_ACT_LAST_MATCH:
1416 (yy_c_buf_p) =
1417 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1418
1419 yy_current_state = yy_get_previous_state( );
1420
1421 yy_cp = (yy_c_buf_p);
1422 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1423 goto yy_find_action;
1424 }
1425 break;
1426 }
1427
1428 default:
1429 YY_FATAL_ERROR(
1430 "fatal flex scanner internal error--no action found" );
1431 } /* end of action switch */
1432 } /* end of scanning one token */
1433} /* end of zconflex */
1434
1435/* yy_get_next_buffer - try to read in a new buffer
1436 *
1437 * Returns a code representing an action:
1438 * EOB_ACT_LAST_MATCH -
1439 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1440 * EOB_ACT_END_OF_FILE - end of file
1441 */
1442static int yy_get_next_buffer (void)
1443{
1444 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1445 register char *source = (yytext_ptr);
1446 register int number_to_move, i;
1447 int ret_val;
1448
1449 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1450 YY_FATAL_ERROR(
1451 "fatal flex scanner internal error--end of buffer missed" );
1452
1453 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1454 { /* Don't try to fill the buffer, so this is an EOF. */
1455 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1456 {
1457 /* We matched a single character, the EOB, so
1458 * treat this as a final EOF.
1459 */
1460 return EOB_ACT_END_OF_FILE;
1461 }
1462
1463 else
1464 {
1465 /* We matched some text prior to the EOB, first
1466 * process it.
1467 */
1468 return EOB_ACT_LAST_MATCH;
1469 }
1470 }
1471
1472 /* Try to read more data. */
1473
1474 /* First move last chars to start of buffer. */
1475 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1476
1477 for ( i = 0; i < number_to_move; ++i )
1478 *(dest++) = *(source++);
1479
1480 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1481 /* don't do the read, it's not guaranteed to return an EOF,
1482 * just force an EOF
1483 */
1484 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1485
1486 else
1487 {
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001488 int num_to_read =
Linus Torvalds1da177e2005-04-16 15:20:36 -07001489 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1490
1491 while ( num_to_read <= 0 )
1492 { /* Not enough room in the buffer - grow it. */
1493
1494 /* just a shorter name for the current buffer */
1495 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1496
1497 int yy_c_buf_p_offset =
1498 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1499
1500 if ( b->yy_is_our_buffer )
1501 {
1502 int new_size = b->yy_buf_size * 2;
1503
1504 if ( new_size <= 0 )
1505 b->yy_buf_size += b->yy_buf_size / 8;
1506 else
1507 b->yy_buf_size *= 2;
1508
1509 b->yy_ch_buf = (char *)
1510 /* Include room in for 2 EOB chars. */
1511 zconfrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1512 }
1513 else
1514 /* Can't grow it, we don't own it. */
1515 b->yy_ch_buf = 0;
1516
1517 if ( ! b->yy_ch_buf )
1518 YY_FATAL_ERROR(
1519 "fatal error - scanner input buffer overflow" );
1520
1521 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1522
1523 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1524 number_to_move - 1;
1525
1526 }
1527
1528 if ( num_to_read > YY_READ_BUF_SIZE )
1529 num_to_read = YY_READ_BUF_SIZE;
1530
1531 /* Read in more data. */
1532 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1533 (yy_n_chars), num_to_read );
1534
1535 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1536 }
1537
1538 if ( (yy_n_chars) == 0 )
1539 {
1540 if ( number_to_move == YY_MORE_ADJ )
1541 {
1542 ret_val = EOB_ACT_END_OF_FILE;
1543 zconfrestart(zconfin );
1544 }
1545
1546 else
1547 {
1548 ret_val = EOB_ACT_LAST_MATCH;
1549 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1550 YY_BUFFER_EOF_PENDING;
1551 }
1552 }
1553
1554 else
1555 ret_val = EOB_ACT_CONTINUE_SCAN;
1556
1557 (yy_n_chars) += number_to_move;
1558 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1559 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1560
1561 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1562
1563 return ret_val;
1564}
1565
1566/* yy_get_previous_state - get the state just before the EOB char was reached */
1567
1568 static yy_state_type yy_get_previous_state (void)
1569{
1570 register yy_state_type yy_current_state;
1571 register char *yy_cp;
1572
1573 yy_current_state = (yy_start);
1574
1575 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1576 {
1577 yy_current_state = yy_nxt[yy_current_state][(*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1)];
1578 }
1579
1580 return yy_current_state;
1581}
1582
1583/* yy_try_NUL_trans - try to make a transition on the NUL character
1584 *
1585 * synopsis
1586 * next_state = yy_try_NUL_trans( current_state );
1587 */
1588 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1589{
1590 register int yy_is_jam;
1591
1592 yy_current_state = yy_nxt[yy_current_state][1];
1593 yy_is_jam = (yy_current_state <= 0);
1594
1595 return yy_is_jam ? 0 : yy_current_state;
1596}
1597
1598 static void yyunput (int c, register char * yy_bp )
1599{
1600 register char *yy_cp;
1601
1602 yy_cp = (yy_c_buf_p);
1603
1604 /* undo effects of setting up zconftext */
1605 *yy_cp = (yy_hold_char);
1606
1607 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1608 { /* need to shift things up to make room */
1609 /* +2 for EOB chars. */
1610 register int number_to_move = (yy_n_chars) + 2;
1611 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1612 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1613 register char *source =
1614 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1615
1616 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1617 *--dest = *--source;
1618
1619 yy_cp += (int) (dest - source);
1620 yy_bp += (int) (dest - source);
1621 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1622 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1623
1624 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1625 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1626 }
1627
1628 *--yy_cp = (char) c;
1629
1630 (yytext_ptr) = yy_bp;
1631 (yy_hold_char) = *yy_cp;
1632 (yy_c_buf_p) = yy_cp;
1633}
1634
1635#ifndef YY_NO_INPUT
1636#ifdef __cplusplus
1637 static int yyinput (void)
1638#else
1639 static int input (void)
1640#endif
1641
1642{
1643 int c;
1644
1645 *(yy_c_buf_p) = (yy_hold_char);
1646
1647 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1648 {
1649 /* yy_c_buf_p now points to the character we want to return.
1650 * If this occurs *before* the EOB characters, then it's a
1651 * valid NUL; if not, then we've hit the end of the buffer.
1652 */
1653 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1654 /* This was really a NUL. */
1655 *(yy_c_buf_p) = '\0';
1656
1657 else
1658 { /* need more input */
1659 int offset = (yy_c_buf_p) - (yytext_ptr);
1660 ++(yy_c_buf_p);
1661
1662 switch ( yy_get_next_buffer( ) )
1663 {
1664 case EOB_ACT_LAST_MATCH:
1665 /* This happens because yy_g_n_b()
1666 * sees that we've accumulated a
1667 * token and flags that we need to
1668 * try matching the token before
1669 * proceeding. But for input(),
1670 * there's no matching to consider.
1671 * So convert the EOB_ACT_LAST_MATCH
1672 * to EOB_ACT_END_OF_FILE.
1673 */
1674
1675 /* Reset buffer status. */
1676 zconfrestart(zconfin );
1677
1678 /*FALLTHROUGH*/
1679
1680 case EOB_ACT_END_OF_FILE:
1681 {
1682 if ( zconfwrap( ) )
1683 return EOF;
1684
1685 if ( ! (yy_did_buffer_switch_on_eof) )
1686 YY_NEW_FILE;
1687#ifdef __cplusplus
1688 return yyinput();
1689#else
1690 return input();
1691#endif
1692 }
1693
1694 case EOB_ACT_CONTINUE_SCAN:
1695 (yy_c_buf_p) = (yytext_ptr) + offset;
1696 break;
1697 }
1698 }
1699 }
1700
1701 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1702 *(yy_c_buf_p) = '\0'; /* preserve zconftext */
1703 (yy_hold_char) = *++(yy_c_buf_p);
1704
1705 return c;
1706}
1707#endif /* ifndef YY_NO_INPUT */
1708
1709/** Immediately switch to a different input stream.
1710 * @param input_file A readable stream.
1711 *
1712 * @note This function does not reset the start condition to @c INITIAL .
1713 */
1714 void zconfrestart (FILE * input_file )
1715{
1716
1717 if ( ! YY_CURRENT_BUFFER ){
1718 zconfensure_buffer_stack ();
1719 YY_CURRENT_BUFFER_LVALUE =
1720 zconf_create_buffer(zconfin,YY_BUF_SIZE );
1721 }
1722
1723 zconf_init_buffer(YY_CURRENT_BUFFER,input_file );
1724 zconf_load_buffer_state( );
1725}
1726
1727/** Switch to a different input buffer.
1728 * @param new_buffer The new input buffer.
1729 *
1730 */
1731 void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1732{
1733
1734 /* TODO. We should be able to replace this entire function body
1735 * with
1736 * zconfpop_buffer_state();
1737 * zconfpush_buffer_state(new_buffer);
1738 */
1739 zconfensure_buffer_stack ();
1740 if ( YY_CURRENT_BUFFER == new_buffer )
1741 return;
1742
1743 if ( YY_CURRENT_BUFFER )
1744 {
1745 /* Flush out information for old buffer. */
1746 *(yy_c_buf_p) = (yy_hold_char);
1747 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1748 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1749 }
1750
1751 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1752 zconf_load_buffer_state( );
1753
1754 /* We don't actually know whether we did this switch during
1755 * EOF (zconfwrap()) processing, but the only time this flag
1756 * is looked at is after zconfwrap() is called, so it's safe
1757 * to go ahead and always set it.
1758 */
1759 (yy_did_buffer_switch_on_eof) = 1;
1760}
1761
1762static void zconf_load_buffer_state (void)
1763{
1764 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1765 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1766 zconfin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1767 (yy_hold_char) = *(yy_c_buf_p);
1768}
1769
1770/** Allocate and initialize an input buffer state.
1771 * @param file A readable stream.
1772 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1773 *
1774 * @return the allocated buffer state.
1775 */
1776 YY_BUFFER_STATE zconf_create_buffer (FILE * file, int size )
1777{
1778 YY_BUFFER_STATE b;
1779
1780 b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state ) );
1781 if ( ! b )
1782 YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" );
1783
1784 b->yy_buf_size = size;
1785
1786 /* yy_ch_buf has to be 2 characters longer than the size given because
1787 * we need to put in 2 end-of-buffer characters.
1788 */
1789 b->yy_ch_buf = (char *) zconfalloc(b->yy_buf_size + 2 );
1790 if ( ! b->yy_ch_buf )
1791 YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" );
1792
1793 b->yy_is_our_buffer = 1;
1794
1795 zconf_init_buffer(b,file );
1796
1797 return b;
1798}
1799
1800/** Destroy the buffer.
1801 * @param b a buffer created with zconf_create_buffer()
1802 *
1803 */
1804 void zconf_delete_buffer (YY_BUFFER_STATE b )
1805{
1806
1807 if ( ! b )
1808 return;
1809
1810 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1811 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1812
1813 if ( b->yy_is_our_buffer )
1814 zconffree((void *) b->yy_ch_buf );
1815
1816 zconffree((void *) b );
1817}
1818
1819/* Initializes or reinitializes a buffer.
1820 * This function is sometimes called more than once on the same buffer,
1821 * such as during a zconfrestart() or at EOF.
1822 */
1823 static void zconf_init_buffer (YY_BUFFER_STATE b, FILE * file )
1824
1825{
1826 int oerrno = errno;
1827
1828 zconf_flush_buffer(b );
1829
1830 b->yy_input_file = file;
1831 b->yy_fill_buffer = 1;
1832
1833 /* If b is the current buffer, then zconf_init_buffer was _probably_
1834 * called from zconfrestart() or through yy_get_next_buffer.
1835 * In that case, we don't want to reset the lineno or column.
1836 */
1837 if (b != YY_CURRENT_BUFFER){
1838 b->yy_bs_lineno = 1;
1839 b->yy_bs_column = 0;
1840 }
1841
1842 b->yy_is_interactive = 0;
1843
1844 errno = oerrno;
1845}
1846
1847/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1848 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1849 *
1850 */
1851 void zconf_flush_buffer (YY_BUFFER_STATE b )
1852{
1853 if ( ! b )
1854 return;
1855
1856 b->yy_n_chars = 0;
1857
1858 /* We always need two end-of-buffer characters. The first causes
1859 * a transition to the end-of-buffer state. The second causes
1860 * a jam in that state.
1861 */
1862 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1863 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1864
1865 b->yy_buf_pos = &b->yy_ch_buf[0];
1866
1867 b->yy_at_bol = 1;
1868 b->yy_buffer_status = YY_BUFFER_NEW;
1869
1870 if ( b == YY_CURRENT_BUFFER )
1871 zconf_load_buffer_state( );
1872}
1873
1874/** Pushes the new state onto the stack. The new state becomes
1875 * the current state. This function will allocate the stack
1876 * if necessary.
1877 * @param new_buffer The new state.
1878 *
1879 */
1880void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
1881{
1882 if (new_buffer == NULL)
1883 return;
1884
1885 zconfensure_buffer_stack();
1886
1887 /* This block is copied from zconf_switch_to_buffer. */
1888 if ( YY_CURRENT_BUFFER )
1889 {
1890 /* Flush out information for old buffer. */
1891 *(yy_c_buf_p) = (yy_hold_char);
1892 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1893 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1894 }
1895
1896 /* Only push if top exists. Otherwise, replace top. */
1897 if (YY_CURRENT_BUFFER)
1898 (yy_buffer_stack_top)++;
1899 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1900
1901 /* copied from zconf_switch_to_buffer. */
1902 zconf_load_buffer_state( );
1903 (yy_did_buffer_switch_on_eof) = 1;
1904}
1905
1906/** Removes and deletes the top of the stack, if present.
1907 * The next element becomes the new top.
1908 *
1909 */
1910void zconfpop_buffer_state (void)
1911{
1912 if (!YY_CURRENT_BUFFER)
1913 return;
1914
1915 zconf_delete_buffer(YY_CURRENT_BUFFER );
1916 YY_CURRENT_BUFFER_LVALUE = NULL;
1917 if ((yy_buffer_stack_top) > 0)
1918 --(yy_buffer_stack_top);
1919
1920 if (YY_CURRENT_BUFFER) {
1921 zconf_load_buffer_state( );
1922 (yy_did_buffer_switch_on_eof) = 1;
1923 }
1924}
1925
1926/* Allocates the stack if it does not exist.
1927 * Guarantees space for at least one push.
1928 */
1929static void zconfensure_buffer_stack (void)
1930{
1931 int num_to_alloc;
1932
1933 if (!(yy_buffer_stack)) {
1934
1935 /* First allocation is just for 2 elements, since we don't know if this
1936 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1937 * immediate realloc on the next call.
1938 */
1939 num_to_alloc = 1;
1940 (yy_buffer_stack) = (struct yy_buffer_state**)zconfalloc
1941 (num_to_alloc * sizeof(struct yy_buffer_state*)
1942 );
1943
1944 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1945
1946 (yy_buffer_stack_max) = num_to_alloc;
1947 (yy_buffer_stack_top) = 0;
1948 return;
1949 }
1950
1951 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1952
1953 /* Increase the buffer to prepare for a possible push. */
1954 int grow_size = 8 /* arbitrary grow size */;
1955
1956 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1957 (yy_buffer_stack) = (struct yy_buffer_state**)zconfrealloc
1958 ((yy_buffer_stack),
1959 num_to_alloc * sizeof(struct yy_buffer_state*)
1960 );
1961
1962 /* zero only the new slots.*/
1963 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1964 (yy_buffer_stack_max) = num_to_alloc;
1965 }
1966}
1967
1968/** Setup the input buffer state to scan directly from a user-specified character buffer.
1969 * @param base the character buffer
1970 * @param size the size in bytes of the character buffer
1971 *
1972 * @return the newly allocated buffer state object.
1973 */
1974YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size )
1975{
1976 YY_BUFFER_STATE b;
1977
1978 if ( size < 2 ||
1979 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1980 base[size-1] != YY_END_OF_BUFFER_CHAR )
1981 /* They forgot to leave room for the EOB's. */
1982 return 0;
1983
1984 b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state ) );
1985 if ( ! b )
1986 YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_buffer()" );
1987
1988 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1989 b->yy_buf_pos = b->yy_ch_buf = base;
1990 b->yy_is_our_buffer = 0;
1991 b->yy_input_file = 0;
1992 b->yy_n_chars = b->yy_buf_size;
1993 b->yy_is_interactive = 0;
1994 b->yy_at_bol = 1;
1995 b->yy_fill_buffer = 0;
1996 b->yy_buffer_status = YY_BUFFER_NEW;
1997
1998 zconf_switch_to_buffer(b );
1999
2000 return b;
2001}
2002
2003/** Setup the input buffer state to scan a string. The next call to zconflex() will
2004 * scan from a @e copy of @a str.
Sam Ravnborg14f31562007-09-26 20:15:39 +02002005 * @param str a NUL-terminated string to scan
Linus Torvalds1da177e2005-04-16 15:20:36 -07002006 *
2007 * @return the newly allocated buffer state object.
2008 * @note If you want to scan bytes that may contain NUL values, then use
2009 * zconf_scan_bytes() instead.
2010 */
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002011YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr )
Linus Torvalds1da177e2005-04-16 15:20:36 -07002012{
2013
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002014 return zconf_scan_bytes(yystr,strlen(yystr) );
Linus Torvalds1da177e2005-04-16 15:20:36 -07002015}
2016
2017/** Setup the input buffer state to scan the given bytes. The next call to zconflex() will
2018 * scan from a @e copy of @a bytes.
2019 * @param bytes the byte buffer to scan
2020 * @param len the number of bytes in the buffer pointed to by @a bytes.
2021 *
2022 * @return the newly allocated buffer state object.
2023 */
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002024YY_BUFFER_STATE zconf_scan_bytes (yyconst char * yybytes, int _yybytes_len )
Linus Torvalds1da177e2005-04-16 15:20:36 -07002025{
2026 YY_BUFFER_STATE b;
2027 char *buf;
2028 yy_size_t n;
2029 int i;
2030
2031 /* Get memory for full buffer, including space for trailing EOB's. */
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002032 n = _yybytes_len + 2;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002033 buf = (char *) zconfalloc(n );
2034 if ( ! buf )
2035 YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_bytes()" );
2036
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002037 for ( i = 0; i < _yybytes_len; ++i )
2038 buf[i] = yybytes[i];
Linus Torvalds1da177e2005-04-16 15:20:36 -07002039
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002040 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002041
2042 b = zconf_scan_buffer(buf,n );
2043 if ( ! b )
2044 YY_FATAL_ERROR( "bad buffer in zconf_scan_bytes()" );
2045
2046 /* It's okay to grow etc. this buffer, and we should throw it
2047 * away when we're done.
2048 */
2049 b->yy_is_our_buffer = 1;
2050
2051 return b;
2052}
2053
2054#ifndef YY_EXIT_FAILURE
2055#define YY_EXIT_FAILURE 2
2056#endif
2057
2058static void yy_fatal_error (yyconst char* msg )
2059{
2060 (void) fprintf( stderr, "%s\n", msg );
2061 exit( YY_EXIT_FAILURE );
2062}
2063
2064/* Redefine yyless() so it works in section 3 code. */
2065
2066#undef yyless
2067#define yyless(n) \
2068 do \
2069 { \
2070 /* Undo effects of setting up zconftext. */ \
2071 int yyless_macro_arg = (n); \
2072 YY_LESS_LINENO(yyless_macro_arg);\
2073 zconftext[zconfleng] = (yy_hold_char); \
2074 (yy_c_buf_p) = zconftext + yyless_macro_arg; \
2075 (yy_hold_char) = *(yy_c_buf_p); \
2076 *(yy_c_buf_p) = '\0'; \
2077 zconfleng = yyless_macro_arg; \
2078 } \
2079 while ( 0 )
2080
2081/* Accessor methods (get/set functions) to struct members. */
2082
2083/** Get the current line number.
2084 *
2085 */
2086int zconfget_lineno (void)
2087{
2088
2089 return zconflineno;
2090}
2091
2092/** Get the input stream.
2093 *
2094 */
2095FILE *zconfget_in (void)
2096{
2097 return zconfin;
2098}
2099
2100/** Get the output stream.
2101 *
2102 */
2103FILE *zconfget_out (void)
2104{
2105 return zconfout;
2106}
2107
2108/** Get the length of the current token.
2109 *
2110 */
2111int zconfget_leng (void)
2112{
2113 return zconfleng;
2114}
2115
2116/** Get the current token.
2117 *
2118 */
2119
2120char *zconfget_text (void)
2121{
2122 return zconftext;
2123}
2124
2125/** Set the current line number.
2126 * @param line_number
2127 *
2128 */
2129void zconfset_lineno (int line_number )
2130{
2131
2132 zconflineno = line_number;
2133}
2134
2135/** Set the input stream. This does not discard the current
2136 * input buffer.
2137 * @param in_str A readable stream.
2138 *
2139 * @see zconf_switch_to_buffer
2140 */
2141void zconfset_in (FILE * in_str )
2142{
2143 zconfin = in_str ;
2144}
2145
2146void zconfset_out (FILE * out_str )
2147{
2148 zconfout = out_str ;
2149}
2150
2151int zconfget_debug (void)
2152{
2153 return zconf_flex_debug;
2154}
2155
2156void zconfset_debug (int bdebug )
2157{
2158 zconf_flex_debug = bdebug ;
2159}
2160
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002161static int yy_init_globals (void)
2162{
2163 /* Initialization is the same as for the non-reentrant scanner.
2164 * This function is called from zconflex_destroy(), so don't allocate here.
2165 */
2166
2167 (yy_buffer_stack) = 0;
2168 (yy_buffer_stack_top) = 0;
2169 (yy_buffer_stack_max) = 0;
2170 (yy_c_buf_p) = (char *) 0;
2171 (yy_init) = 0;
2172 (yy_start) = 0;
2173
2174/* Defined in main.c */
2175#ifdef YY_STDINIT
2176 zconfin = stdin;
2177 zconfout = stdout;
2178#else
2179 zconfin = (FILE *) 0;
2180 zconfout = (FILE *) 0;
2181#endif
2182
2183 /* For future reference: Set errno on error, since we are called by
2184 * zconflex_init()
2185 */
2186 return 0;
2187}
2188
Linus Torvalds1da177e2005-04-16 15:20:36 -07002189/* zconflex_destroy is for both reentrant and non-reentrant scanners. */
2190int zconflex_destroy (void)
2191{
2192
2193 /* Pop the buffer stack, destroying each element. */
2194 while(YY_CURRENT_BUFFER){
2195 zconf_delete_buffer(YY_CURRENT_BUFFER );
2196 YY_CURRENT_BUFFER_LVALUE = NULL;
2197 zconfpop_buffer_state();
2198 }
2199
2200 /* Destroy the stack itself. */
2201 zconffree((yy_buffer_stack) );
2202 (yy_buffer_stack) = NULL;
2203
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002204 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2205 * zconflex() is called, initialization will occur. */
2206 yy_init_globals( );
2207
Linus Torvalds1da177e2005-04-16 15:20:36 -07002208 return 0;
2209}
2210
2211/*
2212 * Internal utility routines.
2213 */
2214
2215#ifndef yytext_ptr
2216static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2217{
2218 register int i;
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002219 for ( i = 0; i < n; ++i )
Linus Torvalds1da177e2005-04-16 15:20:36 -07002220 s1[i] = s2[i];
2221}
2222#endif
2223
2224#ifdef YY_NEED_STRLEN
2225static int yy_flex_strlen (yyconst char * s )
2226{
2227 register int n;
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002228 for ( n = 0; s[n]; ++n )
Linus Torvalds1da177e2005-04-16 15:20:36 -07002229 ;
2230
2231 return n;
2232}
2233#endif
2234
2235void *zconfalloc (yy_size_t size )
2236{
2237 return (void *) malloc( size );
2238}
2239
2240void *zconfrealloc (void * ptr, yy_size_t size )
2241{
2242 /* The cast to (char *) in the following accommodates both
2243 * implementations that use char* generic pointers, and those
2244 * that use void* generic pointers. It works with the latter
2245 * because both ANSI C and C++ allow castless assignment from
2246 * any pointer type to void*, and deal with argument conversions
2247 * as though doing an assignment.
2248 */
2249 return (void *) realloc( (char *) ptr, size );
2250}
2251
2252void zconffree (void * ptr )
2253{
2254 free( (char *) ptr ); /* see zconfrealloc() for (char *) cast */
2255}
2256
2257#define YYTABLES_NAME "yytables"
2258
Linus Torvalds1da177e2005-04-16 15:20:36 -07002259void zconf_starthelp(void)
2260{
2261 new_string();
2262 last_ts = first_ts = 0;
2263 BEGIN(HELP);
2264}
2265
2266static void zconf_endhelp(void)
2267{
2268 zconflval.string = text;
2269 BEGIN(INITIAL);
2270}
2271
2272/*
2273 * Try to open specified file with following names:
2274 * ./name
2275 * $(srctree)/name
2276 * The latter is used when srctree is separate from objtree
2277 * when compiling the kernel.
2278 * Return NULL if file is not found.
2279 */
2280FILE *zconf_fopen(const char *name)
2281{
2282 char *env, fullname[PATH_MAX+1];
2283 FILE *f;
2284
2285 f = fopen(name, "r");
Marcin Garski11de39e2007-05-05 22:49:00 +02002286 if (!f && name != NULL && name[0] != '/') {
Linus Torvalds1da177e2005-04-16 15:20:36 -07002287 env = getenv(SRCTREE);
2288 if (env) {
2289 sprintf(fullname, "%s/%s", env, name);
2290 f = fopen(fullname, "r");
2291 }
2292 }
2293 return f;
2294}
2295
2296void zconf_initscan(const char *name)
2297{
2298 zconfin = zconf_fopen(name);
2299 if (!zconfin) {
2300 printf("can't find file %s\n", name);
2301 exit(1);
2302 }
2303
2304 current_buf = malloc(sizeof(*current_buf));
2305 memset(current_buf, 0, sizeof(*current_buf));
2306
2307 current_file = file_lookup(name);
2308 current_file->lineno = 1;
2309 current_file->flags = FILE_BUSY;
2310}
2311
2312void zconf_nextfile(const char *name)
2313{
2314 struct file *file = file_lookup(name);
2315 struct buffer *buf = malloc(sizeof(*buf));
2316 memset(buf, 0, sizeof(*buf));
2317
2318 current_buf->state = YY_CURRENT_BUFFER;
2319 zconfin = zconf_fopen(name);
2320 if (!zconfin) {
2321 printf("%s:%d: can't open file \"%s\"\n", zconf_curname(), zconf_lineno(), name);
2322 exit(1);
2323 }
2324 zconf_switch_to_buffer(zconf_create_buffer(zconfin,YY_BUF_SIZE));
2325 buf->parent = current_buf;
2326 current_buf = buf;
2327
2328 if (file->flags & FILE_BUSY) {
2329 printf("recursive scan (%s)?\n", name);
2330 exit(1);
2331 }
2332 if (file->flags & FILE_SCANNED) {
2333 printf("file %s already scanned?\n", name);
2334 exit(1);
2335 }
2336 file->flags |= FILE_BUSY;
2337 file->lineno = 1;
2338 file->parent = current_file;
2339 current_file = file;
2340}
2341
Roman Zippela02f0572005-11-08 21:34:53 -08002342static void zconf_endfile(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002343{
2344 struct buffer *parent;
2345
2346 current_file->flags |= FILE_SCANNED;
2347 current_file->flags &= ~FILE_BUSY;
2348 current_file = current_file->parent;
2349
2350 parent = current_buf->parent;
2351 if (parent) {
2352 fclose(zconfin);
2353 zconf_delete_buffer(YY_CURRENT_BUFFER);
2354 zconf_switch_to_buffer(parent->state);
2355 }
2356 free(current_buf);
2357 current_buf = parent;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002358}
2359
2360int zconf_lineno(void)
2361{
Roman Zippela02f0572005-11-08 21:34:53 -08002362 return current_pos.lineno;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002363}
2364
2365char *zconf_curname(void)
2366{
Roman Zippela02f0572005-11-08 21:34:53 -08002367 return current_pos.file ? current_pos.file->name : "<none>";
Linus Torvalds1da177e2005-04-16 15:20:36 -07002368}
2369