/* A lexical scanner generated by flex */ /* Scanner skeleton version: * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ */ #define FLEX_SCANNER #define FBL_Y__FLEX_MAJOR_VERSION 2 #define FBL_Y__FLEX_MINOR_VERSION 5 #include #include /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ #ifdef c_plusplus #ifndef __cplusplus #define __cplusplus #endif #endif #ifdef __cplusplus #include /* Use prototypes in function declarations. */ #define FBL_Y__USE_PROTOS /* The "const" storage-class-modifier is valid. */ #define FBL_Y__USE_CONST #else /* ! __cplusplus */ #if __STDC__ #define FBL_Y__USE_PROTOS #define FBL_Y__USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ #ifdef __TURBOC__ #pragma warn -rch #pragma warn -use #include #include #define FBL_Y__USE_CONST #define FBL_Y__USE_PROTOS #endif #ifdef FBL_Y__USE_CONST #define fbl_y_const const #else #define fbl_y_const #endif #ifdef FBL_Y__USE_PROTOS #define FBL_Y__PROTO(proto) proto #else #define FBL_Y__PROTO(proto) () #endif /* Returned upon end-of-file. */ #define FBL_Y__NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define FBL_Y__SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN fbl_y__start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The FBL_Y_STATE alias is for lex * compatibility. */ #define FBL_Y__START ((fbl_y__start - 1) / 2) #define FBL_Y_STATE FBL_Y__START /* Action number for EOF rule of a given start state. */ #define FBL_Y__STATE_EOF(state) (FBL_Y__END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define FBL_Y__NEW_FILE fbl_y_restart( fbl_y_in ) #define FBL_Y__END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #define FBL_Y__BUF_SIZE 16384 typedef struct fbl_y__buffer_state *FBL_Y__BUFFER_STATE; extern int fbl_y_leng; extern FILE *fbl_y_in, *fbl_y_out; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* The funky do-while in the following #define is used to turn the definition * int a single C statement (which needs a semi-colon terminator). This * avoids problems with code like: * * if ( condition_holds ) * fbl_y_less( 5 ); * else * do_something_else(); * * Prior to using the do-while the compiler would get upset at the * "else" because it interpreted the "if" statement as being all * done when it reached the ';' after the fbl_y_less() call. */ /* Return all but the first 'n' matched characters back to the input stream. */ #define fbl_y_less(n) \ do \ { \ /* Undo effects of setting up fbl_y_text. */ \ *fbl_y__cp = fbl_y__hold_char; \ FBL_Y__RESTORE_FBL_Y__MORE_OFFSET \ fbl_y__c_buf_p = fbl_y__cp = fbl_y__bp + n - FBL_Y__MORE_ADJ; \ FBL_Y__DO_BEFORE_ACTION; /* set up fbl_y_text again */ \ } \ while ( 0 ) #define unput(c) fbl_y_unput( c, fbl_y_text_ptr ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ typedef unsigned int fbl_y__size_t; struct fbl_y__buffer_state { FILE *fbl_y__input_file; char *fbl_y__ch_buf; /* input buffer */ char *fbl_y__buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ fbl_y__size_t fbl_y__buf_size; /* Number of characters read into fbl_y__ch_buf, not including EOB * characters. */ int fbl_y__n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int fbl_y__is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int fbl_y__is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int fbl_y__at_bol; /* Whether to try to fill the input buffer when we reach the * end of it. */ int fbl_y__fill_buffer; int fbl_y__buffer_status; #define FBL_Y__BUFFER_NEW 0 #define FBL_Y__BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as FBL_Y__EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via fbl_y_restart()), so that the user can continue scanning by * just pointing fbl_y_in at a new input file. */ #define FBL_Y__BUFFER_EOF_PENDING 2 }; static FBL_Y__BUFFER_STATE fbl_y__current_buffer = 0; /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". */ #define FBL_Y__CURRENT_BUFFER fbl_y__current_buffer /* fbl_y__hold_char holds the character lost when fbl_y_text is formed. */ static char fbl_y__hold_char; static int fbl_y__n_chars; /* number of characters read into fbl_y__ch_buf */ int fbl_y_leng; /* Points to current character in buffer. */ static char *fbl_y__c_buf_p = (char *) 0; static int fbl_y__init = 1; /* whether we need to initialize */ static int fbl_y__start = 0; /* start state number */ /* Flag which is used to allow fbl_y_wrap()'s to do buffer switches * instead of setting up a fresh fbl_y_in. A bit of a hack ... */ static int fbl_y__did_buffer_switch_on_eof; void fbl_y_restart FBL_Y__PROTO(( FILE *input_file )); void fbl_y__switch_to_buffer FBL_Y__PROTO(( FBL_Y__BUFFER_STATE new_buffer )); void fbl_y__load_buffer_state FBL_Y__PROTO(( void )); FBL_Y__BUFFER_STATE fbl_y__create_buffer FBL_Y__PROTO(( FILE *file, int size )); void fbl_y__delete_buffer FBL_Y__PROTO(( FBL_Y__BUFFER_STATE b )); void fbl_y__init_buffer FBL_Y__PROTO(( FBL_Y__BUFFER_STATE b, FILE *file )); void fbl_y__flush_buffer FBL_Y__PROTO(( FBL_Y__BUFFER_STATE b )); #define FBL_Y__FLUSH_BUFFER fbl_y__flush_buffer( fbl_y__current_buffer ) FBL_Y__BUFFER_STATE fbl_y__scan_buffer FBL_Y__PROTO(( char *base, fbl_y__size_t size )); FBL_Y__BUFFER_STATE fbl_y__scan_string FBL_Y__PROTO(( fbl_y_const char *fbl_y__str )); FBL_Y__BUFFER_STATE fbl_y__scan_bytes FBL_Y__PROTO(( fbl_y_const char *bytes, int len )); static void *fbl_y__flex_alloc FBL_Y__PROTO(( fbl_y__size_t )); static void *fbl_y__flex_realloc FBL_Y__PROTO(( void *, fbl_y__size_t )); static void fbl_y__flex_free FBL_Y__PROTO(( void * )); #define fbl_y__new_buffer fbl_y__create_buffer #define fbl_y__set_interactive(is_interactive) \ { \ if ( ! fbl_y__current_buffer ) \ fbl_y__current_buffer = fbl_y__create_buffer( fbl_y_in, FBL_Y__BUF_SIZE ); \ fbl_y__current_buffer->fbl_y__is_interactive = is_interactive; \ } #define fbl_y__set_bol(at_bol) \ { \ if ( ! fbl_y__current_buffer ) \ fbl_y__current_buffer = fbl_y__create_buffer( fbl_y_in, FBL_Y__BUF_SIZE ); \ fbl_y__current_buffer->fbl_y__at_bol = at_bol; \ } #define FBL_Y__AT_BOL() (fbl_y__current_buffer->fbl_y__at_bol) typedef unsigned char FBL_Y__CHAR; FILE *fbl_y_in = (FILE *) 0, *fbl_y_out = (FILE *) 0; typedef int fbl_y__state_type; extern char *fbl_y_text; #define fbl_y_text_ptr fbl_y_text static fbl_y__state_type fbl_y__get_previous_state FBL_Y__PROTO(( void )); static fbl_y__state_type fbl_y__try_NUL_trans FBL_Y__PROTO(( fbl_y__state_type current_state )); static int fbl_y__get_next_buffer FBL_Y__PROTO(( void )); static void fbl_y__fatal_error FBL_Y__PROTO(( fbl_y_const char msg[] )); /* Done after the current pattern has been matched and before the * corresponding action - sets up fbl_y_text. */ #define FBL_Y__DO_BEFORE_ACTION \ fbl_y_text_ptr = fbl_y__bp; \ fbl_y_leng = (int) (fbl_y__cp - fbl_y__bp); \ fbl_y__hold_char = *fbl_y__cp; \ *fbl_y__cp = '\0'; \ fbl_y__c_buf_p = fbl_y__cp; #define FBL_Y__NUM_RULES 34 #define FBL_Y__END_OF_BUFFER 35 static fbl_y_const short int fbl_y__accept[105] = { 0, 0, 0, 35, 33, 1, 30, 23, 33, 33, 2, 3, 4, 5, 7, 8, 9, 10, 24, 33, 26, 12, 13, 16, 18, 17, 25, 25, 22, 0, 28, 0, 28, 0, 6, 0, 19, 0, 0, 26, 0, 0, 0, 11, 14, 21, 20, 15, 25, 0, 0, 0, 27, 0, 0, 32, 0, 0, 26, 0, 0, 26, 0, 0, 0, 26, 0, 0, 0, 26, 0, 0, 0, 26, 0, 26, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 26, 0, 26, 0, 26, 0, 0, 0, 31, 0 } ; static fbl_y_const int fbl_y__ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 21, 22, 23, 24, 7, 7, 25, 26, 27, 27, 28, 27, 29, 30, 30, 30, 30, 30, 31, 30, 32, 33, 30, 34, 30, 30, 30, 30, 30, 35, 30, 30, 7, 7, 7, 7, 36, 7, 37, 38, 39, 39, 40, 39, 41, 42, 42, 42, 42, 42, 43, 42, 44, 45, 42, 46, 42, 42, 42, 42, 42, 47, 42, 42, 7, 48, 7, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static fbl_y_const int fbl_y__meta[49] = { 0, 1, 2, 1, 2, 3, 4, 2, 5, 2, 2, 2, 2, 2, 2, 2, 2, 6, 2, 7, 8, 2, 2, 2, 2, 7, 7, 7, 7, 9, 9, 9, 9, 9, 9, 9, 10, 7, 7, 7, 7, 9, 9, 9, 9, 9, 9, 9, 2 } ; static fbl_y_const short int fbl_y__base[123] = { 0, 0, 0, 255, 274, 274, 274, 274, 249, 243, 274, 0, 274, 274, 237, 274, 274, 232, 274, 222, 43, 221, 274, 27, 218, 218, 204, 48, 274, 232, 227, 223, 220, 204, 274, 52, 274, 0, 165, 53, 0, 50, 164, 274, 274, 274, 274, 274, 146, 145, 0, 0, 274, 177, 55, 274, 58, 59, 58, 70, 160, 55, 63, 44, 93, 73, 0, 97, 99, 83, 157, 0, 90, 80, 92, 96, 156, 274, 112, 116, 114, 117, 126, 120, 118, 107, 126, 128, 153, 122, 132, 138, 126, 127, 151, 130, 148, 141, 150, 142, 146, 161, 154, 274, 274, 184, 193, 202, 206, 216, 149, 130, 75, 71, 223, 228, 236, 242, 68, 60, 249, 253, 263 } ; static fbl_y_const short int fbl_y__def[123] = { 0, 104, 1, 104, 104, 104, 104, 104, 105, 106, 104, 107, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 108, 108, 104, 105, 104, 106, 104, 104, 104, 109, 104, 110, 104, 104, 111, 104, 104, 104, 104, 104, 104, 104, 108, 108, 112, 113, 104, 109, 109, 104, 109, 114, 104, 115, 104, 104, 116, 117, 109, 104, 118, 114, 114, 104, 104, 119, 115, 104, 115, 104, 104, 104, 116, 116, 117, 117, 109, 104, 120, 121, 104, 109, 104, 104, 120, 120, 121, 121, 104, 104, 109, 104, 104, 104, 104, 122, 122, 104, 0, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104 } ; static fbl_y_const short int fbl_y__nxt[323] = { 0, 4, 5, 6, 7, 8, 4, 4, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 26, 26, 26, 26, 26, 27, 26, 26, 27, 4, 26, 27, 26, 26, 26, 26, 26, 27, 26, 26, 27, 28, 37, 44, 45, 77, 50, 54, 55, 51, 54, 55, 37, 38, 55, 39, 40, 60, 65, 60, 85, 77, 61, 38, 41, 39, 40, 75, 84, 66, 69, 63, 42, 81, 41, 62, 41, 49, 56, 41, 71, 56, 42, 73, 76, 64, 41, 70, 68, 55, 56, 41, 79, 56, 83, 69, 65, 64, 104, 74, 71, 86, 104, 73, 41, 104, 83, 66, 75, 104, 77, 82, 70, 86, 104, 77, 41, 65, 104, 74, 73, 104, 55, 82, 55, 76, 68, 88, 104, 88, 59, 65, 89, 94, 97, 94, 93, 104, 95, 73, 104, 79, 99, 81, 55, 104, 104, 91, 87, 57, 103, 98, 96, 97, 99, 93, 104, 103, 99, 100, 87, 91, 97, 95, 96, 89, 101, 104, 75, 69, 98, 100, 61, 55, 104, 49, 39, 58, 101, 29, 29, 29, 29, 29, 29, 29, 29, 29, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 48, 52, 48, 48, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 67, 31, 67, 67, 32, 29, 67, 72, 72, 72, 30, 72, 78, 49, 47, 46, 78, 43, 36, 78, 80, 35, 80, 34, 32, 80, 90, 30, 104, 90, 104, 104, 90, 92, 92, 104, 92, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 3, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104 } ; static fbl_y_const short int fbl_y__chk[323] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 20, 23, 23, 63, 27, 35, 35, 27, 54, 54, 39, 20, 56, 20, 20, 41, 57, 41, 119, 62, 41, 39, 20, 39, 39, 61, 118, 57, 58, 113, 20, 63, 39, 112, 20, 27, 35, 58, 59, 54, 39, 59, 61, 56, 39, 58, 57, 64, 35, 58, 62, 54, 65, 69, 67, 56, 68, 59, 72, 73, 74, 72, 69, 74, 65, 67, 75, 68, 78, 64, 69, 73, 79, 80, 69, 84, 81, 72, 85, 74, 82, 64, 87, 75, 67, 83, 68, 83, 111, 90, 83, 86, 89, 86, 85, 91, 86, 92, 93, 78, 95, 80, 96, 79, 81, 84, 82, 110, 102, 89, 87, 97, 99, 92, 93, 101, 100, 95, 82, 90, 98, 94, 87, 88, 96, 91, 76, 70, 97, 99, 60, 53, 49, 48, 42, 38, 96, 105, 105, 105, 105, 105, 105, 105, 105, 105, 106, 106, 106, 106, 106, 106, 106, 106, 106, 107, 107, 107, 107, 107, 107, 107, 107, 107, 108, 33, 108, 108, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 114, 32, 114, 114, 31, 30, 114, 115, 115, 115, 29, 115, 116, 26, 25, 24, 116, 21, 19, 116, 117, 17, 117, 14, 9, 117, 120, 8, 3, 120, 0, 0, 120, 121, 121, 0, 121, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104 } ; static fbl_y__state_type fbl_y__last_accepting_state; static char *fbl_y__last_accepting_cpos; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define fbl_y_more() fbl_y_more_used_but_not_detected #define FBL_Y__MORE_ADJ 0 #define FBL_Y__RESTORE_FBL_Y__MORE_OFFSET char *fbl_y_text; #line 1 "../../../src/fvh/src/fbl_bcomp_l.l" #define INITIAL 0 /*------------------------------------------------------------\ | | | This file is part of the Alliance CAD System Copyright | | (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| | | | Home page : http://www-asim.lip6.fr/alliance/ | | E-mail : mailto:alliance-users@asim.lip6.fr | | | | This progam is free software; you can redistribute it | | and/or modify it under the terms of the GNU Library General| | Public License as published by the Free Software Foundation | | either version 2 of the License, or (at your option) any | | later version. | | | | Alliance VLSI CAD System is distributed in the hope that | | it will be useful, but WITHOUT ANY WARRANTY; | | without even the implied warranty of MERCHANTABILITY or | | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | | Public License for more details. | | | | You should have received a copy of the GNU General Public | | License along with the GNU C Library; see the file COPYING. | | If not, write to the Free Software Foundation, Inc., | | 675 Mass Ave, Cambridge, MA 02139, USA. | | | \------------------------------------------------------------*/ #line 28 "../../../src/fvh/src/fbl_bcomp_l.l" #include #include #include #include #include "mut.h" #include "aut.h" #include "abl.h" #include "bdd.h" #include "fvh.h" typedef struct fbl_expr { char *IDENT; /* identifier or constant name */ struct chain *LIST_ABL; /* pointer on fbl_abllst list */ short WIDTH; /* width of bit vector */ } fbl_ablstr; typedef struct { char *NAME; /* identifier name */ short LEFT; /* vector's left index */ short RIGHT; /* vector's right index */ char FLAG; } fbl_name; struct g_type { int VALU; char FLAG; }; #include "fbl_bcomp_y.h" #include "fbl_bedef.h" #include "fbl_blex.h" static el_mc tab_mc []= { {"abs" ,ABS}, {"access" ,ACCESS}, {"after" ,AFTER}, {"alias" ,ALIAS}, {"all" ,ALL}, {"and" ,tok_AND}, {"architecture" ,ARCHITECTURE}, {"array" ,ARRAY}, {"assert" ,ASSERT}, {"attribute" ,ATTRIBUTE}, {"begin" ,_BEGIN}, {"block" ,_BLOCK}, {"body" ,BODY}, {"buffer" ,BUFFER}, {"bus" ,BUS}, {"case" ,CASE}, {"component" ,COMPONENT}, {"configuration" ,CONFIGURATION}, {"constant" ,CONSTANT}, {"disconnect" ,DISCONNECT}, {"downto" ,DOWNTO}, {"else" ,ELSE}, {"elsif" ,ELSIF}, {"end" ,_END}, {"entity" ,ENTITY}, {"error" ,ERROR}, {"event" ,_EVENT}, {"exit" ,_EXIT}, {"file" ,_FILE}, {"for" ,FOR}, {"function" ,FUNCTION}, {"generate" ,GENERATE}, {"generic" ,GENERIC}, {"guarded" ,GUARDED}, {"if" ,IF}, {"in" ,_IN}, {"inout" ,_INOUT}, {"is" ,IS}, {"label" ,_LABEL}, {"library" ,LIBRARY}, {"linkage" ,_LINKAGE}, {"loop" ,LOOP}, {"map" ,MAP}, {"mod" ,MOD}, {"nand" ,_NAND}, {"new" ,NEW}, {"next" ,_NEXT}, {"nor" ,_NOR}, {"not" ,_NOT}, {"null" ,tok_NULL}, {"of" ,OF}, {"on" ,ON}, {"open" ,OPEN}, {"or" ,_OR}, {"others" ,OTHERS}, {"out" ,_OUT}, {"package" ,_PACKAGE}, {"port" ,PORT}, {"procedure" ,PROCEDURE}, {"process" ,PROCESS}, {"range" ,RANGE}, {"record" ,RECORD}, {"register" ,REGISTER}, {"rem" ,REM}, {"report" ,REPORT}, {"return" ,RETURN}, {"select" ,SELECT}, {"severity" ,SEVERITY}, {"signal" ,SIGNAL}, {"stable" ,_STABLE}, {"subtype" ,SUBTYPE}, {"then" ,THEN}, {"to" ,TO}, {"transport" ,TRANSPORT}, {"type" ,FBHTYPE}, {"units" ,UNITS}, {"until" ,UNTIL}, {"use" ,USE}, {"variable" ,VARIABLE}, {"wait" ,WAIT}, {"warning" ,WARNING}, {"when" ,WHEN}, {"while" ,WHILE}, {"with" ,WITH}, {"xor" ,_XOR} }; static int find_mc(s) char *s; { char *loc; el_mc *pt; loc = namealloc(s); pt= (el_mc *) bsearch(loc, (char *)tab_mc,FBL_NB_MC,sizeof(el_mc), (int (*)(const void *, const void *))strcmp); if (pt==NULL) return(-1); return(pt->kval); } /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef FBL_Y__SKIP_FBL_Y_WRAP #ifdef __cplusplus extern "C" int fbl_y_wrap FBL_Y__PROTO(( void )); #else extern int fbl_y_wrap FBL_Y__PROTO(( void )); #endif #endif #ifndef FBL_Y__NO_UNPUT static void fbl_y_unput FBL_Y__PROTO(( int c, char *buf_ptr )); #endif #ifndef fbl_y_text_ptr static void fbl_y__flex_strncpy FBL_Y__PROTO(( char *, fbl_y_const char *, int )); #endif #ifdef FBL_Y__NEED_STRLEN static int fbl_y__flex_strlen FBL_Y__PROTO(( fbl_y_const char * )); #endif #ifndef FBL_Y__NO_INPUT #ifdef __cplusplus static int fbl_y_input FBL_Y__PROTO(( void )); #else static int input FBL_Y__PROTO(( void )); #endif #endif #if FBL_Y__STACK_USED static int fbl_y__start_stack_ptr = 0; static int fbl_y__start_stack_depth = 0; static int *fbl_y__start_stack = 0; #ifndef FBL_Y__NO_PUSH_STATE static void fbl_y__push_state FBL_Y__PROTO(( int new_state )); #endif #ifndef FBL_Y__NO_POP_STATE static void fbl_y__pop_state FBL_Y__PROTO(( void )); #endif #ifndef FBL_Y__NO_TOP_STATE static int fbl_y__top_state FBL_Y__PROTO(( void )); #endif #else #define FBL_Y__NO_PUSH_STATE 1 #define FBL_Y__NO_POP_STATE 1 #define FBL_Y__NO_TOP_STATE 1 #endif #ifdef FBL_Y__MALLOC_DECL FBL_Y__MALLOC_DECL #else #if __STDC__ #ifndef __cplusplus #include #endif #else /* Just try to get by without declaring the routines. This will fail * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) * or sizeof(void*) != sizeof(int). */ #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef FBL_Y__READ_BUF_SIZE #define FBL_Y__READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO (void) fwrite( fbl_y_text, fbl_y_leng, 1, fbl_y_out ) #endif /* Gets input and stuffs it into "buf". number of characters read, or FBL_Y__NULL, * is returned in "result". */ #ifndef FBL_Y__INPUT #define FBL_Y__INPUT(buf,result,max_size) \ if ( fbl_y__current_buffer->fbl_y__is_interactive ) \ { \ int c = '*', n; \ for ( n = 0; n < max_size && \ (c = getc( fbl_y_in )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( fbl_y_in ) ) \ FBL_Y__FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else if ( ((result = fread( buf, 1, max_size, fbl_y_in )) == 0) \ && ferror( fbl_y_in ) ) \ FBL_Y__FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "fbl_y_terminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef fbl_y_terminate #define fbl_y_terminate() return FBL_Y__NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef FBL_Y__START_STACK_INCR #define FBL_Y__START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef FBL_Y__FATAL_ERROR #define FBL_Y__FATAL_ERROR(msg) fbl_y__fatal_error( msg ) #endif /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef FBL_Y__DECL #define FBL_Y__DECL int fbl_y_lex FBL_Y__PROTO(( void )) #endif /* Code executed at the beginning of each rule, after fbl_y_text and fbl_y_leng * have been set up. */ #ifndef FBL_Y__USER_ACTION #define FBL_Y__USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef FBL_Y__BREAK #define FBL_Y__BREAK break; #endif #define FBL_Y__RULE_SETUP \ FBL_Y__USER_ACTION FBL_Y__DECL { register fbl_y__state_type fbl_y__current_state; register char *fbl_y__cp = NULL, *fbl_y__bp = NULL; register int fbl_y__act; #line 194 "../../../src/fvh/src/fbl_bcomp_l.l" if ( fbl_y__init ) { fbl_y__init = 0; #ifdef FBL_Y__USER_INIT FBL_Y__USER_INIT; #endif if ( ! fbl_y__start ) fbl_y__start = 1; /* first start state */ if ( ! fbl_y_in ) fbl_y_in = stdin; if ( ! fbl_y_out ) fbl_y_out = stdout; if ( ! fbl_y__current_buffer ) fbl_y__current_buffer = fbl_y__create_buffer( fbl_y_in, FBL_Y__BUF_SIZE ); fbl_y__load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { fbl_y__cp = fbl_y__c_buf_p; /* Support of fbl_y_text. */ *fbl_y__cp = fbl_y__hold_char; /* fbl_y__bp points to the position in fbl_y__ch_buf of the start of * the current run. */ fbl_y__bp = fbl_y__cp; fbl_y__current_state = fbl_y__start; fbl_y__match: do { register FBL_Y__CHAR fbl_y__c = fbl_y__ec[FBL_Y__SC_TO_UI(*fbl_y__cp)]; if ( fbl_y__accept[fbl_y__current_state] ) { fbl_y__last_accepting_state = fbl_y__current_state; fbl_y__last_accepting_cpos = fbl_y__cp; } while ( fbl_y__chk[fbl_y__base[fbl_y__current_state] + fbl_y__c] != fbl_y__current_state ) { fbl_y__current_state = (int) fbl_y__def[fbl_y__current_state]; if ( fbl_y__current_state >= 105 ) fbl_y__c = fbl_y__meta[(unsigned int) fbl_y__c]; } fbl_y__current_state = fbl_y__nxt[fbl_y__base[fbl_y__current_state] + (unsigned int) fbl_y__c]; ++fbl_y__cp; } while ( fbl_y__base[fbl_y__current_state] != 274 ); fbl_y__find_action: fbl_y__act = fbl_y__accept[fbl_y__current_state]; if ( fbl_y__act == 0 ) { /* have to back up */ fbl_y__cp = fbl_y__last_accepting_cpos; fbl_y__current_state = fbl_y__last_accepting_state; fbl_y__act = fbl_y__accept[fbl_y__current_state]; } FBL_Y__DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( fbl_y__act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of FBL_Y__DO_BEFORE_ACTION */ *fbl_y__cp = fbl_y__hold_char; fbl_y__cp = fbl_y__last_accepting_cpos; fbl_y__current_state = fbl_y__last_accepting_state; goto fbl_y__find_action; case 1: FBL_Y__RULE_SETUP #line 195 "../../../src/fvh/src/fbl_bcomp_l.l" ; FBL_Y__BREAK case 2: FBL_Y__RULE_SETUP #line 196 "../../../src/fvh/src/fbl_bcomp_l.l" { return(Ampersand); } FBL_Y__BREAK case 3: FBL_Y__RULE_SETUP #line 197 "../../../src/fvh/src/fbl_bcomp_l.l" { return(Apostrophe); } FBL_Y__BREAK case 4: FBL_Y__RULE_SETUP #line 198 "../../../src/fvh/src/fbl_bcomp_l.l" { return(LeftParen); } FBL_Y__BREAK case 5: FBL_Y__RULE_SETUP #line 199 "../../../src/fvh/src/fbl_bcomp_l.l" { return(RightParen); } FBL_Y__BREAK case 6: FBL_Y__RULE_SETUP #line 200 "../../../src/fvh/src/fbl_bcomp_l.l" { return(DoubleStar); } FBL_Y__BREAK case 7: FBL_Y__RULE_SETUP #line 201 "../../../src/fvh/src/fbl_bcomp_l.l" { return(Star); } FBL_Y__BREAK case 8: FBL_Y__RULE_SETUP #line 202 "../../../src/fvh/src/fbl_bcomp_l.l" { return(Plus); } FBL_Y__BREAK case 9: FBL_Y__RULE_SETUP #line 203 "../../../src/fvh/src/fbl_bcomp_l.l" { return(Comma); } FBL_Y__BREAK case 10: FBL_Y__RULE_SETUP #line 204 "../../../src/fvh/src/fbl_bcomp_l.l" { return(Minus); } FBL_Y__BREAK case 11: FBL_Y__RULE_SETUP #line 205 "../../../src/fvh/src/fbl_bcomp_l.l" { return(VarAsgn); } FBL_Y__BREAK case 12: FBL_Y__RULE_SETUP #line 206 "../../../src/fvh/src/fbl_bcomp_l.l" { return(Colon); } FBL_Y__BREAK case 13: FBL_Y__RULE_SETUP #line 207 "../../../src/fvh/src/fbl_bcomp_l.l" { return(Semicolon); } FBL_Y__BREAK case 14: FBL_Y__RULE_SETUP #line 208 "../../../src/fvh/src/fbl_bcomp_l.l" { return(_LESym); } FBL_Y__BREAK case 15: FBL_Y__RULE_SETUP #line 209 "../../../src/fvh/src/fbl_bcomp_l.l" { return(_GESym); } FBL_Y__BREAK case 16: FBL_Y__RULE_SETUP #line 210 "../../../src/fvh/src/fbl_bcomp_l.l" { return(_LTSym); } FBL_Y__BREAK case 17: FBL_Y__RULE_SETUP #line 211 "../../../src/fvh/src/fbl_bcomp_l.l" { return(_GTSym); } FBL_Y__BREAK case 18: FBL_Y__RULE_SETUP #line 212 "../../../src/fvh/src/fbl_bcomp_l.l" { return(_EQSym); } FBL_Y__BREAK case 19: FBL_Y__RULE_SETUP #line 213 "../../../src/fvh/src/fbl_bcomp_l.l" { return(_NESym); } FBL_Y__BREAK case 20: FBL_Y__RULE_SETUP #line 214 "../../../src/fvh/src/fbl_bcomp_l.l" { return(Arrow); } FBL_Y__BREAK case 21: FBL_Y__RULE_SETUP #line 215 "../../../src/fvh/src/fbl_bcomp_l.l" { return(Box); } FBL_Y__BREAK case 22: FBL_Y__RULE_SETUP #line 216 "../../../src/fvh/src/fbl_bcomp_l.l" { return(Bar); } FBL_Y__BREAK case 23: FBL_Y__RULE_SETUP #line 217 "../../../src/fvh/src/fbl_bcomp_l.l" { return(Bar); } FBL_Y__BREAK case 24: FBL_Y__RULE_SETUP #line 218 "../../../src/fvh/src/fbl_bcomp_l.l" { return(Dot); } FBL_Y__BREAK case 25: FBL_Y__RULE_SETUP #line 220 "../../../src/fvh/src/fbl_bcomp_l.l" { int itoken; itoken=find_mc(fbl_y_text); if (itoken== -1) { fbl_y_lval.text = namealloc(fbl_y_text); return ( Identifier ); } else { return ( itoken ); } } FBL_Y__BREAK case 26: FBL_Y__RULE_SETUP #line 233 "../../../src/fvh/src/fbl_bcomp_l.l" { fbl_y_lval.text = mbkalloc((unsigned int)strlen(fbl_y_text)+1); strcpy(fbl_y_lval.text,fbl_y_text); return ( AbstractLit ); } FBL_Y__BREAK case 27: FBL_Y__RULE_SETUP #line 238 "../../../src/fvh/src/fbl_bcomp_l.l" { fbl_y_lval.text = namealloc (fbl_y_text); return ( CharacterLit ); } FBL_Y__BREAK case 28: FBL_Y__RULE_SETUP #line 242 "../../../src/fvh/src/fbl_bcomp_l.l" { fbl_y_lval.text = namealloc (fbl_y_text); return ( StringLit ); } FBL_Y__BREAK case 29: FBL_Y__RULE_SETUP #line 246 "../../../src/fvh/src/fbl_bcomp_l.l" { fbl_y_lval.text = namealloc (fbl_y_text); return ( BitStringLit ); } FBL_Y__BREAK case 30: FBL_Y__RULE_SETUP #line 250 "../../../src/fvh/src/fbl_bcomp_l.l" { /* end of line */ FBL_LINNUM++; } FBL_Y__BREAK case 31: *fbl_y__cp = fbl_y__hold_char; /* undo effects of setting up fbl_y_text */ fbl_y__c_buf_p = fbl_y__cp -= 1; FBL_Y__DO_BEFORE_ACTION; /* set up fbl_y_text again */ FBL_Y__RULE_SETUP #line 254 "../../../src/fvh/src/fbl_bcomp_l.l" { /* pragma */ fbl_y_lval.text = namealloc (fbl_y_text); return(Pragma); } FBL_Y__BREAK case 32: *fbl_y__cp = fbl_y__hold_char; /* undo effects of setting up fbl_y_text */ fbl_y__c_buf_p = fbl_y__cp -= 1; FBL_Y__DO_BEFORE_ACTION; /* set up fbl_y_text again */ FBL_Y__RULE_SETUP #line 259 "../../../src/fvh/src/fbl_bcomp_l.l" { /* comment */ /* nothing */ } FBL_Y__BREAK case 33: FBL_Y__RULE_SETUP #line 263 "../../../src/fvh/src/fbl_bcomp_l.l" { return (*fbl_y_text); } FBL_Y__BREAK case 34: FBL_Y__RULE_SETUP #line 266 "../../../src/fvh/src/fbl_bcomp_l.l" ECHO; FBL_Y__BREAK case FBL_Y__STATE_EOF(INITIAL): fbl_y_terminate(); case FBL_Y__END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int fbl_y__amount_of_matched_text = (int) (fbl_y__cp - fbl_y_text_ptr) - 1; /* Undo the effects of FBL_Y__DO_BEFORE_ACTION. */ *fbl_y__cp = fbl_y__hold_char; FBL_Y__RESTORE_FBL_Y__MORE_OFFSET if ( fbl_y__current_buffer->fbl_y__buffer_status == FBL_Y__BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed fbl_y_in at a new source and called * fbl_y_lex(). If so, then we have to assure * consistency between fbl_y__current_buffer and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ fbl_y__n_chars = fbl_y__current_buffer->fbl_y__n_chars; fbl_y__current_buffer->fbl_y__input_file = fbl_y_in; fbl_y__current_buffer->fbl_y__buffer_status = FBL_Y__BUFFER_NORMAL; } /* Note that here we test for fbl_y__c_buf_p "<=" to the position * of the first EOB in the buffer, since fbl_y__c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( fbl_y__c_buf_p <= &fbl_y__current_buffer->fbl_y__ch_buf[fbl_y__n_chars] ) { /* This was really a NUL. */ fbl_y__state_type fbl_y__next_state; fbl_y__c_buf_p = fbl_y_text_ptr + fbl_y__amount_of_matched_text; fbl_y__current_state = fbl_y__get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * fbl_y__get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ fbl_y__next_state = fbl_y__try_NUL_trans( fbl_y__current_state ); fbl_y__bp = fbl_y_text_ptr + FBL_Y__MORE_ADJ; if ( fbl_y__next_state ) { /* Consume the NUL. */ fbl_y__cp = ++fbl_y__c_buf_p; fbl_y__current_state = fbl_y__next_state; goto fbl_y__match; } else { fbl_y__cp = fbl_y__c_buf_p; goto fbl_y__find_action; } } else switch ( fbl_y__get_next_buffer() ) { case EOB_ACT_END_OF_FILE: { fbl_y__did_buffer_switch_on_eof = 0; if ( fbl_y_wrap() ) { /* Note: because we've taken care in * fbl_y__get_next_buffer() to have set up * fbl_y_text, we can now set up * fbl_y__c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * FBL_Y__NULL, it'll still work - another * FBL_Y__NULL will get returned. */ fbl_y__c_buf_p = fbl_y_text_ptr + FBL_Y__MORE_ADJ; fbl_y__act = FBL_Y__STATE_EOF(FBL_Y__START); goto do_action; } else { if ( ! fbl_y__did_buffer_switch_on_eof ) FBL_Y__NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: fbl_y__c_buf_p = fbl_y_text_ptr + fbl_y__amount_of_matched_text; fbl_y__current_state = fbl_y__get_previous_state(); fbl_y__cp = fbl_y__c_buf_p; fbl_y__bp = fbl_y_text_ptr + FBL_Y__MORE_ADJ; goto fbl_y__match; case EOB_ACT_LAST_MATCH: fbl_y__c_buf_p = &fbl_y__current_buffer->fbl_y__ch_buf[fbl_y__n_chars]; fbl_y__current_state = fbl_y__get_previous_state(); fbl_y__cp = fbl_y__c_buf_p; fbl_y__bp = fbl_y_text_ptr + FBL_Y__MORE_ADJ; goto fbl_y__find_action; } break; } default: FBL_Y__FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of fbl_y_lex */ /* fbl_y__get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int fbl_y__get_next_buffer() { register char *dest = fbl_y__current_buffer->fbl_y__ch_buf; register char *source = fbl_y_text_ptr; register int number_to_move, i; int ret_val; if ( fbl_y__c_buf_p > &fbl_y__current_buffer->fbl_y__ch_buf[fbl_y__n_chars + 1] ) FBL_Y__FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( fbl_y__current_buffer->fbl_y__fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( fbl_y__c_buf_p - fbl_y_text_ptr - FBL_Y__MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) (fbl_y__c_buf_p - fbl_y_text_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( fbl_y__current_buffer->fbl_y__buffer_status == FBL_Y__BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ fbl_y__current_buffer->fbl_y__n_chars = fbl_y__n_chars = 0; else { int num_to_read = fbl_y__current_buffer->fbl_y__buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ #ifdef FBL_Y__USES_REJECT FBL_Y__FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); #else /* just a shorter name for the current buffer */ FBL_Y__BUFFER_STATE b = fbl_y__current_buffer; int fbl_y__c_buf_p_offset = (int) (fbl_y__c_buf_p - b->fbl_y__ch_buf); if ( b->fbl_y__is_our_buffer ) { int new_size = b->fbl_y__buf_size * 2; if ( new_size <= 0 ) b->fbl_y__buf_size += b->fbl_y__buf_size / 8; else b->fbl_y__buf_size *= 2; b->fbl_y__ch_buf = (char *) /* Include room in for 2 EOB chars. */ fbl_y__flex_realloc( (void *) b->fbl_y__ch_buf, b->fbl_y__buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->fbl_y__ch_buf = 0; if ( ! b->fbl_y__ch_buf ) FBL_Y__FATAL_ERROR( "fatal error - scanner input buffer overflow" ); fbl_y__c_buf_p = &b->fbl_y__ch_buf[fbl_y__c_buf_p_offset]; num_to_read = fbl_y__current_buffer->fbl_y__buf_size - number_to_move - 1; #endif } if ( num_to_read > FBL_Y__READ_BUF_SIZE ) num_to_read = FBL_Y__READ_BUF_SIZE; /* Read in more data. */ FBL_Y__INPUT( (&fbl_y__current_buffer->fbl_y__ch_buf[number_to_move]), fbl_y__n_chars, num_to_read ); fbl_y__current_buffer->fbl_y__n_chars = fbl_y__n_chars; } if ( fbl_y__n_chars == 0 ) { if ( number_to_move == FBL_Y__MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; fbl_y_restart( fbl_y_in ); } else { ret_val = EOB_ACT_LAST_MATCH; fbl_y__current_buffer->fbl_y__buffer_status = FBL_Y__BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; fbl_y__n_chars += number_to_move; fbl_y__current_buffer->fbl_y__ch_buf[fbl_y__n_chars] = FBL_Y__END_OF_BUFFER_CHAR; fbl_y__current_buffer->fbl_y__ch_buf[fbl_y__n_chars + 1] = FBL_Y__END_OF_BUFFER_CHAR; fbl_y_text_ptr = &fbl_y__current_buffer->fbl_y__ch_buf[0]; return ret_val; } /* fbl_y__get_previous_state - get the state just before the EOB char was reached */ static fbl_y__state_type fbl_y__get_previous_state() { register fbl_y__state_type fbl_y__current_state; register char *fbl_y__cp; fbl_y__current_state = fbl_y__start; for ( fbl_y__cp = fbl_y_text_ptr + FBL_Y__MORE_ADJ; fbl_y__cp < fbl_y__c_buf_p; ++fbl_y__cp ) { register FBL_Y__CHAR fbl_y__c = (*fbl_y__cp ? fbl_y__ec[FBL_Y__SC_TO_UI(*fbl_y__cp)] : 1); if ( fbl_y__accept[fbl_y__current_state] ) { fbl_y__last_accepting_state = fbl_y__current_state; fbl_y__last_accepting_cpos = fbl_y__cp; } while ( fbl_y__chk[fbl_y__base[fbl_y__current_state] + fbl_y__c] != fbl_y__current_state ) { fbl_y__current_state = (int) fbl_y__def[fbl_y__current_state]; if ( fbl_y__current_state >= 105 ) fbl_y__c = fbl_y__meta[(unsigned int) fbl_y__c]; } fbl_y__current_state = fbl_y__nxt[fbl_y__base[fbl_y__current_state] + (unsigned int) fbl_y__c]; } return fbl_y__current_state; } /* fbl_y__try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = fbl_y__try_NUL_trans( current_state ); */ #ifdef FBL_Y__USE_PROTOS static fbl_y__state_type fbl_y__try_NUL_trans( fbl_y__state_type fbl_y__current_state ) #else static fbl_y__state_type fbl_y__try_NUL_trans( fbl_y__current_state ) fbl_y__state_type fbl_y__current_state; #endif { register int fbl_y__is_jam; register char *fbl_y__cp = fbl_y__c_buf_p; register FBL_Y__CHAR fbl_y__c = 1; if ( fbl_y__accept[fbl_y__current_state] ) { fbl_y__last_accepting_state = fbl_y__current_state; fbl_y__last_accepting_cpos = fbl_y__cp; } while ( fbl_y__chk[fbl_y__base[fbl_y__current_state] + fbl_y__c] != fbl_y__current_state ) { fbl_y__current_state = (int) fbl_y__def[fbl_y__current_state]; if ( fbl_y__current_state >= 105 ) fbl_y__c = fbl_y__meta[(unsigned int) fbl_y__c]; } fbl_y__current_state = fbl_y__nxt[fbl_y__base[fbl_y__current_state] + (unsigned int) fbl_y__c]; fbl_y__is_jam = (fbl_y__current_state == 104); return fbl_y__is_jam ? 0 : fbl_y__current_state; } #ifndef FBL_Y__NO_UNPUT #ifdef FBL_Y__USE_PROTOS static void fbl_y_unput( int c, register char *fbl_y__bp ) #else static void fbl_y_unput( c, fbl_y__bp ) int c; register char *fbl_y__bp; #endif { register char *fbl_y__cp = fbl_y__c_buf_p; /* undo effects of setting up fbl_y_text */ *fbl_y__cp = fbl_y__hold_char; if ( fbl_y__cp < fbl_y__current_buffer->fbl_y__ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = fbl_y__n_chars + 2; register char *dest = &fbl_y__current_buffer->fbl_y__ch_buf[ fbl_y__current_buffer->fbl_y__buf_size + 2]; register char *source = &fbl_y__current_buffer->fbl_y__ch_buf[number_to_move]; while ( source > fbl_y__current_buffer->fbl_y__ch_buf ) *--dest = *--source; fbl_y__cp += (int) (dest - source); fbl_y__bp += (int) (dest - source); fbl_y__current_buffer->fbl_y__n_chars = fbl_y__n_chars = fbl_y__current_buffer->fbl_y__buf_size; if ( fbl_y__cp < fbl_y__current_buffer->fbl_y__ch_buf + 2 ) FBL_Y__FATAL_ERROR( "flex scanner push-back overflow" ); } *--fbl_y__cp = (char) c; fbl_y_text_ptr = fbl_y__bp; fbl_y__hold_char = *fbl_y__cp; fbl_y__c_buf_p = fbl_y__cp; } #endif /* ifndef FBL_Y__NO_UNPUT */ #ifndef FBL_Y__NO_INPUT #ifdef __cplusplus static int fbl_y_input() #else static int input() #endif { int c; *fbl_y__c_buf_p = fbl_y__hold_char; if ( *fbl_y__c_buf_p == FBL_Y__END_OF_BUFFER_CHAR ) { /* fbl_y__c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( fbl_y__c_buf_p < &fbl_y__current_buffer->fbl_y__ch_buf[fbl_y__n_chars] ) /* This was really a NUL. */ *fbl_y__c_buf_p = '\0'; else { /* need more input */ int offset = fbl_y__c_buf_p - fbl_y_text_ptr; ++fbl_y__c_buf_p; switch ( fbl_y__get_next_buffer() ) { case EOB_ACT_LAST_MATCH: /* This happens because fbl_y__g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ fbl_y_restart( fbl_y_in ); /* fall through */ case EOB_ACT_END_OF_FILE: { if ( fbl_y_wrap() ) return EOF; if ( ! fbl_y__did_buffer_switch_on_eof ) FBL_Y__NEW_FILE; #ifdef __cplusplus return fbl_y_input(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: fbl_y__c_buf_p = fbl_y_text_ptr + offset; break; } } } c = *(unsigned char *) fbl_y__c_buf_p; /* cast for 8-bit char's */ *fbl_y__c_buf_p = '\0'; /* preserve fbl_y_text */ fbl_y__hold_char = *++fbl_y__c_buf_p; return c; } #endif /* FBL_Y__NO_INPUT */ #ifdef FBL_Y__USE_PROTOS void fbl_y_restart( FILE *input_file ) #else void fbl_y_restart( input_file ) FILE *input_file; #endif { if ( ! fbl_y__current_buffer ) fbl_y__current_buffer = fbl_y__create_buffer( fbl_y_in, FBL_Y__BUF_SIZE ); fbl_y__init_buffer( fbl_y__current_buffer, input_file ); fbl_y__load_buffer_state(); } #ifdef FBL_Y__USE_PROTOS void fbl_y__switch_to_buffer( FBL_Y__BUFFER_STATE new_buffer ) #else void fbl_y__switch_to_buffer( new_buffer ) FBL_Y__BUFFER_STATE new_buffer; #endif { if ( fbl_y__current_buffer == new_buffer ) return; if ( fbl_y__current_buffer ) { /* Flush out information for old buffer. */ *fbl_y__c_buf_p = fbl_y__hold_char; fbl_y__current_buffer->fbl_y__buf_pos = fbl_y__c_buf_p; fbl_y__current_buffer->fbl_y__n_chars = fbl_y__n_chars; } fbl_y__current_buffer = new_buffer; fbl_y__load_buffer_state(); /* We don't actually know whether we did this switch during * EOF (fbl_y_wrap()) processing, but the only time this flag * is looked at is after fbl_y_wrap() is called, so it's safe * to go ahead and always set it. */ fbl_y__did_buffer_switch_on_eof = 1; } #ifdef FBL_Y__USE_PROTOS void fbl_y__load_buffer_state( void ) #else void fbl_y__load_buffer_state() #endif { fbl_y__n_chars = fbl_y__current_buffer->fbl_y__n_chars; fbl_y_text_ptr = fbl_y__c_buf_p = fbl_y__current_buffer->fbl_y__buf_pos; fbl_y_in = fbl_y__current_buffer->fbl_y__input_file; fbl_y__hold_char = *fbl_y__c_buf_p; } #ifdef FBL_Y__USE_PROTOS FBL_Y__BUFFER_STATE fbl_y__create_buffer( FILE *file, int size ) #else FBL_Y__BUFFER_STATE fbl_y__create_buffer( file, size ) FILE *file; int size; #endif { FBL_Y__BUFFER_STATE b; b = (FBL_Y__BUFFER_STATE) fbl_y__flex_alloc( sizeof( struct fbl_y__buffer_state ) ); if ( ! b ) FBL_Y__FATAL_ERROR( "out of dynamic memory in fbl_y__create_buffer()" ); b->fbl_y__buf_size = size; /* fbl_y__ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->fbl_y__ch_buf = (char *) fbl_y__flex_alloc( b->fbl_y__buf_size + 2 ); if ( ! b->fbl_y__ch_buf ) FBL_Y__FATAL_ERROR( "out of dynamic memory in fbl_y__create_buffer()" ); b->fbl_y__is_our_buffer = 1; fbl_y__init_buffer( b, file ); return b; } #ifdef FBL_Y__USE_PROTOS void fbl_y__delete_buffer( FBL_Y__BUFFER_STATE b ) #else void fbl_y__delete_buffer( b ) FBL_Y__BUFFER_STATE b; #endif { if ( ! b ) return; if ( b == fbl_y__current_buffer ) fbl_y__current_buffer = (FBL_Y__BUFFER_STATE) 0; if ( b->fbl_y__is_our_buffer ) fbl_y__flex_free( (void *) b->fbl_y__ch_buf ); fbl_y__flex_free( (void *) b ); } #ifdef FBL_Y__USE_PROTOS void fbl_y__init_buffer( FBL_Y__BUFFER_STATE b, FILE *file ) #else void fbl_y__init_buffer( b, file ) FBL_Y__BUFFER_STATE b; FILE *file; #endif { fbl_y__flush_buffer( b ); b->fbl_y__input_file = file; b->fbl_y__fill_buffer = 1; #if FBL_Y__ALWAYS_INTERACTIVE b->fbl_y__is_interactive = 1; #else #if FBL_Y__NEVER_INTERACTIVE b->fbl_y__is_interactive = 0; #else b->fbl_y__is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; #endif #endif } #ifdef FBL_Y__USE_PROTOS void fbl_y__flush_buffer( FBL_Y__BUFFER_STATE b ) #else void fbl_y__flush_buffer( b ) FBL_Y__BUFFER_STATE b; #endif { if ( ! b ) return; b->fbl_y__n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->fbl_y__ch_buf[0] = FBL_Y__END_OF_BUFFER_CHAR; b->fbl_y__ch_buf[1] = FBL_Y__END_OF_BUFFER_CHAR; b->fbl_y__buf_pos = &b->fbl_y__ch_buf[0]; b->fbl_y__at_bol = 1; b->fbl_y__buffer_status = FBL_Y__BUFFER_NEW; if ( b == fbl_y__current_buffer ) fbl_y__load_buffer_state(); } #ifndef FBL_Y__NO_SCAN_BUFFER #ifdef FBL_Y__USE_PROTOS FBL_Y__BUFFER_STATE fbl_y__scan_buffer( char *base, fbl_y__size_t size ) #else FBL_Y__BUFFER_STATE fbl_y__scan_buffer( base, size ) char *base; fbl_y__size_t size; #endif { FBL_Y__BUFFER_STATE b; if ( size < 2 || base[size-2] != FBL_Y__END_OF_BUFFER_CHAR || base[size-1] != FBL_Y__END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (FBL_Y__BUFFER_STATE) fbl_y__flex_alloc( sizeof( struct fbl_y__buffer_state ) ); if ( ! b ) FBL_Y__FATAL_ERROR( "out of dynamic memory in fbl_y__scan_buffer()" ); b->fbl_y__buf_size = size - 2; /* "- 2" to take care of EOB's */ b->fbl_y__buf_pos = b->fbl_y__ch_buf = base; b->fbl_y__is_our_buffer = 0; b->fbl_y__input_file = 0; b->fbl_y__n_chars = b->fbl_y__buf_size; b->fbl_y__is_interactive = 0; b->fbl_y__at_bol = 1; b->fbl_y__fill_buffer = 0; b->fbl_y__buffer_status = FBL_Y__BUFFER_NEW; fbl_y__switch_to_buffer( b ); return b; } #endif #ifndef FBL_Y__NO_SCAN_STRING #ifdef FBL_Y__USE_PROTOS FBL_Y__BUFFER_STATE fbl_y__scan_string( fbl_y_const char *fbl_y__str ) #else FBL_Y__BUFFER_STATE fbl_y__scan_string( fbl_y__str ) fbl_y_const char *fbl_y__str; #endif { int len; for ( len = 0; fbl_y__str[len]; ++len ) ; return fbl_y__scan_bytes( fbl_y__str, len ); } #endif #ifndef FBL_Y__NO_SCAN_BYTES #ifdef FBL_Y__USE_PROTOS FBL_Y__BUFFER_STATE fbl_y__scan_bytes( fbl_y_const char *bytes, int len ) #else FBL_Y__BUFFER_STATE fbl_y__scan_bytes( bytes, len ) fbl_y_const char *bytes; int len; #endif { FBL_Y__BUFFER_STATE b; char *buf; fbl_y__size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = len + 2; buf = (char *) fbl_y__flex_alloc( n ); if ( ! buf ) FBL_Y__FATAL_ERROR( "out of dynamic memory in fbl_y__scan_bytes()" ); for ( i = 0; i < len; ++i ) buf[i] = bytes[i]; buf[len] = buf[len+1] = FBL_Y__END_OF_BUFFER_CHAR; b = fbl_y__scan_buffer( buf, n ); if ( ! b ) FBL_Y__FATAL_ERROR( "bad buffer in fbl_y__scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->fbl_y__is_our_buffer = 1; return b; } #endif #ifndef FBL_Y__NO_PUSH_STATE #ifdef FBL_Y__USE_PROTOS static void fbl_y__push_state( int new_state ) #else static void fbl_y__push_state( new_state ) int new_state; #endif { if ( fbl_y__start_stack_ptr >= fbl_y__start_stack_depth ) { fbl_y__size_t new_size; fbl_y__start_stack_depth += FBL_Y__START_STACK_INCR; new_size = fbl_y__start_stack_depth * sizeof( int ); if ( ! fbl_y__start_stack ) fbl_y__start_stack = (int *) fbl_y__flex_alloc( new_size ); else fbl_y__start_stack = (int *) fbl_y__flex_realloc( (void *) fbl_y__start_stack, new_size ); if ( ! fbl_y__start_stack ) FBL_Y__FATAL_ERROR( "out of memory expanding start-condition stack" ); } fbl_y__start_stack[fbl_y__start_stack_ptr++] = FBL_Y__START; BEGIN(new_state); } #endif #ifndef FBL_Y__NO_POP_STATE static void fbl_y__pop_state() { if ( --fbl_y__start_stack_ptr < 0 ) FBL_Y__FATAL_ERROR( "start-condition stack underflow" ); BEGIN(fbl_y__start_stack[fbl_y__start_stack_ptr]); } #endif #ifndef FBL_Y__NO_TOP_STATE static int fbl_y__top_state() { return fbl_y__start_stack[fbl_y__start_stack_ptr - 1]; } #endif #ifndef FBL_Y__EXIT_FAILURE #define FBL_Y__EXIT_FAILURE 2 #endif #ifdef FBL_Y__USE_PROTOS static void fbl_y__fatal_error( fbl_y_const char msg[] ) #else static void fbl_y__fatal_error( msg ) char msg[]; #endif { (void) fprintf( stderr, "%s\n", msg ); exit( FBL_Y__EXIT_FAILURE ); } /* Redefine fbl_y_less() so it works in section 3 code. */ #undef fbl_y_less #define fbl_y_less(n) \ do \ { \ /* Undo effects of setting up fbl_y_text. */ \ fbl_y_text[fbl_y_leng] = fbl_y__hold_char; \ fbl_y__c_buf_p = fbl_y_text + n; \ fbl_y__hold_char = *fbl_y__c_buf_p; \ *fbl_y__c_buf_p = '\0'; \ fbl_y_leng = n; \ } \ while ( 0 ) /* Internal utility routines. */ #ifndef fbl_y_text_ptr #ifdef FBL_Y__USE_PROTOS static void fbl_y__flex_strncpy( char *s1, fbl_y_const char *s2, int n ) #else static void fbl_y__flex_strncpy( s1, s2, n ) char *s1; fbl_y_const char *s2; int n; #endif { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef FBL_Y__NEED_STRLEN #ifdef FBL_Y__USE_PROTOS static int fbl_y__flex_strlen( fbl_y_const char *s ) #else static int fbl_y__flex_strlen( s ) fbl_y_const char *s; #endif { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif #ifdef FBL_Y__USE_PROTOS static void *fbl_y__flex_alloc( fbl_y__size_t size ) #else static void *fbl_y__flex_alloc( size ) fbl_y__size_t size; #endif { return (void *) malloc( size ); } #ifdef FBL_Y__USE_PROTOS static void *fbl_y__flex_realloc( void *ptr, fbl_y__size_t size ) #else static void *fbl_y__flex_realloc( ptr, size ) void *ptr; fbl_y__size_t size; #endif { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } #ifdef FBL_Y__USE_PROTOS static void fbl_y__flex_free( void *ptr ) #else static void fbl_y__flex_free( ptr ) void *ptr; #endif { free( ptr ); } #if FBL_Y__MAIN int main() { fbl_y_lex(); return 0; } #endif #line 266 "../../../src/fvh/src/fbl_bcomp_l.l" int fbl_y_wrap() { return(1); }