diff options
author | Roman Zippel <zippel@linux-m68k.org> | 2006-06-09 01:12:44 -0400 |
---|---|---|
committer | Sam Ravnborg <sam@mars.ravnborg.org> | 2006-06-09 01:31:30 -0400 |
commit | f6a88aa86027bdecfc74ef7c6bf6c68233e86bb3 (patch) | |
tree | 524a366add362ffae3fa550fd822293ffd84984e /scripts/kconfig/lex.zconf.c_shipped | |
parent | f1d28fb043b325dad8944647a52b20287e59d8a1 (diff) |
kconfig: add symbol option config syntax
This adds the general framework to the parser to define options for config
symbols with a syntax like:
config FOO
option bar[="arg"]
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/kconfig/lex.zconf.c_shipped')
-rw-r--r-- | scripts/kconfig/lex.zconf.c_shipped | 91 |
1 files changed, 62 insertions, 29 deletions
diff --git a/scripts/kconfig/lex.zconf.c_shipped b/scripts/kconfig/lex.zconf.c_shipped index 24e3c8cbb7ac..800f8c71c407 100644 --- a/scripts/kconfig/lex.zconf.c_shipped +++ b/scripts/kconfig/lex.zconf.c_shipped | |||
@@ -8,7 +8,7 @@ | |||
8 | #define FLEX_SCANNER | 8 | #define FLEX_SCANNER |
9 | #define YY_FLEX_MAJOR_VERSION 2 | 9 | #define YY_FLEX_MAJOR_VERSION 2 |
10 | #define YY_FLEX_MINOR_VERSION 5 | 10 | #define YY_FLEX_MINOR_VERSION 5 |
11 | #define YY_FLEX_SUBMINOR_VERSION 31 | 11 | #define YY_FLEX_SUBMINOR_VERSION 33 |
12 | #if YY_FLEX_SUBMINOR_VERSION > 0 | 12 | #if YY_FLEX_SUBMINOR_VERSION > 0 |
13 | #define FLEX_BETA | 13 | #define FLEX_BETA |
14 | #endif | 14 | #endif |
@@ -30,7 +30,15 @@ | |||
30 | 30 | ||
31 | /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ | 31 | /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ |
32 | 32 | ||
33 | #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L | 33 | #if __STDC_VERSION__ >= 199901L |
34 | |||
35 | /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, | ||
36 | * if you want the limit (max/min) macros for int types. | ||
37 | */ | ||
38 | #ifndef __STDC_LIMIT_MACROS | ||
39 | #define __STDC_LIMIT_MACROS 1 | ||
40 | #endif | ||
41 | |||
34 | #include <inttypes.h> | 42 | #include <inttypes.h> |
35 | typedef int8_t flex_int8_t; | 43 | typedef int8_t flex_int8_t; |
36 | typedef uint8_t flex_uint8_t; | 44 | typedef uint8_t flex_uint8_t; |
@@ -134,6 +142,10 @@ typedef unsigned int flex_uint32_t; | |||
134 | #define YY_BUF_SIZE 16384 | 142 | #define YY_BUF_SIZE 16384 |
135 | #endif | 143 | #endif |
136 | 144 | ||
145 | /* The state buf must be large enough to hold one state per character in the main buffer. | ||
146 | */ | ||
147 | #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) | ||
148 | |||
137 | #ifndef YY_TYPEDEF_YY_BUFFER_STATE | 149 | #ifndef YY_TYPEDEF_YY_BUFFER_STATE |
138 | #define YY_TYPEDEF_YY_BUFFER_STATE | 150 | #define YY_TYPEDEF_YY_BUFFER_STATE |
139 | typedef struct yy_buffer_state *YY_BUFFER_STATE; | 151 | typedef struct yy_buffer_state *YY_BUFFER_STATE; |
@@ -267,7 +279,7 @@ int zconfleng; | |||
267 | 279 | ||
268 | /* Points to current character in buffer. */ | 280 | /* Points to current character in buffer. */ |
269 | static char *yy_c_buf_p = (char *) 0; | 281 | static char *yy_c_buf_p = (char *) 0; |
270 | static int yy_init = 1; /* whether we need to initialize */ | 282 | static int yy_init = 0; /* whether we need to initialize */ |
271 | static int yy_start = 0; /* start state number */ | 283 | static int yy_start = 0; /* start state number */ |
272 | 284 | ||
273 | /* Flag which is used to allow zconfwrap()'s to do buffer switches | 285 | /* Flag which is used to allow zconfwrap()'s to do buffer switches |
@@ -820,6 +832,8 @@ void alloc_string(const char *str, int size) | |||
820 | #define YY_EXTRA_TYPE void * | 832 | #define YY_EXTRA_TYPE void * |
821 | #endif | 833 | #endif |
822 | 834 | ||
835 | static int yy_init_globals (void ); | ||
836 | |||
823 | /* Macros after this point can all be overridden by user definitions in | 837 | /* Macros after this point can all be overridden by user definitions in |
824 | * section 1. | 838 | * section 1. |
825 | */ | 839 | */ |
@@ -942,9 +956,9 @@ YY_DECL | |||
942 | int str = 0; | 956 | int str = 0; |
943 | int ts, i; | 957 | int ts, i; |
944 | 958 | ||
945 | if ( (yy_init) ) | 959 | if ( !(yy_init) ) |
946 | { | 960 | { |
947 | (yy_init) = 0; | 961 | (yy_init) = 1; |
948 | 962 | ||
949 | #ifdef YY_USER_INIT | 963 | #ifdef YY_USER_INIT |
950 | YY_USER_INIT; | 964 | YY_USER_INIT; |
@@ -1452,7 +1466,7 @@ static int yy_get_next_buffer (void) | |||
1452 | 1466 | ||
1453 | else | 1467 | else |
1454 | { | 1468 | { |
1455 | size_t num_to_read = | 1469 | int num_to_read = |
1456 | YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; | 1470 | YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; |
1457 | 1471 | ||
1458 | while ( num_to_read <= 0 ) | 1472 | while ( num_to_read <= 0 ) |
@@ -1969,16 +1983,16 @@ YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size ) | |||
1969 | 1983 | ||
1970 | /** Setup the input buffer state to scan a string. The next call to zconflex() will | 1984 | /** Setup the input buffer state to scan a string. The next call to zconflex() will |
1971 | * scan from a @e copy of @a str. | 1985 | * scan from a @e copy of @a str. |
1972 | * @param yy_str a NUL-terminated string to scan | 1986 | * @param yystr a NUL-terminated string to scan |
1973 | * | 1987 | * |
1974 | * @return the newly allocated buffer state object. | 1988 | * @return the newly allocated buffer state object. |
1975 | * @note If you want to scan bytes that may contain NUL values, then use | 1989 | * @note If you want to scan bytes that may contain NUL values, then use |
1976 | * zconf_scan_bytes() instead. | 1990 | * zconf_scan_bytes() instead. |
1977 | */ | 1991 | */ |
1978 | YY_BUFFER_STATE zconf_scan_string (yyconst char * yy_str ) | 1992 | YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr ) |
1979 | { | 1993 | { |
1980 | 1994 | ||
1981 | return zconf_scan_bytes(yy_str,strlen(yy_str) ); | 1995 | return zconf_scan_bytes(yystr,strlen(yystr) ); |
1982 | } | 1996 | } |
1983 | 1997 | ||
1984 | /** Setup the input buffer state to scan the given bytes. The next call to zconflex() will | 1998 | /** Setup the input buffer state to scan the given bytes. The next call to zconflex() will |
@@ -1988,7 +2002,7 @@ YY_BUFFER_STATE zconf_scan_string (yyconst char * yy_str ) | |||
1988 | * | 2002 | * |
1989 | * @return the newly allocated buffer state object. | 2003 | * @return the newly allocated buffer state object. |
1990 | */ | 2004 | */ |
1991 | YY_BUFFER_STATE zconf_scan_bytes (yyconst char * bytes, int len ) | 2005 | YY_BUFFER_STATE zconf_scan_bytes (yyconst char * yybytes, int _yybytes_len ) |
1992 | { | 2006 | { |
1993 | YY_BUFFER_STATE b; | 2007 | YY_BUFFER_STATE b; |
1994 | char *buf; | 2008 | char *buf; |
@@ -1996,15 +2010,15 @@ YY_BUFFER_STATE zconf_scan_bytes (yyconst char * bytes, int len ) | |||
1996 | int i; | 2010 | int i; |
1997 | 2011 | ||
1998 | /* Get memory for full buffer, including space for trailing EOB's. */ | 2012 | /* Get memory for full buffer, including space for trailing EOB's. */ |
1999 | n = len + 2; | 2013 | n = _yybytes_len + 2; |
2000 | buf = (char *) zconfalloc(n ); | 2014 | buf = (char *) zconfalloc(n ); |
2001 | if ( ! buf ) | 2015 | if ( ! buf ) |
2002 | YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_bytes()" ); | 2016 | YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_bytes()" ); |
2003 | 2017 | ||
2004 | for ( i = 0; i < len; ++i ) | 2018 | for ( i = 0; i < _yybytes_len; ++i ) |
2005 | buf[i] = bytes[i]; | 2019 | buf[i] = yybytes[i]; |
2006 | 2020 | ||
2007 | buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; | 2021 | buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; |
2008 | 2022 | ||
2009 | b = zconf_scan_buffer(buf,n ); | 2023 | b = zconf_scan_buffer(buf,n ); |
2010 | if ( ! b ) | 2024 | if ( ! b ) |
@@ -2125,6 +2139,34 @@ void zconfset_debug (int bdebug ) | |||
2125 | zconf_flex_debug = bdebug ; | 2139 | zconf_flex_debug = bdebug ; |
2126 | } | 2140 | } |
2127 | 2141 | ||
2142 | static int yy_init_globals (void) | ||
2143 | { | ||
2144 | /* Initialization is the same as for the non-reentrant scanner. | ||
2145 | * This function is called from zconflex_destroy(), so don't allocate here. | ||
2146 | */ | ||
2147 | |||
2148 | (yy_buffer_stack) = 0; | ||
2149 | (yy_buffer_stack_top) = 0; | ||
2150 | (yy_buffer_stack_max) = 0; | ||
2151 | (yy_c_buf_p) = (char *) 0; | ||
2152 | (yy_init) = 0; | ||
2153 | (yy_start) = 0; | ||
2154 | |||
2155 | /* Defined in main.c */ | ||
2156 | #ifdef YY_STDINIT | ||
2157 | zconfin = stdin; | ||
2158 | zconfout = stdout; | ||
2159 | #else | ||
2160 | zconfin = (FILE *) 0; | ||
2161 | zconfout = (FILE *) 0; | ||
2162 | #endif | ||
2163 | |||
2164 | /* For future reference: Set errno on error, since we are called by | ||
2165 | * zconflex_init() | ||
2166 | */ | ||
2167 | return 0; | ||
2168 | } | ||
2169 | |||
2128 | /* zconflex_destroy is for both reentrant and non-reentrant scanners. */ | 2170 | /* zconflex_destroy is for both reentrant and non-reentrant scanners. */ |
2129 | int zconflex_destroy (void) | 2171 | int zconflex_destroy (void) |
2130 | { | 2172 | { |
@@ -2140,6 +2182,10 @@ int zconflex_destroy (void) | |||
2140 | zconffree((yy_buffer_stack) ); | 2182 | zconffree((yy_buffer_stack) ); |
2141 | (yy_buffer_stack) = NULL; | 2183 | (yy_buffer_stack) = NULL; |
2142 | 2184 | ||
2185 | /* Reset the globals. This is important in a non-reentrant scanner so the next time | ||
2186 | * zconflex() is called, initialization will occur. */ | ||
2187 | yy_init_globals( ); | ||
2188 | |||
2143 | return 0; | 2189 | return 0; |
2144 | } | 2190 | } |
2145 | 2191 | ||
@@ -2151,7 +2197,7 @@ int zconflex_destroy (void) | |||
2151 | static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) | 2197 | static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) |
2152 | { | 2198 | { |
2153 | register int i; | 2199 | register int i; |
2154 | for ( i = 0; i < n; ++i ) | 2200 | for ( i = 0; i < n; ++i ) |
2155 | s1[i] = s2[i]; | 2201 | s1[i] = s2[i]; |
2156 | } | 2202 | } |
2157 | #endif | 2203 | #endif |
@@ -2160,7 +2206,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) | |||
2160 | static int yy_flex_strlen (yyconst char * s ) | 2206 | static int yy_flex_strlen (yyconst char * s ) |
2161 | { | 2207 | { |
2162 | register int n; | 2208 | register int n; |
2163 | for ( n = 0; s[n]; ++n ) | 2209 | for ( n = 0; s[n]; ++n ) |
2164 | ; | 2210 | ; |
2165 | 2211 | ||
2166 | return n; | 2212 | return n; |
@@ -2191,19 +2237,6 @@ void zconffree (void * ptr ) | |||
2191 | 2237 | ||
2192 | #define YYTABLES_NAME "yytables" | 2238 | #define YYTABLES_NAME "yytables" |
2193 | 2239 | ||
2194 | #undef YY_NEW_FILE | ||
2195 | #undef YY_FLUSH_BUFFER | ||
2196 | #undef yy_set_bol | ||
2197 | #undef yy_new_buffer | ||
2198 | #undef yy_set_interactive | ||
2199 | #undef yytext_ptr | ||
2200 | #undef YY_DO_BEFORE_ACTION | ||
2201 | |||
2202 | #ifdef YY_DECL_IS_OURS | ||
2203 | #undef YY_DECL_IS_OURS | ||
2204 | #undef YY_DECL | ||
2205 | #endif | ||
2206 | |||
2207 | void zconf_starthelp(void) | 2240 | void zconf_starthelp(void) |
2208 | { | 2241 | { |
2209 | new_string(); | 2242 | new_string(); |