/* 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 MVL_Y__FLEX_MAJOR_VERSION 2 #define MVL_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 MVL_Y__USE_PROTOS /* The "const" storage-class-modifier is valid. */ #define MVL_Y__USE_CONST #else /* ! __cplusplus */ #if __STDC__ #define MVL_Y__USE_PROTOS #define MVL_Y__USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ #ifdef __TURBOC__ #pragma warn -rch #pragma warn -use #include #include #define MVL_Y__USE_CONST #define MVL_Y__USE_PROTOS #endif #ifdef MVL_Y__USE_CONST #define mvl_y_const const #else #define mvl_y_const #endif #ifdef MVL_Y__USE_PROTOS #define MVL_Y__PROTO(proto) proto #else #define MVL_Y__PROTO(proto) () #endif /* Returned upon end-of-file. */ #define MVL_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 MVL_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 mvl_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 MVL_Y_STATE alias is for lex * compatibility. */ #define MVL_Y__START ((mvl_y__start - 1) / 2) #define MVL_Y_STATE MVL_Y__START /* Action number for EOF rule of a given start state. */ #define MVL_Y__STATE_EOF(state) (MVL_Y__END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define MVL_Y__NEW_FILE mvl_y_restart( mvl_y_in ) #define MVL_Y__END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #define MVL_Y__BUF_SIZE 16384 typedef struct mvl_y__buffer_state *MVL_Y__BUFFER_STATE; extern int mvl_y_leng; extern FILE *mvl_y_in, *mvl_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 ) * mvl_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 mvl_y_less() call. */ /* Return all but the first 'n' matched characters back to the input stream. */ #define mvl_y_less(n) \ do \ { \ /* Undo effects of setting up mvl_y_text. */ \ *mvl_y__cp = mvl_y__hold_char; \ MVL_Y__RESTORE_MVL_Y__MORE_OFFSET \ mvl_y__c_buf_p = mvl_y__cp = mvl_y__bp + n - MVL_Y__MORE_ADJ; \ MVL_Y__DO_BEFORE_ACTION; /* set up mvl_y_text again */ \ } \ while ( 0 ) #define unput(c) mvl_y_unput( c, mvl_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 mvl_y__size_t; struct mvl_y__buffer_state { FILE *mvl_y__input_file; char *mvl_y__ch_buf; /* input buffer */ char *mvl_y__buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ mvl_y__size_t mvl_y__buf_size; /* Number of characters read into mvl_y__ch_buf, not including EOB * characters. */ int mvl_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 mvl_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 mvl_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 mvl_y__at_bol; /* Whether to try to fill the input buffer when we reach the * end of it. */ int mvl_y__fill_buffer; int mvl_y__buffer_status; #define MVL_Y__BUFFER_NEW 0 #define MVL_Y__BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as MVL_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 mvl_y_restart()), so that the user can continue scanning by * just pointing mvl_y_in at a new input file. */ #define MVL_Y__BUFFER_EOF_PENDING 2 }; static MVL_Y__BUFFER_STATE mvl_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 MVL_Y__CURRENT_BUFFER mvl_y__current_buffer /* mvl_y__hold_char holds the character lost when mvl_y_text is formed. */ static char mvl_y__hold_char; static int mvl_y__n_chars; /* number of characters read into mvl_y__ch_buf */ int mvl_y_leng; /* Points to current character in buffer. */ static char *mvl_y__c_buf_p = (char *) 0; static int mvl_y__init = 1; /* whether we need to initialize */ static int mvl_y__start = 0; /* start state number */ /* Flag which is used to allow mvl_y_wrap()'s to do buffer switches * instead of setting up a fresh mvl_y_in. A bit of a hack ... */ static int mvl_y__did_buffer_switch_on_eof; void mvl_y_restart MVL_Y__PROTO(( FILE *input_file )); void mvl_y__switch_to_buffer MVL_Y__PROTO(( MVL_Y__BUFFER_STATE new_buffer )); void mvl_y__load_buffer_state MVL_Y__PROTO(( void )); MVL_Y__BUFFER_STATE mvl_y__create_buffer MVL_Y__PROTO(( FILE *file, int size )); void mvl_y__delete_buffer MVL_Y__PROTO(( MVL_Y__BUFFER_STATE b )); void mvl_y__init_buffer MVL_Y__PROTO(( MVL_Y__BUFFER_STATE b, FILE *file )); void mvl_y__flush_buffer MVL_Y__PROTO(( MVL_Y__BUFFER_STATE b )); #define MVL_Y__FLUSH_BUFFER mvl_y__flush_buffer( mvl_y__current_buffer ) MVL_Y__BUFFER_STATE mvl_y__scan_buffer MVL_Y__PROTO(( char *base, mvl_y__size_t size )); MVL_Y__BUFFER_STATE mvl_y__scan_string MVL_Y__PROTO(( mvl_y_const char *mvl_y__str )); MVL_Y__BUFFER_STATE mvl_y__scan_bytes MVL_Y__PROTO(( mvl_y_const char *bytes, int len )); static void *mvl_y__flex_alloc MVL_Y__PROTO(( mvl_y__size_t )); static void *mvl_y__flex_realloc MVL_Y__PROTO(( void *, mvl_y__size_t )); static void mvl_y__flex_free MVL_Y__PROTO(( void * )); #define mvl_y__new_buffer mvl_y__create_buffer #define mvl_y__set_interactive(is_interactive) \ { \ if ( ! mvl_y__current_buffer ) \ mvl_y__current_buffer = mvl_y__create_buffer( mvl_y_in, MVL_Y__BUF_SIZE ); \ mvl_y__current_buffer->mvl_y__is_interactive = is_interactive; \ } #define mvl_y__set_bol(at_bol) \ { \ if ( ! mvl_y__current_buffer ) \ mvl_y__current_buffer = mvl_y__create_buffer( mvl_y_in, MVL_Y__BUF_SIZE ); \ mvl_y__current_buffer->mvl_y__at_bol = at_bol; \ } #define MVL_Y__AT_BOL() (mvl_y__current_buffer->mvl_y__at_bol) typedef unsigned char MVL_Y__CHAR; FILE *mvl_y_in = (FILE *) 0, *mvl_y_out = (FILE *) 0; typedef int mvl_y__state_type; extern char *mvl_y_text; #define mvl_y_text_ptr mvl_y_text static mvl_y__state_type mvl_y__get_previous_state MVL_Y__PROTO(( void )); static mvl_y__state_type mvl_y__try_NUL_trans MVL_Y__PROTO(( mvl_y__state_type current_state )); static int mvl_y__get_next_buffer MVL_Y__PROTO(( void )); static void mvl_y__fatal_error MVL_Y__PROTO(( mvl_y_const char msg[] )); /* Done after the current pattern has been matched and before the * corresponding action - sets up mvl_y_text. */ #define MVL_Y__DO_BEFORE_ACTION \ mvl_y_text_ptr = mvl_y__bp; \ mvl_y_leng = (int) (mvl_y__cp - mvl_y__bp); \ mvl_y__hold_char = *mvl_y__cp; \ *mvl_y__cp = '\0'; \ mvl_y__c_buf_p = mvl_y__cp; #define MVL_Y__NUM_RULES 34 #define MVL_Y__END_OF_BUFFER 35 static mvl_y_const short int mvl_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 mvl_y_const int mvl_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 mvl_y_const int mvl_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 mvl_y_const short int mvl_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 mvl_y_const short int mvl_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 mvl_y_const short int mvl_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 mvl_y_const short int mvl_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 mvl_y__state_type mvl_y__last_accepting_state; static char *mvl_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 mvl_y_more() mvl_y_more_used_but_not_detected #define MVL_Y__MORE_ADJ 0 #define MVL_Y__RESTORE_MVL_Y__MORE_OFFSET char *mvl_y_text; #line 1 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" #define INITIAL 0 #line 2 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" /*###----------------------------------------------------------------###*/ /* */ /* Filename : mvl_scomp.lex */ /* Authors : L.A. TABUSSE */ /* VUONG H.N. */ /* Date : Jan 29 1992 */ /* Contents : Lexical VHDL Analyser */ /* For any details refer to the IEEE Standard */ /* VHDL LRM Chapter 13 : Lexical Elements */ /* Called func. : namealloc , mbkalloc , find_mc*/ /* */ /*###----------------------------------------------------------------###*/ #include #include #include #include #include "gen_generic.h" #include "mvl_slex.h" #include "mvl_stdef.h" #include "mvl_stype.h" #include "mvl_scomp_y.h" /* ###--------------------------------------------------------------### */ /* function : search */ /* description : check that an identifier is a reserved word or not */ /* called func. : addht, addhtitem, gethtitem, namealloc */ /* ###--------------------------------------------------------------### */ static int search (key) char *key; { static ht *pt_hash = NULL; if (pt_hash == NULL) { pt_hash = addht (107); addhtitem (pt_hash, namealloc("abs") , ABS ); addhtitem (pt_hash, namealloc("access") , ACCESS ); addhtitem (pt_hash, namealloc("after") , AFTER ); addhtitem (pt_hash, namealloc("alias") , ALIAS ); addhtitem (pt_hash, namealloc("all") , ALL ); addhtitem (pt_hash, namealloc("and") , tok_AND ); addhtitem (pt_hash, namealloc("architecture") , ARCHITECTURE ); addhtitem (pt_hash, namealloc("arg") , ARG ); addhtitem (pt_hash, namealloc("array") , ARRAY ); addhtitem (pt_hash, namealloc("assert") , ASSERT ); addhtitem (pt_hash, namealloc("attribute") , ATTRIBUTE ); addhtitem (pt_hash, namealloc("begin") , _BEGIN ); addhtitem (pt_hash, namealloc("bit") , BIT ); addhtitem (pt_hash, namealloc("bit_vector") , BIT_VECTOR ); addhtitem (pt_hash, namealloc("block") , BLOCK ); addhtitem (pt_hash, namealloc("body") , BODY ); addhtitem (pt_hash, namealloc("buffer") , BUFFER ); addhtitem (pt_hash, namealloc("bus") , BUS ); addhtitem (pt_hash, namealloc("case") , CASE ); addhtitem (pt_hash, namealloc("component") , COMPONENT ); addhtitem (pt_hash, namealloc("configuration"), CONFIGURATION); addhtitem (pt_hash, namealloc("constant") , CONSTANT ); addhtitem (pt_hash, namealloc("disconnect") , DISCONNECT ); addhtitem (pt_hash, namealloc("downto") , DOWNTO ); addhtitem (pt_hash, namealloc("else") , ELSE ); addhtitem (pt_hash, namealloc("elsif") , ELSIF ); addhtitem (pt_hash, namealloc("end") , _END ); addhtitem (pt_hash, namealloc("entity") , ENTITY ); addhtitem (pt_hash, namealloc("error") , ERROR ); addhtitem (pt_hash, namealloc("exit") , _EXIT ); addhtitem (pt_hash, namealloc("file") , _FILE ); addhtitem (pt_hash, namealloc("for") , FOR ); addhtitem (pt_hash, namealloc("function") , FUNCTION ); addhtitem (pt_hash, namealloc("generate") , GENERATE ); addhtitem (pt_hash, namealloc("generic") , GENERIC ); addhtitem (pt_hash, namealloc("guarded") , GUARDED ); addhtitem (pt_hash, namealloc("if") , IF ); addhtitem (pt_hash, namealloc("in") , _IN ); addhtitem (pt_hash, namealloc("inout") , _INOUT ); addhtitem (pt_hash, namealloc("integer") , INTEGER ); addhtitem (pt_hash, namealloc("is") , IS ); addhtitem (pt_hash, namealloc("label") , _LABEL ); addhtitem (pt_hash, namealloc("library") , LIBRARY ); addhtitem (pt_hash, namealloc("linkage") , _LINKAGE ); addhtitem (pt_hash, namealloc("list") , _LIST ); addhtitem (pt_hash, namealloc("loop") , LOOP ); addhtitem (pt_hash, namealloc("map") , MAP ); addhtitem (pt_hash, namealloc("mod") , MOD ); addhtitem (pt_hash, namealloc("mux_bit") , MUX_BIT ); addhtitem (pt_hash, namealloc("mux_vector") , MUX_VECTOR ); addhtitem (pt_hash, namealloc("nand") , _NAND ); addhtitem (pt_hash, namealloc("natural") , NATURAL ); addhtitem (pt_hash, namealloc("new") , NEW ); addhtitem (pt_hash, namealloc("next") , _NEXT ); addhtitem (pt_hash, namealloc("nor") , _NOR ); addhtitem (pt_hash, namealloc("not") , _NOT ); addhtitem (pt_hash, namealloc("null") , tok_NULL ); addhtitem (pt_hash, namealloc("of") , OF ); addhtitem (pt_hash, namealloc("on") , ON ); addhtitem (pt_hash, namealloc("open") , OPEN ); addhtitem (pt_hash, namealloc("or") , _OR ); addhtitem (pt_hash, namealloc("others") , OTHERS ); addhtitem (pt_hash, namealloc("out") , _OUT ); addhtitem (pt_hash, namealloc("package") , _PACKAGE ); addhtitem (pt_hash, namealloc("port") , PORT ); addhtitem (pt_hash, namealloc("positive") , POSITIVE ); addhtitem (pt_hash, namealloc("procedure") , PROCEDURE ); addhtitem (pt_hash, namealloc("process") , PROCESS ); addhtitem (pt_hash, namealloc("range") , RANGE ); addhtitem (pt_hash, namealloc("record") , RECORD ); addhtitem (pt_hash, namealloc("reg_bit") , REG_BIT ); addhtitem (pt_hash, namealloc("reg_vector") , REG_VECTOR ); addhtitem (pt_hash, namealloc("register") , REGISTER ); addhtitem (pt_hash, namealloc("rem") , REM ); addhtitem (pt_hash, namealloc("report") , REPORT ); addhtitem (pt_hash, namealloc("return") , RETURN ); addhtitem (pt_hash, namealloc("select") , SELECT ); addhtitem (pt_hash, namealloc("severity") , SEVERITY ); addhtitem (pt_hash, namealloc("signal") , SIGNAL ); addhtitem (pt_hash, namealloc("stable") , _STABLE ); addhtitem (pt_hash, namealloc("string") , STRING ); addhtitem (pt_hash, namealloc("subtype") , SUBTYPE ); addhtitem (pt_hash, namealloc("then") , THEN ); addhtitem (pt_hash, namealloc("to") , TO ); addhtitem (pt_hash, namealloc("transport") , TRANSPORT ); addhtitem (pt_hash, namealloc("type") , _TYPE ); addhtitem (pt_hash, namealloc("units") , UNITS ); addhtitem (pt_hash, namealloc("until") , UNTIL ); addhtitem (pt_hash, namealloc("use") , USE ); addhtitem (pt_hash, namealloc("variable") , VARIABLE ); addhtitem (pt_hash, namealloc("wait") , WAIT ); addhtitem (pt_hash, namealloc("warning") , WARNING ); addhtitem (pt_hash, namealloc("when") , WHEN ); addhtitem (pt_hash, namealloc("while") , WHILE ); addhtitem (pt_hash, namealloc("with") , WITH ); addhtitem (pt_hash, namealloc("wor_bit") , WOR_BIT ); addhtitem (pt_hash, namealloc("wor_vector") , WOR_VECTOR ); addhtitem (pt_hash, namealloc("xor") , _XOR ); } return (gethtitem (pt_hash, namealloc(key))); } /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef MVL_Y__SKIP_MVL_Y_WRAP #ifdef __cplusplus extern "C" int mvl_y_wrap MVL_Y__PROTO(( void )); #else extern int mvl_y_wrap MVL_Y__PROTO(( void )); #endif #endif #ifndef MVL_Y__NO_UNPUT static void mvl_y_unput MVL_Y__PROTO(( int c, char *buf_ptr )); #endif #ifndef mvl_y_text_ptr static void mvl_y__flex_strncpy MVL_Y__PROTO(( char *, mvl_y_const char *, int )); #endif #ifdef MVL_Y__NEED_STRLEN static int mvl_y__flex_strlen MVL_Y__PROTO(( mvl_y_const char * )); #endif #ifndef MVL_Y__NO_INPUT #ifdef __cplusplus static int mvl_y_input MVL_Y__PROTO(( void )); #else static int input MVL_Y__PROTO(( void )); #endif #endif #if MVL_Y__STACK_USED static int mvl_y__start_stack_ptr = 0; static int mvl_y__start_stack_depth = 0; static int *mvl_y__start_stack = 0; #ifndef MVL_Y__NO_PUSH_STATE static void mvl_y__push_state MVL_Y__PROTO(( int new_state )); #endif #ifndef MVL_Y__NO_POP_STATE static void mvl_y__pop_state MVL_Y__PROTO(( void )); #endif #ifndef MVL_Y__NO_TOP_STATE static int mvl_y__top_state MVL_Y__PROTO(( void )); #endif #else #define MVL_Y__NO_PUSH_STATE 1 #define MVL_Y__NO_POP_STATE 1 #define MVL_Y__NO_TOP_STATE 1 #endif #ifdef MVL_Y__MALLOC_DECL MVL_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 MVL_Y__READ_BUF_SIZE #define MVL_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( mvl_y_text, mvl_y_leng, 1, mvl_y_out ) #endif /* Gets input and stuffs it into "buf". number of characters read, or MVL_Y__NULL, * is returned in "result". */ #ifndef MVL_Y__INPUT #define MVL_Y__INPUT(buf,result,max_size) \ if ( mvl_y__current_buffer->mvl_y__is_interactive ) \ { \ int c = '*', n; \ for ( n = 0; n < max_size && \ (c = getc( mvl_y_in )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( mvl_y_in ) ) \ MVL_Y__FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else if ( ((result = fread( buf, 1, max_size, mvl_y_in )) == 0) \ && ferror( mvl_y_in ) ) \ MVL_Y__FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "mvl_y_terminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef mvl_y_terminate #define mvl_y_terminate() return MVL_Y__NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef MVL_Y__START_STACK_INCR #define MVL_Y__START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef MVL_Y__FATAL_ERROR #define MVL_Y__FATAL_ERROR(msg) mvl_y__fatal_error( msg ) #endif /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef MVL_Y__DECL #define MVL_Y__DECL int mvl_y_lex MVL_Y__PROTO(( void )) #endif /* Code executed at the beginning of each rule, after mvl_y_text and mvl_y_leng * have been set up. */ #ifndef MVL_Y__USER_ACTION #define MVL_Y__USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef MVL_Y__BREAK #define MVL_Y__BREAK break; #endif #define MVL_Y__RULE_SETUP \ MVL_Y__USER_ACTION MVL_Y__DECL { register mvl_y__state_type mvl_y__current_state; register char *mvl_y__cp = NULL, *mvl_y__bp = NULL; register int mvl_y__act; #line 186 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" if ( mvl_y__init ) { mvl_y__init = 0; #ifdef MVL_Y__USER_INIT MVL_Y__USER_INIT; #endif if ( ! mvl_y__start ) mvl_y__start = 1; /* first start state */ if ( ! mvl_y_in ) mvl_y_in = stdin; if ( ! mvl_y_out ) mvl_y_out = stdout; if ( ! mvl_y__current_buffer ) mvl_y__current_buffer = mvl_y__create_buffer( mvl_y_in, MVL_Y__BUF_SIZE ); mvl_y__load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { mvl_y__cp = mvl_y__c_buf_p; /* Support of mvl_y_text. */ *mvl_y__cp = mvl_y__hold_char; /* mvl_y__bp points to the position in mvl_y__ch_buf of the start of * the current run. */ mvl_y__bp = mvl_y__cp; mvl_y__current_state = mvl_y__start; mvl_y__match: do { register MVL_Y__CHAR mvl_y__c = mvl_y__ec[MVL_Y__SC_TO_UI(*mvl_y__cp)]; if ( mvl_y__accept[mvl_y__current_state] ) { mvl_y__last_accepting_state = mvl_y__current_state; mvl_y__last_accepting_cpos = mvl_y__cp; } while ( mvl_y__chk[mvl_y__base[mvl_y__current_state] + mvl_y__c] != mvl_y__current_state ) { mvl_y__current_state = (int) mvl_y__def[mvl_y__current_state]; if ( mvl_y__current_state >= 96 ) mvl_y__c = mvl_y__meta[(unsigned int) mvl_y__c]; } mvl_y__current_state = mvl_y__nxt[mvl_y__base[mvl_y__current_state] + (unsigned int) mvl_y__c]; ++mvl_y__cp; } while ( mvl_y__base[mvl_y__current_state] != 220 ); mvl_y__find_action: mvl_y__act = mvl_y__accept[mvl_y__current_state]; if ( mvl_y__act == 0 ) { /* have to back up */ mvl_y__cp = mvl_y__last_accepting_cpos; mvl_y__current_state = mvl_y__last_accepting_state; mvl_y__act = mvl_y__accept[mvl_y__current_state]; } MVL_Y__DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( mvl_y__act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of MVL_Y__DO_BEFORE_ACTION */ *mvl_y__cp = mvl_y__hold_char; mvl_y__cp = mvl_y__last_accepting_cpos; mvl_y__current_state = mvl_y__last_accepting_state; goto mvl_y__find_action; case 1: MVL_Y__RULE_SETUP #line 187 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { /* nothing */ /* separators */ } MVL_Y__BREAK case 2: MVL_Y__RULE_SETUP #line 191 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { return(Ampersand); } MVL_Y__BREAK case 3: MVL_Y__RULE_SETUP #line 194 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { return(Apostrophe); } MVL_Y__BREAK case 4: MVL_Y__RULE_SETUP #line 197 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { return(LeftParen); } MVL_Y__BREAK case 5: MVL_Y__RULE_SETUP #line 200 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { return(RightParen); } MVL_Y__BREAK case 6: MVL_Y__RULE_SETUP #line 203 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { return(DoubleStar); } MVL_Y__BREAK case 7: MVL_Y__RULE_SETUP #line 206 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { return(Star); } MVL_Y__BREAK case 8: MVL_Y__RULE_SETUP #line 209 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { return(Plus); } MVL_Y__BREAK case 9: MVL_Y__RULE_SETUP #line 212 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { return(Comma); } MVL_Y__BREAK case 10: MVL_Y__RULE_SETUP #line 215 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { return(Minus); } MVL_Y__BREAK case 11: MVL_Y__RULE_SETUP #line 218 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { return(VarAsgn); } MVL_Y__BREAK case 12: MVL_Y__RULE_SETUP #line 221 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { return(Colon); } MVL_Y__BREAK case 13: MVL_Y__RULE_SETUP #line 224 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { return(Semicolon); } MVL_Y__BREAK case 14: MVL_Y__RULE_SETUP #line 227 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { return(_LESym); } MVL_Y__BREAK case 15: MVL_Y__RULE_SETUP #line 230 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { return(_GESym); } MVL_Y__BREAK case 16: MVL_Y__RULE_SETUP #line 233 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { return(_LTSym); } MVL_Y__BREAK case 17: MVL_Y__RULE_SETUP #line 236 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { return(_GTSym); } MVL_Y__BREAK case 18: MVL_Y__RULE_SETUP #line 239 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { return(_EQSym); } MVL_Y__BREAK case 19: MVL_Y__RULE_SETUP #line 242 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { return(_NESym); } MVL_Y__BREAK case 20: MVL_Y__RULE_SETUP #line 245 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { return(Arrow); } MVL_Y__BREAK case 21: MVL_Y__RULE_SETUP #line 248 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { return(Box); } MVL_Y__BREAK case 22: MVL_Y__RULE_SETUP #line 251 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { return(Bar); } MVL_Y__BREAK case 23: MVL_Y__RULE_SETUP #line 254 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { return(Bar); } MVL_Y__BREAK case 24: MVL_Y__RULE_SETUP #line 257 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { return(Dot); } MVL_Y__BREAK case 25: MVL_Y__RULE_SETUP #line 260 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { return(Slash); } MVL_Y__BREAK case 26: MVL_Y__RULE_SETUP #line 263 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { int itoken; itoken = search (mvl_y_text); if (itoken == EMPTYHT) { mvl_y_lval.text = namealloc(mvl_y_text); return ( Identifier ); } else { return ( itoken ); } } MVL_Y__BREAK case 27: MVL_Y__RULE_SETUP #line 277 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { mvl_y_lval.text = mbkalloc((unsigned int)strlen(mvl_y_text)+1); strcpy(mvl_y_lval.text,mvl_y_text); return ( AbstractLit ); } MVL_Y__BREAK case 28: MVL_Y__RULE_SETUP #line 282 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { mvl_y_lval.text = mbkalloc((unsigned int)strlen(mvl_y_text)+1); strcpy(mvl_y_lval.text,mvl_y_text); return ( CharacterLit ); } MVL_Y__BREAK case 29: MVL_Y__RULE_SETUP #line 287 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { mvl_y_lval.text = mbkalloc((unsigned int)strlen(mvl_y_text)+1); strcpy(mvl_y_lval.text,mvl_y_text); return ( StringLit ); } MVL_Y__BREAK case 30: MVL_Y__RULE_SETUP #line 292 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { mvl_y_lval.text = mbkalloc((unsigned int)strlen(mvl_y_text)+1); strcpy(mvl_y_lval.text,mvl_y_text); return ( BitStringLit ); } MVL_Y__BREAK case 31: MVL_Y__RULE_SETUP #line 297 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { /* end of line */ MVL_LINNUM++; } MVL_Y__BREAK case 32: *mvl_y__cp = mvl_y__hold_char; /* undo effects of setting up mvl_y_text */ mvl_y__c_buf_p = mvl_y__cp -= 1; MVL_Y__DO_BEFORE_ACTION; /* set up mvl_y_text again */ MVL_Y__RULE_SETUP #line 301 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { /* comment */ /* nothing */ } MVL_Y__BREAK case 33: MVL_Y__RULE_SETUP #line 305 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" { return (*mvl_y_text); } MVL_Y__BREAK case 34: MVL_Y__RULE_SETUP #line 308 "../../../src/mbkvhdlg/src/mvl_scomp_l.l" ECHO; MVL_Y__BREAK case MVL_Y__STATE_EOF(INITIAL): mvl_y_terminate(); case MVL_Y__END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int mvl_y__amount_of_matched_text = (int) (mvl_y__cp - mvl_y_text_ptr) - 1; /* Undo the effects of MVL_Y__DO_BEFORE_ACTION. */ *mvl_y__cp = mvl_y__hold_char; MVL_Y__RESTORE_MVL_Y__MORE_OFFSET if ( mvl_y__current_buffer->mvl_y__buffer_status == MVL_Y__BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed mvl_y_in at a new source and called * mvl_y_lex(). If so, then we have to assure * consistency between mvl_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. */ mvl_y__n_chars = mvl_y__current_buffer->mvl_y__n_chars; mvl_y__current_buffer->mvl_y__input_file = mvl_y_in; mvl_y__current_buffer->mvl_y__buffer_status = MVL_Y__BUFFER_NORMAL; } /* Note that here we test for mvl_y__c_buf_p "<=" to the position * of the first EOB in the buffer, since mvl_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 ( mvl_y__c_buf_p <= &mvl_y__current_buffer->mvl_y__ch_buf[mvl_y__n_chars] ) { /* This was really a NUL. */ mvl_y__state_type mvl_y__next_state; mvl_y__c_buf_p = mvl_y_text_ptr + mvl_y__amount_of_matched_text; mvl_y__current_state = mvl_y__get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * mvl_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). */ mvl_y__next_state = mvl_y__try_NUL_trans( mvl_y__current_state ); mvl_y__bp = mvl_y_text_ptr + MVL_Y__MORE_ADJ; if ( mvl_y__next_state ) { /* Consume the NUL. */ mvl_y__cp = ++mvl_y__c_buf_p; mvl_y__current_state = mvl_y__next_state; goto mvl_y__match; } else { mvl_y__cp = mvl_y__c_buf_p; goto mvl_y__find_action; } } else switch ( mvl_y__get_next_buffer() ) { case EOB_ACT_END_OF_FILE: { mvl_y__did_buffer_switch_on_eof = 0; if ( mvl_y_wrap() ) { /* Note: because we've taken care in * mvl_y__get_next_buffer() to have set up * mvl_y_text, we can now set up * mvl_y__c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * MVL_Y__NULL, it'll still work - another * MVL_Y__NULL will get returned. */ mvl_y__c_buf_p = mvl_y_text_ptr + MVL_Y__MORE_ADJ; mvl_y__act = MVL_Y__STATE_EOF(MVL_Y__START); goto do_action; } else { if ( ! mvl_y__did_buffer_switch_on_eof ) MVL_Y__NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: mvl_y__c_buf_p = mvl_y_text_ptr + mvl_y__amount_of_matched_text; mvl_y__current_state = mvl_y__get_previous_state(); mvl_y__cp = mvl_y__c_buf_p; mvl_y__bp = mvl_y_text_ptr + MVL_Y__MORE_ADJ; goto mvl_y__match; case EOB_ACT_LAST_MATCH: mvl_y__c_buf_p = &mvl_y__current_buffer->mvl_y__ch_buf[mvl_y__n_chars]; mvl_y__current_state = mvl_y__get_previous_state(); mvl_y__cp = mvl_y__c_buf_p; mvl_y__bp = mvl_y_text_ptr + MVL_Y__MORE_ADJ; goto mvl_y__find_action; } break; } default: MVL_Y__FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of mvl_y_lex */ /* mvl_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 mvl_y__get_next_buffer() { register char *dest = mvl_y__current_buffer->mvl_y__ch_buf; register char *source = mvl_y_text_ptr; register int number_to_move, i; int ret_val; if ( mvl_y__c_buf_p > &mvl_y__current_buffer->mvl_y__ch_buf[mvl_y__n_chars + 1] ) MVL_Y__FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( mvl_y__current_buffer->mvl_y__fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( mvl_y__c_buf_p - mvl_y_text_ptr - MVL_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) (mvl_y__c_buf_p - mvl_y_text_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( mvl_y__current_buffer->mvl_y__buffer_status == MVL_Y__BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ mvl_y__current_buffer->mvl_y__n_chars = mvl_y__n_chars = 0; else { int num_to_read = mvl_y__current_buffer->mvl_y__buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ #ifdef MVL_Y__USES_REJECT MVL_Y__FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); #else /* just a shorter name for the current buffer */ MVL_Y__BUFFER_STATE b = mvl_y__current_buffer; int mvl_y__c_buf_p_offset = (int) (mvl_y__c_buf_p - b->mvl_y__ch_buf); if ( b->mvl_y__is_our_buffer ) { int new_size = b->mvl_y__buf_size * 2; if ( new_size <= 0 ) b->mvl_y__buf_size += b->mvl_y__buf_size / 8; else b->mvl_y__buf_size *= 2; b->mvl_y__ch_buf = (char *) /* Include room in for 2 EOB chars. */ mvl_y__flex_realloc( (void *) b->mvl_y__ch_buf, b->mvl_y__buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->mvl_y__ch_buf = 0; if ( ! b->mvl_y__ch_buf ) MVL_Y__FATAL_ERROR( "fatal error - scanner input buffer overflow" ); mvl_y__c_buf_p = &b->mvl_y__ch_buf[mvl_y__c_buf_p_offset]; num_to_read = mvl_y__current_buffer->mvl_y__buf_size - number_to_move - 1; #endif } if ( num_to_read > MVL_Y__READ_BUF_SIZE ) num_to_read = MVL_Y__READ_BUF_SIZE; /* Read in more data. */ MVL_Y__INPUT( (&mvl_y__current_buffer->mvl_y__ch_buf[number_to_move]), mvl_y__n_chars, num_to_read ); mvl_y__current_buffer->mvl_y__n_chars = mvl_y__n_chars; } if ( mvl_y__n_chars == 0 ) { if ( number_to_move == MVL_Y__MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; mvl_y_restart( mvl_y_in ); } else { ret_val = EOB_ACT_LAST_MATCH; mvl_y__current_buffer->mvl_y__buffer_status = MVL_Y__BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; mvl_y__n_chars += number_to_move; mvl_y__current_buffer->mvl_y__ch_buf[mvl_y__n_chars] = MVL_Y__END_OF_BUFFER_CHAR; mvl_y__current_buffer->mvl_y__ch_buf[mvl_y__n_chars + 1] = MVL_Y__END_OF_BUFFER_CHAR; mvl_y_text_ptr = &mvl_y__current_buffer->mvl_y__ch_buf[0]; return ret_val; } /* mvl_y__get_previous_state - get the state just before the EOB char was reached */ static mvl_y__state_type mvl_y__get_previous_state() { register mvl_y__state_type mvl_y__current_state; register char *mvl_y__cp; mvl_y__current_state = mvl_y__start; for ( mvl_y__cp = mvl_y_text_ptr + MVL_Y__MORE_ADJ; mvl_y__cp < mvl_y__c_buf_p; ++mvl_y__cp ) { register MVL_Y__CHAR mvl_y__c = (*mvl_y__cp ? mvl_y__ec[MVL_Y__SC_TO_UI(*mvl_y__cp)] : 1); if ( mvl_y__accept[mvl_y__current_state] ) { mvl_y__last_accepting_state = mvl_y__current_state; mvl_y__last_accepting_cpos = mvl_y__cp; } while ( mvl_y__chk[mvl_y__base[mvl_y__current_state] + mvl_y__c] != mvl_y__current_state ) { mvl_y__current_state = (int) mvl_y__def[mvl_y__current_state]; if ( mvl_y__current_state >= 96 ) mvl_y__c = mvl_y__meta[(unsigned int) mvl_y__c]; } mvl_y__current_state = mvl_y__nxt[mvl_y__base[mvl_y__current_state] + (unsigned int) mvl_y__c]; } return mvl_y__current_state; } /* mvl_y__try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = mvl_y__try_NUL_trans( current_state ); */ #ifdef MVL_Y__USE_PROTOS static mvl_y__state_type mvl_y__try_NUL_trans( mvl_y__state_type mvl_y__current_state ) #else static mvl_y__state_type mvl_y__try_NUL_trans( mvl_y__current_state ) mvl_y__state_type mvl_y__current_state; #endif { register int mvl_y__is_jam; register char *mvl_y__cp = mvl_y__c_buf_p; register MVL_Y__CHAR mvl_y__c = 1; if ( mvl_y__accept[mvl_y__current_state] ) { mvl_y__last_accepting_state = mvl_y__current_state; mvl_y__last_accepting_cpos = mvl_y__cp; } while ( mvl_y__chk[mvl_y__base[mvl_y__current_state] + mvl_y__c] != mvl_y__current_state ) { mvl_y__current_state = (int) mvl_y__def[mvl_y__current_state]; if ( mvl_y__current_state >= 96 ) mvl_y__c = mvl_y__meta[(unsigned int) mvl_y__c]; } mvl_y__current_state = mvl_y__nxt[mvl_y__base[mvl_y__current_state] + (unsigned int) mvl_y__c]; mvl_y__is_jam = (mvl_y__current_state == 95); return mvl_y__is_jam ? 0 : mvl_y__current_state; } #ifndef MVL_Y__NO_UNPUT #ifdef MVL_Y__USE_PROTOS static void mvl_y_unput( int c, register char *mvl_y__bp ) #else static void mvl_y_unput( c, mvl_y__bp ) int c; register char *mvl_y__bp; #endif { register char *mvl_y__cp = mvl_y__c_buf_p; /* undo effects of setting up mvl_y_text */ *mvl_y__cp = mvl_y__hold_char; if ( mvl_y__cp < mvl_y__current_buffer->mvl_y__ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = mvl_y__n_chars + 2; register char *dest = &mvl_y__current_buffer->mvl_y__ch_buf[ mvl_y__current_buffer->mvl_y__buf_size + 2]; register char *source = &mvl_y__current_buffer->mvl_y__ch_buf[number_to_move]; while ( source > mvl_y__current_buffer->mvl_y__ch_buf ) *--dest = *--source; mvl_y__cp += (int) (dest - source); mvl_y__bp += (int) (dest - source); mvl_y__current_buffer->mvl_y__n_chars = mvl_y__n_chars = mvl_y__current_buffer->mvl_y__buf_size; if ( mvl_y__cp < mvl_y__current_buffer->mvl_y__ch_buf + 2 ) MVL_Y__FATAL_ERROR( "flex scanner push-back overflow" ); } *--mvl_y__cp = (char) c; mvl_y_text_ptr = mvl_y__bp; mvl_y__hold_char = *mvl_y__cp; mvl_y__c_buf_p = mvl_y__cp; } #endif /* ifndef MVL_Y__NO_UNPUT */ #ifndef MVL_Y__NO_INPUT #ifdef __cplusplus static int mvl_y_input() #else static int input() #endif { int c; *mvl_y__c_buf_p = mvl_y__hold_char; if ( *mvl_y__c_buf_p == MVL_Y__END_OF_BUFFER_CHAR ) { /* mvl_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 ( mvl_y__c_buf_p < &mvl_y__current_buffer->mvl_y__ch_buf[mvl_y__n_chars] ) /* This was really a NUL. */ *mvl_y__c_buf_p = '\0'; else { /* need more input */ int offset = mvl_y__c_buf_p - mvl_y_text_ptr; ++mvl_y__c_buf_p; switch ( mvl_y__get_next_buffer() ) { case EOB_ACT_LAST_MATCH: /* This happens because mvl_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. */ mvl_y_restart( mvl_y_in ); /* fall through */ case EOB_ACT_END_OF_FILE: { if ( mvl_y_wrap() ) return EOF; if ( ! mvl_y__did_buffer_switch_on_eof ) MVL_Y__NEW_FILE; #ifdef __cplusplus return mvl_y_input(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: mvl_y__c_buf_p = mvl_y_text_ptr + offset; break; } } } c = *(unsigned char *) mvl_y__c_buf_p; /* cast for 8-bit char's */ *mvl_y__c_buf_p = '\0'; /* preserve mvl_y_text */ mvl_y__hold_char = *++mvl_y__c_buf_p; return c; } #endif /* MVL_Y__NO_INPUT */ #ifdef MVL_Y__USE_PROTOS void mvl_y_restart( FILE *input_file ) #else void mvl_y_restart( input_file ) FILE *input_file; #endif { if ( ! mvl_y__current_buffer ) mvl_y__current_buffer = mvl_y__create_buffer( mvl_y_in, MVL_Y__BUF_SIZE ); mvl_y__init_buffer( mvl_y__current_buffer, input_file ); mvl_y__load_buffer_state(); } #ifdef MVL_Y__USE_PROTOS void mvl_y__switch_to_buffer( MVL_Y__BUFFER_STATE new_buffer ) #else void mvl_y__switch_to_buffer( new_buffer ) MVL_Y__BUFFER_STATE new_buffer; #endif { if ( mvl_y__current_buffer == new_buffer ) return; if ( mvl_y__current_buffer ) { /* Flush out information for old buffer. */ *mvl_y__c_buf_p = mvl_y__hold_char; mvl_y__current_buffer->mvl_y__buf_pos = mvl_y__c_buf_p; mvl_y__current_buffer->mvl_y__n_chars = mvl_y__n_chars; } mvl_y__current_buffer = new_buffer; mvl_y__load_buffer_state(); /* We don't actually know whether we did this switch during * EOF (mvl_y_wrap()) processing, but the only time this flag * is looked at is after mvl_y_wrap() is called, so it's safe * to go ahead and always set it. */ mvl_y__did_buffer_switch_on_eof = 1; } #ifdef MVL_Y__USE_PROTOS void mvl_y__load_buffer_state( void ) #else void mvl_y__load_buffer_state() #endif { mvl_y__n_chars = mvl_y__current_buffer->mvl_y__n_chars; mvl_y_text_ptr = mvl_y__c_buf_p = mvl_y__current_buffer->mvl_y__buf_pos; mvl_y_in = mvl_y__current_buffer->mvl_y__input_file; mvl_y__hold_char = *mvl_y__c_buf_p; } #ifdef MVL_Y__USE_PROTOS MVL_Y__BUFFER_STATE mvl_y__create_buffer( FILE *file, int size ) #else MVL_Y__BUFFER_STATE mvl_y__create_buffer( file, size ) FILE *file; int size; #endif { MVL_Y__BUFFER_STATE b; b = (MVL_Y__BUFFER_STATE) mvl_y__flex_alloc( sizeof( struct mvl_y__buffer_state ) ); if ( ! b ) MVL_Y__FATAL_ERROR( "out of dynamic memory in mvl_y__create_buffer()" ); b->mvl_y__buf_size = size; /* mvl_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->mvl_y__ch_buf = (char *) mvl_y__flex_alloc( b->mvl_y__buf_size + 2 ); if ( ! b->mvl_y__ch_buf ) MVL_Y__FATAL_ERROR( "out of dynamic memory in mvl_y__create_buffer()" ); b->mvl_y__is_our_buffer = 1; mvl_y__init_buffer( b, file ); return b; } #ifdef MVL_Y__USE_PROTOS void mvl_y__delete_buffer( MVL_Y__BUFFER_STATE b ) #else void mvl_y__delete_buffer( b ) MVL_Y__BUFFER_STATE b; #endif { if ( ! b ) return; if ( b == mvl_y__current_buffer ) mvl_y__current_buffer = (MVL_Y__BUFFER_STATE) 0; if ( b->mvl_y__is_our_buffer ) mvl_y__flex_free( (void *) b->mvl_y__ch_buf ); mvl_y__flex_free( (void *) b ); } #ifdef MVL_Y__USE_PROTOS void mvl_y__init_buffer( MVL_Y__BUFFER_STATE b, FILE *file ) #else void mvl_y__init_buffer( b, file ) MVL_Y__BUFFER_STATE b; FILE *file; #endif { mvl_y__flush_buffer( b ); b->mvl_y__input_file = file; b->mvl_y__fill_buffer = 1; #if MVL_Y__ALWAYS_INTERACTIVE b->mvl_y__is_interactive = 1; #else #if MVL_Y__NEVER_INTERACTIVE b->mvl_y__is_interactive = 0; #else b->mvl_y__is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; #endif #endif } #ifdef MVL_Y__USE_PROTOS void mvl_y__flush_buffer( MVL_Y__BUFFER_STATE b ) #else void mvl_y__flush_buffer( b ) MVL_Y__BUFFER_STATE b; #endif { if ( ! b ) return; b->mvl_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->mvl_y__ch_buf[0] = MVL_Y__END_OF_BUFFER_CHAR; b->mvl_y__ch_buf[1] = MVL_Y__END_OF_BUFFER_CHAR; b->mvl_y__buf_pos = &b->mvl_y__ch_buf[0]; b->mvl_y__at_bol = 1; b->mvl_y__buffer_status = MVL_Y__BUFFER_NEW; if ( b == mvl_y__current_buffer ) mvl_y__load_buffer_state(); } #ifndef MVL_Y__NO_SCAN_BUFFER #ifdef MVL_Y__USE_PROTOS MVL_Y__BUFFER_STATE mvl_y__scan_buffer( char *base, mvl_y__size_t size ) #else MVL_Y__BUFFER_STATE mvl_y__scan_buffer( base, size ) char *base; mvl_y__size_t size; #endif { MVL_Y__BUFFER_STATE b; if ( size < 2 || base[size-2] != MVL_Y__END_OF_BUFFER_CHAR || base[size-1] != MVL_Y__END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (MVL_Y__BUFFER_STATE) mvl_y__flex_alloc( sizeof( struct mvl_y__buffer_state ) ); if ( ! b ) MVL_Y__FATAL_ERROR( "out of dynamic memory in mvl_y__scan_buffer()" ); b->mvl_y__buf_size = size - 2; /* "- 2" to take care of EOB's */ b->mvl_y__buf_pos = b->mvl_y__ch_buf = base; b->mvl_y__is_our_buffer = 0; b->mvl_y__input_file = 0; b->mvl_y__n_chars = b->mvl_y__buf_size; b->mvl_y__is_interactive = 0; b->mvl_y__at_bol = 1; b->mvl_y__fill_buffer = 0; b->mvl_y__buffer_status = MVL_Y__BUFFER_NEW; mvl_y__switch_to_buffer( b ); return b; } #endif #ifndef MVL_Y__NO_SCAN_STRING #ifdef MVL_Y__USE_PROTOS MVL_Y__BUFFER_STATE mvl_y__scan_string( mvl_y_const char *mvl_y__str ) #else MVL_Y__BUFFER_STATE mvl_y__scan_string( mvl_y__str ) mvl_y_const char *mvl_y__str; #endif { int len; for ( len = 0; mvl_y__str[len]; ++len ) ; return mvl_y__scan_bytes( mvl_y__str, len ); } #endif #ifndef MVL_Y__NO_SCAN_BYTES #ifdef MVL_Y__USE_PROTOS MVL_Y__BUFFER_STATE mvl_y__scan_bytes( mvl_y_const char *bytes, int len ) #else MVL_Y__BUFFER_STATE mvl_y__scan_bytes( bytes, len ) mvl_y_const char *bytes; int len; #endif { MVL_Y__BUFFER_STATE b; char *buf; mvl_y__size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = len + 2; buf = (char *) mvl_y__flex_alloc( n ); if ( ! buf ) MVL_Y__FATAL_ERROR( "out of dynamic memory in mvl_y__scan_bytes()" ); for ( i = 0; i < len; ++i ) buf[i] = bytes[i]; buf[len] = buf[len+1] = MVL_Y__END_OF_BUFFER_CHAR; b = mvl_y__scan_buffer( buf, n ); if ( ! b ) MVL_Y__FATAL_ERROR( "bad buffer in mvl_y__scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->mvl_y__is_our_buffer = 1; return b; } #endif #ifndef MVL_Y__NO_PUSH_STATE #ifdef MVL_Y__USE_PROTOS static void mvl_y__push_state( int new_state ) #else static void mvl_y__push_state( new_state ) int new_state; #endif { if ( mvl_y__start_stack_ptr >= mvl_y__start_stack_depth ) { mvl_y__size_t new_size; mvl_y__start_stack_depth += MVL_Y__START_STACK_INCR; new_size = mvl_y__start_stack_depth * sizeof( int ); if ( ! mvl_y__start_stack ) mvl_y__start_stack = (int *) mvl_y__flex_alloc( new_size ); else mvl_y__start_stack = (int *) mvl_y__flex_realloc( (void *) mvl_y__start_stack, new_size ); if ( ! mvl_y__start_stack ) MVL_Y__FATAL_ERROR( "out of memory expanding start-condition stack" ); } mvl_y__start_stack[mvl_y__start_stack_ptr++] = MVL_Y__START; BEGIN(new_state); } #endif #ifndef MVL_Y__NO_POP_STATE static void mvl_y__pop_state() { if ( --mvl_y__start_stack_ptr < 0 ) MVL_Y__FATAL_ERROR( "start-condition stack underflow" ); BEGIN(mvl_y__start_stack[mvl_y__start_stack_ptr]); } #endif #ifndef MVL_Y__NO_TOP_STATE static int mvl_y__top_state() { return mvl_y__start_stack[mvl_y__start_stack_ptr - 1]; } #endif #ifndef MVL_Y__EXIT_FAILURE #define MVL_Y__EXIT_FAILURE 2 #endif #ifdef MVL_Y__USE_PROTOS static void mvl_y__fatal_error( mvl_y_const char msg[] ) #else static void mvl_y__fatal_error( msg ) char msg[]; #endif { (void) fprintf( stderr, "%s\n", msg ); exit( MVL_Y__EXIT_FAILURE ); } /* Redefine mvl_y_less() so it works in section 3 code. */ #undef mvl_y_less #define mvl_y_less(n) \ do \ { \ /* Undo effects of setting up mvl_y_text. */ \ mvl_y_text[mvl_y_leng] = mvl_y__hold_char; \ mvl_y__c_buf_p = mvl_y_text + n; \ mvl_y__hold_char = *mvl_y__c_buf_p; \ *mvl_y__c_buf_p = '\0'; \ mvl_y_leng = n; \ } \ while ( 0 ) /* Internal utility routines. */ #ifndef mvl_y_text_ptr #ifdef MVL_Y__USE_PROTOS static void mvl_y__flex_strncpy( char *s1, mvl_y_const char *s2, int n ) #else static void mvl_y__flex_strncpy( s1, s2, n ) char *s1; mvl_y_const char *s2; int n; #endif { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef MVL_Y__NEED_STRLEN #ifdef MVL_Y__USE_PROTOS static int mvl_y__flex_strlen( mvl_y_const char *s ) #else static int mvl_y__flex_strlen( s ) mvl_y_const char *s; #endif { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif #ifdef MVL_Y__USE_PROTOS static void *mvl_y__flex_alloc( mvl_y__size_t size ) #else static void *mvl_y__flex_alloc( size ) mvl_y__size_t size; #endif { return (void *) malloc( size ); } #ifdef MVL_Y__USE_PROTOS static void *mvl_y__flex_realloc( void *ptr, mvl_y__size_t size ) #else static void *mvl_y__flex_realloc( ptr, size ) void *ptr; mvl_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 MVL_Y__USE_PROTOS static void mvl_y__flex_free( void *ptr ) #else static void mvl_y__flex_free( ptr ) void *ptr; #endif { free( ptr ); } #if MVL_Y__MAIN int main() { mvl_y_lex(); return 0; } #endif #line 308 "../../../src/mbkvhdlg/src/mvl_scomp_l.l"