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