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