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