source: trunk/src/binutils/gas/itbl-lex.c@ 1569

Last change on this file since 1569 was 610, checked in by bird, 22 years ago

This commit was generated by cvs2svn to compensate for changes in r609,
which included commits to RCS files with non-trunk default branches.

  • Property cvs2svn:cvs-rev set to 1.1.1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 45.7 KB
Line 
1
2#line 3 "lex.yy.c"
3
4#define YY_INT_ALIGNED short int
5
6/* A lexical scanner generated by flex */
7
8#define FLEX_SCANNER
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
13#define FLEX_BETA
14#endif
15
16/* First, we deal with platform-specific or compiler-specific issues. */
17
18/* begin standard C headers. */
19#include <stdio.h>
20#include <string.h>
21#include <errno.h>
22#include <stdlib.h>
23
24/* end standard C headers. */
25
26/* flex integer type definitions */
27
28#ifndef FLEXINT_H
29#define FLEXINT_H
30
31/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
32
33#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
34#include <inttypes.h>
35typedef int8_t flex_int8_t;
36typedef uint8_t flex_uint8_t;
37typedef int16_t flex_int16_t;
38typedef uint16_t flex_uint16_t;
39typedef int32_t flex_int32_t;
40typedef uint32_t flex_uint32_t;
41#else
42typedef signed char flex_int8_t;
43typedef short int flex_int16_t;
44typedef int flex_int32_t;
45typedef unsigned char flex_uint8_t;
46typedef unsigned short int flex_uint16_t;
47typedef unsigned int flex_uint32_t;
48#endif /* ! C99 */
49
50/* Limits of integral types. */
51#ifndef INT8_MIN
52#define INT8_MIN (-128)
53#endif
54#ifndef INT16_MIN
55#define INT16_MIN (-32767-1)
56#endif
57#ifndef INT32_MIN
58#define INT32_MIN (-2147483647-1)
59#endif
60#ifndef INT8_MAX
61#define INT8_MAX (127)
62#endif
63#ifndef INT16_MAX
64#define INT16_MAX (32767)
65#endif
66#ifndef INT32_MAX
67#define INT32_MAX (2147483647)
68#endif
69#ifndef UINT8_MAX
70#define UINT8_MAX (255U)
71#endif
72#ifndef UINT16_MAX
73#define UINT16_MAX (65535U)
74#endif
75#ifndef UINT32_MAX
76#define UINT32_MAX (4294967295U)
77#endif
78
79#endif /* ! FLEXINT_H */
80
81#ifdef __cplusplus
82
83/* The "const" storage-class-modifier is valid. */
84#define YY_USE_CONST
85
86#else /* ! __cplusplus */
87
88#if __STDC__
89
90#define YY_USE_CONST
91
92#endif /* __STDC__ */
93#endif /* ! __cplusplus */
94
95#ifdef YY_USE_CONST
96#define yyconst const
97#else
98#define yyconst
99#endif
100
101/* Returned upon end-of-file. */
102#define YY_NULL 0
103
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
107 * double cast.
108 */
109#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
110
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.
114 */
115#define BEGIN (yy_start) = 1 + 2 *
116
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
119 * compatibility.
120 */
121#define YY_START (((yy_start) - 1) / 2)
122#define YYSTATE YY_START
123
124/* Action number for EOF rule of a given start state. */
125#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
126
127/* Special action meaning "start processing a new file". */
128#define YY_NEW_FILE yyrestart(yyin )
129
130#define YY_END_OF_BUFFER_CHAR 0
131
132/* Size of default input buffer. */
133#ifndef YY_BUF_SIZE
134#define YY_BUF_SIZE 16384
135#endif
136
137#ifndef YY_TYPEDEF_YY_BUFFER_STATE
138#define YY_TYPEDEF_YY_BUFFER_STATE
139typedef struct yy_buffer_state *YY_BUFFER_STATE;
140#endif
141
142extern int yyleng;
143
144extern FILE *yyin, *yyout;
145
146#define EOB_ACT_CONTINUE_SCAN 0
147#define EOB_ACT_END_OF_FILE 1
148#define EOB_ACT_LAST_MATCH 2
149
150 #define YY_LESS_LINENO(n)
151
152/* Return all but the first "n" matched characters back to the input stream. */
153#define yyless(n) \
154 do \
155 { \
156 /* Undo effects of setting up yytext. */ \
157 int yyless_macro_arg = (n); \
158 YY_LESS_LINENO(yyless_macro_arg);\
159 *yy_cp = (yy_hold_char); \
160 YY_RESTORE_YY_MORE_OFFSET \
161 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
162 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
163 } \
164 while ( 0 )
165
166#define unput(c) yyunput( c, (yytext_ptr) )
167
168/* The following is because we cannot portably get our hands on size_t
169 * (without autoconf's help, which isn't available because we want
170 * flex-generated scanners to compile on their own).
171 */
172
173#ifndef YY_TYPEDEF_YY_SIZE_T
174#define YY_TYPEDEF_YY_SIZE_T
175typedef unsigned int yy_size_t;
176#endif
177
178#ifndef YY_STRUCT_YY_BUFFER_STATE
179#define YY_STRUCT_YY_BUFFER_STATE
180struct yy_buffer_state
181 {
182 FILE *yy_input_file;
183
184 char *yy_ch_buf; /* input buffer */
185 char *yy_buf_pos; /* current position in input buffer */
186
187 /* Size of input buffer in bytes, not including room for EOB
188 * characters.
189 */
190 yy_size_t yy_buf_size;
191
192 /* Number of characters read into yy_ch_buf, not including EOB
193 * characters.
194 */
195 int yy_n_chars;
196
197 /* Whether we "own" the buffer - i.e., we know we created it,
198 * and can realloc() it to grow it, and should free() it to
199 * delete it.
200 */
201 int yy_is_our_buffer;
202
203 /* Whether this is an "interactive" input source; if so, and
204 * if we're using stdio for input, then we want to use getc()
205 * instead of fread(), to make sure we stop fetching input after
206 * each newline.
207 */
208 int yy_is_interactive;
209
210 /* Whether we're considered to be at the beginning of a line.
211 * If so, '^' rules will be active on the next match, otherwise
212 * not.
213 */
214 int yy_at_bol;
215
216 int yy_bs_lineno; /**< The line count. */
217 int yy_bs_column; /**< The column count. */
218
219 /* Whether to try to fill the input buffer when we reach the
220 * end of it.
221 */
222 int yy_fill_buffer;
223
224 int yy_buffer_status;
225
226#define YY_BUFFER_NEW 0
227#define YY_BUFFER_NORMAL 1
228 /* When an EOF's been seen but there's still some text to process
229 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
230 * shouldn't try reading from the input source any more. We might
231 * still have a bunch of tokens to match, though, because of
232 * possible backing-up.
233 *
234 * When we actually see the EOF, we change the status to "new"
235 * (via yyrestart()), so that the user can continue scanning by
236 * just pointing yyin at a new input file.
237 */
238#define YY_BUFFER_EOF_PENDING 2
239
240 };
241#endif /* !YY_STRUCT_YY_BUFFER_STATE */
242
243/* Stack of input buffers. */
244static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
245static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
246static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
247
248/* We provide macros for accessing buffer states in case in the
249 * future we want to put the buffer states in a more general
250 * "scanner state".
251 *
252 * Returns the top of the stack, or NULL.
253 */
254#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
255 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
256 : NULL)
257
258/* Same as previous macro, but useful when we know that the buffer stack is not
259 * NULL or when we need an lvalue. For internal use only.
260 */
261#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
262
263/* yy_hold_char holds the character lost when yytext is formed. */
264static char yy_hold_char;
265static int yy_n_chars; /* number of characters read into yy_ch_buf */
266int yyleng;
267
268/* Points to current character in buffer. */
269static char *yy_c_buf_p = (char *) 0;
270static int yy_init = 1; /* whether we need to initialize */
271static int yy_start = 0; /* start state number */
272
273/* Flag which is used to allow yywrap()'s to do buffer switches
274 * instead of setting up a fresh yyin. A bit of a hack ...
275 */
276static int yy_did_buffer_switch_on_eof;
277
278void yyrestart (FILE *input_file );
279void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
280YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
281void yy_delete_buffer (YY_BUFFER_STATE b );
282void yy_flush_buffer (YY_BUFFER_STATE b );
283void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
284void yypop_buffer_state (void );
285
286static void yyensure_buffer_stack (void );
287static void yy_load_buffer_state (void );
288static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
289
290#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
291
292YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
293YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
294YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
295
296void *yyalloc (yy_size_t );
297void *yyrealloc (void *,yy_size_t );
298void yyfree (void * );
299
300#define yy_new_buffer yy_create_buffer
301
302#define yy_set_interactive(is_interactive) \
303 { \
304 if ( ! YY_CURRENT_BUFFER ){ \
305 yyensure_buffer_stack (); \
306 YY_CURRENT_BUFFER_LVALUE = \
307 yy_create_buffer(yyin,YY_BUF_SIZE ); \
308 } \
309 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
310 }
311
312#define yy_set_bol(at_bol) \
313 { \
314 if ( ! YY_CURRENT_BUFFER ){\
315 yyensure_buffer_stack (); \
316 YY_CURRENT_BUFFER_LVALUE = \
317 yy_create_buffer(yyin,YY_BUF_SIZE ); \
318 } \
319 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
320 }
321
322#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
323
324/* Begin user sect3 */
325
326typedef unsigned char YY_CHAR;
327
328FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
329
330typedef int yy_state_type;
331
332extern int yylineno;
333
334int yylineno = 1;
335
336extern char *yytext;
337#define yytext_ptr yytext
338
339static yy_state_type yy_get_previous_state (void );
340static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
341static int yy_get_next_buffer (void );
342static void yy_fatal_error (yyconst char msg[] );
343
344/* Done after the current pattern has been matched and before the
345 * corresponding action - sets up yytext.
346 */
347#define YY_DO_BEFORE_ACTION \
348 (yytext_ptr) = yy_bp; \
349 yyleng = (size_t) (yy_cp - yy_bp); \
350 (yy_hold_char) = *yy_cp; \
351 *yy_cp = '\0'; \
352 (yy_c_buf_p) = yy_cp;
353
354#define YY_NUM_RULES 15
355#define YY_END_OF_BUFFER 16
356/* This struct is not used in this scanner,
357 but its presence is necessary. */
358struct yy_trans_info
359 {
360 flex_int32_t yy_verify;
361 flex_int32_t yy_nxt;
362 };
363static yyconst flex_int16_t yy_accept[60] =
364 { 0,
365 0, 0, 16, 14, 13, 12, 11, 8, 8, 10,
366 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
367 10, 8, 0, 10, 10, 10, 10, 10, 10, 10,
368 10, 10, 10, 10, 10, 10, 7, 9, 10, 10,
369 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
370 5, 1, 2, 3, 10, 6, 10, 4, 0
371 } ;
372
373static yyconst flex_int32_t yy_ec[256] =
374 { 0,
375 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
376 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
377 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
378 1, 4, 1, 1, 5, 1, 1, 1, 1, 1,
379 1, 1, 1, 1, 1, 1, 1, 6, 7, 7,
380 7, 7, 7, 7, 7, 7, 7, 1, 8, 1,
381 1, 1, 1, 1, 9, 10, 11, 12, 13, 10,
382 14, 15, 16, 15, 15, 15, 17, 18, 15, 15,
383 15, 19, 20, 15, 15, 15, 15, 15, 15, 15,
384 1, 1, 1, 1, 15, 1, 21, 10, 22, 23,
385
386 24, 10, 25, 15, 26, 15, 15, 15, 27, 28,
387 15, 29, 15, 30, 31, 15, 15, 15, 15, 32,
388 15, 15, 1, 1, 1, 1, 1, 1, 1, 1,
389 1, 1, 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
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
403 } ;
404
405static yyconst flex_int32_t yy_meta[33] =
406 { 0,
407 1, 1, 1, 1, 1, 2, 2, 1, 2, 2,
408 2, 2, 2, 3, 3, 3, 3, 3, 3, 3,
409 2, 2, 2, 2, 3, 3, 3, 3, 3, 3,
410 3, 3
411 } ;
412
413static yyconst flex_int16_t yy_base[62] =
414 { 0,
415 0, 0, 83, 84, 84, 84, 84, 27, 29, 70,
416 0, 62, 61, 60, 20, 55, 47, 46, 45, 12,
417 35, 37, 0, 0, 62, 60, 59, 58, 53, 49,
418 45, 43, 42, 41, 37, 32, 0, 0, 43, 44,
419 43, 42, 42, 36, 23, 27, 26, 25, 25, 20,
420 0, 0, 0, 0, 35, 0, 23, 0, 84, 58,
421 43
422 } ;
423
424static yyconst flex_int16_t yy_def[62] =
425 { 0,
426 59, 1, 59, 59, 59, 59, 59, 59, 59, 60,
427 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
428 60, 59, 61, 60, 60, 60, 60, 60, 60, 60,
429 60, 60, 60, 60, 60, 60, 60, 61, 60, 60,
430 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
431 60, 60, 60, 60, 60, 60, 60, 60, 0, 59,
432 59
433 } ;
434
435static yyconst flex_int16_t yy_nxt[117] =
436 { 0,
437 4, 5, 6, 5, 7, 8, 9, 7, 10, 11,
438 12, 13, 11, 14, 11, 15, 11, 11, 11, 11,
439 16, 17, 18, 11, 19, 20, 11, 11, 21, 11,
440 11, 11, 22, 22, 22, 22, 29, 30, 35, 36,
441 37, 37, 22, 22, 38, 58, 58, 56, 57, 54,
442 53, 52, 51, 56, 55, 54, 53, 52, 23, 24,
443 24, 51, 50, 49, 48, 47, 46, 45, 44, 43,
444 42, 41, 40, 39, 34, 33, 32, 31, 28, 27,
445 26, 25, 59, 3, 59, 59, 59, 59, 59, 59,
446 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
447
448 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
449 59, 59, 59, 59, 59, 59
450 } ;
451
452static yyconst flex_int16_t yy_chk[117] =
453 { 0,
454 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
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, 8, 8, 9, 9, 15, 15, 20, 20,
458 21, 21, 22, 22, 61, 57, 55, 50, 49, 48,
459 47, 46, 45, 44, 43, 42, 41, 40, 8, 60,
460 60, 39, 36, 35, 34, 33, 32, 31, 30, 29,
461 28, 27, 26, 25, 19, 18, 17, 16, 14, 13,
462 12, 10, 3, 59, 59, 59, 59, 59, 59, 59,
463 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
464
465 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
466 59, 59, 59, 59, 59, 59
467 } ;
468
469static yy_state_type yy_last_accepting_state;
470static char *yy_last_accepting_cpos;
471
472extern int yy_flex_debug;
473int yy_flex_debug = 0;
474
475/* The intent behind this definition is that it'll catch
476 * any uses of REJECT which flex missed.
477 */
478#define REJECT reject_used_but_not_detected
479#define yymore() yymore_used_but_not_detected
480#define YY_MORE_ADJ 0
481#define YY_RESTORE_YY_MORE_OFFSET
482char *yytext;
483#line 1 "itbl-lex.l"
484/* itbl-lex.l
485 Copyright 1997, 1998, 2001 Free Software Foundation, Inc.
486
487 This file is part of GAS, the GNU Assembler.
488
489 GAS is free software; you can redistribute it and/or modify
490 it under the terms of the GNU General Public License as published by
491 the Free Software Foundation; either version 2, or (at your option)
492 any later version.
493
494 GAS is distributed in the hope that it will be useful,
495 but WITHOUT ANY WARRANTY; without even the implied warranty of
496 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
497 GNU General Public License for more details.
498
499 You should have received a copy of the GNU General Public License
500 along with GAS; see the file COPYING. If not, write to the Free
501 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
502 02111-1307, USA. */
503#line 22 "itbl-lex.l"
504#include <stdio.h>
505#include <string.h>
506#include <stdlib.h>
507
508#include <itbl-parse.h>
509
510#ifdef DEBUG
511#define DBG(x) printf x
512#define MDBG(x) printf x
513#else
514#define DBG(x)
515#define MDBG(x)
516#endif
517
518int insntbl_line = 1;
519#line 520 "lex.yy.c"
520
521#define INITIAL 0
522
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.
526 */
527#include <unistd.h>
528
529#ifndef YY_EXTRA_TYPE
530#define YY_EXTRA_TYPE void *
531#endif
532
533/* Macros after this point can all be overridden by user definitions in
534 * section 1.
535 */
536
537#ifndef YY_SKIP_YYWRAP
538#ifdef __cplusplus
539extern "C" int yywrap (void );
540#else
541extern int yywrap (void );
542#endif
543#endif
544
545 static void yyunput (int c,char *buf_ptr );
546
547#ifndef yytext_ptr
548static void yy_flex_strncpy (char *,yyconst char *,int );
549#endif
550
551#ifdef YY_NEED_STRLEN
552static int yy_flex_strlen (yyconst char * );
553#endif
554
555#ifndef YY_NO_INPUT
556
557#ifdef __cplusplus
558static int yyinput (void );
559#else
560static int input (void );
561#endif
562
563#endif
564
565/* Amount of stuff to slurp up with each read. */
566#ifndef YY_READ_BUF_SIZE
567#define YY_READ_BUF_SIZE 8192
568#endif
569
570/* Copy whatever the last rule matched to the standard output. */
571#ifndef ECHO
572/* This used to be an fputs(), but since the string might contain NUL's,
573 * we now use fwrite().
574 */
575#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
576#endif
577
578/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
579 * is returned in "result".
580 */
581#ifndef YY_INPUT
582#define YY_INPUT(buf,result,max_size) \
583 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
584 { \
585 int c = '*'; \
586 size_t n; \
587 for ( n = 0; n < max_size && \
588 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
589 buf[n] = (char) c; \
590 if ( c == '\n' ) \
591 buf[n++] = (char) c; \
592 if ( c == EOF && ferror( yyin ) ) \
593 YY_FATAL_ERROR( "input in flex scanner failed" ); \
594 result = n; \
595 } \
596 else \
597 { \
598 errno=0; \
599 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
600 { \
601 if( errno != EINTR) \
602 { \
603 YY_FATAL_ERROR( "input in flex scanner failed" ); \
604 break; \
605 } \
606 errno=0; \
607 clearerr(yyin); \
608 } \
609 }\
610\
611
612#endif
613
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.
617 */
618#ifndef yyterminate
619#define yyterminate() return YY_NULL
620#endif
621
622/* Number of entries by which start-condition stack grows. */
623#ifndef YY_START_STACK_INCR
624#define YY_START_STACK_INCR 25
625#endif
626
627/* Report a fatal error. */
628#ifndef YY_FATAL_ERROR
629#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
630#endif
631
632/* end tables serialization structures and prototypes */
633
634/* Default declaration of generated scanner - a define so the user can
635 * easily add parameters.
636 */
637#ifndef YY_DECL
638#define YY_DECL_IS_OURS 1
639
640extern int yylex (void);
641
642#define YY_DECL int yylex (void)
643#endif /* !YY_DECL */
644
645/* Code executed at the beginning of each rule, after yytext and yyleng
646 * have been set up.
647 */
648#ifndef YY_USER_ACTION
649#define YY_USER_ACTION
650#endif
651
652/* Code executed at the end of each rule. */
653#ifndef YY_BREAK
654#define YY_BREAK break;
655#endif
656
657#define YY_RULE_SETUP \
658 YY_USER_ACTION
659
660/** The main scanner function which does all the work.
661 */
662YY_DECL
663{
664 register yy_state_type yy_current_state;
665 register char *yy_cp, *yy_bp;
666 register int yy_act;
667
668#line 44 "itbl-lex.l"
669
670
671#line 672 "lex.yy.c"
672
673 if ( (yy_init) )
674 {
675 (yy_init) = 0;
676
677#ifdef YY_USER_INIT
678 YY_USER_INIT;
679#endif
680
681 if ( ! (yy_start) )
682 (yy_start) = 1; /* first start state */
683
684 if ( ! yyin )
685 yyin = stdin;
686
687 if ( ! yyout )
688 yyout = stdout;
689
690 if ( ! YY_CURRENT_BUFFER ) {
691 yyensure_buffer_stack ();
692 YY_CURRENT_BUFFER_LVALUE =
693 yy_create_buffer(yyin,YY_BUF_SIZE );
694 }
695
696 yy_load_buffer_state( );
697 }
698
699 while ( 1 ) /* loops until end-of-file is reached */
700 {
701 yy_cp = (yy_c_buf_p);
702
703 /* Support of yytext. */
704 *yy_cp = (yy_hold_char);
705
706 /* yy_bp points to the position in yy_ch_buf of the start of
707 * the current run.
708 */
709 yy_bp = yy_cp;
710
711 yy_current_state = (yy_start);
712yy_match:
713 do
714 {
715 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
716 if ( yy_accept[yy_current_state] )
717 {
718 (yy_last_accepting_state) = yy_current_state;
719 (yy_last_accepting_cpos) = yy_cp;
720 }
721 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
722 {
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];
726 }
727 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
728 ++yy_cp;
729 }
730 while ( yy_base[yy_current_state] != 84 );
731
732yy_find_action:
733 yy_act = yy_accept[yy_current_state];
734 if ( yy_act == 0 )
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];
739 }
740
741 YY_DO_BEFORE_ACTION;
742
743do_action: /* This label is used only to access EOF actions. */
744
745 switch ( yy_act )
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);
752 goto yy_find_action;
753
754case 1:
755YY_RULE_SETUP
756#line 46 "itbl-lex.l"
757{
758 return CREG;
759 }
760 YY_BREAK
761case 2:
762YY_RULE_SETUP
763#line 49 "itbl-lex.l"
764{
765 return DREG;
766 }
767 YY_BREAK
768case 3:
769YY_RULE_SETUP
770#line 52 "itbl-lex.l"
771{
772 return GREG;
773 }
774 YY_BREAK
775case 4:
776YY_RULE_SETUP
777#line 55 "itbl-lex.l"
778{
779 return IMMED;
780 }
781 YY_BREAK
782case 5:
783YY_RULE_SETUP
784#line 58 "itbl-lex.l"
785{
786 return ADDR;
787 }
788 YY_BREAK
789case 6:
790YY_RULE_SETUP
791#line 61 "itbl-lex.l"
792{
793 return INSN;
794 }
795 YY_BREAK
796case 7:
797YY_RULE_SETUP
798#line 64 "itbl-lex.l"
799{
800 yytext[yyleng] = 0;
801 yylval.processor = strtoul (yytext+1, 0, 0);
802 return PNUM;
803 }
804 YY_BREAK
805case 8:
806YY_RULE_SETUP
807#line 69 "itbl-lex.l"
808{
809 yytext[yyleng] = 0;
810 yylval.num = strtoul (yytext, 0, 0);
811 return NUM;
812 }
813 YY_BREAK
814case 9:
815YY_RULE_SETUP
816#line 74 "itbl-lex.l"
817{
818 yytext[yyleng] = 0;
819 yylval.num = strtoul (yytext, 0, 0);
820 return NUM;
821 }
822 YY_BREAK
823case 10:
824YY_RULE_SETUP
825#line 79 "itbl-lex.l"
826{
827 yytext[yyleng] = 0;
828 yylval.str = strdup (yytext);
829 return ID;
830 }
831 YY_BREAK
832case 11:
833YY_RULE_SETUP
834#line 84 "itbl-lex.l"
835{
836 int c;
837 while ((c = input ()) != EOF)
838 {
839 if (c == '\n')
840 {
841 unput (c);
842 break;
843 }
844 }
845 }
846 YY_BREAK
847case 12:
848/* rule 12 can match eol */
849YY_RULE_SETUP
850#line 95 "itbl-lex.l"
851{
852 insntbl_line++;
853 MDBG (("in lex, NL = %d (x%x)\n", NL, NL));
854 return NL;
855 }
856 YY_BREAK
857case 13:
858YY_RULE_SETUP
859#line 100 "itbl-lex.l"
860{
861 }
862 YY_BREAK
863case 14:
864YY_RULE_SETUP
865#line 102 "itbl-lex.l"
866{
867 MDBG (("char = %x, %d\n", yytext[0], yytext[0]));
868 return yytext[0];
869 }
870 YY_BREAK
871case 15:
872YY_RULE_SETUP
873#line 106 "itbl-lex.l"
874ECHO;
875 YY_BREAK
876#line 877 "lex.yy.c"
877case YY_STATE_EOF(INITIAL):
878 yyterminate();
879
880 case YY_END_OF_BUFFER:
881 {
882 /* Amount of text matched not including the EOB char. */
883 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
884
885 /* Undo the effects of YY_DO_BEFORE_ACTION. */
886 *yy_cp = (yy_hold_char);
887 YY_RESTORE_YY_MORE_OFFSET
888
889 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
890 {
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.
899 */
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;
903 }
904
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
910 * in input().
911 */
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;
915
916 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
917
918 yy_current_state = yy_get_previous_state( );
919
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).
927 */
928
929 yy_next_state = yy_try_NUL_trans( yy_current_state );
930
931 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
932
933 if ( yy_next_state )
934 {
935 /* Consume the NUL. */
936 yy_cp = ++(yy_c_buf_p);
937 yy_current_state = yy_next_state;
938 goto yy_match;
939 }
940
941 else
942 {
943 yy_cp = (yy_c_buf_p);
944 goto yy_find_action;
945 }
946 }
947
948 else switch ( yy_get_next_buffer( ) )
949 {
950 case EOB_ACT_END_OF_FILE:
951 {
952 (yy_did_buffer_switch_on_eof) = 0;
953
954 if ( yywrap( ) )
955 {
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.
964 */
965 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
966
967 yy_act = YY_STATE_EOF(YY_START);
968 goto do_action;
969 }
970
971 else
972 {
973 if ( ! (yy_did_buffer_switch_on_eof) )
974 YY_NEW_FILE;
975 }
976 break;
977 }
978
979 case EOB_ACT_CONTINUE_SCAN:
980 (yy_c_buf_p) =
981 (yytext_ptr) + yy_amount_of_matched_text;
982
983 yy_current_state = yy_get_previous_state( );
984
985 yy_cp = (yy_c_buf_p);
986 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
987 goto yy_match;
988
989 case EOB_ACT_LAST_MATCH:
990 (yy_c_buf_p) =
991 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
992
993 yy_current_state = yy_get_previous_state( );
994
995 yy_cp = (yy_c_buf_p);
996 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
997 goto yy_find_action;
998 }
999 break;
1000 }
1001
1002 default:
1003 YY_FATAL_ERROR(
1004 "fatal flex scanner internal error--no action found" );
1005 } /* end of action switch */
1006 } /* end of scanning one token */
1007} /* end of yylex */
1008
1009/* yy_get_next_buffer - try to read in a new buffer
1010 *
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
1015 */
1016static int yy_get_next_buffer (void)
1017{
1018 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1019 register char *source = (yytext_ptr);
1020 register int number_to_move, i;
1021 int ret_val;
1022
1023 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1024 YY_FATAL_ERROR(
1025 "fatal flex scanner internal error--end of buffer missed" );
1026
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 )
1030 {
1031 /* We matched a single character, the EOB, so
1032 * treat this as a final EOF.
1033 */
1034 return EOB_ACT_END_OF_FILE;
1035 }
1036
1037 else
1038 {
1039 /* We matched some text prior to the EOB, first
1040 * process it.
1041 */
1042 return EOB_ACT_LAST_MATCH;
1043 }
1044 }
1045
1046 /* Try to read more data. */
1047
1048 /* First move last chars to start of buffer. */
1049 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1050
1051 for ( i = 0; i < number_to_move; ++i )
1052 *(dest++) = *(source++);
1053
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,
1056 * just force an EOF
1057 */
1058 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1059
1060 else
1061 {
1062 size_t num_to_read =
1063 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1064
1065 while ( num_to_read <= 0 )
1066 { /* Not enough room in the buffer - grow it. */
1067
1068 /* just a shorter name for the current buffer */
1069 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1070
1071 int yy_c_buf_p_offset =
1072 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1073
1074 if ( b->yy_is_our_buffer )
1075 {
1076 int new_size = b->yy_buf_size * 2;
1077
1078 if ( new_size <= 0 )
1079 b->yy_buf_size += b->yy_buf_size / 8;
1080 else
1081 b->yy_buf_size *= 2;
1082
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 );
1086 }
1087 else
1088 /* Can't grow it, we don't own it. */
1089 b->yy_ch_buf = 0;
1090
1091 if ( ! b->yy_ch_buf )
1092 YY_FATAL_ERROR(
1093 "fatal error - scanner input buffer overflow" );
1094
1095 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1096
1097 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1098 number_to_move - 1;
1099
1100 }
1101
1102 if ( num_to_read > YY_READ_BUF_SIZE )
1103 num_to_read = YY_READ_BUF_SIZE;
1104
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 );
1108
1109 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1110 }
1111
1112 if ( (yy_n_chars) == 0 )
1113 {
1114 if ( number_to_move == YY_MORE_ADJ )
1115 {
1116 ret_val = EOB_ACT_END_OF_FILE;
1117 yyrestart(yyin );
1118 }
1119
1120 else
1121 {
1122 ret_val = EOB_ACT_LAST_MATCH;
1123 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1124 YY_BUFFER_EOF_PENDING;
1125 }
1126 }
1127
1128 else
1129 ret_val = EOB_ACT_CONTINUE_SCAN;
1130
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;
1134
1135 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1136
1137 return ret_val;
1138}
1139
1140/* yy_get_previous_state - get the state just before the EOB char was reached */
1141
1142 static yy_state_type yy_get_previous_state (void)
1143{
1144 register yy_state_type yy_current_state;
1145 register char *yy_cp;
1146
1147 yy_current_state = (yy_start);
1148
1149 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1150 {
1151 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1152 if ( yy_accept[yy_current_state] )
1153 {
1154 (yy_last_accepting_state) = yy_current_state;
1155 (yy_last_accepting_cpos) = yy_cp;
1156 }
1157 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1158 {
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];
1162 }
1163 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1164 }
1165
1166 return yy_current_state;
1167}
1168
1169/* yy_try_NUL_trans - try to make a transition on the NUL character
1170 *
1171 * synopsis
1172 * next_state = yy_try_NUL_trans( current_state );
1173 */
1174 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1175{
1176 register int yy_is_jam;
1177 register char *yy_cp = (yy_c_buf_p);
1178
1179 register YY_CHAR yy_c = 1;
1180 if ( yy_accept[yy_current_state] )
1181 {
1182 (yy_last_accepting_state) = yy_current_state;
1183 (yy_last_accepting_cpos) = yy_cp;
1184 }
1185 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1186 {
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];
1190 }
1191 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1192 yy_is_jam = (yy_current_state == 59);
1193
1194 return yy_is_jam ? 0 : yy_current_state;
1195}
1196
1197 static void yyunput (int c, register char * yy_bp )
1198{
1199 register char *yy_cp;
1200
1201 yy_cp = (yy_c_buf_p);
1202
1203 /* undo effects of setting up yytext */
1204 *yy_cp = (yy_hold_char);
1205
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];
1214
1215 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1216 *--dest = *--source;
1217
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;
1222
1223 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1224 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1225 }
1226
1227 *--yy_cp = (char) c;
1228
1229 (yytext_ptr) = yy_bp;
1230 (yy_hold_char) = *yy_cp;
1231 (yy_c_buf_p) = yy_cp;
1232}
1233
1234#ifndef YY_NO_INPUT
1235#ifdef __cplusplus
1236 static int yyinput (void)
1237#else
1238 static int input (void)
1239#endif
1240
1241{
1242 int c;
1243
1244 *(yy_c_buf_p) = (yy_hold_char);
1245
1246 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1247 {
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.
1251 */
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';
1255
1256 else
1257 { /* need more input */
1258 int offset = (yy_c_buf_p) - (yytext_ptr);
1259 ++(yy_c_buf_p);
1260
1261 switch ( yy_get_next_buffer( ) )
1262 {
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.
1272 */
1273
1274 /* Reset buffer status. */
1275 yyrestart(yyin );
1276
1277 /*FALLTHROUGH*/
1278
1279 case EOB_ACT_END_OF_FILE:
1280 {
1281 if ( yywrap( ) )
1282 return EOF;
1283
1284 if ( ! (yy_did_buffer_switch_on_eof) )
1285 YY_NEW_FILE;
1286#ifdef __cplusplus
1287 return yyinput();
1288#else
1289 return input();
1290#endif
1291 }
1292
1293 case EOB_ACT_CONTINUE_SCAN:
1294 (yy_c_buf_p) = (yytext_ptr) + offset;
1295 break;
1296 }
1297 }
1298 }
1299
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);
1303
1304 return c;
1305}
1306#endif /* ifndef YY_NO_INPUT */
1307
1308/** Immediately switch to a different input stream.
1309 * @param input_file A readable stream.
1310 *
1311 * @note This function does not reset the start condition to @c INITIAL .
1312 */
1313 void yyrestart (FILE * input_file )
1314{
1315
1316 if ( ! YY_CURRENT_BUFFER ){
1317 yyensure_buffer_stack ();
1318 YY_CURRENT_BUFFER_LVALUE =
1319 yy_create_buffer(yyin,YY_BUF_SIZE );
1320 }
1321
1322 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1323 yy_load_buffer_state( );
1324}
1325
1326/** Switch to a different input buffer.
1327 * @param new_buffer The new input buffer.
1328 *
1329 */
1330 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1331{
1332
1333 /* TODO. We should be able to replace this entire function body
1334 * with
1335 * yypop_buffer_state();
1336 * yypush_buffer_state(new_buffer);
1337 */
1338 yyensure_buffer_stack ();
1339 if ( YY_CURRENT_BUFFER == new_buffer )
1340 return;
1341
1342 if ( YY_CURRENT_BUFFER )
1343 {
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);
1348 }
1349
1350 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1351 yy_load_buffer_state( );
1352
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.
1357 */
1358 (yy_did_buffer_switch_on_eof) = 1;
1359}
1360
1361static void yy_load_buffer_state (void)
1362{
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);
1367}
1368
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.
1372 *
1373 * @return the allocated buffer state.
1374 */
1375 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1376{
1377 YY_BUFFER_STATE b;
1378
1379 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1380 if ( ! b )
1381 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1382
1383 b->yy_buf_size = size;
1384
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.
1387 */
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()" );
1391
1392 b->yy_is_our_buffer = 1;
1393
1394 yy_init_buffer(b,file );
1395
1396 return b;
1397}
1398
1399/** Destroy the buffer.
1400 * @param b a buffer created with yy_create_buffer()
1401 *
1402 */
1403 void yy_delete_buffer (YY_BUFFER_STATE b )
1404{
1405
1406 if ( ! b )
1407 return;
1408
1409 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1410 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1411
1412 if ( b->yy_is_our_buffer )
1413 yyfree((void *) b->yy_ch_buf );
1414
1415 yyfree((void *) b );
1416}
1417
1418#ifndef __cplusplus
1419extern int isatty (int );
1420#endif /* __cplusplus */
1421
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.
1425 */
1426 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1427
1428{
1429 int oerrno = errno;
1430
1431 yy_flush_buffer(b );
1432
1433 b->yy_input_file = file;
1434 b->yy_fill_buffer = 1;
1435
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.
1439 */
1440 if (b != YY_CURRENT_BUFFER){
1441 b->yy_bs_lineno = 1;
1442 b->yy_bs_column = 0;
1443 }
1444
1445 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1446
1447 errno = oerrno;
1448}
1449
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.
1452 *
1453 */
1454 void yy_flush_buffer (YY_BUFFER_STATE b )
1455{
1456 if ( ! b )
1457 return;
1458
1459 b->yy_n_chars = 0;
1460
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.
1464 */
1465 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1466 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1467
1468 b->yy_buf_pos = &b->yy_ch_buf[0];
1469
1470 b->yy_at_bol = 1;
1471 b->yy_buffer_status = YY_BUFFER_NEW;
1472
1473 if ( b == YY_CURRENT_BUFFER )
1474 yy_load_buffer_state( );
1475}
1476
1477/** Pushes the new state onto the stack. The new state becomes
1478 * the current state. This function will allocate the stack
1479 * if necessary.
1480 * @param new_buffer The new state.
1481 *
1482 */
1483void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1484{
1485 if (new_buffer == NULL)
1486 return;
1487
1488 yyensure_buffer_stack();
1489
1490 /* This block is copied from yy_switch_to_buffer. */
1491 if ( YY_CURRENT_BUFFER )
1492 {
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);
1497 }
1498
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;
1503
1504 /* copied from yy_switch_to_buffer. */
1505 yy_load_buffer_state( );
1506 (yy_did_buffer_switch_on_eof) = 1;
1507}
1508
1509/** Removes and deletes the top of the stack, if present.
1510 * The next element becomes the new top.
1511 *
1512 */
1513void yypop_buffer_state (void)
1514{
1515 if (!YY_CURRENT_BUFFER)
1516 return;
1517
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);
1522
1523 if (YY_CURRENT_BUFFER) {
1524 yy_load_buffer_state( );
1525 (yy_did_buffer_switch_on_eof) = 1;
1526 }
1527}
1528
1529/* Allocates the stack if it does not exist.
1530 * Guarantees space for at least one push.
1531 */
1532static void yyensure_buffer_stack (void)
1533{
1534 int num_to_alloc;
1535
1536 if (!(yy_buffer_stack)) {
1537
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.
1541 */
1542 num_to_alloc = 1;
1543 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1544 (num_to_alloc * sizeof(struct yy_buffer_state*)
1545 );
1546
1547 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1548
1549 (yy_buffer_stack_max) = num_to_alloc;
1550 (yy_buffer_stack_top) = 0;
1551 return;
1552 }
1553
1554 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1555
1556 /* Increase the buffer to prepare for a possible push. */
1557 int grow_size = 8 /* arbitrary grow size */;
1558
1559 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1560 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1561 ((yy_buffer_stack),
1562 num_to_alloc * sizeof(struct yy_buffer_state*)
1563 );
1564
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;
1568 }
1569}
1570
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
1574 *
1575 * @return the newly allocated buffer state object.
1576 */
1577YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1578{
1579 YY_BUFFER_STATE b;
1580
1581 if ( size < 2 ||
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. */
1585 return 0;
1586
1587 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1588 if ( ! b )
1589 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1590
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;
1597 b->yy_at_bol = 1;
1598 b->yy_fill_buffer = 0;
1599 b->yy_buffer_status = YY_BUFFER_NEW;
1600
1601 yy_switch_to_buffer(b );
1602
1603 return b;
1604}
1605
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
1609 *
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.
1613 */
1614YY_BUFFER_STATE yy_scan_string (yyconst char * str )
1615{
1616
1617 return yy_scan_bytes(str,strlen(str) );
1618}
1619
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.
1624 *
1625 * @return the newly allocated buffer state object.
1626 */
1627YY_BUFFER_STATE yy_scan_bytes (yyconst char * bytes, int len )
1628{
1629 YY_BUFFER_STATE b;
1630 char *buf;
1631 yy_size_t n;
1632 int i;
1633
1634 /* Get memory for full buffer, including space for trailing EOB's. */
1635 n = len + 2;
1636 buf = (char *) yyalloc(n );
1637 if ( ! buf )
1638 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1639
1640 for ( i = 0; i < len; ++i )
1641 buf[i] = bytes[i];
1642
1643 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1644
1645 b = yy_scan_buffer(buf,n );
1646 if ( ! b )
1647 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1648
1649 /* It's okay to grow etc. this buffer, and we should throw it
1650 * away when we're done.
1651 */
1652 b->yy_is_our_buffer = 1;
1653
1654 return b;
1655}
1656
1657#ifndef YY_EXIT_FAILURE
1658#define YY_EXIT_FAILURE 2
1659#endif
1660
1661static void yy_fatal_error (yyconst char* msg )
1662{
1663 (void) fprintf( stderr, "%s\n", msg );
1664 exit( YY_EXIT_FAILURE );
1665}
1666
1667/* Redefine yyless() so it works in section 3 code. */
1668
1669#undef yyless
1670#define yyless(n) \
1671 do \
1672 { \
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; \
1681 } \
1682 while ( 0 )
1683
1684/* Accessor methods (get/set functions) to struct members. */
1685
1686/** Get the current line number.
1687 *
1688 */
1689int yyget_lineno (void)
1690{
1691
1692 return yylineno;
1693}
1694
1695/** Get the input stream.
1696 *
1697 */
1698FILE *yyget_in (void)
1699{
1700 return yyin;
1701}
1702
1703/** Get the output stream.
1704 *
1705 */
1706FILE *yyget_out (void)
1707{
1708 return yyout;
1709}
1710
1711/** Get the length of the current token.
1712 *
1713 */
1714int yyget_leng (void)
1715{
1716 return yyleng;
1717}
1718
1719/** Get the current token.
1720 *
1721 */
1722
1723char *yyget_text (void)
1724{
1725 return yytext;
1726}
1727
1728/** Set the current line number.
1729 * @param line_number
1730 *
1731 */
1732void yyset_lineno (int line_number )
1733{
1734
1735 yylineno = line_number;
1736}
1737
1738/** Set the input stream. This does not discard the current
1739 * input buffer.
1740 * @param in_str A readable stream.
1741 *
1742 * @see yy_switch_to_buffer
1743 */
1744void yyset_in (FILE * in_str )
1745{
1746 yyin = in_str ;
1747}
1748
1749void yyset_out (FILE * out_str )
1750{
1751 yyout = out_str ;
1752}
1753
1754int yyget_debug (void)
1755{
1756 return yy_flex_debug;
1757}
1758
1759void yyset_debug (int bdebug )
1760{
1761 yy_flex_debug = bdebug ;
1762}
1763
1764/* yylex_destroy is for both reentrant and non-reentrant scanners. */
1765int yylex_destroy (void)
1766{
1767
1768 /* Pop the buffer stack, destroying each element. */
1769 while(YY_CURRENT_BUFFER){
1770 yy_delete_buffer(YY_CURRENT_BUFFER );
1771 YY_CURRENT_BUFFER_LVALUE = NULL;
1772 yypop_buffer_state();
1773 }
1774
1775 /* Destroy the stack itself. */
1776 yyfree((yy_buffer_stack) );
1777 (yy_buffer_stack) = NULL;
1778
1779 return 0;
1780}
1781
1782/*
1783 * Internal utility routines.
1784 */
1785
1786#ifndef yytext_ptr
1787static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1788{
1789 register int i;
1790 for ( i = 0; i < n; ++i )
1791 s1[i] = s2[i];
1792}
1793#endif
1794
1795#ifdef YY_NEED_STRLEN
1796static int yy_flex_strlen (yyconst char * s )
1797{
1798 register int n;
1799 for ( n = 0; s[n]; ++n )
1800 ;
1801
1802 return n;
1803}
1804#endif
1805
1806void *yyalloc (yy_size_t size )
1807{
1808 return (void *) malloc( size );
1809}
1810
1811void *yyrealloc (void * ptr, yy_size_t size )
1812{
1813 /* The cast to (char *) in the following accommodates both
1814 * implementations that use char* generic pointers, and those
1815 * that use void* generic pointers. It works with the latter
1816 * because both ANSI C and C++ allow castless assignment from
1817 * any pointer type to void*, and deal with argument conversions
1818 * as though doing an assignment.
1819 */
1820 return (void *) realloc( (char *) ptr, size );
1821}
1822
1823void yyfree (void * ptr )
1824{
1825 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
1826}
1827
1828#define YYTABLES_NAME "yytables"
1829
1830#undef YY_NEW_FILE
1831#undef YY_FLUSH_BUFFER
1832#undef yy_set_bol
1833#undef yy_new_buffer
1834#undef yy_set_interactive
1835#undef yytext_ptr
1836#undef YY_DO_BEFORE_ACTION
1837
1838#ifdef YY_DECL_IS_OURS
1839#undef YY_DECL_IS_OURS
1840#undef YY_DECL
1841#endif
1842#line 106 "itbl-lex.l"
1843
1844
1845
1846#ifndef yywrap
1847int
1848yywrap ()
1849 {
1850 return 1;
1851 }
1852#endif
1853
Note: See TracBrowser for help on using the repository browser.