1 /* A lexical scanner generated by flex */
3 /* Scanner skeleton version:
8 #define YY_FLEX_MAJOR_VERSION 2
9 #define YY_FLEX_MINOR_VERSION 5
14 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
27 /* Use prototypes in function declarations. */
30 /* The "const" storage-class-modifier is valid. */
33 #else /* ! __cplusplus */
41 #endif /* ! __cplusplus */
60 #define YY_PROTO(proto) proto
62 #define YY_PROTO(proto) ()
65 /* Returned upon end-of-file. */
68 /* Promotes a possibly negative, possibly signed char to an unsigned
69 * integer for use as an array index. If the signed char is negative,
70 * we want to instead treat it as an 8-bit unsigned char, hence the
73 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
75 /* Enter a start condition. This macro really ought to take a parameter,
76 * but we do it the disgusting crufty way forced on us by the ()-less
77 * definition of BEGIN.
79 #define BEGIN yy_start = 1 + 2 *
81 /* Translate the current start state into a value that can be later handed
82 * to BEGIN to return to the state. The YYSTATE alias is for lex
85 #define YY_START ((yy_start - 1) / 2)
86 #define YYSTATE YY_START
88 /* Action number for EOF rule of a given start state. */
89 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
91 /* Special action meaning "start processing a new file". */
92 #define YY_NEW_FILE yyrestart( yyin )
94 #define YY_END_OF_BUFFER_CHAR 0
96 /* Size of default input buffer. */
97 #define YY_BUF_SIZE 16384
99 typedef struct yy_buffer_state *YY_BUFFER_STATE;
102 extern FILE *yyin, *yyout;
104 #define EOB_ACT_CONTINUE_SCAN 0
105 #define EOB_ACT_END_OF_FILE 1
106 #define EOB_ACT_LAST_MATCH 2
108 /* The funky do-while in the following #define is used to turn the definition
109 * int a single C statement (which needs a semi-colon terminator). This
110 * avoids problems with code like:
112 * if ( condition_holds )
115 * do_something_else();
117 * Prior to using the do-while the compiler would get upset at the
118 * "else" because it interpreted the "if" statement as being all
119 * done when it reached the ';' after the yyless() call.
122 /* Return all but the first 'n' matched characters back to the input stream. */
127 /* Undo effects of setting up yytext. */ \
128 *yy_cp = yy_hold_char; \
129 YY_RESTORE_YY_MORE_OFFSET \
130 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
131 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
135 #define unput(c) yyunput( c, yytext_ptr )
137 /* The following is because we cannot portably get our hands on size_t
138 * (without autoconf's help, which isn't available because we want
139 * flex-generated scanners to compile on their own).
141 typedef unsigned int yy_size_t;
144 struct yy_buffer_state
148 char *yy_ch_buf; /* input buffer */
149 char *yy_buf_pos; /* current position in input buffer */
151 /* Size of input buffer in bytes, not including room for EOB
154 yy_size_t yy_buf_size;
156 /* Number of characters read into yy_ch_buf, not including EOB
161 /* Whether we "own" the buffer - i.e., we know we created it,
162 * and can realloc() it to grow it, and should free() it to
165 int yy_is_our_buffer;
167 /* Whether this is an "interactive" input source; if so, and
168 * if we're using stdio for input, then we want to use getc()
169 * instead of fread(), to make sure we stop fetching input after
172 int yy_is_interactive;
174 /* Whether we're considered to be at the beginning of a line.
175 * If so, '^' rules will be active on the next match, otherwise
180 /* Whether to try to fill the input buffer when we reach the
185 int yy_buffer_status;
186 #define YY_BUFFER_NEW 0
187 #define YY_BUFFER_NORMAL 1
188 /* When an EOF's been seen but there's still some text to process
189 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
190 * shouldn't try reading from the input source any more. We might
191 * still have a bunch of tokens to match, though, because of
192 * possible backing-up.
194 * When we actually see the EOF, we change the status to "new"
195 * (via yyrestart()), so that the user can continue scanning by
196 * just pointing yyin at a new input file.
198 #define YY_BUFFER_EOF_PENDING 2
201 static YY_BUFFER_STATE yy_current_buffer = 0;
203 /* We provide macros for accessing buffer states in case in the
204 * future we want to put the buffer states in a more general
207 #define YY_CURRENT_BUFFER yy_current_buffer
210 /* yy_hold_char holds the character lost when yytext is formed. */
211 static char yy_hold_char;
213 static int yy_n_chars; /* number of characters read into yy_ch_buf */
218 /* Points to current character in buffer. */
219 static char *yy_c_buf_p = (char *) 0;
220 static int yy_init = 1; /* whether we need to initialize */
221 static int yy_start = 0; /* start state number */
223 /* Flag which is used to allow yywrap()'s to do buffer switches
224 * instead of setting up a fresh yyin. A bit of a hack ...
226 static int yy_did_buffer_switch_on_eof;
228 void yyrestart YY_PROTO(( FILE *input_file ));
230 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
231 void yy_load_buffer_state YY_PROTO(( void ));
232 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
233 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
234 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
235 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
236 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
238 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
239 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
240 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
242 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
243 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
244 static void yy_flex_free YY_PROTO(( void * ));
246 #define yy_new_buffer yy_create_buffer
248 #define yy_set_interactive(is_interactive) \
250 if ( ! yy_current_buffer ) \
251 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
252 yy_current_buffer->yy_is_interactive = is_interactive; \
255 #define yy_set_bol(at_bol) \
257 if ( ! yy_current_buffer ) \
258 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
259 yy_current_buffer->yy_at_bol = at_bol; \
262 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
266 #define YY_SKIP_YYWRAP
267 typedef unsigned char YY_CHAR;
268 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
269 typedef int yy_state_type;
271 #define yytext_ptr yytext
273 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
274 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
275 static int yy_get_next_buffer YY_PROTO(( void ));
276 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
278 /* Done after the current pattern has been matched and before the
279 * corresponding action - sets up yytext.
281 #define YY_DO_BEFORE_ACTION \
282 yytext_ptr = yy_bp; \
283 yyleng = (int) (yy_cp - yy_bp); \
284 yy_hold_char = *yy_cp; \
288 #define YY_NUM_RULES 103
289 #define YY_END_OF_BUFFER 104
290 static yyconst short int yy_accept[572] =
292 0, 0, 104, 102, 96, 97, 89, 101, 99, 86,
293 90, 87, 88, 93, 102, 102, 102, 102, 102, 102,
294 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
295 102, 102, 102, 102, 102, 102, 91, 102, 96, 97,
296 99, 101, 101, 100, 101, 99, 99, 98, 95, 93,
297 102, 102, 102, 102, 19, 102, 102, 102, 102, 102,
298 102, 102, 102, 102, 102, 37, 102, 102, 102, 102,
299 32, 102, 102, 102, 102, 102, 102, 102, 102, 102,
300 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
301 102, 102, 102, 102, 102, 102, 100, 101, 101, 101,
303 101, 0, 101, 101, 94, 93, 102, 102, 102, 102,
304 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
305 102, 31, 62, 102, 102, 102, 102, 102, 102, 102,
306 102, 102, 102, 70, 102, 102, 102, 102, 102, 102,
307 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
308 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
309 102, 101, 101, 100, 0, 101, 101, 94, 93, 102,
310 102, 102, 66, 102, 102, 63, 67, 102, 102, 102,
311 35, 36, 102, 102, 102, 102, 40, 42, 102, 50,
312 102, 102, 59, 69, 102, 71, 102, 72, 102, 102,
314 102, 102, 102, 102, 102, 30, 102, 84, 102, 102,
315 102, 102, 102, 102, 102, 102, 102, 102, 74, 75,
316 102, 61, 102, 101, 101, 0, 0, 0, 101, 94,
317 93, 102, 64, 102, 102, 102, 102, 102, 58, 102,
318 65, 102, 92, 102, 38, 102, 102, 102, 102, 102,
319 102, 102, 102, 102, 102, 102, 102, 41, 102, 102,
320 48, 102, 102, 102, 102, 102, 102, 102, 102, 102,
321 102, 85, 101, 0, 0, 94, 93, 102, 102, 102,
322 102, 102, 68, 102, 102, 102, 102, 102, 102, 69,
323 76, 77, 78, 79, 80, 81, 82, 83, 102, 102,
325 102, 102, 60, 102, 102, 102, 1, 102, 102, 102,
326 102, 39, 102, 73, 102, 102, 102, 102, 0, 94,
327 93, 102, 102, 102, 102, 102, 102, 102, 102, 49,
328 102, 21, 26, 102, 102, 102, 10, 102, 102, 102,
329 102, 102, 51, 102, 102, 102, 102, 45, 61, 94,
330 93, 102, 9, 66, 102, 102, 102, 102, 102, 102,
331 102, 102, 102, 102, 102, 102, 47, 102, 102, 102,
332 102, 102, 102, 46, 102, 94, 102, 102, 102, 102,
333 102, 102, 102, 102, 102, 102, 12, 102, 102, 102,
334 102, 102, 102, 44, 11, 102, 102, 102, 102, 102,
336 102, 94, 102, 102, 102, 102, 102, 33, 102, 102,
337 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
338 8, 102, 102, 102, 102, 102, 102, 102, 102, 102,
339 102, 102, 43, 34, 102, 102, 102, 102, 102, 102,
340 102, 102, 102, 102, 102, 102, 102, 102, 20, 102,
341 102, 102, 102, 52, 102, 102, 102, 102, 102, 102,
342 102, 102, 102, 102, 102, 102, 102, 55, 102, 102,
343 102, 102, 102, 53, 102, 102, 102, 102, 102, 102,
344 102, 102, 102, 102, 102, 102, 102, 56, 102, 102,
345 15, 102, 102, 102, 102, 17, 7, 102, 102, 102,
347 102, 102, 102, 102, 23, 102, 102, 102, 102, 102,
348 102, 102, 102, 102, 102, 102, 4, 102, 102, 102,
349 22, 102, 102, 102, 102, 102, 13, 102, 102, 102,
350 102, 5, 6, 102, 102, 102, 102, 102, 102, 16,
351 102, 102, 102, 102, 102, 102, 3, 25, 102, 18,
352 102, 102, 102, 27, 102, 54, 102, 24, 14, 57,
353 102, 102, 102, 102, 28, 102, 102, 102, 29, 2,
357 static yyconst int yy_ec[256] =
359 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
360 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
361 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
362 1, 2, 4, 5, 6, 7, 8, 9, 8, 10,
363 11, 8, 8, 8, 12, 8, 8, 13, 14, 15,
364 16, 17, 18, 19, 20, 21, 21, 8, 8, 8,
365 8, 8, 8, 8, 22, 22, 22, 22, 22, 22,
366 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
367 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
368 8, 23, 8, 8, 24, 8, 25, 26, 27, 28,
370 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
371 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
372 49, 50, 8, 51, 8, 8, 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,
378 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
379 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,
384 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
385 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
389 static yyconst int yy_meta[52] =
391 1, 2, 3, 1, 1, 1, 1, 1, 1, 1,
392 1, 1, 4, 4, 4, 4, 4, 4, 4, 4,
393 4, 1, 1, 1, 1, 1, 1, 1, 1, 1,
394 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
395 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
399 static yyconst short int yy_base[582] =
401 0, 0, 917, 0, 50, 918, 0, 52, 56, 0,
402 0, 0, 0, 64, 883, 19, 44, 37, 51, 882,
403 25, 36, 64, 885, 34, 67, 62, 867, 887, 866,
404 75, 68, 871, 60, 880, 73, 0, 0, 106, 918,
405 905, 109, 101, 905, 132, 116, 903, 918, 168, 177,
406 867, 87, 860, 24, 0, 87, 874, 876, 858, 88,
407 871, 853, 868, 855, 867, 0, 856, 865, 849, 856,
408 0, 853, 95, 848, 862, 846, 854, 843, 838, 115,
409 848, 854, 98, 849, 843, 130, 114, 841, 839, 835,
410 837, 847, 848, 832, 831, 839, 0, 198, 869, 0,
412 126, 134, 245, 265, 283, 292, 843, 827, 829, 835,
413 830, 838, 820, 825, 825, 816, 833, 829, 829, 815,
414 823, 0, 816, 827, 827, 812, 826, 810, 810, 812,
415 808, 808, 820, 0, 808, 800, 799, 132, 808, 804,
416 797, 805, 812, 792, 804, 806, 804, 787, 802, 785,
417 783, 816, 785, 786, 789, 788, 781, 782, 778, 782,
418 775, 301, 318, 918, 348, 384, 393, 411, 420, 782,
419 773, 769, 775, 781, 781, 0, 0, 773, 780, 771,
420 0, 0, 778, 766, 765, 761, 0, 0, 778, 0,
421 762, 758, 0, 773, 765, 0, 775, 0, 766, 132,
423 771, 785, 754, 768, 757, 0, 764, 0, 765, 758,
424 746, 747, 755, 758, 744, 743, 745, 754, 770, 0,
425 748, 747, 750, 429, 438, 135, 0, 464, 200, 482,
426 491, 733, 0, 765, 734, 737, 762, 735, 0, 734,
427 0, 732, 727, 725, 0, 739, 739, 730, 500, 734,
428 721, 719, 722, 732, 730, 726, 729, 0, 713, 714,
429 0, 722, 727, 715, 723, 722, 719, 703, 706, 708,
430 708, 0, 139, 0, 508, 526, 535, 717, 714, 710,
431 711, 700, 0, 702, 701, 726, 708, 724, 706, 0,
432 0, 0, 0, 0, 0, 0, 0, 0, 705, 706,
434 720, 691, 0, 702, 701, 684, 715, 697, 681, 695,
435 677, 0, 679, 0, 692, 693, 681, 687, 198, 544,
436 553, 688, 688, 669, 702, 668, 683, 674, 123, 698,
437 679, 696, 0, 668, 677, 663, 0, 675, 674, 672,
438 689, 651, 687, 665, 654, 660, 665, 0, 0, 562,
439 682, 681, 0, 0, 134, 659, 664, 661, 644, 649,
440 140, 659, 194, 648, 647, 655, 0, 641, 654, 651,
441 179, 638, 667, 0, 645, 571, 198, 635, 633, 631,
442 630, 635, 629, 659, 625, 627, 0, 635, 637, 627,
443 627, 618, 620, 0, 0, 634, 619, 617, 620, 633,
445 621, 0, 620, 606, 611, 614, 623, 0, 639, 606,
446 617, 100, 615, 608, 604, 616, 605, 614, 609, 598,
447 0, 601, 610, 600, 595, 607, 602, 591, 604, 587,
448 589, 598, 0, 0, 596, 125, 592, 590, 597, 577,
449 588, 592, 573, 599, 554, 553, 557, 501, 0, 502,
450 461, 434, 435, 462, 428, 436, 443, 427, 418, 449,
451 390, 383, 350, 350, 354, 367, 351, 378, 360, 345,
452 349, 347, 373, 0, 341, 343, 353, 352, 344, 346,
453 198, 334, 334, 336, 363, 336, 331, 0, 329, 333,
454 0, 316, 321, 316, 325, 0, 0, 314, 316, 316,
456 320, 327, 303, 286, 317, 296, 290, 295, 293, 280,
457 277, 247, 249, 246, 232, 242, 0, 230, 227, 227,
458 0, 243, 212, 227, 212, 225, 0, 226, 219, 221,
459 214, 0, 0, 220, 216, 196, 208, 202, 202, 0,
460 203, 198, 205, 202, 198, 206, 0, 0, 196, 0,
461 187, 193, 190, 0, 173, 0, 164, 0, 0, 0,
462 177, 177, 165, 145, 0, 134, 141, 119, 0, 0,
463 918, 592, 596, 600, 604, 608, 612, 616, 620, 138,
467 static yyconst short int yy_def[582] =
469 571, 1, 571, 572, 571, 571, 572, 573, 574, 572,
470 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
471 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
472 572, 572, 572, 572, 572, 572, 572, 572, 571, 571,
473 575, 573, 576, 577, 573, 574, 575, 571, 572, 14,
474 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
475 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
476 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
477 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
478 572, 572, 572, 572, 572, 572, 578, 576, 577, 578,
480 578, 579, 577, 573, 572, 14, 572, 572, 572, 572,
481 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
482 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
483 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
484 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
485 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
486 572, 578, 576, 571, 579, 103, 104, 572, 14, 572,
487 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
488 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
489 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
491 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
492 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
493 572, 572, 572, 578, 163, 571, 580, 579, 573, 572,
494 14, 572, 572, 572, 572, 572, 572, 572, 572, 572,
495 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
496 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
497 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
498 572, 572, 576, 581, 228, 572, 14, 572, 572, 572,
499 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
500 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
502 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
503 572, 572, 572, 572, 572, 572, 572, 572, 579, 572,
504 14, 572, 572, 572, 572, 572, 572, 572, 572, 572,
505 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
506 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
507 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
508 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
509 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
510 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
511 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
513 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
514 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
515 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
516 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
517 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
518 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
519 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
520 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
521 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
522 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
524 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
525 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
526 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
527 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
528 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
529 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
530 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
531 0, 571, 571, 571, 571, 571, 571, 571, 571, 571,
535 static yyconst short int yy_nxt[970] =
537 4, 5, 6, 7, 8, 9, 10, 4, 11, 12,
538 13, 4, 14, 14, 14, 14, 14, 14, 14, 14,
539 14, 4, 4, 15, 16, 4, 17, 18, 19, 20,
540 21, 22, 23, 4, 24, 25, 26, 27, 28, 29,
541 30, 31, 32, 33, 34, 35, 36, 4, 4, 4,
542 37, 39, 40, 43, 52, 41, 44, 47, 48, 111,
543 67, 57, 69, 53, 70, 58, 68, 112, 54, 59,
544 102, 55, 75, 76, 45, 49, 50, 50, 50, 50,
545 50, 50, 50, 50, 50, 56, 60, 61, 62, 63,
546 79, 77, 64, 71, 72, 78, 87, 95, 65, 85,
548 80, 73, 92, 86, 93, 97, 81, 39, 40, 88,
549 43, 41, 89, 44, 96, 108, 90, 47, 48, 113,
550 118, 130, 109, 98, 131, 114, 138, 101, 102, 435,
551 119, 45, 99, 101, 102, 142, 226, 102, 164, 143,
552 150, 274, 436, 97, 103, 103, 103, 103, 103, 103,
553 103, 103, 103, 99, 146, 151, 165, 152, 139, 199,
554 252, 98, 359, 147, 378, 385, 360, 570, 457, 386,
555 148, 569, 149, 458, 200, 568, 253, 567, 379, 104,
556 105, 105, 105, 105, 105, 105, 105, 105, 105, 106,
557 106, 106, 106, 106, 106, 106, 106, 106, 100, 101,
559 102, 43, 164, 566, 44, 565, 564, 563, 562, 397,
560 162, 162, 162, 162, 162, 162, 162, 162, 162, 100,
561 165, 388, 45, 398, 403, 501, 389, 561, 560, 390,
562 559, 558, 557, 556, 555, 554, 553, 502, 552, 551,
563 404, 550, 405, 549, 548, 163, 100, 547, 546, 545,
564 544, 543, 542, 541, 540, 539, 538, 166, 166, 166,
565 166, 166, 166, 166, 166, 166, 43, 537, 536, 44,
566 535, 534, 533, 532, 531, 530, 529, 167, 167, 167,
567 167, 167, 167, 167, 167, 167, 167, 45, 528, 167,
568 167, 167, 167, 167, 167, 168, 168, 168, 168, 168,
570 168, 168, 168, 168, 169, 169, 169, 169, 169, 169,
571 169, 169, 169, 224, 224, 224, 224, 224, 224, 224,
572 224, 224, 97, 527, 526, 525, 524, 523, 522, 521,
573 225, 225, 225, 225, 225, 225, 225, 225, 225, 225,
574 98, 520, 225, 225, 225, 225, 225, 225, 571, 226,
575 102, 519, 518, 517, 516, 515, 514, 513, 512, 511,
576 227, 227, 227, 227, 227, 227, 227, 227, 227, 571,
577 510, 509, 508, 507, 506, 505, 504, 503, 500, 499,
578 498, 497, 496, 495, 494, 493, 492, 491, 490, 489,
579 488, 487, 486, 485, 484, 228, 42, 42, 42, 42,
581 42, 42, 42, 42, 42, 229, 229, 229, 229, 229,
582 229, 229, 229, 229, 229, 483, 482, 229, 229, 229,
583 229, 229, 229, 230, 230, 230, 230, 230, 230, 230,
584 230, 230, 231, 231, 231, 231, 231, 231, 231, 231,
585 231, 43, 43, 43, 43, 43, 43, 43, 43, 43,
586 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
587 481, 480, 273, 273, 273, 273, 273, 273, 164, 479,
588 478, 477, 476, 475, 474, 473, 275, 275, 275, 275,
589 275, 275, 275, 275, 275, 275, 165, 472, 275, 275,
590 275, 275, 275, 275, 276, 276, 276, 276, 276, 276,
592 276, 276, 276, 277, 277, 277, 277, 277, 277, 277,
593 277, 277, 291, 292, 293, 294, 295, 296, 297, 298,
594 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
595 471, 470, 319, 319, 319, 319, 319, 319, 320, 320,
596 320, 320, 320, 320, 320, 320, 320, 321, 321, 321,
597 321, 321, 321, 321, 321, 321, 350, 350, 350, 350,
598 350, 350, 350, 350, 350, 351, 351, 351, 351, 351,
599 351, 351, 351, 351, 376, 376, 376, 376, 376, 376,
600 376, 376, 376, 402, 402, 402, 402, 402, 402, 402,
601 402, 402, 38, 469, 468, 38, 42, 42, 467, 42,
603 46, 46, 46, 46, 47, 47, 47, 47, 43, 43,
604 466, 43, 99, 99, 465, 99, 100, 100, 464, 100,
605 102, 102, 463, 102, 462, 461, 460, 459, 456, 455,
606 454, 453, 452, 451, 450, 449, 448, 447, 446, 445,
607 444, 443, 442, 441, 440, 439, 438, 437, 434, 433,
608 432, 431, 430, 429, 428, 427, 426, 425, 424, 423,
609 422, 421, 420, 419, 418, 417, 416, 415, 414, 413,
610 412, 411, 410, 409, 408, 407, 406, 401, 400, 399,
611 396, 395, 394, 393, 392, 391, 387, 384, 383, 382,
612 381, 380, 377, 49, 375, 374, 373, 372, 371, 354,
614 370, 369, 368, 367, 366, 365, 364, 363, 362, 361,
615 358, 357, 356, 355, 354, 353, 352, 349, 348, 347,
616 346, 345, 344, 343, 342, 341, 340, 339, 338, 337,
617 336, 335, 334, 333, 332, 331, 330, 329, 328, 327,
618 326, 325, 324, 323, 322, 318, 317, 316, 315, 314,
619 313, 312, 311, 310, 309, 308, 307, 306, 305, 304,
620 303, 302, 301, 300, 299, 290, 289, 288, 287, 286,
621 285, 284, 283, 282, 281, 280, 279, 278, 272, 271,
622 270, 269, 268, 267, 266, 265, 264, 263, 262, 261,
623 260, 259, 258, 257, 241, 256, 255, 254, 251, 250,
625 249, 248, 247, 246, 245, 244, 243, 242, 241, 240,
626 239, 238, 237, 236, 235, 234, 233, 232, 223, 222,
627 221, 220, 219, 218, 217, 216, 215, 214, 213, 212,
628 211, 210, 209, 208, 207, 206, 205, 204, 203, 202,
629 201, 198, 197, 196, 195, 194, 193, 192, 191, 190,
630 189, 188, 187, 186, 185, 184, 183, 182, 181, 180,
631 179, 178, 177, 176, 175, 174, 173, 172, 171, 170,
632 100, 161, 160, 159, 158, 157, 156, 155, 154, 153,
633 145, 144, 141, 140, 137, 136, 135, 134, 133, 132,
634 129, 128, 127, 126, 125, 124, 123, 122, 121, 120,
636 117, 116, 115, 110, 107, 48, 100, 48, 94, 91,
637 84, 83, 82, 74, 66, 51, 571, 3, 571, 571,
638 571, 571, 571, 571, 571, 571, 571, 571, 571, 571,
639 571, 571, 571, 571, 571, 571, 571, 571, 571, 571,
640 571, 571, 571, 571, 571, 571, 571, 571, 571, 571,
641 571, 571, 571, 571, 571, 571, 571, 571, 571, 571,
642 571, 571, 571, 571, 571, 571, 571, 571, 571
645 static yyconst short int yy_chk[970] =
647 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
648 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
649 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
650 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
651 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
652 1, 5, 5, 8, 16, 5, 8, 9, 9, 54,
653 21, 18, 22, 16, 22, 18, 21, 54, 17, 18,
654 581, 17, 25, 25, 8, 14, 14, 14, 14, 14,
655 14, 14, 14, 14, 14, 17, 19, 19, 19, 19,
656 27, 26, 19, 23, 23, 26, 32, 36, 19, 31,
658 27, 23, 34, 31, 34, 43, 27, 39, 39, 32,
659 42, 39, 32, 42, 36, 52, 32, 46, 46, 56,
660 60, 73, 52, 43, 73, 56, 80, 101, 101, 412,
661 60, 42, 45, 45, 45, 83, 226, 226, 102, 83,
662 87, 580, 412, 273, 45, 45, 45, 45, 45, 45,
663 45, 45, 45, 45, 86, 87, 102, 87, 80, 138,
664 200, 273, 329, 86, 355, 361, 329, 568, 436, 361,
665 86, 567, 86, 436, 138, 566, 200, 564, 355, 45,
666 49, 49, 49, 49, 49, 49, 49, 49, 49, 50,
667 50, 50, 50, 50, 50, 50, 50, 50, 98, 98,
669 98, 229, 319, 563, 229, 562, 561, 557, 555, 371,
670 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
671 319, 363, 229, 371, 377, 481, 363, 553, 552, 363,
672 551, 549, 546, 545, 544, 543, 542, 481, 541, 539,
673 377, 538, 377, 537, 536, 98, 103, 535, 534, 531,
674 530, 529, 528, 526, 525, 524, 523, 103, 103, 103,
675 103, 103, 103, 103, 103, 103, 104, 522, 520, 104,
676 519, 518, 516, 515, 514, 513, 512, 104, 104, 104,
677 104, 104, 104, 104, 104, 104, 104, 104, 511, 104,
678 104, 104, 104, 104, 104, 105, 105, 105, 105, 105,
680 105, 105, 105, 105, 106, 106, 106, 106, 106, 106,
681 106, 106, 106, 162, 162, 162, 162, 162, 162, 162,
682 162, 162, 163, 510, 509, 508, 507, 506, 505, 504,
683 163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
684 163, 503, 163, 163, 163, 163, 163, 163, 165, 165,
685 165, 502, 501, 500, 499, 498, 495, 494, 493, 492,
686 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
687 490, 489, 487, 486, 485, 484, 483, 482, 480, 479,
688 478, 477, 476, 475, 473, 472, 471, 470, 469, 468,
689 467, 466, 465, 464, 463, 165, 166, 166, 166, 166,
691 166, 166, 166, 166, 166, 167, 167, 167, 167, 167,
692 167, 167, 167, 167, 167, 462, 461, 167, 167, 167,
693 167, 167, 167, 168, 168, 168, 168, 168, 168, 168,
694 168, 168, 169, 169, 169, 169, 169, 169, 169, 169,
695 169, 224, 224, 224, 224, 224, 224, 224, 224, 224,
696 225, 225, 225, 225, 225, 225, 225, 225, 225, 225,
697 460, 459, 225, 225, 225, 225, 225, 225, 228, 458,
698 457, 456, 455, 454, 453, 452, 228, 228, 228, 228,
699 228, 228, 228, 228, 228, 228, 228, 451, 228, 228,
700 228, 228, 228, 228, 230, 230, 230, 230, 230, 230,
702 230, 230, 230, 231, 231, 231, 231, 231, 231, 231,
703 231, 231, 249, 249, 249, 249, 249, 249, 249, 249,
704 275, 275, 275, 275, 275, 275, 275, 275, 275, 275,
705 450, 448, 275, 275, 275, 275, 275, 275, 276, 276,
706 276, 276, 276, 276, 276, 276, 276, 277, 277, 277,
707 277, 277, 277, 277, 277, 277, 320, 320, 320, 320,
708 320, 320, 320, 320, 320, 321, 321, 321, 321, 321,
709 321, 321, 321, 321, 350, 350, 350, 350, 350, 350,
710 350, 350, 350, 376, 376, 376, 376, 376, 376, 376,
711 376, 376, 572, 447, 446, 572, 573, 573, 445, 573,
713 574, 574, 574, 574, 575, 575, 575, 575, 576, 576,
714 444, 576, 577, 577, 443, 577, 578, 578, 442, 578,
715 579, 579, 441, 579, 440, 439, 438, 437, 435, 432,
716 431, 430, 429, 428, 427, 426, 425, 424, 423, 422,
717 420, 419, 418, 417, 416, 415, 414, 413, 411, 410,
718 409, 407, 406, 405, 404, 403, 401, 400, 399, 398,
719 397, 396, 393, 392, 391, 390, 389, 388, 386, 385,
720 384, 383, 382, 381, 380, 379, 378, 375, 373, 372,
721 370, 369, 368, 366, 365, 364, 362, 360, 359, 358,
722 357, 356, 352, 351, 347, 346, 345, 344, 343, 342,
724 341, 340, 339, 338, 336, 335, 334, 332, 331, 330,
725 328, 327, 326, 325, 324, 323, 322, 318, 317, 316,
726 315, 313, 311, 310, 309, 308, 307, 306, 305, 304,
727 302, 301, 300, 299, 289, 288, 287, 286, 285, 284,
728 282, 281, 280, 279, 278, 271, 270, 269, 268, 267,
729 266, 265, 264, 263, 262, 260, 259, 257, 256, 255,
730 254, 253, 252, 251, 250, 248, 247, 246, 244, 243,
731 242, 240, 238, 237, 236, 235, 234, 232, 223, 222,
732 221, 219, 218, 217, 216, 215, 214, 213, 212, 211,
733 210, 209, 207, 205, 204, 203, 202, 201, 199, 197,
735 195, 194, 192, 191, 189, 186, 185, 184, 183, 180,
736 179, 178, 175, 174, 173, 172, 171, 170, 161, 160,
737 159, 158, 157, 156, 155, 154, 153, 152, 151, 150,
738 149, 148, 147, 146, 145, 144, 143, 142, 141, 140,
739 139, 137, 136, 135, 133, 132, 131, 130, 129, 128,
740 127, 126, 125, 124, 123, 121, 120, 119, 118, 117,
741 116, 115, 114, 113, 112, 111, 110, 109, 108, 107,
742 99, 96, 95, 94, 93, 92, 91, 90, 89, 88,
743 85, 84, 82, 81, 79, 78, 77, 76, 75, 74,
744 72, 70, 69, 68, 67, 65, 64, 63, 62, 61,
746 59, 58, 57, 53, 51, 47, 44, 41, 35, 33,
747 30, 29, 28, 24, 20, 15, 3, 571, 571, 571,
748 571, 571, 571, 571, 571, 571, 571, 571, 571, 571,
749 571, 571, 571, 571, 571, 571, 571, 571, 571, 571,
750 571, 571, 571, 571, 571, 571, 571, 571, 571, 571,
751 571, 571, 571, 571, 571, 571, 571, 571, 571, 571,
752 571, 571, 571, 571, 571, 571, 571, 571, 571
755 static yy_state_type yy_last_accepting_state;
756 static char *yy_last_accepting_cpos;
758 /* The intent behind this definition is that it'll catch
759 * any uses of REJECT which flex missed.
761 #define REJECT reject_used_but_not_detected
762 #define yymore() yymore_used_but_not_detected
763 #define YY_MORE_ADJ 0
764 #define YY_RESTORE_YY_MORE_OFFSET
769 * Copyright (C)1996-1997,1999 Ian Jackson
771 * This is free software; you can redistribute it and/or modify it
772 * under the terms of the GNU General Public License as published by
773 * the Free Software Foundation; either version 2 of the License, or
774 * (at your option) any later version.
776 * This program is distributed in the hope that it will be useful, but
777 * WITHOUT ANY WARRANTY; without even the implied warranty of
778 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
779 * General Public License for more details.
781 * You should have received a copy of the GNU General Public License
782 * along with userv; if not, write to the Free Software
783 * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
803 #include <sys/types.h>
804 #include <sys/stat.h>
816 typedef int directive_fnt(int dtoken);
817 static directive_fnt df_reject, df_execute, df_executefrompath;
818 static directive_fnt df_executefromdirectory, df_executebuiltin;
819 static directive_fnt df_errorstostderr, df_errorstosyslog, df_errorstofile;
820 static directive_fnt dfg_fdwant, dfg_setflag;
821 static directive_fnt df_reset, df_cd, df_userrcfile, df_include;
822 static directive_fnt df_includelookup, df_includedirectory;
823 static directive_fnt df_message, df_error, df_quit, df_eof;
824 static directive_fnt df_if, df_catchquit, df_errorspush;
825 static directive_fnt dfi_includeuserrcfile, dfi_includeclientconfig;
826 /* directive functions return:
827 * 0 for success having scanned up to and including end of line but not beyond,
828 * or tokv_error or tokv_quit.
829 * They expect to parse the whitespace before their parameters (if any).
832 typedef int parmcondition_fnt(int ctoken, char *const *parmvalues, int *rtrue);
833 static parmcondition_fnt pcf_glob, pcf_range, pcf_grep;
834 /* all conditional functions return tokv_error for failure or 0 for success
835 * at parsing and testing, in which case *rtrue is set to 0 or 1.
836 * On success they have scanned up to and including the condition's
837 * terminating newline; the pcf_... functions expect to parse the whitespace
838 * between the parameter name and the condition's arguments.
839 * Otherwise they return tokv_error.
840 * The parameter-based conditionals take a list of parameter values
841 * as obtained from the parameter functions and pa_parameter,
842 * and do _not_ free it.
845 typedef int parameter_fnt(int ptoken, char ***rvalues);
846 static parameter_fnt pf_service;
847 static parameter_fnt pf_callinguser, pf_serviceuser;
848 static parameter_fnt pf_callinggroup, pf_servicegroup;
849 static parameter_fnt pf_callingusershell, pf_serviceusershell;
850 /* Parameter functions return tokv_error or 0 for success at parsing
851 * and determining the value, in which case *rvalues is made to be
852 * a mallocd null-terminated array of pointers to mallocd strings.
853 * freeparm can be used to free such an array.
856 typedef int builtinserviceparse_fnt(char ***rnewargs);
857 static builtinserviceparse_fnt bispa_none, bispa_parameter;
858 /* These parse the arguments to a builtin service, including the
859 * newline at the end of the line. *rnewargs will initially be
860 * null, indicating that no arguments are to be set; the function
861 * may store a mallocd array of mallocd strings in it,
862 * containing the arguments it wishes to have set (null-pointer
866 static int yylex(void);
867 /* Returns a token (which may be an eof or error exception) */
869 static directive_fnt *lr_dir;
870 static parmcondition_fnt *lr_parmcond;
871 static builtinserviceparse_fnt *lr_bispa;
872 static builtinserviceexec_fnt *lr_bisexec;
873 static parameter_fnt *lr_parameter;
874 static int lr_loglevel, lr_logfacility, lr_min, lr_max, *lr_flag;
875 static int lr_flagval, lr_controlend;
876 static int lr_fdwant_readwrite; /* -1=never, 0=opt, 1=always */
878 /* Forward declarations of things used in lexer and parser */
880 struct parser_state {
881 int lineno, reportlineno, notedreferer, isinternal;
882 const char *filename;
883 struct stat filestab;
884 YY_BUFFER_STATE ybuf;
885 struct parser_state *upstate;
888 static struct parser_state *cstate;
890 struct error_handling {
891 int handling; /* One of the error handling modes tokt_ehandlemode */
892 int logfacility, loglevel;
893 int filekeep; /* File is in use by higher-level errors-push, leave it open */
898 static struct error_handling eh = { tokv_word_errorstostderr, 0,0,0,0,0 };
900 static int dequote(char *inplace);
905 /* Macros after this point can all be overridden by user definitions in
909 #ifndef YY_SKIP_YYWRAP
911 extern "C" int yywrap YY_PROTO(( void ));
913 extern int yywrap YY_PROTO(( void ));
918 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
922 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
925 #ifdef YY_NEED_STRLEN
926 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
931 static int yyinput YY_PROTO(( void ));
933 static int input YY_PROTO(( void ));
938 static int yy_start_stack_ptr = 0;
939 static int yy_start_stack_depth = 0;
940 static int *yy_start_stack = 0;
941 #ifndef YY_NO_PUSH_STATE
942 static void yy_push_state YY_PROTO(( int new_state ));
944 #ifndef YY_NO_POP_STATE
945 static void yy_pop_state YY_PROTO(( void ));
947 #ifndef YY_NO_TOP_STATE
948 static int yy_top_state YY_PROTO(( void ));
952 #define YY_NO_PUSH_STATE 1
953 #define YY_NO_POP_STATE 1
954 #define YY_NO_TOP_STATE 1
957 #ifdef YY_MALLOC_DECL
965 /* Just try to get by without declaring the routines. This will fail
966 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
967 * or sizeof(void*) != sizeof(int).
972 /* Amount of stuff to slurp up with each read. */
973 #ifndef YY_READ_BUF_SIZE
974 #define YY_READ_BUF_SIZE 8192
977 /* Copy whatever the last rule matched to the standard output. */
980 /* This used to be an fputs(), but since the string might contain NUL's,
981 * we now use fwrite().
983 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
986 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
987 * is returned in "result".
990 #define YY_INPUT(buf,result,max_size) \
991 if ( yy_current_buffer->yy_is_interactive ) \
994 for ( n = 0; n < max_size && \
995 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
998 buf[n++] = (char) c; \
999 if ( c == EOF && ferror( yyin ) ) \
1000 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1003 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
1004 && ferror( yyin ) ) \
1005 YY_FATAL_ERROR( "input in flex scanner failed" );
1008 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1009 * we don't want an extra ';' after the "return" because that will cause
1010 * some compilers to complain about unreachable statements.
1013 #define yyterminate() return YY_NULL
1016 /* Number of entries by which start-condition stack grows. */
1017 #ifndef YY_START_STACK_INCR
1018 #define YY_START_STACK_INCR 25
1021 /* Report a fatal error. */
1022 #ifndef YY_FATAL_ERROR
1023 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1026 /* Default declaration of generated scanner - a define so the user can
1027 * easily add parameters.
1030 #define YY_DECL int yylex YY_PROTO(( void ))
1033 /* Code executed at the beginning of each rule, after yytext and yyleng
1036 #ifndef YY_USER_ACTION
1037 #define YY_USER_ACTION
1040 /* Code executed at the end of each rule. */
1042 #define YY_BREAK break;
1045 #define YY_RULE_SETUP \
1050 register yy_state_type yy_current_state;
1051 register char *yy_cp, *yy_bp;
1052 register int yy_act;
1067 yy_start = 1; /* first start state */
1075 if ( ! yy_current_buffer )
1077 yy_create_buffer( yyin, YY_BUF_SIZE );
1079 yy_load_buffer_state();
1082 while ( 1 ) /* loops until end-of-file is reached */
1086 /* Support of yytext. */
1087 *yy_cp = yy_hold_char;
1089 /* yy_bp points to the position in yy_ch_buf of the start of
1094 yy_current_state = yy_start;
1098 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1099 if ( yy_accept[yy_current_state] )
1101 yy_last_accepting_state = yy_current_state;
1102 yy_last_accepting_cpos = yy_cp;
1104 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1106 yy_current_state = (int) yy_def[yy_current_state];
1107 if ( yy_current_state >= 572 )
1108 yy_c = yy_meta[(unsigned int) yy_c];
1110 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1113 while ( yy_base[yy_current_state] != 918 );
1116 yy_act = yy_accept[yy_current_state];
1118 { /* have to back up */
1119 yy_cp = yy_last_accepting_cpos;
1120 yy_current_state = yy_last_accepting_state;
1121 yy_act = yy_accept[yy_current_state];
1124 YY_DO_BEFORE_ACTION;
1127 do_action: /* This label is used only to access EOF actions. */
1131 { /* beginning of action switch */
1132 case 0: /* must back up */
1133 /* undo the effects of YY_DO_BEFORE_ACTION */
1134 *yy_cp = yy_hold_char;
1135 yy_cp = yy_last_accepting_cpos;
1136 yy_current_state = yy_last_accepting_state;
1137 goto yy_find_action;
1142 { lr_dir= df_reject; return tokv_word_reject; }
1147 { lr_dir= df_executefromdirectory; return tokv_word_executefromdirectory; }
1152 { lr_dir= df_executefrompath; return tokv_word_executefrompath; }
1157 { lr_dir= df_executebuiltin; return tokv_word_executebuiltin; }
1162 { lr_dir= df_errorstostderr; return tokv_word_errorstostderr; }
1167 { lr_dir= df_errorstosyslog; return tokv_word_errorstosyslog; }
1172 { lr_dir= df_errorstofile; return tokv_word_errorstofile; }
1177 { lr_dir= dfg_fdwant; lr_fdwant_readwrite=1; return tokv_word_requirefd; }
1182 { lr_dir= dfg_fdwant; lr_fdwant_readwrite=0; return tokv_word_allowfd; }
1187 { lr_dir= dfg_fdwant; lr_fdwant_readwrite=0; return tokv_word_nullfd; }
1192 { lr_dir= dfg_fdwant; lr_fdwant_readwrite=-1; return tokv_word_rejectfd; }
1197 { lr_dir= dfg_fdwant; lr_fdwant_readwrite=-1; return tokv_word_ignorefd; }
1202 { lr_dir= dfg_setflag; lr_flag= &setenvironment; lr_flagval= 1; return tokv_word_setenvironment; }
1207 { lr_dir= dfg_setflag; lr_flag= &setenvironment; lr_flagval= 0; return tokv_word_nosetenvironment; }
1212 { lr_dir= dfg_setflag; lr_flag= &suppressargs; lr_flagval= 1; return tokv_word_suppressargs; }
1217 { lr_dir= dfg_setflag; lr_flag= &suppressargs; lr_flagval= 0; return tokv_word_nosuppressargs; }
1222 { lr_dir= dfg_setflag; lr_flag= &disconnecthup; lr_flagval= 1; return tokv_word_disconnecthup; }
1227 { lr_dir= dfg_setflag; lr_flag= &disconnecthup; lr_flagval= 0; return tokv_word_nodisconnecthup; }
1232 { lr_dir= df_cd; return tokv_word_cd; }
1237 { lr_dir= df_userrcfile; return tokv_word_userrcfile; }
1242 { lr_dir= df_include; return tokv_word_include; }
1247 { lr_dir= df_include; return tokv_word_includeifexist; }
1252 { lr_dir= df_includelookup; return tokv_word_includelookup; }
1257 { lr_dir= df_includelookup; return tokv_word_includelookupall; }
1262 { lr_dir= df_includedirectory; return tokv_word_includedirectory; }
1267 { lr_dir= df_message; return tokv_word_message; }
1272 { lr_dir= df_include; return tokv_word_includesysconfig; }
1277 { lr_dir= dfi_includeuserrcfile; return tokv_word_includeuserrcfile; }
1282 { lr_dir= dfi_includeclientconfig; return tokv_word_includeclientconfig; }
1287 { lr_dir= df_quit; return tokv_word_quit; }
1292 { lr_dir= df_eof; return tokv_word_eof; }
1297 { lr_dir= df_if; return tokv_word_if; }
1302 { lr_dir= df_catchquit; return tokv_word_catchquit; }
1307 { lr_dir= df_errorspush; return tokv_word_errorspush; }
1312 { lr_controlend= tokv_word_if; return tokv_word_elif; }
1317 { lr_controlend= tokv_word_if; return tokv_word_else; }
1322 { lr_controlend= tokv_word_if; return tokv_word_fi; }
1327 { lr_controlend= tokv_word_catchquit; return tokv_word_hctac; }
1332 { lr_controlend= tokv_word_errorspush; return tokv_word_srorre; }
1337 { lr_parmcond= pcf_glob; return tokv_word_glob; }
1342 { lr_parmcond= pcf_range; return tokv_word_range; }
1347 { lr_parmcond= pcf_grep; return tokv_word_grep; }
1352 { lr_bispa= bispa_none; lr_bisexec= bisexec_environment; return tokv_word_environment; }
1357 { lr_bispa= bispa_parameter; lr_bisexec= bisexec_parameter; return tokv_word_parameter; }
1362 { lr_bispa= bispa_none; lr_bisexec= bisexec_version; return tokv_word_version; }
1367 { lr_bispa= bispa_none; lr_bisexec= bisexec_toplevel; return tokv_word_toplevel; }
1372 { lr_bispa= bispa_none; lr_bisexec= bisexec_override; return tokv_word_override; }
1377 { lr_bispa= bispa_none; lr_bisexec= bisexec_reset; lr_dir= df_reset; return tokv_word_reset; }
1382 { lr_bispa= bispa_none; lr_bisexec= bisexec_execute; lr_dir= df_execute; return tokv_word_execute; }
1387 { lr_bispa= bispa_none; lr_bisexec= bisexec_help; return tokv_word_help; }
1392 { lr_parameter= pf_service; return tokv_word_service; }
1397 { lr_parameter= pf_callinguser; return tokv_word_callinguser; }
1402 { lr_parameter= pf_callinggroup; return tokv_word_callinggroup; }
1407 { lr_parameter= pf_callingusershell; return tokv_word_callingusershell; }
1412 { lr_parameter= pf_serviceuser; return tokv_word_serviceuser; }
1417 { lr_parameter= pf_servicegroup; return tokv_word_servicegroup; }
1422 { lr_parameter= pf_serviceusershell; return tokv_word_serviceusershell; }
1427 { lr_loglevel= LOG_DEBUG; return tokv_syslog_debug; }
1432 { lr_loglevel= LOG_INFO; return tokv_syslog_info; }
1437 { lr_loglevel= LOG_NOTICE; return tokv_syslog_notice; }
1442 { lr_loglevel= LOG_WARNING; return tokv_syslog_warning; }
1447 { lr_loglevel= LOG_ERR; return tokv_syslog_err; }
1452 { lr_loglevel= LOG_CRIT; return tokv_syslog_crit; }
1457 { lr_loglevel= LOG_ALERT; return tokv_syslog_alert; }
1462 { lr_loglevel= LOG_EMERG; return tokv_syslog_emerg; }
1467 { lr_logfacility= LOG_AUTHPRIV; return tokv_syslog_authpriv; }
1472 { lr_logfacility= LOG_CRON; return tokv_syslog_cron; }
1477 { lr_logfacility= LOG_DAEMON; return tokv_syslog_daemon; }
1482 { lr_logfacility= LOG_KERN; return tokv_syslog_kern; }
1487 { lr_logfacility= LOG_LPR; return tokv_syslog_lpr; }
1492 { lr_logfacility= LOG_MAIL; return tokv_syslog_mail; }
1497 { lr_logfacility= LOG_NEWS; return tokv_syslog_news; }
1502 { lr_logfacility= LOG_SYSLOG; return tokv_syslog_syslog; }
1507 { lr_logfacility= LOG_USER; return tokv_syslog_user; }
1512 { lr_logfacility= LOG_UUCP; return tokv_syslog_uucp; }
1517 { lr_logfacility= LOG_LOCAL0; return tokv_syslog_local0; }
1522 { lr_logfacility= LOG_LOCAL1; return tokv_syslog_local1; }
1527 { lr_logfacility= LOG_LOCAL2; return tokv_syslog_local2; }
1532 { lr_logfacility= LOG_LOCAL3; return tokv_syslog_local3; }
1537 { lr_logfacility= LOG_LOCAL4; return tokv_syslog_local4; }
1542 { lr_logfacility= LOG_LOCAL5; return tokv_syslog_local5; }
1547 { lr_logfacility= LOG_LOCAL6; return tokv_syslog_local6; }
1552 { lr_logfacility= LOG_LOCAL7; return tokv_syslog_local7; }
1557 { return tokv_word_read; }
1562 { return tokv_word_write; }
1567 { return tokv_dollar; }
1572 { return tokv_openparen; }
1577 { return tokv_closeparen; }
1582 { return tokv_not; }
1587 { return tokv_and; }
1597 { lr_dir= df_error; lr_loglevel= LOG_ERR; return tokv_word_error; }
1604 lr_min=lr_max= (int)strtoul(yytext,&ep,10);
1606 return tokv_ordinal;
1614 lr_min= (int)strtoul(yytext,&ep,10);
1615 assert(*ep == HYPHEN);
1617 lr_max= (int)strtoul(ep,&ep,10);
1619 if (lr_max < lr_min) {
1620 parseerrprint("fd range has min > max");
1623 return tokv_fdrange;
1631 lr_min= (int)strtoul(yytext,&ep,10);
1632 assert(*ep == HYPHEN);
1635 return tokv_fdstoend;
1646 cstate->lineno++; return tokv_newline;
1651 cstate->lineno++; return tokv_newline;
1657 parseerrprint("missing newline at eof after comment");
1665 return dequote(yytext);
1672 parseerrprint("misquoted or unterminated string");
1679 return tokv_barestring;
1681 case YY_STATE_EOF(INITIAL):
1691 case YY_END_OF_BUFFER:
1693 /* Amount of text matched not including the EOB char. */
1694 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1696 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1697 *yy_cp = yy_hold_char;
1698 YY_RESTORE_YY_MORE_OFFSET
1700 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1702 /* We're scanning a new file or input source. It's
1703 * possible that this happened because the user
1704 * just pointed yyin at a new source and called
1705 * yylex(). If so, then we have to assure
1706 * consistency between yy_current_buffer and our
1707 * globals. Here is the right place to do so, because
1708 * this is the first action (other than possibly a
1709 * back-up) that will match for the new input source.
1711 yy_n_chars = yy_current_buffer->yy_n_chars;
1712 yy_current_buffer->yy_input_file = yyin;
1713 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1716 /* Note that here we test for yy_c_buf_p "<=" to the position
1717 * of the first EOB in the buffer, since yy_c_buf_p will
1718 * already have been incremented past the NUL character
1719 * (since all states make transitions on EOB to the
1720 * end-of-buffer state). Contrast this with the test
1723 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1724 { /* This was really a NUL. */
1725 yy_state_type yy_next_state;
1727 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1729 yy_current_state = yy_get_previous_state();
1731 /* Okay, we're now positioned to make the NUL
1732 * transition. We couldn't have
1733 * yy_get_previous_state() go ahead and do it
1734 * for us because it doesn't know how to deal
1735 * with the possibility of jamming (and we don't
1736 * want to build jamming into it because then it
1737 * will run more slowly).
1740 yy_next_state = yy_try_NUL_trans( yy_current_state );
1742 yy_bp = yytext_ptr + YY_MORE_ADJ;
1744 if ( yy_next_state )
1746 /* Consume the NUL. */
1747 yy_cp = ++yy_c_buf_p;
1748 yy_current_state = yy_next_state;
1755 goto yy_find_action;
1759 else switch ( yy_get_next_buffer() )
1761 case EOB_ACT_END_OF_FILE:
1763 yy_did_buffer_switch_on_eof = 0;
1767 /* Note: because we've taken care in
1768 * yy_get_next_buffer() to have set up
1769 * yytext, we can now set up
1770 * yy_c_buf_p so that if some total
1771 * hoser (like flex itself) wants to
1772 * call the scanner after we return the
1773 * YY_NULL, it'll still work - another
1774 * YY_NULL will get returned.
1776 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1778 yy_act = YY_STATE_EOF(YY_START);
1784 if ( ! yy_did_buffer_switch_on_eof )
1790 case EOB_ACT_CONTINUE_SCAN:
1792 yytext_ptr + yy_amount_of_matched_text;
1794 yy_current_state = yy_get_previous_state();
1797 yy_bp = yytext_ptr + YY_MORE_ADJ;
1800 case EOB_ACT_LAST_MATCH:
1802 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1804 yy_current_state = yy_get_previous_state();
1807 yy_bp = yytext_ptr + YY_MORE_ADJ;
1808 goto yy_find_action;
1815 "fatal flex scanner internal error--no action found" );
1816 } /* end of action switch */
1817 } /* end of scanning one token */
1818 } /* end of yylex */
1821 /* yy_get_next_buffer - try to read in a new buffer
1823 * Returns a code representing an action:
1824 * EOB_ACT_LAST_MATCH -
1825 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1826 * EOB_ACT_END_OF_FILE - end of file
1829 static int yy_get_next_buffer()
1831 register char *dest = yy_current_buffer->yy_ch_buf;
1832 register char *source = yytext_ptr;
1833 register int number_to_move, i;
1836 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1838 "fatal flex scanner internal error--end of buffer missed" );
1840 if ( yy_current_buffer->yy_fill_buffer == 0 )
1841 { /* Don't try to fill the buffer, so this is an EOF. */
1842 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1844 /* We matched a single character, the EOB, so
1845 * treat this as a final EOF.
1847 return EOB_ACT_END_OF_FILE;
1852 /* We matched some text prior to the EOB, first
1855 return EOB_ACT_LAST_MATCH;
1859 /* Try to read more data. */
1861 /* First move last chars to start of buffer. */
1862 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1864 for ( i = 0; i < number_to_move; ++i )
1865 *(dest++) = *(source++);
1867 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1868 /* don't do the read, it's not guaranteed to return an EOF,
1871 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1876 yy_current_buffer->yy_buf_size - number_to_move - 1;
1878 while ( num_to_read <= 0 )
1879 { /* Not enough room in the buffer - grow it. */
1880 #ifdef YY_USES_REJECT
1882 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1885 /* just a shorter name for the current buffer */
1886 YY_BUFFER_STATE b = yy_current_buffer;
1888 int yy_c_buf_p_offset =
1889 (int) (yy_c_buf_p - b->yy_ch_buf);
1891 if ( b->yy_is_our_buffer )
1893 int new_size = b->yy_buf_size * 2;
1895 if ( new_size <= 0 )
1896 b->yy_buf_size += b->yy_buf_size / 8;
1898 b->yy_buf_size *= 2;
1900 b->yy_ch_buf = (char *)
1901 /* Include room in for 2 EOB chars. */
1902 yy_flex_realloc( (void *) b->yy_ch_buf,
1903 b->yy_buf_size + 2 );
1906 /* Can't grow it, we don't own it. */
1909 if ( ! b->yy_ch_buf )
1911 "fatal error - scanner input buffer overflow" );
1913 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1915 num_to_read = yy_current_buffer->yy_buf_size -
1920 if ( num_to_read > YY_READ_BUF_SIZE )
1921 num_to_read = YY_READ_BUF_SIZE;
1923 /* Read in more data. */
1924 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1925 yy_n_chars, num_to_read );
1927 yy_current_buffer->yy_n_chars = yy_n_chars;
1930 if ( yy_n_chars == 0 )
1932 if ( number_to_move == YY_MORE_ADJ )
1934 ret_val = EOB_ACT_END_OF_FILE;
1940 ret_val = EOB_ACT_LAST_MATCH;
1941 yy_current_buffer->yy_buffer_status =
1942 YY_BUFFER_EOF_PENDING;
1947 ret_val = EOB_ACT_CONTINUE_SCAN;
1949 yy_n_chars += number_to_move;
1950 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1951 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1953 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1959 /* yy_get_previous_state - get the state just before the EOB char was reached */
1961 static yy_state_type yy_get_previous_state()
1963 register yy_state_type yy_current_state;
1964 register char *yy_cp;
1966 yy_current_state = yy_start;
1968 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1970 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1971 if ( yy_accept[yy_current_state] )
1973 yy_last_accepting_state = yy_current_state;
1974 yy_last_accepting_cpos = yy_cp;
1976 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1978 yy_current_state = (int) yy_def[yy_current_state];
1979 if ( yy_current_state >= 572 )
1980 yy_c = yy_meta[(unsigned int) yy_c];
1982 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1985 return yy_current_state;
1989 /* yy_try_NUL_trans - try to make a transition on the NUL character
1992 * next_state = yy_try_NUL_trans( current_state );
1995 #ifdef YY_USE_PROTOS
1996 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1998 static yy_state_type yy_try_NUL_trans( yy_current_state )
1999 yy_state_type yy_current_state;
2002 register int yy_is_jam;
2003 register char *yy_cp = yy_c_buf_p;
2005 register YY_CHAR yy_c = 1;
2006 if ( yy_accept[yy_current_state] )
2008 yy_last_accepting_state = yy_current_state;
2009 yy_last_accepting_cpos = yy_cp;
2011 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2013 yy_current_state = (int) yy_def[yy_current_state];
2014 if ( yy_current_state >= 572 )
2015 yy_c = yy_meta[(unsigned int) yy_c];
2017 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2018 yy_is_jam = (yy_current_state == 571);
2020 return yy_is_jam ? 0 : yy_current_state;
2025 #ifdef YY_USE_PROTOS
2026 static void yyunput( int c, register char *yy_bp )
2028 static void yyunput( c, yy_bp )
2030 register char *yy_bp;
2033 register char *yy_cp = yy_c_buf_p;
2035 /* undo effects of setting up yytext */
2036 *yy_cp = yy_hold_char;
2038 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
2039 { /* need to shift things up to make room */
2040 /* +2 for EOB chars. */
2041 register int number_to_move = yy_n_chars + 2;
2042 register char *dest = &yy_current_buffer->yy_ch_buf[
2043 yy_current_buffer->yy_buf_size + 2];
2044 register char *source =
2045 &yy_current_buffer->yy_ch_buf[number_to_move];
2047 while ( source > yy_current_buffer->yy_ch_buf )
2048 *--dest = *--source;
2050 yy_cp += (int) (dest - source);
2051 yy_bp += (int) (dest - source);
2052 yy_current_buffer->yy_n_chars =
2053 yy_n_chars = yy_current_buffer->yy_buf_size;
2055 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
2056 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2059 *--yy_cp = (char) c;
2063 yy_hold_char = *yy_cp;
2066 #endif /* ifndef YY_NO_UNPUT */
2070 static int yyinput()
2077 *yy_c_buf_p = yy_hold_char;
2079 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2081 /* yy_c_buf_p now points to the character we want to return.
2082 * If this occurs *before* the EOB characters, then it's a
2083 * valid NUL; if not, then we've hit the end of the buffer.
2085 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
2086 /* This was really a NUL. */
2090 { /* need more input */
2091 int offset = yy_c_buf_p - yytext_ptr;
2094 switch ( yy_get_next_buffer() )
2096 case EOB_ACT_LAST_MATCH:
2097 /* This happens because yy_g_n_b()
2098 * sees that we've accumulated a
2099 * token and flags that we need to
2100 * try matching the token before
2101 * proceeding. But for input(),
2102 * there's no matching to consider.
2103 * So convert the EOB_ACT_LAST_MATCH
2104 * to EOB_ACT_END_OF_FILE.
2107 /* Reset buffer status. */
2112 case EOB_ACT_END_OF_FILE:
2117 if ( ! yy_did_buffer_switch_on_eof )
2126 case EOB_ACT_CONTINUE_SCAN:
2127 yy_c_buf_p = yytext_ptr + offset;
2133 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
2134 *yy_c_buf_p = '\0'; /* preserve yytext */
2135 yy_hold_char = *++yy_c_buf_p;
2142 #ifdef YY_USE_PROTOS
2143 void yyrestart( FILE *input_file )
2145 void yyrestart( input_file )
2149 if ( ! yy_current_buffer )
2150 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
2152 yy_init_buffer( yy_current_buffer, input_file );
2153 yy_load_buffer_state();
2157 #ifdef YY_USE_PROTOS
2158 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
2160 void yy_switch_to_buffer( new_buffer )
2161 YY_BUFFER_STATE new_buffer;
2164 if ( yy_current_buffer == new_buffer )
2167 if ( yy_current_buffer )
2169 /* Flush out information for old buffer. */
2170 *yy_c_buf_p = yy_hold_char;
2171 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
2172 yy_current_buffer->yy_n_chars = yy_n_chars;
2175 yy_current_buffer = new_buffer;
2176 yy_load_buffer_state();
2178 /* We don't actually know whether we did this switch during
2179 * EOF (yywrap()) processing, but the only time this flag
2180 * is looked at is after yywrap() is called, so it's safe
2181 * to go ahead and always set it.
2183 yy_did_buffer_switch_on_eof = 1;
2187 #ifdef YY_USE_PROTOS
2188 void yy_load_buffer_state( void )
2190 void yy_load_buffer_state()
2193 yy_n_chars = yy_current_buffer->yy_n_chars;
2194 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
2195 yyin = yy_current_buffer->yy_input_file;
2196 yy_hold_char = *yy_c_buf_p;
2200 #ifdef YY_USE_PROTOS
2201 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
2203 YY_BUFFER_STATE yy_create_buffer( file, size )
2210 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2212 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2214 b->yy_buf_size = size;
2216 /* yy_ch_buf has to be 2 characters longer than the size given because
2217 * we need to put in 2 end-of-buffer characters.
2219 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
2220 if ( ! b->yy_ch_buf )
2221 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2223 b->yy_is_our_buffer = 1;
2225 yy_init_buffer( b, file );
2231 #ifdef YY_USE_PROTOS
2232 void yy_delete_buffer( YY_BUFFER_STATE b )
2234 void yy_delete_buffer( b )
2241 if ( b == yy_current_buffer )
2242 yy_current_buffer = (YY_BUFFER_STATE) 0;
2244 if ( b->yy_is_our_buffer )
2245 yy_flex_free( (void *) b->yy_ch_buf );
2247 yy_flex_free( (void *) b );
2251 #ifndef YY_ALWAYS_INTERACTIVE
2252 #ifndef YY_NEVER_INTERACTIVE
2253 extern int isatty YY_PROTO(( int ));
2257 #ifdef YY_USE_PROTOS
2258 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
2260 void yy_init_buffer( b, file )
2267 yy_flush_buffer( b );
2269 b->yy_input_file = file;
2270 b->yy_fill_buffer = 1;
2272 #if YY_ALWAYS_INTERACTIVE
2273 b->yy_is_interactive = 1;
2275 #if YY_NEVER_INTERACTIVE
2276 b->yy_is_interactive = 0;
2278 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2284 #ifdef YY_USE_PROTOS
2285 void yy_flush_buffer( YY_BUFFER_STATE b )
2287 void yy_flush_buffer( b )
2297 /* We always need two end-of-buffer characters. The first causes
2298 * a transition to the end-of-buffer state. The second causes
2299 * a jam in that state.
2301 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2302 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2304 b->yy_buf_pos = &b->yy_ch_buf[0];
2307 b->yy_buffer_status = YY_BUFFER_NEW;
2309 if ( b == yy_current_buffer )
2310 yy_load_buffer_state();
2314 #ifndef YY_NO_SCAN_BUFFER
2315 #ifdef YY_USE_PROTOS
2316 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
2318 YY_BUFFER_STATE yy_scan_buffer( base, size )
2326 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2327 base[size-1] != YY_END_OF_BUFFER_CHAR )
2328 /* They forgot to leave room for the EOB's. */
2331 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2333 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2335 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2336 b->yy_buf_pos = b->yy_ch_buf = base;
2337 b->yy_is_our_buffer = 0;
2338 b->yy_input_file = 0;
2339 b->yy_n_chars = b->yy_buf_size;
2340 b->yy_is_interactive = 0;
2342 b->yy_fill_buffer = 0;
2343 b->yy_buffer_status = YY_BUFFER_NEW;
2345 yy_switch_to_buffer( b );
2352 #ifndef YY_NO_SCAN_STRING
2353 #ifdef YY_USE_PROTOS
2354 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
2356 YY_BUFFER_STATE yy_scan_string( yy_str )
2357 yyconst char *yy_str;
2361 for ( len = 0; yy_str[len]; ++len )
2364 return yy_scan_bytes( yy_str, len );
2369 #ifndef YY_NO_SCAN_BYTES
2370 #ifdef YY_USE_PROTOS
2371 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
2373 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
2374 yyconst char *bytes;
2383 /* Get memory for full buffer, including space for trailing EOB's. */
2385 buf = (char *) yy_flex_alloc( n );
2387 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2389 for ( i = 0; i < len; ++i )
2392 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
2394 b = yy_scan_buffer( buf, n );
2396 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2398 /* It's okay to grow etc. this buffer, and we should throw it
2399 * away when we're done.
2401 b->yy_is_our_buffer = 1;
2408 #ifndef YY_NO_PUSH_STATE
2409 #ifdef YY_USE_PROTOS
2410 static void yy_push_state( int new_state )
2412 static void yy_push_state( new_state )
2416 if ( yy_start_stack_ptr >= yy_start_stack_depth )
2420 yy_start_stack_depth += YY_START_STACK_INCR;
2421 new_size = yy_start_stack_depth * sizeof( int );
2423 if ( ! yy_start_stack )
2424 yy_start_stack = (int *) yy_flex_alloc( new_size );
2427 yy_start_stack = (int *) yy_flex_realloc(
2428 (void *) yy_start_stack, new_size );
2430 if ( ! yy_start_stack )
2432 "out of memory expanding start-condition stack" );
2435 yy_start_stack[yy_start_stack_ptr++] = YY_START;
2442 #ifndef YY_NO_POP_STATE
2443 static void yy_pop_state()
2445 if ( --yy_start_stack_ptr < 0 )
2446 YY_FATAL_ERROR( "start-condition stack underflow" );
2448 BEGIN(yy_start_stack[yy_start_stack_ptr]);
2453 #ifndef YY_NO_TOP_STATE
2454 static int yy_top_state()
2456 return yy_start_stack[yy_start_stack_ptr - 1];
2460 #ifndef YY_EXIT_FAILURE
2461 #define YY_EXIT_FAILURE 2
2464 #ifdef YY_USE_PROTOS
2465 static void yy_fatal_error( yyconst char msg[] )
2467 static void yy_fatal_error( msg )
2471 (void) fprintf( stderr, "%s\n", msg );
2472 exit( YY_EXIT_FAILURE );
2477 /* Redefine yyless() so it works in section 3 code. */
2483 /* Undo effects of setting up yytext. */ \
2484 yytext[yyleng] = yy_hold_char; \
2485 yy_c_buf_p = yytext + n; \
2486 yy_hold_char = *yy_c_buf_p; \
2487 *yy_c_buf_p = '\0'; \
2493 /* Internal utility routines. */
2496 #ifdef YY_USE_PROTOS
2497 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
2499 static void yy_flex_strncpy( s1, s2, n )
2506 for ( i = 0; i < n; ++i )
2511 #ifdef YY_NEED_STRLEN
2512 #ifdef YY_USE_PROTOS
2513 static int yy_flex_strlen( yyconst char *s )
2515 static int yy_flex_strlen( s )
2520 for ( n = 0; s[n]; ++n )
2528 #ifdef YY_USE_PROTOS
2529 static void *yy_flex_alloc( yy_size_t size )
2531 static void *yy_flex_alloc( size )
2535 return (void *) malloc( size );
2538 #ifdef YY_USE_PROTOS
2539 static void *yy_flex_realloc( void *ptr, yy_size_t size )
2541 static void *yy_flex_realloc( ptr, size )
2546 /* The cast to (char *) in the following accommodates both
2547 * implementations that use char* generic pointers, and those
2548 * that use void* generic pointers. It works with the latter
2549 * because both ANSI C and C++ allow castless assignment from
2550 * any pointer type to void*, and deal with argument conversions
2551 * as though doing an assignment.
2553 return (void *) realloc( (char *) ptr, size );
2556 #ifdef YY_USE_PROTOS
2557 static void yy_flex_free( void *ptr )
2559 static void yy_flex_free( ptr )
2576 const char *const builtinservicehelpstrings[]= {
2578 "parameter <parameter>",