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