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

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

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 39.9 KB
Line 
1/* A lexical scanner generated by flex */
2
3/* Scanner skeleton version:
4 * $Header: /cvs/src/src/gas/Attic/itbl-lex.c,v 1.1.4.2 2001/06/10 15:37:28 pb Exp $
5 */
6
7#define FLEX_SCANNER
8#define YY_FLEX_MAJOR_VERSION 2
9#define YY_FLEX_MINOR_VERSION 5
10
11#include <stdio.h>
12
13
14/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
15#ifdef c_plusplus
16#ifndef __cplusplus
17#define __cplusplus
18#endif
19#endif
20
21
22#ifdef __cplusplus
23
24#include <stdlib.h>
25#include <unistd.h>
26
27/* Use prototypes in function declarations. */
28#define YY_USE_PROTOS
29
30/* The "const" storage-class-modifier is valid. */
31#define YY_USE_CONST
32
33#else /* ! __cplusplus */
34
35#if __STDC__
36
37#define YY_USE_PROTOS
38#define YY_USE_CONST
39
40#endif /* __STDC__ */
41#endif /* ! __cplusplus */
42
43#ifdef __TURBOC__
44 #pragma warn -rch
45 #pragma warn -use
46#include <io.h>
47#include <stdlib.h>
48#define YY_USE_CONST
49#define YY_USE_PROTOS
50#endif
51
52#ifdef YY_USE_CONST
53#define yyconst const
54#else
55#define yyconst
56#endif
57
58
59#ifdef YY_USE_PROTOS
60#define YY_PROTO(proto) proto
61#else
62#define YY_PROTO(proto) ()
63#endif
64
65/* Returned upon end-of-file. */
66#define YY_NULL 0
67
68/* Promotes a possibly negative, possibly signed char to an unsigned
69 * integer for use as an array index. If the signed char is negative,
70 * we want to instead treat it as an 8-bit unsigned char, hence the
71 * double cast.
72 */
73#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
74
75/* Enter a start condition. This macro really ought to take a parameter,
76 * but we do it the disgusting crufty way forced on us by the ()-less
77 * definition of BEGIN.
78 */
79#define BEGIN yy_start = 1 + 2 *
80
81/* Translate the current start state into a value that can be later handed
82 * to BEGIN to return to the state. The YYSTATE alias is for lex
83 * compatibility.
84 */
85#define YY_START ((yy_start - 1) / 2)
86#define YYSTATE YY_START
87
88/* Action number for EOF rule of a given start state. */
89#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
90
91/* Special action meaning "start processing a new file". */
92#define YY_NEW_FILE yyrestart( yyin )
93
94#define YY_END_OF_BUFFER_CHAR 0
95
96/* Size of default input buffer. */
97#define YY_BUF_SIZE 16384
98
99typedef struct yy_buffer_state *YY_BUFFER_STATE;
100
101extern int yyleng;
102extern FILE *yyin, *yyout;
103
104#define EOB_ACT_CONTINUE_SCAN 0
105#define EOB_ACT_END_OF_FILE 1
106#define EOB_ACT_LAST_MATCH 2
107
108/* The funky do-while in the following #define is used to turn the definition
109 * int a single C statement (which needs a semi-colon terminator). This
110 * avoids problems with code like:
111 *
112 * if ( condition_holds )
113 * yyless( 5 );
114 * else
115 * do_something_else();
116 *
117 * Prior to using the do-while the compiler would get upset at the
118 * "else" because it interpreted the "if" statement as being all
119 * done when it reached the ';' after the yyless() call.
120 */
121
122/* Return all but the first 'n' matched characters back to the input stream. */
123
124#define yyless(n) \
125 do \
126 { \
127 /* Undo effects of setting up yytext. */ \
128 *yy_cp = yy_hold_char; \
129 YY_RESTORE_YY_MORE_OFFSET \
130 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
131 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
132 } \
133 while ( 0 )
134
135#define unput(c) yyunput( c, yytext_ptr )
136
137/* The following is because we cannot portably get our hands on size_t
138 * (without autoconf's help, which isn't available because we want
139 * flex-generated scanners to compile on their own).
140 */
141typedef unsigned int yy_size_t;
142
143
144struct yy_buffer_state
145 {
146 FILE *yy_input_file;
147
148 char *yy_ch_buf; /* input buffer */
149 char *yy_buf_pos; /* current position in input buffer */
150
151 /* Size of input buffer in bytes, not including room for EOB
152 * characters.
153 */
154 yy_size_t yy_buf_size;
155
156 /* Number of characters read into yy_ch_buf, not including EOB
157 * characters.
158 */
159 int yy_n_chars;
160
161 /* Whether we "own" the buffer - i.e., we know we created it,
162 * and can realloc() it to grow it, and should free() it to
163 * delete it.
164 */
165 int yy_is_our_buffer;
166
167 /* Whether this is an "interactive" input source; if so, and
168 * if we're using stdio for input, then we want to use getc()
169 * instead of fread(), to make sure we stop fetching input after
170 * each newline.
171 */
172 int yy_is_interactive;
173
174 /* Whether we're considered to be at the beginning of a line.
175 * If so, '^' rules will be active on the next match, otherwise
176 * not.
177 */
178 int yy_at_bol;
179
180 /* Whether to try to fill the input buffer when we reach the
181 * end of it.
182 */
183 int yy_fill_buffer;
184
185 int yy_buffer_status;
186#define YY_BUFFER_NEW 0
187#define YY_BUFFER_NORMAL 1
188 /* When an EOF's been seen but there's still some text to process
189 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
190 * shouldn't try reading from the input source any more. We might
191 * still have a bunch of tokens to match, though, because of
192 * possible backing-up.
193 *
194 * When we actually see the EOF, we change the status to "new"
195 * (via yyrestart()), so that the user can continue scanning by
196 * just pointing yyin at a new input file.
197 */
198#define YY_BUFFER_EOF_PENDING 2
199 };
200
201static YY_BUFFER_STATE yy_current_buffer = 0;
202
203/* We provide macros for accessing buffer states in case in the
204 * future we want to put the buffer states in a more general
205 * "scanner state".
206 */
207#define YY_CURRENT_BUFFER yy_current_buffer
208
209
210/* yy_hold_char holds the character lost when yytext is formed. */
211static char yy_hold_char;
212
213static int yy_n_chars; /* number of characters read into yy_ch_buf */
214
215
216int yyleng;
217
218/* Points to current character in buffer. */
219static char *yy_c_buf_p = (char *) 0;
220static int yy_init = 1; /* whether we need to initialize */
221static int yy_start = 0; /* start state number */
222
223/* Flag which is used to allow yywrap()'s to do buffer switches
224 * instead of setting up a fresh yyin. A bit of a hack ...
225 */
226static int yy_did_buffer_switch_on_eof;
227
228void yyrestart YY_PROTO(( FILE *input_file ));
229
230void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
231void yy_load_buffer_state YY_PROTO(( void ));
232YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
233void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
234void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
235void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
236#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
237
238YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
239YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
240YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
241
242static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
243static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
244static void yy_flex_free YY_PROTO(( void * ));
245
246#define yy_new_buffer yy_create_buffer
247
248#define yy_set_interactive(is_interactive) \
249 { \
250 if ( ! yy_current_buffer ) \
251 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
252 yy_current_buffer->yy_is_interactive = is_interactive; \
253 }
254
255#define yy_set_bol(at_bol) \
256 { \
257 if ( ! yy_current_buffer ) \
258 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
259 yy_current_buffer->yy_at_bol = at_bol; \
260 }
261
262#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
263
264typedef unsigned char YY_CHAR;
265FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
266typedef int yy_state_type;
267extern char *yytext;
268#define yytext_ptr yytext
269
270static yy_state_type yy_get_previous_state YY_PROTO(( void ));
271static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
272static int yy_get_next_buffer YY_PROTO(( void ));
273static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
274
275/* Done after the current pattern has been matched and before the
276 * corresponding action - sets up yytext.
277 */
278#define YY_DO_BEFORE_ACTION \
279 yytext_ptr = yy_bp; \
280 yyleng = (int) (yy_cp - yy_bp); \
281 yy_hold_char = *yy_cp; \
282 *yy_cp = '\0'; \
283 yy_c_buf_p = yy_cp;
284
285#define YY_NUM_RULES 15
286#define YY_END_OF_BUFFER 16
287static yyconst short int yy_accept[60] =
288 { 0,
289 0, 0, 16, 14, 13, 12, 11, 8, 8, 10,
290 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
291 10, 8, 0, 10, 10, 10, 10, 10, 10, 10,
292 10, 10, 10, 10, 10, 10, 7, 9, 10, 10,
293 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
294 5, 1, 2, 3, 10, 6, 10, 4, 0
295 } ;
296
297static yyconst int yy_ec[256] =
298 { 0,
299 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
300 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
301 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
302 1, 4, 1, 1, 5, 1, 1, 1, 1, 1,
303 1, 1, 1, 1, 1, 1, 1, 6, 7, 7,
304 7, 7, 7, 7, 7, 7, 7, 1, 8, 1,
305 1, 1, 1, 1, 9, 10, 11, 12, 13, 10,
306 14, 15, 16, 15, 15, 15, 17, 18, 15, 15,
307 15, 19, 20, 15, 15, 15, 15, 15, 15, 15,
308 1, 1, 1, 1, 15, 1, 21, 10, 22, 23,
309
310 24, 10, 25, 15, 26, 15, 15, 15, 27, 28,
311 15, 29, 15, 30, 31, 15, 15, 15, 15, 32,
312 15, 15, 1, 1, 1, 1, 1, 1, 1, 1,
313 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
314 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
315 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
316 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
317 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
318 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
319 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
320
321 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
322 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
323 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
324 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
325 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
326 1, 1, 1, 1, 1
327 } ;
328
329static yyconst int yy_meta[33] =
330 { 0,
331 1, 1, 1, 1, 1, 2, 2, 1, 2, 2,
332 2, 2, 2, 3, 3, 3, 3, 3, 3, 3,
333 2, 2, 2, 2, 3, 3, 3, 3, 3, 3,
334 3, 3
335 } ;
336
337static yyconst short int yy_base[62] =
338 { 0,
339 0, 0, 83, 84, 84, 84, 84, 27, 29, 70,
340 0, 62, 61, 60, 20, 55, 47, 46, 45, 12,
341 35, 37, 0, 0, 62, 60, 59, 58, 53, 49,
342 45, 43, 42, 41, 37, 32, 0, 0, 43, 44,
343 43, 42, 42, 36, 23, 27, 26, 25, 25, 20,
344 0, 0, 0, 0, 35, 0, 23, 0, 84, 58,
345 43
346 } ;
347
348static yyconst short int yy_def[62] =
349 { 0,
350 59, 1, 59, 59, 59, 59, 59, 59, 59, 60,
351 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
352 60, 59, 61, 60, 60, 60, 60, 60, 60, 60,
353 60, 60, 60, 60, 60, 60, 60, 61, 60, 60,
354 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
355 60, 60, 60, 60, 60, 60, 60, 60, 0, 59,
356 59
357 } ;
358
359static yyconst short int yy_nxt[117] =
360 { 0,
361 4, 5, 6, 5, 7, 8, 9, 7, 10, 11,
362 12, 13, 11, 14, 11, 15, 11, 11, 11, 11,
363 16, 17, 18, 11, 19, 20, 11, 11, 21, 11,
364 11, 11, 22, 22, 22, 22, 29, 30, 35, 36,
365 37, 37, 22, 22, 38, 58, 58, 56, 57, 54,
366 53, 52, 51, 56, 55, 54, 53, 52, 23, 24,
367 24, 51, 50, 49, 48, 47, 46, 45, 44, 43,
368 42, 41, 40, 39, 34, 33, 32, 31, 28, 27,
369 26, 25, 59, 3, 59, 59, 59, 59, 59, 59,
370 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
371
372 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
373 59, 59, 59, 59, 59, 59
374 } ;
375
376static yyconst short int yy_chk[117] =
377 { 0,
378 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
379 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
380 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
381 1, 1, 8, 8, 9, 9, 15, 15, 20, 20,
382 21, 21, 22, 22, 61, 57, 55, 50, 49, 48,
383 47, 46, 45, 44, 43, 42, 41, 40, 8, 60,
384 60, 39, 36, 35, 34, 33, 32, 31, 30, 29,
385 28, 27, 26, 25, 19, 18, 17, 16, 14, 13,
386 12, 10, 3, 59, 59, 59, 59, 59, 59, 59,
387 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
388
389 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
390 59, 59, 59, 59, 59, 59
391 } ;
392
393static yy_state_type yy_last_accepting_state;
394static char *yy_last_accepting_cpos;
395
396/* The intent behind this definition is that it'll catch
397 * any uses of REJECT which flex missed.
398 */
399#define REJECT reject_used_but_not_detected
400#define yymore() yymore_used_but_not_detected
401#define YY_MORE_ADJ 0
402#define YY_RESTORE_YY_MORE_OFFSET
403char *yytext;
404#line 1 "itbl-lex.l"
405#define INITIAL 0
406/* itbl-lex.l
407 Copyright 1997, 1998 Free Software Foundation, Inc.
408
409 This file is part of GAS, the GNU Assembler.
410
411 GAS is free software; you can redistribute it and/or modify
412 it under the terms of the GNU General Public License as published by
413 the Free Software Foundation; either version 2, or (at your option)
414 any later version.
415
416 GAS is distributed in the hope that it will be useful,
417 but WITHOUT ANY WARRANTY; without even the implied warranty of
418 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
419 GNU General Public License for more details.
420
421 You should have received a copy of the GNU General Public License
422 along with GAS; see the file COPYING. If not, write to the Free
423 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
424 02111-1307, USA. */
425#line 22 "itbl-lex.l"
426#include <stdio.h>
427#include <string.h>
428#include <stdlib.h>
429#include <ctype.h>
430#include "itbl-parse.h"
431
432#ifdef DEBUG
433#define DBG(x) printf x
434#define MDBG(x) printf x
435#else
436#define DBG(x)
437#define MDBG(x)
438#endif
439
440int insntbl_line = 1;
441#line 442 "lex.yy.c"
442
443/* Macros after this point can all be overridden by user definitions in
444 * section 1.
445 */
446
447#ifndef YY_SKIP_YYWRAP
448#ifdef __cplusplus
449extern "C" int yywrap YY_PROTO(( void ));
450#else
451extern int yywrap YY_PROTO(( void ));
452#endif
453#endif
454
455#ifndef YY_NO_UNPUT
456static void yyunput YY_PROTO(( int c, char *buf_ptr ));
457#endif
458
459#ifndef yytext_ptr
460static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
461#endif
462
463#ifdef YY_NEED_STRLEN
464static int yy_flex_strlen YY_PROTO(( yyconst char * ));
465#endif
466
467#ifndef YY_NO_INPUT
468#ifdef __cplusplus
469static int yyinput YY_PROTO(( void ));
470#else
471static int input YY_PROTO(( void ));
472#endif
473#endif
474
475#if YY_STACK_USED
476static int yy_start_stack_ptr = 0;
477static int yy_start_stack_depth = 0;
478static int *yy_start_stack = 0;
479#ifndef YY_NO_PUSH_STATE
480static void yy_push_state YY_PROTO(( int new_state ));
481#endif
482#ifndef YY_NO_POP_STATE
483static void yy_pop_state YY_PROTO(( void ));
484#endif
485#ifndef YY_NO_TOP_STATE
486static int yy_top_state YY_PROTO(( void ));
487#endif
488
489#else
490#define YY_NO_PUSH_STATE 1
491#define YY_NO_POP_STATE 1
492#define YY_NO_TOP_STATE 1
493#endif
494
495#ifdef YY_MALLOC_DECL
496YY_MALLOC_DECL
497#else
498#if __STDC__
499#ifndef __cplusplus
500#include <stdlib.h>
501#endif
502#else
503/* Just try to get by without declaring the routines. This will fail
504 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
505 * or sizeof(void*) != sizeof(int).
506 */
507#endif
508#endif
509
510/* Amount of stuff to slurp up with each read. */
511#ifndef YY_READ_BUF_SIZE
512#define YY_READ_BUF_SIZE 8192
513#endif
514
515/* Copy whatever the last rule matched to the standard output. */
516
517#ifndef ECHO
518/* This used to be an fputs(), but since the string might contain NUL's,
519 * we now use fwrite().
520 */
521#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
522#endif
523
524/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
525 * is returned in "result".
526 */
527#ifndef YY_INPUT
528#define YY_INPUT(buf,result,max_size) \
529 if ( yy_current_buffer->yy_is_interactive ) \
530 { \
531 int c = '*', n; \
532 for ( n = 0; n < max_size && \
533 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
534 buf[n] = (char) c; \
535 if ( c == '\n' ) \
536 buf[n++] = (char) c; \
537 if ( c == EOF && ferror( yyin ) ) \
538 YY_FATAL_ERROR( "input in flex scanner failed" ); \
539 result = n; \
540 } \
541 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
542 && ferror( yyin ) ) \
543 YY_FATAL_ERROR( "input in flex scanner failed" );
544#endif
545
546/* No semi-colon after return; correct usage is to write "yyterminate();" -
547 * we don't want an extra ';' after the "return" because that will cause
548 * some compilers to complain about unreachable statements.
549 */
550#ifndef yyterminate
551#define yyterminate() return YY_NULL
552#endif
553
554/* Number of entries by which start-condition stack grows. */
555#ifndef YY_START_STACK_INCR
556#define YY_START_STACK_INCR 25
557#endif
558
559/* Report a fatal error. */
560#ifndef YY_FATAL_ERROR
561#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
562#endif
563
564/* Default declaration of generated scanner - a define so the user can
565 * easily add parameters.
566 */
567#ifndef YY_DECL
568#define YY_DECL int yylex YY_PROTO(( void ))
569#endif
570
571/* Code executed at the beginning of each rule, after yytext and yyleng
572 * have been set up.
573 */
574#ifndef YY_USER_ACTION
575#define YY_USER_ACTION
576#endif
577
578/* Code executed at the end of each rule. */
579#ifndef YY_BREAK
580#define YY_BREAK break;
581#endif
582
583#define YY_RULE_SETUP \
584 YY_USER_ACTION
585
586YY_DECL
587 {
588 register yy_state_type yy_current_state;
589 register char *yy_cp, *yy_bp;
590 register int yy_act;
591
592#line 44 "itbl-lex.l"
593
594
595#line 596 "lex.yy.c"
596
597 if ( yy_init )
598 {
599 yy_init = 0;
600
601#ifdef YY_USER_INIT
602 YY_USER_INIT;
603#endif
604
605 if ( ! yy_start )
606 yy_start = 1; /* first start state */
607
608 if ( ! yyin )
609 yyin = stdin;
610
611 if ( ! yyout )
612 yyout = stdout;
613
614 if ( ! yy_current_buffer )
615 yy_current_buffer =
616 yy_create_buffer( yyin, YY_BUF_SIZE );
617
618 yy_load_buffer_state();
619 }
620
621 while ( 1 ) /* loops until end-of-file is reached */
622 {
623 yy_cp = yy_c_buf_p;
624
625 /* Support of yytext. */
626 *yy_cp = yy_hold_char;
627
628 /* yy_bp points to the position in yy_ch_buf of the start of
629 * the current run.
630 */
631 yy_bp = yy_cp;
632
633 yy_current_state = yy_start;
634yy_match:
635 do
636 {
637 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
638 if ( yy_accept[yy_current_state] )
639 {
640 yy_last_accepting_state = yy_current_state;
641 yy_last_accepting_cpos = yy_cp;
642 }
643 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
644 {
645 yy_current_state = (int) yy_def[yy_current_state];
646 if ( yy_current_state >= 60 )
647 yy_c = yy_meta[(unsigned int) yy_c];
648 }
649 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
650 ++yy_cp;
651 }
652 while ( yy_base[yy_current_state] != 84 );
653
654yy_find_action:
655 yy_act = yy_accept[yy_current_state];
656 if ( yy_act == 0 )
657 { /* have to back up */
658 yy_cp = yy_last_accepting_cpos;
659 yy_current_state = yy_last_accepting_state;
660 yy_act = yy_accept[yy_current_state];
661 }
662
663 YY_DO_BEFORE_ACTION;
664
665
666do_action: /* This label is used only to access EOF actions. */
667
668
669 switch ( yy_act )
670 { /* beginning of action switch */
671 case 0: /* must back up */
672 /* undo the effects of YY_DO_BEFORE_ACTION */
673 *yy_cp = yy_hold_char;
674 yy_cp = yy_last_accepting_cpos;
675 yy_current_state = yy_last_accepting_state;
676 goto yy_find_action;
677
678case 1:
679YY_RULE_SETUP
680#line 46 "itbl-lex.l"
681{
682 return CREG;
683 }
684 YY_BREAK
685case 2:
686YY_RULE_SETUP
687#line 49 "itbl-lex.l"
688{
689 return DREG;
690 }
691 YY_BREAK
692case 3:
693YY_RULE_SETUP
694#line 52 "itbl-lex.l"
695{
696 return GREG;
697 }
698 YY_BREAK
699case 4:
700YY_RULE_SETUP
701#line 55 "itbl-lex.l"
702{
703 return IMMED;
704 }
705 YY_BREAK
706case 5:
707YY_RULE_SETUP
708#line 58 "itbl-lex.l"
709{
710 return ADDR;
711 }
712 YY_BREAK
713case 6:
714YY_RULE_SETUP
715#line 61 "itbl-lex.l"
716{
717 return INSN;
718 }
719 YY_BREAK
720case 7:
721YY_RULE_SETUP
722#line 64 "itbl-lex.l"
723{
724 yytext[yyleng] = 0;
725 yylval.processor = strtoul (yytext+1, 0, 0);
726 return PNUM;
727 }
728 YY_BREAK
729case 8:
730YY_RULE_SETUP
731#line 69 "itbl-lex.l"
732{
733 yytext[yyleng] = 0;
734 yylval.num = strtoul (yytext, 0, 0);
735 return NUM;
736 }
737 YY_BREAK
738case 9:
739YY_RULE_SETUP
740#line 74 "itbl-lex.l"
741{
742 yytext[yyleng] = 0;
743 yylval.num = strtoul (yytext, 0, 0);
744 return NUM;
745 }
746 YY_BREAK
747case 10:
748YY_RULE_SETUP
749#line 79 "itbl-lex.l"
750{
751 yytext[yyleng] = 0;
752 yylval.str = strdup (yytext);
753 return ID;
754 }
755 YY_BREAK
756case 11:
757YY_RULE_SETUP
758#line 84 "itbl-lex.l"
759{
760 int c;
761 while ((c = input ()) != EOF)
762 {
763 if (c == '\n')
764 {
765 unput (c);
766 break;
767 }
768 }
769 }
770 YY_BREAK
771case 12:
772YY_RULE_SETUP
773#line 95 "itbl-lex.l"
774{
775 insntbl_line++;
776 MDBG (("in lex, NL = %d (x%x)\n", NL, NL));
777 return NL;
778 }
779 YY_BREAK
780case 13:
781YY_RULE_SETUP
782#line 100 "itbl-lex.l"
783{
784 }
785 YY_BREAK
786case 14:
787YY_RULE_SETUP
788#line 102 "itbl-lex.l"
789{
790 MDBG (("char = %x, %d\n", yytext[0], yytext[0]));
791 return yytext[0];
792 }
793 YY_BREAK
794case 15:
795YY_RULE_SETUP
796#line 106 "itbl-lex.l"
797ECHO;
798 YY_BREAK
799#line 800 "lex.yy.c"
800case YY_STATE_EOF(INITIAL):
801 yyterminate();
802
803 case YY_END_OF_BUFFER:
804 {
805 /* Amount of text matched not including the EOB char. */
806 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
807
808 /* Undo the effects of YY_DO_BEFORE_ACTION. */
809 *yy_cp = yy_hold_char;
810 YY_RESTORE_YY_MORE_OFFSET
811
812 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
813 {
814 /* We're scanning a new file or input source. It's
815 * possible that this happened because the user
816 * just pointed yyin at a new source and called
817 * yylex(). If so, then we have to assure
818 * consistency between yy_current_buffer and our
819 * globals. Here is the right place to do so, because
820 * this is the first action (other than possibly a
821 * back-up) that will match for the new input source.
822 */
823 yy_n_chars = yy_current_buffer->yy_n_chars;
824 yy_current_buffer->yy_input_file = yyin;
825 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
826 }
827
828 /* Note that here we test for yy_c_buf_p "<=" to the position
829 * of the first EOB in the buffer, since yy_c_buf_p will
830 * already have been incremented past the NUL character
831 * (since all states make transitions on EOB to the
832 * end-of-buffer state). Contrast this with the test
833 * in input().
834 */
835 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
836 { /* This was really a NUL. */
837 yy_state_type yy_next_state;
838
839 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
840
841 yy_current_state = yy_get_previous_state();
842
843 /* Okay, we're now positioned to make the NUL
844 * transition. We couldn't have
845 * yy_get_previous_state() go ahead and do it
846 * for us because it doesn't know how to deal
847 * with the possibility of jamming (and we don't
848 * want to build jamming into it because then it
849 * will run more slowly).
850 */
851
852 yy_next_state = yy_try_NUL_trans( yy_current_state );
853
854 yy_bp = yytext_ptr + YY_MORE_ADJ;
855
856 if ( yy_next_state )
857 {
858 /* Consume the NUL. */
859 yy_cp = ++yy_c_buf_p;
860 yy_current_state = yy_next_state;
861 goto yy_match;
862 }
863
864 else
865 {
866 yy_cp = yy_c_buf_p;
867 goto yy_find_action;
868 }
869 }
870
871 else switch ( yy_get_next_buffer() )
872 {
873 case EOB_ACT_END_OF_FILE:
874 {
875 yy_did_buffer_switch_on_eof = 0;
876
877 if ( yywrap() )
878 {
879 /* Note: because we've taken care in
880 * yy_get_next_buffer() to have set up
881 * yytext, we can now set up
882 * yy_c_buf_p so that if some total
883 * hoser (like flex itself) wants to
884 * call the scanner after we return the
885 * YY_NULL, it'll still work - another
886 * YY_NULL will get returned.
887 */
888 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
889
890 yy_act = YY_STATE_EOF(YY_START);
891 goto do_action;
892 }
893
894 else
895 {
896 if ( ! yy_did_buffer_switch_on_eof )
897 YY_NEW_FILE;
898 }
899 break;
900 }
901
902 case EOB_ACT_CONTINUE_SCAN:
903 yy_c_buf_p =
904 yytext_ptr + yy_amount_of_matched_text;
905
906 yy_current_state = yy_get_previous_state();
907
908 yy_cp = yy_c_buf_p;
909 yy_bp = yytext_ptr + YY_MORE_ADJ;
910 goto yy_match;
911
912 case EOB_ACT_LAST_MATCH:
913 yy_c_buf_p =
914 &yy_current_buffer->yy_ch_buf[yy_n_chars];
915
916 yy_current_state = yy_get_previous_state();
917
918 yy_cp = yy_c_buf_p;
919 yy_bp = yytext_ptr + YY_MORE_ADJ;
920 goto yy_find_action;
921 }
922 break;
923 }
924
925 default:
926 YY_FATAL_ERROR(
927 "fatal flex scanner internal error--no action found" );
928 } /* end of action switch */
929 } /* end of scanning one token */
930 } /* end of yylex */
931
932
933/* yy_get_next_buffer - try to read in a new buffer
934 *
935 * Returns a code representing an action:
936 * EOB_ACT_LAST_MATCH -
937 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
938 * EOB_ACT_END_OF_FILE - end of file
939 */
940
941static int yy_get_next_buffer()
942 {
943 register char *dest = yy_current_buffer->yy_ch_buf;
944 register char *source = yytext_ptr;
945 register int number_to_move, i;
946 int ret_val;
947
948 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
949 YY_FATAL_ERROR(
950 "fatal flex scanner internal error--end of buffer missed" );
951
952 if ( yy_current_buffer->yy_fill_buffer == 0 )
953 { /* Don't try to fill the buffer, so this is an EOF. */
954 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
955 {
956 /* We matched a single character, the EOB, so
957 * treat this as a final EOF.
958 */
959 return EOB_ACT_END_OF_FILE;
960 }
961
962 else
963 {
964 /* We matched some text prior to the EOB, first
965 * process it.
966 */
967 return EOB_ACT_LAST_MATCH;
968 }
969 }
970
971 /* Try to read more data. */
972
973 /* First move last chars to start of buffer. */
974 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
975
976 for ( i = 0; i < number_to_move; ++i )
977 *(dest++) = *(source++);
978
979 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
980 /* don't do the read, it's not guaranteed to return an EOF,
981 * just force an EOF
982 */
983 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
984
985 else
986 {
987 int num_to_read =
988 yy_current_buffer->yy_buf_size - number_to_move - 1;
989
990 while ( num_to_read <= 0 )
991 { /* Not enough room in the buffer - grow it. */
992#ifdef YY_USES_REJECT
993 YY_FATAL_ERROR(
994"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
995#else
996
997 /* just a shorter name for the current buffer */
998 YY_BUFFER_STATE b = yy_current_buffer;
999
1000 int yy_c_buf_p_offset =
1001 (int) (yy_c_buf_p - b->yy_ch_buf);
1002
1003 if ( b->yy_is_our_buffer )
1004 {
1005 int new_size = b->yy_buf_size * 2;
1006
1007 if ( new_size <= 0 )
1008 b->yy_buf_size += b->yy_buf_size / 8;
1009 else
1010 b->yy_buf_size *= 2;
1011
1012 b->yy_ch_buf = (char *)
1013 /* Include room in for 2 EOB chars. */
1014 yy_flex_realloc( (void *) b->yy_ch_buf,
1015 b->yy_buf_size + 2 );
1016 }
1017 else
1018 /* Can't grow it, we don't own it. */
1019 b->yy_ch_buf = 0;
1020
1021 if ( ! b->yy_ch_buf )
1022 YY_FATAL_ERROR(
1023 "fatal error - scanner input buffer overflow" );
1024
1025 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1026
1027 num_to_read = yy_current_buffer->yy_buf_size -
1028 number_to_move - 1;
1029#endif
1030 }
1031
1032 if ( num_to_read > YY_READ_BUF_SIZE )
1033 num_to_read = YY_READ_BUF_SIZE;
1034
1035 /* Read in more data. */
1036 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1037 yy_n_chars, num_to_read );
1038
1039 yy_current_buffer->yy_n_chars = yy_n_chars;
1040 }
1041
1042 if ( yy_n_chars == 0 )
1043 {
1044 if ( number_to_move == YY_MORE_ADJ )
1045 {
1046 ret_val = EOB_ACT_END_OF_FILE;
1047 yyrestart( yyin );
1048 }
1049
1050 else
1051 {
1052 ret_val = EOB_ACT_LAST_MATCH;
1053 yy_current_buffer->yy_buffer_status =
1054 YY_BUFFER_EOF_PENDING;
1055 }
1056 }
1057
1058 else
1059 ret_val = EOB_ACT_CONTINUE_SCAN;
1060
1061 yy_n_chars += number_to_move;
1062 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1063 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1064
1065 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1066
1067 return ret_val;
1068 }
1069
1070
1071/* yy_get_previous_state - get the state just before the EOB char was reached */
1072
1073static yy_state_type yy_get_previous_state()
1074 {
1075 register yy_state_type yy_current_state;
1076 register char *yy_cp;
1077
1078 yy_current_state = yy_start;
1079
1080 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1081 {
1082 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1083 if ( yy_accept[yy_current_state] )
1084 {
1085 yy_last_accepting_state = yy_current_state;
1086 yy_last_accepting_cpos = yy_cp;
1087 }
1088 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1089 {
1090 yy_current_state = (int) yy_def[yy_current_state];
1091 if ( yy_current_state >= 60 )
1092 yy_c = yy_meta[(unsigned int) yy_c];
1093 }
1094 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1095 }
1096
1097 return yy_current_state;
1098 }
1099
1100
1101/* yy_try_NUL_trans - try to make a transition on the NUL character
1102 *
1103 * synopsis
1104 * next_state = yy_try_NUL_trans( current_state );
1105 */
1106
1107#ifdef YY_USE_PROTOS
1108static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1109#else
1110static yy_state_type yy_try_NUL_trans( yy_current_state )
1111yy_state_type yy_current_state;
1112#endif
1113 {
1114 register int yy_is_jam;
1115 register char *yy_cp = yy_c_buf_p;
1116
1117 register YY_CHAR yy_c = 1;
1118 if ( yy_accept[yy_current_state] )
1119 {
1120 yy_last_accepting_state = yy_current_state;
1121 yy_last_accepting_cpos = yy_cp;
1122 }
1123 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1124 {
1125 yy_current_state = (int) yy_def[yy_current_state];
1126 if ( yy_current_state >= 60 )
1127 yy_c = yy_meta[(unsigned int) yy_c];
1128 }
1129 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1130 yy_is_jam = (yy_current_state == 59);
1131
1132 return yy_is_jam ? 0 : yy_current_state;
1133 }
1134
1135
1136#ifndef YY_NO_UNPUT
1137#ifdef YY_USE_PROTOS
1138static void yyunput( int c, register char *yy_bp )
1139#else
1140static void yyunput( c, yy_bp )
1141int c;
1142register char *yy_bp;
1143#endif
1144 {
1145 register char *yy_cp = yy_c_buf_p;
1146
1147 /* undo effects of setting up yytext */
1148 *yy_cp = yy_hold_char;
1149
1150 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1151 { /* need to shift things up to make room */
1152 /* +2 for EOB chars. */
1153 register int number_to_move = yy_n_chars + 2;
1154 register char *dest = &yy_current_buffer->yy_ch_buf[
1155 yy_current_buffer->yy_buf_size + 2];
1156 register char *source =
1157 &yy_current_buffer->yy_ch_buf[number_to_move];
1158
1159 while ( source > yy_current_buffer->yy_ch_buf )
1160 *--dest = *--source;
1161
1162 yy_cp += (int) (dest - source);
1163 yy_bp += (int) (dest - source);
1164 yy_current_buffer->yy_n_chars =
1165 yy_n_chars = yy_current_buffer->yy_buf_size;
1166
1167 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1168 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1169 }
1170
1171 *--yy_cp = (char) c;
1172
1173
1174 yytext_ptr = yy_bp;
1175 yy_hold_char = *yy_cp;
1176 yy_c_buf_p = yy_cp;
1177 }
1178#endif /* ifndef YY_NO_UNPUT */
1179
1180
1181#ifdef __cplusplus
1182static int yyinput()
1183#else
1184static int input()
1185#endif
1186 {
1187 int c;
1188
1189 *yy_c_buf_p = yy_hold_char;
1190
1191 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1192 {
1193 /* yy_c_buf_p now points to the character we want to return.
1194 * If this occurs *before* the EOB characters, then it's a
1195 * valid NUL; if not, then we've hit the end of the buffer.
1196 */
1197 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1198 /* This was really a NUL. */
1199 *yy_c_buf_p = '\0';
1200
1201 else
1202 { /* need more input */
1203 int offset = yy_c_buf_p - yytext_ptr;
1204 ++yy_c_buf_p;
1205
1206 switch ( yy_get_next_buffer() )
1207 {
1208 case EOB_ACT_LAST_MATCH:
1209 /* This happens because yy_g_n_b()
1210 * sees that we've accumulated a
1211 * token and flags that we need to
1212 * try matching the token before
1213 * proceeding. But for input(),
1214 * there's no matching to consider.
1215 * So convert the EOB_ACT_LAST_MATCH
1216 * to EOB_ACT_END_OF_FILE.
1217 */
1218
1219 /* Reset buffer status. */
1220 yyrestart( yyin );
1221
1222 /* fall through */
1223
1224 case EOB_ACT_END_OF_FILE:
1225 {
1226 if ( yywrap() )
1227 return EOF;
1228
1229 if ( ! yy_did_buffer_switch_on_eof )
1230 YY_NEW_FILE;
1231#ifdef __cplusplus
1232 return yyinput();
1233#else
1234 return input();
1235#endif
1236 }
1237
1238 case EOB_ACT_CONTINUE_SCAN:
1239 yy_c_buf_p = yytext_ptr + offset;
1240 break;
1241 }
1242 }
1243 }
1244
1245 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1246 *yy_c_buf_p = '\0'; /* preserve yytext */
1247 yy_hold_char = *++yy_c_buf_p;
1248
1249
1250 return c;
1251 }
1252
1253
1254#ifdef YY_USE_PROTOS
1255void yyrestart( FILE *input_file )
1256#else
1257void yyrestart( input_file )
1258FILE *input_file;
1259#endif
1260 {
1261 if ( ! yy_current_buffer )
1262 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1263
1264 yy_init_buffer( yy_current_buffer, input_file );
1265 yy_load_buffer_state();
1266 }
1267
1268
1269#ifdef YY_USE_PROTOS
1270void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1271#else
1272void yy_switch_to_buffer( new_buffer )
1273YY_BUFFER_STATE new_buffer;
1274#endif
1275 {
1276 if ( yy_current_buffer == new_buffer )
1277 return;
1278
1279 if ( yy_current_buffer )
1280 {
1281 /* Flush out information for old buffer. */
1282 *yy_c_buf_p = yy_hold_char;
1283 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1284 yy_current_buffer->yy_n_chars = yy_n_chars;
1285 }
1286
1287 yy_current_buffer = new_buffer;
1288 yy_load_buffer_state();
1289
1290 /* We don't actually know whether we did this switch during
1291 * EOF (yywrap()) processing, but the only time this flag
1292 * is looked at is after yywrap() is called, so it's safe
1293 * to go ahead and always set it.
1294 */
1295 yy_did_buffer_switch_on_eof = 1;
1296 }
1297
1298
1299#ifdef YY_USE_PROTOS
1300void yy_load_buffer_state( void )
1301#else
1302void yy_load_buffer_state()
1303#endif
1304 {
1305 yy_n_chars = yy_current_buffer->yy_n_chars;
1306 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1307 yyin = yy_current_buffer->yy_input_file;
1308 yy_hold_char = *yy_c_buf_p;
1309 }
1310
1311
1312#ifdef YY_USE_PROTOS
1313YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1314#else
1315YY_BUFFER_STATE yy_create_buffer( file, size )
1316FILE *file;
1317int size;
1318#endif
1319 {
1320 YY_BUFFER_STATE b;
1321
1322 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1323 if ( ! b )
1324 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1325
1326 b->yy_buf_size = size;
1327
1328 /* yy_ch_buf has to be 2 characters longer than the size given because
1329 * we need to put in 2 end-of-buffer characters.
1330 */
1331 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1332 if ( ! b->yy_ch_buf )
1333 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1334
1335 b->yy_is_our_buffer = 1;
1336
1337 yy_init_buffer( b, file );
1338
1339 return b;
1340 }
1341
1342
1343#ifdef YY_USE_PROTOS
1344void yy_delete_buffer( YY_BUFFER_STATE b )
1345#else
1346void yy_delete_buffer( b )
1347YY_BUFFER_STATE b;
1348#endif
1349 {
1350 if ( ! b )
1351 return;
1352
1353 if ( b == yy_current_buffer )
1354 yy_current_buffer = (YY_BUFFER_STATE) 0;
1355
1356 if ( b->yy_is_our_buffer )
1357 yy_flex_free( (void *) b->yy_ch_buf );
1358
1359 yy_flex_free( (void *) b );
1360 }
1361
1362
1363#ifndef YY_ALWAYS_INTERACTIVE
1364#ifndef YY_NEVER_INTERACTIVE
1365extern int isatty YY_PROTO(( int ));
1366#endif
1367#endif
1368
1369#ifdef YY_USE_PROTOS
1370void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1371#else
1372void yy_init_buffer( b, file )
1373YY_BUFFER_STATE b;
1374FILE *file;
1375#endif
1376
1377
1378 {
1379 yy_flush_buffer( b );
1380
1381 b->yy_input_file = file;
1382 b->yy_fill_buffer = 1;
1383
1384#if YY_ALWAYS_INTERACTIVE
1385 b->yy_is_interactive = 1;
1386#else
1387#if YY_NEVER_INTERACTIVE
1388 b->yy_is_interactive = 0;
1389#else
1390 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1391#endif
1392#endif
1393 }
1394
1395
1396#ifdef YY_USE_PROTOS
1397void yy_flush_buffer( YY_BUFFER_STATE b )
1398#else
1399void yy_flush_buffer( b )
1400YY_BUFFER_STATE b;
1401#endif
1402
1403 {
1404 if ( ! b )
1405 return;
1406
1407 b->yy_n_chars = 0;
1408
1409 /* We always need two end-of-buffer characters. The first causes
1410 * a transition to the end-of-buffer state. The second causes
1411 * a jam in that state.
1412 */
1413 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1414 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1415
1416 b->yy_buf_pos = &b->yy_ch_buf[0];
1417
1418 b->yy_at_bol = 1;
1419 b->yy_buffer_status = YY_BUFFER_NEW;
1420
1421 if ( b == yy_current_buffer )
1422 yy_load_buffer_state();
1423 }
1424
1425
1426#ifndef YY_NO_SCAN_BUFFER
1427#ifdef YY_USE_PROTOS
1428YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1429#else
1430YY_BUFFER_STATE yy_scan_buffer( base, size )
1431char *base;
1432yy_size_t size;
1433#endif
1434 {
1435 YY_BUFFER_STATE b;
1436
1437 if ( size < 2 ||
1438 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1439 base[size-1] != YY_END_OF_BUFFER_CHAR )
1440 /* They forgot to leave room for the EOB's. */
1441 return 0;
1442
1443 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1444 if ( ! b )
1445 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1446
1447 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1448 b->yy_buf_pos = b->yy_ch_buf = base;
1449 b->yy_is_our_buffer = 0;
1450 b->yy_input_file = 0;
1451 b->yy_n_chars = b->yy_buf_size;
1452 b->yy_is_interactive = 0;
1453 b->yy_at_bol = 1;
1454 b->yy_fill_buffer = 0;
1455 b->yy_buffer_status = YY_BUFFER_NEW;
1456
1457 yy_switch_to_buffer( b );
1458
1459 return b;
1460 }
1461#endif
1462
1463
1464#ifndef YY_NO_SCAN_STRING
1465#ifdef YY_USE_PROTOS
1466YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1467#else
1468YY_BUFFER_STATE yy_scan_string( yy_str )
1469yyconst char *yy_str;
1470#endif
1471 {
1472 int len;
1473 for ( len = 0; yy_str[len]; ++len )
1474 ;
1475
1476 return yy_scan_bytes( yy_str, len );
1477 }
1478#endif
1479
1480
1481#ifndef YY_NO_SCAN_BYTES
1482#ifdef YY_USE_PROTOS
1483YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1484#else
1485YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1486yyconst char *bytes;
1487int len;
1488#endif
1489 {
1490 YY_BUFFER_STATE b;
1491 char *buf;
1492 yy_size_t n;
1493 int i;
1494
1495 /* Get memory for full buffer, including space for trailing EOB's. */
1496 n = len + 2;
1497 buf = (char *) yy_flex_alloc( n );
1498 if ( ! buf )
1499 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1500
1501 for ( i = 0; i < len; ++i )
1502 buf[i] = bytes[i];
1503
1504 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1505
1506 b = yy_scan_buffer( buf, n );
1507 if ( ! b )
1508 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1509
1510 /* It's okay to grow etc. this buffer, and we should throw it
1511 * away when we're done.
1512 */
1513 b->yy_is_our_buffer = 1;
1514
1515 return b;
1516 }
1517#endif
1518
1519
1520#ifndef YY_NO_PUSH_STATE
1521#ifdef YY_USE_PROTOS
1522static void yy_push_state( int new_state )
1523#else
1524static void yy_push_state( new_state )
1525int new_state;
1526#endif
1527 {
1528 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1529 {
1530 yy_size_t new_size;
1531
1532 yy_start_stack_depth += YY_START_STACK_INCR;
1533 new_size = yy_start_stack_depth * sizeof( int );
1534
1535 if ( ! yy_start_stack )
1536 yy_start_stack = (int *) yy_flex_alloc( new_size );
1537
1538 else
1539 yy_start_stack = (int *) yy_flex_realloc(
1540 (void *) yy_start_stack, new_size );
1541
1542 if ( ! yy_start_stack )
1543 YY_FATAL_ERROR(
1544 "out of memory expanding start-condition stack" );
1545 }
1546
1547 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1548
1549 BEGIN(new_state);
1550 }
1551#endif
1552
1553
1554#ifndef YY_NO_POP_STATE
1555static void yy_pop_state()
1556 {
1557 if ( --yy_start_stack_ptr < 0 )
1558 YY_FATAL_ERROR( "start-condition stack underflow" );
1559
1560 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1561 }
1562#endif
1563
1564
1565#ifndef YY_NO_TOP_STATE
1566static int yy_top_state()
1567 {
1568 return yy_start_stack[yy_start_stack_ptr - 1];
1569 }
1570#endif
1571
1572#ifndef YY_EXIT_FAILURE
1573#define YY_EXIT_FAILURE 2
1574#endif
1575
1576#ifdef YY_USE_PROTOS
1577static void yy_fatal_error( yyconst char msg[] )
1578#else
1579static void yy_fatal_error( msg )
1580char msg[];
1581#endif
1582 {
1583 (void) fprintf( stderr, "%s\n", msg );
1584 exit( YY_EXIT_FAILURE );
1585 }
1586
1587
1588
1589/* Redefine yyless() so it works in section 3 code. */
1590
1591#undef yyless
1592#define yyless(n) \
1593 do \
1594 { \
1595 /* Undo effects of setting up yytext. */ \
1596 yytext[yyleng] = yy_hold_char; \
1597 yy_c_buf_p = yytext + n; \
1598 yy_hold_char = *yy_c_buf_p; \
1599 *yy_c_buf_p = '\0'; \
1600 yyleng = n; \
1601 } \
1602 while ( 0 )
1603
1604
1605/* Internal utility routines. */
1606
1607#ifndef yytext_ptr
1608#ifdef YY_USE_PROTOS
1609static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1610#else
1611static void yy_flex_strncpy( s1, s2, n )
1612char *s1;
1613yyconst char *s2;
1614int n;
1615#endif
1616 {
1617 register int i;
1618 for ( i = 0; i < n; ++i )
1619 s1[i] = s2[i];
1620 }
1621#endif
1622
1623#ifdef YY_NEED_STRLEN
1624#ifdef YY_USE_PROTOS
1625static int yy_flex_strlen( yyconst char *s )
1626#else
1627static int yy_flex_strlen( s )
1628yyconst char *s;
1629#endif
1630 {
1631 register int n;
1632 for ( n = 0; s[n]; ++n )
1633 ;
1634
1635 return n;
1636 }
1637#endif
1638
1639
1640#ifdef YY_USE_PROTOS
1641static void *yy_flex_alloc( yy_size_t size )
1642#else
1643static void *yy_flex_alloc( size )
1644yy_size_t size;
1645#endif
1646 {
1647 return (void *) malloc( size );
1648 }
1649
1650#ifdef YY_USE_PROTOS
1651static void *yy_flex_realloc( void *ptr, yy_size_t size )
1652#else
1653static void *yy_flex_realloc( ptr, size )
1654void *ptr;
1655yy_size_t size;
1656#endif
1657 {
1658 /* The cast to (char *) in the following accommodates both
1659 * implementations that use char* generic pointers, and those
1660 * that use void* generic pointers. It works with the latter
1661 * because both ANSI C and C++ allow castless assignment from
1662 * any pointer type to void*, and deal with argument conversions
1663 * as though doing an assignment.
1664 */
1665 return (void *) realloc( (char *) ptr, size );
1666 }
1667
1668#ifdef YY_USE_PROTOS
1669static void yy_flex_free( void *ptr )
1670#else
1671static void yy_flex_free( ptr )
1672void *ptr;
1673#endif
1674 {
1675 free( ptr );
1676 }
1677
1678#if YY_MAIN
1679int main()
1680 {
1681 yylex();
1682 return 0;
1683 }
1684#endif
1685#line 106 "itbl-lex.l"
1686
1687
1688#ifndef yywrap
1689int
1690yywrap ()
1691 {
1692 return 1;
1693 }
1694#endif
Note: See TracBrowser for help on using the repository browser.