1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/kconfig/lex.zconf.c_shipped Sat Jul 19 12:25:46 2008 +0000
1.3 @@ -0,0 +1,2350 @@
1.4 +
1.5 +#line 3 "scripts/kconfig/lex.zconf.c"
1.6 +
1.7 +#define YY_INT_ALIGNED short int
1.8 +
1.9 +/* A lexical scanner generated by flex */
1.10 +
1.11 +#define FLEX_SCANNER
1.12 +#define YY_FLEX_MAJOR_VERSION 2
1.13 +#define YY_FLEX_MINOR_VERSION 5
1.14 +#define YY_FLEX_SUBMINOR_VERSION 33
1.15 +#if YY_FLEX_SUBMINOR_VERSION > 0
1.16 +#define FLEX_BETA
1.17 +#endif
1.18 +
1.19 +/* First, we deal with platform-specific or compiler-specific issues. */
1.20 +
1.21 +/* begin standard C headers. */
1.22 +#include <stdio.h>
1.23 +#include <string.h>
1.24 +#include <errno.h>
1.25 +#include <stdlib.h>
1.26 +
1.27 +/* end standard C headers. */
1.28 +
1.29 +/* flex integer type definitions */
1.30 +
1.31 +#ifndef FLEXINT_H
1.32 +#define FLEXINT_H
1.33 +
1.34 +/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
1.35 +
1.36 +#if __STDC_VERSION__ >= 199901L
1.37 +
1.38 +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
1.39 + * if you want the limit (max/min) macros for int types.
1.40 + */
1.41 +#ifndef __STDC_LIMIT_MACROS
1.42 +#define __STDC_LIMIT_MACROS 1
1.43 +#endif
1.44 +
1.45 +#include <inttypes.h>
1.46 +typedef int8_t flex_int8_t;
1.47 +typedef uint8_t flex_uint8_t;
1.48 +typedef int16_t flex_int16_t;
1.49 +typedef uint16_t flex_uint16_t;
1.50 +typedef int32_t flex_int32_t;
1.51 +typedef uint32_t flex_uint32_t;
1.52 +#else
1.53 +typedef signed char flex_int8_t;
1.54 +typedef short int flex_int16_t;
1.55 +typedef int flex_int32_t;
1.56 +typedef unsigned char flex_uint8_t;
1.57 +typedef unsigned short int flex_uint16_t;
1.58 +typedef unsigned int flex_uint32_t;
1.59 +#endif /* ! C99 */
1.60 +
1.61 +/* Limits of integral types. */
1.62 +#ifndef INT8_MIN
1.63 +#define INT8_MIN (-128)
1.64 +#endif
1.65 +#ifndef INT16_MIN
1.66 +#define INT16_MIN (-32767-1)
1.67 +#endif
1.68 +#ifndef INT32_MIN
1.69 +#define INT32_MIN (-2147483647-1)
1.70 +#endif
1.71 +#ifndef INT8_MAX
1.72 +#define INT8_MAX (127)
1.73 +#endif
1.74 +#ifndef INT16_MAX
1.75 +#define INT16_MAX (32767)
1.76 +#endif
1.77 +#ifndef INT32_MAX
1.78 +#define INT32_MAX (2147483647)
1.79 +#endif
1.80 +#ifndef UINT8_MAX
1.81 +#define UINT8_MAX (255U)
1.82 +#endif
1.83 +#ifndef UINT16_MAX
1.84 +#define UINT16_MAX (65535U)
1.85 +#endif
1.86 +#ifndef UINT32_MAX
1.87 +#define UINT32_MAX (4294967295U)
1.88 +#endif
1.89 +
1.90 +#endif /* ! FLEXINT_H */
1.91 +
1.92 +#ifdef __cplusplus
1.93 +
1.94 +/* The "const" storage-class-modifier is valid. */
1.95 +#define YY_USE_CONST
1.96 +
1.97 +#else /* ! __cplusplus */
1.98 +
1.99 +#if __STDC__
1.100 +
1.101 +#define YY_USE_CONST
1.102 +
1.103 +#endif /* __STDC__ */
1.104 +#endif /* ! __cplusplus */
1.105 +
1.106 +#ifdef YY_USE_CONST
1.107 +#define yyconst const
1.108 +#else
1.109 +#define yyconst
1.110 +#endif
1.111 +
1.112 +/* Returned upon end-of-file. */
1.113 +#define YY_NULL 0
1.114 +
1.115 +/* Promotes a possibly negative, possibly signed char to an unsigned
1.116 + * integer for use as an array index. If the signed char is negative,
1.117 + * we want to instead treat it as an 8-bit unsigned char, hence the
1.118 + * double cast.
1.119 + */
1.120 +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
1.121 +
1.122 +/* Enter a start condition. This macro really ought to take a parameter,
1.123 + * but we do it the disgusting crufty way forced on us by the ()-less
1.124 + * definition of BEGIN.
1.125 + */
1.126 +#define BEGIN (yy_start) = 1 + 2 *
1.127 +
1.128 +/* Translate the current start state into a value that can be later handed
1.129 + * to BEGIN to return to the state. The YYSTATE alias is for lex
1.130 + * compatibility.
1.131 + */
1.132 +#define YY_START (((yy_start) - 1) / 2)
1.133 +#define YYSTATE YY_START
1.134 +
1.135 +/* Action number for EOF rule of a given start state. */
1.136 +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
1.137 +
1.138 +/* Special action meaning "start processing a new file". */
1.139 +#define YY_NEW_FILE zconfrestart(zconfin )
1.140 +
1.141 +#define YY_END_OF_BUFFER_CHAR 0
1.142 +
1.143 +/* Size of default input buffer. */
1.144 +#ifndef YY_BUF_SIZE
1.145 +#define YY_BUF_SIZE 16384
1.146 +#endif
1.147 +
1.148 +/* The state buf must be large enough to hold one state per character in the main buffer.
1.149 + */
1.150 +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
1.151 +
1.152 +#ifndef YY_TYPEDEF_YY_BUFFER_STATE
1.153 +#define YY_TYPEDEF_YY_BUFFER_STATE
1.154 +typedef struct yy_buffer_state *YY_BUFFER_STATE;
1.155 +#endif
1.156 +
1.157 +extern int zconfleng;
1.158 +
1.159 +extern FILE *zconfin, *zconfout;
1.160 +
1.161 +#define EOB_ACT_CONTINUE_SCAN 0
1.162 +#define EOB_ACT_END_OF_FILE 1
1.163 +#define EOB_ACT_LAST_MATCH 2
1.164 +
1.165 + #define YY_LESS_LINENO(n)
1.166 +
1.167 +/* Return all but the first "n" matched characters back to the input stream. */
1.168 +#define yyless(n) \
1.169 + do \
1.170 + { \
1.171 + /* Undo effects of setting up zconftext. */ \
1.172 + int yyless_macro_arg = (n); \
1.173 + YY_LESS_LINENO(yyless_macro_arg);\
1.174 + *yy_cp = (yy_hold_char); \
1.175 + YY_RESTORE_YY_MORE_OFFSET \
1.176 + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
1.177 + YY_DO_BEFORE_ACTION; /* set up zconftext again */ \
1.178 + } \
1.179 + while ( 0 )
1.180 +
1.181 +#define unput(c) yyunput( c, (yytext_ptr) )
1.182 +
1.183 +/* The following is because we cannot portably get our hands on size_t
1.184 + * (without autoconf's help, which isn't available because we want
1.185 + * flex-generated scanners to compile on their own).
1.186 + */
1.187 +
1.188 +#ifndef YY_TYPEDEF_YY_SIZE_T
1.189 +#define YY_TYPEDEF_YY_SIZE_T
1.190 +typedef unsigned int yy_size_t;
1.191 +#endif
1.192 +
1.193 +#ifndef YY_STRUCT_YY_BUFFER_STATE
1.194 +#define YY_STRUCT_YY_BUFFER_STATE
1.195 +struct yy_buffer_state
1.196 + {
1.197 + FILE *yy_input_file;
1.198 +
1.199 + char *yy_ch_buf; /* input buffer */
1.200 + char *yy_buf_pos; /* current position in input buffer */
1.201 +
1.202 + /* Size of input buffer in bytes, not including room for EOB
1.203 + * characters.
1.204 + */
1.205 + yy_size_t yy_buf_size;
1.206 +
1.207 + /* Number of characters read into yy_ch_buf, not including EOB
1.208 + * characters.
1.209 + */
1.210 + int yy_n_chars;
1.211 +
1.212 + /* Whether we "own" the buffer - i.e., we know we created it,
1.213 + * and can realloc() it to grow it, and should free() it to
1.214 + * delete it.
1.215 + */
1.216 + int yy_is_our_buffer;
1.217 +
1.218 + /* Whether this is an "interactive" input source; if so, and
1.219 + * if we're using stdio for input, then we want to use getc()
1.220 + * instead of fread(), to make sure we stop fetching input after
1.221 + * each newline.
1.222 + */
1.223 + int yy_is_interactive;
1.224 +
1.225 + /* Whether we're considered to be at the beginning of a line.
1.226 + * If so, '^' rules will be active on the next match, otherwise
1.227 + * not.
1.228 + */
1.229 + int yy_at_bol;
1.230 +
1.231 + int yy_bs_lineno; /**< The line count. */
1.232 + int yy_bs_column; /**< The column count. */
1.233 +
1.234 + /* Whether to try to fill the input buffer when we reach the
1.235 + * end of it.
1.236 + */
1.237 + int yy_fill_buffer;
1.238 +
1.239 + int yy_buffer_status;
1.240 +
1.241 +#define YY_BUFFER_NEW 0
1.242 +#define YY_BUFFER_NORMAL 1
1.243 + /* When an EOF's been seen but there's still some text to process
1.244 + * then we mark the buffer as YY_EOF_PENDING, to indicate that we
1.245 + * shouldn't try reading from the input source any more. We might
1.246 + * still have a bunch of tokens to match, though, because of
1.247 + * possible backing-up.
1.248 + *
1.249 + * When we actually see the EOF, we change the status to "new"
1.250 + * (via zconfrestart()), so that the user can continue scanning by
1.251 + * just pointing zconfin at a new input file.
1.252 + */
1.253 +#define YY_BUFFER_EOF_PENDING 2
1.254 +
1.255 + };
1.256 +#endif /* !YY_STRUCT_YY_BUFFER_STATE */
1.257 +
1.258 +/* Stack of input buffers. */
1.259 +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
1.260 +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
1.261 +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
1.262 +
1.263 +/* We provide macros for accessing buffer states in case in the
1.264 + * future we want to put the buffer states in a more general
1.265 + * "scanner state".
1.266 + *
1.267 + * Returns the top of the stack, or NULL.
1.268 + */
1.269 +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
1.270 + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
1.271 + : NULL)
1.272 +
1.273 +/* Same as previous macro, but useful when we know that the buffer stack is not
1.274 + * NULL or when we need an lvalue. For internal use only.
1.275 + */
1.276 +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
1.277 +
1.278 +/* yy_hold_char holds the character lost when zconftext is formed. */
1.279 +static char yy_hold_char;
1.280 +static int yy_n_chars; /* number of characters read into yy_ch_buf */
1.281 +int zconfleng;
1.282 +
1.283 +/* Points to current character in buffer. */
1.284 +static char *yy_c_buf_p = (char *) 0;
1.285 +static int yy_init = 0; /* whether we need to initialize */
1.286 +static int yy_start = 0; /* start state number */
1.287 +
1.288 +/* Flag which is used to allow zconfwrap()'s to do buffer switches
1.289 + * instead of setting up a fresh zconfin. A bit of a hack ...
1.290 + */
1.291 +static int yy_did_buffer_switch_on_eof;
1.292 +
1.293 +void zconfrestart (FILE *input_file );
1.294 +void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer );
1.295 +YY_BUFFER_STATE zconf_create_buffer (FILE *file,int size );
1.296 +void zconf_delete_buffer (YY_BUFFER_STATE b );
1.297 +void zconf_flush_buffer (YY_BUFFER_STATE b );
1.298 +void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer );
1.299 +void zconfpop_buffer_state (void );
1.300 +
1.301 +static void zconfensure_buffer_stack (void );
1.302 +static void zconf_load_buffer_state (void );
1.303 +static void zconf_init_buffer (YY_BUFFER_STATE b,FILE *file );
1.304 +
1.305 +#define YY_FLUSH_BUFFER zconf_flush_buffer(YY_CURRENT_BUFFER )
1.306 +
1.307 +YY_BUFFER_STATE zconf_scan_buffer (char *base,yy_size_t size );
1.308 +YY_BUFFER_STATE zconf_scan_string (yyconst char *yy_str );
1.309 +YY_BUFFER_STATE zconf_scan_bytes (yyconst char *bytes,int len );
1.310 +
1.311 +void *zconfalloc (yy_size_t );
1.312 +void *zconfrealloc (void *,yy_size_t );
1.313 +void zconffree (void * );
1.314 +
1.315 +#define yy_new_buffer zconf_create_buffer
1.316 +
1.317 +#define yy_set_interactive(is_interactive) \
1.318 + { \
1.319 + if ( ! YY_CURRENT_BUFFER ){ \
1.320 + zconfensure_buffer_stack (); \
1.321 + YY_CURRENT_BUFFER_LVALUE = \
1.322 + zconf_create_buffer(zconfin,YY_BUF_SIZE ); \
1.323 + } \
1.324 + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
1.325 + }
1.326 +
1.327 +#define yy_set_bol(at_bol) \
1.328 + { \
1.329 + if ( ! YY_CURRENT_BUFFER ){\
1.330 + zconfensure_buffer_stack (); \
1.331 + YY_CURRENT_BUFFER_LVALUE = \
1.332 + zconf_create_buffer(zconfin,YY_BUF_SIZE ); \
1.333 + } \
1.334 + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
1.335 + }
1.336 +
1.337 +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
1.338 +
1.339 +/* Begin user sect3 */
1.340 +
1.341 +#define zconfwrap() 1
1.342 +#define YY_SKIP_YYWRAP
1.343 +
1.344 +typedef unsigned char YY_CHAR;
1.345 +
1.346 +FILE *zconfin = (FILE *) 0, *zconfout = (FILE *) 0;
1.347 +
1.348 +typedef int yy_state_type;
1.349 +
1.350 +extern int zconflineno;
1.351 +
1.352 +int zconflineno = 1;
1.353 +
1.354 +extern char *zconftext;
1.355 +#define yytext_ptr zconftext
1.356 +static yyconst flex_int16_t yy_nxt[][17] =
1.357 + {
1.358 + {
1.359 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1.360 + 0, 0, 0, 0, 0, 0, 0
1.361 + },
1.362 +
1.363 + {
1.364 + 11, 12, 13, 14, 12, 12, 15, 12, 12, 12,
1.365 + 12, 12, 12, 12, 12, 12, 12
1.366 + },
1.367 +
1.368 + {
1.369 + 11, 12, 13, 14, 12, 12, 15, 12, 12, 12,
1.370 + 12, 12, 12, 12, 12, 12, 12
1.371 + },
1.372 +
1.373 + {
1.374 + 11, 16, 16, 17, 16, 16, 16, 16, 16, 16,
1.375 + 16, 16, 16, 18, 16, 16, 16
1.376 + },
1.377 +
1.378 + {
1.379 + 11, 16, 16, 17, 16, 16, 16, 16, 16, 16,
1.380 + 16, 16, 16, 18, 16, 16, 16
1.381 +
1.382 + },
1.383 +
1.384 + {
1.385 + 11, 19, 20, 21, 19, 19, 19, 19, 19, 19,
1.386 + 19, 19, 19, 19, 19, 19, 19
1.387 + },
1.388 +
1.389 + {
1.390 + 11, 19, 20, 21, 19, 19, 19, 19, 19, 19,
1.391 + 19, 19, 19, 19, 19, 19, 19
1.392 + },
1.393 +
1.394 + {
1.395 + 11, 22, 22, 23, 22, 24, 22, 22, 24, 22,
1.396 + 22, 22, 22, 22, 22, 25, 22
1.397 + },
1.398 +
1.399 + {
1.400 + 11, 22, 22, 23, 22, 24, 22, 22, 24, 22,
1.401 + 22, 22, 22, 22, 22, 25, 22
1.402 + },
1.403 +
1.404 + {
1.405 + 11, 26, 26, 27, 28, 29, 30, 31, 29, 32,
1.406 + 33, 34, 35, 35, 36, 37, 38
1.407 +
1.408 + },
1.409 +
1.410 + {
1.411 + 11, 26, 26, 27, 28, 29, 30, 31, 29, 32,
1.412 + 33, 34, 35, 35, 36, 37, 38
1.413 + },
1.414 +
1.415 + {
1.416 + -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
1.417 + -11, -11, -11, -11, -11, -11, -11
1.418 + },
1.419 +
1.420 + {
1.421 + 11, -12, -12, -12, -12, -12, -12, -12, -12, -12,
1.422 + -12, -12, -12, -12, -12, -12, -12
1.423 + },
1.424 +
1.425 + {
1.426 + 11, -13, 39, 40, -13, -13, 41, -13, -13, -13,
1.427 + -13, -13, -13, -13, -13, -13, -13
1.428 + },
1.429 +
1.430 + {
1.431 + 11, -14, -14, -14, -14, -14, -14, -14, -14, -14,
1.432 + -14, -14, -14, -14, -14, -14, -14
1.433 +
1.434 + },
1.435 +
1.436 + {
1.437 + 11, 42, 42, 43, 42, 42, 42, 42, 42, 42,
1.438 + 42, 42, 42, 42, 42, 42, 42
1.439 + },
1.440 +
1.441 + {
1.442 + 11, -16, -16, -16, -16, -16, -16, -16, -16, -16,
1.443 + -16, -16, -16, -16, -16, -16, -16
1.444 + },
1.445 +
1.446 + {
1.447 + 11, -17, -17, -17, -17, -17, -17, -17, -17, -17,
1.448 + -17, -17, -17, -17, -17, -17, -17
1.449 + },
1.450 +
1.451 + {
1.452 + 11, -18, -18, -18, -18, -18, -18, -18, -18, -18,
1.453 + -18, -18, -18, 44, -18, -18, -18
1.454 + },
1.455 +
1.456 + {
1.457 + 11, 45, 45, -19, 45, 45, 45, 45, 45, 45,
1.458 + 45, 45, 45, 45, 45, 45, 45
1.459 +
1.460 + },
1.461 +
1.462 + {
1.463 + 11, -20, 46, 47, -20, -20, -20, -20, -20, -20,
1.464 + -20, -20, -20, -20, -20, -20, -20
1.465 + },
1.466 +
1.467 + {
1.468 + 11, 48, -21, -21, 48, 48, 48, 48, 48, 48,
1.469 + 48, 48, 48, 48, 48, 48, 48
1.470 + },
1.471 +
1.472 + {
1.473 + 11, 49, 49, 50, 49, -22, 49, 49, -22, 49,
1.474 + 49, 49, 49, 49, 49, -22, 49
1.475 + },
1.476 +
1.477 + {
1.478 + 11, -23, -23, -23, -23, -23, -23, -23, -23, -23,
1.479 + -23, -23, -23, -23, -23, -23, -23
1.480 + },
1.481 +
1.482 + {
1.483 + 11, -24, -24, -24, -24, -24, -24, -24, -24, -24,
1.484 + -24, -24, -24, -24, -24, -24, -24
1.485 +
1.486 + },
1.487 +
1.488 + {
1.489 + 11, 51, 51, 52, 51, 51, 51, 51, 51, 51,
1.490 + 51, 51, 51, 51, 51, 51, 51
1.491 + },
1.492 +
1.493 + {
1.494 + 11, -26, -26, -26, -26, -26, -26, -26, -26, -26,
1.495 + -26, -26, -26, -26, -26, -26, -26
1.496 + },
1.497 +
1.498 + {
1.499 + 11, -27, -27, -27, -27, -27, -27, -27, -27, -27,
1.500 + -27, -27, -27, -27, -27, -27, -27
1.501 + },
1.502 +
1.503 + {
1.504 + 11, -28, -28, -28, -28, -28, -28, -28, -28, -28,
1.505 + -28, -28, -28, -28, 53, -28, -28
1.506 + },
1.507 +
1.508 + {
1.509 + 11, -29, -29, -29, -29, -29, -29, -29, -29, -29,
1.510 + -29, -29, -29, -29, -29, -29, -29
1.511 +
1.512 + },
1.513 +
1.514 + {
1.515 + 11, 54, 54, -30, 54, 54, 54, 54, 54, 54,
1.516 + 54, 54, 54, 54, 54, 54, 54
1.517 + },
1.518 +
1.519 + {
1.520 + 11, -31, -31, -31, -31, -31, -31, 55, -31, -31,
1.521 + -31, -31, -31, -31, -31, -31, -31
1.522 + },
1.523 +
1.524 + {
1.525 + 11, -32, -32, -32, -32, -32, -32, -32, -32, -32,
1.526 + -32, -32, -32, -32, -32, -32, -32
1.527 + },
1.528 +
1.529 + {
1.530 + 11, -33, -33, -33, -33, -33, -33, -33, -33, -33,
1.531 + -33, -33, -33, -33, -33, -33, -33
1.532 + },
1.533 +
1.534 + {
1.535 + 11, -34, -34, -34, -34, -34, -34, -34, -34, -34,
1.536 + -34, 56, 57, 57, -34, -34, -34
1.537 +
1.538 + },
1.539 +
1.540 + {
1.541 + 11, -35, -35, -35, -35, -35, -35, -35, -35, -35,
1.542 + -35, 57, 57, 57, -35, -35, -35
1.543 + },
1.544 +
1.545 + {
1.546 + 11, -36, -36, -36, -36, -36, -36, -36, -36, -36,
1.547 + -36, -36, -36, -36, -36, -36, -36
1.548 + },
1.549 +
1.550 + {
1.551 + 11, -37, -37, 58, -37, -37, -37, -37, -37, -37,
1.552 + -37, -37, -37, -37, -37, -37, -37
1.553 + },
1.554 +
1.555 + {
1.556 + 11, -38, -38, -38, -38, -38, -38, -38, -38, -38,
1.557 + -38, -38, -38, -38, -38, -38, 59
1.558 + },
1.559 +
1.560 + {
1.561 + 11, -39, 39, 40, -39, -39, 41, -39, -39, -39,
1.562 + -39, -39, -39, -39, -39, -39, -39
1.563 +
1.564 + },
1.565 +
1.566 + {
1.567 + 11, -40, -40, -40, -40, -40, -40, -40, -40, -40,
1.568 + -40, -40, -40, -40, -40, -40, -40
1.569 + },
1.570 +
1.571 + {
1.572 + 11, 42, 42, 43, 42, 42, 42, 42, 42, 42,
1.573 + 42, 42, 42, 42, 42, 42, 42
1.574 + },
1.575 +
1.576 + {
1.577 + 11, 42, 42, 43, 42, 42, 42, 42, 42, 42,
1.578 + 42, 42, 42, 42, 42, 42, 42
1.579 + },
1.580 +
1.581 + {
1.582 + 11, -43, -43, -43, -43, -43, -43, -43, -43, -43,
1.583 + -43, -43, -43, -43, -43, -43, -43
1.584 + },
1.585 +
1.586 + {
1.587 + 11, -44, -44, -44, -44, -44, -44, -44, -44, -44,
1.588 + -44, -44, -44, 44, -44, -44, -44
1.589 +
1.590 + },
1.591 +
1.592 + {
1.593 + 11, 45, 45, -45, 45, 45, 45, 45, 45, 45,
1.594 + 45, 45, 45, 45, 45, 45, 45
1.595 + },
1.596 +
1.597 + {
1.598 + 11, -46, 46, 47, -46, -46, -46, -46, -46, -46,
1.599 + -46, -46, -46, -46, -46, -46, -46
1.600 + },
1.601 +
1.602 + {
1.603 + 11, 48, -47, -47, 48, 48, 48, 48, 48, 48,
1.604 + 48, 48, 48, 48, 48, 48, 48
1.605 + },
1.606 +
1.607 + {
1.608 + 11, -48, -48, -48, -48, -48, -48, -48, -48, -48,
1.609 + -48, -48, -48, -48, -48, -48, -48
1.610 + },
1.611 +
1.612 + {
1.613 + 11, 49, 49, 50, 49, -49, 49, 49, -49, 49,
1.614 + 49, 49, 49, 49, 49, -49, 49
1.615 +
1.616 + },
1.617 +
1.618 + {
1.619 + 11, -50, -50, -50, -50, -50, -50, -50, -50, -50,
1.620 + -50, -50, -50, -50, -50, -50, -50
1.621 + },
1.622 +
1.623 + {
1.624 + 11, -51, -51, 52, -51, -51, -51, -51, -51, -51,
1.625 + -51, -51, -51, -51, -51, -51, -51
1.626 + },
1.627 +
1.628 + {
1.629 + 11, -52, -52, -52, -52, -52, -52, -52, -52, -52,
1.630 + -52, -52, -52, -52, -52, -52, -52
1.631 + },
1.632 +
1.633 + {
1.634 + 11, -53, -53, -53, -53, -53, -53, -53, -53, -53,
1.635 + -53, -53, -53, -53, -53, -53, -53
1.636 + },
1.637 +
1.638 + {
1.639 + 11, 54, 54, -54, 54, 54, 54, 54, 54, 54,
1.640 + 54, 54, 54, 54, 54, 54, 54
1.641 +
1.642 + },
1.643 +
1.644 + {
1.645 + 11, -55, -55, -55, -55, -55, -55, -55, -55, -55,
1.646 + -55, -55, -55, -55, -55, -55, -55
1.647 + },
1.648 +
1.649 + {
1.650 + 11, -56, -56, -56, -56, -56, -56, -56, -56, -56,
1.651 + -56, 60, 57, 57, -56, -56, -56
1.652 + },
1.653 +
1.654 + {
1.655 + 11, -57, -57, -57, -57, -57, -57, -57, -57, -57,
1.656 + -57, 57, 57, 57, -57, -57, -57
1.657 + },
1.658 +
1.659 + {
1.660 + 11, -58, -58, -58, -58, -58, -58, -58, -58, -58,
1.661 + -58, -58, -58, -58, -58, -58, -58
1.662 + },
1.663 +
1.664 + {
1.665 + 11, -59, -59, -59, -59, -59, -59, -59, -59, -59,
1.666 + -59, -59, -59, -59, -59, -59, -59
1.667 +
1.668 + },
1.669 +
1.670 + {
1.671 + 11, -60, -60, -60, -60, -60, -60, -60, -60, -60,
1.672 + -60, 57, 57, 57, -60, -60, -60
1.673 + },
1.674 +
1.675 + } ;
1.676 +
1.677 +static yy_state_type yy_get_previous_state (void );
1.678 +static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
1.679 +static int yy_get_next_buffer (void );
1.680 +static void yy_fatal_error (yyconst char msg[] );
1.681 +
1.682 +/* Done after the current pattern has been matched and before the
1.683 + * corresponding action - sets up zconftext.
1.684 + */
1.685 +#define YY_DO_BEFORE_ACTION \
1.686 + (yytext_ptr) = yy_bp; \
1.687 + zconfleng = (size_t) (yy_cp - yy_bp); \
1.688 + (yy_hold_char) = *yy_cp; \
1.689 + *yy_cp = '\0'; \
1.690 + (yy_c_buf_p) = yy_cp;
1.691 +
1.692 +#define YY_NUM_RULES 33
1.693 +#define YY_END_OF_BUFFER 34
1.694 +/* This struct is not used in this scanner,
1.695 + but its presence is necessary. */
1.696 +struct yy_trans_info
1.697 + {
1.698 + flex_int32_t yy_verify;
1.699 + flex_int32_t yy_nxt;
1.700 + };
1.701 +static yyconst flex_int16_t yy_accept[61] =
1.702 + { 0,
1.703 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1.704 + 34, 5, 4, 2, 3, 7, 8, 6, 32, 29,
1.705 + 31, 24, 28, 27, 26, 22, 17, 13, 16, 20,
1.706 + 22, 11, 12, 19, 19, 14, 22, 22, 4, 2,
1.707 + 3, 3, 1, 6, 32, 29, 31, 30, 24, 23,
1.708 + 26, 25, 15, 20, 9, 19, 19, 21, 10, 18
1.709 + } ;
1.710 +
1.711 +static yyconst flex_int32_t yy_ec[256] =
1.712 + { 0,
1.713 + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1.714 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1.715 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1.716 + 1, 2, 4, 5, 6, 1, 1, 7, 8, 9,
1.717 + 10, 1, 1, 1, 11, 12, 12, 13, 13, 13,
1.718 + 13, 13, 13, 13, 13, 13, 13, 1, 1, 1,
1.719 + 14, 1, 1, 1, 13, 13, 13, 13, 13, 13,
1.720 + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
1.721 + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
1.722 + 1, 15, 1, 1, 13, 1, 13, 13, 13, 13,
1.723 +
1.724 + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
1.725 + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
1.726 + 13, 13, 1, 16, 1, 1, 1, 1, 1, 1,
1.727 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1.728 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1.729 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1.730 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1.731 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1.732 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1.733 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1.734 +
1.735 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1.736 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1.737 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1.738 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1.739 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1.740 + 1, 1, 1, 1, 1
1.741 + } ;
1.742 +
1.743 +extern int zconf_flex_debug;
1.744 +int zconf_flex_debug = 0;
1.745 +
1.746 +/* The intent behind this definition is that it'll catch
1.747 + * any uses of REJECT which flex missed.
1.748 + */
1.749 +#define REJECT reject_used_but_not_detected
1.750 +#define yymore() yymore_used_but_not_detected
1.751 +#define YY_MORE_ADJ 0
1.752 +#define YY_RESTORE_YY_MORE_OFFSET
1.753 +char *zconftext;
1.754 +
1.755 +/*
1.756 + * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
1.757 + * Released under the terms of the GNU GPL v2.0.
1.758 + */
1.759 +
1.760 +#include <limits.h>
1.761 +#include <stdio.h>
1.762 +#include <stdlib.h>
1.763 +#include <string.h>
1.764 +#include <unistd.h>
1.765 +
1.766 +#define LKC_DIRECT_LINK
1.767 +#include "lkc.h"
1.768 +
1.769 +#define START_STRSIZE 16
1.770 +
1.771 +static struct {
1.772 + struct file *file;
1.773 + int lineno;
1.774 +} current_pos;
1.775 +
1.776 +static char *text;
1.777 +static int text_size, text_asize;
1.778 +
1.779 +struct buffer {
1.780 + struct buffer *parent;
1.781 + YY_BUFFER_STATE state;
1.782 +};
1.783 +
1.784 +struct buffer *current_buf;
1.785 +
1.786 +static int last_ts, first_ts;
1.787 +
1.788 +static void zconf_endhelp(void);
1.789 +static void zconf_endfile(void);
1.790 +
1.791 +void new_string(void)
1.792 +{
1.793 + text = malloc(START_STRSIZE);
1.794 + text_asize = START_STRSIZE;
1.795 + text_size = 0;
1.796 + *text = 0;
1.797 +}
1.798 +
1.799 +void append_string(const char *str, int size)
1.800 +{
1.801 + int new_size = text_size + size + 1;
1.802 + if (new_size > text_asize) {
1.803 + new_size += START_STRSIZE - 1;
1.804 + new_size &= -START_STRSIZE;
1.805 + text = realloc(text, new_size);
1.806 + text_asize = new_size;
1.807 + }
1.808 + memcpy(text + text_size, str, size);
1.809 + text_size += size;
1.810 + text[text_size] = 0;
1.811 +}
1.812 +
1.813 +void alloc_string(const char *str, int size)
1.814 +{
1.815 + text = malloc(size + 1);
1.816 + memcpy(text, str, size);
1.817 + text[size] = 0;
1.818 +}
1.819 +
1.820 +#define INITIAL 0
1.821 +#define COMMAND 1
1.822 +#define HELP 2
1.823 +#define STRING 3
1.824 +#define PARAM 4
1.825 +
1.826 +#ifndef YY_NO_UNISTD_H
1.827 +/* Special case for "unistd.h", since it is non-ANSI. We include it way
1.828 + * down here because we want the user's section 1 to have been scanned first.
1.829 + * The user has a chance to override it with an option.
1.830 + */
1.831 +#include <unistd.h>
1.832 +#endif
1.833 +
1.834 +#ifndef YY_EXTRA_TYPE
1.835 +#define YY_EXTRA_TYPE void *
1.836 +#endif
1.837 +
1.838 +static int yy_init_globals (void );
1.839 +
1.840 +/* Macros after this point can all be overridden by user definitions in
1.841 + * section 1.
1.842 + */
1.843 +
1.844 +#ifndef YY_SKIP_YYWRAP
1.845 +#ifdef __cplusplus
1.846 +extern "C" int zconfwrap (void );
1.847 +#else
1.848 +extern int zconfwrap (void );
1.849 +#endif
1.850 +#endif
1.851 +
1.852 + static void yyunput (int c,char *buf_ptr );
1.853 +
1.854 +#ifndef yytext_ptr
1.855 +static void yy_flex_strncpy (char *,yyconst char *,int );
1.856 +#endif
1.857 +
1.858 +#ifdef YY_NEED_STRLEN
1.859 +static int yy_flex_strlen (yyconst char * );
1.860 +#endif
1.861 +
1.862 +#ifndef YY_NO_INPUT
1.863 +
1.864 +#ifdef __cplusplus
1.865 +static int yyinput (void );
1.866 +#else
1.867 +static int input (void );
1.868 +#endif
1.869 +
1.870 +#endif
1.871 +
1.872 +/* Amount of stuff to slurp up with each read. */
1.873 +#ifndef YY_READ_BUF_SIZE
1.874 +#define YY_READ_BUF_SIZE 8192
1.875 +#endif
1.876 +
1.877 +/* Copy whatever the last rule matched to the standard output. */
1.878 +#ifndef ECHO
1.879 +/* This used to be an fputs(), but since the string might contain NUL's,
1.880 + * we now use fwrite().
1.881 + */
1.882 +#define ECHO (void) fwrite( zconftext, zconfleng, 1, zconfout )
1.883 +#endif
1.884 +
1.885 +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1.886 + * is returned in "result".
1.887 + */
1.888 +#ifndef YY_INPUT
1.889 +#define YY_INPUT(buf,result,max_size) \
1.890 + errno=0; \
1.891 + while ( (result = read( fileno(zconfin), (char *) buf, max_size )) < 0 ) \
1.892 + { \
1.893 + if( errno != EINTR) \
1.894 + { \
1.895 + YY_FATAL_ERROR( "input in flex scanner failed" ); \
1.896 + break; \
1.897 + } \
1.898 + errno=0; \
1.899 + clearerr(zconfin); \
1.900 + }\
1.901 +\
1.902 +
1.903 +#endif
1.904 +
1.905 +/* No semi-colon after return; correct usage is to write "yyterminate();" -
1.906 + * we don't want an extra ';' after the "return" because that will cause
1.907 + * some compilers to complain about unreachable statements.
1.908 + */
1.909 +#ifndef yyterminate
1.910 +#define yyterminate() return YY_NULL
1.911 +#endif
1.912 +
1.913 +/* Number of entries by which start-condition stack grows. */
1.914 +#ifndef YY_START_STACK_INCR
1.915 +#define YY_START_STACK_INCR 25
1.916 +#endif
1.917 +
1.918 +/* Report a fatal error. */
1.919 +#ifndef YY_FATAL_ERROR
1.920 +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1.921 +#endif
1.922 +
1.923 +/* end tables serialization structures and prototypes */
1.924 +
1.925 +/* Default declaration of generated scanner - a define so the user can
1.926 + * easily add parameters.
1.927 + */
1.928 +#ifndef YY_DECL
1.929 +#define YY_DECL_IS_OURS 1
1.930 +
1.931 +extern int zconflex (void);
1.932 +
1.933 +#define YY_DECL int zconflex (void)
1.934 +#endif /* !YY_DECL */
1.935 +
1.936 +/* Code executed at the beginning of each rule, after zconftext and zconfleng
1.937 + * have been set up.
1.938 + */
1.939 +#ifndef YY_USER_ACTION
1.940 +#define YY_USER_ACTION
1.941 +#endif
1.942 +
1.943 +/* Code executed at the end of each rule. */
1.944 +#ifndef YY_BREAK
1.945 +#define YY_BREAK break;
1.946 +#endif
1.947 +
1.948 +#define YY_RULE_SETUP \
1.949 + YY_USER_ACTION
1.950 +
1.951 +/** The main scanner function which does all the work.
1.952 + */
1.953 +YY_DECL
1.954 +{
1.955 + register yy_state_type yy_current_state;
1.956 + register char *yy_cp, *yy_bp;
1.957 + register int yy_act;
1.958 +
1.959 + int str = 0;
1.960 + int ts, i;
1.961 +
1.962 + if ( !(yy_init) )
1.963 + {
1.964 + (yy_init) = 1;
1.965 +
1.966 +#ifdef YY_USER_INIT
1.967 + YY_USER_INIT;
1.968 +#endif
1.969 +
1.970 + if ( ! (yy_start) )
1.971 + (yy_start) = 1; /* first start state */
1.972 +
1.973 + if ( ! zconfin )
1.974 + zconfin = stdin;
1.975 +
1.976 + if ( ! zconfout )
1.977 + zconfout = stdout;
1.978 +
1.979 + if ( ! YY_CURRENT_BUFFER ) {
1.980 + zconfensure_buffer_stack ();
1.981 + YY_CURRENT_BUFFER_LVALUE =
1.982 + zconf_create_buffer(zconfin,YY_BUF_SIZE );
1.983 + }
1.984 +
1.985 + zconf_load_buffer_state( );
1.986 + }
1.987 +
1.988 + while ( 1 ) /* loops until end-of-file is reached */
1.989 + {
1.990 + yy_cp = (yy_c_buf_p);
1.991 +
1.992 + /* Support of zconftext. */
1.993 + *yy_cp = (yy_hold_char);
1.994 +
1.995 + /* yy_bp points to the position in yy_ch_buf of the start of
1.996 + * the current run.
1.997 + */
1.998 + yy_bp = yy_cp;
1.999 +
1.1000 + yy_current_state = (yy_start);
1.1001 +yy_match:
1.1002 + while ( (yy_current_state = yy_nxt[yy_current_state][ yy_ec[YY_SC_TO_UI(*yy_cp)] ]) > 0 )
1.1003 + ++yy_cp;
1.1004 +
1.1005 + yy_current_state = -yy_current_state;
1.1006 +
1.1007 +yy_find_action:
1.1008 + yy_act = yy_accept[yy_current_state];
1.1009 +
1.1010 + YY_DO_BEFORE_ACTION;
1.1011 +
1.1012 +do_action: /* This label is used only to access EOF actions. */
1.1013 +
1.1014 + switch ( yy_act )
1.1015 + { /* beginning of action switch */
1.1016 +case 1:
1.1017 +/* rule 1 can match eol */
1.1018 +case 2:
1.1019 +/* rule 2 can match eol */
1.1020 +YY_RULE_SETUP
1.1021 +{
1.1022 + current_file->lineno++;
1.1023 + return T_EOL;
1.1024 +}
1.1025 + YY_BREAK
1.1026 +case 3:
1.1027 +YY_RULE_SETUP
1.1028 +
1.1029 + YY_BREAK
1.1030 +case 4:
1.1031 +YY_RULE_SETUP
1.1032 +{
1.1033 + BEGIN(COMMAND);
1.1034 +}
1.1035 + YY_BREAK
1.1036 +case 5:
1.1037 +YY_RULE_SETUP
1.1038 +{
1.1039 + unput(zconftext[0]);
1.1040 + BEGIN(COMMAND);
1.1041 +}
1.1042 + YY_BREAK
1.1043 +
1.1044 +case 6:
1.1045 +YY_RULE_SETUP
1.1046 +{
1.1047 + struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng);
1.1048 + BEGIN(PARAM);
1.1049 + current_pos.file = current_file;
1.1050 + current_pos.lineno = current_file->lineno;
1.1051 + if (id && id->flags & TF_COMMAND) {
1.1052 + zconflval.id = id;
1.1053 + return id->token;
1.1054 + }
1.1055 + alloc_string(zconftext, zconfleng);
1.1056 + zconflval.string = text;
1.1057 + return T_WORD;
1.1058 + }
1.1059 + YY_BREAK
1.1060 +case 7:
1.1061 +YY_RULE_SETUP
1.1062 +
1.1063 + YY_BREAK
1.1064 +case 8:
1.1065 +/* rule 8 can match eol */
1.1066 +YY_RULE_SETUP
1.1067 +{
1.1068 + BEGIN(INITIAL);
1.1069 + current_file->lineno++;
1.1070 + return T_EOL;
1.1071 + }
1.1072 + YY_BREAK
1.1073 +
1.1074 +case 9:
1.1075 +YY_RULE_SETUP
1.1076 +return T_AND;
1.1077 + YY_BREAK
1.1078 +case 10:
1.1079 +YY_RULE_SETUP
1.1080 +return T_OR;
1.1081 + YY_BREAK
1.1082 +case 11:
1.1083 +YY_RULE_SETUP
1.1084 +return T_OPEN_PAREN;
1.1085 + YY_BREAK
1.1086 +case 12:
1.1087 +YY_RULE_SETUP
1.1088 +return T_CLOSE_PAREN;
1.1089 + YY_BREAK
1.1090 +case 13:
1.1091 +YY_RULE_SETUP
1.1092 +return T_NOT;
1.1093 + YY_BREAK
1.1094 +case 14:
1.1095 +YY_RULE_SETUP
1.1096 +return T_EQUAL;
1.1097 + YY_BREAK
1.1098 +case 15:
1.1099 +YY_RULE_SETUP
1.1100 +return T_UNEQUAL;
1.1101 + YY_BREAK
1.1102 +case 16:
1.1103 +YY_RULE_SETUP
1.1104 +{
1.1105 + str = zconftext[0];
1.1106 + new_string();
1.1107 + BEGIN(STRING);
1.1108 + }
1.1109 + YY_BREAK
1.1110 +case 17:
1.1111 +/* rule 17 can match eol */
1.1112 +YY_RULE_SETUP
1.1113 +BEGIN(INITIAL); current_file->lineno++; return T_EOL;
1.1114 + YY_BREAK
1.1115 +case 18:
1.1116 +YY_RULE_SETUP
1.1117 +/* ignore */
1.1118 + YY_BREAK
1.1119 +case 19:
1.1120 +YY_RULE_SETUP
1.1121 +{
1.1122 + struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng);
1.1123 + if (id && id->flags & TF_PARAM) {
1.1124 + zconflval.id = id;
1.1125 + return id->token;
1.1126 + }
1.1127 + alloc_string(zconftext, zconfleng);
1.1128 + zconflval.string = text;
1.1129 + return T_WORD;
1.1130 + }
1.1131 + YY_BREAK
1.1132 +case 20:
1.1133 +YY_RULE_SETUP
1.1134 +/* comment */
1.1135 + YY_BREAK
1.1136 +case 21:
1.1137 +/* rule 21 can match eol */
1.1138 +YY_RULE_SETUP
1.1139 +current_file->lineno++;
1.1140 + YY_BREAK
1.1141 +case 22:
1.1142 +YY_RULE_SETUP
1.1143 +
1.1144 + YY_BREAK
1.1145 +case YY_STATE_EOF(PARAM):
1.1146 +{
1.1147 + BEGIN(INITIAL);
1.1148 + }
1.1149 + YY_BREAK
1.1150 +
1.1151 +case 23:
1.1152 +/* rule 23 can match eol */
1.1153 +*yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */
1.1154 +(yy_c_buf_p) = yy_cp -= 1;
1.1155 +YY_DO_BEFORE_ACTION; /* set up zconftext again */
1.1156 +YY_RULE_SETUP
1.1157 +{
1.1158 + append_string(zconftext, zconfleng);
1.1159 + zconflval.string = text;
1.1160 + return T_WORD_QUOTE;
1.1161 + }
1.1162 + YY_BREAK
1.1163 +case 24:
1.1164 +YY_RULE_SETUP
1.1165 +{
1.1166 + append_string(zconftext, zconfleng);
1.1167 + }
1.1168 + YY_BREAK
1.1169 +case 25:
1.1170 +/* rule 25 can match eol */
1.1171 +*yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */
1.1172 +(yy_c_buf_p) = yy_cp -= 1;
1.1173 +YY_DO_BEFORE_ACTION; /* set up zconftext again */
1.1174 +YY_RULE_SETUP
1.1175 +{
1.1176 + append_string(zconftext + 1, zconfleng - 1);
1.1177 + zconflval.string = text;
1.1178 + return T_WORD_QUOTE;
1.1179 + }
1.1180 + YY_BREAK
1.1181 +case 26:
1.1182 +YY_RULE_SETUP
1.1183 +{
1.1184 + append_string(zconftext + 1, zconfleng - 1);
1.1185 + }
1.1186 + YY_BREAK
1.1187 +case 27:
1.1188 +YY_RULE_SETUP
1.1189 +{
1.1190 + if (str == zconftext[0]) {
1.1191 + BEGIN(PARAM);
1.1192 + zconflval.string = text;
1.1193 + return T_WORD_QUOTE;
1.1194 + } else
1.1195 + append_string(zconftext, 1);
1.1196 + }
1.1197 + YY_BREAK
1.1198 +case 28:
1.1199 +/* rule 28 can match eol */
1.1200 +YY_RULE_SETUP
1.1201 +{
1.1202 + printf("%s:%d:warning: multi-line strings not supported\n", zconf_curname(), zconf_lineno());
1.1203 + current_file->lineno++;
1.1204 + BEGIN(INITIAL);
1.1205 + return T_EOL;
1.1206 + }
1.1207 + YY_BREAK
1.1208 +case YY_STATE_EOF(STRING):
1.1209 +{
1.1210 + BEGIN(INITIAL);
1.1211 + }
1.1212 + YY_BREAK
1.1213 +
1.1214 +case 29:
1.1215 +YY_RULE_SETUP
1.1216 +{
1.1217 + ts = 0;
1.1218 + for (i = 0; i < zconfleng; i++) {
1.1219 + if (zconftext[i] == '\t')
1.1220 + ts = (ts & ~7) + 8;
1.1221 + else
1.1222 + ts++;
1.1223 + }
1.1224 + last_ts = ts;
1.1225 + if (first_ts) {
1.1226 + if (ts < first_ts) {
1.1227 + zconf_endhelp();
1.1228 + return T_HELPTEXT;
1.1229 + }
1.1230 + ts -= first_ts;
1.1231 + while (ts > 8) {
1.1232 + append_string(" ", 8);
1.1233 + ts -= 8;
1.1234 + }
1.1235 + append_string(" ", ts);
1.1236 + }
1.1237 + }
1.1238 + YY_BREAK
1.1239 +case 30:
1.1240 +/* rule 30 can match eol */
1.1241 +*yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */
1.1242 +(yy_c_buf_p) = yy_cp -= 1;
1.1243 +YY_DO_BEFORE_ACTION; /* set up zconftext again */
1.1244 +YY_RULE_SETUP
1.1245 +{
1.1246 + current_file->lineno++;
1.1247 + zconf_endhelp();
1.1248 + return T_HELPTEXT;
1.1249 + }
1.1250 + YY_BREAK
1.1251 +case 31:
1.1252 +/* rule 31 can match eol */
1.1253 +YY_RULE_SETUP
1.1254 +{
1.1255 + current_file->lineno++;
1.1256 + append_string("\n", 1);
1.1257 + }
1.1258 + YY_BREAK
1.1259 +case 32:
1.1260 +YY_RULE_SETUP
1.1261 +{
1.1262 + append_string(zconftext, zconfleng);
1.1263 + if (!first_ts)
1.1264 + first_ts = last_ts;
1.1265 + }
1.1266 + YY_BREAK
1.1267 +case YY_STATE_EOF(HELP):
1.1268 +{
1.1269 + zconf_endhelp();
1.1270 + return T_HELPTEXT;
1.1271 + }
1.1272 + YY_BREAK
1.1273 +
1.1274 +case YY_STATE_EOF(INITIAL):
1.1275 +case YY_STATE_EOF(COMMAND):
1.1276 +{
1.1277 + if (current_file) {
1.1278 + zconf_endfile();
1.1279 + return T_EOL;
1.1280 + }
1.1281 + fclose(zconfin);
1.1282 + yyterminate();
1.1283 +}
1.1284 + YY_BREAK
1.1285 +case 33:
1.1286 +YY_RULE_SETUP
1.1287 +YY_FATAL_ERROR( "flex scanner jammed" );
1.1288 + YY_BREAK
1.1289 +
1.1290 + case YY_END_OF_BUFFER:
1.1291 + {
1.1292 + /* Amount of text matched not including the EOB char. */
1.1293 + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1.1294 +
1.1295 + /* Undo the effects of YY_DO_BEFORE_ACTION. */
1.1296 + *yy_cp = (yy_hold_char);
1.1297 + YY_RESTORE_YY_MORE_OFFSET
1.1298 +
1.1299 + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1.1300 + {
1.1301 + /* We're scanning a new file or input source. It's
1.1302 + * possible that this happened because the user
1.1303 + * just pointed zconfin at a new source and called
1.1304 + * zconflex(). If so, then we have to assure
1.1305 + * consistency between YY_CURRENT_BUFFER and our
1.1306 + * globals. Here is the right place to do so, because
1.1307 + * this is the first action (other than possibly a
1.1308 + * back-up) that will match for the new input source.
1.1309 + */
1.1310 + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1.1311 + YY_CURRENT_BUFFER_LVALUE->yy_input_file = zconfin;
1.1312 + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1.1313 + }
1.1314 +
1.1315 + /* Note that here we test for yy_c_buf_p "<=" to the position
1.1316 + * of the first EOB in the buffer, since yy_c_buf_p will
1.1317 + * already have been incremented past the NUL character
1.1318 + * (since all states make transitions on EOB to the
1.1319 + * end-of-buffer state). Contrast this with the test
1.1320 + * in input().
1.1321 + */
1.1322 + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1.1323 + { /* This was really a NUL. */
1.1324 + yy_state_type yy_next_state;
1.1325 +
1.1326 + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1.1327 +
1.1328 + yy_current_state = yy_get_previous_state( );
1.1329 +
1.1330 + /* Okay, we're now positioned to make the NUL
1.1331 + * transition. We couldn't have
1.1332 + * yy_get_previous_state() go ahead and do it
1.1333 + * for us because it doesn't know how to deal
1.1334 + * with the possibility of jamming (and we don't
1.1335 + * want to build jamming into it because then it
1.1336 + * will run more slowly).
1.1337 + */
1.1338 +
1.1339 + yy_next_state = yy_try_NUL_trans( yy_current_state );
1.1340 +
1.1341 + yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1.1342 +
1.1343 + if ( yy_next_state )
1.1344 + {
1.1345 + /* Consume the NUL. */
1.1346 + yy_cp = ++(yy_c_buf_p);
1.1347 + yy_current_state = yy_next_state;
1.1348 + goto yy_match;
1.1349 + }
1.1350 +
1.1351 + else
1.1352 + {
1.1353 + yy_cp = (yy_c_buf_p);
1.1354 + goto yy_find_action;
1.1355 + }
1.1356 + }
1.1357 +
1.1358 + else switch ( yy_get_next_buffer( ) )
1.1359 + {
1.1360 + case EOB_ACT_END_OF_FILE:
1.1361 + {
1.1362 + (yy_did_buffer_switch_on_eof) = 0;
1.1363 +
1.1364 + if ( zconfwrap( ) )
1.1365 + {
1.1366 + /* Note: because we've taken care in
1.1367 + * yy_get_next_buffer() to have set up
1.1368 + * zconftext, we can now set up
1.1369 + * yy_c_buf_p so that if some total
1.1370 + * hoser (like flex itself) wants to
1.1371 + * call the scanner after we return the
1.1372 + * YY_NULL, it'll still work - another
1.1373 + * YY_NULL will get returned.
1.1374 + */
1.1375 + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1.1376 +
1.1377 + yy_act = YY_STATE_EOF(YY_START);
1.1378 + goto do_action;
1.1379 + }
1.1380 +
1.1381 + else
1.1382 + {
1.1383 + if ( ! (yy_did_buffer_switch_on_eof) )
1.1384 + YY_NEW_FILE;
1.1385 + }
1.1386 + break;
1.1387 + }
1.1388 +
1.1389 + case EOB_ACT_CONTINUE_SCAN:
1.1390 + (yy_c_buf_p) =
1.1391 + (yytext_ptr) + yy_amount_of_matched_text;
1.1392 +
1.1393 + yy_current_state = yy_get_previous_state( );
1.1394 +
1.1395 + yy_cp = (yy_c_buf_p);
1.1396 + yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1.1397 + goto yy_match;
1.1398 +
1.1399 + case EOB_ACT_LAST_MATCH:
1.1400 + (yy_c_buf_p) =
1.1401 + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1.1402 +
1.1403 + yy_current_state = yy_get_previous_state( );
1.1404 +
1.1405 + yy_cp = (yy_c_buf_p);
1.1406 + yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1.1407 + goto yy_find_action;
1.1408 + }
1.1409 + break;
1.1410 + }
1.1411 +
1.1412 + default:
1.1413 + YY_FATAL_ERROR(
1.1414 + "fatal flex scanner internal error--no action found" );
1.1415 + } /* end of action switch */
1.1416 + } /* end of scanning one token */
1.1417 +} /* end of zconflex */
1.1418 +
1.1419 +/* yy_get_next_buffer - try to read in a new buffer
1.1420 + *
1.1421 + * Returns a code representing an action:
1.1422 + * EOB_ACT_LAST_MATCH -
1.1423 + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1.1424 + * EOB_ACT_END_OF_FILE - end of file
1.1425 + */
1.1426 +static int yy_get_next_buffer (void)
1.1427 +{
1.1428 + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1.1429 + register char *source = (yytext_ptr);
1.1430 + register int number_to_move, i;
1.1431 + int ret_val;
1.1432 +
1.1433 + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1.1434 + YY_FATAL_ERROR(
1.1435 + "fatal flex scanner internal error--end of buffer missed" );
1.1436 +
1.1437 + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1.1438 + { /* Don't try to fill the buffer, so this is an EOF. */
1.1439 + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1.1440 + {
1.1441 + /* We matched a single character, the EOB, so
1.1442 + * treat this as a final EOF.
1.1443 + */
1.1444 + return EOB_ACT_END_OF_FILE;
1.1445 + }
1.1446 +
1.1447 + else
1.1448 + {
1.1449 + /* We matched some text prior to the EOB, first
1.1450 + * process it.
1.1451 + */
1.1452 + return EOB_ACT_LAST_MATCH;
1.1453 + }
1.1454 + }
1.1455 +
1.1456 + /* Try to read more data. */
1.1457 +
1.1458 + /* First move last chars to start of buffer. */
1.1459 + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1.1460 +
1.1461 + for ( i = 0; i < number_to_move; ++i )
1.1462 + *(dest++) = *(source++);
1.1463 +
1.1464 + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1.1465 + /* don't do the read, it's not guaranteed to return an EOF,
1.1466 + * just force an EOF
1.1467 + */
1.1468 + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1.1469 +
1.1470 + else
1.1471 + {
1.1472 + int num_to_read =
1.1473 + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1.1474 +
1.1475 + while ( num_to_read <= 0 )
1.1476 + { /* Not enough room in the buffer - grow it. */
1.1477 +
1.1478 + /* just a shorter name for the current buffer */
1.1479 + YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1.1480 +
1.1481 + int yy_c_buf_p_offset =
1.1482 + (int) ((yy_c_buf_p) - b->yy_ch_buf);
1.1483 +
1.1484 + if ( b->yy_is_our_buffer )
1.1485 + {
1.1486 + int new_size = b->yy_buf_size * 2;
1.1487 +
1.1488 + if ( new_size <= 0 )
1.1489 + b->yy_buf_size += b->yy_buf_size / 8;
1.1490 + else
1.1491 + b->yy_buf_size *= 2;
1.1492 +
1.1493 + b->yy_ch_buf = (char *)
1.1494 + /* Include room in for 2 EOB chars. */
1.1495 + zconfrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1.1496 + }
1.1497 + else
1.1498 + /* Can't grow it, we don't own it. */
1.1499 + b->yy_ch_buf = 0;
1.1500 +
1.1501 + if ( ! b->yy_ch_buf )
1.1502 + YY_FATAL_ERROR(
1.1503 + "fatal error - scanner input buffer overflow" );
1.1504 +
1.1505 + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1.1506 +
1.1507 + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1.1508 + number_to_move - 1;
1.1509 +
1.1510 + }
1.1511 +
1.1512 + if ( num_to_read > YY_READ_BUF_SIZE )
1.1513 + num_to_read = YY_READ_BUF_SIZE;
1.1514 +
1.1515 + /* Read in more data. */
1.1516 + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1.1517 + (yy_n_chars), num_to_read );
1.1518 +
1.1519 + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1.1520 + }
1.1521 +
1.1522 + if ( (yy_n_chars) == 0 )
1.1523 + {
1.1524 + if ( number_to_move == YY_MORE_ADJ )
1.1525 + {
1.1526 + ret_val = EOB_ACT_END_OF_FILE;
1.1527 + zconfrestart(zconfin );
1.1528 + }
1.1529 +
1.1530 + else
1.1531 + {
1.1532 + ret_val = EOB_ACT_LAST_MATCH;
1.1533 + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1.1534 + YY_BUFFER_EOF_PENDING;
1.1535 + }
1.1536 + }
1.1537 +
1.1538 + else
1.1539 + ret_val = EOB_ACT_CONTINUE_SCAN;
1.1540 +
1.1541 + (yy_n_chars) += number_to_move;
1.1542 + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1.1543 + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1.1544 +
1.1545 + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1.1546 +
1.1547 + return ret_val;
1.1548 +}
1.1549 +
1.1550 +/* yy_get_previous_state - get the state just before the EOB char was reached */
1.1551 +
1.1552 + static yy_state_type yy_get_previous_state (void)
1.1553 +{
1.1554 + register yy_state_type yy_current_state;
1.1555 + register char *yy_cp;
1.1556 +
1.1557 + yy_current_state = (yy_start);
1.1558 +
1.1559 + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1.1560 + {
1.1561 + yy_current_state = yy_nxt[yy_current_state][(*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1)];
1.1562 + }
1.1563 +
1.1564 + return yy_current_state;
1.1565 +}
1.1566 +
1.1567 +/* yy_try_NUL_trans - try to make a transition on the NUL character
1.1568 + *
1.1569 + * synopsis
1.1570 + * next_state = yy_try_NUL_trans( current_state );
1.1571 + */
1.1572 + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1.1573 +{
1.1574 + register int yy_is_jam;
1.1575 +
1.1576 + yy_current_state = yy_nxt[yy_current_state][1];
1.1577 + yy_is_jam = (yy_current_state <= 0);
1.1578 +
1.1579 + return yy_is_jam ? 0 : yy_current_state;
1.1580 +}
1.1581 +
1.1582 + static void yyunput (int c, register char * yy_bp )
1.1583 +{
1.1584 + register char *yy_cp;
1.1585 +
1.1586 + yy_cp = (yy_c_buf_p);
1.1587 +
1.1588 + /* undo effects of setting up zconftext */
1.1589 + *yy_cp = (yy_hold_char);
1.1590 +
1.1591 + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1.1592 + { /* need to shift things up to make room */
1.1593 + /* +2 for EOB chars. */
1.1594 + register int number_to_move = (yy_n_chars) + 2;
1.1595 + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1.1596 + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1.1597 + register char *source =
1.1598 + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1.1599 +
1.1600 + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1.1601 + *--dest = *--source;
1.1602 +
1.1603 + yy_cp += (int) (dest - source);
1.1604 + yy_bp += (int) (dest - source);
1.1605 + YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1.1606 + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1.1607 +
1.1608 + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1.1609 + YY_FATAL_ERROR( "flex scanner push-back overflow" );
1.1610 + }
1.1611 +
1.1612 + *--yy_cp = (char) c;
1.1613 +
1.1614 + (yytext_ptr) = yy_bp;
1.1615 + (yy_hold_char) = *yy_cp;
1.1616 + (yy_c_buf_p) = yy_cp;
1.1617 +}
1.1618 +
1.1619 +#ifndef YY_NO_INPUT
1.1620 +#ifdef __cplusplus
1.1621 + static int yyinput (void)
1.1622 +#else
1.1623 + static int input (void)
1.1624 +#endif
1.1625 +
1.1626 +{
1.1627 + int c;
1.1628 +
1.1629 + *(yy_c_buf_p) = (yy_hold_char);
1.1630 +
1.1631 + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1.1632 + {
1.1633 + /* yy_c_buf_p now points to the character we want to return.
1.1634 + * If this occurs *before* the EOB characters, then it's a
1.1635 + * valid NUL; if not, then we've hit the end of the buffer.
1.1636 + */
1.1637 + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1.1638 + /* This was really a NUL. */
1.1639 + *(yy_c_buf_p) = '\0';
1.1640 +
1.1641 + else
1.1642 + { /* need more input */
1.1643 + int offset = (yy_c_buf_p) - (yytext_ptr);
1.1644 + ++(yy_c_buf_p);
1.1645 +
1.1646 + switch ( yy_get_next_buffer( ) )
1.1647 + {
1.1648 + case EOB_ACT_LAST_MATCH:
1.1649 + /* This happens because yy_g_n_b()
1.1650 + * sees that we've accumulated a
1.1651 + * token and flags that we need to
1.1652 + * try matching the token before
1.1653 + * proceeding. But for input(),
1.1654 + * there's no matching to consider.
1.1655 + * So convert the EOB_ACT_LAST_MATCH
1.1656 + * to EOB_ACT_END_OF_FILE.
1.1657 + */
1.1658 +
1.1659 + /* Reset buffer status. */
1.1660 + zconfrestart(zconfin );
1.1661 +
1.1662 + /*FALLTHROUGH*/
1.1663 +
1.1664 + case EOB_ACT_END_OF_FILE:
1.1665 + {
1.1666 + if ( zconfwrap( ) )
1.1667 + return EOF;
1.1668 +
1.1669 + if ( ! (yy_did_buffer_switch_on_eof) )
1.1670 + YY_NEW_FILE;
1.1671 +#ifdef __cplusplus
1.1672 + return yyinput();
1.1673 +#else
1.1674 + return input();
1.1675 +#endif
1.1676 + }
1.1677 +
1.1678 + case EOB_ACT_CONTINUE_SCAN:
1.1679 + (yy_c_buf_p) = (yytext_ptr) + offset;
1.1680 + break;
1.1681 + }
1.1682 + }
1.1683 + }
1.1684 +
1.1685 + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1.1686 + *(yy_c_buf_p) = '\0'; /* preserve zconftext */
1.1687 + (yy_hold_char) = *++(yy_c_buf_p);
1.1688 +
1.1689 + return c;
1.1690 +}
1.1691 +#endif /* ifndef YY_NO_INPUT */
1.1692 +
1.1693 +/** Immediately switch to a different input stream.
1.1694 + * @param input_file A readable stream.
1.1695 + *
1.1696 + * @note This function does not reset the start condition to @c INITIAL .
1.1697 + */
1.1698 + void zconfrestart (FILE * input_file )
1.1699 +{
1.1700 +
1.1701 + if ( ! YY_CURRENT_BUFFER ){
1.1702 + zconfensure_buffer_stack ();
1.1703 + YY_CURRENT_BUFFER_LVALUE =
1.1704 + zconf_create_buffer(zconfin,YY_BUF_SIZE );
1.1705 + }
1.1706 +
1.1707 + zconf_init_buffer(YY_CURRENT_BUFFER,input_file );
1.1708 + zconf_load_buffer_state( );
1.1709 +}
1.1710 +
1.1711 +/** Switch to a different input buffer.
1.1712 + * @param new_buffer The new input buffer.
1.1713 + *
1.1714 + */
1.1715 + void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1.1716 +{
1.1717 +
1.1718 + /* TODO. We should be able to replace this entire function body
1.1719 + * with
1.1720 + * zconfpop_buffer_state();
1.1721 + * zconfpush_buffer_state(new_buffer);
1.1722 + */
1.1723 + zconfensure_buffer_stack ();
1.1724 + if ( YY_CURRENT_BUFFER == new_buffer )
1.1725 + return;
1.1726 +
1.1727 + if ( YY_CURRENT_BUFFER )
1.1728 + {
1.1729 + /* Flush out information for old buffer. */
1.1730 + *(yy_c_buf_p) = (yy_hold_char);
1.1731 + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1.1732 + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1.1733 + }
1.1734 +
1.1735 + YY_CURRENT_BUFFER_LVALUE = new_buffer;
1.1736 + zconf_load_buffer_state( );
1.1737 +
1.1738 + /* We don't actually know whether we did this switch during
1.1739 + * EOF (zconfwrap()) processing, but the only time this flag
1.1740 + * is looked at is after zconfwrap() is called, so it's safe
1.1741 + * to go ahead and always set it.
1.1742 + */
1.1743 + (yy_did_buffer_switch_on_eof) = 1;
1.1744 +}
1.1745 +
1.1746 +static void zconf_load_buffer_state (void)
1.1747 +{
1.1748 + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1.1749 + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1.1750 + zconfin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1.1751 + (yy_hold_char) = *(yy_c_buf_p);
1.1752 +}
1.1753 +
1.1754 +/** Allocate and initialize an input buffer state.
1.1755 + * @param file A readable stream.
1.1756 + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1.1757 + *
1.1758 + * @return the allocated buffer state.
1.1759 + */
1.1760 + YY_BUFFER_STATE zconf_create_buffer (FILE * file, int size )
1.1761 +{
1.1762 + YY_BUFFER_STATE b;
1.1763 +
1.1764 + b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state ) );
1.1765 + if ( ! b )
1.1766 + YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" );
1.1767 +
1.1768 + b->yy_buf_size = size;
1.1769 +
1.1770 + /* yy_ch_buf has to be 2 characters longer than the size given because
1.1771 + * we need to put in 2 end-of-buffer characters.
1.1772 + */
1.1773 + b->yy_ch_buf = (char *) zconfalloc(b->yy_buf_size + 2 );
1.1774 + if ( ! b->yy_ch_buf )
1.1775 + YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" );
1.1776 +
1.1777 + b->yy_is_our_buffer = 1;
1.1778 +
1.1779 + zconf_init_buffer(b,file );
1.1780 +
1.1781 + return b;
1.1782 +}
1.1783 +
1.1784 +/** Destroy the buffer.
1.1785 + * @param b a buffer created with zconf_create_buffer()
1.1786 + *
1.1787 + */
1.1788 + void zconf_delete_buffer (YY_BUFFER_STATE b )
1.1789 +{
1.1790 +
1.1791 + if ( ! b )
1.1792 + return;
1.1793 +
1.1794 + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1.1795 + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1.1796 +
1.1797 + if ( b->yy_is_our_buffer )
1.1798 + zconffree((void *) b->yy_ch_buf );
1.1799 +
1.1800 + zconffree((void *) b );
1.1801 +}
1.1802 +
1.1803 +/* Initializes or reinitializes a buffer.
1.1804 + * This function is sometimes called more than once on the same buffer,
1.1805 + * such as during a zconfrestart() or at EOF.
1.1806 + */
1.1807 + static void zconf_init_buffer (YY_BUFFER_STATE b, FILE * file )
1.1808 +
1.1809 +{
1.1810 + int oerrno = errno;
1.1811 +
1.1812 + zconf_flush_buffer(b );
1.1813 +
1.1814 + b->yy_input_file = file;
1.1815 + b->yy_fill_buffer = 1;
1.1816 +
1.1817 + /* If b is the current buffer, then zconf_init_buffer was _probably_
1.1818 + * called from zconfrestart() or through yy_get_next_buffer.
1.1819 + * In that case, we don't want to reset the lineno or column.
1.1820 + */
1.1821 + if (b != YY_CURRENT_BUFFER){
1.1822 + b->yy_bs_lineno = 1;
1.1823 + b->yy_bs_column = 0;
1.1824 + }
1.1825 +
1.1826 + b->yy_is_interactive = 0;
1.1827 +
1.1828 + errno = oerrno;
1.1829 +}
1.1830 +
1.1831 +/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1.1832 + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1.1833 + *
1.1834 + */
1.1835 + void zconf_flush_buffer (YY_BUFFER_STATE b )
1.1836 +{
1.1837 + if ( ! b )
1.1838 + return;
1.1839 +
1.1840 + b->yy_n_chars = 0;
1.1841 +
1.1842 + /* We always need two end-of-buffer characters. The first causes
1.1843 + * a transition to the end-of-buffer state. The second causes
1.1844 + * a jam in that state.
1.1845 + */
1.1846 + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1.1847 + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1.1848 +
1.1849 + b->yy_buf_pos = &b->yy_ch_buf[0];
1.1850 +
1.1851 + b->yy_at_bol = 1;
1.1852 + b->yy_buffer_status = YY_BUFFER_NEW;
1.1853 +
1.1854 + if ( b == YY_CURRENT_BUFFER )
1.1855 + zconf_load_buffer_state( );
1.1856 +}
1.1857 +
1.1858 +/** Pushes the new state onto the stack. The new state becomes
1.1859 + * the current state. This function will allocate the stack
1.1860 + * if necessary.
1.1861 + * @param new_buffer The new state.
1.1862 + *
1.1863 + */
1.1864 +void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
1.1865 +{
1.1866 + if (new_buffer == NULL)
1.1867 + return;
1.1868 +
1.1869 + zconfensure_buffer_stack();
1.1870 +
1.1871 + /* This block is copied from zconf_switch_to_buffer. */
1.1872 + if ( YY_CURRENT_BUFFER )
1.1873 + {
1.1874 + /* Flush out information for old buffer. */
1.1875 + *(yy_c_buf_p) = (yy_hold_char);
1.1876 + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1.1877 + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1.1878 + }
1.1879 +
1.1880 + /* Only push if top exists. Otherwise, replace top. */
1.1881 + if (YY_CURRENT_BUFFER)
1.1882 + (yy_buffer_stack_top)++;
1.1883 + YY_CURRENT_BUFFER_LVALUE = new_buffer;
1.1884 +
1.1885 + /* copied from zconf_switch_to_buffer. */
1.1886 + zconf_load_buffer_state( );
1.1887 + (yy_did_buffer_switch_on_eof) = 1;
1.1888 +}
1.1889 +
1.1890 +/** Removes and deletes the top of the stack, if present.
1.1891 + * The next element becomes the new top.
1.1892 + *
1.1893 + */
1.1894 +void zconfpop_buffer_state (void)
1.1895 +{
1.1896 + if (!YY_CURRENT_BUFFER)
1.1897 + return;
1.1898 +
1.1899 + zconf_delete_buffer(YY_CURRENT_BUFFER );
1.1900 + YY_CURRENT_BUFFER_LVALUE = NULL;
1.1901 + if ((yy_buffer_stack_top) > 0)
1.1902 + --(yy_buffer_stack_top);
1.1903 +
1.1904 + if (YY_CURRENT_BUFFER) {
1.1905 + zconf_load_buffer_state( );
1.1906 + (yy_did_buffer_switch_on_eof) = 1;
1.1907 + }
1.1908 +}
1.1909 +
1.1910 +/* Allocates the stack if it does not exist.
1.1911 + * Guarantees space for at least one push.
1.1912 + */
1.1913 +static void zconfensure_buffer_stack (void)
1.1914 +{
1.1915 + int num_to_alloc;
1.1916 +
1.1917 + if (!(yy_buffer_stack)) {
1.1918 +
1.1919 + /* First allocation is just for 2 elements, since we don't know if this
1.1920 + * scanner will even need a stack. We use 2 instead of 1 to avoid an
1.1921 + * immediate realloc on the next call.
1.1922 + */
1.1923 + num_to_alloc = 1;
1.1924 + (yy_buffer_stack) = (struct yy_buffer_state**)zconfalloc
1.1925 + (num_to_alloc * sizeof(struct yy_buffer_state*)
1.1926 + );
1.1927 +
1.1928 + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1.1929 +
1.1930 + (yy_buffer_stack_max) = num_to_alloc;
1.1931 + (yy_buffer_stack_top) = 0;
1.1932 + return;
1.1933 + }
1.1934 +
1.1935 + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1.1936 +
1.1937 + /* Increase the buffer to prepare for a possible push. */
1.1938 + int grow_size = 8 /* arbitrary grow size */;
1.1939 +
1.1940 + num_to_alloc = (yy_buffer_stack_max) + grow_size;
1.1941 + (yy_buffer_stack) = (struct yy_buffer_state**)zconfrealloc
1.1942 + ((yy_buffer_stack),
1.1943 + num_to_alloc * sizeof(struct yy_buffer_state*)
1.1944 + );
1.1945 +
1.1946 + /* zero only the new slots.*/
1.1947 + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1.1948 + (yy_buffer_stack_max) = num_to_alloc;
1.1949 + }
1.1950 +}
1.1951 +
1.1952 +/** Setup the input buffer state to scan directly from a user-specified character buffer.
1.1953 + * @param base the character buffer
1.1954 + * @param size the size in bytes of the character buffer
1.1955 + *
1.1956 + * @return the newly allocated buffer state object.
1.1957 + */
1.1958 +YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size )
1.1959 +{
1.1960 + YY_BUFFER_STATE b;
1.1961 +
1.1962 + if ( size < 2 ||
1.1963 + base[size-2] != YY_END_OF_BUFFER_CHAR ||
1.1964 + base[size-1] != YY_END_OF_BUFFER_CHAR )
1.1965 + /* They forgot to leave room for the EOB's. */
1.1966 + return 0;
1.1967 +
1.1968 + b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state ) );
1.1969 + if ( ! b )
1.1970 + YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_buffer()" );
1.1971 +
1.1972 + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1.1973 + b->yy_buf_pos = b->yy_ch_buf = base;
1.1974 + b->yy_is_our_buffer = 0;
1.1975 + b->yy_input_file = 0;
1.1976 + b->yy_n_chars = b->yy_buf_size;
1.1977 + b->yy_is_interactive = 0;
1.1978 + b->yy_at_bol = 1;
1.1979 + b->yy_fill_buffer = 0;
1.1980 + b->yy_buffer_status = YY_BUFFER_NEW;
1.1981 +
1.1982 + zconf_switch_to_buffer(b );
1.1983 +
1.1984 + return b;
1.1985 +}
1.1986 +
1.1987 +/** Setup the input buffer state to scan a string. The next call to zconflex() will
1.1988 + * scan from a @e copy of @a str.
1.1989 + * @param yystr a NUL-terminated string to scan
1.1990 + *
1.1991 + * @return the newly allocated buffer state object.
1.1992 + * @note If you want to scan bytes that may contain NUL values, then use
1.1993 + * zconf_scan_bytes() instead.
1.1994 + */
1.1995 +YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr )
1.1996 +{
1.1997 +
1.1998 + return zconf_scan_bytes(yystr,strlen(yystr) );
1.1999 +}
1.2000 +
1.2001 +/** Setup the input buffer state to scan the given bytes. The next call to zconflex() will
1.2002 + * scan from a @e copy of @a bytes.
1.2003 + * @param bytes the byte buffer to scan
1.2004 + * @param len the number of bytes in the buffer pointed to by @a bytes.
1.2005 + *
1.2006 + * @return the newly allocated buffer state object.
1.2007 + */
1.2008 +YY_BUFFER_STATE zconf_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1.2009 +{
1.2010 + YY_BUFFER_STATE b;
1.2011 + char *buf;
1.2012 + yy_size_t n;
1.2013 + int i;
1.2014 +
1.2015 + /* Get memory for full buffer, including space for trailing EOB's. */
1.2016 + n = _yybytes_len + 2;
1.2017 + buf = (char *) zconfalloc(n );
1.2018 + if ( ! buf )
1.2019 + YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_bytes()" );
1.2020 +
1.2021 + for ( i = 0; i < _yybytes_len; ++i )
1.2022 + buf[i] = yybytes[i];
1.2023 +
1.2024 + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1.2025 +
1.2026 + b = zconf_scan_buffer(buf,n );
1.2027 + if ( ! b )
1.2028 + YY_FATAL_ERROR( "bad buffer in zconf_scan_bytes()" );
1.2029 +
1.2030 + /* It's okay to grow etc. this buffer, and we should throw it
1.2031 + * away when we're done.
1.2032 + */
1.2033 + b->yy_is_our_buffer = 1;
1.2034 +
1.2035 + return b;
1.2036 +}
1.2037 +
1.2038 +#ifndef YY_EXIT_FAILURE
1.2039 +#define YY_EXIT_FAILURE 2
1.2040 +#endif
1.2041 +
1.2042 +static void yy_fatal_error (yyconst char* msg )
1.2043 +{
1.2044 + (void) fprintf( stderr, "%s\n", msg );
1.2045 + exit( YY_EXIT_FAILURE );
1.2046 +}
1.2047 +
1.2048 +/* Redefine yyless() so it works in section 3 code. */
1.2049 +
1.2050 +#undef yyless
1.2051 +#define yyless(n) \
1.2052 + do \
1.2053 + { \
1.2054 + /* Undo effects of setting up zconftext. */ \
1.2055 + int yyless_macro_arg = (n); \
1.2056 + YY_LESS_LINENO(yyless_macro_arg);\
1.2057 + zconftext[zconfleng] = (yy_hold_char); \
1.2058 + (yy_c_buf_p) = zconftext + yyless_macro_arg; \
1.2059 + (yy_hold_char) = *(yy_c_buf_p); \
1.2060 + *(yy_c_buf_p) = '\0'; \
1.2061 + zconfleng = yyless_macro_arg; \
1.2062 + } \
1.2063 + while ( 0 )
1.2064 +
1.2065 +/* Accessor methods (get/set functions) to struct members. */
1.2066 +
1.2067 +/** Get the current line number.
1.2068 + *
1.2069 + */
1.2070 +int zconfget_lineno (void)
1.2071 +{
1.2072 +
1.2073 + return zconflineno;
1.2074 +}
1.2075 +
1.2076 +/** Get the input stream.
1.2077 + *
1.2078 + */
1.2079 +FILE *zconfget_in (void)
1.2080 +{
1.2081 + return zconfin;
1.2082 +}
1.2083 +
1.2084 +/** Get the output stream.
1.2085 + *
1.2086 + */
1.2087 +FILE *zconfget_out (void)
1.2088 +{
1.2089 + return zconfout;
1.2090 +}
1.2091 +
1.2092 +/** Get the length of the current token.
1.2093 + *
1.2094 + */
1.2095 +int zconfget_leng (void)
1.2096 +{
1.2097 + return zconfleng;
1.2098 +}
1.2099 +
1.2100 +/** Get the current token.
1.2101 + *
1.2102 + */
1.2103 +
1.2104 +char *zconfget_text (void)
1.2105 +{
1.2106 + return zconftext;
1.2107 +}
1.2108 +
1.2109 +/** Set the current line number.
1.2110 + * @param line_number
1.2111 + *
1.2112 + */
1.2113 +void zconfset_lineno (int line_number )
1.2114 +{
1.2115 +
1.2116 + zconflineno = line_number;
1.2117 +}
1.2118 +
1.2119 +/** Set the input stream. This does not discard the current
1.2120 + * input buffer.
1.2121 + * @param in_str A readable stream.
1.2122 + *
1.2123 + * @see zconf_switch_to_buffer
1.2124 + */
1.2125 +void zconfset_in (FILE * in_str )
1.2126 +{
1.2127 + zconfin = in_str ;
1.2128 +}
1.2129 +
1.2130 +void zconfset_out (FILE * out_str )
1.2131 +{
1.2132 + zconfout = out_str ;
1.2133 +}
1.2134 +
1.2135 +int zconfget_debug (void)
1.2136 +{
1.2137 + return zconf_flex_debug;
1.2138 +}
1.2139 +
1.2140 +void zconfset_debug (int bdebug )
1.2141 +{
1.2142 + zconf_flex_debug = bdebug ;
1.2143 +}
1.2144 +
1.2145 +static int yy_init_globals (void)
1.2146 +{
1.2147 + /* Initialization is the same as for the non-reentrant scanner.
1.2148 + * This function is called from zconflex_destroy(), so don't allocate here.
1.2149 + */
1.2150 +
1.2151 + (yy_buffer_stack) = 0;
1.2152 + (yy_buffer_stack_top) = 0;
1.2153 + (yy_buffer_stack_max) = 0;
1.2154 + (yy_c_buf_p) = (char *) 0;
1.2155 + (yy_init) = 0;
1.2156 + (yy_start) = 0;
1.2157 +
1.2158 +/* Defined in main.c */
1.2159 +#ifdef YY_STDINIT
1.2160 + zconfin = stdin;
1.2161 + zconfout = stdout;
1.2162 +#else
1.2163 + zconfin = (FILE *) 0;
1.2164 + zconfout = (FILE *) 0;
1.2165 +#endif
1.2166 +
1.2167 + /* For future reference: Set errno on error, since we are called by
1.2168 + * zconflex_init()
1.2169 + */
1.2170 + return 0;
1.2171 +}
1.2172 +
1.2173 +/* zconflex_destroy is for both reentrant and non-reentrant scanners. */
1.2174 +int zconflex_destroy (void)
1.2175 +{
1.2176 +
1.2177 + /* Pop the buffer stack, destroying each element. */
1.2178 + while(YY_CURRENT_BUFFER){
1.2179 + zconf_delete_buffer(YY_CURRENT_BUFFER );
1.2180 + YY_CURRENT_BUFFER_LVALUE = NULL;
1.2181 + zconfpop_buffer_state();
1.2182 + }
1.2183 +
1.2184 + /* Destroy the stack itself. */
1.2185 + zconffree((yy_buffer_stack) );
1.2186 + (yy_buffer_stack) = NULL;
1.2187 +
1.2188 + /* Reset the globals. This is important in a non-reentrant scanner so the next time
1.2189 + * zconflex() is called, initialization will occur. */
1.2190 + yy_init_globals( );
1.2191 +
1.2192 + return 0;
1.2193 +}
1.2194 +
1.2195 +/*
1.2196 + * Internal utility routines.
1.2197 + */
1.2198 +
1.2199 +#ifndef yytext_ptr
1.2200 +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1.2201 +{
1.2202 + register int i;
1.2203 + for ( i = 0; i < n; ++i )
1.2204 + s1[i] = s2[i];
1.2205 +}
1.2206 +#endif
1.2207 +
1.2208 +#ifdef YY_NEED_STRLEN
1.2209 +static int yy_flex_strlen (yyconst char * s )
1.2210 +{
1.2211 + register int n;
1.2212 + for ( n = 0; s[n]; ++n )
1.2213 + ;
1.2214 +
1.2215 + return n;
1.2216 +}
1.2217 +#endif
1.2218 +
1.2219 +void *zconfalloc (yy_size_t size )
1.2220 +{
1.2221 + return (void *) malloc( size );
1.2222 +}
1.2223 +
1.2224 +void *zconfrealloc (void * ptr, yy_size_t size )
1.2225 +{
1.2226 + /* The cast to (char *) in the following accommodates both
1.2227 + * implementations that use char* generic pointers, and those
1.2228 + * that use void* generic pointers. It works with the latter
1.2229 + * because both ANSI C and C++ allow castless assignment from
1.2230 + * any pointer type to void*, and deal with argument conversions
1.2231 + * as though doing an assignment.
1.2232 + */
1.2233 + return (void *) realloc( (char *) ptr, size );
1.2234 +}
1.2235 +
1.2236 +void zconffree (void * ptr )
1.2237 +{
1.2238 + free( (char *) ptr ); /* see zconfrealloc() for (char *) cast */
1.2239 +}
1.2240 +
1.2241 +#define YYTABLES_NAME "yytables"
1.2242 +
1.2243 +void zconf_starthelp(void)
1.2244 +{
1.2245 + new_string();
1.2246 + last_ts = first_ts = 0;
1.2247 + BEGIN(HELP);
1.2248 +}
1.2249 +
1.2250 +static void zconf_endhelp(void)
1.2251 +{
1.2252 + zconflval.string = text;
1.2253 + BEGIN(INITIAL);
1.2254 +}
1.2255 +
1.2256 +/*
1.2257 + * Try to open specified file with following names:
1.2258 + * ./name
1.2259 + * $(srctree)/name
1.2260 + * The latter is used when srctree is separate from objtree
1.2261 + * when compiling the kernel.
1.2262 + * Return NULL if file is not found.
1.2263 + */
1.2264 +FILE *zconf_fopen(const char *name)
1.2265 +{
1.2266 + char *env, fullname[PATH_MAX+1];
1.2267 + FILE *f;
1.2268 +
1.2269 + f = fopen(name, "r");
1.2270 + if (!f && name[0] != '/') {
1.2271 + env = getenv(SRCTREE);
1.2272 + if (env) {
1.2273 + sprintf(fullname, "%s/%s", env, name);
1.2274 + f = fopen(fullname, "r");
1.2275 + }
1.2276 + }
1.2277 + return f;
1.2278 +}
1.2279 +
1.2280 +void zconf_initscan(const char *name)
1.2281 +{
1.2282 + zconfin = zconf_fopen(name);
1.2283 + if (!zconfin) {
1.2284 + printf("can't find file %s\n", name);
1.2285 + exit(1);
1.2286 + }
1.2287 +
1.2288 + current_buf = malloc(sizeof(*current_buf));
1.2289 + memset(current_buf, 0, sizeof(*current_buf));
1.2290 +
1.2291 + current_file = file_lookup(name);
1.2292 + current_file->lineno = 1;
1.2293 + current_file->flags = FILE_BUSY;
1.2294 +}
1.2295 +
1.2296 +void zconf_nextfile(const char *name)
1.2297 +{
1.2298 + struct file *file = file_lookup(name);
1.2299 + struct buffer *buf = malloc(sizeof(*buf));
1.2300 + memset(buf, 0, sizeof(*buf));
1.2301 +
1.2302 + current_buf->state = YY_CURRENT_BUFFER;
1.2303 + zconfin = zconf_fopen(name);
1.2304 + if (!zconfin) {
1.2305 + printf("%s:%d: can't open file \"%s\"\n", zconf_curname(), zconf_lineno(), name);
1.2306 + exit(1);
1.2307 + }
1.2308 + zconf_switch_to_buffer(zconf_create_buffer(zconfin,YY_BUF_SIZE));
1.2309 + buf->parent = current_buf;
1.2310 + current_buf = buf;
1.2311 +
1.2312 + if (file->flags & FILE_BUSY) {
1.2313 + printf("recursive scan (%s)?\n", name);
1.2314 + exit(1);
1.2315 + }
1.2316 + if (file->flags & FILE_SCANNED) {
1.2317 + printf("file %s already scanned?\n", name);
1.2318 + exit(1);
1.2319 + }
1.2320 + file->flags |= FILE_BUSY;
1.2321 + file->lineno = 1;
1.2322 + file->parent = current_file;
1.2323 + current_file = file;
1.2324 +}
1.2325 +
1.2326 +static void zconf_endfile(void)
1.2327 +{
1.2328 + struct buffer *parent;
1.2329 +
1.2330 + current_file->flags |= FILE_SCANNED;
1.2331 + current_file->flags &= ~FILE_BUSY;
1.2332 + current_file = current_file->parent;
1.2333 +
1.2334 + parent = current_buf->parent;
1.2335 + if (parent) {
1.2336 + fclose(zconfin);
1.2337 + zconf_delete_buffer(YY_CURRENT_BUFFER);
1.2338 + zconf_switch_to_buffer(parent->state);
1.2339 + }
1.2340 + free(current_buf);
1.2341 + current_buf = parent;
1.2342 +}
1.2343 +
1.2344 +int zconf_lineno(void)
1.2345 +{
1.2346 + return current_pos.lineno;
1.2347 +}
1.2348 +
1.2349 +char *zconf_curname(void)
1.2350 +{
1.2351 + return current_pos.file ? current_pos.file->name : "<none>";
1.2352 +}
1.2353 +