1 | #line 2 "nslexer.c" |
---|
2 | |
---|
3 | #line 4 "nslexer.c" |
---|
4 | |
---|
5 | #define YY_BUF_SIZE 1024 |
---|
6 | #define YY_INT_ALIGNED short int |
---|
7 | |
---|
8 | /* A lexical scanner generated by flex */ |
---|
9 | |
---|
10 | #define yy_create_buffer _nsyy_create_buffer |
---|
11 | #define yy_delete_buffer _nsyy_delete_buffer |
---|
12 | #define yy_flex_debug _nsyy_flex_debug |
---|
13 | #define yy_init_buffer _nsyy_init_buffer |
---|
14 | #define yy_flush_buffer _nsyy_flush_buffer |
---|
15 | #define yy_load_buffer_state _nsyy_load_buffer_state |
---|
16 | #define yy_switch_to_buffer _nsyy_switch_to_buffer |
---|
17 | #define yyin _nsyyin |
---|
18 | #define yyleng _nsyyleng |
---|
19 | #define yylex _nsyylex |
---|
20 | #define yylineno _nsyylineno |
---|
21 | #define yyout _nsyyout |
---|
22 | #define yyrestart _nsyyrestart |
---|
23 | #define yytext _nsyytext |
---|
24 | #define yywrap _nsyywrap |
---|
25 | #define yyalloc _nsyyalloc |
---|
26 | #define yyrealloc _nsyyrealloc |
---|
27 | #define yyfree _nsyyfree |
---|
28 | |
---|
29 | #define FLEX_SCANNER |
---|
30 | #define YY_FLEX_MAJOR_VERSION 2 |
---|
31 | #define YY_FLEX_MINOR_VERSION 5 |
---|
32 | #define YY_FLEX_SUBMINOR_VERSION 37 |
---|
33 | #if YY_FLEX_SUBMINOR_VERSION > 0 |
---|
34 | #define FLEX_BETA |
---|
35 | #endif |
---|
36 | |
---|
37 | /* First, we deal with platform-specific or compiler-specific issues. */ |
---|
38 | |
---|
39 | #if defined(__FreeBSD__) |
---|
40 | #ifndef __STDC_LIMIT_MACROS |
---|
41 | #define __STDC_LIMIT_MACROS |
---|
42 | #endif |
---|
43 | #include <sys/cdefs.h> |
---|
44 | #include <stdint.h> |
---|
45 | #else |
---|
46 | #define __dead2 |
---|
47 | #endif |
---|
48 | |
---|
49 | /* begin standard C headers. */ |
---|
50 | #include <stdio.h> |
---|
51 | #include <string.h> |
---|
52 | #include <errno.h> |
---|
53 | #include <stdlib.h> |
---|
54 | |
---|
55 | /* end standard C headers. */ |
---|
56 | |
---|
57 | /* flex integer type definitions */ |
---|
58 | |
---|
59 | #ifndef FLEXINT_H |
---|
60 | #define FLEXINT_H |
---|
61 | |
---|
62 | /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ |
---|
63 | |
---|
64 | #if defined(__FreeBSD__) || \ |
---|
65 | (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) |
---|
66 | |
---|
67 | /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, |
---|
68 | * if you want the limit (max/min) macros for int types. |
---|
69 | */ |
---|
70 | #ifndef __STDC_LIMIT_MACROS |
---|
71 | #define __STDC_LIMIT_MACROS 1 |
---|
72 | #endif |
---|
73 | |
---|
74 | #include <inttypes.h> |
---|
75 | typedef int8_t flex_int8_t; |
---|
76 | typedef uint8_t flex_uint8_t; |
---|
77 | typedef int16_t flex_int16_t; |
---|
78 | typedef uint16_t flex_uint16_t; |
---|
79 | typedef int32_t flex_int32_t; |
---|
80 | typedef uint32_t flex_uint32_t; |
---|
81 | #else |
---|
82 | typedef signed char flex_int8_t; |
---|
83 | typedef short int flex_int16_t; |
---|
84 | typedef int flex_int32_t; |
---|
85 | typedef unsigned char flex_uint8_t; |
---|
86 | typedef unsigned short int flex_uint16_t; |
---|
87 | typedef unsigned int flex_uint32_t; |
---|
88 | |
---|
89 | /* Limits of integral types. */ |
---|
90 | #ifndef INT8_MIN |
---|
91 | #define INT8_MIN (-128) |
---|
92 | #endif |
---|
93 | #ifndef INT16_MIN |
---|
94 | #define INT16_MIN (-32767-1) |
---|
95 | #endif |
---|
96 | #ifndef INT32_MIN |
---|
97 | #define INT32_MIN (-2147483647-1) |
---|
98 | #endif |
---|
99 | #ifndef INT8_MAX |
---|
100 | #define INT8_MAX (127) |
---|
101 | #endif |
---|
102 | #ifndef INT16_MAX |
---|
103 | #define INT16_MAX (32767) |
---|
104 | #endif |
---|
105 | #ifndef INT32_MAX |
---|
106 | #define INT32_MAX (2147483647) |
---|
107 | #endif |
---|
108 | #ifndef UINT8_MAX |
---|
109 | #define UINT8_MAX (255U) |
---|
110 | #endif |
---|
111 | #ifndef UINT16_MAX |
---|
112 | #define UINT16_MAX (65535U) |
---|
113 | #endif |
---|
114 | #ifndef UINT32_MAX |
---|
115 | #define UINT32_MAX (4294967295U) |
---|
116 | #endif |
---|
117 | |
---|
118 | #endif /* ! C99 */ |
---|
119 | |
---|
120 | #endif /* ! FLEXINT_H */ |
---|
121 | |
---|
122 | #ifdef __cplusplus |
---|
123 | |
---|
124 | /* The "const" storage-class-modifier is valid. */ |
---|
125 | #define YY_USE_CONST |
---|
126 | |
---|
127 | #else /* ! __cplusplus */ |
---|
128 | |
---|
129 | /* C99 requires __STDC__ to be defined as 1. */ |
---|
130 | #if defined (__STDC__) |
---|
131 | |
---|
132 | #define YY_USE_CONST |
---|
133 | |
---|
134 | #endif /* defined (__STDC__) */ |
---|
135 | #endif /* ! __cplusplus */ |
---|
136 | |
---|
137 | #ifdef YY_USE_CONST |
---|
138 | #define yyconst const |
---|
139 | #else |
---|
140 | #define yyconst |
---|
141 | #endif |
---|
142 | |
---|
143 | /* Returned upon end-of-file. */ |
---|
144 | #define YY_NULL 0 |
---|
145 | |
---|
146 | /* Promotes a possibly negative, possibly signed char to an unsigned |
---|
147 | * integer for use as an array index. If the signed char is negative, |
---|
148 | * we want to instead treat it as an 8-bit unsigned char, hence the |
---|
149 | * double cast. |
---|
150 | */ |
---|
151 | #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) |
---|
152 | |
---|
153 | /* Enter a start condition. This macro really ought to take a parameter, |
---|
154 | * but we do it the disgusting crufty way forced on us by the ()-less |
---|
155 | * definition of BEGIN. |
---|
156 | */ |
---|
157 | #define BEGIN (yy_start) = 1 + 2 * |
---|
158 | |
---|
159 | /* Translate the current start state into a value that can be later handed |
---|
160 | * to BEGIN to return to the state. The YYSTATE alias is for lex |
---|
161 | * compatibility. |
---|
162 | */ |
---|
163 | #define YY_START (((yy_start) - 1) / 2) |
---|
164 | #define YYSTATE YY_START |
---|
165 | |
---|
166 | /* Action number for EOF rule of a given start state. */ |
---|
167 | #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) |
---|
168 | |
---|
169 | /* Special action meaning "start processing a new file". */ |
---|
170 | #define YY_NEW_FILE _nsyyrestart(_nsyyin ) |
---|
171 | |
---|
172 | #define YY_END_OF_BUFFER_CHAR 0 |
---|
173 | |
---|
174 | /* Size of default input buffer. */ |
---|
175 | #ifndef YY_BUF_SIZE |
---|
176 | #define YY_BUF_SIZE 16384 |
---|
177 | #endif |
---|
178 | |
---|
179 | /* The state buf must be large enough to hold one state per character in the main buffer. |
---|
180 | */ |
---|
181 | #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) |
---|
182 | |
---|
183 | #ifndef YY_TYPEDEF_YY_BUFFER_STATE |
---|
184 | #define YY_TYPEDEF_YY_BUFFER_STATE |
---|
185 | typedef struct yy_buffer_state *YY_BUFFER_STATE; |
---|
186 | #endif |
---|
187 | |
---|
188 | #ifndef YY_TYPEDEF_YY_SIZE_T |
---|
189 | #define YY_TYPEDEF_YY_SIZE_T |
---|
190 | typedef size_t yy_size_t; |
---|
191 | #endif |
---|
192 | |
---|
193 | extern yy_size_t _nsyyleng; |
---|
194 | |
---|
195 | extern FILE *_nsyyin, *_nsyyout; |
---|
196 | |
---|
197 | #define EOB_ACT_CONTINUE_SCAN 0 |
---|
198 | #define EOB_ACT_END_OF_FILE 1 |
---|
199 | #define EOB_ACT_LAST_MATCH 2 |
---|
200 | |
---|
201 | /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires |
---|
202 | * access to the local variable yy_act. Since yyless() is a macro, it would break |
---|
203 | * existing scanners that call yyless() from OUTSIDE _nsyylex. |
---|
204 | * One obvious solution it to make yy_act a global. I tried that, and saw |
---|
205 | * a 5% performance hit in a non-_nsyylineno scanner, because yy_act is |
---|
206 | * normally declared as a register variable-- so it is not worth it. |
---|
207 | */ |
---|
208 | #define YY_LESS_LINENO(n) \ |
---|
209 | do { \ |
---|
210 | int yyl;\ |
---|
211 | for ( yyl = n; yyl < _nsyyleng; ++yyl )\ |
---|
212 | if ( _nsyytext[yyl] == '\n' )\ |
---|
213 | --_nsyylineno;\ |
---|
214 | }while(0) |
---|
215 | |
---|
216 | /* Return all but the first "n" matched characters back to the input stream. */ |
---|
217 | #define yyless(n) \ |
---|
218 | do \ |
---|
219 | { \ |
---|
220 | /* Undo effects of setting up _nsyytext. */ \ |
---|
221 | int yyless_macro_arg = (n); \ |
---|
222 | YY_LESS_LINENO(yyless_macro_arg);\ |
---|
223 | *yy_cp = (yy_hold_char); \ |
---|
224 | YY_RESTORE_YY_MORE_OFFSET \ |
---|
225 | (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ |
---|
226 | YY_DO_BEFORE_ACTION; /* set up _nsyytext again */ \ |
---|
227 | } \ |
---|
228 | while ( 0 ) |
---|
229 | |
---|
230 | #define unput(c) yyunput( c, (yytext_ptr) ) |
---|
231 | |
---|
232 | #ifndef YY_STRUCT_YY_BUFFER_STATE |
---|
233 | #define YY_STRUCT_YY_BUFFER_STATE |
---|
234 | struct yy_buffer_state |
---|
235 | { |
---|
236 | FILE *yy_input_file; |
---|
237 | |
---|
238 | char *yy_ch_buf; /* input buffer */ |
---|
239 | char *yy_buf_pos; /* current position in input buffer */ |
---|
240 | |
---|
241 | /* Size of input buffer in bytes, not including room for EOB |
---|
242 | * characters. |
---|
243 | */ |
---|
244 | yy_size_t yy_buf_size; |
---|
245 | |
---|
246 | /* Number of characters read into yy_ch_buf, not including EOB |
---|
247 | * characters. |
---|
248 | */ |
---|
249 | yy_size_t yy_n_chars; |
---|
250 | |
---|
251 | /* Whether we "own" the buffer - i.e., we know we created it, |
---|
252 | * and can realloc() it to grow it, and should free() it to |
---|
253 | * delete it. |
---|
254 | */ |
---|
255 | int yy_is_our_buffer; |
---|
256 | |
---|
257 | /* Whether this is an "interactive" input source; if so, and |
---|
258 | * if we're using stdio for input, then we want to use getc() |
---|
259 | * instead of fread(), to make sure we stop fetching input after |
---|
260 | * each newline. |
---|
261 | */ |
---|
262 | int yy_is_interactive; |
---|
263 | |
---|
264 | /* Whether we're considered to be at the beginning of a line. |
---|
265 | * If so, '^' rules will be active on the next match, otherwise |
---|
266 | * not. |
---|
267 | */ |
---|
268 | int yy_at_bol; |
---|
269 | |
---|
270 | int yy_bs_lineno; /**< The line count. */ |
---|
271 | int yy_bs_column; /**< The column count. */ |
---|
272 | |
---|
273 | /* Whether to try to fill the input buffer when we reach the |
---|
274 | * end of it. |
---|
275 | */ |
---|
276 | int yy_fill_buffer; |
---|
277 | |
---|
278 | int yy_buffer_status; |
---|
279 | |
---|
280 | #define YY_BUFFER_NEW 0 |
---|
281 | #define YY_BUFFER_NORMAL 1 |
---|
282 | /* When an EOF's been seen but there's still some text to process |
---|
283 | * then we mark the buffer as YY_EOF_PENDING, to indicate that we |
---|
284 | * shouldn't try reading from the input source any more. We might |
---|
285 | * still have a bunch of tokens to match, though, because of |
---|
286 | * possible backing-up. |
---|
287 | * |
---|
288 | * When we actually see the EOF, we change the status to "new" |
---|
289 | * (via _nsyyrestart()), so that the user can continue scanning by |
---|
290 | * just pointing _nsyyin at a new input file. |
---|
291 | */ |
---|
292 | #define YY_BUFFER_EOF_PENDING 2 |
---|
293 | |
---|
294 | }; |
---|
295 | #endif /* !YY_STRUCT_YY_BUFFER_STATE */ |
---|
296 | |
---|
297 | /* Stack of input buffers. */ |
---|
298 | static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ |
---|
299 | static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ |
---|
300 | static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ |
---|
301 | |
---|
302 | /* We provide macros for accessing buffer states in case in the |
---|
303 | * future we want to put the buffer states in a more general |
---|
304 | * "scanner state". |
---|
305 | * |
---|
306 | * Returns the top of the stack, or NULL. |
---|
307 | */ |
---|
308 | #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ |
---|
309 | ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ |
---|
310 | : NULL) |
---|
311 | #define yy_current_buffer YY_CURRENT_BUFFER |
---|
312 | |
---|
313 | /* Same as previous macro, but useful when we know that the buffer stack is not |
---|
314 | * NULL or when we need an lvalue. For internal use only. |
---|
315 | */ |
---|
316 | #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] |
---|
317 | |
---|
318 | /* yy_hold_char holds the character lost when _nsyytext is formed. */ |
---|
319 | static char yy_hold_char; |
---|
320 | static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ |
---|
321 | yy_size_t _nsyyleng; |
---|
322 | |
---|
323 | /* Points to current character in buffer. */ |
---|
324 | static char *yy_c_buf_p = (char *) 0; |
---|
325 | static int yy_init = 0; /* whether we need to initialize */ |
---|
326 | static int yy_start = 0; /* start state number */ |
---|
327 | |
---|
328 | /* Flag which is used to allow _nsyywrap()'s to do buffer switches |
---|
329 | * instead of setting up a fresh _nsyyin. A bit of a hack ... |
---|
330 | */ |
---|
331 | static int yy_did_buffer_switch_on_eof; |
---|
332 | |
---|
333 | void _nsyyrestart (FILE *input_file ); |
---|
334 | void _nsyy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); |
---|
335 | YY_BUFFER_STATE _nsyy_create_buffer (FILE *file,int size ); |
---|
336 | void _nsyy_delete_buffer (YY_BUFFER_STATE b ); |
---|
337 | void _nsyy_flush_buffer (YY_BUFFER_STATE b ); |
---|
338 | void _nsyypush_buffer_state (YY_BUFFER_STATE new_buffer ); |
---|
339 | void _nsyypop_buffer_state (void ); |
---|
340 | |
---|
341 | static void _nsyyensure_buffer_stack (void ); |
---|
342 | static void _nsyy_load_buffer_state (void ); |
---|
343 | static void _nsyy_init_buffer (YY_BUFFER_STATE b,FILE *file ); |
---|
344 | |
---|
345 | #define YY_FLUSH_BUFFER _nsyy_flush_buffer(YY_CURRENT_BUFFER ) |
---|
346 | |
---|
347 | YY_BUFFER_STATE _nsyy_scan_buffer (char *base,yy_size_t size ); |
---|
348 | YY_BUFFER_STATE _nsyy_scan_string (yyconst char *yy_str ); |
---|
349 | YY_BUFFER_STATE _nsyy_scan_bytes (yyconst char *bytes,yy_size_t len ); |
---|
350 | |
---|
351 | void *_nsyyalloc (yy_size_t ); |
---|
352 | void *_nsyyrealloc (void *,yy_size_t ); |
---|
353 | void _nsyyfree (void * ); |
---|
354 | |
---|
355 | #define yy_new_buffer _nsyy_create_buffer |
---|
356 | |
---|
357 | #define yy_set_interactive(is_interactive) \ |
---|
358 | { \ |
---|
359 | if ( ! YY_CURRENT_BUFFER ){ \ |
---|
360 | _nsyyensure_buffer_stack (); \ |
---|
361 | YY_CURRENT_BUFFER_LVALUE = \ |
---|
362 | _nsyy_create_buffer(_nsyyin,YY_BUF_SIZE ); \ |
---|
363 | } \ |
---|
364 | YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ |
---|
365 | } |
---|
366 | |
---|
367 | #define yy_set_bol(at_bol) \ |
---|
368 | { \ |
---|
369 | if ( ! YY_CURRENT_BUFFER ){\ |
---|
370 | _nsyyensure_buffer_stack (); \ |
---|
371 | YY_CURRENT_BUFFER_LVALUE = \ |
---|
372 | _nsyy_create_buffer(_nsyyin,YY_BUF_SIZE ); \ |
---|
373 | } \ |
---|
374 | YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ |
---|
375 | } |
---|
376 | |
---|
377 | #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) |
---|
378 | |
---|
379 | /* Begin user sect3 */ |
---|
380 | |
---|
381 | typedef unsigned char YY_CHAR; |
---|
382 | |
---|
383 | FILE *_nsyyin = (FILE *) 0, *_nsyyout = (FILE *) 0; |
---|
384 | |
---|
385 | typedef int yy_state_type; |
---|
386 | |
---|
387 | extern int _nsyylineno; |
---|
388 | |
---|
389 | int _nsyylineno = 1; |
---|
390 | |
---|
391 | extern char *_nsyytext; |
---|
392 | #define yytext_ptr _nsyytext |
---|
393 | |
---|
394 | static yy_state_type yy_get_previous_state (void ); |
---|
395 | static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); |
---|
396 | static int yy_get_next_buffer (void ); |
---|
397 | static void yy_fatal_error (yyconst char msg[] ) __dead2; |
---|
398 | |
---|
399 | /* Done after the current pattern has been matched and before the |
---|
400 | * corresponding action - sets up _nsyytext. |
---|
401 | */ |
---|
402 | #define YY_DO_BEFORE_ACTION \ |
---|
403 | (yytext_ptr) = yy_bp; \ |
---|
404 | _nsyyleng = (size_t) (yy_cp - yy_bp); \ |
---|
405 | (yy_hold_char) = *yy_cp; \ |
---|
406 | *yy_cp = '\0'; \ |
---|
407 | (yy_c_buf_p) = yy_cp; |
---|
408 | |
---|
409 | #define YY_NUM_RULES 13 |
---|
410 | #define YY_END_OF_BUFFER 14 |
---|
411 | /* This struct is not used in this scanner, |
---|
412 | but its presence is necessary. */ |
---|
413 | struct yy_trans_info |
---|
414 | { |
---|
415 | flex_int32_t yy_verify; |
---|
416 | flex_int32_t yy_nxt; |
---|
417 | }; |
---|
418 | static yyconst flex_int16_t yy_accept[59] = |
---|
419 | { 0, |
---|
420 | 0, 0, 14, 12, 1, 4, 2, 11, 11, 11, |
---|
421 | 11, 11, 11, 11, 12, 1, 2, 11, 11, 11, |
---|
422 | 11, 11, 11, 11, 3, 11, 11, 11, 11, 11, |
---|
423 | 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, |
---|
424 | 11, 11, 11, 11, 11, 9, 11, 11, 11, 11, |
---|
425 | 11, 5, 11, 6, 10, 7, 8, 0 |
---|
426 | } ; |
---|
427 | |
---|
428 | static yyconst flex_int32_t yy_ec[256] = |
---|
429 | { 0, |
---|
430 | 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, |
---|
431 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
432 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
433 | 1, 2, 1, 1, 4, 1, 1, 1, 1, 1, |
---|
434 | 1, 1, 1, 1, 1, 1, 1, 5, 5, 5, |
---|
435 | 5, 5, 5, 5, 5, 5, 5, 1, 1, 1, |
---|
436 | 1, 1, 1, 1, 6, 7, 8, 9, 10, 11, |
---|
437 | 12, 7, 13, 7, 7, 14, 7, 15, 16, 7, |
---|
438 | 7, 17, 18, 19, 20, 21, 7, 7, 22, 7, |
---|
439 | 1, 23, 1, 1, 5, 1, 6, 7, 8, 9, |
---|
440 | |
---|
441 | 10, 11, 12, 7, 13, 7, 7, 14, 7, 15, |
---|
442 | 16, 7, 7, 17, 18, 19, 20, 21, 7, 7, |
---|
443 | 22, 7, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
444 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
445 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
446 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
447 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
448 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
449 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
450 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
451 | |
---|
452 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
453 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
454 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
455 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
456 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
457 | 1, 1, 1, 1, 1 |
---|
458 | } ; |
---|
459 | |
---|
460 | static yyconst flex_int32_t yy_meta[24] = |
---|
461 | { 0, |
---|
462 | 1, 1, 2, 1, 3, 3, 3, 3, 3, 3, |
---|
463 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, |
---|
464 | 3, 3, 1 |
---|
465 | } ; |
---|
466 | |
---|
467 | static yyconst flex_int16_t yy_base[61] = |
---|
468 | { 0, |
---|
469 | 0, 0, 68, 69, 65, 69, 0, 0, 50, 49, |
---|
470 | 54, 43, 45, 46, 57, 57, 0, 0, 43, 38, |
---|
471 | 37, 47, 32, 47, 69, 33, 40, 30, 41, 42, |
---|
472 | 26, 33, 29, 27, 33, 30, 35, 25, 19, 23, |
---|
473 | 19, 30, 22, 14, 18, 0, 14, 18, 16, 19, |
---|
474 | 19, 0, 12, 0, 0, 0, 0, 69, 23, 22 |
---|
475 | } ; |
---|
476 | |
---|
477 | static yyconst flex_int16_t yy_def[61] = |
---|
478 | { 0, |
---|
479 | 58, 1, 58, 58, 58, 58, 59, 60, 60, 60, |
---|
480 | 60, 60, 60, 60, 58, 58, 59, 60, 60, 60, |
---|
481 | 60, 60, 60, 60, 58, 60, 60, 60, 60, 60, |
---|
482 | 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, |
---|
483 | 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, |
---|
484 | 60, 60, 60, 60, 60, 60, 60, 0, 58, 58 |
---|
485 | } ; |
---|
486 | |
---|
487 | static yyconst flex_int16_t yy_nxt[93] = |
---|
488 | { 0, |
---|
489 | 4, 5, 6, 7, 4, 8, 8, 9, 8, 8, |
---|
490 | 8, 8, 8, 8, 10, 8, 11, 12, 13, 14, |
---|
491 | 8, 8, 15, 17, 18, 17, 57, 56, 55, 54, |
---|
492 | 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, |
---|
493 | 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, |
---|
494 | 33, 32, 31, 30, 29, 28, 27, 26, 16, 25, |
---|
495 | 24, 23, 22, 21, 20, 19, 16, 58, 3, 58, |
---|
496 | 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, |
---|
497 | 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, |
---|
498 | 58, 58 |
---|
499 | |
---|
500 | } ; |
---|
501 | |
---|
502 | static yyconst flex_int16_t yy_chk[93] = |
---|
503 | { 0, |
---|
504 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
505 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
506 | 1, 1, 1, 59, 60, 59, 53, 51, 50, 49, |
---|
507 | 48, 47, 45, 44, 43, 42, 41, 40, 39, 38, |
---|
508 | 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, |
---|
509 | 27, 26, 24, 23, 22, 21, 20, 19, 16, 15, |
---|
510 | 14, 13, 12, 11, 10, 9, 5, 3, 58, 58, |
---|
511 | 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, |
---|
512 | 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, |
---|
513 | 58, 58 |
---|
514 | |
---|
515 | } ; |
---|
516 | |
---|
517 | /* Table of booleans, true if rule could match eol. */ |
---|
518 | static yyconst flex_int32_t yy_rule_can_match_eol[14] = |
---|
519 | { 0, |
---|
520 | 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; |
---|
521 | |
---|
522 | static yy_state_type yy_last_accepting_state; |
---|
523 | static char *yy_last_accepting_cpos; |
---|
524 | |
---|
525 | extern int _nsyy_flex_debug; |
---|
526 | int _nsyy_flex_debug = 0; |
---|
527 | |
---|
528 | /* The intent behind this definition is that it'll catch |
---|
529 | * any uses of REJECT which flex missed. |
---|
530 | */ |
---|
531 | #define REJECT reject_used_but_not_detected |
---|
532 | #define yymore() yymore_used_but_not_detected |
---|
533 | #define YY_MORE_ADJ 0 |
---|
534 | #define YY_RESTORE_YY_MORE_OFFSET |
---|
535 | char *_nsyytext; |
---|
536 | #line 1 "nslexer.l" |
---|
537 | #line 2 "nslexer.l" |
---|
538 | /* $NetBSD: nslexer.l,v 1.3 1999/01/25 00:16:17 lukem Exp $ */ |
---|
539 | |
---|
540 | /*- |
---|
541 | * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc. |
---|
542 | * All rights reserved. |
---|
543 | * |
---|
544 | * This code is derived from software contributed to The NetBSD Foundation |
---|
545 | * by Luke Mewburn. |
---|
546 | * |
---|
547 | * Redistribution and use in source and binary forms, with or without |
---|
548 | * modification, are permitted provided that the following conditions |
---|
549 | * are met: |
---|
550 | * 1. Redistributions of source code must retain the above copyright |
---|
551 | * notice, this list of conditions and the following disclaimer. |
---|
552 | * 2. Redistributions in binary form must reproduce the above copyright |
---|
553 | * notice, this list of conditions and the following disclaimer in the |
---|
554 | * documentation and/or other materials provided with the distribution. |
---|
555 | * |
---|
556 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS |
---|
557 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
---|
558 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
---|
559 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
---|
560 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
561 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
562 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
563 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
564 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
565 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
---|
566 | * POSSIBILITY OF SUCH DAMAGE. |
---|
567 | */ |
---|
568 | |
---|
569 | #include <sys/cdefs.h> |
---|
570 | #if defined(LIBC_SCCS) && !defined(lint) |
---|
571 | static char *rcsid = |
---|
572 | "$FreeBSD$"; |
---|
573 | #endif /* LIBC_SCCS and not lint */ |
---|
574 | |
---|
575 | #include "namespace.h" |
---|
576 | #include <ctype.h> |
---|
577 | #define _NS_PRIVATE |
---|
578 | #include <nsswitch.h> |
---|
579 | #include <string.h> |
---|
580 | #include <syslog.h> |
---|
581 | #include "un-namespace.h" |
---|
582 | |
---|
583 | #include "nsparser.h" |
---|
584 | |
---|
585 | #define YY_NO_INPUT 1 |
---|
586 | #line 587 "nslexer.c" |
---|
587 | |
---|
588 | #define INITIAL 0 |
---|
589 | |
---|
590 | #ifndef YY_NO_UNISTD_H |
---|
591 | /* Special case for "unistd.h", since it is non-ANSI. We include it way |
---|
592 | * down here because we want the user's section 1 to have been scanned first. |
---|
593 | * The user has a chance to override it with an option. |
---|
594 | */ |
---|
595 | #include <unistd.h> |
---|
596 | #endif |
---|
597 | |
---|
598 | #ifndef YY_EXTRA_TYPE |
---|
599 | #define YY_EXTRA_TYPE void * |
---|
600 | #endif |
---|
601 | |
---|
602 | static int yy_init_globals (void ); |
---|
603 | |
---|
604 | /* Accessor methods to globals. |
---|
605 | These are made visible to non-reentrant scanners for convenience. */ |
---|
606 | |
---|
607 | int _nsyylex_destroy (void ); |
---|
608 | |
---|
609 | int _nsyyget_debug (void ); |
---|
610 | |
---|
611 | void _nsyyset_debug (int debug_flag ); |
---|
612 | |
---|
613 | YY_EXTRA_TYPE _nsyyget_extra (void ); |
---|
614 | |
---|
615 | void _nsyyset_extra (YY_EXTRA_TYPE user_defined ); |
---|
616 | |
---|
617 | FILE *_nsyyget_in (void ); |
---|
618 | |
---|
619 | void _nsyyset_in (FILE * in_str ); |
---|
620 | |
---|
621 | FILE *_nsyyget_out (void ); |
---|
622 | |
---|
623 | void _nsyyset_out (FILE * out_str ); |
---|
624 | |
---|
625 | yy_size_t _nsyyget_leng (void ); |
---|
626 | |
---|
627 | char *_nsyyget_text (void ); |
---|
628 | |
---|
629 | int _nsyyget_lineno (void ); |
---|
630 | |
---|
631 | void _nsyyset_lineno (int line_number ); |
---|
632 | |
---|
633 | /* Macros after this point can all be overridden by user definitions in |
---|
634 | * section 1. |
---|
635 | */ |
---|
636 | |
---|
637 | #ifndef YY_SKIP_YYWRAP |
---|
638 | #ifdef __cplusplus |
---|
639 | extern "C" int _nsyywrap (void ); |
---|
640 | #else |
---|
641 | extern int _nsyywrap (void ); |
---|
642 | #endif |
---|
643 | #endif |
---|
644 | |
---|
645 | #ifndef yytext_ptr |
---|
646 | static void yy_flex_strncpy (char *,yyconst char *,int ); |
---|
647 | #endif |
---|
648 | |
---|
649 | #ifdef YY_NEED_STRLEN |
---|
650 | static int yy_flex_strlen (yyconst char * ); |
---|
651 | #endif |
---|
652 | |
---|
653 | #ifndef YY_NO_INPUT |
---|
654 | |
---|
655 | #ifdef __cplusplus |
---|
656 | static int yyinput (void ); |
---|
657 | #else |
---|
658 | static int input (void ); |
---|
659 | #endif |
---|
660 | |
---|
661 | #endif |
---|
662 | |
---|
663 | /* Amount of stuff to slurp up with each read. */ |
---|
664 | #ifndef YY_READ_BUF_SIZE |
---|
665 | #define YY_READ_BUF_SIZE 8192 |
---|
666 | #endif |
---|
667 | |
---|
668 | /* Copy whatever the last rule matched to the standard output. */ |
---|
669 | #ifndef ECHO |
---|
670 | /* This used to be an fputs(), but since the string might contain NUL's, |
---|
671 | * we now use fwrite(). |
---|
672 | */ |
---|
673 | #define ECHO do { if (fwrite( _nsyytext, _nsyyleng, 1, _nsyyout )) {} } while (0) |
---|
674 | #endif |
---|
675 | |
---|
676 | /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, |
---|
677 | * is returned in "result". |
---|
678 | */ |
---|
679 | #ifndef YY_INPUT |
---|
680 | #define YY_INPUT(buf,result,max_size) \ |
---|
681 | if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ |
---|
682 | { \ |
---|
683 | int c = '*'; \ |
---|
684 | size_t n; \ |
---|
685 | for ( n = 0; n < max_size && \ |
---|
686 | (c = getc( _nsyyin )) != EOF && c != '\n'; ++n ) \ |
---|
687 | buf[n] = (char) c; \ |
---|
688 | if ( c == '\n' ) \ |
---|
689 | buf[n++] = (char) c; \ |
---|
690 | if ( c == EOF && ferror( _nsyyin ) ) \ |
---|
691 | YY_FATAL_ERROR( "input in flex scanner failed" ); \ |
---|
692 | result = n; \ |
---|
693 | } \ |
---|
694 | else \ |
---|
695 | { \ |
---|
696 | errno=0; \ |
---|
697 | while ( (result = fread(buf, 1, max_size, _nsyyin))==0 && ferror(_nsyyin)) \ |
---|
698 | { \ |
---|
699 | if( errno != EINTR) \ |
---|
700 | { \ |
---|
701 | YY_FATAL_ERROR( "input in flex scanner failed" ); \ |
---|
702 | break; \ |
---|
703 | } \ |
---|
704 | errno=0; \ |
---|
705 | clearerr(_nsyyin); \ |
---|
706 | } \ |
---|
707 | }\ |
---|
708 | \ |
---|
709 | |
---|
710 | #endif |
---|
711 | |
---|
712 | /* No semi-colon after return; correct usage is to write "yyterminate();" - |
---|
713 | * we don't want an extra ';' after the "return" because that will cause |
---|
714 | * some compilers to complain about unreachable statements. |
---|
715 | */ |
---|
716 | #ifndef yyterminate |
---|
717 | #define yyterminate() return YY_NULL |
---|
718 | #endif |
---|
719 | |
---|
720 | /* Number of entries by which start-condition stack grows. */ |
---|
721 | #ifndef YY_START_STACK_INCR |
---|
722 | #define YY_START_STACK_INCR 25 |
---|
723 | #endif |
---|
724 | |
---|
725 | /* Report a fatal error. */ |
---|
726 | #ifndef YY_FATAL_ERROR |
---|
727 | #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) |
---|
728 | #endif |
---|
729 | |
---|
730 | /* end tables serialization structures and prototypes */ |
---|
731 | |
---|
732 | /* Default declaration of generated scanner - a define so the user can |
---|
733 | * easily add parameters. |
---|
734 | */ |
---|
735 | #ifndef YY_DECL |
---|
736 | #define YY_DECL_IS_OURS 1 |
---|
737 | |
---|
738 | extern int _nsyylex (void); |
---|
739 | |
---|
740 | #define YY_DECL int _nsyylex (void) |
---|
741 | #endif /* !YY_DECL */ |
---|
742 | |
---|
743 | /* Code executed at the beginning of each rule, after _nsyytext and _nsyyleng |
---|
744 | * have been set up. |
---|
745 | */ |
---|
746 | #ifndef YY_USER_ACTION |
---|
747 | #define YY_USER_ACTION |
---|
748 | #endif |
---|
749 | |
---|
750 | /* Code executed at the end of each rule. */ |
---|
751 | #ifndef YY_BREAK |
---|
752 | #define YY_BREAK break; |
---|
753 | #endif |
---|
754 | |
---|
755 | #define YY_RULE_SETUP \ |
---|
756 | YY_USER_ACTION |
---|
757 | |
---|
758 | /** The main scanner function which does all the work. |
---|
759 | */ |
---|
760 | YY_DECL |
---|
761 | { |
---|
762 | yy_state_type yy_current_state; |
---|
763 | char *yy_cp, *yy_bp; |
---|
764 | int yy_act; |
---|
765 | |
---|
766 | #line 59 "nslexer.l" |
---|
767 | |
---|
768 | |
---|
769 | #line 770 "nslexer.c" |
---|
770 | |
---|
771 | if ( !(yy_init) ) |
---|
772 | { |
---|
773 | (yy_init) = 1; |
---|
774 | |
---|
775 | #ifdef YY_USER_INIT |
---|
776 | YY_USER_INIT; |
---|
777 | #endif |
---|
778 | |
---|
779 | if ( ! (yy_start) ) |
---|
780 | (yy_start) = 1; /* first start state */ |
---|
781 | |
---|
782 | if ( ! _nsyyin ) |
---|
783 | _nsyyin = stdin; |
---|
784 | |
---|
785 | if ( ! _nsyyout ) |
---|
786 | _nsyyout = stdout; |
---|
787 | |
---|
788 | if ( ! YY_CURRENT_BUFFER ) { |
---|
789 | _nsyyensure_buffer_stack (); |
---|
790 | YY_CURRENT_BUFFER_LVALUE = |
---|
791 | _nsyy_create_buffer(_nsyyin,YY_BUF_SIZE ); |
---|
792 | } |
---|
793 | |
---|
794 | _nsyy_load_buffer_state( ); |
---|
795 | } |
---|
796 | |
---|
797 | while ( 1 ) /* loops until end-of-file is reached */ |
---|
798 | { |
---|
799 | yy_cp = (yy_c_buf_p); |
---|
800 | |
---|
801 | /* Support of _nsyytext. */ |
---|
802 | *yy_cp = (yy_hold_char); |
---|
803 | |
---|
804 | /* yy_bp points to the position in yy_ch_buf of the start of |
---|
805 | * the current run. |
---|
806 | */ |
---|
807 | yy_bp = yy_cp; |
---|
808 | |
---|
809 | yy_current_state = (yy_start); |
---|
810 | yy_match: |
---|
811 | do |
---|
812 | { |
---|
813 | YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; |
---|
814 | if ( yy_accept[yy_current_state] ) |
---|
815 | { |
---|
816 | (yy_last_accepting_state) = yy_current_state; |
---|
817 | (yy_last_accepting_cpos) = yy_cp; |
---|
818 | } |
---|
819 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
---|
820 | { |
---|
821 | yy_current_state = (int) yy_def[yy_current_state]; |
---|
822 | if ( yy_current_state >= 59 ) |
---|
823 | yy_c = yy_meta[(unsigned int) yy_c]; |
---|
824 | } |
---|
825 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
---|
826 | ++yy_cp; |
---|
827 | } |
---|
828 | while ( yy_base[yy_current_state] != 69 ); |
---|
829 | |
---|
830 | yy_find_action: |
---|
831 | yy_act = yy_accept[yy_current_state]; |
---|
832 | if ( yy_act == 0 ) |
---|
833 | { /* have to back up */ |
---|
834 | yy_cp = (yy_last_accepting_cpos); |
---|
835 | yy_current_state = (yy_last_accepting_state); |
---|
836 | yy_act = yy_accept[yy_current_state]; |
---|
837 | } |
---|
838 | |
---|
839 | YY_DO_BEFORE_ACTION; |
---|
840 | |
---|
841 | if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) |
---|
842 | { |
---|
843 | yy_size_t yyl; |
---|
844 | for ( yyl = 0; yyl < _nsyyleng; ++yyl ) |
---|
845 | if ( _nsyytext[yyl] == '\n' ) |
---|
846 | |
---|
847 | _nsyylineno++; |
---|
848 | ; |
---|
849 | } |
---|
850 | |
---|
851 | do_action: /* This label is used only to access EOF actions. */ |
---|
852 | |
---|
853 | switch ( yy_act ) |
---|
854 | { /* beginning of action switch */ |
---|
855 | case 0: /* must back up */ |
---|
856 | /* undo the effects of YY_DO_BEFORE_ACTION */ |
---|
857 | *yy_cp = (yy_hold_char); |
---|
858 | yy_cp = (yy_last_accepting_cpos); |
---|
859 | yy_current_state = (yy_last_accepting_state); |
---|
860 | goto yy_find_action; |
---|
861 | |
---|
862 | case 1: |
---|
863 | YY_RULE_SETUP |
---|
864 | #line 61 "nslexer.l" |
---|
865 | ; /* skip whitespace */ |
---|
866 | YY_BREAK |
---|
867 | case 2: |
---|
868 | YY_RULE_SETUP |
---|
869 | #line 63 "nslexer.l" |
---|
870 | ; /* skip comments */ |
---|
871 | YY_BREAK |
---|
872 | case 3: |
---|
873 | /* rule 3 can match eol */ |
---|
874 | YY_RULE_SETUP |
---|
875 | #line 65 "nslexer.l" |
---|
876 | ; /* allow continuation */ |
---|
877 | YY_BREAK |
---|
878 | case 4: |
---|
879 | /* rule 4 can match eol */ |
---|
880 | YY_RULE_SETUP |
---|
881 | #line 67 "nslexer.l" |
---|
882 | return NL; |
---|
883 | YY_BREAK |
---|
884 | case 5: |
---|
885 | YY_RULE_SETUP |
---|
886 | #line 69 "nslexer.l" |
---|
887 | return SUCCESS; |
---|
888 | YY_BREAK |
---|
889 | case 6: |
---|
890 | YY_RULE_SETUP |
---|
891 | #line 70 "nslexer.l" |
---|
892 | return UNAVAIL; |
---|
893 | YY_BREAK |
---|
894 | case 7: |
---|
895 | YY_RULE_SETUP |
---|
896 | #line 71 "nslexer.l" |
---|
897 | return NOTFOUND; |
---|
898 | YY_BREAK |
---|
899 | case 8: |
---|
900 | YY_RULE_SETUP |
---|
901 | #line 72 "nslexer.l" |
---|
902 | return TRYAGAIN; |
---|
903 | YY_BREAK |
---|
904 | case 9: |
---|
905 | YY_RULE_SETUP |
---|
906 | #line 74 "nslexer.l" |
---|
907 | return RETURN; |
---|
908 | YY_BREAK |
---|
909 | case 10: |
---|
910 | YY_RULE_SETUP |
---|
911 | #line 75 "nslexer.l" |
---|
912 | return CONTINUE; |
---|
913 | YY_BREAK |
---|
914 | case 11: |
---|
915 | YY_RULE_SETUP |
---|
916 | #line 77 "nslexer.l" |
---|
917 | { |
---|
918 | char *p; |
---|
919 | int i; |
---|
920 | |
---|
921 | if ((p = strdup(_nsyytext)) == NULL) { |
---|
922 | syslog(LOG_ERR, |
---|
923 | "NSSWITCH(nslexer): memory allocation failure"); |
---|
924 | return ERRORTOKEN; |
---|
925 | } |
---|
926 | for (i = 0; i < strlen(p); i++) { |
---|
927 | if (isupper((unsigned char)p[i])) |
---|
928 | p[i] = tolower((unsigned char)p[i]); |
---|
929 | } |
---|
930 | _nsyylval.str = p; |
---|
931 | return STRING; |
---|
932 | } |
---|
933 | YY_BREAK |
---|
934 | case 12: |
---|
935 | YY_RULE_SETUP |
---|
936 | #line 94 "nslexer.l" |
---|
937 | return _nsyytext[0]; |
---|
938 | YY_BREAK |
---|
939 | case 13: |
---|
940 | YY_RULE_SETUP |
---|
941 | #line 96 "nslexer.l" |
---|
942 | ECHO; |
---|
943 | YY_BREAK |
---|
944 | #line 945 "nslexer.c" |
---|
945 | case YY_STATE_EOF(INITIAL): |
---|
946 | yyterminate(); |
---|
947 | |
---|
948 | case YY_END_OF_BUFFER: |
---|
949 | { |
---|
950 | /* Amount of text matched not including the EOB char. */ |
---|
951 | int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; |
---|
952 | |
---|
953 | /* Undo the effects of YY_DO_BEFORE_ACTION. */ |
---|
954 | *yy_cp = (yy_hold_char); |
---|
955 | YY_RESTORE_YY_MORE_OFFSET |
---|
956 | |
---|
957 | if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) |
---|
958 | { |
---|
959 | /* We're scanning a new file or input source. It's |
---|
960 | * possible that this happened because the user |
---|
961 | * just pointed _nsyyin at a new source and called |
---|
962 | * _nsyylex(). If so, then we have to assure |
---|
963 | * consistency between YY_CURRENT_BUFFER and our |
---|
964 | * globals. Here is the right place to do so, because |
---|
965 | * this is the first action (other than possibly a |
---|
966 | * back-up) that will match for the new input source. |
---|
967 | */ |
---|
968 | (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; |
---|
969 | YY_CURRENT_BUFFER_LVALUE->yy_input_file = _nsyyin; |
---|
970 | YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; |
---|
971 | } |
---|
972 | |
---|
973 | /* Note that here we test for yy_c_buf_p "<=" to the position |
---|
974 | * of the first EOB in the buffer, since yy_c_buf_p will |
---|
975 | * already have been incremented past the NUL character |
---|
976 | * (since all states make transitions on EOB to the |
---|
977 | * end-of-buffer state). Contrast this with the test |
---|
978 | * in input(). |
---|
979 | */ |
---|
980 | if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) |
---|
981 | { /* This was really a NUL. */ |
---|
982 | yy_state_type yy_next_state; |
---|
983 | |
---|
984 | (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; |
---|
985 | |
---|
986 | yy_current_state = yy_get_previous_state( ); |
---|
987 | |
---|
988 | /* Okay, we're now positioned to make the NUL |
---|
989 | * transition. We couldn't have |
---|
990 | * yy_get_previous_state() go ahead and do it |
---|
991 | * for us because it doesn't know how to deal |
---|
992 | * with the possibility of jamming (and we don't |
---|
993 | * want to build jamming into it because then it |
---|
994 | * will run more slowly). |
---|
995 | */ |
---|
996 | |
---|
997 | yy_next_state = yy_try_NUL_trans( yy_current_state ); |
---|
998 | |
---|
999 | yy_bp = (yytext_ptr) + YY_MORE_ADJ; |
---|
1000 | |
---|
1001 | if ( yy_next_state ) |
---|
1002 | { |
---|
1003 | /* Consume the NUL. */ |
---|
1004 | yy_cp = ++(yy_c_buf_p); |
---|
1005 | yy_current_state = yy_next_state; |
---|
1006 | goto yy_match; |
---|
1007 | } |
---|
1008 | |
---|
1009 | else |
---|
1010 | { |
---|
1011 | yy_cp = (yy_c_buf_p); |
---|
1012 | goto yy_find_action; |
---|
1013 | } |
---|
1014 | } |
---|
1015 | |
---|
1016 | else switch ( yy_get_next_buffer( ) ) |
---|
1017 | { |
---|
1018 | case EOB_ACT_END_OF_FILE: |
---|
1019 | { |
---|
1020 | (yy_did_buffer_switch_on_eof) = 0; |
---|
1021 | |
---|
1022 | if ( _nsyywrap( ) ) |
---|
1023 | { |
---|
1024 | /* Note: because we've taken care in |
---|
1025 | * yy_get_next_buffer() to have set up |
---|
1026 | * _nsyytext, we can now set up |
---|
1027 | * yy_c_buf_p so that if some total |
---|
1028 | * hoser (like flex itself) wants to |
---|
1029 | * call the scanner after we return the |
---|
1030 | * YY_NULL, it'll still work - another |
---|
1031 | * YY_NULL will get returned. |
---|
1032 | */ |
---|
1033 | (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; |
---|
1034 | |
---|
1035 | yy_act = YY_STATE_EOF(YY_START); |
---|
1036 | goto do_action; |
---|
1037 | } |
---|
1038 | |
---|
1039 | else |
---|
1040 | { |
---|
1041 | if ( ! (yy_did_buffer_switch_on_eof) ) |
---|
1042 | YY_NEW_FILE; |
---|
1043 | } |
---|
1044 | break; |
---|
1045 | } |
---|
1046 | |
---|
1047 | case EOB_ACT_CONTINUE_SCAN: |
---|
1048 | (yy_c_buf_p) = |
---|
1049 | (yytext_ptr) + yy_amount_of_matched_text; |
---|
1050 | |
---|
1051 | yy_current_state = yy_get_previous_state( ); |
---|
1052 | |
---|
1053 | yy_cp = (yy_c_buf_p); |
---|
1054 | yy_bp = (yytext_ptr) + YY_MORE_ADJ; |
---|
1055 | goto yy_match; |
---|
1056 | |
---|
1057 | case EOB_ACT_LAST_MATCH: |
---|
1058 | (yy_c_buf_p) = |
---|
1059 | &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; |
---|
1060 | |
---|
1061 | yy_current_state = yy_get_previous_state( ); |
---|
1062 | |
---|
1063 | yy_cp = (yy_c_buf_p); |
---|
1064 | yy_bp = (yytext_ptr) + YY_MORE_ADJ; |
---|
1065 | goto yy_find_action; |
---|
1066 | } |
---|
1067 | break; |
---|
1068 | } |
---|
1069 | |
---|
1070 | default: |
---|
1071 | YY_FATAL_ERROR( |
---|
1072 | "fatal flex scanner internal error--no action found" ); |
---|
1073 | } /* end of action switch */ |
---|
1074 | } /* end of scanning one token */ |
---|
1075 | } /* end of _nsyylex */ |
---|
1076 | |
---|
1077 | /* yy_get_next_buffer - try to read in a new buffer |
---|
1078 | * |
---|
1079 | * Returns a code representing an action: |
---|
1080 | * EOB_ACT_LAST_MATCH - |
---|
1081 | * EOB_ACT_CONTINUE_SCAN - continue scanning from current position |
---|
1082 | * EOB_ACT_END_OF_FILE - end of file |
---|
1083 | */ |
---|
1084 | static int yy_get_next_buffer (void) |
---|
1085 | { |
---|
1086 | char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; |
---|
1087 | char *source = (yytext_ptr); |
---|
1088 | int number_to_move, i; |
---|
1089 | int ret_val; |
---|
1090 | |
---|
1091 | if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) |
---|
1092 | YY_FATAL_ERROR( |
---|
1093 | "fatal flex scanner internal error--end of buffer missed" ); |
---|
1094 | |
---|
1095 | if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) |
---|
1096 | { /* Don't try to fill the buffer, so this is an EOF. */ |
---|
1097 | if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) |
---|
1098 | { |
---|
1099 | /* We matched a single character, the EOB, so |
---|
1100 | * treat this as a final EOF. |
---|
1101 | */ |
---|
1102 | return EOB_ACT_END_OF_FILE; |
---|
1103 | } |
---|
1104 | |
---|
1105 | else |
---|
1106 | { |
---|
1107 | /* We matched some text prior to the EOB, first |
---|
1108 | * process it. |
---|
1109 | */ |
---|
1110 | return EOB_ACT_LAST_MATCH; |
---|
1111 | } |
---|
1112 | } |
---|
1113 | |
---|
1114 | /* Try to read more data. */ |
---|
1115 | |
---|
1116 | /* First move last chars to start of buffer. */ |
---|
1117 | number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; |
---|
1118 | |
---|
1119 | for ( i = 0; i < number_to_move; ++i ) |
---|
1120 | *(dest++) = *(source++); |
---|
1121 | |
---|
1122 | if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) |
---|
1123 | /* don't do the read, it's not guaranteed to return an EOF, |
---|
1124 | * just force an EOF |
---|
1125 | */ |
---|
1126 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; |
---|
1127 | |
---|
1128 | else |
---|
1129 | { |
---|
1130 | yy_size_t num_to_read = |
---|
1131 | YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; |
---|
1132 | |
---|
1133 | while ( num_to_read <= 0 ) |
---|
1134 | { /* Not enough room in the buffer - grow it. */ |
---|
1135 | |
---|
1136 | /* just a shorter name for the current buffer */ |
---|
1137 | YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; |
---|
1138 | |
---|
1139 | int yy_c_buf_p_offset = |
---|
1140 | (int) ((yy_c_buf_p) - b->yy_ch_buf); |
---|
1141 | |
---|
1142 | if ( b->yy_is_our_buffer ) |
---|
1143 | { |
---|
1144 | yy_size_t new_size = b->yy_buf_size * 2; |
---|
1145 | |
---|
1146 | if ( new_size <= 0 ) |
---|
1147 | b->yy_buf_size += b->yy_buf_size / 8; |
---|
1148 | else |
---|
1149 | b->yy_buf_size *= 2; |
---|
1150 | |
---|
1151 | b->yy_ch_buf = (char *) |
---|
1152 | /* Include room in for 2 EOB chars. */ |
---|
1153 | _nsyyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); |
---|
1154 | } |
---|
1155 | else |
---|
1156 | /* Can't grow it, we don't own it. */ |
---|
1157 | b->yy_ch_buf = 0; |
---|
1158 | |
---|
1159 | if ( ! b->yy_ch_buf ) |
---|
1160 | YY_FATAL_ERROR( |
---|
1161 | "fatal error - scanner input buffer overflow" ); |
---|
1162 | |
---|
1163 | (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; |
---|
1164 | |
---|
1165 | num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - |
---|
1166 | number_to_move - 1; |
---|
1167 | |
---|
1168 | } |
---|
1169 | |
---|
1170 | if ( num_to_read > YY_READ_BUF_SIZE ) |
---|
1171 | num_to_read = YY_READ_BUF_SIZE; |
---|
1172 | |
---|
1173 | /* Read in more data. */ |
---|
1174 | YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), |
---|
1175 | (yy_n_chars), num_to_read ); |
---|
1176 | |
---|
1177 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); |
---|
1178 | } |
---|
1179 | |
---|
1180 | if ( (yy_n_chars) == 0 ) |
---|
1181 | { |
---|
1182 | if ( number_to_move == YY_MORE_ADJ ) |
---|
1183 | { |
---|
1184 | ret_val = EOB_ACT_END_OF_FILE; |
---|
1185 | _nsyyrestart(_nsyyin ); |
---|
1186 | } |
---|
1187 | |
---|
1188 | else |
---|
1189 | { |
---|
1190 | ret_val = EOB_ACT_LAST_MATCH; |
---|
1191 | YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = |
---|
1192 | YY_BUFFER_EOF_PENDING; |
---|
1193 | } |
---|
1194 | } |
---|
1195 | |
---|
1196 | else |
---|
1197 | ret_val = EOB_ACT_CONTINUE_SCAN; |
---|
1198 | |
---|
1199 | if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { |
---|
1200 | /* Extend the array by 50%, plus the number we really need. */ |
---|
1201 | yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); |
---|
1202 | YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) _nsyyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); |
---|
1203 | if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) |
---|
1204 | YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); |
---|
1205 | } |
---|
1206 | |
---|
1207 | (yy_n_chars) += number_to_move; |
---|
1208 | YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; |
---|
1209 | YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; |
---|
1210 | |
---|
1211 | (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; |
---|
1212 | |
---|
1213 | return ret_val; |
---|
1214 | } |
---|
1215 | |
---|
1216 | /* yy_get_previous_state - get the state just before the EOB char was reached */ |
---|
1217 | |
---|
1218 | static yy_state_type yy_get_previous_state (void) |
---|
1219 | { |
---|
1220 | yy_state_type yy_current_state; |
---|
1221 | char *yy_cp; |
---|
1222 | |
---|
1223 | yy_current_state = (yy_start); |
---|
1224 | |
---|
1225 | for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) |
---|
1226 | { |
---|
1227 | YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); |
---|
1228 | if ( yy_accept[yy_current_state] ) |
---|
1229 | { |
---|
1230 | (yy_last_accepting_state) = yy_current_state; |
---|
1231 | (yy_last_accepting_cpos) = yy_cp; |
---|
1232 | } |
---|
1233 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
---|
1234 | { |
---|
1235 | yy_current_state = (int) yy_def[yy_current_state]; |
---|
1236 | if ( yy_current_state >= 59 ) |
---|
1237 | yy_c = yy_meta[(unsigned int) yy_c]; |
---|
1238 | } |
---|
1239 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
---|
1240 | } |
---|
1241 | |
---|
1242 | return yy_current_state; |
---|
1243 | } |
---|
1244 | |
---|
1245 | /* yy_try_NUL_trans - try to make a transition on the NUL character |
---|
1246 | * |
---|
1247 | * synopsis |
---|
1248 | * next_state = yy_try_NUL_trans( current_state ); |
---|
1249 | */ |
---|
1250 | static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) |
---|
1251 | { |
---|
1252 | int yy_is_jam; |
---|
1253 | char *yy_cp = (yy_c_buf_p); |
---|
1254 | |
---|
1255 | YY_CHAR yy_c = 1; |
---|
1256 | if ( yy_accept[yy_current_state] ) |
---|
1257 | { |
---|
1258 | (yy_last_accepting_state) = yy_current_state; |
---|
1259 | (yy_last_accepting_cpos) = yy_cp; |
---|
1260 | } |
---|
1261 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
---|
1262 | { |
---|
1263 | yy_current_state = (int) yy_def[yy_current_state]; |
---|
1264 | if ( yy_current_state >= 59 ) |
---|
1265 | yy_c = yy_meta[(unsigned int) yy_c]; |
---|
1266 | } |
---|
1267 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
---|
1268 | yy_is_jam = (yy_current_state == 58); |
---|
1269 | |
---|
1270 | return yy_is_jam ? 0 : yy_current_state; |
---|
1271 | } |
---|
1272 | |
---|
1273 | #ifndef YY_NO_INPUT |
---|
1274 | #ifdef __cplusplus |
---|
1275 | static int yyinput (void) |
---|
1276 | #else |
---|
1277 | static int input (void) |
---|
1278 | #endif |
---|
1279 | |
---|
1280 | { |
---|
1281 | int c; |
---|
1282 | |
---|
1283 | *(yy_c_buf_p) = (yy_hold_char); |
---|
1284 | |
---|
1285 | if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) |
---|
1286 | { |
---|
1287 | /* yy_c_buf_p now points to the character we want to return. |
---|
1288 | * If this occurs *before* the EOB characters, then it's a |
---|
1289 | * valid NUL; if not, then we've hit the end of the buffer. |
---|
1290 | */ |
---|
1291 | if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) |
---|
1292 | /* This was really a NUL. */ |
---|
1293 | *(yy_c_buf_p) = '\0'; |
---|
1294 | |
---|
1295 | else |
---|
1296 | { /* need more input */ |
---|
1297 | yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); |
---|
1298 | ++(yy_c_buf_p); |
---|
1299 | |
---|
1300 | switch ( yy_get_next_buffer( ) ) |
---|
1301 | { |
---|
1302 | case EOB_ACT_LAST_MATCH: |
---|
1303 | /* This happens because yy_g_n_b() |
---|
1304 | * sees that we've accumulated a |
---|
1305 | * token and flags that we need to |
---|
1306 | * try matching the token before |
---|
1307 | * proceeding. But for input(), |
---|
1308 | * there's no matching to consider. |
---|
1309 | * So convert the EOB_ACT_LAST_MATCH |
---|
1310 | * to EOB_ACT_END_OF_FILE. |
---|
1311 | */ |
---|
1312 | |
---|
1313 | /* Reset buffer status. */ |
---|
1314 | _nsyyrestart(_nsyyin ); |
---|
1315 | |
---|
1316 | /*FALLTHROUGH*/ |
---|
1317 | |
---|
1318 | case EOB_ACT_END_OF_FILE: |
---|
1319 | { |
---|
1320 | if ( _nsyywrap( ) ) |
---|
1321 | return EOF; |
---|
1322 | |
---|
1323 | if ( ! (yy_did_buffer_switch_on_eof) ) |
---|
1324 | YY_NEW_FILE; |
---|
1325 | #ifdef __cplusplus |
---|
1326 | return yyinput(); |
---|
1327 | #else |
---|
1328 | return input(); |
---|
1329 | #endif |
---|
1330 | } |
---|
1331 | |
---|
1332 | case EOB_ACT_CONTINUE_SCAN: |
---|
1333 | (yy_c_buf_p) = (yytext_ptr) + offset; |
---|
1334 | break; |
---|
1335 | } |
---|
1336 | } |
---|
1337 | } |
---|
1338 | |
---|
1339 | c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ |
---|
1340 | *(yy_c_buf_p) = '\0'; /* preserve _nsyytext */ |
---|
1341 | (yy_hold_char) = *++(yy_c_buf_p); |
---|
1342 | |
---|
1343 | if ( c == '\n' ) |
---|
1344 | |
---|
1345 | _nsyylineno++; |
---|
1346 | ; |
---|
1347 | |
---|
1348 | return c; |
---|
1349 | } |
---|
1350 | #endif /* ifndef YY_NO_INPUT */ |
---|
1351 | |
---|
1352 | /** Immediately switch to a different input stream. |
---|
1353 | * @param input_file A readable stream. |
---|
1354 | * |
---|
1355 | * @note This function does not reset the start condition to @c INITIAL . |
---|
1356 | */ |
---|
1357 | void _nsyyrestart (FILE * input_file ) |
---|
1358 | { |
---|
1359 | |
---|
1360 | if ( ! YY_CURRENT_BUFFER ){ |
---|
1361 | _nsyyensure_buffer_stack (); |
---|
1362 | YY_CURRENT_BUFFER_LVALUE = |
---|
1363 | _nsyy_create_buffer(_nsyyin,YY_BUF_SIZE ); |
---|
1364 | } |
---|
1365 | |
---|
1366 | _nsyy_init_buffer(YY_CURRENT_BUFFER,input_file ); |
---|
1367 | _nsyy_load_buffer_state( ); |
---|
1368 | } |
---|
1369 | |
---|
1370 | /** Switch to a different input buffer. |
---|
1371 | * @param new_buffer The new input buffer. |
---|
1372 | * |
---|
1373 | */ |
---|
1374 | void _nsyy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) |
---|
1375 | { |
---|
1376 | |
---|
1377 | /* TODO. We should be able to replace this entire function body |
---|
1378 | * with |
---|
1379 | * _nsyypop_buffer_state(); |
---|
1380 | * _nsyypush_buffer_state(new_buffer); |
---|
1381 | */ |
---|
1382 | _nsyyensure_buffer_stack (); |
---|
1383 | if ( YY_CURRENT_BUFFER == new_buffer ) |
---|
1384 | return; |
---|
1385 | |
---|
1386 | if ( YY_CURRENT_BUFFER ) |
---|
1387 | { |
---|
1388 | /* Flush out information for old buffer. */ |
---|
1389 | *(yy_c_buf_p) = (yy_hold_char); |
---|
1390 | YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); |
---|
1391 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); |
---|
1392 | } |
---|
1393 | |
---|
1394 | YY_CURRENT_BUFFER_LVALUE = new_buffer; |
---|
1395 | _nsyy_load_buffer_state( ); |
---|
1396 | |
---|
1397 | /* We don't actually know whether we did this switch during |
---|
1398 | * EOF (_nsyywrap()) processing, but the only time this flag |
---|
1399 | * is looked at is after _nsyywrap() is called, so it's safe |
---|
1400 | * to go ahead and always set it. |
---|
1401 | */ |
---|
1402 | (yy_did_buffer_switch_on_eof) = 1; |
---|
1403 | } |
---|
1404 | |
---|
1405 | static void _nsyy_load_buffer_state (void) |
---|
1406 | { |
---|
1407 | (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; |
---|
1408 | (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; |
---|
1409 | _nsyyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; |
---|
1410 | (yy_hold_char) = *(yy_c_buf_p); |
---|
1411 | } |
---|
1412 | |
---|
1413 | /** Allocate and initialize an input buffer state. |
---|
1414 | * @param file A readable stream. |
---|
1415 | * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. |
---|
1416 | * |
---|
1417 | * @return the allocated buffer state. |
---|
1418 | */ |
---|
1419 | YY_BUFFER_STATE _nsyy_create_buffer (FILE * file, int size ) |
---|
1420 | { |
---|
1421 | YY_BUFFER_STATE b; |
---|
1422 | |
---|
1423 | b = (YY_BUFFER_STATE) _nsyyalloc(sizeof( struct yy_buffer_state ) ); |
---|
1424 | if ( ! b ) |
---|
1425 | YY_FATAL_ERROR( "out of dynamic memory in _nsyy_create_buffer()" ); |
---|
1426 | |
---|
1427 | b->yy_buf_size = size; |
---|
1428 | |
---|
1429 | /* yy_ch_buf has to be 2 characters longer than the size given because |
---|
1430 | * we need to put in 2 end-of-buffer characters. |
---|
1431 | */ |
---|
1432 | b->yy_ch_buf = (char *) _nsyyalloc(b->yy_buf_size + 2 ); |
---|
1433 | if ( ! b->yy_ch_buf ) |
---|
1434 | YY_FATAL_ERROR( "out of dynamic memory in _nsyy_create_buffer()" ); |
---|
1435 | |
---|
1436 | b->yy_is_our_buffer = 1; |
---|
1437 | |
---|
1438 | _nsyy_init_buffer(b,file ); |
---|
1439 | |
---|
1440 | return b; |
---|
1441 | } |
---|
1442 | |
---|
1443 | /** Destroy the buffer. |
---|
1444 | * @param b a buffer created with _nsyy_create_buffer() |
---|
1445 | * |
---|
1446 | */ |
---|
1447 | void _nsyy_delete_buffer (YY_BUFFER_STATE b ) |
---|
1448 | { |
---|
1449 | |
---|
1450 | if ( ! b ) |
---|
1451 | return; |
---|
1452 | |
---|
1453 | if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ |
---|
1454 | YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; |
---|
1455 | |
---|
1456 | if ( b->yy_is_our_buffer ) |
---|
1457 | _nsyyfree((void *) b->yy_ch_buf ); |
---|
1458 | |
---|
1459 | _nsyyfree((void *) b ); |
---|
1460 | } |
---|
1461 | |
---|
1462 | /* Initializes or reinitializes a buffer. |
---|
1463 | * This function is sometimes called more than once on the same buffer, |
---|
1464 | * such as during a _nsyyrestart() or at EOF. |
---|
1465 | */ |
---|
1466 | static void _nsyy_init_buffer (YY_BUFFER_STATE b, FILE * file ) |
---|
1467 | |
---|
1468 | { |
---|
1469 | int oerrno = errno; |
---|
1470 | |
---|
1471 | _nsyy_flush_buffer(b ); |
---|
1472 | |
---|
1473 | b->yy_input_file = file; |
---|
1474 | b->yy_fill_buffer = 1; |
---|
1475 | |
---|
1476 | /* If b is the current buffer, then _nsyy_init_buffer was _probably_ |
---|
1477 | * called from _nsyyrestart() or through yy_get_next_buffer. |
---|
1478 | * In that case, we don't want to reset the lineno or column. |
---|
1479 | */ |
---|
1480 | if (b != YY_CURRENT_BUFFER){ |
---|
1481 | b->yy_bs_lineno = 1; |
---|
1482 | b->yy_bs_column = 0; |
---|
1483 | } |
---|
1484 | |
---|
1485 | b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; |
---|
1486 | |
---|
1487 | errno = oerrno; |
---|
1488 | } |
---|
1489 | |
---|
1490 | /** Discard all buffered characters. On the next scan, YY_INPUT will be called. |
---|
1491 | * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. |
---|
1492 | * |
---|
1493 | */ |
---|
1494 | void _nsyy_flush_buffer (YY_BUFFER_STATE b ) |
---|
1495 | { |
---|
1496 | if ( ! b ) |
---|
1497 | return; |
---|
1498 | |
---|
1499 | b->yy_n_chars = 0; |
---|
1500 | |
---|
1501 | /* We always need two end-of-buffer characters. The first causes |
---|
1502 | * a transition to the end-of-buffer state. The second causes |
---|
1503 | * a jam in that state. |
---|
1504 | */ |
---|
1505 | b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; |
---|
1506 | b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; |
---|
1507 | |
---|
1508 | b->yy_buf_pos = &b->yy_ch_buf[0]; |
---|
1509 | |
---|
1510 | b->yy_at_bol = 1; |
---|
1511 | b->yy_buffer_status = YY_BUFFER_NEW; |
---|
1512 | |
---|
1513 | if ( b == YY_CURRENT_BUFFER ) |
---|
1514 | _nsyy_load_buffer_state( ); |
---|
1515 | } |
---|
1516 | |
---|
1517 | /** Pushes the new state onto the stack. The new state becomes |
---|
1518 | * the current state. This function will allocate the stack |
---|
1519 | * if necessary. |
---|
1520 | * @param new_buffer The new state. |
---|
1521 | * |
---|
1522 | */ |
---|
1523 | void _nsyypush_buffer_state (YY_BUFFER_STATE new_buffer ) |
---|
1524 | { |
---|
1525 | if (new_buffer == NULL) |
---|
1526 | return; |
---|
1527 | |
---|
1528 | _nsyyensure_buffer_stack(); |
---|
1529 | |
---|
1530 | /* This block is copied from _nsyy_switch_to_buffer. */ |
---|
1531 | if ( YY_CURRENT_BUFFER ) |
---|
1532 | { |
---|
1533 | /* Flush out information for old buffer. */ |
---|
1534 | *(yy_c_buf_p) = (yy_hold_char); |
---|
1535 | YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); |
---|
1536 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); |
---|
1537 | } |
---|
1538 | |
---|
1539 | /* Only push if top exists. Otherwise, replace top. */ |
---|
1540 | if (YY_CURRENT_BUFFER) |
---|
1541 | (yy_buffer_stack_top)++; |
---|
1542 | YY_CURRENT_BUFFER_LVALUE = new_buffer; |
---|
1543 | |
---|
1544 | /* copied from _nsyy_switch_to_buffer. */ |
---|
1545 | _nsyy_load_buffer_state( ); |
---|
1546 | (yy_did_buffer_switch_on_eof) = 1; |
---|
1547 | } |
---|
1548 | |
---|
1549 | /** Removes and deletes the top of the stack, if present. |
---|
1550 | * The next element becomes the new top. |
---|
1551 | * |
---|
1552 | */ |
---|
1553 | void _nsyypop_buffer_state (void) |
---|
1554 | { |
---|
1555 | if (!YY_CURRENT_BUFFER) |
---|
1556 | return; |
---|
1557 | |
---|
1558 | _nsyy_delete_buffer(YY_CURRENT_BUFFER ); |
---|
1559 | YY_CURRENT_BUFFER_LVALUE = NULL; |
---|
1560 | if ((yy_buffer_stack_top) > 0) |
---|
1561 | --(yy_buffer_stack_top); |
---|
1562 | |
---|
1563 | if (YY_CURRENT_BUFFER) { |
---|
1564 | _nsyy_load_buffer_state( ); |
---|
1565 | (yy_did_buffer_switch_on_eof) = 1; |
---|
1566 | } |
---|
1567 | } |
---|
1568 | |
---|
1569 | /* Allocates the stack if it does not exist. |
---|
1570 | * Guarantees space for at least one push. |
---|
1571 | */ |
---|
1572 | static void _nsyyensure_buffer_stack (void) |
---|
1573 | { |
---|
1574 | yy_size_t num_to_alloc; |
---|
1575 | |
---|
1576 | if (!(yy_buffer_stack)) { |
---|
1577 | |
---|
1578 | /* First allocation is just for 2 elements, since we don't know if this |
---|
1579 | * scanner will even need a stack. We use 2 instead of 1 to avoid an |
---|
1580 | * immediate realloc on the next call. |
---|
1581 | */ |
---|
1582 | num_to_alloc = 1; |
---|
1583 | (yy_buffer_stack) = (struct yy_buffer_state**)_nsyyalloc |
---|
1584 | (num_to_alloc * sizeof(struct yy_buffer_state*) |
---|
1585 | ); |
---|
1586 | if ( ! (yy_buffer_stack) ) |
---|
1587 | YY_FATAL_ERROR( "out of dynamic memory in _nsyyensure_buffer_stack()" ); |
---|
1588 | |
---|
1589 | memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); |
---|
1590 | |
---|
1591 | (yy_buffer_stack_max) = num_to_alloc; |
---|
1592 | (yy_buffer_stack_top) = 0; |
---|
1593 | return; |
---|
1594 | } |
---|
1595 | |
---|
1596 | if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ |
---|
1597 | |
---|
1598 | /* Increase the buffer to prepare for a possible push. */ |
---|
1599 | int grow_size = 8 /* arbitrary grow size */; |
---|
1600 | |
---|
1601 | num_to_alloc = (yy_buffer_stack_max) + grow_size; |
---|
1602 | (yy_buffer_stack) = (struct yy_buffer_state**)_nsyyrealloc |
---|
1603 | ((yy_buffer_stack), |
---|
1604 | num_to_alloc * sizeof(struct yy_buffer_state*) |
---|
1605 | ); |
---|
1606 | if ( ! (yy_buffer_stack) ) |
---|
1607 | YY_FATAL_ERROR( "out of dynamic memory in _nsyyensure_buffer_stack()" ); |
---|
1608 | |
---|
1609 | /* zero only the new slots.*/ |
---|
1610 | memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); |
---|
1611 | (yy_buffer_stack_max) = num_to_alloc; |
---|
1612 | } |
---|
1613 | } |
---|
1614 | |
---|
1615 | /** Setup the input buffer state to scan directly from a user-specified character buffer. |
---|
1616 | * @param base the character buffer |
---|
1617 | * @param size the size in bytes of the character buffer |
---|
1618 | * |
---|
1619 | * @return the newly allocated buffer state object. |
---|
1620 | */ |
---|
1621 | YY_BUFFER_STATE _nsyy_scan_buffer (char * base, yy_size_t size ) |
---|
1622 | { |
---|
1623 | YY_BUFFER_STATE b; |
---|
1624 | |
---|
1625 | if ( size < 2 || |
---|
1626 | base[size-2] != YY_END_OF_BUFFER_CHAR || |
---|
1627 | base[size-1] != YY_END_OF_BUFFER_CHAR ) |
---|
1628 | /* They forgot to leave room for the EOB's. */ |
---|
1629 | return 0; |
---|
1630 | |
---|
1631 | b = (YY_BUFFER_STATE) _nsyyalloc(sizeof( struct yy_buffer_state ) ); |
---|
1632 | if ( ! b ) |
---|
1633 | YY_FATAL_ERROR( "out of dynamic memory in _nsyy_scan_buffer()" ); |
---|
1634 | |
---|
1635 | b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ |
---|
1636 | b->yy_buf_pos = b->yy_ch_buf = base; |
---|
1637 | b->yy_is_our_buffer = 0; |
---|
1638 | b->yy_input_file = 0; |
---|
1639 | b->yy_n_chars = b->yy_buf_size; |
---|
1640 | b->yy_is_interactive = 0; |
---|
1641 | b->yy_at_bol = 1; |
---|
1642 | b->yy_fill_buffer = 0; |
---|
1643 | b->yy_buffer_status = YY_BUFFER_NEW; |
---|
1644 | |
---|
1645 | _nsyy_switch_to_buffer(b ); |
---|
1646 | |
---|
1647 | return b; |
---|
1648 | } |
---|
1649 | |
---|
1650 | /** Setup the input buffer state to scan a string. The next call to _nsyylex() will |
---|
1651 | * scan from a @e copy of @a str. |
---|
1652 | * @param yystr a NUL-terminated string to scan |
---|
1653 | * |
---|
1654 | * @return the newly allocated buffer state object. |
---|
1655 | * @note If you want to scan bytes that may contain NUL values, then use |
---|
1656 | * _nsyy_scan_bytes() instead. |
---|
1657 | */ |
---|
1658 | YY_BUFFER_STATE _nsyy_scan_string (yyconst char * yystr ) |
---|
1659 | { |
---|
1660 | |
---|
1661 | return _nsyy_scan_bytes(yystr,strlen(yystr) ); |
---|
1662 | } |
---|
1663 | |
---|
1664 | /** Setup the input buffer state to scan the given bytes. The next call to _nsyylex() will |
---|
1665 | * scan from a @e copy of @a bytes. |
---|
1666 | * @param yybytes the byte buffer to scan |
---|
1667 | * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. |
---|
1668 | * |
---|
1669 | * @return the newly allocated buffer state object. |
---|
1670 | */ |
---|
1671 | YY_BUFFER_STATE _nsyy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) |
---|
1672 | { |
---|
1673 | YY_BUFFER_STATE b; |
---|
1674 | char *buf; |
---|
1675 | yy_size_t n; |
---|
1676 | yy_size_t i; |
---|
1677 | |
---|
1678 | /* Get memory for full buffer, including space for trailing EOB's. */ |
---|
1679 | n = _yybytes_len + 2; |
---|
1680 | buf = (char *) _nsyyalloc(n ); |
---|
1681 | if ( ! buf ) |
---|
1682 | YY_FATAL_ERROR( "out of dynamic memory in _nsyy_scan_bytes()" ); |
---|
1683 | |
---|
1684 | for ( i = 0; i < _yybytes_len; ++i ) |
---|
1685 | buf[i] = yybytes[i]; |
---|
1686 | |
---|
1687 | buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; |
---|
1688 | |
---|
1689 | b = _nsyy_scan_buffer(buf,n ); |
---|
1690 | if ( ! b ) |
---|
1691 | YY_FATAL_ERROR( "bad buffer in _nsyy_scan_bytes()" ); |
---|
1692 | |
---|
1693 | /* It's okay to grow etc. this buffer, and we should throw it |
---|
1694 | * away when we're done. |
---|
1695 | */ |
---|
1696 | b->yy_is_our_buffer = 1; |
---|
1697 | |
---|
1698 | return b; |
---|
1699 | } |
---|
1700 | |
---|
1701 | #ifndef YY_EXIT_FAILURE |
---|
1702 | #define YY_EXIT_FAILURE 2 |
---|
1703 | #endif |
---|
1704 | |
---|
1705 | static void yy_fatal_error (yyconst char* msg ) |
---|
1706 | { |
---|
1707 | (void) fprintf( stderr, "%s\n", msg ); |
---|
1708 | exit( YY_EXIT_FAILURE ); |
---|
1709 | } |
---|
1710 | |
---|
1711 | /* Redefine yyless() so it works in section 3 code. */ |
---|
1712 | |
---|
1713 | #undef yyless |
---|
1714 | #define yyless(n) \ |
---|
1715 | do \ |
---|
1716 | { \ |
---|
1717 | /* Undo effects of setting up _nsyytext. */ \ |
---|
1718 | int yyless_macro_arg = (n); \ |
---|
1719 | YY_LESS_LINENO(yyless_macro_arg);\ |
---|
1720 | _nsyytext[_nsyyleng] = (yy_hold_char); \ |
---|
1721 | (yy_c_buf_p) = _nsyytext + yyless_macro_arg; \ |
---|
1722 | (yy_hold_char) = *(yy_c_buf_p); \ |
---|
1723 | *(yy_c_buf_p) = '\0'; \ |
---|
1724 | _nsyyleng = yyless_macro_arg; \ |
---|
1725 | } \ |
---|
1726 | while ( 0 ) |
---|
1727 | |
---|
1728 | /* Accessor methods (get/set functions) to struct members. */ |
---|
1729 | |
---|
1730 | /** Get the current line number. |
---|
1731 | * |
---|
1732 | */ |
---|
1733 | int _nsyyget_lineno (void) |
---|
1734 | { |
---|
1735 | |
---|
1736 | return _nsyylineno; |
---|
1737 | } |
---|
1738 | |
---|
1739 | /** Get the input stream. |
---|
1740 | * |
---|
1741 | */ |
---|
1742 | FILE *_nsyyget_in (void) |
---|
1743 | { |
---|
1744 | return _nsyyin; |
---|
1745 | } |
---|
1746 | |
---|
1747 | /** Get the output stream. |
---|
1748 | * |
---|
1749 | */ |
---|
1750 | FILE *_nsyyget_out (void) |
---|
1751 | { |
---|
1752 | return _nsyyout; |
---|
1753 | } |
---|
1754 | |
---|
1755 | /** Get the length of the current token. |
---|
1756 | * |
---|
1757 | */ |
---|
1758 | yy_size_t _nsyyget_leng (void) |
---|
1759 | { |
---|
1760 | return _nsyyleng; |
---|
1761 | } |
---|
1762 | |
---|
1763 | /** Get the current token. |
---|
1764 | * |
---|
1765 | */ |
---|
1766 | |
---|
1767 | char *_nsyyget_text (void) |
---|
1768 | { |
---|
1769 | return _nsyytext; |
---|
1770 | } |
---|
1771 | |
---|
1772 | /** Set the current line number. |
---|
1773 | * @param line_number |
---|
1774 | * |
---|
1775 | */ |
---|
1776 | void _nsyyset_lineno (int line_number ) |
---|
1777 | { |
---|
1778 | |
---|
1779 | _nsyylineno = line_number; |
---|
1780 | } |
---|
1781 | |
---|
1782 | /** Set the input stream. This does not discard the current |
---|
1783 | * input buffer. |
---|
1784 | * @param in_str A readable stream. |
---|
1785 | * |
---|
1786 | * @see _nsyy_switch_to_buffer |
---|
1787 | */ |
---|
1788 | void _nsyyset_in (FILE * in_str ) |
---|
1789 | { |
---|
1790 | _nsyyin = in_str ; |
---|
1791 | } |
---|
1792 | |
---|
1793 | void _nsyyset_out (FILE * out_str ) |
---|
1794 | { |
---|
1795 | _nsyyout = out_str ; |
---|
1796 | } |
---|
1797 | |
---|
1798 | int _nsyyget_debug (void) |
---|
1799 | { |
---|
1800 | return _nsyy_flex_debug; |
---|
1801 | } |
---|
1802 | |
---|
1803 | void _nsyyset_debug (int bdebug ) |
---|
1804 | { |
---|
1805 | _nsyy_flex_debug = bdebug ; |
---|
1806 | } |
---|
1807 | |
---|
1808 | static int yy_init_globals (void) |
---|
1809 | { |
---|
1810 | /* Initialization is the same as for the non-reentrant scanner. |
---|
1811 | * This function is called from _nsyylex_destroy(), so don't allocate here. |
---|
1812 | */ |
---|
1813 | |
---|
1814 | /* We do not touch _nsyylineno unless the option is enabled. */ |
---|
1815 | _nsyylineno = 1; |
---|
1816 | |
---|
1817 | (yy_buffer_stack) = 0; |
---|
1818 | (yy_buffer_stack_top) = 0; |
---|
1819 | (yy_buffer_stack_max) = 0; |
---|
1820 | (yy_c_buf_p) = (char *) 0; |
---|
1821 | (yy_init) = 0; |
---|
1822 | (yy_start) = 0; |
---|
1823 | |
---|
1824 | /* Defined in main.c */ |
---|
1825 | #ifdef YY_STDINIT |
---|
1826 | _nsyyin = stdin; |
---|
1827 | _nsyyout = stdout; |
---|
1828 | #else |
---|
1829 | _nsyyin = (FILE *) 0; |
---|
1830 | _nsyyout = (FILE *) 0; |
---|
1831 | #endif |
---|
1832 | |
---|
1833 | /* For future reference: Set errno on error, since we are called by |
---|
1834 | * _nsyylex_init() |
---|
1835 | */ |
---|
1836 | return 0; |
---|
1837 | } |
---|
1838 | |
---|
1839 | /* _nsyylex_destroy is for both reentrant and non-reentrant scanners. */ |
---|
1840 | int _nsyylex_destroy (void) |
---|
1841 | { |
---|
1842 | |
---|
1843 | /* Pop the buffer stack, destroying each element. */ |
---|
1844 | while(YY_CURRENT_BUFFER){ |
---|
1845 | _nsyy_delete_buffer(YY_CURRENT_BUFFER ); |
---|
1846 | YY_CURRENT_BUFFER_LVALUE = NULL; |
---|
1847 | _nsyypop_buffer_state(); |
---|
1848 | } |
---|
1849 | |
---|
1850 | /* Destroy the stack itself. */ |
---|
1851 | _nsyyfree((yy_buffer_stack) ); |
---|
1852 | (yy_buffer_stack) = NULL; |
---|
1853 | |
---|
1854 | /* Reset the globals. This is important in a non-reentrant scanner so the next time |
---|
1855 | * _nsyylex() is called, initialization will occur. */ |
---|
1856 | yy_init_globals( ); |
---|
1857 | |
---|
1858 | return 0; |
---|
1859 | } |
---|
1860 | |
---|
1861 | /* |
---|
1862 | * Internal utility routines. |
---|
1863 | */ |
---|
1864 | |
---|
1865 | #ifndef yytext_ptr |
---|
1866 | static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) |
---|
1867 | { |
---|
1868 | int i; |
---|
1869 | for ( i = 0; i < n; ++i ) |
---|
1870 | s1[i] = s2[i]; |
---|
1871 | } |
---|
1872 | #endif |
---|
1873 | |
---|
1874 | #ifdef YY_NEED_STRLEN |
---|
1875 | static int yy_flex_strlen (yyconst char * s ) |
---|
1876 | { |
---|
1877 | int n; |
---|
1878 | for ( n = 0; s[n]; ++n ) |
---|
1879 | ; |
---|
1880 | |
---|
1881 | return n; |
---|
1882 | } |
---|
1883 | #endif |
---|
1884 | |
---|
1885 | void *_nsyyalloc (yy_size_t size ) |
---|
1886 | { |
---|
1887 | return (void *) malloc( size ); |
---|
1888 | } |
---|
1889 | |
---|
1890 | void *_nsyyrealloc (void * ptr, yy_size_t size ) |
---|
1891 | { |
---|
1892 | /* The cast to (char *) in the following accommodates both |
---|
1893 | * implementations that use char* generic pointers, and those |
---|
1894 | * that use void* generic pointers. It works with the latter |
---|
1895 | * because both ANSI C and C++ allow castless assignment from |
---|
1896 | * any pointer type to void*, and deal with argument conversions |
---|
1897 | * as though doing an assignment. |
---|
1898 | */ |
---|
1899 | return (void *) realloc( (char *) ptr, size ); |
---|
1900 | } |
---|
1901 | |
---|
1902 | void _nsyyfree (void * ptr ) |
---|
1903 | { |
---|
1904 | free( (char *) ptr ); /* see _nsyyrealloc() for (char *) cast */ |
---|
1905 | } |
---|
1906 | |
---|
1907 | #define YYTABLES_NAME "yytables" |
---|
1908 | |
---|
1909 | #line 96 "nslexer.l" |
---|
1910 | |
---|
1911 | |
---|
1912 | |
---|
1913 | #undef _nsyywrap |
---|
1914 | int |
---|
1915 | _nsyywrap(void) |
---|
1916 | { |
---|
1917 | return 1; |
---|
1918 | } /* _nsyywrap */ |
---|
1919 | |
---|
1920 | void |
---|
1921 | _nsyyerror(const char *msg) |
---|
1922 | { |
---|
1923 | |
---|
1924 | syslog(LOG_ERR, "NSSWITCH(nslexer): %s line %d: %s at '%s'", |
---|
1925 | _PATH_NS_CONF, _nsyylineno, msg, _nsyytext); |
---|
1926 | } /* _nsyyerror */ |
---|
1927 | |
---|