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 5
11 #define YY_FLEX_SUBMINOR_VERSION 31
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 typedef int8_t flex_int8_t
;
36 typedef uint8_t flex_uint8_t
;
37 typedef int16_t flex_int16_t
;
38 typedef uint16_t flex_uint16_t
;
39 typedef int32_t flex_int32_t
;
40 typedef uint32_t flex_uint32_t
;
42 typedef signed char flex_int8_t
;
43 typedef short int flex_int16_t
;
44 typedef int flex_int32_t
;
45 typedef unsigned char flex_uint8_t
;
46 typedef unsigned short int flex_uint16_t
;
47 typedef unsigned int flex_uint32_t
;
50 /* Limits of integral types. */
52 #define INT8_MIN (-128)
55 #define INT16_MIN (-32767-1)
58 #define INT32_MIN (-2147483647-1)
61 #define INT8_MAX (127)
64 #define INT16_MAX (32767)
67 #define INT32_MAX (2147483647)
70 #define UINT8_MAX (255U)
73 #define UINT16_MAX (65535U)
76 #define UINT32_MAX (4294967295U)
79 #endif /* ! FLEXINT_H */
83 /* The "const" storage-class-modifier is valid. */
86 #else /* ! __cplusplus */
93 #endif /* ! __cplusplus */
101 /* Returned upon end-of-file. */
104 /* Promotes a possibly negative, possibly signed char to an unsigned
105 * integer for use as an array index. If the signed char is negative,
106 * we want to instead treat it as an 8-bit unsigned char, hence the
109 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
111 /* Enter a start condition. This macro really ought to take a parameter,
112 * but we do it the disgusting crufty way forced on us by the ()-less
113 * definition of BEGIN.
115 #define BEGIN (yy_start) = 1 + 2 *
117 /* Translate the current start state into a value that can be later handed
118 * to BEGIN to return to the state. The YYSTATE alias is for lex
121 #define YY_START (((yy_start) - 1) / 2)
122 #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)
127 /* Special action meaning "start processing a new file". */
128 #define YY_NEW_FILE yyrestart(yyin )
130 #define YY_END_OF_BUFFER_CHAR 0
132 /* Size of default input buffer. */
134 #define YY_BUF_SIZE 16384
137 /* The state buf must be large enough to hold one state per character in the main buffer.
139 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
141 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
142 #define YY_TYPEDEF_YY_BUFFER_STATE
143 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
148 extern FILE *yyin
, *yyout
;
150 #define EOB_ACT_CONTINUE_SCAN 0
151 #define EOB_ACT_END_OF_FILE 1
152 #define EOB_ACT_LAST_MATCH 2
154 #define YY_LESS_LINENO(n)
156 /* Return all but the first "n" matched characters back to the input stream. */
160 /* Undo effects of setting up yytext. */ \
161 int yyless_macro_arg = (n); \
162 YY_LESS_LINENO(yyless_macro_arg);\
163 *yy_cp = (yy_hold_char); \
164 YY_RESTORE_YY_MORE_OFFSET \
165 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
166 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
170 #define unput(c) yyunput( c, (yytext_ptr) )
172 /* The following is because we cannot portably get our hands on size_t
173 * (without autoconf's help, which isn't available because we want
174 * flex-generated scanners to compile on their own).
177 #ifndef YY_TYPEDEF_YY_SIZE_T
178 #define YY_TYPEDEF_YY_SIZE_T
179 typedef unsigned int yy_size_t
;
182 #ifndef YY_STRUCT_YY_BUFFER_STATE
183 #define YY_STRUCT_YY_BUFFER_STATE
184 struct yy_buffer_state
188 char *yy_ch_buf
; /* input buffer */
189 char *yy_buf_pos
; /* current position in input buffer */
191 /* Size of input buffer in bytes, not including room for EOB
194 yy_size_t yy_buf_size
;
196 /* Number of characters read into yy_ch_buf, not including EOB
201 /* Whether we "own" the buffer - i.e., we know we created it,
202 * and can realloc() it to grow it, and should free() it to
205 int yy_is_our_buffer
;
207 /* Whether this is an "interactive" input source; if so, and
208 * if we're using stdio for input, then we want to use getc()
209 * instead of fread(), to make sure we stop fetching input after
212 int yy_is_interactive
;
214 /* Whether we're considered to be at the beginning of a line.
215 * If so, '^' rules will be active on the next match, otherwise
220 int yy_bs_lineno
; /**< The line count. */
221 int yy_bs_column
; /**< The column count. */
223 /* Whether to try to fill the input buffer when we reach the
228 int yy_buffer_status
;
230 #define YY_BUFFER_NEW 0
231 #define YY_BUFFER_NORMAL 1
232 /* When an EOF's been seen but there's still some text to process
233 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
234 * shouldn't try reading from the input source any more. We might
235 * still have a bunch of tokens to match, though, because of
236 * possible backing-up.
238 * When we actually see the EOF, we change the status to "new"
239 * (via yyrestart()), so that the user can continue scanning by
240 * just pointing yyin at a new input file.
242 #define YY_BUFFER_EOF_PENDING 2
245 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
247 /* Stack of input buffers. */
248 static size_t yy_buffer_stack_top
= 0; /**< index of top of stack. */
249 static size_t yy_buffer_stack_max
= 0; /**< capacity of stack. */
250 static YY_BUFFER_STATE
* yy_buffer_stack
= 0; /**< Stack as an array. */
252 /* We provide macros for accessing buffer states in case in the
253 * future we want to put the buffer states in a more general
256 * Returns the top of the stack, or NULL.
258 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
259 ? (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
= (char *) 0;
274 static int yy_init
= 1; /* 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
);
294 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
296 YY_BUFFER_STATE
yy_scan_buffer (char *base
,yy_size_t size
);
297 YY_BUFFER_STATE
yy_scan_string (yyconst
char *yy_str
);
298 YY_BUFFER_STATE
yy_scan_bytes (yyconst
char *bytes
,int len
);
300 void *yyalloc (yy_size_t
);
301 void *yyrealloc (void *,yy_size_t
);
302 void yyfree (void * );
304 #define yy_new_buffer yy_create_buffer
306 #define yy_set_interactive(is_interactive) \
308 if ( ! YY_CURRENT_BUFFER ){ \
309 yyensure_buffer_stack (); \
310 YY_CURRENT_BUFFER_LVALUE = \
311 yy_create_buffer(yyin,YY_BUF_SIZE ); \
313 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
316 #define yy_set_bol(at_bol) \
318 if ( ! YY_CURRENT_BUFFER ){\
319 yyensure_buffer_stack (); \
320 YY_CURRENT_BUFFER_LVALUE = \
321 yy_create_buffer(yyin,YY_BUF_SIZE ); \
323 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
326 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
328 /* Begin user sect3 */
330 typedef unsigned char YY_CHAR
;
332 FILE *yyin
= (FILE *) 0, *yyout
= (FILE *) 0;
334 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 yy_fatal_error (yyconst
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 = (size_t) (yy_cp - yy_bp); \
351 (yy_hold_char) = *yy_cp; \
353 (yy_c_buf_p) = yy_cp;
355 #define YY_NUM_RULES 15
356 #define YY_END_OF_BUFFER 16
357 /* This struct is not used in this scanner,
358 but its presence is necessary. */
361 flex_int32_t yy_verify
;
364 static yyconst flex_int16_t yy_accept
[60] =
366 0, 0, 16, 14, 13, 12, 11, 8, 8, 10,
367 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
368 10, 8, 0, 10, 10, 10, 10, 10, 10, 10,
369 10, 10, 10, 10, 10, 10, 7, 9, 10, 10,
370 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
371 5, 1, 2, 3, 10, 6, 10, 4, 0
374 static yyconst flex_int32_t yy_ec
[256] =
376 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
377 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
378 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
379 1, 4, 1, 1, 5, 1, 1, 1, 1, 1,
380 1, 1, 1, 1, 1, 1, 1, 6, 7, 7,
381 7, 7, 7, 7, 7, 7, 7, 1, 8, 1,
382 1, 1, 1, 1, 9, 10, 11, 12, 13, 10,
383 14, 15, 16, 15, 15, 15, 17, 18, 15, 15,
384 15, 19, 20, 15, 15, 15, 15, 15, 15, 15,
385 1, 1, 1, 1, 15, 1, 21, 10, 22, 23,
387 24, 10, 25, 15, 26, 15, 15, 15, 27, 28,
388 15, 29, 15, 30, 31, 15, 15, 15, 15, 32,
389 15, 15, 1, 1, 1, 1, 1, 1, 1, 1,
390 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
391 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
392 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
393 1, 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,
396 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,
406 static yyconst flex_int32_t yy_meta
[33] =
408 1, 1, 1, 1, 1, 2, 2, 1, 2, 2,
409 2, 2, 2, 3, 3, 3, 3, 3, 3, 3,
410 2, 2, 2, 2, 3, 3, 3, 3, 3, 3,
414 static yyconst flex_int16_t yy_base
[62] =
416 0, 0, 83, 84, 84, 84, 84, 27, 29, 70,
417 0, 62, 61, 60, 20, 55, 47, 46, 45, 12,
418 35, 37, 0, 0, 62, 60, 59, 58, 53, 49,
419 45, 43, 42, 41, 37, 32, 0, 0, 43, 44,
420 43, 42, 42, 36, 23, 27, 26, 25, 25, 20,
421 0, 0, 0, 0, 35, 0, 23, 0, 84, 58,
425 static yyconst flex_int16_t yy_def
[62] =
427 59, 1, 59, 59, 59, 59, 59, 59, 59, 60,
428 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
429 60, 59, 61, 60, 60, 60, 60, 60, 60, 60,
430 60, 60, 60, 60, 60, 60, 60, 61, 60, 60,
431 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
432 60, 60, 60, 60, 60, 60, 60, 60, 0, 59,
436 static yyconst flex_int16_t yy_nxt
[117] =
438 4, 5, 6, 5, 7, 8, 9, 7, 10, 11,
439 12, 13, 11, 14, 11, 15, 11, 11, 11, 11,
440 16, 17, 18, 11, 19, 20, 11, 11, 21, 11,
441 11, 11, 22, 22, 22, 22, 29, 30, 35, 36,
442 37, 37, 22, 22, 38, 58, 58, 56, 57, 54,
443 53, 52, 51, 56, 55, 54, 53, 52, 23, 24,
444 24, 51, 50, 49, 48, 47, 46, 45, 44, 43,
445 42, 41, 40, 39, 34, 33, 32, 31, 28, 27,
446 26, 25, 59, 3, 59, 59, 59, 59, 59, 59,
447 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
449 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
450 59, 59, 59, 59, 59, 59
453 static yyconst flex_int16_t yy_chk
[117] =
455 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
456 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
457 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
458 1, 1, 8, 8, 9, 9, 15, 15, 20, 20,
459 21, 21, 22, 22, 61, 57, 55, 50, 49, 48,
460 47, 46, 45, 44, 43, 42, 41, 40, 8, 60,
461 60, 39, 36, 35, 34, 33, 32, 31, 30, 29,
462 28, 27, 26, 25, 19, 18, 17, 16, 14, 13,
463 12, 10, 3, 59, 59, 59, 59, 59, 59, 59,
464 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
466 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
467 59, 59, 59, 59, 59, 59
470 static yy_state_type yy_last_accepting_state
;
471 static char *yy_last_accepting_cpos
;
473 extern int yy_flex_debug
;
474 int yy_flex_debug
= 0;
476 /* The intent behind this definition is that it'll catch
477 * any uses of REJECT which flex missed.
479 #define REJECT reject_used_but_not_detected
480 #define yymore() yymore_used_but_not_detected
481 #define YY_MORE_ADJ 0
482 #define YY_RESTORE_YY_MORE_OFFSET
486 Copyright 1997, 1998, 2001, 2002, 2005, 2006, 2007
487 Free Software Foundation, Inc.
489 This file is part of GAS, the GNU Assembler.
491 GAS is free software; you can redistribute it and/or modify
492 it under the terms of the GNU General Public License as published by
493 the Free Software Foundation; either version 3, or (at your option)
496 GAS is distributed in the hope that it will be useful,
497 but WITHOUT ANY WARRANTY; without even the implied warranty of
498 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
499 GNU General Public License for more details.
501 You should have received a copy of the GNU General Public License
502 along with GAS; see the file COPYING. If not, write to the Free
503 Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
505 #line 23 "itbl-lex.l"
507 #include "itbl-lex.h"
508 #include <itbl-parse.h>
511 #define DBG(x) printf x
512 #define MDBG(x) printf x
518 int insntbl_line
= 1;
519 #line 520 "itbl-lex.c"
523 /* Special case for "unistd.h", since it is non-ANSI. We include it way
524 * down here because we want the user's section 1 to have been scanned first.
525 * The user has a chance to override it with an option.
529 #ifndef YY_EXTRA_TYPE
530 #define YY_EXTRA_TYPE void *
533 /* Macros after this point can all be overridden by user definitions in
537 #ifndef YY_SKIP_YYWRAP
539 extern "C" int yywrap (void );
541 extern int yywrap (void );
545 static void yyunput (int c
,char *buf_ptr
);
548 static void yy_flex_strncpy (char *,yyconst
char *,int );
551 #ifdef YY_NEED_STRLEN
552 static int yy_flex_strlen (yyconst
char * );
558 static int yyinput (void );
560 static int input (void );
565 /* Amount of stuff to slurp up with each read. */
566 #ifndef YY_READ_BUF_SIZE
567 #define YY_READ_BUF_SIZE 8192
570 /* Copy whatever the last rule matched to the standard output. */
572 /* This used to be an fputs(), but since the string might contain NUL's,
573 * we now use fwrite().
575 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
578 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
579 * is returned in "result".
582 #define YY_INPUT(buf,result,max_size) \
583 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
587 for ( n = 0; n < max_size && \
588 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
591 buf[n++] = (char) c; \
592 if ( c == EOF && ferror( yyin ) ) \
593 YY_FATAL_ERROR( "input in flex scanner failed" ); \
599 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
601 if( errno != EINTR) \
603 YY_FATAL_ERROR( "input in flex scanner failed" ); \
614 /* No semi-colon after return; correct usage is to write "yyterminate();" -
615 * we don't want an extra ';' after the "return" because that will cause
616 * some compilers to complain about unreachable statements.
619 #define yyterminate() return YY_NULL
622 /* Number of entries by which start-condition stack grows. */
623 #ifndef YY_START_STACK_INCR
624 #define YY_START_STACK_INCR 25
627 /* Report a fatal error. */
628 #ifndef YY_FATAL_ERROR
629 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
632 /* end tables serialization structures and prototypes */
634 /* Default declaration of generated scanner - a define so the user can
635 * easily add parameters.
638 #define YY_DECL_IS_OURS 1
640 extern int yylex (void);
642 #define YY_DECL int yylex (void)
643 #endif /* !YY_DECL */
645 /* Code executed at the beginning of each rule, after yytext and yyleng
648 #ifndef YY_USER_ACTION
649 #define YY_USER_ACTION
652 /* Code executed at the end of each rule. */
654 #define YY_BREAK break;
657 #define YY_RULE_SETUP \
660 /** The main scanner function which does all the work.
664 register yy_state_type yy_current_state
;
665 register char *yy_cp
, *yy_bp
;
668 #line 43 "itbl-lex.l"
671 #line 672 "itbl-lex.c"
682 (yy_start
) = 1; /* first start state */
690 if ( ! YY_CURRENT_BUFFER
) {
691 yyensure_buffer_stack ();
692 YY_CURRENT_BUFFER_LVALUE
=
693 yy_create_buffer(yyin
,YY_BUF_SIZE
);
696 yy_load_buffer_state( );
699 while ( 1 ) /* loops until end-of-file is reached */
701 yy_cp
= (yy_c_buf_p
);
703 /* Support of yytext. */
704 *yy_cp
= (yy_hold_char
);
706 /* yy_bp points to the position in yy_ch_buf of the start of
711 yy_current_state
= (yy_start
);
715 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
716 if ( yy_accept
[yy_current_state
] )
718 (yy_last_accepting_state
) = yy_current_state
;
719 (yy_last_accepting_cpos
) = yy_cp
;
721 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
723 yy_current_state
= (int) yy_def
[yy_current_state
];
724 if ( yy_current_state
>= 60 )
725 yy_c
= yy_meta
[(unsigned int) yy_c
];
727 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
730 while ( yy_base
[yy_current_state
] != 84 );
733 yy_act
= yy_accept
[yy_current_state
];
735 { /* have to back up */
736 yy_cp
= (yy_last_accepting_cpos
);
737 yy_current_state
= (yy_last_accepting_state
);
738 yy_act
= yy_accept
[yy_current_state
];
743 do_action
: /* This label is used only to access EOF actions. */
746 { /* beginning of action switch */
747 case 0: /* must back up */
748 /* undo the effects of YY_DO_BEFORE_ACTION */
749 *yy_cp
= (yy_hold_char
);
750 yy_cp
= (yy_last_accepting_cpos
);
751 yy_current_state
= (yy_last_accepting_state
);
756 #line 45 "itbl-lex.l"
763 #line 48 "itbl-lex.l"
770 #line 51 "itbl-lex.l"
777 #line 54 "itbl-lex.l"
784 #line 57 "itbl-lex.l"
791 #line 60 "itbl-lex.l"
798 #line 63 "itbl-lex.l"
801 yylval
.processor
= strtoul (yytext
+1, 0, 0);
807 #line 68 "itbl-lex.l"
810 yylval
.num
= strtoul (yytext
, 0, 0);
816 #line 73 "itbl-lex.l"
819 yylval
.num
= strtoul (yytext
, 0, 0);
825 #line 78 "itbl-lex.l"
828 yylval
.str
= strdup (yytext
);
834 #line 83 "itbl-lex.l"
837 while ((c
= input ()) != EOF
)
848 /* rule 12 can match eol */
850 #line 94 "itbl-lex.l"
853 MDBG (("in lex, NL = %d (x%x)\n", NL
, NL
));
859 #line 99 "itbl-lex.l"
865 #line 101 "itbl-lex.l"
867 MDBG (("char = %x, %d\n", yytext
[0], yytext
[0]));
873 #line 105 "itbl-lex.l"
876 #line 877 "itbl-lex.c"
877 case YY_STATE_EOF(INITIAL
):
880 case YY_END_OF_BUFFER
:
882 /* Amount of text matched not including the EOB char. */
883 int yy_amount_of_matched_text
= (int) (yy_cp
- (yytext_ptr
)) - 1;
885 /* Undo the effects of YY_DO_BEFORE_ACTION. */
886 *yy_cp
= (yy_hold_char
);
887 YY_RESTORE_YY_MORE_OFFSET
889 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_NEW
)
891 /* We're scanning a new file or input source. It's
892 * possible that this happened because the user
893 * just pointed yyin at a new source and called
894 * yylex(). If so, then we have to assure
895 * consistency between YY_CURRENT_BUFFER and our
896 * globals. Here is the right place to do so, because
897 * this is the first action (other than possibly a
898 * back-up) that will match for the new input source.
900 (yy_n_chars
) = YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
901 YY_CURRENT_BUFFER_LVALUE
->yy_input_file
= yyin
;
902 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
= YY_BUFFER_NORMAL
;
905 /* Note that here we test for yy_c_buf_p "<=" to the position
906 * of the first EOB in the buffer, since yy_c_buf_p will
907 * already have been incremented past the NUL character
908 * (since all states make transitions on EOB to the
909 * end-of-buffer state). Contrast this with the test
912 if ( (yy_c_buf_p
) <= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
)] )
913 { /* This was really a NUL. */
914 yy_state_type yy_next_state
;
916 (yy_c_buf_p
) = (yytext_ptr
) + yy_amount_of_matched_text
;
918 yy_current_state
= yy_get_previous_state( );
920 /* Okay, we're now positioned to make the NUL
921 * transition. We couldn't have
922 * yy_get_previous_state() go ahead and do it
923 * for us because it doesn't know how to deal
924 * with the possibility of jamming (and we don't
925 * want to build jamming into it because then it
926 * will run more slowly).
929 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
931 yy_bp
= (yytext_ptr
) + YY_MORE_ADJ
;
935 /* Consume the NUL. */
936 yy_cp
= ++(yy_c_buf_p
);
937 yy_current_state
= yy_next_state
;
943 yy_cp
= (yy_c_buf_p
);
948 else switch ( yy_get_next_buffer( ) )
950 case EOB_ACT_END_OF_FILE
:
952 (yy_did_buffer_switch_on_eof
) = 0;
956 /* Note: because we've taken care in
957 * yy_get_next_buffer() to have set up
958 * yytext, we can now set up
959 * yy_c_buf_p so that if some total
960 * hoser (like flex itself) wants to
961 * call the scanner after we return the
962 * YY_NULL, it'll still work - another
963 * YY_NULL will get returned.
965 (yy_c_buf_p
) = (yytext_ptr
) + YY_MORE_ADJ
;
967 yy_act
= YY_STATE_EOF(YY_START
);
973 if ( ! (yy_did_buffer_switch_on_eof
) )
979 case EOB_ACT_CONTINUE_SCAN
:
981 (yytext_ptr
) + yy_amount_of_matched_text
;
983 yy_current_state
= yy_get_previous_state( );
985 yy_cp
= (yy_c_buf_p
);
986 yy_bp
= (yytext_ptr
) + YY_MORE_ADJ
;
989 case EOB_ACT_LAST_MATCH
:
991 &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
)];
993 yy_current_state
= yy_get_previous_state( );
995 yy_cp
= (yy_c_buf_p
);
996 yy_bp
= (yytext_ptr
) + YY_MORE_ADJ
;
1004 "fatal flex scanner internal error--no action found" );
1005 } /* end of action switch */
1006 } /* end of scanning one token */
1007 } /* end of yylex */
1009 /* yy_get_next_buffer - try to read in a new buffer
1011 * Returns a code representing an action:
1012 * EOB_ACT_LAST_MATCH -
1013 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1014 * EOB_ACT_END_OF_FILE - end of file
1016 static int yy_get_next_buffer (void)
1018 register char *dest
= YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
;
1019 register char *source
= (yytext_ptr
);
1020 register int number_to_move
, i
;
1023 if ( (yy_c_buf_p
) > &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
) + 1] )
1025 "fatal flex scanner internal error--end of buffer missed" );
1027 if ( YY_CURRENT_BUFFER_LVALUE
->yy_fill_buffer
== 0 )
1028 { /* Don't try to fill the buffer, so this is an EOF. */
1029 if ( (yy_c_buf_p
) - (yytext_ptr
) - YY_MORE_ADJ
== 1 )
1031 /* We matched a single character, the EOB, so
1032 * treat this as a final EOF.
1034 return EOB_ACT_END_OF_FILE
;
1039 /* We matched some text prior to the EOB, first
1042 return EOB_ACT_LAST_MATCH
;
1046 /* Try to read more data. */
1048 /* First move last chars to start of buffer. */
1049 number_to_move
= (int) ((yy_c_buf_p
) - (yytext_ptr
)) - 1;
1051 for ( i
= 0; i
< number_to_move
; ++i
)
1052 *(dest
++) = *(source
++);
1054 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
1055 /* don't do the read, it's not guaranteed to return an EOF,
1058 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
) = 0;
1062 size_t num_to_read
=
1063 YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
- number_to_move
- 1;
1065 while ( num_to_read
<= 0 )
1066 { /* Not enough room in the buffer - grow it. */
1068 /* just a shorter name for the current buffer */
1069 YY_BUFFER_STATE b
= YY_CURRENT_BUFFER
;
1071 int yy_c_buf_p_offset
=
1072 (int) ((yy_c_buf_p
) - b
->yy_ch_buf
);
1074 if ( b
->yy_is_our_buffer
)
1076 int new_size
= b
->yy_buf_size
* 2;
1078 if ( new_size
<= 0 )
1079 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
1081 b
->yy_buf_size
*= 2;
1083 b
->yy_ch_buf
= (char *)
1084 /* Include room in for 2 EOB chars. */
1085 yyrealloc((void *) b
->yy_ch_buf
,b
->yy_buf_size
+ 2 );
1088 /* Can't grow it, we don't own it. */
1091 if ( ! b
->yy_ch_buf
)
1093 "fatal error - scanner input buffer overflow" );
1095 (yy_c_buf_p
) = &b
->yy_ch_buf
[yy_c_buf_p_offset
];
1097 num_to_read
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
-
1102 if ( num_to_read
> YY_READ_BUF_SIZE
)
1103 num_to_read
= YY_READ_BUF_SIZE
;
1105 /* Read in more data. */
1106 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[number_to_move
]),
1107 (yy_n_chars
), num_to_read
);
1109 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
);
1112 if ( (yy_n_chars
) == 0 )
1114 if ( number_to_move
== YY_MORE_ADJ
)
1116 ret_val
= EOB_ACT_END_OF_FILE
;
1122 ret_val
= EOB_ACT_LAST_MATCH
;
1123 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
=
1124 YY_BUFFER_EOF_PENDING
;
1129 ret_val
= EOB_ACT_CONTINUE_SCAN
;
1131 (yy_n_chars
) += number_to_move
;
1132 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
)] = YY_END_OF_BUFFER_CHAR
;
1133 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
) + 1] = YY_END_OF_BUFFER_CHAR
;
1135 (yytext_ptr
) = &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[0];
1140 /* yy_get_previous_state - get the state just before the EOB char was reached */
1142 static yy_state_type
yy_get_previous_state (void)
1144 register yy_state_type yy_current_state
;
1145 register char *yy_cp
;
1147 yy_current_state
= (yy_start
);
1149 for ( yy_cp
= (yytext_ptr
) + YY_MORE_ADJ
; yy_cp
< (yy_c_buf_p
); ++yy_cp
)
1151 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
1152 if ( yy_accept
[yy_current_state
] )
1154 (yy_last_accepting_state
) = yy_current_state
;
1155 (yy_last_accepting_cpos
) = yy_cp
;
1157 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1159 yy_current_state
= (int) yy_def
[yy_current_state
];
1160 if ( yy_current_state
>= 60 )
1161 yy_c
= yy_meta
[(unsigned int) yy_c
];
1163 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1166 return yy_current_state
;
1169 /* yy_try_NUL_trans - try to make a transition on the NUL character
1172 * next_state = yy_try_NUL_trans( current_state );
1174 static yy_state_type
yy_try_NUL_trans (yy_state_type yy_current_state
)
1176 register int yy_is_jam
;
1177 register char *yy_cp
= (yy_c_buf_p
);
1179 register YY_CHAR yy_c
= 1;
1180 if ( yy_accept
[yy_current_state
] )
1182 (yy_last_accepting_state
) = yy_current_state
;
1183 (yy_last_accepting_cpos
) = yy_cp
;
1185 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1187 yy_current_state
= (int) yy_def
[yy_current_state
];
1188 if ( yy_current_state
>= 60 )
1189 yy_c
= yy_meta
[(unsigned int) yy_c
];
1191 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1192 yy_is_jam
= (yy_current_state
== 59);
1194 return yy_is_jam
? 0 : yy_current_state
;
1197 static void yyunput (int c
, register char * yy_bp
)
1199 register char *yy_cp
;
1201 yy_cp
= (yy_c_buf_p
);
1203 /* undo effects of setting up yytext */
1204 *yy_cp
= (yy_hold_char
);
1206 if ( yy_cp
< YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
+ 2 )
1207 { /* need to shift things up to make room */
1208 /* +2 for EOB chars. */
1209 register int number_to_move
= (yy_n_chars
) + 2;
1210 register char *dest
= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[
1211 YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
+ 2];
1212 register char *source
=
1213 &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[number_to_move
];
1215 while ( source
> YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
)
1216 *--dest
= *--source
;
1218 yy_cp
+= (int) (dest
- source
);
1219 yy_bp
+= (int) (dest
- source
);
1220 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
=
1221 (yy_n_chars
) = YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
;
1223 if ( yy_cp
< YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
+ 2 )
1224 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1227 *--yy_cp
= (char) c
;
1229 (yytext_ptr
) = yy_bp
;
1230 (yy_hold_char
) = *yy_cp
;
1231 (yy_c_buf_p
) = yy_cp
;
1236 static int yyinput (void)
1238 static int input (void)
1244 *(yy_c_buf_p
) = (yy_hold_char
);
1246 if ( *(yy_c_buf_p
) == YY_END_OF_BUFFER_CHAR
)
1248 /* yy_c_buf_p now points to the character we want to return.
1249 * If this occurs *before* the EOB characters, then it's a
1250 * valid NUL; if not, then we've hit the end of the buffer.
1252 if ( (yy_c_buf_p
) < &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
)] )
1253 /* This was really a NUL. */
1254 *(yy_c_buf_p
) = '\0';
1257 { /* need more input */
1258 int offset
= (yy_c_buf_p
) - (yytext_ptr
);
1261 switch ( yy_get_next_buffer( ) )
1263 case EOB_ACT_LAST_MATCH
:
1264 /* This happens because yy_g_n_b()
1265 * sees that we've accumulated a
1266 * token and flags that we need to
1267 * try matching the token before
1268 * proceeding. But for input(),
1269 * there's no matching to consider.
1270 * So convert the EOB_ACT_LAST_MATCH
1271 * to EOB_ACT_END_OF_FILE.
1274 /* Reset buffer status. */
1279 case EOB_ACT_END_OF_FILE
:
1284 if ( ! (yy_did_buffer_switch_on_eof
) )
1293 case EOB_ACT_CONTINUE_SCAN
:
1294 (yy_c_buf_p
) = (yytext_ptr
) + offset
;
1300 c
= *(unsigned char *) (yy_c_buf_p
); /* cast for 8-bit char's */
1301 *(yy_c_buf_p
) = '\0'; /* preserve yytext */
1302 (yy_hold_char
) = *++(yy_c_buf_p
);
1306 #endif /* ifndef YY_NO_INPUT */
1308 /** Immediately switch to a different input stream.
1309 * @param input_file A readable stream.
1311 * @note This function does not reset the start condition to @c INITIAL .
1313 void yyrestart (FILE * input_file
)
1316 if ( ! YY_CURRENT_BUFFER
){
1317 yyensure_buffer_stack ();
1318 YY_CURRENT_BUFFER_LVALUE
=
1319 yy_create_buffer(yyin
,YY_BUF_SIZE
);
1322 yy_init_buffer(YY_CURRENT_BUFFER
,input_file
);
1323 yy_load_buffer_state( );
1326 /** Switch to a different input buffer.
1327 * @param new_buffer The new input buffer.
1330 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer
)
1333 /* TODO. We should be able to replace this entire function body
1335 * yypop_buffer_state();
1336 * yypush_buffer_state(new_buffer);
1338 yyensure_buffer_stack ();
1339 if ( YY_CURRENT_BUFFER
== new_buffer
)
1342 if ( YY_CURRENT_BUFFER
)
1344 /* Flush out information for old buffer. */
1345 *(yy_c_buf_p
) = (yy_hold_char
);
1346 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= (yy_c_buf_p
);
1347 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
);
1350 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
1351 yy_load_buffer_state( );
1353 /* We don't actually know whether we did this switch during
1354 * EOF (yywrap()) processing, but the only time this flag
1355 * is looked at is after yywrap() is called, so it's safe
1356 * to go ahead and always set it.
1358 (yy_did_buffer_switch_on_eof
) = 1;
1361 static void yy_load_buffer_state (void)
1363 (yy_n_chars
) = YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
1364 (yytext_ptr
) = (yy_c_buf_p
) = YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
;
1365 yyin
= YY_CURRENT_BUFFER_LVALUE
->yy_input_file
;
1366 (yy_hold_char
) = *(yy_c_buf_p
);
1369 /** Allocate and initialize an input buffer state.
1370 * @param file A readable stream.
1371 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1373 * @return the allocated buffer state.
1375 YY_BUFFER_STATE
yy_create_buffer (FILE * file
, int size
)
1379 b
= (YY_BUFFER_STATE
) yyalloc(sizeof( struct yy_buffer_state
) );
1381 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1383 b
->yy_buf_size
= size
;
1385 /* yy_ch_buf has to be 2 characters longer than the size given because
1386 * we need to put in 2 end-of-buffer characters.
1388 b
->yy_ch_buf
= (char *) yyalloc(b
->yy_buf_size
+ 2 );
1389 if ( ! b
->yy_ch_buf
)
1390 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1392 b
->yy_is_our_buffer
= 1;
1394 yy_init_buffer(b
,file
);
1399 /** Destroy the buffer.
1400 * @param b a buffer created with yy_create_buffer()
1403 void yy_delete_buffer (YY_BUFFER_STATE b
)
1409 if ( b
== YY_CURRENT_BUFFER
) /* Not sure if we should pop here. */
1410 YY_CURRENT_BUFFER_LVALUE
= (YY_BUFFER_STATE
) 0;
1412 if ( b
->yy_is_our_buffer
)
1413 yyfree((void *) b
->yy_ch_buf
);
1415 yyfree((void *) b
);
1419 extern int isatty (int );
1420 #endif /* __cplusplus */
1422 /* Initializes or reinitializes a buffer.
1423 * This function is sometimes called more than once on the same buffer,
1424 * such as during a yyrestart() or at EOF.
1426 static void yy_init_buffer (YY_BUFFER_STATE b
, FILE * file
)
1431 yy_flush_buffer(b
);
1433 b
->yy_input_file
= file
;
1434 b
->yy_fill_buffer
= 1;
1436 /* If b is the current buffer, then yy_init_buffer was _probably_
1437 * called from yyrestart() or through yy_get_next_buffer.
1438 * In that case, we don't want to reset the lineno or column.
1440 if (b
!= YY_CURRENT_BUFFER
){
1441 b
->yy_bs_lineno
= 1;
1442 b
->yy_bs_column
= 0;
1445 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
1450 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1451 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1454 void yy_flush_buffer (YY_BUFFER_STATE b
)
1461 /* We always need two end-of-buffer characters. The first causes
1462 * a transition to the end-of-buffer state. The second causes
1463 * a jam in that state.
1465 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
1466 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1468 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
1471 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1473 if ( b
== YY_CURRENT_BUFFER
)
1474 yy_load_buffer_state( );
1477 /** Pushes the new state onto the stack. The new state becomes
1478 * the current state. This function will allocate the stack
1480 * @param new_buffer The new state.
1483 void yypush_buffer_state (YY_BUFFER_STATE new_buffer
)
1485 if (new_buffer
== NULL
)
1488 yyensure_buffer_stack();
1490 /* This block is copied from yy_switch_to_buffer. */
1491 if ( YY_CURRENT_BUFFER
)
1493 /* Flush out information for old buffer. */
1494 *(yy_c_buf_p
) = (yy_hold_char
);
1495 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= (yy_c_buf_p
);
1496 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
);
1499 /* Only push if top exists. Otherwise, replace top. */
1500 if (YY_CURRENT_BUFFER
)
1501 (yy_buffer_stack_top
)++;
1502 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
1504 /* copied from yy_switch_to_buffer. */
1505 yy_load_buffer_state( );
1506 (yy_did_buffer_switch_on_eof
) = 1;
1509 /** Removes and deletes the top of the stack, if present.
1510 * The next element becomes the new top.
1513 void yypop_buffer_state (void)
1515 if (!YY_CURRENT_BUFFER
)
1518 yy_delete_buffer(YY_CURRENT_BUFFER
);
1519 YY_CURRENT_BUFFER_LVALUE
= NULL
;
1520 if ((yy_buffer_stack_top
) > 0)
1521 --(yy_buffer_stack_top
);
1523 if (YY_CURRENT_BUFFER
) {
1524 yy_load_buffer_state( );
1525 (yy_did_buffer_switch_on_eof
) = 1;
1529 /* Allocates the stack if it does not exist.
1530 * Guarantees space for at least one push.
1532 static void yyensure_buffer_stack (void)
1536 if (!(yy_buffer_stack
)) {
1538 /* First allocation is just for 2 elements, since we don't know if this
1539 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1540 * immediate realloc on the next call.
1543 (yy_buffer_stack
) = (struct yy_buffer_state
**)yyalloc
1544 (num_to_alloc
* sizeof(struct yy_buffer_state
*)
1547 memset((yy_buffer_stack
), 0, num_to_alloc
* sizeof(struct yy_buffer_state
*));
1549 (yy_buffer_stack_max
) = num_to_alloc
;
1550 (yy_buffer_stack_top
) = 0;
1554 if ((yy_buffer_stack_top
) >= ((yy_buffer_stack_max
)) - 1){
1556 /* Increase the buffer to prepare for a possible push. */
1557 int grow_size
= 8 /* arbitrary grow size */;
1559 num_to_alloc
= (yy_buffer_stack_max
) + grow_size
;
1560 (yy_buffer_stack
) = (struct yy_buffer_state
**)yyrealloc
1562 num_to_alloc
* sizeof(struct yy_buffer_state
*)
1565 /* zero only the new slots.*/
1566 memset((yy_buffer_stack
) + (yy_buffer_stack_max
), 0, grow_size
* sizeof(struct yy_buffer_state
*));
1567 (yy_buffer_stack_max
) = num_to_alloc
;
1571 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1572 * @param base the character buffer
1573 * @param size the size in bytes of the character buffer
1575 * @return the newly allocated buffer state object.
1577 YY_BUFFER_STATE
yy_scan_buffer (char * base
, yy_size_t size
)
1582 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
1583 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
1584 /* They forgot to leave room for the EOB's. */
1587 b
= (YY_BUFFER_STATE
) yyalloc(sizeof( struct yy_buffer_state
) );
1589 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1591 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
1592 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
1593 b
->yy_is_our_buffer
= 0;
1594 b
->yy_input_file
= 0;
1595 b
->yy_n_chars
= b
->yy_buf_size
;
1596 b
->yy_is_interactive
= 0;
1598 b
->yy_fill_buffer
= 0;
1599 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1601 yy_switch_to_buffer(b
);
1606 /** Setup the input buffer state to scan a string. The next call to yylex() will
1607 * scan from a @e copy of @a str.
1608 * @param str a NUL-terminated string to scan
1610 * @return the newly allocated buffer state object.
1611 * @note If you want to scan bytes that may contain NUL values, then use
1612 * yy_scan_bytes() instead.
1614 YY_BUFFER_STATE
yy_scan_string (yyconst
char * str
)
1617 return yy_scan_bytes(str
,strlen(str
) );
1620 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1621 * scan from a @e copy of @a bytes.
1622 * @param bytes the byte buffer to scan
1623 * @param len the number of bytes in the buffer pointed to by @a bytes.
1625 * @return the newly allocated buffer state object.
1627 YY_BUFFER_STATE
yy_scan_bytes (yyconst
char * bytes
, int len
)
1634 /* Get memory for full buffer, including space for trailing EOB's. */
1636 buf
= (char *) yyalloc(n
);
1638 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1640 for ( i
= 0; i
< len
; ++i
)
1643 buf
[len
] = buf
[len
+1] = YY_END_OF_BUFFER_CHAR
;
1645 b
= yy_scan_buffer(buf
,n
);
1647 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1649 /* It's okay to grow etc. this buffer, and we should throw it
1650 * away when we're done.
1652 b
->yy_is_our_buffer
= 1;
1657 #ifndef YY_EXIT_FAILURE
1658 #define YY_EXIT_FAILURE 2
1661 static void yy_fatal_error (yyconst
char* msg
)
1663 (void) fprintf( stderr
, "%s\n", msg
);
1664 exit( YY_EXIT_FAILURE
);
1667 /* Redefine yyless() so it works in section 3 code. */
1673 /* Undo effects of setting up yytext. */ \
1674 int yyless_macro_arg = (n); \
1675 YY_LESS_LINENO(yyless_macro_arg);\
1676 yytext[yyleng] = (yy_hold_char); \
1677 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1678 (yy_hold_char) = *(yy_c_buf_p); \
1679 *(yy_c_buf_p) = '\0'; \
1680 yyleng = yyless_macro_arg; \
1684 /* Accessor methods (get/set functions) to struct members. */
1686 /** Get the input stream.
1689 FILE *yyget_in (void)
1694 /** Get the output stream.
1697 FILE *yyget_out (void)
1702 /** Get the length of the current token.
1705 int yyget_leng (void)
1710 /** Get the current token.
1714 char *yyget_text (void)
1719 /** Set the input stream. This does not discard the current
1721 * @param in_str A readable stream.
1723 * @see yy_switch_to_buffer
1725 void yyset_in (FILE * in_str
)
1730 void yyset_out (FILE * out_str
)
1735 int yyget_debug (void)
1737 return yy_flex_debug
;
1740 void yyset_debug (int bdebug
)
1742 yy_flex_debug
= bdebug
;
1745 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
1746 int yylex_destroy (void)
1749 /* Pop the buffer stack, destroying each element. */
1750 while(YY_CURRENT_BUFFER
){
1751 yy_delete_buffer(YY_CURRENT_BUFFER
);
1752 YY_CURRENT_BUFFER_LVALUE
= NULL
;
1753 yypop_buffer_state();
1756 /* Destroy the stack itself. */
1757 yyfree((yy_buffer_stack
) );
1758 (yy_buffer_stack
) = NULL
;
1764 * Internal utility routines.
1768 static void yy_flex_strncpy (char* s1
, yyconst
char * s2
, int n
)
1771 for ( i
= 0; i
< n
; ++i
)
1776 #ifdef YY_NEED_STRLEN
1777 static int yy_flex_strlen (yyconst
char * s
)
1780 for ( n
= 0; s
[n
]; ++n
)
1787 void *yyalloc (yy_size_t size
)
1789 return (void *) malloc( size
);
1792 void *yyrealloc (void * ptr
, yy_size_t size
)
1794 /* The cast to (char *) in the following accommodates both
1795 * implementations that use char* generic pointers, and those
1796 * that use void* generic pointers. It works with the latter
1797 * because both ANSI C and C++ allow castless assignment from
1798 * any pointer type to void*, and deal with argument conversions
1799 * as though doing an assignment.
1801 return (void *) realloc( (char *) ptr
, size
);
1804 void yyfree (void * ptr
)
1806 free( (char *) ptr
); /* see yyrealloc() for (char *) cast */
1809 #define YYTABLES_NAME "yytables"
1811 #line 105 "itbl-lex.l"