1 /* A lexical scanner generated by flex */
3 /* Scanner skeleton version:
4 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
5 * $FreeBSD: src/usr.bin/lex/flex.skl,v 1.8 2004/01/06 19:03:44 nectar Exp $
8 #if defined(__FreeBSD__)
15 #define YY_FLEX_MAJOR_VERSION 2
16 #define YY_FLEX_MINOR_VERSION 5
21 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
34 /* Use prototypes in function declarations. */
37 /* The "const" storage-class-modifier is valid. */
40 #else /* ! __cplusplus */
48 #endif /* ! __cplusplus */
67 #define YY_PROTO(proto) proto
69 #define YY_PROTO(proto) ()
72 /* Returned upon end-of-file. */
75 /* Promotes a possibly negative, possibly signed char to an unsigned
76 * integer for use as an array index. If the signed char is negative,
77 * we want to instead treat it as an 8-bit unsigned char, hence the
80 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
82 /* Enter a start condition. This macro really ought to take a parameter,
83 * but we do it the disgusting crufty way forced on us by the ()-less
84 * definition of BEGIN.
86 #define BEGIN yy_start = 1 + 2 *
88 /* Translate the current start state into a value that can be later handed
89 * to BEGIN to return to the state. The YYSTATE alias is for lex
92 #define YY_START ((yy_start - 1) / 2)
93 #define YYSTATE YY_START
95 /* Action number for EOF rule of a given start state. */
96 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
98 /* Special action meaning "start processing a new file". */
99 #define YY_NEW_FILE yyrestart( yyin )
101 #define YY_END_OF_BUFFER_CHAR 0
103 /* Size of default input buffer. */
104 #define YY_BUF_SIZE 16384
106 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
109 extern FILE *yyin
, *yyout
;
111 #define EOB_ACT_CONTINUE_SCAN 0
112 #define EOB_ACT_END_OF_FILE 1
113 #define EOB_ACT_LAST_MATCH 2
115 /* The funky do-while in the following #define is used to turn the definition
116 * int a single C statement (which needs a semi-colon terminator). This
117 * avoids problems with code like:
119 * if ( condition_holds )
122 * do_something_else();
124 * Prior to using the do-while the compiler would get upset at the
125 * "else" because it interpreted the "if" statement as being all
126 * done when it reached the ';' after the yyless() call.
129 /* Return all but the first 'n' matched characters back to the input stream. */
134 /* Undo effects of setting up yytext. */ \
135 *yy_cp = yy_hold_char; \
136 YY_RESTORE_YY_MORE_OFFSET \
137 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
138 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
142 #define unput(c) yyunput( c, yytext_ptr )
144 /* The following is because we cannot portably get our hands on size_t
145 * (without autoconf's help, which isn't available because we want
146 * flex-generated scanners to compile on their own).
148 typedef unsigned int yy_size_t
;
151 struct yy_buffer_state
155 char *yy_ch_buf
; /* input buffer */
156 char *yy_buf_pos
; /* current position in input buffer */
158 /* Size of input buffer in bytes, not including room for EOB
161 yy_size_t yy_buf_size
;
163 /* Number of characters read into yy_ch_buf, not including EOB
168 /* Whether we "own" the buffer - i.e., we know we created it,
169 * and can realloc() it to grow it, and should free() it to
172 int yy_is_our_buffer
;
174 /* Whether this is an "interactive" input source; if so, and
175 * if we're using stdio for input, then we want to use getc()
176 * instead of fread(), to make sure we stop fetching input after
179 int yy_is_interactive
;
181 /* Whether we're considered to be at the beginning of a line.
182 * If so, '^' rules will be active on the next match, otherwise
187 /* Whether to try to fill the input buffer when we reach the
192 int yy_buffer_status
;
193 #define YY_BUFFER_NEW 0
194 #define YY_BUFFER_NORMAL 1
195 /* When an EOF's been seen but there's still some text to process
196 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
197 * shouldn't try reading from the input source any more. We might
198 * still have a bunch of tokens to match, though, because of
199 * possible backing-up.
201 * When we actually see the EOF, we change the status to "new"
202 * (via yyrestart()), so that the user can continue scanning by
203 * just pointing yyin at a new input file.
205 #define YY_BUFFER_EOF_PENDING 2
208 static YY_BUFFER_STATE yy_current_buffer
= 0;
210 /* We provide macros for accessing buffer states in case in the
211 * future we want to put the buffer states in a more general
214 #define YY_CURRENT_BUFFER yy_current_buffer
217 /* yy_hold_char holds the character lost when yytext is formed. */
218 static char yy_hold_char
;
220 static int yy_n_chars
; /* number of characters read into yy_ch_buf */
225 /* Points to current character in buffer. */
226 static char *yy_c_buf_p
= (char *) 0;
227 static int yy_init
= 1; /* whether we need to initialize */
228 static int yy_start
= 0; /* start state number */
230 /* Flag which is used to allow yywrap()'s to do buffer switches
231 * instead of setting up a fresh yyin. A bit of a hack ...
233 static int yy_did_buffer_switch_on_eof
;
235 void yyrestart
YY_PROTO(( FILE *input_file
));
237 void yy_switch_to_buffer
YY_PROTO(( YY_BUFFER_STATE new_buffer
));
238 void yy_load_buffer_state
YY_PROTO(( void ));
239 YY_BUFFER_STATE yy_create_buffer
YY_PROTO(( FILE *file
, int size
));
240 void yy_delete_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
241 void yy_init_buffer
YY_PROTO(( YY_BUFFER_STATE b
, FILE *file
));
242 void yy_flush_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
243 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
245 YY_BUFFER_STATE yy_scan_buffer
YY_PROTO(( char *base
, yy_size_t size
));
246 YY_BUFFER_STATE yy_scan_string
YY_PROTO(( yyconst
char *yy_str
));
247 YY_BUFFER_STATE yy_scan_bytes
YY_PROTO(( yyconst
char *bytes
, int len
));
249 static void *yy_flex_alloc
YY_PROTO(( yy_size_t
));
250 static void *yy_flex_realloc
YY_PROTO(( void *, yy_size_t
)) __unused
;
251 static void yy_flex_free
YY_PROTO(( void * ));
253 #define yy_new_buffer yy_create_buffer
255 #define yy_set_interactive(is_interactive) \
257 if ( ! yy_current_buffer ) \
258 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
259 yy_current_buffer->yy_is_interactive = is_interactive; \
262 #define yy_set_bol(at_bol) \
264 if ( ! yy_current_buffer ) \
265 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
266 yy_current_buffer->yy_at_bol = at_bol; \
269 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
271 typedef unsigned char YY_CHAR
;
272 FILE *yyin
= (FILE *) 0, *yyout
= (FILE *) 0;
273 typedef int yy_state_type
;
275 #define yytext_ptr yytext
277 static yy_state_type yy_get_previous_state
YY_PROTO(( void ));
278 static yy_state_type yy_try_NUL_trans
YY_PROTO(( yy_state_type current_state
));
279 static int yy_get_next_buffer
YY_PROTO(( void ));
280 static void yy_fatal_error
YY_PROTO(( yyconst
char msg
[] ));
282 /* Done after the current pattern has been matched and before the
283 * corresponding action - sets up yytext.
285 #define YY_DO_BEFORE_ACTION \
286 yytext_ptr = yy_bp; \
287 yyleng = (int) (yy_cp - yy_bp); \
288 yy_hold_char = *yy_cp; \
292 #define YY_NUM_RULES 81
293 #define YY_END_OF_BUFFER 82
294 static yyconst
short int yy_accept
[517] =
296 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
297 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
298 0, 0, 0, 0, 82, 81, 71, 72, 81, 73,
299 76, 80, 80, 75, 74, 77, 78, 79, 80, 80,
300 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
301 80, 80, 80, 2, 2, 2, 4, 4, 4, 74,
302 80, 80, 42, 80, 80, 43, 49, 49, 49, 62,
303 62, 62, 81, 6, 6, 6, 81, 71, 0, 70,
304 73, 80, 74, 80, 74, 80, 80, 80, 80, 80,
305 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
307 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
308 80, 80, 80, 17, 2, 2, 2, 2, 4, 4,
309 4, 4, 8, 8, 42, 80, 42, 41, 40, 49,
310 49, 49, 49, 62, 62, 62, 62, 0, 66, 6,
311 6, 6, 6, 0, 69, 80, 80, 80, 80, 80,
312 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
313 80, 80, 53, 80, 80, 80, 80, 80, 80, 80,
314 80, 80, 52, 80, 80, 80, 80, 80, 80, 80,
315 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
316 80, 7, 80, 80, 3, 80, 80, 80, 80, 80,
318 80, 80, 80, 80, 80, 80, 80, 80, 5, 80,
319 80, 80, 80, 80, 80, 80, 80, 80, 80, 15,
320 80, 80, 80, 80, 80, 80, 80, 38, 80, 80,
321 80, 80, 80, 80, 80, 22, 21, 80, 80, 80,
322 80, 80, 64, 80, 80, 80, 80, 80, 80, 80,
323 80, 80, 80, 16, 80, 63, 80, 80, 80, 80,
324 80, 80, 80, 80, 8, 80, 80, 80, 80, 80,
325 80, 80, 80, 67, 80, 80, 80, 80, 80, 80,
326 80, 80, 80, 80, 80, 80, 80, 80, 19, 80,
327 10, 80, 80, 80, 80, 80, 12, 65, 80, 45,
329 80, 80, 59, 9, 80, 80, 80, 54, 80, 80,
330 58, 80, 68, 80, 80, 80, 61, 80, 80, 80,
331 80, 80, 80, 80, 80, 80, 80, 80, 80, 14,
332 80, 46, 57, 80, 80, 80, 80, 80, 80, 56,
333 39, 47, 80, 80, 80, 80, 80, 80, 80, 80,
334 80, 80, 50, 80, 55, 80, 80, 80, 51, 80,
335 80, 80, 80, 80, 1, 80, 80, 80, 80, 80,
336 80, 80, 80, 80, 80, 80, 80, 80, 80, 13,
337 80, 80, 80, 80, 80, 80, 80, 80, 11, 80,
338 80, 80, 80, 80, 80, 80, 24, 80, 60, 80,
340 80, 80, 80, 27, 80, 80, 34, 80, 18, 80,
341 80, 80, 80, 80, 80, 80, 80, 80, 80, 20,
342 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
343 80, 80, 80, 80, 80, 48, 80, 80, 80, 80,
344 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
345 80, 80, 80, 29, 80, 80, 80, 80, 80, 80,
346 80, 80, 80, 80, 80, 37, 80, 80, 31, 80,
347 80, 44, 80, 80, 80, 80, 80, 80, 80, 80,
348 80, 80, 80, 80, 80, 80, 28, 80, 80, 80,
349 25, 80, 80, 80, 23, 80, 30, 80, 80, 32,
351 80, 80, 80, 80, 80, 80, 80, 80, 80, 35,
352 80, 26, 80, 36, 33, 0
355 static yyconst
int yy_ec
[256] =
357 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
358 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
359 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
360 1, 2, 1, 4, 5, 1, 1, 1, 1, 1,
361 1, 1, 1, 6, 7, 8, 9, 10, 10, 10,
362 10, 10, 11, 10, 10, 10, 10, 12, 13, 1,
363 1, 1, 1, 1, 14, 15, 16, 17, 15, 15,
364 18, 19, 18, 18, 18, 18, 20, 18, 18, 18,
365 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
366 1, 1, 1, 1, 18, 1, 21, 22, 23, 24,
368 25, 26, 27, 28, 29, 18, 30, 31, 32, 33,
369 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
370 44, 18, 45, 1, 46, 1, 1, 1, 1, 1,
371 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
372 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
373 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
374 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
375 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
376 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
377 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
379 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
380 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
381 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
382 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
383 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
387 static yyconst
int yy_meta
[47] =
389 1, 1, 2, 1, 1, 1, 3, 3, 1, 3,
390 3, 3, 1, 3, 3, 3, 3, 3, 3, 3,
391 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
392 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
396 static yyconst
short int yy_base
[533] =
398 0, 46, 74, 0, 113, 159, 0, 0, 205, 251,
399 288, 0, 8, 25, 314, 360, 406, 452, 767, 766,
400 498, 544, 765, 764, 767, 772, 764, 772, 761, 0,
401 772, 0, 4, 772, 12, 772, 772, 772, 744, 0,
402 740, 4, 719, 0, 4, 736, 726, 32, 724, 5,
403 41, 44, 724, 0, 16, 66, 0, 53, 70, 583,
404 74, 76, 117, 736, 732, 772, 0, 78, 121, 0,
405 90, 125, 751, 0, 127, 131, 750, 751, 748, 772,
406 0, 0, 133, 135, 139, 737, 726, 41, 710, 716,
407 716, 714, 716, 709, 722, 704, 734, 733, 71, 695,
409 705, 699, 701, 696, 700, 123, 118, 701, 150, 695,
410 97, 696, 709, 0, 0, 144, 164, 169, 0, 171,
411 173, 177, 181, 717, 184, 186, 190, 0, 0, 0,
412 192, 209, 213, 0, 215, 217, 221, 724, 772, 0,
413 223, 225, 229, 723, 772, 710, 688, 690, 689, 694,
414 698, 699, 698, 694, 688, 693, 676, 208, 693, 682,
415 183, 687, 682, 676, 223, 702, 679, 676, 680, 666,
416 677, 674, 0, 671, 667, 663, 659, 669, 660, 672,
417 688, 687, 600, 10, 668, 655, 649, 665, 651, 644,
418 658, 0, 649, 215, 0, 664, 660, 645, 642, 648,
420 643, 642, 166, 655, 128, 670, 638, 641, 0, 54,
421 640, 641, 613, 604, 602, 605, 604, 585, 594, 0,
422 580, 213, 617, 593, 595, 565, 573, 0, 568, 589,
423 570, 559, 563, 555, 562, 0, 0, 547, 560, 554,
424 550, 555, 0, 554, 545, 544, 552, 225, 551, 542,
425 537, 530, 549, 0, 564, 0, 544, 531, 530, 528,
426 527, 540, 540, 538, 550, 544, 549, 521, 519, 517,
427 513, 518, 534, 0, 516, 528, 504, 512, 497, 514,
428 513, 499, 492, 499, 493, 495, 503, 490, 0, 501,
429 518, 490, 500, 493, 493, 481, 0, 0, 482, 0,
431 485, 506, 0, 509, 487, 485, 488, 482, 477, 494,
432 0, 473, 0, 451, 455, 470, 0, 459, 470, 449,
433 457, 451, 446, 453, 456, 453, 449, 455, 442, 0,
434 439, 0, 0, 444, 446, 454, 439, 450, 453, 0,
435 0, 0, 444, 447, 432, 441, 444, 447, 426, 441,
436 441, 426, 0, 418, 0, 420, 423, 413, 0, 425,
437 404, 400, 411, 408, 0, 416, 407, 402, 409, 412,
438 399, 410, 395, 401, 400, 394, 396, 390, 403, 0,
439 402, 393, 388, 417, 416, 389, 384, 382, 0, 393,
440 384, 379, 396, 371, 372, 363, 392, 391, 0, 364,
442 224, 389, 388, 0, 357, 354, 0, 244, 0, 358,
443 384, 352, 355, 367, 363, 352, 352, 245, 358, 0,
444 359, 348, 348, 246, 355, 346, 346, 353, 344, 354,
445 350, 338, 346, 334, 325, 0, 332, 321, 317, 322,
446 327, 314, 329, 317, 324, 315, 323, 308, 323, 319,
447 310, 300, 296, 0, 314, 309, 312, 299, 314, 309,
448 308, 303, 294, 309, 304, 0, 290, 293, 0, 296,
449 279, 0, 269, 273, 276, 271, 258, 256, 286, 254,
450 258, 252, 282, 250, 254, 248, 0, 252, 246, 276,
451 0, 249, 243, 273, 0, 258, 0, 245, 256, 0,
453 243, 243, 253, 241, 251, 246, 214, 213, 146, 0,
454 131, 0, 115, 0, 0, 772, 643, 646, 649, 652,
455 655, 658, 661, 664, 131, 102, 87, 18, 9, 667,
459 static yyconst
short int yy_def
[533] =
461 517, 517, 2, 3, 518, 518, 2, 2, 519, 519,
462 2, 11, 2, 2, 520, 520, 521, 521, 2, 2,
463 522, 522, 2, 2, 516, 516, 516, 516, 523, 524,
464 516, 525, 525, 516, 525, 516, 516, 516, 525, 525,
465 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
466 525, 525, 525, 526, 526, 526, 527, 527, 527, 525,
467 60, 525, 525, 525, 525, 516, 528, 528, 528, 529,
468 529, 529, 530, 531, 531, 531, 532, 516, 523, 516,
469 524, 525, 525, 525, 525, 525, 525, 525, 525, 525,
470 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
472 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
473 525, 525, 525, 525, 526, 526, 526, 526, 527, 527,
474 527, 527, 525, 525, 525, 525, 525, 525, 525, 528,
475 528, 528, 528, 529, 529, 529, 529, 530, 516, 531,
476 531, 531, 531, 532, 516, 525, 525, 525, 525, 525,
477 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
478 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
479 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
480 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
481 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
483 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
484 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
485 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
486 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
487 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
488 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
489 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
490 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
491 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
492 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
494 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
495 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
496 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
497 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
498 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
499 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
500 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
501 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
502 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
503 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
505 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
506 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
507 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
508 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
509 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
510 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
511 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
512 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
513 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
514 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
516 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
517 525, 525, 525, 525, 525, 0, 516, 516, 516, 516,
518 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
522 static yyconst
short int yy_nxt
[819] =
524 26, 27, 28, 29, 30, 31, 140, 33, 34, 35,
525 35, 134, 36, 83, 83, 62, 224, 63, 63, 84,
526 130, 85, 85, 87, 97, 116, 116, 98, 91, 225,
527 88, 95, 62, 96, 63, 63, 99, 92, 105, 89,
528 64, 106, 65, 93, 37, 38, 26, 27, 28, 29,
529 30, 31, 66, 33, 34, 35, 35, 64, 36, 65,
530 102, 107, 120, 120, 108, 109, 110, 148, 111, 66,
531 103, 149, 112, 117, 113, 118, 118, 121, 251, 122,
532 122, 82, 252, 124, 124, 125, 125, 131, 131, 119,
533 37, 38, 39, 160, 40, 41, 161, 42, 43, 135,
535 135, 44, 45, 46, 115, 47, 48, 49, 50, 162,
536 51, 52, 53, 26, 27, 28, 29, 30, 31, 179,
537 55, 34, 56, 56, 126, 36, 127, 127, 132, 180,
538 133, 133, 136, 82, 137, 137, 141, 141, 142, 515,
539 143, 143, 83, 83, 83, 83, 84, 169, 85, 85,
540 171, 246, 172, 116, 116, 514, 170, 37, 38, 26,
541 27, 28, 29, 30, 31, 247, 55, 34, 56, 56,
542 174, 36, 175, 116, 116, 176, 117, 513, 118, 118,
543 120, 120, 120, 120, 121, 177, 122, 122, 84, 243,
544 85, 85, 183, 125, 125, 125, 125, 126, 244, 127,
546 127, 131, 131, 37, 38, 26, 27, 28, 29, 30,
547 31, 200, 58, 34, 59, 59, 201, 36, 131, 131,
548 132, 234, 133, 133, 135, 135, 135, 135, 136, 205,
549 137, 137, 141, 141, 141, 141, 142, 512, 143, 143,
550 196, 263, 197, 264, 415, 511, 235, 416, 286, 37,
551 38, 26, 27, 28, 29, 30, 31, 206, 58, 34,
552 59, 59, 287, 36, 421, 431, 437, 422, 432, 438,
553 510, 509, 508, 507, 506, 505, 504, 503, 502, 501,
554 500, 499, 498, 497, 496, 495, 494, 493, 492, 491,
555 490, 489, 488, 487, 486, 37, 38, 60, 60, 485,
557 484, 61, 61, 61, 61, 483, 482, 481, 61, 61,
558 61, 61, 61, 61, 26, 27, 28, 29, 30, 31,
559 480, 68, 34, 69, 69, 479, 36, 478, 477, 476,
560 475, 474, 473, 472, 471, 470, 469, 468, 467, 466,
561 465, 464, 463, 462, 461, 460, 459, 458, 457, 456,
562 455, 454, 453, 452, 451, 450, 449, 448, 37, 38,
563 26, 27, 28, 29, 30, 31, 447, 68, 34, 69,
564 69, 446, 36, 445, 444, 443, 442, 441, 440, 439,
565 436, 435, 434, 433, 430, 429, 428, 427, 426, 425,
566 424, 423, 420, 419, 418, 417, 414, 413, 412, 411,
568 410, 409, 408, 407, 37, 38, 26, 27, 28, 29,
569 30, 31, 406, 71, 34, 72, 72, 405, 36, 404,
570 403, 402, 401, 400, 399, 398, 397, 396, 395, 394,
571 393, 392, 391, 390, 389, 388, 387, 386, 385, 384,
572 383, 382, 381, 380, 379, 378, 377, 376, 375, 374,
573 37, 38, 26, 27, 28, 29, 30, 31, 373, 71,
574 34, 72, 72, 372, 36, 371, 370, 369, 368, 367,
575 366, 365, 364, 363, 362, 361, 360, 359, 358, 357,
576 356, 355, 354, 353, 352, 351, 350, 349, 348, 347,
577 346, 345, 344, 343, 342, 341, 37, 38, 26, 27,
579 28, 29, 30, 31, 340, 75, 34, 76, 76, 339,
580 36, 338, 337, 336, 335, 334, 333, 332, 331, 330,
581 329, 328, 327, 326, 325, 324, 323, 322, 321, 320,
582 319, 318, 317, 316, 315, 314, 313, 312, 311, 310,
583 309, 308, 37, 38, 26, 27, 28, 29, 30, 31,
584 307, 75, 34, 76, 76, 306, 36, 305, 304, 303,
585 302, 183, 301, 300, 299, 298, 297, 296, 295, 294,
586 293, 292, 291, 290, 289, 288, 285, 284, 283, 282,
587 281, 280, 279, 278, 277, 276, 275, 274, 37, 38,
588 84, 273, 123, 123, 272, 271, 124, 124, 124, 124,
590 270, 269, 268, 124, 124, 124, 124, 124, 124, 223,
591 223, 267, 266, 223, 223, 223, 223, 262, 261, 260,
592 223, 223, 223, 223, 223, 223, 265, 265, 259, 258,
593 265, 265, 265, 265, 257, 256, 255, 265, 265, 265,
594 265, 265, 265, 32, 32, 32, 54, 54, 54, 57,
595 57, 57, 67, 67, 67, 70, 70, 70, 74, 74,
596 74, 79, 79, 79, 81, 254, 81, 138, 138, 138,
597 144, 144, 144, 253, 250, 249, 248, 245, 242, 241,
598 240, 239, 238, 237, 236, 233, 232, 231, 230, 229,
599 228, 227, 226, 222, 221, 220, 219, 218, 217, 216,
601 215, 214, 213, 212, 211, 210, 209, 208, 207, 204,
602 203, 202, 199, 198, 195, 194, 193, 192, 191, 190,
603 189, 188, 187, 186, 185, 184, 145, 139, 183, 182,
604 181, 178, 173, 168, 167, 166, 165, 164, 163, 159,
605 158, 157, 156, 155, 154, 153, 152, 151, 150, 147,
606 146, 80, 78, 145, 139, 129, 128, 114, 104, 101,
607 100, 94, 90, 86, 80, 78, 516, 77, 77, 73,
608 73, 25, 516, 516, 516, 516, 516, 516, 516, 516,
609 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
610 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
612 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
613 516, 516, 516, 516, 516, 516, 516, 516
616 static yyconst
short int yy_chk
[819] =
618 1, 1, 1, 1, 1, 1, 531, 1, 1, 1,
619 1, 529, 1, 33, 33, 13, 184, 13, 13, 35,
620 528, 35, 35, 40, 45, 55, 55, 45, 42, 184,
621 40, 44, 14, 44, 14, 14, 45, 42, 50, 40,
622 13, 50, 13, 42, 1, 1, 2, 2, 2, 2,
623 2, 2, 13, 2, 2, 2, 2, 14, 2, 14,
624 48, 51, 58, 58, 51, 51, 52, 88, 52, 14,
625 48, 88, 52, 56, 52, 56, 56, 59, 210, 59,
626 59, 61, 210, 61, 61, 62, 62, 68, 68, 527,
627 2, 2, 3, 99, 3, 3, 99, 3, 3, 71,
629 71, 3, 3, 3, 526, 3, 3, 3, 3, 99,
630 3, 3, 3, 5, 5, 5, 5, 5, 5, 111,
631 5, 5, 5, 5, 63, 5, 63, 63, 69, 111,
632 69, 69, 72, 525, 72, 72, 75, 75, 76, 513,
633 76, 76, 83, 83, 84, 84, 85, 106, 85, 85,
634 107, 205, 107, 116, 116, 511, 106, 5, 5, 6,
635 6, 6, 6, 6, 6, 205, 6, 6, 6, 6,
636 109, 6, 109, 117, 117, 109, 118, 509, 118, 118,
637 120, 120, 121, 121, 122, 109, 122, 122, 123, 203,
638 123, 123, 123, 125, 125, 126, 126, 127, 203, 127,
640 127, 131, 131, 6, 6, 9, 9, 9, 9, 9,
641 9, 161, 9, 9, 9, 9, 161, 9, 132, 132,
642 133, 194, 133, 133, 135, 135, 136, 136, 137, 165,
643 137, 137, 141, 141, 142, 142, 143, 508, 143, 143,
644 158, 222, 158, 222, 401, 507, 194, 401, 248, 9,
645 9, 10, 10, 10, 10, 10, 10, 165, 10, 10,
646 10, 10, 248, 10, 408, 418, 424, 408, 418, 424,
647 506, 505, 504, 503, 502, 501, 499, 498, 496, 494,
648 493, 492, 490, 489, 488, 486, 485, 484, 483, 482,
649 481, 480, 479, 478, 477, 10, 10, 11, 11, 476,
651 475, 11, 11, 11, 11, 474, 473, 471, 11, 11,
652 11, 11, 11, 11, 15, 15, 15, 15, 15, 15,
653 470, 15, 15, 15, 15, 468, 15, 467, 465, 464,
654 463, 462, 461, 460, 459, 458, 457, 456, 455, 453,
655 452, 451, 450, 449, 448, 447, 446, 445, 444, 443,
656 442, 441, 440, 439, 438, 437, 435, 434, 15, 15,
657 16, 16, 16, 16, 16, 16, 433, 16, 16, 16,
658 16, 432, 16, 431, 430, 429, 428, 427, 426, 425,
659 423, 422, 421, 419, 417, 416, 415, 414, 413, 412,
660 411, 410, 406, 405, 403, 402, 400, 398, 397, 396,
662 395, 394, 393, 392, 16, 16, 17, 17, 17, 17,
663 17, 17, 391, 17, 17, 17, 17, 390, 17, 388,
664 387, 386, 385, 384, 383, 382, 381, 379, 378, 377,
665 376, 375, 374, 373, 372, 371, 370, 369, 368, 367,
666 366, 364, 363, 362, 361, 360, 358, 357, 356, 354,
667 17, 17, 18, 18, 18, 18, 18, 18, 352, 18,
668 18, 18, 18, 351, 18, 350, 349, 348, 347, 346,
669 345, 344, 343, 339, 338, 337, 336, 335, 334, 331,
670 329, 328, 327, 326, 325, 324, 323, 322, 321, 320,
671 319, 318, 316, 315, 314, 312, 18, 18, 21, 21,
673 21, 21, 21, 21, 310, 21, 21, 21, 21, 309,
674 21, 308, 307, 306, 305, 304, 302, 301, 299, 296,
675 295, 294, 293, 292, 291, 290, 288, 287, 286, 285,
676 284, 283, 282, 281, 280, 279, 278, 277, 276, 275,
677 273, 272, 21, 21, 22, 22, 22, 22, 22, 22,
678 271, 22, 22, 22, 22, 270, 22, 269, 268, 267,
679 266, 265, 264, 263, 262, 261, 260, 259, 258, 257,
680 255, 253, 252, 251, 250, 249, 247, 246, 245, 244,
681 242, 241, 240, 239, 238, 235, 234, 233, 22, 22,
682 60, 232, 60, 60, 231, 230, 60, 60, 60, 60,
684 229, 227, 226, 60, 60, 60, 60, 60, 60, 183,
685 183, 225, 224, 183, 183, 183, 183, 221, 219, 218,
686 183, 183, 183, 183, 183, 183, 223, 223, 217, 216,
687 223, 223, 223, 223, 215, 214, 213, 223, 223, 223,
688 223, 223, 223, 517, 517, 517, 518, 518, 518, 519,
689 519, 519, 520, 520, 520, 521, 521, 521, 522, 522,
690 522, 523, 523, 523, 524, 212, 524, 530, 530, 530,
691 532, 532, 532, 211, 208, 207, 206, 204, 202, 201,
692 200, 199, 198, 197, 196, 193, 191, 190, 189, 188,
693 187, 186, 185, 182, 181, 180, 179, 178, 177, 176,
695 175, 174, 172, 171, 170, 169, 168, 167, 166, 164,
696 163, 162, 160, 159, 157, 156, 155, 154, 153, 152,
697 151, 150, 149, 148, 147, 146, 144, 138, 124, 113,
698 112, 110, 108, 105, 104, 103, 102, 101, 100, 98,
699 97, 96, 95, 94, 93, 92, 91, 90, 89, 87,
700 86, 79, 78, 77, 73, 65, 64, 53, 49, 47,
701 46, 43, 41, 39, 29, 27, 25, 24, 23, 20,
702 19, 516, 516, 516, 516, 516, 516, 516, 516, 516,
703 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
704 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
706 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
707 516, 516, 516, 516, 516, 516, 516, 516
710 static yy_state_type yy_last_accepting_state
;
711 static char *yy_last_accepting_cpos
;
713 /* The intent behind this definition is that it'll catch
714 * any uses of REJECT which flex missed.
716 #define REJECT reject_used_but_not_detected
717 #define yymore() yymore_used_but_not_detected
718 #define YY_MORE_ADJ 0
719 #define YY_RESTORE_YY_MORE_OFFSET
723 /* $KAME: cftoken.l,v 1.35 2005/01/12 06:06:11 suz Exp $ */
726 * Copyright (C) 2002 WIDE Project.
727 * All rights reserved.
729 * Redistribution and use in source and binary forms, with or without
730 * modification, are permitted provided that the following conditions
732 * 1. Redistributions of source code must retain the above copyright
733 * notice, this list of conditions and the following disclaimer.
734 * 2. Redistributions in binary form must reproduce the above copyright
735 * notice, this list of conditions and the following disclaimer in the
736 * documentation and/or other materials provided with the distribution.
737 * 3. Neither the name of the project nor the names of its contributors
738 * may be used to endorse or promote products derived from this software
739 * without specific prior written permission.
741 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
742 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
743 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
744 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
745 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
746 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
747 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
748 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
749 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
750 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
753 #include <sys/types.h>
754 #include <sys/param.h>
755 #include <sys/socket.h>
756 #include <sys/queue.h>
757 #include <sys/time.h>
759 #include <netinet/in.h>
775 #define YY_NO_UNPUT 1
777 char *configfilename
;
781 /* Recursion limit for includes */
782 #define MAX_INCLUDE_DEPTH 10
784 static struct include_stack
{
786 YY_BUFFER_STATE state
;
788 } incstack
[MAX_INCLUDE_DEPTH
];
792 static int yy_first_time
= 1;
793 static int yyerrorcount
= 0;
795 #ifndef NOCONFIG_DEBUG
803 extern int yyparse
__P((void));
804 extern int cf_post_config
__P((void));
806 static void cfdebug_print
__P((char *, char *, int));
808 #define DP(str) if (cfdebug) cfdebug_print(str, yytext, yyleng)
809 #define DECHO if (cfdebug) cfdebug_print(NULL, yytext, yyleng);
810 #define DNOECHO if (cfdebug) cfdebug_print(NULL, "****", yyleng);
830 #define S_ADDRPOOL 10
836 /* Macros after this point can all be overridden by user definitions in
840 #ifndef YY_SKIP_YYWRAP
842 extern "C" int yywrap
YY_PROTO(( void ));
844 extern int yywrap
YY_PROTO(( void ));
849 static void yyunput
YY_PROTO(( int c
, char *buf_ptr
));
853 static void yy_flex_strncpy
YY_PROTO(( char *, yyconst
char *, int ));
856 #ifdef YY_NEED_STRLEN
857 static int yy_flex_strlen
YY_PROTO(( yyconst
char * ));
862 static int yyinput
YY_PROTO(( void ));
864 static int input
YY_PROTO(( void ));
869 static int yy_start_stack_ptr
= 0;
870 static int yy_start_stack_depth
= 0;
871 static int *yy_start_stack
= 0;
872 #ifndef YY_NO_PUSH_STATE
873 static void yy_push_state
YY_PROTO(( int new_state
));
875 #ifndef YY_NO_POP_STATE
876 static void yy_pop_state
YY_PROTO(( void ));
878 #ifndef YY_NO_TOP_STATE
879 static int yy_top_state
YY_PROTO(( void ));
883 #define YY_NO_PUSH_STATE 1
884 #define YY_NO_POP_STATE 1
885 #define YY_NO_TOP_STATE 1
888 #ifdef YY_MALLOC_DECL
896 /* Just try to get by without declaring the routines. This will fail
897 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
898 * or sizeof(void*) != sizeof(int).
903 /* Amount of stuff to slurp up with each read. */
904 #ifndef YY_READ_BUF_SIZE
905 #define YY_READ_BUF_SIZE 8192
908 /* Copy whatever the last rule matched to the standard output. */
911 /* This used to be an fputs(), but since the string might contain NUL's,
912 * we now use fwrite().
914 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
917 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
918 * is returned in "result".
921 #define YY_INPUT(buf,result,max_size) \
922 if ( yy_current_buffer->yy_is_interactive ) \
925 for ( n = 0; n < max_size && \
926 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
929 buf[n++] = (char) c; \
930 if ( c == EOF && ferror( yyin ) ) \
931 YY_FATAL_ERROR( "input in flex scanner failed" ); \
934 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
935 && ferror( yyin ) ) \
936 YY_FATAL_ERROR( "input in flex scanner failed" );
939 /* No semi-colon after return; correct usage is to write "yyterminate();" -
940 * we don't want an extra ';' after the "return" because that will cause
941 * some compilers to complain about unreachable statements.
944 #define yyterminate() return YY_NULL
947 /* Number of entries by which start-condition stack grows. */
948 #ifndef YY_START_STACK_INCR
949 #define YY_START_STACK_INCR 25
952 /* Report a fatal error. */
953 #ifndef YY_FATAL_ERROR
954 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
957 /* Default declaration of generated scanner - a define so the user can
958 * easily add parameters.
961 #define YY_DECL int yylex YY_PROTO(( void ))
964 /* Code executed at the beginning of each rule, after yytext and yyleng
967 #ifndef YY_USER_ACTION
968 #define YY_USER_ACTION
971 /* Code executed at the end of each rule. */
973 #define YY_BREAK break;
976 #define YY_RULE_SETUP \
981 register yy_state_type yy_current_state
;
982 register char *yy_cp
, *yy_bp
;
985 #line 124 "cftoken.l"
993 /* interface configuration */
1005 yy_start
= 1; /* first start state */
1013 if ( ! yy_current_buffer
)
1015 yy_create_buffer( yyin
, YY_BUF_SIZE
);
1017 yy_load_buffer_state();
1020 while ( 1 ) /* loops until end-of-file is reached */
1024 /* Support of yytext. */
1025 *yy_cp
= yy_hold_char
;
1027 /* yy_bp points to the position in yy_ch_buf of the start of
1032 yy_current_state
= yy_start
;
1036 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
1037 if ( yy_accept
[yy_current_state
] )
1039 yy_last_accepting_state
= yy_current_state
;
1040 yy_last_accepting_cpos
= yy_cp
;
1042 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1044 yy_current_state
= (int) yy_def
[yy_current_state
];
1045 if ( yy_current_state
>= 517 )
1046 yy_c
= yy_meta
[(unsigned int) yy_c
];
1048 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1051 while ( yy_base
[yy_current_state
] != 772 );
1054 yy_act
= yy_accept
[yy_current_state
];
1056 { /* have to back up */
1057 yy_cp
= yy_last_accepting_cpos
;
1058 yy_current_state
= yy_last_accepting_state
;
1059 yy_act
= yy_accept
[yy_current_state
];
1062 YY_DO_BEFORE_ACTION
;
1065 do_action
: /* This label is used only to access EOF actions. */
1069 { /* beginning of action switch */
1070 case 0: /* must back up */
1071 /* undo the effects of YY_DO_BEFORE_ACTION */
1072 *yy_cp
= yy_hold_char
;
1073 yy_cp
= yy_last_accepting_cpos
;
1074 yy_current_state
= yy_last_accepting_state
;
1075 goto yy_find_action
;
1079 #line 132 "cftoken.l"
1080 { DECHO
; BEGIN S_IFACE
; return (INTERFACE
); }
1084 #line 133 "cftoken.l"
1087 yylval
.str
= strdup(yytext
);
1092 /* host configuration */
1095 #line 141 "cftoken.l"
1096 { DECHO
; BEGIN S_HOST
; return (HOST
); }
1100 #line 142 "cftoken.l"
1103 yylval
.str
= strdup(yytext
);
1108 /* address pool configuration */
1111 #line 150 "cftoken.l"
1112 { DECHO
; BEGIN S_ADDRPOOL
; return (ADDRPOOL
); }
1116 #line 152 "cftoken.l"
1119 yylval
.str
= strdup(yytext
);
1126 #line 159 "cftoken.l"
1127 { DECHO
; BEGIN S_DUID
; return (DUID
); }
1131 #line 160 "cftoken.l"
1134 yylval
.str
= strdup(yytext
);
1141 #line 167 "cftoken.l"
1142 { DECHO
; return (ADDRESS
); }
1146 #line 169 "cftoken.l"
1147 { DECHO
; return (PREFIX
); }
1151 #line 171 "cftoken.l"
1152 { DECHO
; return (PREFERENCE
); }
1156 #line 173 "cftoken.l"
1157 { DECHO
; return (SCRIPT
); }
1161 #line 175 "cftoken.l"
1162 { DECHO
; return (DELAYEDKEY
); }
1167 #line 178 "cftoken.l"
1168 { DECHO
; return (REQUEST
); }
1173 #line 181 "cftoken.l"
1174 { DECHO
; return (SEND
); }
1179 #line 184 "cftoken.l"
1180 { DECHO
; return (RANGE
); }
1184 #line 185 "cftoken.l"
1185 { DECHO
; return (TO
); }
1190 #line 188 "cftoken.l"
1191 { DECHO
; return (ADDRESS_POOL
); }
1196 #line 191 "cftoken.l"
1197 { DECHO
; return (OPTION
); }
1201 #line 193 "cftoken.l"
1202 { DECHO
; return (RAPID_COMMIT
); }
1206 #line 194 "cftoken.l"
1207 { DECHO
; return (IA_PD
); }
1211 #line 195 "cftoken.l"
1212 { DECHO
; return (IA_NA
); }
1216 #line 196 "cftoken.l"
1217 { DECHO
; return (DNS_SERVERS
); }
1221 #line 197 "cftoken.l"
1222 { DECHO
; return (DNS_NAME
); }
1226 #line 198 "cftoken.l"
1227 { DECHO
; return (SIP_SERVERS
); }
1231 #line 199 "cftoken.l"
1232 { DECHO
; return (SIP_NAME
); }
1236 #line 200 "cftoken.l"
1237 { DECHO
; return (NTP_SERVERS
); }
1241 #line 201 "cftoken.l"
1242 { DECHO
; return (NIS_SERVERS
); }
1246 #line 202 "cftoken.l"
1247 { DECHO
; return (NIS_NAME
); }
1251 #line 203 "cftoken.l"
1252 { DECHO
; return (NISP_SERVERS
); }
1256 #line 204 "cftoken.l"
1257 { DECHO
; return (NISP_NAME
); }
1261 #line 205 "cftoken.l"
1262 { DECHO
; return (BCMCS_SERVERS
); }
1266 #line 206 "cftoken.l"
1267 { DECHO
; return (BCMCS_NAME
); }
1271 #line 207 "cftoken.l"
1272 { DECHO
; return (REFRESHTIME
); }
1274 /* provided for a backward compatibility to WIDE-DHCPv6 before Oct 1 2006 */
1277 #line 210 "cftoken.l"
1278 { DECHO
; return (NIS_NAME
); }
1282 #line 211 "cftoken.l"
1283 { DECHO
; return (NISP_NAME
); }
1285 /* generic options */
1288 #line 214 "cftoken.l"
1289 { DECHO
; return (INFO_ONLY
); }
1293 #line 216 "cftoken.l"
1294 { DECHO
; return (ALLOW
); }
1296 /* identity association */
1299 #line 219 "cftoken.l"
1300 { DECHO
; BEGIN S_IA
; return(ID_ASSOC
); }
1304 #line 220 "cftoken.l"
1305 { DECHO
; return(IA_PD
); }
1309 #line 221 "cftoken.l"
1310 { DECHO
; return(IA_NA
); }
1314 #line 222 "cftoken.l"
1315 { DECHO
; yylval
.str
= strdup(yytext
); return(IAID
); }
1319 #line 223 "cftoken.l"
1320 { DP("begin of closure"); BEGIN S_CNF
; return (BCL
); }
1323 * interface parameters for delegated prefix configuration.
1324 * when lex reads an interface name, the state will be back to
1329 #line 230 "cftoken.l"
1330 { DECHO
; BEGIN S_IFACE
; return (PREFIX_INTERFACE
); }
1334 #line 231 "cftoken.l"
1335 { DECHO
; return (SLA_ID
); }
1339 #line 232 "cftoken.l"
1340 { DECHO
; return (SLA_LEN
); }
1345 #line 235 "cftoken.l"
1346 { DECHO
; return (INFINITY
); }
1348 /* authentication option */
1351 #line 238 "cftoken.l"
1352 { DECHO
; BEGIN S_AUTH
; return (AUTHENTICATION
); }
1356 #line 239 "cftoken.l"
1359 yylval
.str
= strdup(yytext
);
1364 /* authentication parameters */
1367 #line 247 "cftoken.l"
1368 { DECHO
; return (PROTOCOL
); };
1372 #line 248 "cftoken.l"
1373 { DECHO
; return (ALGORITHM
); };
1377 #line 249 "cftoken.l"
1378 { DECHO
; return (RDM
); };
1382 #line 250 "cftoken.l"
1383 { DECHO
; return (KEY
); };
1385 /* authentication protocols */
1388 #line 253 "cftoken.l"
1389 { DECHO
; return (DELAYED
); };
1393 #line 254 "cftoken.l"
1394 { DECHO
; return (RECONFIG
); };
1396 /* authentication algorithms */
1399 #line 257 "cftoken.l"
1400 { DECHO
; return (HMACMD5
); };
1404 #line 258 "cftoken.l"
1405 { DECHO
; return (HMACMD5
); };
1409 #line 259 "cftoken.l"
1410 { DECHO
; return (HMACMD5
); };
1414 #line 260 "cftoken.l"
1415 { DECHO
; return (HMACMD5
); };
1417 /* authentication RDM */
1420 #line 263 "cftoken.l"
1421 { DECHO
; return (MONOCOUNTER
); };
1426 #line 266 "cftoken.l"
1427 { DECHO
; BEGIN S_KEY
; return (KEYINFO
); }
1431 #line 267 "cftoken.l"
1434 yylval
.str
= strdup(yytext
);
1439 /* key parameters */
1442 #line 275 "cftoken.l"
1443 { DECHO
; return (REALM
); }
1447 #line 276 "cftoken.l"
1448 { DECHO
; return (KEYID
); }
1452 #line 277 "cftoken.l"
1453 { DECHO
; BEGIN S_SECRET
; return (SECRET
); }
1457 #line 278 "cftoken.l"
1460 yylval
.str
= strdup(yytext
);
1467 #line 284 "cftoken.l"
1468 { DECHO
; return (EXPIRE
); }
1473 #line 287 "cftoken.l"
1474 { DECHO
; BEGIN S_INCL
; return (INCLUDE
); }
1478 #line 288 "cftoken.l"
1481 yylval
.str
= strdup(yytext
);
1489 #line 296 "cftoken.l"
1492 yylval
.str
= strdup(yytext
);
1499 #line 303 "cftoken.l"
1504 #line 304 "cftoken.l"
1509 #line 305 "cftoken.l"
1514 #line 306 "cftoken.l"
1517 yylval
.num
= strtoll(yytext
, NULL
, 10);
1523 #line 311 "cftoken.l"
1524 { DECHO
; return (SLASH
); }
1528 #line 312 "cftoken.l"
1529 { DECHO
; return (COMMA
); }
1533 #line 313 "cftoken.l"
1534 { DP("end of sentence"); return (EOS
); }
1538 #line 314 "cftoken.l"
1539 { DP("begin of closure"); return (BCL
); }
1543 #line 315 "cftoken.l"
1544 { DP("end of closure"); return (ECL
); }
1546 /* generic string */
1549 #line 318 "cftoken.l"
1552 yylval
.str
= strdup(yytext
);
1556 case YY_STATE_EOF(INITIAL
):
1557 case YY_STATE_EOF(S_CNF
):
1558 case YY_STATE_EOF(S_IFACE
):
1559 case YY_STATE_EOF(S_PREF
):
1560 case YY_STATE_EOF(S_HOST
):
1561 case YY_STATE_EOF(S_DUID
):
1562 case YY_STATE_EOF(S_IA
):
1563 case YY_STATE_EOF(S_AUTH
):
1564 case YY_STATE_EOF(S_KEY
):
1565 case YY_STATE_EOF(S_SECRET
):
1566 case YY_STATE_EOF(S_ADDRPOOL
):
1567 case YY_STATE_EOF(S_INCL
):
1568 #line 324 "cftoken.l"
1570 if (--incstackp
< 0)
1573 yy_delete_buffer(YY_CURRENT_BUFFER
);
1574 free(incstack
[incstackp
+ 1].path
);
1575 configfilename
= incstack
[incstackp
].path
;
1576 lineno
= incstack
[incstackp
].lineno
;
1577 yy_switch_to_buffer(incstack
[incstackp
].state
);
1583 #line 336 "cftoken.l"
1586 #line 1587 "lex.yy.c"
1588 case YY_END_OF_BUFFER
:
1590 /* Amount of text matched not including the EOB char. */
1591 int yy_amount_of_matched_text
= (int) (yy_cp
- yytext_ptr
) - 1;
1593 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1594 *yy_cp
= yy_hold_char
;
1595 YY_RESTORE_YY_MORE_OFFSET
1597 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_NEW
)
1599 /* We're scanning a new file or input source. It's
1600 * possible that this happened because the user
1601 * just pointed yyin at a new source and called
1602 * yylex(). If so, then we have to assure
1603 * consistency between yy_current_buffer and our
1604 * globals. Here is the right place to do so, because
1605 * this is the first action (other than possibly a
1606 * back-up) that will match for the new input source.
1608 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1609 yy_current_buffer
->yy_input_file
= yyin
;
1610 yy_current_buffer
->yy_buffer_status
= YY_BUFFER_NORMAL
;
1613 /* Note that here we test for yy_c_buf_p "<=" to the position
1614 * of the first EOB in the buffer, since yy_c_buf_p will
1615 * already have been incremented past the NUL character
1616 * (since all states make transitions on EOB to the
1617 * end-of-buffer state). Contrast this with the test
1620 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1621 { /* This was really a NUL. */
1622 yy_state_type yy_next_state
;
1624 yy_c_buf_p
= yytext_ptr
+ yy_amount_of_matched_text
;
1626 yy_current_state
= yy_get_previous_state();
1628 /* Okay, we're now positioned to make the NUL
1629 * transition. We couldn't have
1630 * yy_get_previous_state() go ahead and do it
1631 * for us because it doesn't know how to deal
1632 * with the possibility of jamming (and we don't
1633 * want to build jamming into it because then it
1634 * will run more slowly).
1637 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
1639 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1641 if ( yy_next_state
)
1643 /* Consume the NUL. */
1644 yy_cp
= ++yy_c_buf_p
;
1645 yy_current_state
= yy_next_state
;
1652 goto yy_find_action
;
1656 else switch ( yy_get_next_buffer() )
1658 case EOB_ACT_END_OF_FILE
:
1660 yy_did_buffer_switch_on_eof
= 0;
1664 /* Note: because we've taken care in
1665 * yy_get_next_buffer() to have set up
1666 * yytext, we can now set up
1667 * yy_c_buf_p so that if some total
1668 * hoser (like flex itself) wants to
1669 * call the scanner after we return the
1670 * YY_NULL, it'll still work - another
1671 * YY_NULL will get returned.
1673 yy_c_buf_p
= yytext_ptr
+ YY_MORE_ADJ
;
1675 yy_act
= YY_STATE_EOF(YY_START
);
1681 if ( ! yy_did_buffer_switch_on_eof
)
1687 case EOB_ACT_CONTINUE_SCAN
:
1689 yytext_ptr
+ yy_amount_of_matched_text
;
1691 yy_current_state
= yy_get_previous_state();
1694 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1697 case EOB_ACT_LAST_MATCH
:
1699 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
1701 yy_current_state
= yy_get_previous_state();
1704 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1705 goto yy_find_action
;
1712 "fatal flex scanner internal error--no action found" );
1713 } /* end of action switch */
1714 } /* end of scanning one token */
1715 } /* end of yylex */
1718 /* yy_get_next_buffer - try to read in a new buffer
1720 * Returns a code representing an action:
1721 * EOB_ACT_LAST_MATCH -
1722 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1723 * EOB_ACT_END_OF_FILE - end of file
1726 static int yy_get_next_buffer()
1728 register char *dest
= yy_current_buffer
->yy_ch_buf
;
1729 register char *source
= yytext_ptr
;
1730 register int number_to_move
, i
;
1733 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
1735 "fatal flex scanner internal error--end of buffer missed" );
1737 if ( yy_current_buffer
->yy_fill_buffer
== 0 )
1738 { /* Don't try to fill the buffer, so this is an EOF. */
1739 if ( yy_c_buf_p
- yytext_ptr
- YY_MORE_ADJ
== 1 )
1741 /* We matched a single character, the EOB, so
1742 * treat this as a final EOF.
1744 return EOB_ACT_END_OF_FILE
;
1749 /* We matched some text prior to the EOB, first
1752 return EOB_ACT_LAST_MATCH
;
1756 /* Try to read more data. */
1758 /* First move last chars to start of buffer. */
1759 number_to_move
= (int) (yy_c_buf_p
- yytext_ptr
) - 1;
1761 for ( i
= 0; i
< number_to_move
; ++i
)
1762 *(dest
++) = *(source
++);
1764 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
1765 /* don't do the read, it's not guaranteed to return an EOF,
1768 yy_current_buffer
->yy_n_chars
= yy_n_chars
= 0;
1773 yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
1775 while ( num_to_read
<= 0 )
1776 { /* Not enough room in the buffer - grow it. */
1777 #ifdef YY_USES_REJECT
1779 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1782 /* just a shorter name for the current buffer */
1783 YY_BUFFER_STATE b
= yy_current_buffer
;
1785 int yy_c_buf_p_offset
=
1786 (int) (yy_c_buf_p
- b
->yy_ch_buf
);
1788 if ( b
->yy_is_our_buffer
)
1790 int new_size
= b
->yy_buf_size
* 2;
1792 if ( new_size
<= 0 )
1793 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
1795 b
->yy_buf_size
*= 2;
1797 b
->yy_ch_buf
= (char *)
1798 /* Include room in for 2 EOB chars. */
1799 yy_flex_realloc( (void *) b
->yy_ch_buf
,
1800 b
->yy_buf_size
+ 2 );
1803 /* Can't grow it, we don't own it. */
1806 if ( ! b
->yy_ch_buf
)
1808 "fatal error - scanner input buffer overflow" );
1810 yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
1812 num_to_read
= yy_current_buffer
->yy_buf_size
-
1817 if ( num_to_read
> YY_READ_BUF_SIZE
)
1818 num_to_read
= YY_READ_BUF_SIZE
;
1820 /* Read in more data. */
1821 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
1822 yy_n_chars
, num_to_read
);
1824 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
1827 if ( yy_n_chars
== 0 )
1829 if ( number_to_move
== YY_MORE_ADJ
)
1831 ret_val
= EOB_ACT_END_OF_FILE
;
1837 ret_val
= EOB_ACT_LAST_MATCH
;
1838 yy_current_buffer
->yy_buffer_status
=
1839 YY_BUFFER_EOF_PENDING
;
1844 ret_val
= EOB_ACT_CONTINUE_SCAN
;
1846 yy_n_chars
+= number_to_move
;
1847 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
1848 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
1850 yytext_ptr
= &yy_current_buffer
->yy_ch_buf
[0];
1856 /* yy_get_previous_state - get the state just before the EOB char was reached */
1858 static yy_state_type
yy_get_previous_state()
1860 register yy_state_type yy_current_state
;
1861 register char *yy_cp
;
1863 yy_current_state
= yy_start
;
1865 for ( yy_cp
= yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
1867 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
1868 if ( yy_accept
[yy_current_state
] )
1870 yy_last_accepting_state
= yy_current_state
;
1871 yy_last_accepting_cpos
= yy_cp
;
1873 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1875 yy_current_state
= (int) yy_def
[yy_current_state
];
1876 if ( yy_current_state
>= 517 )
1877 yy_c
= yy_meta
[(unsigned int) yy_c
];
1879 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1882 return yy_current_state
;
1886 /* yy_try_NUL_trans - try to make a transition on the NUL character
1889 * next_state = yy_try_NUL_trans( current_state );
1892 #ifdef YY_USE_PROTOS
1893 static yy_state_type
yy_try_NUL_trans( yy_state_type yy_current_state
)
1895 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
1896 yy_state_type yy_current_state
;
1899 register int yy_is_jam
;
1900 register char *yy_cp
= yy_c_buf_p
;
1902 register YY_CHAR yy_c
= 1;
1903 if ( yy_accept
[yy_current_state
] )
1905 yy_last_accepting_state
= yy_current_state
;
1906 yy_last_accepting_cpos
= yy_cp
;
1908 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1910 yy_current_state
= (int) yy_def
[yy_current_state
];
1911 if ( yy_current_state
>= 517 )
1912 yy_c
= yy_meta
[(unsigned int) yy_c
];
1914 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1915 yy_is_jam
= (yy_current_state
== 516);
1917 return yy_is_jam
? 0 : yy_current_state
;
1922 #ifdef YY_USE_PROTOS
1923 static void yyunput( int c
, register char *yy_bp
)
1925 static void yyunput( c
, yy_bp
)
1927 register char *yy_bp
;
1930 register char *yy_cp
= yy_c_buf_p
;
1932 /* undo effects of setting up yytext */
1933 *yy_cp
= yy_hold_char
;
1935 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
1936 { /* need to shift things up to make room */
1937 /* +2 for EOB chars. */
1938 register int number_to_move
= yy_n_chars
+ 2;
1939 register char *dest
= &yy_current_buffer
->yy_ch_buf
[
1940 yy_current_buffer
->yy_buf_size
+ 2];
1941 register char *source
=
1942 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
1944 while ( source
> yy_current_buffer
->yy_ch_buf
)
1945 *--dest
= *--source
;
1947 yy_cp
+= (int) (dest
- source
);
1948 yy_bp
+= (int) (dest
- source
);
1949 yy_current_buffer
->yy_n_chars
=
1950 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
1952 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
1953 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1956 *--yy_cp
= (char) c
;
1960 yy_hold_char
= *yy_cp
;
1963 #endif /* ifndef YY_NO_UNPUT */
1967 static int yyinput()
1974 *yy_c_buf_p
= yy_hold_char
;
1976 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
1978 /* yy_c_buf_p now points to the character we want to return.
1979 * If this occurs *before* the EOB characters, then it's a
1980 * valid NUL; if not, then we've hit the end of the buffer.
1982 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1983 /* This was really a NUL. */
1987 { /* need more input */
1988 int offset
= yy_c_buf_p
- yytext_ptr
;
1991 switch ( yy_get_next_buffer() )
1993 case EOB_ACT_LAST_MATCH
:
1994 /* This happens because yy_g_n_b()
1995 * sees that we've accumulated a
1996 * token and flags that we need to
1997 * try matching the token before
1998 * proceeding. But for input(),
1999 * there's no matching to consider.
2000 * So convert the EOB_ACT_LAST_MATCH
2001 * to EOB_ACT_END_OF_FILE.
2004 /* Reset buffer status. */
2009 case EOB_ACT_END_OF_FILE
:
2014 if ( ! yy_did_buffer_switch_on_eof
)
2023 case EOB_ACT_CONTINUE_SCAN
:
2024 yy_c_buf_p
= yytext_ptr
+ offset
;
2030 c
= *(unsigned char *) yy_c_buf_p
; /* cast for 8-bit char's */
2031 *yy_c_buf_p
= '\0'; /* preserve yytext */
2032 yy_hold_char
= *++yy_c_buf_p
;
2039 #ifdef YY_USE_PROTOS
2040 void yyrestart( FILE *input_file
)
2042 void yyrestart( input_file
)
2046 if ( ! yy_current_buffer
)
2047 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
2049 yy_init_buffer( yy_current_buffer
, input_file
);
2050 yy_load_buffer_state();
2054 #ifdef YY_USE_PROTOS
2055 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
2057 void yy_switch_to_buffer( new_buffer
)
2058 YY_BUFFER_STATE new_buffer
;
2061 if ( yy_current_buffer
== new_buffer
)
2064 if ( yy_current_buffer
)
2066 /* Flush out information for old buffer. */
2067 *yy_c_buf_p
= yy_hold_char
;
2068 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
2069 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2072 yy_current_buffer
= new_buffer
;
2073 yy_load_buffer_state();
2075 /* We don't actually know whether we did this switch during
2076 * EOF (yywrap()) processing, but the only time this flag
2077 * is looked at is after yywrap() is called, so it's safe
2078 * to go ahead and always set it.
2080 yy_did_buffer_switch_on_eof
= 1;
2084 #ifdef YY_USE_PROTOS
2085 void yy_load_buffer_state( void )
2087 void yy_load_buffer_state()
2090 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
2091 yytext_ptr
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
2092 yyin
= yy_current_buffer
->yy_input_file
;
2093 yy_hold_char
= *yy_c_buf_p
;
2097 #ifdef YY_USE_PROTOS
2098 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
2100 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
2107 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2109 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2111 b
->yy_buf_size
= size
;
2113 /* yy_ch_buf has to be 2 characters longer than the size given because
2114 * we need to put in 2 end-of-buffer characters.
2116 b
->yy_ch_buf
= (char *) yy_flex_alloc( b
->yy_buf_size
+ 2 );
2117 if ( ! b
->yy_ch_buf
)
2118 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2120 b
->yy_is_our_buffer
= 1;
2122 yy_init_buffer( b
, file
);
2128 #ifdef YY_USE_PROTOS
2129 void yy_delete_buffer( YY_BUFFER_STATE b
)
2131 void yy_delete_buffer( b
)
2138 if ( b
== yy_current_buffer
)
2139 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
2141 if ( b
->yy_is_our_buffer
)
2142 yy_flex_free( (void *) b
->yy_ch_buf
);
2144 yy_flex_free( (void *) b
);
2148 #ifndef YY_ALWAYS_INTERACTIVE
2149 #ifndef YY_NEVER_INTERACTIVE
2150 extern int isatty
YY_PROTO(( int ));
2154 #ifdef YY_USE_PROTOS
2155 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
2157 void yy_init_buffer( b
, file
)
2164 yy_flush_buffer( b
);
2166 b
->yy_input_file
= file
;
2167 b
->yy_fill_buffer
= 1;
2169 #if YY_ALWAYS_INTERACTIVE
2170 b
->yy_is_interactive
= 1;
2172 #if YY_NEVER_INTERACTIVE
2173 b
->yy_is_interactive
= 0;
2175 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
2181 #ifdef YY_USE_PROTOS
2182 void yy_flush_buffer( YY_BUFFER_STATE b
)
2184 void yy_flush_buffer( b
)
2194 /* We always need two end-of-buffer characters. The first causes
2195 * a transition to the end-of-buffer state. The second causes
2196 * a jam in that state.
2198 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
2199 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
2201 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
2204 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2206 if ( b
== yy_current_buffer
)
2207 yy_load_buffer_state();
2211 #ifndef YY_NO_SCAN_BUFFER
2212 #ifdef YY_USE_PROTOS
2213 YY_BUFFER_STATE
yy_scan_buffer( char *base
, yy_size_t size
)
2215 YY_BUFFER_STATE
yy_scan_buffer( base
, size
)
2223 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
2224 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
2225 /* They forgot to leave room for the EOB's. */
2228 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2230 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2232 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
2233 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
2234 b
->yy_is_our_buffer
= 0;
2235 b
->yy_input_file
= 0;
2236 b
->yy_n_chars
= b
->yy_buf_size
;
2237 b
->yy_is_interactive
= 0;
2239 b
->yy_fill_buffer
= 0;
2240 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2242 yy_switch_to_buffer( b
);
2249 #ifndef YY_NO_SCAN_STRING
2250 #ifdef YY_USE_PROTOS
2251 YY_BUFFER_STATE
yy_scan_string( yyconst
char *yy_str
)
2253 YY_BUFFER_STATE
yy_scan_string( yy_str
)
2254 yyconst
char *yy_str
;
2258 for ( len
= 0; yy_str
[len
]; ++len
)
2261 return yy_scan_bytes( yy_str
, len
);
2266 #ifndef YY_NO_SCAN_BYTES
2267 #ifdef YY_USE_PROTOS
2268 YY_BUFFER_STATE
yy_scan_bytes( yyconst
char *bytes
, int len
)
2270 YY_BUFFER_STATE
yy_scan_bytes( bytes
, len
)
2271 yyconst
char *bytes
;
2280 /* Get memory for full buffer, including space for trailing EOB's. */
2282 buf
= (char *) yy_flex_alloc( n
);
2284 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2286 for ( i
= 0; i
< len
; ++i
)
2289 buf
[len
] = buf
[len
+1] = YY_END_OF_BUFFER_CHAR
;
2291 b
= yy_scan_buffer( buf
, n
);
2293 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2295 /* It's okay to grow etc. this buffer, and we should throw it
2296 * away when we're done.
2298 b
->yy_is_our_buffer
= 1;
2305 #ifndef YY_NO_PUSH_STATE
2306 #ifdef YY_USE_PROTOS
2307 static void yy_push_state( int new_state
)
2309 static void yy_push_state( new_state
)
2313 if ( yy_start_stack_ptr
>= yy_start_stack_depth
)
2317 yy_start_stack_depth
+= YY_START_STACK_INCR
;
2318 new_size
= yy_start_stack_depth
* sizeof( int );
2320 if ( ! yy_start_stack
)
2321 yy_start_stack
= (int *) yy_flex_alloc( new_size
);
2324 yy_start_stack
= (int *) yy_flex_realloc(
2325 (void *) yy_start_stack
, new_size
);
2327 if ( ! yy_start_stack
)
2329 "out of memory expanding start-condition stack" );
2332 yy_start_stack
[yy_start_stack_ptr
++] = YY_START
;
2339 #ifndef YY_NO_POP_STATE
2340 static void yy_pop_state()
2342 if ( --yy_start_stack_ptr
< 0 )
2343 YY_FATAL_ERROR( "start-condition stack underflow" );
2345 BEGIN(yy_start_stack
[yy_start_stack_ptr
]);
2350 #ifndef YY_NO_TOP_STATE
2351 static int yy_top_state()
2353 return yy_start_stack
[yy_start_stack_ptr
- 1];
2357 #ifndef YY_EXIT_FAILURE
2358 #define YY_EXIT_FAILURE 2
2361 #ifdef YY_USE_PROTOS
2362 static void yy_fatal_error( yyconst
char msg
[] )
2364 static void yy_fatal_error( msg
)
2368 (void) fprintf( stderr
, "%s\n", msg
);
2369 exit( YY_EXIT_FAILURE
);
2374 /* Redefine yyless() so it works in section 3 code. */
2380 /* Undo effects of setting up yytext. */ \
2381 yytext[yyleng] = yy_hold_char; \
2382 yy_c_buf_p = yytext + n; \
2383 yy_hold_char = *yy_c_buf_p; \
2384 *yy_c_buf_p = '\0'; \
2390 /* Internal utility routines. */
2393 #ifdef YY_USE_PROTOS
2394 static void yy_flex_strncpy( char *s1
, yyconst
char *s2
, int n
)
2396 static void yy_flex_strncpy( s1
, s2
, n
)
2403 for ( i
= 0; i
< n
; ++i
)
2408 #ifdef YY_NEED_STRLEN
2409 #ifdef YY_USE_PROTOS
2410 static int yy_flex_strlen( yyconst
char *s
)
2412 static int yy_flex_strlen( s
)
2417 for ( n
= 0; s
[n
]; ++n
)
2425 #ifdef YY_USE_PROTOS
2426 static void *yy_flex_alloc( yy_size_t size
)
2428 static void *yy_flex_alloc( size
)
2432 return (void *) malloc( size
);
2435 #ifdef YY_USE_PROTOS
2436 static void *yy_flex_realloc( void *ptr
, yy_size_t size
)
2438 static void *yy_flex_realloc( ptr
, size
)
2443 /* The cast to (char *) in the following accommodates both
2444 * implementations that use char* generic pointers, and those
2445 * that use void* generic pointers. It works with the latter
2446 * because both ANSI C and C++ allow castless assignment from
2447 * any pointer type to void*, and deal with argument conversions
2448 * as though doing an assignment.
2450 return (void *) realloc( (char *) ptr
, size
);
2453 #ifdef YY_USE_PROTOS
2454 static void yy_flex_free( void *ptr
)
2456 static void yy_flex_free( ptr
)
2470 #line 336 "cftoken.l"
2473 cfdebug_print(w
, t
, l
)
2478 dprintf(LOG_DEBUG
, FNAME
,
2479 "<%d>%s [%s] (%d)", yy_start
, w
, t
, l
);
2481 dprintf(LOG_DEBUG
, FNAME
,
2482 "<%d>[%s] (%d)", yy_start
, t
, l
);
2487 yyerror0(int level
, char *s
, va_list ap
)
2489 char ebuf
[BUFSIZ
], *bp
, *ep
;
2492 ep
= ebuf
+ sizeof(ebuf
);
2493 bp
+= snprintf(bp
, ep
- bp
, "%s %d: ", configfilename
, lineno
);
2495 bp
+= vsnprintf(bp
, ep
- bp
, s
, ap
);
2497 dprintf(level
, FNAME
, ebuf
);
2501 yyerror(char *s
, ...)
2504 #ifdef HAVE_STDARG_H
2509 yyerror0(LOG_ERR
, s
, ap
);
2515 yywarn(char *s
, ...)
2518 #ifdef HAVE_STDARG_H
2523 yyerror0(LOG_WARNING
, s
, ap
);
2528 cfswitch_buffer(incl
)
2531 char *path
= qstrdup(incl
);
2534 if (incstackp
>= MAX_INCLUDE_DEPTH
) {
2535 dprintf(LOG_ERR
, FNAME
, "cfparse: includes nested too deeply");
2538 incstack
[incstackp
].path
= configfilename
;
2539 incstack
[incstackp
].state
= YY_CURRENT_BUFFER
;
2540 incstack
[incstackp
].lineno
= lineno
;
2542 fp
= fopen(path
, "r");
2544 dprintf(LOG_ERR
, FNAME
, "cfparse: fopen(%s): %s",
2545 path
, strerror(errno
));
2546 if (errno
== ENOENT
)
2551 configfilename
= path
;
2553 yy_switch_to_buffer(yy_create_buffer(fp
, YY_BUF_SIZE
));
2564 configfilename
= conf
;
2565 if ((yyin
= fopen(configfilename
, "r")) == NULL
) {
2566 dprintf(LOG_ERR
, FNAME
, "cfparse: fopen(%s): %s",
2567 configfilename
, strerror(errno
));
2568 if (errno
== ENOENT
)
2573 if (yyparse() || yyerrorcount
) {
2575 yyerror("fatal parse failure: exiting (%d errors)",
2578 yyerror("fatal parse failure: exiting");
2582 return (cf_post_config());