/* 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 VBL_Y__FLEX_MAJOR_VERSION 2 #define VBL_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 VBL_Y__USE_PROTOS /* The "const" storage-class-modifier is valid. */ #define VBL_Y__USE_CONST #else /* ! __cplusplus */ #if __STDC__ #define VBL_Y__USE_PROTOS #define VBL_Y__USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ #ifdef __TURBOC__ #pragma warn -rch #pragma warn -use #include #include #define VBL_Y__USE_CONST #define VBL_Y__USE_PROTOS #endif #ifdef VBL_Y__USE_CONST #define vbl_y_const const #else #define vbl_y_const #endif #ifdef VBL_Y__USE_PROTOS #define VBL_Y__PROTO(proto) proto #else #define VBL_Y__PROTO(proto) () #endif /* Returned upon end-of-file. */ #define VBL_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 VBL_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 vbl_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 VBL_Y_STATE alias is for lex * compatibility. */ #define VBL_Y__START ((vbl_y__start - 1) / 2) #define VBL_Y_STATE VBL_Y__START /* Action number for EOF rule of a given start state. */ #define VBL_Y__STATE_EOF(state) (VBL_Y__END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define VBL_Y__NEW_FILE vbl_y_restart( vbl_y_in ) #define VBL_Y__END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #define VBL_Y__BUF_SIZE 16384 typedef struct vbl_y__buffer_state *VBL_Y__BUFFER_STATE; extern int vbl_y_leng; extern FILE *vbl_y_in, *vbl_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 ) * vbl_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 vbl_y_less() call. */ /* Return all but the first 'n' matched characters back to the input stream. */ #define vbl_y_less(n) \ do \ { \ /* Undo effects of setting up vbl_y_text. */ \ *vbl_y__cp = vbl_y__hold_char; \ VBL_Y__RESTORE_VBL_Y__MORE_OFFSET \ vbl_y__c_buf_p = vbl_y__cp = vbl_y__bp + n - VBL_Y__MORE_ADJ; \ VBL_Y__DO_BEFORE_ACTION; /* set up vbl_y_text again */ \ } \ while ( 0 ) #define unput(c) vbl_y_unput( c, vbl_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 vbl_y__size_t; struct vbl_y__buffer_state { FILE *vbl_y__input_file; char *vbl_y__ch_buf; /* input buffer */ char *vbl_y__buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ vbl_y__size_t vbl_y__buf_size; /* Number of characters read into vbl_y__ch_buf, not including EOB * characters. */ int vbl_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 vbl_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 vbl_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 vbl_y__at_bol; /* Whether to try to fill the input buffer when we reach the * end of it. */ int vbl_y__fill_buffer; int vbl_y__buffer_status; #define VBL_Y__BUFFER_NEW 0 #define VBL_Y__BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as VBL_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 vbl_y_restart()), so that the user can continue scanning by * just pointing vbl_y_in at a new input file. */ #define VBL_Y__BUFFER_EOF_PENDING 2 }; static VBL_Y__BUFFER_STATE vbl_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 VBL_Y__CURRENT_BUFFER vbl_y__current_buffer /* vbl_y__hold_char holds the character lost when vbl_y_text is formed. */ static char vbl_y__hold_char; static int vbl_y__n_chars; /* number of characters read into vbl_y__ch_buf */ int vbl_y_leng; /* Points to current character in buffer. */ static char *vbl_y__c_buf_p = (char *) 0; static int vbl_y__init = 1; /* whether we need to initialize */ static int vbl_y__start = 0; /* start state number */ /* Flag which is used to allow vbl_y_wrap()'s to do buffer switches * instead of setting up a fresh vbl_y_in. A bit of a hack ... */ static int vbl_y__did_buffer_switch_on_eof; void vbl_y_restart VBL_Y__PROTO(( FILE *input_file )); void vbl_y__switch_to_buffer VBL_Y__PROTO(( VBL_Y__BUFFER_STATE new_buffer )); void vbl_y__load_buffer_state VBL_Y__PROTO(( void )); VBL_Y__BUFFER_STATE vbl_y__create_buffer VBL_Y__PROTO(( FILE *file, int size )); void vbl_y__delete_buffer VBL_Y__PROTO(( VBL_Y__BUFFER_STATE b )); void vbl_y__init_buffer VBL_Y__PROTO(( VBL_Y__BUFFER_STATE b, FILE *file )); void vbl_y__flush_buffer VBL_Y__PROTO(( VBL_Y__BUFFER_STATE b )); #define VBL_Y__FLUSH_BUFFER vbl_y__flush_buffer( vbl_y__current_buffer ) VBL_Y__BUFFER_STATE vbl_y__scan_buffer VBL_Y__PROTO(( char *base, vbl_y__size_t size )); VBL_Y__BUFFER_STATE vbl_y__scan_string VBL_Y__PROTO(( vbl_y_const char *vbl_y__str )); VBL_Y__BUFFER_STATE vbl_y__scan_bytes VBL_Y__PROTO(( vbl_y_const char *bytes, int len )); static void *vbl_y__flex_alloc VBL_Y__PROTO(( vbl_y__size_t )); static void *vbl_y__flex_realloc VBL_Y__PROTO(( void *, vbl_y__size_t )); static void vbl_y__flex_free VBL_Y__PROTO(( void * )); #define vbl_y__new_buffer vbl_y__create_buffer #define vbl_y__set_interactive(is_interactive) \ { \ if ( ! vbl_y__current_buffer ) \ vbl_y__current_buffer = vbl_y__create_buffer( vbl_y_in, VBL_Y__BUF_SIZE ); \ vbl_y__current_buffer->vbl_y__is_interactive = is_interactive; \ } #define vbl_y__set_bol(at_bol) \ { \ if ( ! vbl_y__current_buffer ) \ vbl_y__current_buffer = vbl_y__create_buffer( vbl_y_in, VBL_Y__BUF_SIZE ); \ vbl_y__current_buffer->vbl_y__at_bol = at_bol; \ } #define VBL_Y__AT_BOL() (vbl_y__current_buffer->vbl_y__at_bol) typedef unsigned char VBL_Y__CHAR; FILE *vbl_y_in = (FILE *) 0, *vbl_y_out = (FILE *) 0; typedef int vbl_y__state_type; extern char *vbl_y_text; #define vbl_y_text_ptr vbl_y_text static vbl_y__state_type vbl_y__get_previous_state VBL_Y__PROTO(( void )); static vbl_y__state_type vbl_y__try_NUL_trans VBL_Y__PROTO(( vbl_y__state_type current_state )); static int vbl_y__get_next_buffer VBL_Y__PROTO(( void )); static void vbl_y__fatal_error VBL_Y__PROTO(( vbl_y_const char msg[] )); /* Done after the current pattern has been matched and before the * corresponding action - sets up vbl_y_text. */ #define VBL_Y__DO_BEFORE_ACTION \ vbl_y_text_ptr = vbl_y__bp; \ vbl_y_leng = (int) (vbl_y__cp - vbl_y__bp); \ vbl_y__hold_char = *vbl_y__cp; \ *vbl_y__cp = '\0'; \ vbl_y__c_buf_p = vbl_y__cp; #define VBL_Y__NUM_RULES 34 #define VBL_Y__END_OF_BUFFER 35 static vbl_y_const short int vbl_y__accept[96] = { 0, 0, 0, 35, 33, 1, 31, 23, 33, 33, 2, 3, 4, 5, 7, 8, 9, 10, 24, 25, 27, 12, 13, 16, 18, 17, 26, 26, 22, 0, 29, 0, 29, 0, 6, 0, 19, 0, 0, 27, 0, 0, 0, 11, 14, 21, 20, 15, 26, 0, 0, 0, 28, 0, 32, 0, 27, 0, 0, 27, 0, 0, 27, 0, 0, 0, 27, 0, 0, 0, 27, 0, 27, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 27, 27, 0, 27, 0, 0 } ; static vbl_y_const int vbl_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, 25, 25, 27, 25, 28, 28, 28, 28, 28, 28, 28, 28, 29, 28, 28, 28, 28, 28, 28, 28, 28, 30, 28, 28, 7, 7, 7, 7, 31, 7, 32, 33, 32, 32, 34, 32, 35, 35, 35, 35, 35, 35, 35, 35, 36, 35, 35, 35, 35, 35, 35, 35, 35, 37, 35, 35, 7, 38, 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 vbl_y_const int vbl_y__meta[39] = { 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, 9, 9, 9, 10, 7, 7, 7, 9, 9, 9, 2 } ; static vbl_y_const short int vbl_y__base[113] = { 0, 0, 0, 219, 220, 220, 220, 220, 213, 209, 220, 0, 220, 220, 203, 220, 220, 199, 220, 191, 33, 190, 220, 17, 188, 187, 175, 37, 220, 200, 198, 194, 191, 188, 220, 193, 220, 0, 174, 0, 0, 30, 173, 220, 220, 220, 220, 220, 159, 158, 0, 0, 220, 185, 220, 41, 32, 45, 166, 24, 43, 46, 44, 0, 63, 64, 56, 161, 0, 62, 57, 68, 42, 160, 220, 81, 84, 88, 89, 84, 86, 82, 90, 157, 91, 95, 99, 87, 94, 143, 92, 97, 113, 102, 112, 220, 132, 141, 150, 154, 164, 122, 120, 117, 101, 171, 176, 184, 190, 50, 49, 197, 201 } ; static vbl_y_const short int vbl_y__def[113] = { 0, 95, 1, 95, 95, 95, 95, 95, 96, 97, 95, 98, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 99, 99, 95, 96, 95, 97, 95, 95, 95, 100, 95, 101, 95, 20, 102, 95, 95, 95, 95, 95, 95, 95, 99, 99, 103, 104, 95, 100, 95, 105, 95, 106, 95, 95, 107, 108, 95, 109, 105, 105, 95, 95, 110, 106, 95, 106, 95, 95, 95, 107, 107, 108, 108, 95, 111, 112, 95, 95, 95, 111, 111, 112, 112, 95, 95, 95, 95, 95, 95, 0, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95 } ; static vbl_y_const short int vbl_y__nxt[259] = { 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, 27, 27, 4, 26, 27, 26, 26, 27, 27, 28, 37, 44, 45, 50, 72, 58, 51, 58, 62, 74, 59, 38, 66, 39, 40, 74, 73, 81, 80, 63, 41, 41, 72, 68, 67, 42, 70, 41, 41, 49, 62, 95, 79, 65, 73, 76, 66, 71, 78, 79, 68, 63, 95, 70, 41, 82, 95, 74, 67, 95, 95, 41, 82, 62, 71, 65, 95, 74, 95, 83, 95, 83, 62, 70, 84, 89, 95, 89, 70, 61, 90, 91, 93, 76, 88, 95, 95, 91, 86, 88, 78, 95, 93, 92, 94, 60, 95, 86, 57, 92, 55, 95, 93, 91, 94, 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, 90, 48, 48, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 64, 84, 64, 64, 72, 66, 64, 69, 69, 69, 59, 69, 75, 54, 95, 49, 75, 39, 56, 75, 77, 54, 77, 52, 31, 77, 85, 32, 29, 85, 30, 49, 85, 87, 87, 47, 87, 46, 43, 36, 35, 34, 32, 30, 95, 3, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95 } ; static vbl_y_const short int vbl_y__chk[259] = { 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, 20, 23, 23, 27, 59, 41, 27, 41, 55, 60, 41, 20, 56, 20, 20, 61, 59, 110, 109, 55, 56, 20, 72, 57, 56, 20, 57, 56, 20, 27, 64, 65, 62, 55, 72, 60, 66, 57, 61, 62, 69, 64, 65, 69, 66, 70, 71, 75, 66, 71, 76, 66, 70, 80, 69, 64, 65, 77, 78, 79, 71, 79, 85, 81, 79, 82, 86, 82, 87, 104, 82, 84, 90, 75, 81, 88, 76, 91, 80, 87, 77, 78, 93, 84, 90, 103, 88, 85, 102, 91, 101, 86, 94, 92, 93, 96, 96, 96, 96, 96, 96, 96, 96, 96, 97, 97, 97, 97, 97, 97, 97, 97, 97, 98, 98, 98, 98, 98, 98, 98, 98, 98, 99, 89, 99, 99, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 105, 83, 105, 105, 73, 67, 105, 106, 106, 106, 58, 106, 107, 53, 49, 48, 107, 42, 38, 107, 108, 35, 108, 33, 32, 108, 111, 31, 30, 111, 29, 26, 111, 112, 112, 25, 112, 24, 21, 19, 17, 14, 9, 8, 3, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95 } ; static vbl_y__state_type vbl_y__last_accepting_state; static char *vbl_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 vbl_y_more() vbl_y_more_used_but_not_detected #define VBL_Y__MORE_ADJ 0 #define VBL_Y__RESTORE_VBL_Y__MORE_OFFSET char *vbl_y_text; #line 1 "../../../src/vbl/src/vbl_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/vbl/src/vbl_bcomp_l.l" #include #include #include #include #include "mut.h" #include "aut.h" #include "vex.h" #include "vbh.h" typedef struct vbl_expr { vexexpr *IDENT; /* identifier or constant name */ vexexpr *VEX; /* pointer on bvl_abllst list */ short WIDTH; short TYPE; } vbl_vexstr; typedef struct { char *NAME; /* identifier name */ long LEFT; /* vector's left index */ long RIGHT; /* vector's right index */ short WIDTH; char FLAG; } vbl_name; struct g_type { int VALU; char FLAG; }; #include "vbl_bcomp_y.h" #include "vbl_bedef.h" #include "vbl_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}, {"false" ,_FALSE}, {"file" ,_FILE}, {"for" ,FOR}, {"fs" ,_FS}, {"function" ,FUNCTION}, {"generate" ,GENERATE}, {"generic" ,GENERIC}, {"guarded" ,GUARDED}, {"high" ,_HIGH}, {"if" ,IF}, {"ift" ,_IFT}, {"in" ,_IN}, {"inout" ,_INOUT}, {"is" ,IS}, {"label" ,_LABEL}, {"left" ,_LEFT}, {"length" ,_LENGTH}, {"library" ,_LIBRARY}, {"linkage" ,_LINKAGE}, {"loop" ,LOOP}, {"low" ,_LOW}, {"map" ,MAP}, {"mod" ,MOD}, {"ms" ,_MS}, {"nand" ,_NAND}, {"new" ,NEW}, {"next" ,_NEXT}, {"nor" ,_NOR}, {"not" ,_NOT}, {"ns" ,_NS}, {"null" ,tok_NULL}, {"nxor" ,_NXOR}, {"of" ,OF}, {"on" ,ON}, {"open" ,OPEN}, {"or" ,_OR}, {"others" ,OTHERS}, {"out" ,_OUT}, {"package" ,_PACKAGE}, {"port" ,PORT}, {"procedure" ,PROCEDURE}, {"process" ,PROCESS}, {"ps" ,_PS}, {"range" ,_RANGE}, {"record" ,RECORD}, {"register" ,REGISTER}, {"rem" ,REM}, {"report" ,REPORT}, {"return" ,_RETURN}, {"reverse_range" ,_REV_RANGE}, {"right" ,_RIGHT}, {"select" ,SELECT}, {"severity" ,SEVERITY}, {"signal" ,SIGNAL}, {"stable" ,_STABLE}, {"subtype" ,SUBTYPE}, {"then" ,THEN}, {"to" ,TO}, {"transport" ,TRANSPORT}, {"true" ,_TRUE }, {"type" ,_TYPE}, {"units" ,UNITS}, {"until" ,UNTIL}, {"use" ,USE}, {"variable" ,_VARIABLE}, {"wait" ,WAIT}, {"warning" ,WARNING}, {"when" ,WHEN}, {"while" ,WHILE}, {"with" ,WITH}, {"xnor" ,_NXOR}, {"xor" ,_XOR} }; static int find_mc(s) char *s; { char loc[512]; int l; el_mc *pt; l=strlen(s); strcpy(loc,s); while(l--) loc[l]=tolower(loc[l]); /* conversion en minuscules */ pt= (el_mc *) bsearch(loc, (char *)tab_mc,VBL_NB_MC,sizeof(el_mc), (int (*)(const void *, const void *)) strcmp); if (pt==NULL) return(-1); return(pt->kval); } int vbl_y_wrap () { return (1); } /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef VBL_Y__SKIP_VBL_Y_WRAP #ifdef __cplusplus extern "C" int vbl_y_wrap VBL_Y__PROTO(( void )); #else extern int vbl_y_wrap VBL_Y__PROTO(( void )); #endif #endif #ifndef VBL_Y__NO_UNPUT static void vbl_y_unput VBL_Y__PROTO(( int c, char *buf_ptr )); #endif #ifndef vbl_y_text_ptr static void vbl_y__flex_strncpy VBL_Y__PROTO(( char *, vbl_y_const char *, int )); #endif #ifdef VBL_Y__NEED_STRLEN static int vbl_y__flex_strlen VBL_Y__PROTO(( vbl_y_const char * )); #endif #ifndef VBL_Y__NO_INPUT #ifdef __cplusplus static int vbl_y_input VBL_Y__PROTO(( void )); #else static int input VBL_Y__PROTO(( void )); #endif #endif #if VBL_Y__STACK_USED static int vbl_y__start_stack_ptr = 0; static int vbl_y__start_stack_depth = 0; static int *vbl_y__start_stack = 0; #ifndef VBL_Y__NO_PUSH_STATE static void vbl_y__push_state VBL_Y__PROTO(( int new_state )); #endif #ifndef VBL_Y__NO_POP_STATE static void vbl_y__pop_state VBL_Y__PROTO(( void )); #endif #ifndef VBL_Y__NO_TOP_STATE static int vbl_y__top_state VBL_Y__PROTO(( void )); #endif #else #define VBL_Y__NO_PUSH_STATE 1 #define VBL_Y__NO_POP_STATE 1 #define VBL_Y__NO_TOP_STATE 1 #endif #ifdef VBL_Y__MALLOC_DECL VBL_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 VBL_Y__READ_BUF_SIZE #define VBL_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( vbl_y_text, vbl_y_leng, 1, vbl_y_out ) #endif /* Gets input and stuffs it into "buf". number of characters read, or VBL_Y__NULL, * is returned in "result". */ #ifndef VBL_Y__INPUT #define VBL_Y__INPUT(buf,result,max_size) \ if ( vbl_y__current_buffer->vbl_y__is_interactive ) \ { \ int c = '*', n; \ for ( n = 0; n < max_size && \ (c = getc( vbl_y_in )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( vbl_y_in ) ) \ VBL_Y__FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else if ( ((result = fread( buf, 1, max_size, vbl_y_in )) == 0) \ && ferror( vbl_y_in ) ) \ VBL_Y__FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "vbl_y_terminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef vbl_y_terminate #define vbl_y_terminate() return VBL_Y__NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef VBL_Y__START_STACK_INCR #define VBL_Y__START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef VBL_Y__FATAL_ERROR #define VBL_Y__FATAL_ERROR(msg) vbl_y__fatal_error( msg ) #endif /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef VBL_Y__DECL #define VBL_Y__DECL int vbl_y_lex VBL_Y__PROTO(( void )) #endif /* Code executed at the beginning of each rule, after vbl_y_text and vbl_y_leng * have been set up. */ #ifndef VBL_Y__USER_ACTION #define VBL_Y__USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef VBL_Y__BREAK #define VBL_Y__BREAK break; #endif #define VBL_Y__RULE_SETUP \ VBL_Y__USER_ACTION VBL_Y__DECL { register vbl_y__state_type vbl_y__current_state; register char *vbl_y__cp = NULL, *vbl_y__bp = NULL; register int vbl_y__act; #line 218 "../../../src/vbl/src/vbl_bcomp_l.l" if ( vbl_y__init ) { vbl_y__init = 0; #ifdef VBL_Y__USER_INIT VBL_Y__USER_INIT; #endif if ( ! vbl_y__start ) vbl_y__start = 1; /* first start state */ if ( ! vbl_y_in ) vbl_y_in = stdin; if ( ! vbl_y_out ) vbl_y_out = stdout; if ( ! vbl_y__current_buffer ) vbl_y__current_buffer = vbl_y__create_buffer( vbl_y_in, VBL_Y__BUF_SIZE ); vbl_y__load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { vbl_y__cp = vbl_y__c_buf_p; /* Support of vbl_y_text. */ *vbl_y__cp = vbl_y__hold_char; /* vbl_y__bp points to the position in vbl_y__ch_buf of the start of * the current run. */ vbl_y__bp = vbl_y__cp; vbl_y__current_state = vbl_y__start; vbl_y__match: do { register VBL_Y__CHAR vbl_y__c = vbl_y__ec[VBL_Y__SC_TO_UI(*vbl_y__cp)]; if ( vbl_y__accept[vbl_y__current_state] ) { vbl_y__last_accepting_state = vbl_y__current_state; vbl_y__last_accepting_cpos = vbl_y__cp; } while ( vbl_y__chk[vbl_y__base[vbl_y__current_state] + vbl_y__c] != vbl_y__current_state ) { vbl_y__current_state = (int) vbl_y__def[vbl_y__current_state]; if ( vbl_y__current_state >= 96 ) vbl_y__c = vbl_y__meta[(unsigned int) vbl_y__c]; } vbl_y__current_state = vbl_y__nxt[vbl_y__base[vbl_y__current_state] + (unsigned int) vbl_y__c]; ++vbl_y__cp; } while ( vbl_y__base[vbl_y__current_state] != 220 ); vbl_y__find_action: vbl_y__act = vbl_y__accept[vbl_y__current_state]; if ( vbl_y__act == 0 ) { /* have to back up */ vbl_y__cp = vbl_y__last_accepting_cpos; vbl_y__current_state = vbl_y__last_accepting_state; vbl_y__act = vbl_y__accept[vbl_y__current_state]; } VBL_Y__DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( vbl_y__act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of VBL_Y__DO_BEFORE_ACTION */ *vbl_y__cp = vbl_y__hold_char; vbl_y__cp = vbl_y__last_accepting_cpos; vbl_y__current_state = vbl_y__last_accepting_state; goto vbl_y__find_action; case 1: VBL_Y__RULE_SETUP #line 219 "../../../src/vbl/src/vbl_bcomp_l.l" ; VBL_Y__BREAK case 2: VBL_Y__RULE_SETUP #line 220 "../../../src/vbl/src/vbl_bcomp_l.l" { return(Ampersand); } VBL_Y__BREAK case 3: VBL_Y__RULE_SETUP #line 221 "../../../src/vbl/src/vbl_bcomp_l.l" { return(Apostrophe); } VBL_Y__BREAK case 4: VBL_Y__RULE_SETUP #line 222 "../../../src/vbl/src/vbl_bcomp_l.l" { return(LeftParen); } VBL_Y__BREAK case 5: VBL_Y__RULE_SETUP #line 223 "../../../src/vbl/src/vbl_bcomp_l.l" { return(RightParen); } VBL_Y__BREAK case 6: VBL_Y__RULE_SETUP #line 224 "../../../src/vbl/src/vbl_bcomp_l.l" { return(DoubleStar); } VBL_Y__BREAK case 7: VBL_Y__RULE_SETUP #line 225 "../../../src/vbl/src/vbl_bcomp_l.l" { return(Star); } VBL_Y__BREAK case 8: VBL_Y__RULE_SETUP #line 226 "../../../src/vbl/src/vbl_bcomp_l.l" { return(Plus); } VBL_Y__BREAK case 9: VBL_Y__RULE_SETUP #line 227 "../../../src/vbl/src/vbl_bcomp_l.l" { return(Comma); } VBL_Y__BREAK case 10: VBL_Y__RULE_SETUP #line 228 "../../../src/vbl/src/vbl_bcomp_l.l" { return(Minus); } VBL_Y__BREAK case 11: VBL_Y__RULE_SETUP #line 229 "../../../src/vbl/src/vbl_bcomp_l.l" { return(VarAsgn); } VBL_Y__BREAK case 12: VBL_Y__RULE_SETUP #line 230 "../../../src/vbl/src/vbl_bcomp_l.l" { return(Colon); } VBL_Y__BREAK case 13: VBL_Y__RULE_SETUP #line 231 "../../../src/vbl/src/vbl_bcomp_l.l" { return(Semicolon); } VBL_Y__BREAK case 14: VBL_Y__RULE_SETUP #line 232 "../../../src/vbl/src/vbl_bcomp_l.l" { return(_LESym); } VBL_Y__BREAK case 15: VBL_Y__RULE_SETUP #line 233 "../../../src/vbl/src/vbl_bcomp_l.l" { return(_GESym); } VBL_Y__BREAK case 16: VBL_Y__RULE_SETUP #line 234 "../../../src/vbl/src/vbl_bcomp_l.l" { return(_LTSym); } VBL_Y__BREAK case 17: VBL_Y__RULE_SETUP #line 235 "../../../src/vbl/src/vbl_bcomp_l.l" { return(_GTSym); } VBL_Y__BREAK case 18: VBL_Y__RULE_SETUP #line 236 "../../../src/vbl/src/vbl_bcomp_l.l" { return(_EQSym); } VBL_Y__BREAK case 19: VBL_Y__RULE_SETUP #line 237 "../../../src/vbl/src/vbl_bcomp_l.l" { return(_NESym); } VBL_Y__BREAK case 20: VBL_Y__RULE_SETUP #line 238 "../../../src/vbl/src/vbl_bcomp_l.l" { return(Arrow); } VBL_Y__BREAK case 21: VBL_Y__RULE_SETUP #line 239 "../../../src/vbl/src/vbl_bcomp_l.l" { return(Box); } VBL_Y__BREAK case 22: VBL_Y__RULE_SETUP #line 240 "../../../src/vbl/src/vbl_bcomp_l.l" { return(Bar); } VBL_Y__BREAK case 23: VBL_Y__RULE_SETUP #line 241 "../../../src/vbl/src/vbl_bcomp_l.l" { return(Bar); } VBL_Y__BREAK case 24: VBL_Y__RULE_SETUP #line 242 "../../../src/vbl/src/vbl_bcomp_l.l" { return(Dot); } VBL_Y__BREAK case 25: VBL_Y__RULE_SETUP #line 243 "../../../src/vbl/src/vbl_bcomp_l.l" { return(Slash); } VBL_Y__BREAK case 26: VBL_Y__RULE_SETUP #line 245 "../../../src/vbl/src/vbl_bcomp_l.l" { int itoken; itoken=find_mc(vbl_y_text); if (itoken== -1) { vbl_y_lval.text = namealloc(vbl_y_text); return ( Identifier ); } else { return ( itoken ); } } VBL_Y__BREAK case 27: VBL_Y__RULE_SETUP #line 258 "../../../src/vbl/src/vbl_bcomp_l.l" { vbl_y_lval.text = mbkalloc((unsigned int)strlen(vbl_y_text)+1); strcpy(vbl_y_lval.text,vbl_y_text); return ( AbstractLit ); } VBL_Y__BREAK case 28: VBL_Y__RULE_SETUP #line 263 "../../../src/vbl/src/vbl_bcomp_l.l" { vbl_y_lval.text = namealloc (vbl_y_text); return ( CharacterLit ); } VBL_Y__BREAK case 29: VBL_Y__RULE_SETUP #line 267 "../../../src/vbl/src/vbl_bcomp_l.l" { vbl_y_lval.text = namealloc (vbl_y_text); return ( StringLit ); } VBL_Y__BREAK case 30: VBL_Y__RULE_SETUP #line 271 "../../../src/vbl/src/vbl_bcomp_l.l" { vbl_y_lval.text = namealloc (vbl_y_text); return ( BitStringLit ); } VBL_Y__BREAK case 31: VBL_Y__RULE_SETUP #line 275 "../../../src/vbl/src/vbl_bcomp_l.l" { VBL_LINNUM++; } VBL_Y__BREAK case 32: *vbl_y__cp = vbl_y__hold_char; /* undo effects of setting up vbl_y_text */ vbl_y__c_buf_p = vbl_y__cp -= 1; VBL_Y__DO_BEFORE_ACTION; /* set up vbl_y_text again */ VBL_Y__RULE_SETUP #line 278 "../../../src/vbl/src/vbl_bcomp_l.l" { /* comment */ /* nothing */ } VBL_Y__BREAK case 33: VBL_Y__RULE_SETUP #line 282 "../../../src/vbl/src/vbl_bcomp_l.l" { return (*vbl_y_text); } VBL_Y__BREAK case 34: VBL_Y__RULE_SETUP #line 285 "../../../src/vbl/src/vbl_bcomp_l.l" ECHO; VBL_Y__BREAK case VBL_Y__STATE_EOF(INITIAL): vbl_y_terminate(); case VBL_Y__END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int vbl_y__amount_of_matched_text = (int) (vbl_y__cp - vbl_y_text_ptr) - 1; /* Undo the effects of VBL_Y__DO_BEFORE_ACTION. */ *vbl_y__cp = vbl_y__hold_char; VBL_Y__RESTORE_VBL_Y__MORE_OFFSET if ( vbl_y__current_buffer->vbl_y__buffer_status == VBL_Y__BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed vbl_y_in at a new source and called * vbl_y_lex(). If so, then we have to assure * consistency between vbl_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. */ vbl_y__n_chars = vbl_y__current_buffer->vbl_y__n_chars; vbl_y__current_buffer->vbl_y__input_file = vbl_y_in; vbl_y__current_buffer->vbl_y__buffer_status = VBL_Y__BUFFER_NORMAL; } /* Note that here we test for vbl_y__c_buf_p "<=" to the position * of the first EOB in the buffer, since vbl_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 ( vbl_y__c_buf_p <= &vbl_y__current_buffer->vbl_y__ch_buf[vbl_y__n_chars] ) { /* This was really a NUL. */ vbl_y__state_type vbl_y__next_state; vbl_y__c_buf_p = vbl_y_text_ptr + vbl_y__amount_of_matched_text; vbl_y__current_state = vbl_y__get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * vbl_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). */ vbl_y__next_state = vbl_y__try_NUL_trans( vbl_y__current_state ); vbl_y__bp = vbl_y_text_ptr + VBL_Y__MORE_ADJ; if ( vbl_y__next_state ) { /* Consume the NUL. */ vbl_y__cp = ++vbl_y__c_buf_p; vbl_y__current_state = vbl_y__next_state; goto vbl_y__match; } else { vbl_y__cp = vbl_y__c_buf_p; goto vbl_y__find_action; } } else switch ( vbl_y__get_next_buffer() ) { case EOB_ACT_END_OF_FILE: { vbl_y__did_buffer_switch_on_eof = 0; if ( vbl_y_wrap() ) { /* Note: because we've taken care in * vbl_y__get_next_buffer() to have set up * vbl_y_text, we can now set up * vbl_y__c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * VBL_Y__NULL, it'll still work - another * VBL_Y__NULL will get returned. */ vbl_y__c_buf_p = vbl_y_text_ptr + VBL_Y__MORE_ADJ; vbl_y__act = VBL_Y__STATE_EOF(VBL_Y__START); goto do_action; } else { if ( ! vbl_y__did_buffer_switch_on_eof ) VBL_Y__NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: vbl_y__c_buf_p = vbl_y_text_ptr + vbl_y__amount_of_matched_text; vbl_y__current_state = vbl_y__get_previous_state(); vbl_y__cp = vbl_y__c_buf_p; vbl_y__bp = vbl_y_text_ptr + VBL_Y__MORE_ADJ; goto vbl_y__match; case EOB_ACT_LAST_MATCH: vbl_y__c_buf_p = &vbl_y__current_buffer->vbl_y__ch_buf[vbl_y__n_chars]; vbl_y__current_state = vbl_y__get_previous_state(); vbl_y__cp = vbl_y__c_buf_p; vbl_y__bp = vbl_y_text_ptr + VBL_Y__MORE_ADJ; goto vbl_y__find_action; } break; } default: VBL_Y__FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of vbl_y_lex */ /* vbl_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 vbl_y__get_next_buffer() { register char *dest = vbl_y__current_buffer->vbl_y__ch_buf; register char *source = vbl_y_text_ptr; register int number_to_move, i; int ret_val; if ( vbl_y__c_buf_p > &vbl_y__current_buffer->vbl_y__ch_buf[vbl_y__n_chars + 1] ) VBL_Y__FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( vbl_y__current_buffer->vbl_y__fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( vbl_y__c_buf_p - vbl_y_text_ptr - VBL_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) (vbl_y__c_buf_p - vbl_y_text_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( vbl_y__current_buffer->vbl_y__buffer_status == VBL_Y__BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ vbl_y__current_buffer->vbl_y__n_chars = vbl_y__n_chars = 0; else { int num_to_read = vbl_y__current_buffer->vbl_y__buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ #ifdef VBL_Y__USES_REJECT VBL_Y__FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); #else /* just a shorter name for the current buffer */ VBL_Y__BUFFER_STATE b = vbl_y__current_buffer; int vbl_y__c_buf_p_offset = (int) (vbl_y__c_buf_p - b->vbl_y__ch_buf); if ( b->vbl_y__is_our_buffer ) { int new_size = b->vbl_y__buf_size * 2; if ( new_size <= 0 ) b->vbl_y__buf_size += b->vbl_y__buf_size / 8; else b->vbl_y__buf_size *= 2; b->vbl_y__ch_buf = (char *) /* Include room in for 2 EOB chars. */ vbl_y__flex_realloc( (void *) b->vbl_y__ch_buf, b->vbl_y__buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->vbl_y__ch_buf = 0; if ( ! b->vbl_y__ch_buf ) VBL_Y__FATAL_ERROR( "fatal error - scanner input buffer overflow" ); vbl_y__c_buf_p = &b->vbl_y__ch_buf[vbl_y__c_buf_p_offset]; num_to_read = vbl_y__current_buffer->vbl_y__buf_size - number_to_move - 1; #endif } if ( num_to_read > VBL_Y__READ_BUF_SIZE ) num_to_read = VBL_Y__READ_BUF_SIZE; /* Read in more data. */ VBL_Y__INPUT( (&vbl_y__current_buffer->vbl_y__ch_buf[number_to_move]), vbl_y__n_chars, num_to_read ); vbl_y__current_buffer->vbl_y__n_chars = vbl_y__n_chars; } if ( vbl_y__n_chars == 0 ) { if ( number_to_move == VBL_Y__MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; vbl_y_restart( vbl_y_in ); } else { ret_val = EOB_ACT_LAST_MATCH; vbl_y__current_buffer->vbl_y__buffer_status = VBL_Y__BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; vbl_y__n_chars += number_to_move; vbl_y__current_buffer->vbl_y__ch_buf[vbl_y__n_chars] = VBL_Y__END_OF_BUFFER_CHAR; vbl_y__current_buffer->vbl_y__ch_buf[vbl_y__n_chars + 1] = VBL_Y__END_OF_BUFFER_CHAR; vbl_y_text_ptr = &vbl_y__current_buffer->vbl_y__ch_buf[0]; return ret_val; } /* vbl_y__get_previous_state - get the state just before the EOB char was reached */ static vbl_y__state_type vbl_y__get_previous_state() { register vbl_y__state_type vbl_y__current_state; register char *vbl_y__cp; vbl_y__current_state = vbl_y__start; for ( vbl_y__cp = vbl_y_text_ptr + VBL_Y__MORE_ADJ; vbl_y__cp < vbl_y__c_buf_p; ++vbl_y__cp ) { register VBL_Y__CHAR vbl_y__c = (*vbl_y__cp ? vbl_y__ec[VBL_Y__SC_TO_UI(*vbl_y__cp)] : 1); if ( vbl_y__accept[vbl_y__current_state] ) { vbl_y__last_accepting_state = vbl_y__current_state; vbl_y__last_accepting_cpos = vbl_y__cp; } while ( vbl_y__chk[vbl_y__base[vbl_y__current_state] + vbl_y__c] != vbl_y__current_state ) { vbl_y__current_state = (int) vbl_y__def[vbl_y__current_state]; if ( vbl_y__current_state >= 96 ) vbl_y__c = vbl_y__meta[(unsigned int) vbl_y__c]; } vbl_y__current_state = vbl_y__nxt[vbl_y__base[vbl_y__current_state] + (unsigned int) vbl_y__c]; } return vbl_y__current_state; } /* vbl_y__try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = vbl_y__try_NUL_trans( current_state ); */ #ifdef VBL_Y__USE_PROTOS static vbl_y__state_type vbl_y__try_NUL_trans( vbl_y__state_type vbl_y__current_state ) #else static vbl_y__state_type vbl_y__try_NUL_trans( vbl_y__current_state ) vbl_y__state_type vbl_y__current_state; #endif { register int vbl_y__is_jam; register char *vbl_y__cp = vbl_y__c_buf_p; register VBL_Y__CHAR vbl_y__c = 1; if ( vbl_y__accept[vbl_y__current_state] ) { vbl_y__last_accepting_state = vbl_y__current_state; vbl_y__last_accepting_cpos = vbl_y__cp; } while ( vbl_y__chk[vbl_y__base[vbl_y__current_state] + vbl_y__c] != vbl_y__current_state ) { vbl_y__current_state = (int) vbl_y__def[vbl_y__current_state]; if ( vbl_y__current_state >= 96 ) vbl_y__c = vbl_y__meta[(unsigned int) vbl_y__c]; } vbl_y__current_state = vbl_y__nxt[vbl_y__base[vbl_y__current_state] + (unsigned int) vbl_y__c]; vbl_y__is_jam = (vbl_y__current_state == 95); return vbl_y__is_jam ? 0 : vbl_y__current_state; } #ifndef VBL_Y__NO_UNPUT #ifdef VBL_Y__USE_PROTOS static void vbl_y_unput( int c, register char *vbl_y__bp ) #else static void vbl_y_unput( c, vbl_y__bp ) int c; register char *vbl_y__bp; #endif { register char *vbl_y__cp = vbl_y__c_buf_p; /* undo effects of setting up vbl_y_text */ *vbl_y__cp = vbl_y__hold_char; if ( vbl_y__cp < vbl_y__current_buffer->vbl_y__ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = vbl_y__n_chars + 2; register char *dest = &vbl_y__current_buffer->vbl_y__ch_buf[ vbl_y__current_buffer->vbl_y__buf_size + 2]; register char *source = &vbl_y__current_buffer->vbl_y__ch_buf[number_to_move]; while ( source > vbl_y__current_buffer->vbl_y__ch_buf ) *--dest = *--source; vbl_y__cp += (int) (dest - source); vbl_y__bp += (int) (dest - source); vbl_y__current_buffer->vbl_y__n_chars = vbl_y__n_chars = vbl_y__current_buffer->vbl_y__buf_size; if ( vbl_y__cp < vbl_y__current_buffer->vbl_y__ch_buf + 2 ) VBL_Y__FATAL_ERROR( "flex scanner push-back overflow" ); } *--vbl_y__cp = (char) c; vbl_y_text_ptr = vbl_y__bp; vbl_y__hold_char = *vbl_y__cp; vbl_y__c_buf_p = vbl_y__cp; } #endif /* ifndef VBL_Y__NO_UNPUT */ #ifndef VBL_Y__NO_INPUT #ifdef __cplusplus static int vbl_y_input() #else static int input() #endif { int c; *vbl_y__c_buf_p = vbl_y__hold_char; if ( *vbl_y__c_buf_p == VBL_Y__END_OF_BUFFER_CHAR ) { /* vbl_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 ( vbl_y__c_buf_p < &vbl_y__current_buffer->vbl_y__ch_buf[vbl_y__n_chars] ) /* This was really a NUL. */ *vbl_y__c_buf_p = '\0'; else { /* need more input */ int offset = vbl_y__c_buf_p - vbl_y_text_ptr; ++vbl_y__c_buf_p; switch ( vbl_y__get_next_buffer() ) { case EOB_ACT_LAST_MATCH: /* This happens because vbl_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. */ vbl_y_restart( vbl_y_in ); /* fall through */ case EOB_ACT_END_OF_FILE: { if ( vbl_y_wrap() ) return EOF; if ( ! vbl_y__did_buffer_switch_on_eof ) VBL_Y__NEW_FILE; #ifdef __cplusplus return vbl_y_input(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: vbl_y__c_buf_p = vbl_y_text_ptr + offset; break; } } } c = *(unsigned char *) vbl_y__c_buf_p; /* cast for 8-bit char's */ *vbl_y__c_buf_p = '\0'; /* preserve vbl_y_text */ vbl_y__hold_char = *++vbl_y__c_buf_p; return c; } #endif /* VBL_Y__NO_INPUT */ #ifdef VBL_Y__USE_PROTOS void vbl_y_restart( FILE *input_file ) #else void vbl_y_restart( input_file ) FILE *input_file; #endif { if ( ! vbl_y__current_buffer ) vbl_y__current_buffer = vbl_y__create_buffer( vbl_y_in, VBL_Y__BUF_SIZE ); vbl_y__init_buffer( vbl_y__current_buffer, input_file ); vbl_y__load_buffer_state(); } #ifdef VBL_Y__USE_PROTOS void vbl_y__switch_to_buffer( VBL_Y__BUFFER_STATE new_buffer ) #else void vbl_y__switch_to_buffer( new_buffer ) VBL_Y__BUFFER_STATE new_buffer; #endif { if ( vbl_y__current_buffer == new_buffer ) return; if ( vbl_y__current_buffer ) { /* Flush out information for old buffer. */ *vbl_y__c_buf_p = vbl_y__hold_char; vbl_y__current_buffer->vbl_y__buf_pos = vbl_y__c_buf_p; vbl_y__current_buffer->vbl_y__n_chars = vbl_y__n_chars; } vbl_y__current_buffer = new_buffer; vbl_y__load_buffer_state(); /* We don't actually know whether we did this switch during * EOF (vbl_y_wrap()) processing, but the only time this flag * is looked at is after vbl_y_wrap() is called, so it's safe * to go ahead and always set it. */ vbl_y__did_buffer_switch_on_eof = 1; } #ifdef VBL_Y__USE_PROTOS void vbl_y__load_buffer_state( void ) #else void vbl_y__load_buffer_state() #endif { vbl_y__n_chars = vbl_y__current_buffer->vbl_y__n_chars; vbl_y_text_ptr = vbl_y__c_buf_p = vbl_y__current_buffer->vbl_y__buf_pos; vbl_y_in = vbl_y__current_buffer->vbl_y__input_file; vbl_y__hold_char = *vbl_y__c_buf_p; } #ifdef VBL_Y__USE_PROTOS VBL_Y__BUFFER_STATE vbl_y__create_buffer( FILE *file, int size ) #else VBL_Y__BUFFER_STATE vbl_y__create_buffer( file, size ) FILE *file; int size; #endif { VBL_Y__BUFFER_STATE b; b = (VBL_Y__BUFFER_STATE) vbl_y__flex_alloc( sizeof( struct vbl_y__buffer_state ) ); if ( ! b ) VBL_Y__FATAL_ERROR( "out of dynamic memory in vbl_y__create_buffer()" ); b->vbl_y__buf_size = size; /* vbl_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->vbl_y__ch_buf = (char *) vbl_y__flex_alloc( b->vbl_y__buf_size + 2 ); if ( ! b->vbl_y__ch_buf ) VBL_Y__FATAL_ERROR( "out of dynamic memory in vbl_y__create_buffer()" ); b->vbl_y__is_our_buffer = 1; vbl_y__init_buffer( b, file ); return b; } #ifdef VBL_Y__USE_PROTOS void vbl_y__delete_buffer( VBL_Y__BUFFER_STATE b ) #else void vbl_y__delete_buffer( b ) VBL_Y__BUFFER_STATE b; #endif { if ( ! b ) return; if ( b == vbl_y__current_buffer ) vbl_y__current_buffer = (VBL_Y__BUFFER_STATE) 0; if ( b->vbl_y__is_our_buffer ) vbl_y__flex_free( (void *) b->vbl_y__ch_buf ); vbl_y__flex_free( (void *) b ); } #ifdef VBL_Y__USE_PROTOS void vbl_y__init_buffer( VBL_Y__BUFFER_STATE b, FILE *file ) #else void vbl_y__init_buffer( b, file ) VBL_Y__BUFFER_STATE b; FILE *file; #endif { vbl_y__flush_buffer( b ); b->vbl_y__input_file = file; b->vbl_y__fill_buffer = 1; #if VBL_Y__ALWAYS_INTERACTIVE b->vbl_y__is_interactive = 1; #else #if VBL_Y__NEVER_INTERACTIVE b->vbl_y__is_interactive = 0; #else b->vbl_y__is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; #endif #endif } #ifdef VBL_Y__USE_PROTOS void vbl_y__flush_buffer( VBL_Y__BUFFER_STATE b ) #else void vbl_y__flush_buffer( b ) VBL_Y__BUFFER_STATE b; #endif { if ( ! b ) return; b->vbl_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->vbl_y__ch_buf[0] = VBL_Y__END_OF_BUFFER_CHAR; b->vbl_y__ch_buf[1] = VBL_Y__END_OF_BUFFER_CHAR; b->vbl_y__buf_pos = &b->vbl_y__ch_buf[0]; b->vbl_y__at_bol = 1; b->vbl_y__buffer_status = VBL_Y__BUFFER_NEW; if ( b == vbl_y__current_buffer ) vbl_y__load_buffer_state(); } #ifndef VBL_Y__NO_SCAN_BUFFER #ifdef VBL_Y__USE_PROTOS VBL_Y__BUFFER_STATE vbl_y__scan_buffer( char *base, vbl_y__size_t size ) #else VBL_Y__BUFFER_STATE vbl_y__scan_buffer( base, size ) char *base; vbl_y__size_t size; #endif { VBL_Y__BUFFER_STATE b; if ( size < 2 || base[size-2] != VBL_Y__END_OF_BUFFER_CHAR || base[size-1] != VBL_Y__END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (VBL_Y__BUFFER_STATE) vbl_y__flex_alloc( sizeof( struct vbl_y__buffer_state ) ); if ( ! b ) VBL_Y__FATAL_ERROR( "out of dynamic memory in vbl_y__scan_buffer()" ); b->vbl_y__buf_size = size - 2; /* "- 2" to take care of EOB's */ b->vbl_y__buf_pos = b->vbl_y__ch_buf = base; b->vbl_y__is_our_buffer = 0; b->vbl_y__input_file = 0; b->vbl_y__n_chars = b->vbl_y__buf_size; b->vbl_y__is_interactive = 0; b->vbl_y__at_bol = 1; b->vbl_y__fill_buffer = 0; b->vbl_y__buffer_status = VBL_Y__BUFFER_NEW; vbl_y__switch_to_buffer( b ); return b; } #endif #ifndef VBL_Y__NO_SCAN_STRING #ifdef VBL_Y__USE_PROTOS VBL_Y__BUFFER_STATE vbl_y__scan_string( vbl_y_const char *vbl_y__str ) #else VBL_Y__BUFFER_STATE vbl_y__scan_string( vbl_y__str ) vbl_y_const char *vbl_y__str; #endif { int len; for ( len = 0; vbl_y__str[len]; ++len ) ; return vbl_y__scan_bytes( vbl_y__str, len ); } #endif #ifndef VBL_Y__NO_SCAN_BYTES #ifdef VBL_Y__USE_PROTOS VBL_Y__BUFFER_STATE vbl_y__scan_bytes( vbl_y_const char *bytes, int len ) #else VBL_Y__BUFFER_STATE vbl_y__scan_bytes( bytes, len ) vbl_y_const char *bytes; int len; #endif { VBL_Y__BUFFER_STATE b; char *buf; vbl_y__size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = len + 2; buf = (char *) vbl_y__flex_alloc( n ); if ( ! buf ) VBL_Y__FATAL_ERROR( "out of dynamic memory in vbl_y__scan_bytes()" ); for ( i = 0; i < len; ++i ) buf[i] = bytes[i]; buf[len] = buf[len+1] = VBL_Y__END_OF_BUFFER_CHAR; b = vbl_y__scan_buffer( buf, n ); if ( ! b ) VBL_Y__FATAL_ERROR( "bad buffer in vbl_y__scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->vbl_y__is_our_buffer = 1; return b; } #endif #ifndef VBL_Y__NO_PUSH_STATE #ifdef VBL_Y__USE_PROTOS static void vbl_y__push_state( int new_state ) #else static void vbl_y__push_state( new_state ) int new_state; #endif { if ( vbl_y__start_stack_ptr >= vbl_y__start_stack_depth ) { vbl_y__size_t new_size; vbl_y__start_stack_depth += VBL_Y__START_STACK_INCR; new_size = vbl_y__start_stack_depth * sizeof( int ); if ( ! vbl_y__start_stack ) vbl_y__start_stack = (int *) vbl_y__flex_alloc( new_size ); else vbl_y__start_stack = (int *) vbl_y__flex_realloc( (void *) vbl_y__start_stack, new_size ); if ( ! vbl_y__start_stack ) VBL_Y__FATAL_ERROR( "out of memory expanding start-condition stack" ); } vbl_y__start_stack[vbl_y__start_stack_ptr++] = VBL_Y__START; BEGIN(new_state); } #endif #ifndef VBL_Y__NO_POP_STATE static void vbl_y__pop_state() { if ( --vbl_y__start_stack_ptr < 0 ) VBL_Y__FATAL_ERROR( "start-condition stack underflow" ); BEGIN(vbl_y__start_stack[vbl_y__start_stack_ptr]); } #endif #ifndef VBL_Y__NO_TOP_STATE static int vbl_y__top_state() { return vbl_y__start_stack[vbl_y__start_stack_ptr - 1]; } #endif #ifndef VBL_Y__EXIT_FAILURE #define VBL_Y__EXIT_FAILURE 2 #endif #ifdef VBL_Y__USE_PROTOS static void vbl_y__fatal_error( vbl_y_const char msg[] ) #else static void vbl_y__fatal_error( msg ) char msg[]; #endif { (void) fprintf( stderr, "%s\n", msg ); exit( VBL_Y__EXIT_FAILURE ); } /* Redefine vbl_y_less() so it works in section 3 code. */ #undef vbl_y_less #define vbl_y_less(n) \ do \ { \ /* Undo effects of setting up vbl_y_text. */ \ vbl_y_text[vbl_y_leng] = vbl_y__hold_char; \ vbl_y__c_buf_p = vbl_y_text + n; \ vbl_y__hold_char = *vbl_y__c_buf_p; \ *vbl_y__c_buf_p = '\0'; \ vbl_y_leng = n; \ } \ while ( 0 ) /* Internal utility routines. */ #ifndef vbl_y_text_ptr #ifdef VBL_Y__USE_PROTOS static void vbl_y__flex_strncpy( char *s1, vbl_y_const char *s2, int n ) #else static void vbl_y__flex_strncpy( s1, s2, n ) char *s1; vbl_y_const char *s2; int n; #endif { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef VBL_Y__NEED_STRLEN #ifdef VBL_Y__USE_PROTOS static int vbl_y__flex_strlen( vbl_y_const char *s ) #else static int vbl_y__flex_strlen( s ) vbl_y_const char *s; #endif { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif #ifdef VBL_Y__USE_PROTOS static void *vbl_y__flex_alloc( vbl_y__size_t size ) #else static void *vbl_y__flex_alloc( size ) vbl_y__size_t size; #endif { return (void *) malloc( size ); } #ifdef VBL_Y__USE_PROTOS static void *vbl_y__flex_realloc( void *ptr, vbl_y__size_t size ) #else static void *vbl_y__flex_realloc( ptr, size ) void *ptr; vbl_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 VBL_Y__USE_PROTOS static void vbl_y__flex_free( void *ptr ) #else static void vbl_y__flex_free( ptr ) void *ptr; #endif { free( ptr ); } #if VBL_Y__MAIN int main() { vbl_y_lex(); return 0; } #endif #line 285 "../../../src/vbl/src/vbl_bcomp_l.l"