4 #define YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 6
11 #define YY_FLEX_SUBMINOR_VERSION 4
12 #if YY_FLEX_SUBMINOR_VERSION > 0
16 /* First, we deal with platform-specific or compiler-specific issues. */
18 /* begin standard C headers. */
24 /* end standard C headers. */
26 /* flex integer type definitions */
31 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36 * if you want the limit (max/min) macros for int types.
38 #ifndef __STDC_LIMIT_MACROS
39 #define __STDC_LIMIT_MACROS 1
43 typedef int8_t flex_int8_t;
44 typedef uint8_t flex_uint8_t;
45 typedef int16_t flex_int16_t;
46 typedef uint16_t flex_uint16_t;
47 typedef int32_t flex_int32_t;
48 typedef uint32_t flex_uint32_t;
50 typedef signed char flex_int8_t;
51 typedef short int flex_int16_t;
52 typedef int flex_int32_t;
53 typedef unsigned char flex_uint8_t;
54 typedef unsigned short int flex_uint16_t;
55 typedef unsigned int flex_uint32_t;
57 /* Limits of integral types. */
59 #define INT8_MIN (-128)
62 #define INT16_MIN (-32767-1)
65 #define INT32_MIN (-2147483647-1)
68 #define INT8_MAX (127)
71 #define INT16_MAX (32767)
74 #define INT32_MAX (2147483647)
77 #define UINT8_MAX (255U)
80 #define UINT16_MAX (65535U)
83 #define UINT32_MAX (4294967295U)
87 #define SIZE_MAX (~(size_t)0)
92 #endif /* ! FLEXINT_H */
94 /* begin standard C++ headers. */
96 /* TODO: this is always defined, so inline it */
99 #if defined(__GNUC__) && __GNUC__ >= 3
100 #define yynoreturn __attribute__((__noreturn__))
105 /* Returned upon end-of-file. */
108 /* Promotes a possibly negative, possibly signed char to an
109 * integer in range [0..255] for use as an array index.
111 #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
113 /* Enter a start condition. This macro really ought to take a parameter,
114 * but we do it the disgusting crufty way forced on us by the ()-less
115 * definition of BEGIN.
117 #define BEGIN (yy_start) = 1 + 2 *
118 /* Translate the current start state into a value that can be later handed
119 * to BEGIN to return to the state. The YYSTATE alias is for lex
122 #define YY_START (((yy_start) - 1) / 2)
123 #define YYSTATE YY_START
124 /* Action number for EOF rule of a given start state. */
125 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
126 /* Special action meaning "start processing a new file". */
127 #define YY_NEW_FILE yyrestart( yyin )
128 #define YY_END_OF_BUFFER_CHAR 0
130 /* Size of default input buffer. */
133 /* On IA-64, the buffer size is 16k, not 8k.
134 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
135 * Ditto for the __ia64__ case accordingly.
137 #define YY_BUF_SIZE 32768
139 #define YY_BUF_SIZE 16384
140 #endif /* __ia64__ */
143 /* The state buf must be large enough to hold one state per character in the main buffer.
145 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
147 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
148 #define YY_TYPEDEF_YY_BUFFER_STATE
149 typedef struct yy_buffer_state *YY_BUFFER_STATE;
152 #ifndef YY_TYPEDEF_YY_SIZE_T
153 #define YY_TYPEDEF_YY_SIZE_T
154 typedef size_t yy_size_t;
159 extern FILE *yyin, *yyout;
161 #define EOB_ACT_CONTINUE_SCAN 0
162 #define EOB_ACT_END_OF_FILE 1
163 #define EOB_ACT_LAST_MATCH 2
165 #define YY_LESS_LINENO(n)
166 #define YY_LINENO_REWIND_TO(ptr)
168 /* Return all but the first "n" matched characters back to the input stream. */
172 /* Undo effects of setting up yytext. */ \
173 int yyless_macro_arg = (n); \
174 YY_LESS_LINENO(yyless_macro_arg);\
175 *yy_cp = (yy_hold_char); \
176 YY_RESTORE_YY_MORE_OFFSET \
177 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
178 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
181 #define unput(c) yyunput( c, (yytext_ptr) )
183 #ifndef YY_STRUCT_YY_BUFFER_STATE
184 #define YY_STRUCT_YY_BUFFER_STATE
185 struct yy_buffer_state
189 char *yy_ch_buf; /* input buffer */
190 char *yy_buf_pos; /* current position in input buffer */
192 /* Size of input buffer in bytes, not including room for EOB
197 /* Number of characters read into yy_ch_buf, not including EOB
202 /* Whether we "own" the buffer - i.e., we know we created it,
203 * and can realloc() it to grow it, and should free() it to
206 int yy_is_our_buffer;
208 /* Whether this is an "interactive" input source; if so, and
209 * if we're using stdio for input, then we want to use getc()
210 * instead of fread(), to make sure we stop fetching input after
213 int yy_is_interactive;
215 /* Whether we're considered to be at the beginning of a line.
216 * If so, '^' rules will be active on the next match, otherwise
221 int yy_bs_lineno; /**< The line count. */
222 int yy_bs_column; /**< The column count. */
224 /* Whether to try to fill the input buffer when we reach the
229 int yy_buffer_status;
231 #define YY_BUFFER_NEW 0
232 #define YY_BUFFER_NORMAL 1
233 /* When an EOF's been seen but there's still some text to process
234 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
235 * shouldn't try reading from the input source any more. We might
236 * still have a bunch of tokens to match, though, because of
237 * possible backing-up.
239 * When we actually see the EOF, we change the status to "new"
240 * (via yyrestart()), so that the user can continue scanning by
241 * just pointing yyin at a new input file.
243 #define YY_BUFFER_EOF_PENDING 2
246 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
248 /* Stack of input buffers. */
249 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
250 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
251 static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
253 /* We provide macros for accessing buffer states in case in the
254 * future we want to put the buffer states in a more general
257 * Returns the top of the stack, or NULL.
259 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
260 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
262 /* Same as previous macro, but useful when we know that the buffer stack is not
263 * NULL or when we need an lvalue. For internal use only.
265 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
267 /* yy_hold_char holds the character lost when yytext is formed. */
268 static char yy_hold_char;
269 static int yy_n_chars; /* number of characters read into yy_ch_buf */
272 /* Points to current character in buffer. */
273 static char *yy_c_buf_p = NULL;
274 static int yy_init = 0; /* whether we need to initialize */
275 static int yy_start = 0; /* start state number */
277 /* Flag which is used to allow yywrap()'s to do buffer switches
278 * instead of setting up a fresh yyin. A bit of a hack ...
280 static int yy_did_buffer_switch_on_eof;
282 void yyrestart ( FILE *input_file );
283 void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
284 YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
285 void yy_delete_buffer ( YY_BUFFER_STATE b );
286 void yy_flush_buffer ( YY_BUFFER_STATE b );
287 void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
288 void yypop_buffer_state ( void );
290 static void yyensure_buffer_stack ( void );
291 static void yy_load_buffer_state ( void );
292 static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
293 #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
295 YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
296 YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
297 YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
299 void *yyalloc ( yy_size_t );
300 void *yyrealloc ( void *, yy_size_t );
301 void yyfree ( void * );
303 #define yy_new_buffer yy_create_buffer
304 #define yy_set_interactive(is_interactive) \
306 if ( ! YY_CURRENT_BUFFER ){ \
307 yyensure_buffer_stack (); \
308 YY_CURRENT_BUFFER_LVALUE = \
309 yy_create_buffer( yyin, YY_BUF_SIZE ); \
311 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
313 #define yy_set_bol(at_bol) \
315 if ( ! YY_CURRENT_BUFFER ){\
316 yyensure_buffer_stack (); \
317 YY_CURRENT_BUFFER_LVALUE = \
318 yy_create_buffer( yyin, YY_BUF_SIZE ); \
320 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
322 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
324 /* Begin user sect3 */
325 typedef flex_uint8_t YY_CHAR;
327 FILE *yyin = NULL, *yyout = NULL;
329 typedef int yy_state_type;
338 #define yytext_ptr yytext
340 static yy_state_type yy_get_previous_state ( void );
341 static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
342 static int yy_get_next_buffer ( void );
343 static void yynoreturn yy_fatal_error ( const char* msg );
345 /* Done after the current pattern has been matched and before the
346 * corresponding action - sets up yytext.
348 #define YY_DO_BEFORE_ACTION \
349 (yytext_ptr) = yy_bp; \
350 yyleng = (int) (yy_cp - yy_bp); \
351 (yy_hold_char) = *yy_cp; \
353 (yy_c_buf_p) = yy_cp;
354 #define YY_NUM_RULES 39
355 #define YY_END_OF_BUFFER 40
356 /* This struct is not used in this scanner,
357 but its presence is necessary. */
360 flex_int32_t yy_verify;
363 static const flex_int16_t yy_accept[114] =
365 0, 0, 40, 38, 2, 3, 38, 4, 38, 38,
366 38, 38, 38, 38, 38, 7, 36, 38, 38, 38,
367 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
368 37, 37, 38, 24, 37, 27, 0, 0, 33, 29,
369 0, 36, 31, 30, 32, 35, 1, 35, 25, 23,
370 26, 37, 37, 37, 37, 37, 37, 37, 14, 37,
371 37, 37, 37, 37, 37, 28, 5, 0, 35, 37,
372 9, 10, 37, 37, 13, 37, 37, 37, 37, 21,
373 37, 6, 37, 34, 11, 37, 37, 37, 37, 37,
374 37, 37, 8, 37, 15, 37, 37, 18, 20, 22,
376 37, 37, 17, 37, 12, 37, 37, 37, 37, 16,
380 static const YY_CHAR yy_ec[256] =
382 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
383 1, 2, 2, 1, 1, 1, 1, 1, 1, 1,
384 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
385 1, 2, 4, 5, 1, 6, 1, 7, 8, 1,
386 1, 9, 10, 1, 11, 12, 13, 14, 14, 14,
387 14, 14, 14, 14, 14, 14, 14, 1, 1, 15,
388 16, 17, 1, 1, 18, 19, 18, 20, 21, 18,
389 22, 18, 23, 18, 18, 18, 18, 24, 18, 18,
390 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
391 1, 25, 1, 1, 18, 1, 26, 27, 28, 29,
393 30, 31, 18, 32, 33, 18, 18, 34, 35, 36,
394 37, 18, 18, 38, 39, 40, 41, 42, 43, 44,
395 18, 18, 1, 45, 1, 1, 1, 1, 1, 1,
396 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
397 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
398 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
399 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
400 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
401 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
404 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
405 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
406 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
407 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
408 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
412 static const YY_CHAR yy_meta[46] =
414 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
415 1, 1, 1, 3, 1, 1, 1, 3, 3, 3,
416 3, 3, 3, 3, 1, 3, 3, 3, 3, 3,
417 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
421 static const flex_int16_t yy_base[118] =
423 0, 0, 137, 138, 138, 138, 120, 138, 0, 128,
424 109, 117, 36, 42, 118, 122, 35, 114, 113, 112,
425 0, 106, 102, 92, 17, 87, 92, 85, 95, 90,
426 19, 87, 73, 138, 138, 138, 109, 0, 138, 138,
427 102, 43, 138, 138, 138, 101, 138, 100, 138, 138,
428 138, 0, 91, 92, 69, 71, 69, 70, 0, 79,
429 71, 65, 78, 76, 69, 138, 138, 93, 86, 76,
430 0, 82, 67, 66, 0, 69, 64, 52, 24, 0,
431 58, 138, 67, 138, 0, 54, 55, 50, 49, 46,
432 55, 54, 0, 54, 0, 41, 45, 42, 0, 0,
434 40, 44, 0, 36, 0, 46, 41, 35, 42, 0,
435 27, 0, 138, 64, 67, 60, 70
438 static const flex_int16_t yy_def[118] =
440 113, 1, 113, 113, 113, 113, 113, 113, 114, 113,
441 115, 113, 113, 113, 113, 113, 113, 113, 113, 113,
442 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
443 116, 116, 113, 113, 113, 113, 113, 117, 113, 113,
444 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
445 113, 116, 116, 116, 116, 116, 116, 116, 116, 116,
446 116, 116, 116, 116, 116, 113, 113, 113, 113, 116,
447 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
448 116, 113, 116, 113, 116, 116, 116, 116, 116, 116,
449 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
451 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
452 116, 116, 0, 113, 113, 113, 113
455 static const flex_int16_t yy_nxt[184] =
457 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
458 14, 15, 16, 17, 18, 19, 20, 21, 22, 21,
459 23, 21, 21, 21, 4, 21, 21, 21, 24, 25,
460 26, 21, 27, 28, 21, 29, 21, 30, 31, 21,
461 21, 21, 32, 21, 33, 40, 48, 41, 42, 42,
462 56, 43, 44, 41, 48, 42, 42, 45, 63, 64,
463 57, 90, 52, 91, 35, 112, 35, 37, 37, 37,
464 68, 111, 68, 110, 109, 108, 107, 106, 105, 104,
465 103, 102, 101, 100, 99, 98, 97, 96, 95, 94,
466 93, 92, 89, 88, 87, 86, 85, 84, 83, 69,
468 82, 81, 80, 79, 78, 77, 76, 75, 74, 73,
469 72, 71, 70, 69, 46, 46, 67, 66, 65, 62,
470 61, 60, 59, 58, 55, 54, 53, 51, 50, 49,
471 47, 46, 39, 38, 36, 34, 113, 3, 113, 113,
472 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
473 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
474 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
475 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
479 static const flex_int16_t yy_chk[184] =
481 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
482 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
483 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
484 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
485 1, 1, 1, 1, 1, 13, 17, 13, 17, 13,
486 25, 13, 14, 14, 42, 14, 42, 14, 31, 31,
487 25, 79, 116, 79, 114, 111, 114, 115, 115, 115,
488 117, 109, 117, 108, 107, 106, 104, 102, 101, 98,
489 97, 96, 94, 92, 91, 90, 89, 88, 87, 86,
490 83, 81, 78, 77, 76, 74, 73, 72, 70, 69,
492 68, 65, 64, 63, 62, 61, 60, 58, 57, 56,
493 55, 54, 53, 48, 46, 41, 37, 33, 32, 30,
494 29, 28, 27, 26, 24, 23, 22, 20, 19, 18,
495 16, 15, 12, 11, 10, 7, 3, 113, 113, 113,
496 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
497 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
498 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
499 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
503 static yy_state_type yy_last_accepting_state;
504 static char *yy_last_accepting_cpos;
506 extern int yy_flex_debug;
507 int yy_flex_debug = 0;
509 /* The intent behind this definition is that it'll catch
510 * any uses of REJECT which flex missed.
512 #define REJECT reject_used_but_not_detected
513 #define yymore() yymore_used_but_not_detected
514 #define YY_MORE_ADJ 0
515 #define YY_RESTORE_YY_MORE_OFFSET
521 * Copyright (c) 1997-1998 Markku Rossi.
523 * Author: Markku Rossi <mtr@iki.fi>
527 * This file is part of GNU Enscript.
529 * Enscript is free software: you can redistribute it and/or modify
530 * it under the terms of the GNU General Public License as published by
531 * the Free Software Foundation, either version 3 of the License, or
532 * (at your option) any later version.
534 * Enscript is distributed in the hope that it will be useful,
535 * but WITHOUT ANY WARRANTY; without even the implied warranty of
536 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
537 * GNU General Public License for more details.
539 * You should have received a copy of the GNU General Public License
540 * along with Enscript. If not, see <http://www.gnu.org/licenses/>.
544 * $Id: lex.l,v 1.1.1.1 2003/03/05 07:25:52 mtr Exp $
550 static void eat_comment ();
551 static char *read_string ___P ((unsigned int *len_return));
552 static void read_regexp ___P ((Node *node));
558 #ifndef YY_NO_UNISTD_H
559 /* Special case for "unistd.h", since it is non-ANSI. We include it way
560 * down here because we want the user's section 1 to have been scanned first.
561 * The user has a chance to override it with an option.
566 #ifndef YY_EXTRA_TYPE
567 #define YY_EXTRA_TYPE void *
570 static int yy_init_globals ( void );
572 /* Accessor methods to globals.
573 These are made visible to non-reentrant scanners for convenience. */
575 int yylex_destroy ( void );
577 int yyget_debug ( void );
579 void yyset_debug ( int debug_flag );
581 YY_EXTRA_TYPE yyget_extra ( void );
583 void yyset_extra ( YY_EXTRA_TYPE user_defined );
585 FILE *yyget_in ( void );
587 void yyset_in ( FILE * _in_str );
589 FILE *yyget_out ( void );
591 void yyset_out ( FILE * _out_str );
593 int yyget_leng ( void );
595 char *yyget_text ( void );
597 int yyget_lineno ( void );
599 void yyset_lineno ( int _line_number );
601 /* Macros after this point can all be overridden by user definitions in
605 #ifndef YY_SKIP_YYWRAP
607 extern "C" int yywrap ( void );
609 extern int yywrap ( void );
615 static void yyunput ( int c, char *buf_ptr );
620 static void yy_flex_strncpy ( char *, const char *, int );
623 #ifdef YY_NEED_STRLEN
624 static int yy_flex_strlen ( const char * );
629 static int yyinput ( void );
631 static int input ( void );
636 /* Amount of stuff to slurp up with each read. */
637 #ifndef YY_READ_BUF_SIZE
639 /* On IA-64, the buffer size is 16k, not 8k */
640 #define YY_READ_BUF_SIZE 16384
642 #define YY_READ_BUF_SIZE 8192
643 #endif /* __ia64__ */
646 /* Copy whatever the last rule matched to the standard output. */
648 /* This used to be an fputs(), but since the string might contain NUL's,
649 * we now use fwrite().
651 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
654 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
655 * is returned in "result".
658 #define YY_INPUT(buf,result,max_size) \
659 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
663 for ( n = 0; n < max_size && \
664 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
667 buf[n++] = (char) c; \
668 if ( c == EOF && ferror( yyin ) ) \
669 YY_FATAL_ERROR( "input in flex scanner failed" ); \
675 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
677 if( errno != EINTR) \
679 YY_FATAL_ERROR( "input in flex scanner failed" ); \
690 /* No semi-colon after return; correct usage is to write "yyterminate();" -
691 * we don't want an extra ';' after the "return" because that will cause
692 * some compilers to complain about unreachable statements.
695 #define yyterminate() return YY_NULL
698 /* Number of entries by which start-condition stack grows. */
699 #ifndef YY_START_STACK_INCR
700 #define YY_START_STACK_INCR 25
703 /* Report a fatal error. */
704 #ifndef YY_FATAL_ERROR
705 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
708 /* end tables serialization structures and prototypes */
710 /* Default declaration of generated scanner - a define so the user can
711 * easily add parameters.
714 #define YY_DECL_IS_OURS 1
716 extern int yylex (void);
718 #define YY_DECL int yylex (void)
719 #endif /* !YY_DECL */
721 /* Code executed at the beginning of each rule, after yytext and yyleng
724 #ifndef YY_USER_ACTION
725 #define YY_USER_ACTION
728 /* Code executed at the end of each rule. */
730 #define YY_BREAK /*LINTED*/break;
733 #define YY_RULE_SETUP \
736 /** The main scanner function which does all the work.
740 yy_state_type yy_current_state;
753 (yy_start) = 1; /* first start state */
761 if ( ! YY_CURRENT_BUFFER ) {
762 yyensure_buffer_stack ();
763 YY_CURRENT_BUFFER_LVALUE =
764 yy_create_buffer( yyin, YY_BUF_SIZE );
767 yy_load_buffer_state( );
776 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
778 yy_cp = (yy_c_buf_p);
780 /* Support of yytext. */
781 *yy_cp = (yy_hold_char);
783 /* yy_bp points to the position in yy_ch_buf of the start of
788 yy_current_state = (yy_start);
792 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
793 if ( yy_accept[yy_current_state] )
795 (yy_last_accepting_state) = yy_current_state;
796 (yy_last_accepting_cpos) = yy_cp;
798 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
800 yy_current_state = (int) yy_def[yy_current_state];
801 if ( yy_current_state >= 114 )
802 yy_c = yy_meta[yy_c];
804 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
807 while ( yy_base[yy_current_state] != 138 );
810 yy_act = yy_accept[yy_current_state];
812 { /* have to back up */
813 yy_cp = (yy_last_accepting_cpos);
814 yy_current_state = (yy_last_accepting_state);
815 yy_act = yy_accept[yy_current_state];
820 do_action: /* This label is used only to access EOF actions. */
823 { /* beginning of action switch */
824 case 0: /* must back up */
825 /* undo the effects of YY_DO_BEFORE_ACTION */
826 *yy_cp = (yy_hold_char);
827 yy_cp = (yy_last_accepting_cpos);
828 yy_current_state = (yy_last_accepting_state);
842 /* rule 3 can match eol */
850 { yylval.node = node_alloc (nSTRING);
851 yylval.node->u.str.data
852 = read_string (&yylval.node->u.str.len);
857 /* rule 5 can match eol */
860 { yylval.node = node_alloc (nINTEGER);
861 yylval.node->u.integer = yytext[1];
868 { yylval.node = node_alloc (nINTEGER);
872 yylval.node->u.integer = '\n';
876 yylval.node->u.integer = '\t';
880 yylval.node->u.integer = '\v';
884 yylval.node->u.integer = '\b';
888 yylval.node->u.integer = '\r';
892 yylval.node->u.integer = '\f';
896 yylval.node->u.integer = '\a';
900 yylval.node->u.integer = yytext[2];
910 { yylval.node = node_alloc (nREGEXP);
911 read_regexp (yylval.node);
958 { return tNAMERULES; }
973 { return tSTARTRULES; }
1023 { return tPLUSPLUS; }
1028 { return tMINUSMINUS; }
1033 { return tADDASSIGN; }
1038 { return tSUBASSIGN; }
1043 { return tMULASSIGN; }
1048 { return tDIVASSIGN; }
1053 { yylval.node = node_alloc (nREAL);
1054 yylval.node->u.real = atof (yytext);
1061 { yylval.node = node_alloc (nINTEGER);
1062 yylval.node->u.integer = atoi (yytext);
1069 { yylval.node = node_alloc (nSYMBOL);
1070 yylval.node->u.sym = xstrdup (yytext);
1077 { return yytext[0]; }
1085 case YY_STATE_EOF(INITIAL):
1088 case YY_END_OF_BUFFER:
1090 /* Amount of text matched not including the EOB char. */
1091 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1093 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1094 *yy_cp = (yy_hold_char);
1095 YY_RESTORE_YY_MORE_OFFSET
1097 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1099 /* We're scanning a new file or input source. It's
1100 * possible that this happened because the user
1101 * just pointed yyin at a new source and called
1102 * yylex(). If so, then we have to assure
1103 * consistency between YY_CURRENT_BUFFER and our
1104 * globals. Here is the right place to do so, because
1105 * this is the first action (other than possibly a
1106 * back-up) that will match for the new input source.
1108 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1109 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1110 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1113 /* Note that here we test for yy_c_buf_p "<=" to the position
1114 * of the first EOB in the buffer, since yy_c_buf_p will
1115 * already have been incremented past the NUL character
1116 * (since all states make transitions on EOB to the
1117 * end-of-buffer state). Contrast this with the test
1120 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1121 { /* This was really a NUL. */
1122 yy_state_type yy_next_state;
1124 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1126 yy_current_state = yy_get_previous_state( );
1128 /* Okay, we're now positioned to make the NUL
1129 * transition. We couldn't have
1130 * yy_get_previous_state() go ahead and do it
1131 * for us because it doesn't know how to deal
1132 * with the possibility of jamming (and we don't
1133 * want to build jamming into it because then it
1134 * will run more slowly).
1137 yy_next_state = yy_try_NUL_trans( yy_current_state );
1139 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1141 if ( yy_next_state )
1143 /* Consume the NUL. */
1144 yy_cp = ++(yy_c_buf_p);
1145 yy_current_state = yy_next_state;
1151 yy_cp = (yy_c_buf_p);
1152 goto yy_find_action;
1156 else switch ( yy_get_next_buffer( ) )
1158 case EOB_ACT_END_OF_FILE:
1160 (yy_did_buffer_switch_on_eof) = 0;
1164 /* Note: because we've taken care in
1165 * yy_get_next_buffer() to have set up
1166 * yytext, we can now set up
1167 * yy_c_buf_p so that if some total
1168 * hoser (like flex itself) wants to
1169 * call the scanner after we return the
1170 * YY_NULL, it'll still work - another
1171 * YY_NULL will get returned.
1173 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1175 yy_act = YY_STATE_EOF(YY_START);
1181 if ( ! (yy_did_buffer_switch_on_eof) )
1187 case EOB_ACT_CONTINUE_SCAN:
1189 (yytext_ptr) + yy_amount_of_matched_text;
1191 yy_current_state = yy_get_previous_state( );
1193 yy_cp = (yy_c_buf_p);
1194 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1197 case EOB_ACT_LAST_MATCH:
1199 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1201 yy_current_state = yy_get_previous_state( );
1203 yy_cp = (yy_c_buf_p);
1204 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1205 goto yy_find_action;
1212 "fatal flex scanner internal error--no action found" );
1213 } /* end of action switch */
1214 } /* end of scanning one token */
1215 } /* end of user's declarations */
1216 } /* end of yylex */
1218 /* yy_get_next_buffer - try to read in a new buffer
1220 * Returns a code representing an action:
1221 * EOB_ACT_LAST_MATCH -
1222 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1223 * EOB_ACT_END_OF_FILE - end of file
1225 static int yy_get_next_buffer (void)
1227 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1228 char *source = (yytext_ptr);
1229 int number_to_move, i;
1232 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1234 "fatal flex scanner internal error--end of buffer missed" );
1236 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1237 { /* Don't try to fill the buffer, so this is an EOF. */
1238 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1240 /* We matched a single character, the EOB, so
1241 * treat this as a final EOF.
1243 return EOB_ACT_END_OF_FILE;
1248 /* We matched some text prior to the EOB, first
1251 return EOB_ACT_LAST_MATCH;
1255 /* Try to read more data. */
1257 /* First move last chars to start of buffer. */
1258 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1260 for ( i = 0; i < number_to_move; ++i )
1261 *(dest++) = *(source++);
1263 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1264 /* don't do the read, it's not guaranteed to return an EOF,
1267 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1272 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1274 while ( num_to_read <= 0 )
1275 { /* Not enough room in the buffer - grow it. */
1277 /* just a shorter name for the current buffer */
1278 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1280 int yy_c_buf_p_offset =
1281 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1283 if ( b->yy_is_our_buffer )
1285 int new_size = b->yy_buf_size * 2;
1287 if ( new_size <= 0 )
1288 b->yy_buf_size += b->yy_buf_size / 8;
1290 b->yy_buf_size *= 2;
1292 b->yy_ch_buf = (char *)
1293 /* Include room in for 2 EOB chars. */
1294 yyrealloc( (void *) b->yy_ch_buf,
1295 (yy_size_t) (b->yy_buf_size + 2) );
1298 /* Can't grow it, we don't own it. */
1299 b->yy_ch_buf = NULL;
1301 if ( ! b->yy_ch_buf )
1303 "fatal error - scanner input buffer overflow" );
1305 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1307 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1312 if ( num_to_read > YY_READ_BUF_SIZE )
1313 num_to_read = YY_READ_BUF_SIZE;
1315 /* Read in more data. */
1316 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1317 (yy_n_chars), num_to_read );
1319 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1322 if ( (yy_n_chars) == 0 )
1324 if ( number_to_move == YY_MORE_ADJ )
1326 ret_val = EOB_ACT_END_OF_FILE;
1332 ret_val = EOB_ACT_LAST_MATCH;
1333 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1334 YY_BUFFER_EOF_PENDING;
1339 ret_val = EOB_ACT_CONTINUE_SCAN;
1341 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1342 /* Extend the array by 50%, plus the number we really need. */
1343 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1344 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1345 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
1346 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1347 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1348 /* "- 2" to take care of EOB's */
1349 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1352 (yy_n_chars) += number_to_move;
1353 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1354 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1356 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1361 /* yy_get_previous_state - get the state just before the EOB char was reached */
1363 static yy_state_type yy_get_previous_state (void)
1365 yy_state_type yy_current_state;
1368 yy_current_state = (yy_start);
1370 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1372 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1373 if ( yy_accept[yy_current_state] )
1375 (yy_last_accepting_state) = yy_current_state;
1376 (yy_last_accepting_cpos) = yy_cp;
1378 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1380 yy_current_state = (int) yy_def[yy_current_state];
1381 if ( yy_current_state >= 114 )
1382 yy_c = yy_meta[yy_c];
1384 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1387 return yy_current_state;
1390 /* yy_try_NUL_trans - try to make a transition on the NUL character
1393 * next_state = yy_try_NUL_trans( current_state );
1395 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1398 char *yy_cp = (yy_c_buf_p);
1401 if ( yy_accept[yy_current_state] )
1403 (yy_last_accepting_state) = yy_current_state;
1404 (yy_last_accepting_cpos) = yy_cp;
1406 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1408 yy_current_state = (int) yy_def[yy_current_state];
1409 if ( yy_current_state >= 114 )
1410 yy_c = yy_meta[yy_c];
1412 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1413 yy_is_jam = (yy_current_state == 113);
1415 return yy_is_jam ? 0 : yy_current_state;
1420 static void yyunput (int c, char * yy_bp )
1424 yy_cp = (yy_c_buf_p);
1426 /* undo effects of setting up yytext */
1427 *yy_cp = (yy_hold_char);
1429 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1430 { /* need to shift things up to make room */
1431 /* +2 for EOB chars. */
1432 int number_to_move = (yy_n_chars) + 2;
1433 char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1434 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1436 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1438 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1439 *--dest = *--source;
1441 yy_cp += (int) (dest - source);
1442 yy_bp += (int) (dest - source);
1443 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1444 (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1446 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1447 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1450 *--yy_cp = (char) c;
1452 (yytext_ptr) = yy_bp;
1453 (yy_hold_char) = *yy_cp;
1454 (yy_c_buf_p) = yy_cp;
1461 static int yyinput (void)
1463 static int input (void)
1469 *(yy_c_buf_p) = (yy_hold_char);
1471 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1473 /* yy_c_buf_p now points to the character we want to return.
1474 * If this occurs *before* the EOB characters, then it's a
1475 * valid NUL; if not, then we've hit the end of the buffer.
1477 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1478 /* This was really a NUL. */
1479 *(yy_c_buf_p) = '\0';
1482 { /* need more input */
1483 int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
1486 switch ( yy_get_next_buffer( ) )
1488 case EOB_ACT_LAST_MATCH:
1489 /* This happens because yy_g_n_b()
1490 * sees that we've accumulated a
1491 * token and flags that we need to
1492 * try matching the token before
1493 * proceeding. But for input(),
1494 * there's no matching to consider.
1495 * So convert the EOB_ACT_LAST_MATCH
1496 * to EOB_ACT_END_OF_FILE.
1499 /* Reset buffer status. */
1504 case EOB_ACT_END_OF_FILE:
1509 if ( ! (yy_did_buffer_switch_on_eof) )
1518 case EOB_ACT_CONTINUE_SCAN:
1519 (yy_c_buf_p) = (yytext_ptr) + offset;
1525 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1526 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1527 (yy_hold_char) = *++(yy_c_buf_p);
1531 #endif /* ifndef YY_NO_INPUT */
1533 /** Immediately switch to a different input stream.
1534 * @param input_file A readable stream.
1536 * @note This function does not reset the start condition to @c INITIAL .
1538 void yyrestart (FILE * input_file )
1541 if ( ! YY_CURRENT_BUFFER ){
1542 yyensure_buffer_stack ();
1543 YY_CURRENT_BUFFER_LVALUE =
1544 yy_create_buffer( yyin, YY_BUF_SIZE );
1547 yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1548 yy_load_buffer_state( );
1551 /** Switch to a different input buffer.
1552 * @param new_buffer The new input buffer.
1555 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1558 /* TODO. We should be able to replace this entire function body
1560 * yypop_buffer_state();
1561 * yypush_buffer_state(new_buffer);
1563 yyensure_buffer_stack ();
1564 if ( YY_CURRENT_BUFFER == new_buffer )
1567 if ( YY_CURRENT_BUFFER )
1569 /* Flush out information for old buffer. */
1570 *(yy_c_buf_p) = (yy_hold_char);
1571 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1572 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1575 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1576 yy_load_buffer_state( );
1578 /* We don't actually know whether we did this switch during
1579 * EOF (yywrap()) processing, but the only time this flag
1580 * is looked at is after yywrap() is called, so it's safe
1581 * to go ahead and always set it.
1583 (yy_did_buffer_switch_on_eof) = 1;
1586 static void yy_load_buffer_state (void)
1588 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1589 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1590 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1591 (yy_hold_char) = *(yy_c_buf_p);
1594 /** Allocate and initialize an input buffer state.
1595 * @param file A readable stream.
1596 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1598 * @return the allocated buffer state.
1600 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1604 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1606 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1608 b->yy_buf_size = size;
1610 /* yy_ch_buf has to be 2 characters longer than the size given because
1611 * we need to put in 2 end-of-buffer characters.
1613 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
1614 if ( ! b->yy_ch_buf )
1615 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1617 b->yy_is_our_buffer = 1;
1619 yy_init_buffer( b, file );
1624 /** Destroy the buffer.
1625 * @param b a buffer created with yy_create_buffer()
1628 void yy_delete_buffer (YY_BUFFER_STATE b )
1634 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1635 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1637 if ( b->yy_is_our_buffer )
1638 yyfree( (void *) b->yy_ch_buf );
1640 yyfree( (void *) b );
1643 /* Initializes or reinitializes a buffer.
1644 * This function is sometimes called more than once on the same buffer,
1645 * such as during a yyrestart() or at EOF.
1647 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1652 yy_flush_buffer( b );
1654 b->yy_input_file = file;
1655 b->yy_fill_buffer = 1;
1657 /* If b is the current buffer, then yy_init_buffer was _probably_
1658 * called from yyrestart() or through yy_get_next_buffer.
1659 * In that case, we don't want to reset the lineno or column.
1661 if (b != YY_CURRENT_BUFFER){
1662 b->yy_bs_lineno = 1;
1663 b->yy_bs_column = 0;
1666 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1671 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1672 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1675 void yy_flush_buffer (YY_BUFFER_STATE b )
1682 /* We always need two end-of-buffer characters. The first causes
1683 * a transition to the end-of-buffer state. The second causes
1684 * a jam in that state.
1686 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1687 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1689 b->yy_buf_pos = &b->yy_ch_buf[0];
1692 b->yy_buffer_status = YY_BUFFER_NEW;
1694 if ( b == YY_CURRENT_BUFFER )
1695 yy_load_buffer_state( );
1698 /** Pushes the new state onto the stack. The new state becomes
1699 * the current state. This function will allocate the stack
1701 * @param new_buffer The new state.
1704 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1706 if (new_buffer == NULL)
1709 yyensure_buffer_stack();
1711 /* This block is copied from yy_switch_to_buffer. */
1712 if ( YY_CURRENT_BUFFER )
1714 /* Flush out information for old buffer. */
1715 *(yy_c_buf_p) = (yy_hold_char);
1716 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1717 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1720 /* Only push if top exists. Otherwise, replace top. */
1721 if (YY_CURRENT_BUFFER)
1722 (yy_buffer_stack_top)++;
1723 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1725 /* copied from yy_switch_to_buffer. */
1726 yy_load_buffer_state( );
1727 (yy_did_buffer_switch_on_eof) = 1;
1730 /** Removes and deletes the top of the stack, if present.
1731 * The next element becomes the new top.
1734 void yypop_buffer_state (void)
1736 if (!YY_CURRENT_BUFFER)
1739 yy_delete_buffer(YY_CURRENT_BUFFER );
1740 YY_CURRENT_BUFFER_LVALUE = NULL;
1741 if ((yy_buffer_stack_top) > 0)
1742 --(yy_buffer_stack_top);
1744 if (YY_CURRENT_BUFFER) {
1745 yy_load_buffer_state( );
1746 (yy_did_buffer_switch_on_eof) = 1;
1750 /* Allocates the stack if it does not exist.
1751 * Guarantees space for at least one push.
1753 static void yyensure_buffer_stack (void)
1755 yy_size_t num_to_alloc;
1757 if (!(yy_buffer_stack)) {
1759 /* First allocation is just for 2 elements, since we don't know if this
1760 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1761 * immediate realloc on the next call.
1763 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1764 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1765 (num_to_alloc * sizeof(struct yy_buffer_state*)
1767 if ( ! (yy_buffer_stack) )
1768 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1770 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1772 (yy_buffer_stack_max) = num_to_alloc;
1773 (yy_buffer_stack_top) = 0;
1777 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1779 /* Increase the buffer to prepare for a possible push. */
1780 yy_size_t grow_size = 8 /* arbitrary grow size */;
1782 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1783 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1785 num_to_alloc * sizeof(struct yy_buffer_state*)
1787 if ( ! (yy_buffer_stack) )
1788 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1790 /* zero only the new slots.*/
1791 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1792 (yy_buffer_stack_max) = num_to_alloc;
1796 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1797 * @param base the character buffer
1798 * @param size the size in bytes of the character buffer
1800 * @return the newly allocated buffer state object.
1802 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1807 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1808 base[size-1] != YY_END_OF_BUFFER_CHAR )
1809 /* They forgot to leave room for the EOB's. */
1812 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1814 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1816 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
1817 b->yy_buf_pos = b->yy_ch_buf = base;
1818 b->yy_is_our_buffer = 0;
1819 b->yy_input_file = NULL;
1820 b->yy_n_chars = b->yy_buf_size;
1821 b->yy_is_interactive = 0;
1823 b->yy_fill_buffer = 0;
1824 b->yy_buffer_status = YY_BUFFER_NEW;
1826 yy_switch_to_buffer( b );
1831 /** Setup the input buffer state to scan a string. The next call to yylex() will
1832 * scan from a @e copy of @a str.
1833 * @param yystr a NUL-terminated string to scan
1835 * @return the newly allocated buffer state object.
1836 * @note If you want to scan bytes that may contain NUL values, then use
1837 * yy_scan_bytes() instead.
1839 YY_BUFFER_STATE yy_scan_string (const char * yystr )
1842 return yy_scan_bytes( yystr, (int) strlen(yystr) );
1845 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1846 * scan from a @e copy of @a bytes.
1847 * @param yybytes the byte buffer to scan
1848 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1850 * @return the newly allocated buffer state object.
1852 YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
1859 /* Get memory for full buffer, including space for trailing EOB's. */
1860 n = (yy_size_t) (_yybytes_len + 2);
1861 buf = (char *) yyalloc( n );
1863 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1865 for ( i = 0; i < _yybytes_len; ++i )
1866 buf[i] = yybytes[i];
1868 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1870 b = yy_scan_buffer( buf, n );
1872 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1874 /* It's okay to grow etc. this buffer, and we should throw it
1875 * away when we're done.
1877 b->yy_is_our_buffer = 1;
1882 #ifndef YY_EXIT_FAILURE
1883 #define YY_EXIT_FAILURE 2
1886 static void yynoreturn yy_fatal_error (const char* msg )
1888 fprintf( stderr, "%s\n", msg );
1889 exit( YY_EXIT_FAILURE );
1892 /* Redefine yyless() so it works in section 3 code. */
1898 /* Undo effects of setting up yytext. */ \
1899 int yyless_macro_arg = (n); \
1900 YY_LESS_LINENO(yyless_macro_arg);\
1901 yytext[yyleng] = (yy_hold_char); \
1902 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1903 (yy_hold_char) = *(yy_c_buf_p); \
1904 *(yy_c_buf_p) = '\0'; \
1905 yyleng = yyless_macro_arg; \
1909 /* Accessor methods (get/set functions) to struct members. */
1911 /** Get the current line number.
1914 int yyget_lineno (void)
1920 /** Get the input stream.
1923 FILE *yyget_in (void)
1928 /** Get the output stream.
1931 FILE *yyget_out (void)
1936 /** Get the length of the current token.
1939 int yyget_leng (void)
1944 /** Get the current token.
1948 char *yyget_text (void)
1953 /** Set the current line number.
1954 * @param _line_number line number
1957 void yyset_lineno (int _line_number )
1960 yylineno = _line_number;
1963 /** Set the input stream. This does not discard the current
1965 * @param _in_str A readable stream.
1967 * @see yy_switch_to_buffer
1969 void yyset_in (FILE * _in_str )
1974 void yyset_out (FILE * _out_str )
1979 int yyget_debug (void)
1981 return yy_flex_debug;
1984 void yyset_debug (int _bdebug )
1986 yy_flex_debug = _bdebug ;
1989 static int yy_init_globals (void)
1991 /* Initialization is the same as for the non-reentrant scanner.
1992 * This function is called from yylex_destroy(), so don't allocate here.
1995 (yy_buffer_stack) = NULL;
1996 (yy_buffer_stack_top) = 0;
1997 (yy_buffer_stack_max) = 0;
1998 (yy_c_buf_p) = NULL;
2002 /* Defined in main.c */
2011 /* For future reference: Set errno on error, since we are called by
2017 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2018 int yylex_destroy (void)
2021 /* Pop the buffer stack, destroying each element. */
2022 while(YY_CURRENT_BUFFER){
2023 yy_delete_buffer( YY_CURRENT_BUFFER );
2024 YY_CURRENT_BUFFER_LVALUE = NULL;
2025 yypop_buffer_state();
2028 /* Destroy the stack itself. */
2029 yyfree((yy_buffer_stack) );
2030 (yy_buffer_stack) = NULL;
2032 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2033 * yylex() is called, initialization will occur. */
2040 * Internal utility routines.
2044 static void yy_flex_strncpy (char* s1, const char * s2, int n )
2048 for ( i = 0; i < n; ++i )
2053 #ifdef YY_NEED_STRLEN
2054 static int yy_flex_strlen (const char * s )
2057 for ( n = 0; s[n]; ++n )
2064 void *yyalloc (yy_size_t size )
2066 return malloc(size);
2069 void *yyrealloc (void * ptr, yy_size_t size )
2072 /* The cast to (char *) in the following accommodates both
2073 * implementations that use char* generic pointers, and those
2074 * that use void* generic pointers. It works with the latter
2075 * because both ANSI C and C++ allow castless assignment from
2076 * any pointer type to void*, and deal with argument conversions
2077 * as though doing an assignment.
2079 return realloc(ptr, size);
2082 void yyfree (void * ptr )
2084 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2087 #define YYTABLES_NAME "yytables"
2097 while ((c = input ()) != EOF)
2110 yyerror (_("error: EOF in comment"));
2116 yyerror (_("error: EOF in comment"));
2127 read_string (len_return)
2128 unsigned int *len_return;
2147 yyerror (_("error: EOF in string constant"));
2188 goto unexpected_eof;
2197 for (i = 0; i < 3; i++)
2200 if ('0' <= ch && ch <= '7')
2201 val = val * 8 + ch - '0';
2215 if (bufpos >= buflen)
2218 buf = (char *) xrealloc (buf, buflen);
2225 buf2 = (char *) xmalloc (bufpos + 1);
2226 memcpy (buf2, buf, bufpos);
2227 buf2[bufpos] = '\0';
2230 *len_return = bufpos;
2254 yyerror (_("error: EOF in regular expression"));
2294 goto unexpected_eof;
2303 for (i = 0; i < 3; i++)
2306 if ('0' <= ch && ch <= '7')
2307 val = val * 8 + ch - '0';
2318 /* Pass it through. */
2327 if (bufpos >= buflen)
2330 buf = (char *) xrealloc (buf, buflen);
2337 /* Possible options. */
2345 /* Case-insensitive regular expression. */
2346 node->u.re.flags |= fRE_CASE_INSENSITIVE;
2350 /* Unknown option => this belongs to the next token. */
2357 buf2 = (char *) xmalloc (bufpos + 1);
2358 memcpy (buf2, buf, bufpos);
2359 buf2[bufpos] = '\0';
2362 node->u.re.data = buf2;
2363 node->u.re.len = bufpos;