5 #define YY_INT_ALIGNED short int
7 /* A lexical scanner generated by flex */
10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 5
12 #define YY_FLEX_SUBMINOR_VERSION 33
13 #if YY_FLEX_SUBMINOR_VERSION > 0
17 /* First, we deal with platform-specific or compiler-specific issues. */
19 /* begin standard C headers. */
25 /* end standard C headers. */
27 /* flex integer type definitions */
32 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
34 #if __STDC_VERSION__ >= 199901L
36 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37 * if you want the limit (max/min) macros for int types.
39 #ifndef __STDC_LIMIT_MACROS
40 #define __STDC_LIMIT_MACROS 1
44 typedef int8_t flex_int8_t;
45 typedef uint8_t flex_uint8_t;
46 typedef int16_t flex_int16_t;
47 typedef uint16_t flex_uint16_t;
48 typedef int32_t flex_int32_t;
49 typedef uint32_t flex_uint32_t;
51 typedef signed char flex_int8_t;
52 typedef short int flex_int16_t;
53 typedef int flex_int32_t;
54 typedef unsigned char flex_uint8_t;
55 typedef unsigned short int flex_uint16_t;
56 typedef unsigned int flex_uint32_t;
59 /* Limits of integral types. */
61 #define INT8_MIN (-128)
64 #define INT16_MIN (-32767-1)
67 #define INT32_MIN (-2147483647-1)
70 #define INT8_MAX (127)
73 #define INT16_MAX (32767)
76 #define INT32_MAX (2147483647)
79 #define UINT8_MAX (255U)
82 #define UINT16_MAX (65535U)
85 #define UINT32_MAX (4294967295U)
88 #endif /* ! FLEXINT_H */
92 /* The "const" storage-class-modifier is valid. */
95 #else /* ! __cplusplus */
101 #endif /* __STDC__ */
102 #endif /* ! __cplusplus */
105 #define yyconst const
110 /* Returned upon end-of-file. */
113 /* Promotes a possibly negative, possibly signed char to an unsigned
114 * integer for use as an array index. If the signed char is negative,
115 * we want to instead treat it as an 8-bit unsigned char, hence the
118 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
120 /* Enter a start condition. This macro really ought to take a parameter,
121 * but we do it the disgusting crufty way forced on us by the ()-less
122 * definition of BEGIN.
124 #define BEGIN (yy_start) = 1 + 2 *
126 /* Translate the current start state into a value that can be later handed
127 * to BEGIN to return to the state. The YYSTATE alias is for lex
130 #define YY_START (((yy_start) - 1) / 2)
131 #define YYSTATE YY_START
133 /* Action number for EOF rule of a given start state. */
134 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
136 /* Special action meaning "start processing a new file". */
137 #define YY_NEW_FILE yyrestart(yyin )
139 #define YY_END_OF_BUFFER_CHAR 0
141 /* Size of default input buffer. */
143 #define YY_BUF_SIZE 16384
146 /* The state buf must be large enough to hold one state per character in the main buffer.
148 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
150 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
151 #define YY_TYPEDEF_YY_BUFFER_STATE
152 typedef struct yy_buffer_state *YY_BUFFER_STATE;
157 extern FILE *yyin, *yyout;
159 #define EOB_ACT_CONTINUE_SCAN 0
160 #define EOB_ACT_END_OF_FILE 1
161 #define EOB_ACT_LAST_MATCH 2
163 #define YY_LESS_LINENO(n)
165 /* Return all but the first "n" matched characters back to the input stream. */
169 /* Undo effects of setting up yytext. */ \
170 int yyless_macro_arg = (n); \
171 YY_LESS_LINENO(yyless_macro_arg);\
172 *yy_cp = (yy_hold_char); \
173 YY_RESTORE_YY_MORE_OFFSET \
174 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
175 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
179 #define unput(c) yyunput( c, (yytext_ptr) )
181 /* The following is because we cannot portably get our hands on size_t
182 * (without autoconf's help, which isn't available because we want
183 * flex-generated scanners to compile on their own).
186 #ifndef YY_TYPEDEF_YY_SIZE_T
187 #define YY_TYPEDEF_YY_SIZE_T
188 typedef unsigned int yy_size_t;
191 #ifndef YY_STRUCT_YY_BUFFER_STATE
192 #define YY_STRUCT_YY_BUFFER_STATE
193 struct yy_buffer_state
197 char *yy_ch_buf; /* input buffer */
198 char *yy_buf_pos; /* current position in input buffer */
200 /* Size of input buffer in bytes, not including room for EOB
203 yy_size_t yy_buf_size;
205 /* Number of characters read into yy_ch_buf, not including EOB
210 /* Whether we "own" the buffer - i.e., we know we created it,
211 * and can realloc() it to grow it, and should free() it to
214 int yy_is_our_buffer;
216 /* Whether this is an "interactive" input source; if so, and
217 * if we're using stdio for input, then we want to use getc()
218 * instead of fread(), to make sure we stop fetching input after
221 int yy_is_interactive;
223 /* Whether we're considered to be at the beginning of a line.
224 * If so, '^' rules will be active on the next match, otherwise
229 int yy_bs_lineno; /**< The line count. */
230 int yy_bs_column; /**< The column count. */
232 /* Whether to try to fill the input buffer when we reach the
237 int yy_buffer_status;
239 #define YY_BUFFER_NEW 0
240 #define YY_BUFFER_NORMAL 1
241 /* When an EOF's been seen but there's still some text to process
242 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
243 * shouldn't try reading from the input source any more. We might
244 * still have a bunch of tokens to match, though, because of
245 * possible backing-up.
247 * When we actually see the EOF, we change the status to "new"
248 * (via yyrestart()), so that the user can continue scanning by
249 * just pointing yyin at a new input file.
251 #define YY_BUFFER_EOF_PENDING 2
254 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
256 /* Stack of input buffers. */
257 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
258 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
259 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
261 /* We provide macros for accessing buffer states in case in the
262 * future we want to put the buffer states in a more general
265 * Returns the top of the stack, or NULL.
267 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
268 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
271 /* Same as previous macro, but useful when we know that the buffer stack is not
272 * NULL or when we need an lvalue. For internal use only.
274 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
276 /* yy_hold_char holds the character lost when yytext is formed. */
277 static char yy_hold_char;
278 static int yy_n_chars; /* number of characters read into yy_ch_buf */
281 /* Points to current character in buffer. */
282 static char *yy_c_buf_p = (char *) 0;
283 static int yy_init = 0; /* whether we need to initialize */
284 static int yy_start = 0; /* start state number */
286 /* Flag which is used to allow yywrap()'s to do buffer switches
287 * instead of setting up a fresh yyin. A bit of a hack ...
289 static int yy_did_buffer_switch_on_eof;
291 void yyrestart (FILE *input_file );
292 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
293 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
294 void yy_delete_buffer (YY_BUFFER_STATE b );
295 void yy_flush_buffer (YY_BUFFER_STATE b );
296 void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
297 void yypop_buffer_state (void );
299 static void yyensure_buffer_stack (void );
300 static void yy_load_buffer_state (void );
301 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
303 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
305 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
306 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
307 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
309 void *yyalloc (yy_size_t );
310 void *yyrealloc (void *,yy_size_t );
311 void yyfree (void * );
313 #define yy_new_buffer yy_create_buffer
315 #define yy_set_interactive(is_interactive) \
317 if ( ! YY_CURRENT_BUFFER ){ \
318 yyensure_buffer_stack (); \
319 YY_CURRENT_BUFFER_LVALUE = \
320 yy_create_buffer(yyin,YY_BUF_SIZE ); \
322 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
325 #define yy_set_bol(at_bol) \
327 if ( ! YY_CURRENT_BUFFER ){\
328 yyensure_buffer_stack (); \
329 YY_CURRENT_BUFFER_LVALUE = \
330 yy_create_buffer(yyin,YY_BUF_SIZE ); \
332 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
335 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
337 /* Begin user sect3 */
339 typedef unsigned char YY_CHAR;
341 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
343 typedef int yy_state_type;
350 #define yytext_ptr yytext
352 static yy_state_type yy_get_previous_state (void );
353 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
354 static int yy_get_next_buffer (void );
355 static void yy_fatal_error (yyconst char msg[] );
357 /* Done after the current pattern has been matched and before the
358 * corresponding action - sets up yytext.
360 #define YY_DO_BEFORE_ACTION \
361 (yytext_ptr) = yy_bp; \
362 yyleng = (size_t) (yy_cp - yy_bp); \
363 (yy_hold_char) = *yy_cp; \
365 (yy_c_buf_p) = yy_cp;
367 #define YY_NUM_RULES 38
368 #define YY_END_OF_BUFFER 39
369 /* This struct is not used in this scanner,
370 but its presence is necessary. */
373 flex_int32_t yy_verify;
376 static yyconst flex_int16_t yy_accept[185] =
378 0, 0, 39, 38, 34, 35, 38, 38, 31, 38,
379 29, 32, 32, 32, 32, 32, 32, 32, 32, 32,
380 32, 32, 32, 32, 32, 32, 38, 34, 0, 0,
381 31, 0, 36, 32, 32, 32, 32, 32, 32, 32,
382 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
383 32, 32, 32, 32, 32, 32, 32, 0, 33, 37,
384 32, 32, 32, 32, 32, 32, 32, 32, 9, 32,
385 32, 32, 32, 15, 14, 32, 32, 32, 32, 32,
386 32, 32, 32, 32, 32, 0, 33, 32, 32, 32,
387 32, 32, 32, 32, 32, 32, 32, 32, 32, 16,
389 32, 18, 32, 32, 21, 32, 23, 24, 32, 0,
390 32, 32, 32, 4, 32, 32, 32, 32, 32, 32,
391 32, 32, 32, 32, 32, 32, 25, 0, 32, 32,
392 32, 32, 5, 32, 32, 32, 32, 32, 32, 32,
393 19, 32, 32, 32, 32, 0, 32, 32, 32, 6,
394 32, 32, 10, 32, 12, 13, 17, 32, 32, 32,
395 32, 27, 0, 32, 2, 3, 32, 8, 11, 20,
396 32, 32, 28, 0, 32, 32, 22, 26, 30, 1,
400 static yyconst flex_int32_t yy_ec[256] =
402 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
403 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
404 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
405 1, 2, 4, 5, 1, 1, 1, 1, 1, 1,
406 1, 1, 1, 1, 6, 1, 1, 7, 7, 7,
407 7, 7, 7, 7, 7, 7, 7, 1, 8, 1,
408 9, 1, 1, 1, 10, 11, 12, 13, 14, 15,
409 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
410 26, 27, 28, 29, 30, 31, 32, 33, 34, 19,
411 35, 36, 37, 1, 6, 1, 19, 19, 19, 19,
413 19, 19, 38, 19, 39, 19, 19, 19, 19, 40,
414 19, 19, 19, 41, 42, 43, 19, 19, 19, 19,
415 19, 19, 36, 1, 36, 1, 1, 1, 1, 1,
416 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
417 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
418 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
421 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
422 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
424 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
425 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
426 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
427 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
428 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
432 static yyconst flex_int32_t yy_meta[44] =
434 1, 1, 2, 1, 1, 3, 3, 1, 1, 4,
435 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
436 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
437 4, 4, 4, 4, 1, 5, 1, 4, 4, 4,
441 static yyconst flex_int16_t yy_base[190] =
443 0, 0, 213, 214, 210, 214, 207, 0, 203, 206,
444 214, 196, 0, 34, 31, 33, 178, 192, 39, 37,
445 38, 191, 29, 190, 175, 192, 159, 198, 0, 196,
446 191, 194, 214, 0, 167, 166, 180, 183, 48, 168,
447 173, 177, 164, 174, 153, 38, 163, 163, 162, 156,
448 161, 155, 162, 154, 145, 163, 155, 132, 0, 214,
449 156, 159, 160, 143, 160, 155, 143, 138, 0, 145,
450 143, 141, 146, 0, 0, 148, 147, 131, 141, 128,
451 134, 131, 126, 127, 123, 111, 0, 127, 134, 129,
452 120, 117, 117, 132, 115, 133, 121, 131, 122, 0,
454 112, 0, 126, 119, 0, 112, 0, 0, 121, 95,
455 110, 108, 120, 0, 109, 115, 104, 113, 108, 107,
456 102, 100, 104, 87, 93, 92, 29, 78, 96, 89,
457 91, 85, 0, 81, 79, 88, 82, 95, 94, 95,
458 0, 92, 76, 94, 45, 65, 84, 67, 67, 0,
459 76, 69, 0, 68, 0, 0, 0, 83, 81, 72,
460 78, 0, 50, 63, 0, 0, 69, 0, 0, 0,
461 76, 74, 0, 50, 44, 52, 0, 0, 214, 0,
462 37, 35, 0, 214, 71, 76, 79, 57, 82
465 static yyconst flex_int16_t yy_def[190] =
467 184, 1, 184, 184, 184, 184, 184, 185, 184, 186,
468 184, 187, 187, 187, 187, 187, 187, 187, 187, 187,
469 187, 187, 187, 187, 187, 187, 184, 184, 188, 185,
470 184, 186, 184, 187, 187, 187, 187, 187, 187, 187,
471 187, 187, 187, 187, 187, 187, 187, 187, 187, 187,
472 187, 187, 187, 187, 187, 187, 187, 184, 189, 184,
473 187, 187, 187, 187, 187, 187, 187, 187, 187, 187,
474 187, 187, 187, 187, 187, 187, 187, 187, 187, 187,
475 187, 187, 187, 187, 187, 184, 189, 187, 187, 187,
476 187, 187, 187, 187, 187, 187, 187, 187, 187, 187,
478 187, 187, 187, 187, 187, 187, 187, 187, 187, 184,
479 187, 187, 187, 187, 187, 187, 187, 187, 187, 187,
480 187, 187, 187, 187, 187, 187, 187, 184, 187, 187,
481 187, 187, 187, 187, 187, 187, 187, 187, 187, 187,
482 187, 187, 187, 187, 187, 184, 187, 187, 187, 187,
483 187, 187, 187, 187, 187, 187, 187, 187, 187, 187,
484 187, 187, 184, 187, 187, 187, 187, 187, 187, 187,
485 187, 187, 187, 184, 187, 187, 187, 187, 184, 187,
486 187, 187, 187, 0, 184, 184, 184, 184, 184
489 static yyconst flex_int16_t yy_nxt[258] =
491 4, 5, 6, 7, 8, 4, 9, 10, 11, 12,
492 13, 14, 15, 16, 13, 13, 13, 17, 13, 18,
493 13, 19, 20, 13, 21, 13, 22, 23, 24, 25,
494 26, 13, 13, 13, 27, 13, 4, 13, 13, 13,
495 13, 13, 13, 36, 39, 41, 48, 50, 46, 73,
496 37, 144, 145, 53, 38, 42, 47, 40, 54, 161,
497 59, 51, 65, 183, 182, 43, 49, 162, 66, 181,
498 74, 30, 180, 30, 30, 30, 32, 32, 32, 32,
499 32, 34, 34, 34, 87, 87, 179, 178, 177, 176,
500 175, 174, 173, 172, 171, 170, 169, 168, 167, 166,
502 165, 164, 163, 160, 159, 158, 157, 156, 155, 154,
503 153, 152, 151, 150, 149, 148, 147, 146, 143, 142,
504 141, 140, 139, 138, 137, 136, 135, 134, 133, 132,
505 131, 130, 129, 128, 127, 126, 125, 124, 123, 122,
506 121, 120, 119, 118, 117, 116, 115, 114, 113, 112,
507 111, 110, 109, 108, 107, 106, 105, 104, 103, 102,
508 101, 100, 99, 98, 97, 96, 95, 94, 93, 92,
509 91, 90, 89, 88, 86, 85, 84, 83, 82, 81,
510 80, 79, 78, 77, 76, 75, 72, 71, 70, 69,
511 68, 67, 64, 63, 62, 61, 33, 31, 60, 28,
513 58, 57, 56, 55, 52, 45, 44, 35, 33, 31,
514 29, 28, 184, 3, 184, 184, 184, 184, 184, 184,
515 184, 184, 184, 184, 184, 184, 184, 184, 184, 184,
516 184, 184, 184, 184, 184, 184, 184, 184, 184, 184,
517 184, 184, 184, 184, 184, 184, 184, 184, 184, 184,
518 184, 184, 184, 184, 184, 184, 184
521 static yyconst flex_int16_t yy_chk[258] =
523 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
524 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
525 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
526 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
527 1, 1, 1, 14, 15, 16, 20, 21, 19, 46,
528 14, 127, 127, 23, 14, 16, 19, 15, 23, 145,
529 188, 21, 39, 182, 181, 16, 20, 145, 39, 176,
530 46, 185, 175, 185, 185, 185, 186, 186, 186, 186,
531 186, 187, 187, 187, 189, 189, 174, 172, 171, 167,
532 164, 163, 161, 160, 159, 158, 154, 152, 151, 149,
534 148, 147, 146, 144, 143, 142, 140, 139, 138, 137,
535 136, 135, 134, 132, 131, 130, 129, 128, 126, 125,
536 124, 123, 122, 121, 120, 119, 118, 117, 116, 115,
537 113, 112, 111, 110, 109, 106, 104, 103, 101, 99,
538 98, 97, 96, 95, 94, 93, 92, 91, 90, 89,
539 88, 86, 85, 84, 83, 82, 81, 80, 79, 78,
540 77, 76, 73, 72, 71, 70, 68, 67, 66, 65,
541 64, 63, 62, 61, 58, 57, 56, 55, 54, 53,
542 52, 51, 50, 49, 48, 47, 45, 44, 43, 42,
543 41, 40, 38, 37, 36, 35, 32, 31, 30, 28,
545 27, 26, 25, 24, 22, 18, 17, 12, 10, 9,
546 7, 5, 3, 184, 184, 184, 184, 184, 184, 184,
547 184, 184, 184, 184, 184, 184, 184, 184, 184, 184,
548 184, 184, 184, 184, 184, 184, 184, 184, 184, 184,
549 184, 184, 184, 184, 184, 184, 184, 184, 184, 184,
550 184, 184, 184, 184, 184, 184, 184
553 static yy_state_type yy_last_accepting_state;
554 static char *yy_last_accepting_cpos;
556 extern int yy_flex_debug;
557 int yy_flex_debug = 0;
559 /* The intent behind this definition is that it'll catch
560 * any uses of REJECT which flex missed.
562 #define REJECT reject_used_but_not_detected
563 #define yymore() yymore_used_but_not_detected
564 #define YY_MORE_ADJ 0
565 #define YY_RESTORE_YY_MORE_OFFSET
569 Unix SMB/CIFS implementation.
570 Copyright (C) 2006 Wilco Baan Hofman <wilco@baanhofman.nl>
571 Copyright (C) 2006 Jelmer Vernooij <jelmer@samba.org>
573 This program is free software; you can redistribute it and/or modify
574 it under the terms of the GNU General Public License as published by
575 the Free Software Foundation; either version 2 of the License, or
576 (at your option) any later version.
578 This program is distributed in the hope that it will be useful,
579 but WITHOUT ANY WARRANTY; without even the implied warranty of
580 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
581 GNU General Public License for more details.
583 You should have received a copy of the GNU General Public License
584 along with this program; if not, write to the Free Software
585 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
588 #include "includes.h"
589 #include "lib/policy/parse_adm.h"
590 void error_message (const char *format, ...);
593 static int lineno = 1;
594 static bool utf16 = false;
596 #define YY_INPUT(buf,result,max_size) \
600 if (fread(&v, 2, 1, yyin) < 1) \
603 result = push_codepoint(buf, v); \
605 int c = getc(yyin); \
606 result = (c == EOF) ? YY_NULL : (buf[0] = c, 1); \
614 #ifndef YY_NO_UNISTD_H
615 /* Special case for "unistd.h", since it is non-ANSI. We include it way
616 * down here because we want the user's section 1 to have been scanned first.
617 * The user has a chance to override it with an option.
622 #ifndef YY_EXTRA_TYPE
623 #define YY_EXTRA_TYPE void *
626 static int yy_init_globals (void );
628 /* Macros after this point can all be overridden by user definitions in
632 #ifndef YY_SKIP_YYWRAP
634 extern "C" int yywrap (void );
636 extern int yywrap (void );
640 static void yyunput (int c,char *buf_ptr );
643 static void yy_flex_strncpy (char *,yyconst char *,int );
646 #ifdef YY_NEED_STRLEN
647 static int yy_flex_strlen (yyconst char * );
653 static int yyinput (void );
655 static int input (void );
660 /* Amount of stuff to slurp up with each read. */
661 #ifndef YY_READ_BUF_SIZE
662 #define YY_READ_BUF_SIZE 8192
665 /* Copy whatever the last rule matched to the standard output. */
667 /* This used to be an fputs(), but since the string might contain NUL's,
668 * we now use fwrite().
670 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
673 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
674 * is returned in "result".
677 #define YY_INPUT(buf,result,max_size) \
678 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
682 for ( n = 0; n < max_size && \
683 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
686 buf[n++] = (char) c; \
687 if ( c == EOF && ferror( yyin ) ) \
688 YY_FATAL_ERROR( "input in flex scanner failed" ); \
694 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
696 if( errno != EINTR) \
698 YY_FATAL_ERROR( "input in flex scanner failed" ); \
709 /* No semi-colon after return; correct usage is to write "yyterminate();" -
710 * we don't want an extra ';' after the "return" because that will cause
711 * some compilers to complain about unreachable statements.
714 #define yyterminate() return YY_NULL
717 /* Number of entries by which start-condition stack grows. */
718 #ifndef YY_START_STACK_INCR
719 #define YY_START_STACK_INCR 25
722 /* Report a fatal error. */
723 #ifndef YY_FATAL_ERROR
724 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
727 /* end tables serialization structures and prototypes */
729 /* Default declaration of generated scanner - a define so the user can
730 * easily add parameters.
733 #define YY_DECL_IS_OURS 1
735 extern int yylex (void);
737 #define YY_DECL int yylex (void)
738 #endif /* !YY_DECL */
740 /* Code executed at the beginning of each rule, after yytext and yyleng
743 #ifndef YY_USER_ACTION
744 #define YY_USER_ACTION
747 /* Code executed at the end of each rule. */
749 #define YY_BREAK break;
752 #define YY_RULE_SETUP \
755 /** The main scanner function which does all the work.
759 register yy_state_type yy_current_state;
760 register char *yy_cp, *yy_bp;
777 (yy_start) = 1; /* first start state */
785 if ( ! YY_CURRENT_BUFFER ) {
786 yyensure_buffer_stack ();
787 YY_CURRENT_BUFFER_LVALUE =
788 yy_create_buffer(yyin,YY_BUF_SIZE );
791 yy_load_buffer_state( );
794 while ( 1 ) /* loops until end-of-file is reached */
796 yy_cp = (yy_c_buf_p);
798 /* Support of yytext. */
799 *yy_cp = (yy_hold_char);
801 /* yy_bp points to the position in yy_ch_buf of the start of
806 yy_current_state = (yy_start);
810 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
811 if ( yy_accept[yy_current_state] )
813 (yy_last_accepting_state) = yy_current_state;
814 (yy_last_accepting_cpos) = yy_cp;
816 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
818 yy_current_state = (int) yy_def[yy_current_state];
819 if ( yy_current_state >= 185 )
820 yy_c = yy_meta[(unsigned int) yy_c];
822 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
825 while ( yy_base[yy_current_state] != 214 );
828 yy_act = yy_accept[yy_current_state];
830 { /* have to back up */
831 yy_cp = (yy_last_accepting_cpos);
832 yy_current_state = (yy_last_accepting_state);
833 yy_act = yy_accept[yy_current_state];
838 do_action: /* This label is used only to access EOF actions. */
841 { /* beginning of action switch */
842 case 0: /* must back up */
843 /* undo the effects of YY_DO_BEFORE_ACTION */
844 *yy_cp = (yy_hold_char);
845 yy_cp = (yy_last_accepting_cpos);
846 yy_current_state = (yy_last_accepting_state);
852 { return ACTIONLIST; }
882 { return DROPDOWNLIST; }
912 { return CLASS_MACHINE; }
957 { return SUPPORTED; }
967 { return CLASS_USER; }
977 { return VALUENAME; }
997 { return STRINGSSECTION; }
1003 char *e, *y = yytext;
1004 yylval.integer = strtol((const char *)yytext, &e, 0);
1006 error_message("malformed constant (%s)", yytext);
1015 yylval.text = strdup ((const char *)yytext);
1023 yylval.text = strdup ((const char *)yytext);
1024 return LOOKUPLITERAL;
1033 /* rule 35 can match eol */
1039 /* rule 36 can match eol */
1045 /* rule 37 can match eol */
1048 { lineno++; yylval.text = strdup((const char *)yytext); return LITERAL; }
1055 #line 1055 "lex.yy.c"
1056 case YY_STATE_EOF(INITIAL):
1059 case YY_END_OF_BUFFER:
1061 /* Amount of text matched not including the EOB char. */
1062 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1064 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1065 *yy_cp = (yy_hold_char);
1066 YY_RESTORE_YY_MORE_OFFSET
1068 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1070 /* We're scanning a new file or input source. It's
1071 * possible that this happened because the user
1072 * just pointed yyin at a new source and called
1073 * yylex(). If so, then we have to assure
1074 * consistency between YY_CURRENT_BUFFER and our
1075 * globals. Here is the right place to do so, because
1076 * this is the first action (other than possibly a
1077 * back-up) that will match for the new input source.
1079 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1080 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1081 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1084 /* Note that here we test for yy_c_buf_p "<=" to the position
1085 * of the first EOB in the buffer, since yy_c_buf_p will
1086 * already have been incremented past the NUL character
1087 * (since all states make transitions on EOB to the
1088 * end-of-buffer state). Contrast this with the test
1091 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1092 { /* This was really a NUL. */
1093 yy_state_type yy_next_state;
1095 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1097 yy_current_state = yy_get_previous_state( );
1099 /* Okay, we're now positioned to make the NUL
1100 * transition. We couldn't have
1101 * yy_get_previous_state() go ahead and do it
1102 * for us because it doesn't know how to deal
1103 * with the possibility of jamming (and we don't
1104 * want to build jamming into it because then it
1105 * will run more slowly).
1108 yy_next_state = yy_try_NUL_trans( yy_current_state );
1110 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1112 if ( yy_next_state )
1114 /* Consume the NUL. */
1115 yy_cp = ++(yy_c_buf_p);
1116 yy_current_state = yy_next_state;
1122 yy_cp = (yy_c_buf_p);
1123 goto yy_find_action;
1127 else switch ( yy_get_next_buffer( ) )
1129 case EOB_ACT_END_OF_FILE:
1131 (yy_did_buffer_switch_on_eof) = 0;
1135 /* Note: because we've taken care in
1136 * yy_get_next_buffer() to have set up
1137 * yytext, we can now set up
1138 * yy_c_buf_p so that if some total
1139 * hoser (like flex itself) wants to
1140 * call the scanner after we return the
1141 * YY_NULL, it'll still work - another
1142 * YY_NULL will get returned.
1144 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1146 yy_act = YY_STATE_EOF(YY_START);
1152 if ( ! (yy_did_buffer_switch_on_eof) )
1158 case EOB_ACT_CONTINUE_SCAN:
1160 (yytext_ptr) + yy_amount_of_matched_text;
1162 yy_current_state = yy_get_previous_state( );
1164 yy_cp = (yy_c_buf_p);
1165 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1168 case EOB_ACT_LAST_MATCH:
1170 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1172 yy_current_state = yy_get_previous_state( );
1174 yy_cp = (yy_c_buf_p);
1175 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1176 goto yy_find_action;
1183 "fatal flex scanner internal error--no action found" );
1184 } /* end of action switch */
1185 } /* end of scanning one token */
1186 } /* end of yylex */
1188 /* yy_get_next_buffer - try to read in a new buffer
1190 * Returns a code representing an action:
1191 * EOB_ACT_LAST_MATCH -
1192 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1193 * EOB_ACT_END_OF_FILE - end of file
1195 static int yy_get_next_buffer (void)
1197 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1198 register char *source = (yytext_ptr);
1199 register int number_to_move, i;
1202 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1204 "fatal flex scanner internal error--end of buffer missed" );
1206 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1207 { /* Don't try to fill the buffer, so this is an EOF. */
1208 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1210 /* We matched a single character, the EOB, so
1211 * treat this as a final EOF.
1213 return EOB_ACT_END_OF_FILE;
1218 /* We matched some text prior to the EOB, first
1221 return EOB_ACT_LAST_MATCH;
1225 /* Try to read more data. */
1227 /* First move last chars to start of buffer. */
1228 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1230 for ( i = 0; i < number_to_move; ++i )
1231 *(dest++) = *(source++);
1233 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1234 /* don't do the read, it's not guaranteed to return an EOF,
1237 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1242 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1244 while ( num_to_read <= 0 )
1245 { /* Not enough room in the buffer - grow it. */
1247 /* just a shorter name for the current buffer */
1248 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1250 int yy_c_buf_p_offset =
1251 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1253 if ( b->yy_is_our_buffer )
1255 int new_size = b->yy_buf_size * 2;
1257 if ( new_size <= 0 )
1258 b->yy_buf_size += b->yy_buf_size / 8;
1260 b->yy_buf_size *= 2;
1262 b->yy_ch_buf = (char *)
1263 /* Include room in for 2 EOB chars. */
1264 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1267 /* Can't grow it, we don't own it. */
1270 if ( ! b->yy_ch_buf )
1272 "fatal error - scanner input buffer overflow" );
1274 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1276 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1281 if ( num_to_read > YY_READ_BUF_SIZE )
1282 num_to_read = YY_READ_BUF_SIZE;
1284 /* Read in more data. */
1285 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1286 (yy_n_chars), (size_t) num_to_read );
1288 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1291 if ( (yy_n_chars) == 0 )
1293 if ( number_to_move == YY_MORE_ADJ )
1295 ret_val = EOB_ACT_END_OF_FILE;
1301 ret_val = EOB_ACT_LAST_MATCH;
1302 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1303 YY_BUFFER_EOF_PENDING;
1308 ret_val = EOB_ACT_CONTINUE_SCAN;
1310 (yy_n_chars) += number_to_move;
1311 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1312 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1314 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1319 /* yy_get_previous_state - get the state just before the EOB char was reached */
1321 static yy_state_type yy_get_previous_state (void)
1323 register yy_state_type yy_current_state;
1324 register char *yy_cp;
1326 yy_current_state = (yy_start);
1328 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1330 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1331 if ( yy_accept[yy_current_state] )
1333 (yy_last_accepting_state) = yy_current_state;
1334 (yy_last_accepting_cpos) = yy_cp;
1336 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1338 yy_current_state = (int) yy_def[yy_current_state];
1339 if ( yy_current_state >= 185 )
1340 yy_c = yy_meta[(unsigned int) yy_c];
1342 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1345 return yy_current_state;
1348 /* yy_try_NUL_trans - try to make a transition on the NUL character
1351 * next_state = yy_try_NUL_trans( current_state );
1353 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1355 register int yy_is_jam;
1356 register char *yy_cp = (yy_c_buf_p);
1358 register YY_CHAR yy_c = 1;
1359 if ( yy_accept[yy_current_state] )
1361 (yy_last_accepting_state) = yy_current_state;
1362 (yy_last_accepting_cpos) = yy_cp;
1364 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1366 yy_current_state = (int) yy_def[yy_current_state];
1367 if ( yy_current_state >= 185 )
1368 yy_c = yy_meta[(unsigned int) yy_c];
1370 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1371 yy_is_jam = (yy_current_state == 184);
1373 return yy_is_jam ? 0 : yy_current_state;
1376 static void yyunput (int c, register char * yy_bp )
1378 register char *yy_cp;
1380 yy_cp = (yy_c_buf_p);
1382 /* undo effects of setting up yytext */
1383 *yy_cp = (yy_hold_char);
1385 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1386 { /* need to shift things up to make room */
1387 /* +2 for EOB chars. */
1388 register int number_to_move = (yy_n_chars) + 2;
1389 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1390 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1391 register char *source =
1392 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1394 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1395 *--dest = *--source;
1397 yy_cp += (int) (dest - source);
1398 yy_bp += (int) (dest - source);
1399 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1400 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1402 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1403 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1406 *--yy_cp = (char) c;
1408 (yytext_ptr) = yy_bp;
1409 (yy_hold_char) = *yy_cp;
1410 (yy_c_buf_p) = yy_cp;
1415 static int yyinput (void)
1417 static int input (void)
1423 *(yy_c_buf_p) = (yy_hold_char);
1425 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1427 /* yy_c_buf_p now points to the character we want to return.
1428 * If this occurs *before* the EOB characters, then it's a
1429 * valid NUL; if not, then we've hit the end of the buffer.
1431 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1432 /* This was really a NUL. */
1433 *(yy_c_buf_p) = '\0';
1436 { /* need more input */
1437 int offset = (yy_c_buf_p) - (yytext_ptr);
1440 switch ( yy_get_next_buffer( ) )
1442 case EOB_ACT_LAST_MATCH:
1443 /* This happens because yy_g_n_b()
1444 * sees that we've accumulated a
1445 * token and flags that we need to
1446 * try matching the token before
1447 * proceeding. But for input(),
1448 * there's no matching to consider.
1449 * So convert the EOB_ACT_LAST_MATCH
1450 * to EOB_ACT_END_OF_FILE.
1453 /* Reset buffer status. */
1458 case EOB_ACT_END_OF_FILE:
1463 if ( ! (yy_did_buffer_switch_on_eof) )
1472 case EOB_ACT_CONTINUE_SCAN:
1473 (yy_c_buf_p) = (yytext_ptr) + offset;
1479 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1480 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1481 (yy_hold_char) = *++(yy_c_buf_p);
1485 #endif /* ifndef YY_NO_INPUT */
1487 /** Immediately switch to a different input stream.
1488 * @param input_file A readable stream.
1490 * @note This function does not reset the start condition to @c INITIAL .
1492 void yyrestart (FILE * input_file )
1495 if ( ! YY_CURRENT_BUFFER ){
1496 yyensure_buffer_stack ();
1497 YY_CURRENT_BUFFER_LVALUE =
1498 yy_create_buffer(yyin,YY_BUF_SIZE );
1501 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1502 yy_load_buffer_state( );
1505 /** Switch to a different input buffer.
1506 * @param new_buffer The new input buffer.
1509 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1512 /* TODO. We should be able to replace this entire function body
1514 * yypop_buffer_state();
1515 * yypush_buffer_state(new_buffer);
1517 yyensure_buffer_stack ();
1518 if ( YY_CURRENT_BUFFER == new_buffer )
1521 if ( YY_CURRENT_BUFFER )
1523 /* Flush out information for old buffer. */
1524 *(yy_c_buf_p) = (yy_hold_char);
1525 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1526 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1529 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1530 yy_load_buffer_state( );
1532 /* We don't actually know whether we did this switch during
1533 * EOF (yywrap()) processing, but the only time this flag
1534 * is looked at is after yywrap() is called, so it's safe
1535 * to go ahead and always set it.
1537 (yy_did_buffer_switch_on_eof) = 1;
1540 static void yy_load_buffer_state (void)
1542 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1543 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1544 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1545 (yy_hold_char) = *(yy_c_buf_p);
1548 /** Allocate and initialize an input buffer state.
1549 * @param file A readable stream.
1550 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1552 * @return the allocated buffer state.
1554 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1558 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1560 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1562 b->yy_buf_size = size;
1564 /* yy_ch_buf has to be 2 characters longer than the size given because
1565 * we need to put in 2 end-of-buffer characters.
1567 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1568 if ( ! b->yy_ch_buf )
1569 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1571 b->yy_is_our_buffer = 1;
1573 yy_init_buffer(b,file );
1578 /** Destroy the buffer.
1579 * @param b a buffer created with yy_create_buffer()
1582 void yy_delete_buffer (YY_BUFFER_STATE b )
1588 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1589 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1591 if ( b->yy_is_our_buffer )
1592 yyfree((void *) b->yy_ch_buf );
1594 yyfree((void *) b );
1598 extern int isatty (int );
1599 #endif /* __cplusplus */
1601 /* Initializes or reinitializes a buffer.
1602 * This function is sometimes called more than once on the same buffer,
1603 * such as during a yyrestart() or at EOF.
1605 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1610 yy_flush_buffer(b );
1612 b->yy_input_file = file;
1613 b->yy_fill_buffer = 1;
1615 /* If b is the current buffer, then yy_init_buffer was _probably_
1616 * called from yyrestart() or through yy_get_next_buffer.
1617 * In that case, we don't want to reset the lineno or column.
1619 if (b != YY_CURRENT_BUFFER){
1620 b->yy_bs_lineno = 1;
1621 b->yy_bs_column = 0;
1624 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1629 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1630 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1633 void yy_flush_buffer (YY_BUFFER_STATE b )
1640 /* We always need two end-of-buffer characters. The first causes
1641 * a transition to the end-of-buffer state. The second causes
1642 * a jam in that state.
1644 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1645 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1647 b->yy_buf_pos = &b->yy_ch_buf[0];
1650 b->yy_buffer_status = YY_BUFFER_NEW;
1652 if ( b == YY_CURRENT_BUFFER )
1653 yy_load_buffer_state( );
1656 /** Pushes the new state onto the stack. The new state becomes
1657 * the current state. This function will allocate the stack
1659 * @param new_buffer The new state.
1662 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1664 if (new_buffer == NULL)
1667 yyensure_buffer_stack();
1669 /* This block is copied from yy_switch_to_buffer. */
1670 if ( YY_CURRENT_BUFFER )
1672 /* Flush out information for old buffer. */
1673 *(yy_c_buf_p) = (yy_hold_char);
1674 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1675 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1678 /* Only push if top exists. Otherwise, replace top. */
1679 if (YY_CURRENT_BUFFER)
1680 (yy_buffer_stack_top)++;
1681 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1683 /* copied from yy_switch_to_buffer. */
1684 yy_load_buffer_state( );
1685 (yy_did_buffer_switch_on_eof) = 1;
1688 /** Removes and deletes the top of the stack, if present.
1689 * The next element becomes the new top.
1692 void yypop_buffer_state (void)
1694 if (!YY_CURRENT_BUFFER)
1697 yy_delete_buffer(YY_CURRENT_BUFFER );
1698 YY_CURRENT_BUFFER_LVALUE = NULL;
1699 if ((yy_buffer_stack_top) > 0)
1700 --(yy_buffer_stack_top);
1702 if (YY_CURRENT_BUFFER) {
1703 yy_load_buffer_state( );
1704 (yy_did_buffer_switch_on_eof) = 1;
1708 /* Allocates the stack if it does not exist.
1709 * Guarantees space for at least one push.
1711 static void yyensure_buffer_stack (void)
1715 if (!(yy_buffer_stack)) {
1717 /* First allocation is just for 2 elements, since we don't know if this
1718 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1719 * immediate realloc on the next call.
1722 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1723 (num_to_alloc * sizeof(struct yy_buffer_state*)
1726 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1728 (yy_buffer_stack_max) = num_to_alloc;
1729 (yy_buffer_stack_top) = 0;
1733 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1735 /* Increase the buffer to prepare for a possible push. */
1736 int grow_size = 8 /* arbitrary grow size */;
1738 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1739 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1741 num_to_alloc * sizeof(struct yy_buffer_state*)
1744 /* zero only the new slots.*/
1745 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1746 (yy_buffer_stack_max) = num_to_alloc;
1750 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1751 * @param base the character buffer
1752 * @param size the size in bytes of the character buffer
1754 * @return the newly allocated buffer state object.
1756 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1761 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1762 base[size-1] != YY_END_OF_BUFFER_CHAR )
1763 /* They forgot to leave room for the EOB's. */
1766 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1768 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1770 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1771 b->yy_buf_pos = b->yy_ch_buf = base;
1772 b->yy_is_our_buffer = 0;
1773 b->yy_input_file = 0;
1774 b->yy_n_chars = b->yy_buf_size;
1775 b->yy_is_interactive = 0;
1777 b->yy_fill_buffer = 0;
1778 b->yy_buffer_status = YY_BUFFER_NEW;
1780 yy_switch_to_buffer(b );
1785 /** Setup the input buffer state to scan a string. The next call to yylex() will
1786 * scan from a @e copy of @a str.
1787 * @param yystr a NUL-terminated string to scan
1789 * @return the newly allocated buffer state object.
1790 * @note If you want to scan bytes that may contain NUL values, then use
1791 * yy_scan_bytes() instead.
1793 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1796 return yy_scan_bytes(yystr,strlen(yystr) );
1799 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1800 * scan from a @e copy of @a bytes.
1801 * @param bytes the byte buffer to scan
1802 * @param len the number of bytes in the buffer pointed to by @a bytes.
1804 * @return the newly allocated buffer state object.
1806 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1813 /* Get memory for full buffer, including space for trailing EOB's. */
1814 n = _yybytes_len + 2;
1815 buf = (char *) yyalloc(n );
1817 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1819 for ( i = 0; i < _yybytes_len; ++i )
1820 buf[i] = yybytes[i];
1822 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1824 b = yy_scan_buffer(buf,n );
1826 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1828 /* It's okay to grow etc. this buffer, and we should throw it
1829 * away when we're done.
1831 b->yy_is_our_buffer = 1;
1836 #ifndef YY_EXIT_FAILURE
1837 #define YY_EXIT_FAILURE 2
1840 static void yy_fatal_error (yyconst char* msg )
1842 (void) fprintf( stderr, "%s\n", msg );
1843 exit( YY_EXIT_FAILURE );
1846 /* Redefine yyless() so it works in section 3 code. */
1852 /* Undo effects of setting up yytext. */ \
1853 int yyless_macro_arg = (n); \
1854 YY_LESS_LINENO(yyless_macro_arg);\
1855 yytext[yyleng] = (yy_hold_char); \
1856 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1857 (yy_hold_char) = *(yy_c_buf_p); \
1858 *(yy_c_buf_p) = '\0'; \
1859 yyleng = yyless_macro_arg; \
1863 /* Accessor methods (get/set functions) to struct members. */
1865 /** Get the current line number.
1868 int yyget_lineno (void)
1874 /** Get the input stream.
1877 FILE *yyget_in (void)
1882 /** Get the output stream.
1885 FILE *yyget_out (void)
1890 /** Get the length of the current token.
1893 int yyget_leng (void)
1898 /** Get the current token.
1902 char *yyget_text (void)
1907 /** Set the current line number.
1908 * @param line_number
1911 void yyset_lineno (int line_number )
1914 yylineno = line_number;
1917 /** Set the input stream. This does not discard the current
1919 * @param in_str A readable stream.
1921 * @see yy_switch_to_buffer
1923 void yyset_in (FILE * in_str )
1928 void yyset_out (FILE * out_str )
1933 int yyget_debug (void)
1935 return yy_flex_debug;
1938 void yyset_debug (int bdebug )
1940 yy_flex_debug = bdebug ;
1943 static int yy_init_globals (void)
1945 /* Initialization is the same as for the non-reentrant scanner.
1946 * This function is called from yylex_destroy(), so don't allocate here.
1949 (yy_buffer_stack) = 0;
1950 (yy_buffer_stack_top) = 0;
1951 (yy_buffer_stack_max) = 0;
1952 (yy_c_buf_p) = (char *) 0;
1956 /* Defined in main.c */
1965 /* For future reference: Set errno on error, since we are called by
1971 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
1972 int yylex_destroy (void)
1975 /* Pop the buffer stack, destroying each element. */
1976 while(YY_CURRENT_BUFFER){
1977 yy_delete_buffer(YY_CURRENT_BUFFER );
1978 YY_CURRENT_BUFFER_LVALUE = NULL;
1979 yypop_buffer_state();
1982 /* Destroy the stack itself. */
1983 yyfree((yy_buffer_stack) );
1984 (yy_buffer_stack) = NULL;
1986 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1987 * yylex() is called, initialization will occur. */
1994 * Internal utility routines.
1998 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2001 for ( i = 0; i < n; ++i )
2006 #ifdef YY_NEED_STRLEN
2007 static int yy_flex_strlen (yyconst char * s )
2010 for ( n = 0; s[n]; ++n )
2017 void *yyalloc (yy_size_t size )
2019 return (void *) malloc( size );
2022 void *yyrealloc (void * ptr, yy_size_t size )
2024 /* The cast to (char *) in the following accommodates both
2025 * implementations that use char* generic pointers, and those
2026 * that use void* generic pointers. It works with the latter
2027 * because both ANSI C and C++ allow castless assignment from
2028 * any pointer type to void*, and deal with argument conversions
2029 * as though doing an assignment.
2031 return (void *) realloc( (char *) ptr, size );
2034 void yyfree (void * ptr )
2036 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2039 #define YYTABLES_NAME "yytables"
2045 #ifndef yywrap /* XXX */
2055 error_message (const char *format, ...)
2059 va_start (args, format);
2060 fprintf (stderr, "%d:", lineno);
2061 vfprintf (stderr, format, args);
2065 struct adm_file *adm_read_file(const char *file)
2068 yyin = fopen(file, "r");
2074 if (c[0] == 0xff && c[1] == 0xfe) {
2082 return NULL; /* FIXME */