#line 3 "" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define yy_create_buffer vhdlscannerYY_create_buffer #define yy_delete_buffer vhdlscannerYY_delete_buffer #define yy_flex_debug vhdlscannerYY_flex_debug #define yy_init_buffer vhdlscannerYY_init_buffer #define yy_flush_buffer vhdlscannerYY_flush_buffer #define yy_load_buffer_state vhdlscannerYY_load_buffer_state #define yy_switch_to_buffer vhdlscannerYY_switch_to_buffer #define yyin vhdlscannerYYin #define yyleng vhdlscannerYYleng #define yylex vhdlscannerYYlex #define yylineno vhdlscannerYYlineno #define yyout vhdlscannerYYout #define yyrestart vhdlscannerYYrestart #define yytext vhdlscannerYYtext #define yywrap vhdlscannerYYwrap #define yyalloc vhdlscannerYYalloc #define yyrealloc vhdlscannerYYrealloc #define yyfree vhdlscannerYYfree #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 37 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST #endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* Returned upon end-of-file. */ #define YY_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 YY_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 (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE vhdlscannerYYrestart(vhdlscannerYYin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #define YY_BUF_SIZE 262144 #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif extern yy_size_t vhdlscannerYYleng; extern FILE *vhdlscannerYYin, *vhdlscannerYYout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up vhdlscannerYYtext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up vhdlscannerYYtext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ yy_size_t yy_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 yy_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 yy_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 yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_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 vhdlscannerYYrestart()), so that the user can continue scanning by * just pointing vhdlscannerYYin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* 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". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when vhdlscannerYYtext is formed. */ static char yy_hold_char; static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ yy_size_t vhdlscannerYYleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow vhdlscannerYYwrap()'s to do buffer switches * instead of setting up a fresh vhdlscannerYYin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void vhdlscannerYYrestart (FILE *input_file ); void vhdlscannerYY_switch_to_buffer (YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE vhdlscannerYY_create_buffer (FILE *file,int size ); void vhdlscannerYY_delete_buffer (YY_BUFFER_STATE b ); void vhdlscannerYY_flush_buffer (YY_BUFFER_STATE b ); void vhdlscannerYYpush_buffer_state (YY_BUFFER_STATE new_buffer ); void vhdlscannerYYpop_buffer_state (void ); static void vhdlscannerYYensure_buffer_stack (void ); static void vhdlscannerYY_load_buffer_state (void ); static void vhdlscannerYY_init_buffer (YY_BUFFER_STATE b,FILE *file ); #define YY_FLUSH_BUFFER vhdlscannerYY_flush_buffer(YY_CURRENT_BUFFER ) YY_BUFFER_STATE vhdlscannerYY_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE vhdlscannerYY_scan_string (yyconst char *yy_str ); YY_BUFFER_STATE vhdlscannerYY_scan_bytes (yyconst char *bytes,yy_size_t len ); void *vhdlscannerYYalloc (yy_size_t ); void *vhdlscannerYYrealloc (void *,yy_size_t ); void vhdlscannerYYfree (void * ); #define yy_new_buffer vhdlscannerYY_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ vhdlscannerYYensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ vhdlscannerYY_create_buffer(vhdlscannerYYin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ vhdlscannerYYensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ vhdlscannerYY_create_buffer(vhdlscannerYYin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ #define vhdlscannerYYwrap() 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; FILE *vhdlscannerYYin = (FILE *) 0, *vhdlscannerYYout = (FILE *) 0; typedef int yy_state_type; extern int vhdlscannerYYlineno; int vhdlscannerYYlineno = 1; extern char *vhdlscannerYYtext; #define yytext_ptr vhdlscannerYYtext static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up vhdlscannerYYtext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ vhdlscannerYYleng = (size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 55 #define YY_END_OF_BUFFER 56 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static yyconst flex_int16_t yy_acclist[220] = { 0, 56, 47, 55, 1, 47, 55, 45, 55, 47, 55, 47, 55, 47, 55, 2, 47, 55, 3, 47, 55, 4, 47, 55, 5, 47, 55, 7, 47, 55, 8, 47, 55, 9, 47, 55, 10, 47, 55, 33, 47, 55, 34, 47, 55, 40, 47, 55, 12, 47, 55, 13, 47, 55, 16, 47, 55, 18, 47, 55, 17, 47, 55, 31, 47, 55, 35, 47, 55, 39, 47, 55, 39, 47, 55, 39, 47, 55, 39, 47, 55, 39, 47, 55, 39, 47, 55, 39, 47, 55, 37, 47, 55, 47, 55, 38, 47, 55, 36, 47, 55, 47, 55, 32, 47, 55, 50, 55, 50, 55, 50, 55, 50, 55, 50, 55, 50, 55, 55, 55, 53, 55, 55, 55, 55, 55, 55, 55, 55, 42, 42, 6, 46, 52, 19, 40, 11, 22, 14, 21, 20, 15, 23, 28, 29, 27, 24, 39, 39, 39, 39, 39, 39, 39, 39, 39, 44, 44, 46, 53, 46, 52, 53, 54, 41, 46, 46, 51, 40, 40, 40, 30, 26, 25, 46, 49, 51, 46, 46, 51, 46, 53, 46, 51,16432, 46, 51, 40, 40, 40, 40, 43, 49, 46, 49, 51, 46, 49, 51, 46, 51, 16432, 46, 51, 53, 46, 51, 49, 49, 53, 46, 51, 53, 40, 40, 53, 8240, 40, 40, 8240 } ; static yyconst flex_int16_t yy_accept[218] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 7, 9, 11, 13, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60, 63, 66, 69, 72, 75, 78, 81, 84, 87, 90, 93, 95, 98, 101, 103, 106, 108, 110, 112, 114, 116, 118, 119, 120, 122, 123, 124, 125, 126, 127, 128, 129, 129, 129, 129, 130, 130, 130, 131, 131, 131, 131, 132, 133, 134, 135, 135, 135, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 137, 138, 139, 140, 141, 142, 143, 143, 144, 145, 146, 147, 148, 149, 149, 149, 149, 150, 151, 152, 153, 154, 155, 155, 155, 156, 157, 158, 158, 158, 159, 159, 160, 160, 160, 161, 163, 164, 164, 165, 166, 168, 168, 169, 169, 169, 170, 170, 170, 170, 170, 170, 170, 171, 172, 173, 174, 174, 174, 174, 177, 177, 178, 180, 182, 182, 184, 185, 187, 188, 188, 188, 188, 189, 189, 189, 189, 190, 190, 191, 191, 192, 192, 192, 192, 192, 193, 196, 199, 199, 201, 202, 205, 207, 207, 207, 207, 207, 207, 207, 207, 207, 208, 209, 209, 210, 210, 210, 210, 213, 213, 213, 214, 214, 214, 214, 214, 214, 215, 216, 216, 217, 218, 218, 219, 219, 220, 220 } ; static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 28, 30, 31, 28, 32, 32, 32, 32, 32, 32, 32, 32, 33, 32, 32, 32, 34, 32, 35, 32, 32, 36, 32, 32, 37, 38, 39, 40, 41, 42, 28, 43, 28, 44, 31, 28, 32, 32, 32, 32, 32, 32, 32, 32, 45, 32, 32, 32, 46, 32, 47, 32, 32, 48, 32, 32, 49, 50, 49, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 yyconst flex_int32_t yy_meta[51] = { 0, 1, 2, 3, 1, 2, 4, 5, 2, 6, 2, 2, 2, 2, 2, 2, 2, 2, 7, 2, 8, 9, 2, 2, 2, 2, 2, 2, 8, 8, 8, 8, 10, 10, 10, 10, 10, 2, 2, 2, 2, 8, 2, 8, 8, 10, 10, 10, 10, 2, 2 } ; static yyconst flex_int16_t yy_base[243] = { 0, 0, 0, 49, 52, 56, 60, 78, 82, 725, 901, 85, 101, 104, 120, 169, 901, 218, 901, 901, 709, 901, 901, 705, 901, 43, 262, 695, 901, 86, 660, 66, 251, 901, 52, 279, 0, 0, 315, 282, 0, 901, 362, 901, 901, 385, 901, 901, 269, 667, 669, 329, 665, 667, 333, 666, 98, 665, 901, 336, 659, 660, 662, 339, 658, 0, 663, 0, 0, 659, 0, 656, 653, 901, 657, 901, 901, 406, 641, 0, 423, 107, 108, 264, 114, 412, 429, 281, 640, 901, 901, 901, 901, 901, 901, 901, 635, 634, 901, 633, 901, 295, 307, 78, 450, 455, 0, 0, 0, 0, 0, 0, 0, 0, 0, 472, 0, 421, 637, 643, 633, 631, 507, 300, 352, 627, 901, 626, 901, 0, 75, 271, 451, 308, 609, 282, 313, 353, 359, 433, 438, 450, 505, 901, 901, 901, 59, 454, 597, 419, 340, 80, 473, 573, 424, 485, 59, 582, 519, 509, 523, 527, 513, 529, 531, 524, 517, 548, 420, 512, 901, 490, 552, 526, 569, 494, 524, 511, 587, 590, 592, 600, 602, 566, 488, 511, 473, 602, 287, 448, 603, 581, 461, 607, 621, 623, 626, 549, 624, 441, 351, 566, 293, 622, 567, 643, 202, 591, 630, 347, 901, 605, 201, 614, 153, 158, 901, 687, 697, 707, 710, 719, 729, 739, 749, 759, 765, 767, 773, 776, 784, 794, 804, 814, 824, 834, 844, 854, 864, 870, 871, 880, 890 } ; static yyconst flex_int16_t yy_def[243] = { 0, 216, 1, 217, 217, 218, 218, 219, 219, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 220, 220, 35, 35, 35, 38, 35, 216, 216, 216, 216, 221, 216, 216, 216, 216, 216, 216, 216, 222, 222, 216, 222, 222, 216, 216, 216, 216, 216, 216, 216, 14, 216, 14, 15, 216, 15, 216, 216, 216, 223, 216, 216, 216, 216, 26, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 35, 35, 220, 216, 216, 35, 35, 35, 35, 35, 35, 42, 42, 42, 221, 115, 216, 216, 223, 222, 216, 222, 222, 224, 216, 216, 216, 216, 223, 225, 226, 216, 227, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 228, 229, 216, 230, 222, 224, 231, 223, 232, 225, 216, 233, 216, 216, 226, 216, 216, 216, 216, 227, 216, 216, 216, 216, 216, 228, 216, 229, 216, 234, 230, 235, 236, 231, 222, 225, 237, 232, 238, 216, 216, 216, 239, 240, 216, 234, 241, 236, 232, 242, 222, 222, 233, 216, 216, 216, 239, 216, 240, 216, 216, 216, 238, 222, 216, 216, 216, 216, 216, 222, 0, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216 } ; static yyconst flex_int16_t yy_nxt[952] = { 0, 10, 11, 12, 13, 10, 14, 10, 10, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 34, 34, 37, 38, 39, 40, 41, 42, 43, 44, 10, 45, 35, 36, 37, 38, 39, 40, 10, 46, 48, 48, 48, 51, 48, 48, 75, 54, 54, 54, 185, 54, 54, 54, 170, 49, 76, 50, 52, 55, 50, 101, 56, 55, 57, 186, 56, 156, 57, 59, 59, 59, 120, 59, 59, 59, 63, 63, 63, 94, 95, 60, 103, 153, 61, 60, 62, 101, 61, 172, 62, 64, 63, 63, 63, 63, 63, 63, 90, 91, 92, 121, 104, 104, 124, 105, 105, 64, 216, 104, 64, 65, 105, 157, 65, 66, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 67, 67, 67, 67, 67, 67, 67, 67, 67, 65, 65, 65, 65, 65, 65, 67, 67, 67, 67, 67, 67, 65, 65, 68, 121, 213, 68, 68, 68, 68, 69, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 70, 70, 70, 70, 70, 70, 70, 70, 70, 68, 68, 68, 68, 68, 68, 70, 70, 70, 70, 70, 70, 68, 68, 71, 211, 207, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 72, 72, 72, 72, 72, 72, 72, 72, 72, 71, 71, 71, 71, 71, 71, 72, 72, 72, 72, 72, 72, 71, 71, 77, 96, 63, 63, 63, 97, 98, 99, 100, 158, 134, 78, 134, 79, 80, 135, 104, 64, 104, 105, 159, 105, 81, 82, 83, 158, 84, 85, 86, 87, 101, 158, 216, 168, 88, 216, 81, 82, 84, 85, 86, 87, 109, 161, 216, 121, 110, 216, 150, 111, 104, 103, 216, 105, 169, 216, 109, 164, 110, 203, 166, 111, 117, 63, 63, 203, 122, 122, 122, 63, 63, 63, 63, 63, 63, 106, 178, 118, 121, 107, 167, 123, 108, 215, 64, 121, 120, 64, 152, 106, 104, 107, 121, 105, 108, 112, 104, 153, 112, 105, 112, 112, 201, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 113, 113, 113, 113, 113, 113, 113, 113, 113, 112, 114, 112, 112, 112, 112, 113, 113, 113, 113, 113, 113, 112, 112, 116, 116, 116, 116, 116, 116, 116, 116, 116, 156, 117, 63, 63, 131, 156, 116, 116, 116, 116, 116, 116, 131, 131, 131, 131, 118, 104, 168, 136, 105, 133, 104, 137, 210, 105, 138, 131, 131, 133, 133, 133, 133, 136, 104, 137, 139, 105, 138, 169, 140, 170, 156, 141, 133, 133, 177, 166, 146, 162, 139, 184, 140, 147, 180, 141, 146, 146, 146, 146, 83, 147, 147, 147, 147, 181, 156, 205, 199, 156, 163, 146, 146, 174, 170, 156, 147, 147, 116, 116, 116, 116, 116, 116, 116, 116, 116, 122, 122, 122, 77, 185, 156, 116, 116, 116, 116, 116, 116, 121, 182, 78, 123, 142, 80, 156, 186, 188, 158, 172, 168, 162, 157, 170, 83, 188, 188, 188, 188, 159, 164, 192, 83, 166, 88, 160, 190, 162, 187, 189, 188, 188, 163, 160, 160, 160, 160, 189, 189, 189, 189, 121, 161, 167, 209, 174, 165, 156, 160, 160, 171, 177, 189, 189, 165, 165, 165, 165, 171, 171, 171, 171, 156, 156, 211, 153, 166, 173, 180, 165, 165, 180, 196, 171, 171, 173, 173, 173, 173, 194, 175, 156, 181, 180, 121, 212, 205, 197, 180, 213, 173, 173, 181, 184, 198, 200, 206, 200, 206, 194, 201, 207, 156, 211, 180, 156, 196, 135, 192, 154, 214, 156, 213, 194, 195, 208, 198, 182, 121, 121, 202, 197, 208, 121, 212, 121, 149, 157, 202, 202, 202, 202, 148, 214, 195, 145, 144, 143, 142, 132, 130, 204, 128, 202, 202, 128, 68, 65, 184, 204, 204, 204, 204, 127, 75, 74, 126, 125, 121, 121, 119, 75, 74, 93, 204, 204, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 102, 89, 102, 115, 74, 73, 115, 216, 115, 115, 115, 115, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 129, 129, 216, 129, 129, 129, 129, 129, 129, 129, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 160, 216, 160, 160, 165, 165, 165, 171, 216, 216, 216, 171, 173, 216, 173, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 202, 216, 216, 202, 204, 204, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 9, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216 } ; static yyconst flex_int16_t yy_chk[952] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 4, 4, 4, 25, 5, 5, 5, 156, 6, 6, 6, 146, 3, 25, 3, 4, 5, 4, 34, 5, 6, 5, 156, 6, 130, 6, 7, 7, 7, 151, 8, 8, 8, 11, 11, 11, 31, 31, 7, 34, 151, 7, 8, 7, 103, 8, 146, 8, 11, 12, 12, 12, 13, 13, 13, 29, 29, 29, 56, 81, 82, 56, 81, 82, 12, 103, 84, 13, 14, 84, 130, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 215, 214, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 17, 212, 206, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 26, 32, 48, 48, 48, 32, 32, 32, 32, 131, 83, 26, 83, 26, 26, 83, 35, 48, 87, 35, 131, 87, 26, 26, 26, 188, 26, 26, 26, 26, 35, 202, 101, 135, 26, 101, 26, 26, 26, 26, 26, 26, 39, 131, 102, 123, 39, 102, 123, 39, 136, 35, 38, 136, 135, 38, 39, 133, 39, 188, 133, 39, 51, 51, 51, 202, 54, 54, 54, 59, 59, 59, 63, 63, 63, 38, 150, 51, 54, 38, 133, 54, 38, 209, 59, 150, 124, 63, 124, 38, 137, 38, 209, 137, 38, 42, 138, 124, 42, 138, 42, 42, 200, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 45, 45, 45, 45, 45, 45, 45, 45, 45, 149, 117, 117, 117, 77, 154, 45, 45, 45, 45, 45, 45, 77, 77, 77, 77, 117, 139, 168, 85, 139, 80, 140, 85, 199, 140, 85, 77, 77, 80, 80, 80, 80, 85, 141, 85, 86, 141, 85, 168, 86, 147, 192, 86, 80, 80, 149, 189, 104, 132, 86, 154, 86, 105, 152, 86, 104, 104, 104, 104, 132, 105, 105, 105, 105, 152, 155, 189, 186, 184, 132, 104, 104, 147, 171, 175, 105, 105, 115, 115, 115, 115, 115, 115, 115, 115, 115, 122, 122, 122, 142, 185, 177, 115, 115, 115, 115, 115, 115, 122, 152, 142, 122, 142, 142, 176, 185, 159, 160, 171, 169, 162, 155, 173, 142, 159, 159, 159, 159, 160, 165, 175, 162, 165, 142, 161, 166, 163, 158, 164, 159, 159, 162, 161, 161, 161, 161, 164, 164, 164, 164, 197, 160, 165, 197, 173, 167, 183, 161, 161, 172, 176, 164, 164, 167, 167, 167, 167, 172, 172, 172, 172, 191, 157, 201, 153, 204, 174, 178, 167, 167, 179, 180, 172, 172, 174, 174, 174, 174, 178, 148, 181, 179, 182, 180, 201, 204, 180, 193, 207, 174, 174, 181, 183, 182, 187, 190, 187, 190, 193, 187, 190, 194, 211, 195, 198, 196, 134, 191, 127, 207, 208, 213, 194, 178, 195, 198, 179, 196, 125, 203, 196, 208, 121, 211, 120, 119, 181, 203, 203, 203, 203, 118, 213, 193, 99, 97, 96, 88, 78, 74, 205, 72, 203, 203, 71, 69, 66, 194, 205, 205, 205, 205, 64, 62, 61, 60, 57, 55, 53, 52, 50, 49, 30, 205, 205, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 220, 27, 220, 221, 23, 20, 221, 9, 221, 221, 221, 221, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 223, 223, 0, 223, 223, 223, 223, 223, 223, 223, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 226, 0, 226, 226, 227, 227, 227, 228, 0, 0, 0, 228, 229, 0, 229, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 239, 0, 0, 239, 240, 240, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216 } ; extern int vhdlscannerYY_flex_debug; int vhdlscannerYY_flex_debug = 0; static yy_state_type *yy_state_buf=0, *yy_state_ptr=0; static char *yy_full_match; static int yy_lp; static int yy_looking_for_trail_begin = 0; static int yy_full_lp; static int *yy_full_state; #define YY_TRAILING_MASK 0x2000 #define YY_TRAILING_HEAD_MASK 0x4000 #define REJECT \ { \ *yy_cp = (yy_hold_char); /* undo effects of setting up vhdlscannerYYtext */ \ yy_cp = (yy_full_match); /* restore poss. backed-over text */ \ (yy_lp) = (yy_full_lp); /* restore orig. accepting pos. */ \ (yy_state_ptr) = (yy_full_state); /* restore orig. state */ \ yy_current_state = *(yy_state_ptr); /* restore curr. state */ \ ++(yy_lp); \ goto find_rule; \ } #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *vhdlscannerYYtext; #line 1 "vhdlscanner.l" /************** VHDL scanner in LEX format ********** * * Version 0.2 Wed Aug 11, 1993 * * This scanner is derived from a scanner of the ALLIANCE CAD toolset, * release 1.1. That toolset was written from: * MASI/CAO-VLSI CAD Team * Laboratoire MASI/CAO-VLSI * Tour 55-65, 2eme etage, Porte 13 * Universite Pierre et Marie Curie (PARIS VI) * 4, place Jussieu 75252 PARIS Cedex 05, FRANCE * The ALLIANCE CAD Toolset can be obtained from ftp site : ftp-masi.ibp.fr * * This scanner is avail at: ftp.cs.utwente.nl in pub/src/VHDL/Grammar * A corresponding Yacc grammar is available at the same site * * author of this derived scanner version: * Thomas Dettmer * Dortmund University * Dept. of Computer Scienc, LS1 * PB 500 500 * D-44221 Dortmund (Germany) * Phone: +49-231-755-6464 * e-mail: dettmer@ls1.informatik.uni-dortmund.de * * **************************************************************** * * This file is intended not to be used for commercial purposes * without permission of the University of Dortmund * * NOTE THAT THERE IS NO WARRANTY FOR CORRECTNES, COMPLETENESS, SUPPORT * OR ANYTHING ELSE. *******************************************************/ /****************************************************************************** * modified for doxygen by M. Kreis * extended to VHDL 93/2008 ******************************************************************************/ #line 40 "vhdlscanner.l" #ifndef YYSTYPE typedef int YYSTYPE; #endif #include #include #include #include #include #include #include #include "commentscan.h" #include "vhdlparser.h" #include "vhdlscanner.h" #include "doxygen.h" #include "searchindex.h" #include "scanner.h" #include "vhdldocgen.h" #include "util.h" #include "bufstr.h" #include "message.h" #include "vhdlcode.h" #include "entry.h" #include "config.h" #define YY_NO_INPUT 1 extern void vhdlParse(); // defined in vhdlparser.y static bool g_lexInit = FALSE; static ParserInterface *g_thisParser; static VhdlContainer* yycont=NULL; static Entry* current_root; static Entry gBlock; static int yyLineNr =1; static int g_lastCommentContext; static int inputPosition; static int startComment; static QCString inputVhdlString; static QFile inputFile; static QCString yyFileName; static QList qlist; static QCString lastLetter; static bool doxComment=FALSE; // doxygen comment ? static QCString strComment; static int iDocLine=-1; static int* lineIndex=NULL; static int num_chars; static int prevToken; static int iCodeLen; static QMap keyMap; static QList lineEntry; static bool checkMultiComment(QCString& qcs,int line); static void handleCommentBlock(const QCString &doc,bool brief); static void mapLibPackage(Entry* ce); static QList* getEntryAtLine(const Entry* ce,int line); static bool addLibUseClause(const QCString &type); static Entry* oldEntry; static bool varr=FALSE; static QCString varName; static struct { QCString doc; bool brief; bool pending; int iDocLine; } str_doc; #define YY_NEVER_INTERACTIVE 1 #define YY_USER_ACTION num_chars += (int)vhdlscannerYYleng; #define MAX_KEYWORD_LEN 20 typedef struct { char nom[MAX_KEYWORD_LEN]; int kval; } el_mc; static el_mc tab_mc []= { { "abs", t_ABS }, { "access", t_ACCESS }, { "after", t_AFTER }, { "alias", t_ALIAS }, { "all", t_ALL }, { "and", t_AND }, { "architecture", t_ARCHITECTURE }, { "array", t_ARRAY }, { "assert", t_ASSERT }, { "assume", t_ASSUME }, { "assume_guarantee", t_ASSUME_GUARANTEE }, { "attribute", t_ATTRIBUTE }, { "begin", t_BEGIN }, { "block", t_BLOCK }, { "body", t_BODY }, { "buffer", t_BUFFER }, { "bus", t_BUS }, { "case", t_CASE }, { "component", t_COMPONENT }, { "configuration", t_CONFIGURATION }, { "constant", t_CONSTANT }, { "context", t_CONTEXT }, { "cover", t_COVER }, { "default", t_DEFAULT }, { "disconnect", t_DISCONNECT }, { "downto", t_DOWNTO }, { "else", t_ELSE }, { "elsif", t_ELSIF }, { "end", t_END }, { "entity", t_ENTITY }, { "exit", t_EXIT }, { "fairness", t_FAIRNESS }, { "file", t_FILE }, { "for", t_FOR }, { "force", t_FORCE }, { "function", t_FUNCTION }, { "generate", t_GENERATE }, { "generic", t_GENERIC }, { "group", t_GROUP }, { "guarded", t_GUARDED }, { "if", t_IF }, { "impure", t_IMPURE }, { "in", t_IN }, { "inertial", t_INERTIAL }, { "inout", t_INOUT }, { "is", t_IS }, { "label", t_LABEL }, { "library", t_LIBRARY }, { "linkage", t_LINKAGE }, { "literal", t_LITERAL }, { "loop", t_LOOP }, { "map", t_MAP }, { "mod", t_MOD }, { "nand", t_NAND }, { "new", t_NEW }, { "next", t_NEXT }, { "nor", t_NOR }, { "not", t_NOT }, { "null", t_NULL }, { "of", t_OF }, { "on", t_ON }, { "open", t_OPEN }, { "or", t_OR }, { "others", t_OTHERS }, { "out", t_OUT }, { "package", t_PACKAGE }, { "parameter", t_PARAMETER }, { "port", t_PORT }, { "postponed", t_POSTPONED }, { "procedure", t_PROCEDURE }, { "process", t_PROCESS }, { "property", t_PROPERTY }, { "protected", t_PROTECTED }, { "pure", t_PURE }, { "range", t_RANGE }, { "record", t_RECORD }, { "register", t_REGISTER }, { "reject", t_REJECT }, { "release", t_RELEASE }, { "restrict", t_RESTRICT }, { "restrict_guarantee", t_RESTRICT_GUARANTEE }, { "rem", t_REM }, { "report", t_REPORT }, { "rol", t_ROL }, { "ror", t_ROR }, { "return", t_RETURN }, { "select", t_SELECT }, { "sequence", t_SEQUENCE }, { "severity", t_SEVERITY }, { "signal", t_SIGNAL }, { "shared", t_SHARED }, { "sla", t_SLA }, { "sll", t_SLL }, { "sra", t_SRA }, { "srl", t_SRL }, { "strong", t_STRONG }, { "subtype", t_SUBTYPE }, { "then", t_THEN }, { "to", t_TO }, { "transport", t_TRANSPORT }, { "type", t_TYPE }, { "unaffected", t_UNAFFECTED }, { "units", t_UNITS }, { "until", t_UNTIL }, { "use", t_USE }, { "variable", t_VARIABLE }, { "vmode", t_VMODE }, { "vprop", t_VPROP }, { "vunit", t_VUNIT }, { "wait", t_WAIT }, { "when", t_WHEN }, { "while", t_WHILE }, { "with", t_WITH }, { "xor", t_XOR }, { "xnor", t_XNOR }, { "zz", -1 } // list end }; static int find_keyword(char *s) { QCString word(s); // keyword ? if (word.length() > MAX_KEYWORD_LEN) return -1; word=word.lower(); QMap::Iterator it = keyMap.find(word); if (it.key()) return it.data(); return -1; } // update current line static void lineCount() { for (const char* c=vhdlscannerYYtext ; *c ; ++c ) { yyLineNr += (*c == '\n') ; } } static void startCodeBlock(int index){ int ll=strComment.length(); iCodeLen=inputVhdlString.findRev(strComment.data())+ll; // fprintf(stderr,"\n startin code..%d %d %d\n",iCodeLen,num_chars,ll); //assert(false); gBlock.reset(); int len=strComment.length(); QCString name=strComment.right(len-index);// name=VhdlDocGen::getIndexWord(name.data(),1); if (!name) gBlock.name="misc"+ VhdlDocGen::getRecordNumber(); else gBlock.name=name; strComment=strComment.left(index); gBlock.startLine=yyLineNr+1; gBlock.bodyLine=yyLineNr+1; VhdlDocGen::prepareComment(strComment); gBlock.brief+=strComment; } static void makeInlineDoc(int endCode) { int len=endCode-iCodeLen; QCString par=inputVhdlString.mid(iCodeLen,len); gBlock.doc=par; gBlock.inbodyDocs=par; gBlock.section=Entry::VARIABLE_SEC; gBlock.spec=VhdlDocGen::MISCELLANEOUS; gBlock.fileName = yyFileName; gBlock.endBodyLine=yyLineNr-1; gBlock.lang=SrcLangExt_VHDL; Entry *temp=new Entry(gBlock); Entry* compound=getVhdlCompound(); if (compound) { compound->addSubEntry(temp); } else { temp->type="misc"; // global code like library ieee... current_root->addSubEntry(temp); } strComment.resize(0); gBlock.reset(); }// makeInlineDoc static bool isConstraintFile(const QCString &fileName,const QCString &ext) { return fileName.right(ext.length())==ext; } //static void resetScanner(const char* s,MyParserVhdl* parse); #undef YY_INPUT #define YY_INPUT(buf,result,max_size) result=vhdlscannerYYread(buf,max_size); static int vhdlscannerYYread(char *buf,int max_size) { int c=0; while ( c < max_size && inputVhdlString.at(inputPosition) ) { *buf = inputVhdlString.at(inputPosition++) ; c++; buf++; } return c; } #line 1162 "" #define INITIAL 0 #define Comment 1 #define Vhdl2008Comment 2 #define EndVhdl2008Comment 3 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif static int yy_init_globals (void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int vhdlscannerYYlex_destroy (void ); int vhdlscannerYYget_debug (void ); void vhdlscannerYYset_debug (int debug_flag ); YY_EXTRA_TYPE vhdlscannerYYget_extra (void ); void vhdlscannerYYset_extra (YY_EXTRA_TYPE user_defined ); FILE *vhdlscannerYYget_in (void ); void vhdlscannerYYset_in (FILE * in_str ); FILE *vhdlscannerYYget_out (void ); void vhdlscannerYYset_out (FILE * out_str ); yy_size_t vhdlscannerYYget_leng (void ); char *vhdlscannerYYget_text (void ); int vhdlscannerYYget_lineno (void ); void vhdlscannerYYset_lineno (int line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int vhdlscannerYYwrap (void ); #else extern int vhdlscannerYYwrap (void ); #endif #endif static void yyunput (int c,char *buf_ptr ); #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void ); #else static int input (void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 262144 #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 do { if (fwrite( vhdlscannerYYtext, vhdlscannerYYleng, 1, vhdlscannerYYout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ size_t n; \ for ( n = 0; n < max_size && \ (c = getc( vhdlscannerYYin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( vhdlscannerYYin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = fread(buf, 1, max_size, vhdlscannerYYin))==0 && ferror(vhdlscannerYYin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(vhdlscannerYYin); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int vhdlscannerYYlex (void); #define YY_DECL int vhdlscannerYYlex (void) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after vhdlscannerYYtext and vhdlscannerYYleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ if ( vhdlscannerYYleng > 0 ) \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ (vhdlscannerYYtext[vhdlscannerYYleng - 1] == '\n'); \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 397 "vhdlscanner.l" #line 1353 "" if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif /* Create the reject buffer large enough to save one state per allowed character. */ if ( ! (yy_state_buf) ) (yy_state_buf) = (yy_state_type *)vhdlscannerYYalloc(YY_STATE_BUF_SIZE ); if ( ! (yy_state_buf) ) YY_FATAL_ERROR( "out of dynamic memory in vhdlscannerYYlex()" ); if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! vhdlscannerYYin ) vhdlscannerYYin = stdin; if ( ! vhdlscannerYYout ) vhdlscannerYYout = stdout; if ( ! YY_CURRENT_BUFFER ) { vhdlscannerYYensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = vhdlscannerYY_create_buffer(vhdlscannerYYin,YY_BUF_SIZE ); } vhdlscannerYY_load_buffer_state( ); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); /* Support of vhdlscannerYYtext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); (yy_state_ptr) = (yy_state_buf); *(yy_state_ptr)++ = yy_current_state; yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 217 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; *(yy_state_ptr)++ = yy_current_state; ++yy_cp; } while ( yy_base[yy_current_state] != 901 ); yy_find_action: yy_current_state = *--(yy_state_ptr); (yy_lp) = yy_accept[yy_current_state]; find_rule: /* we branch to this label when backing up */ for ( ; ; ) /* until we find what rule we matched */ { if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] ) { yy_act = yy_acclist[(yy_lp)]; if ( yy_act & YY_TRAILING_HEAD_MASK || (yy_looking_for_trail_begin) ) { if ( yy_act == (yy_looking_for_trail_begin) ) { (yy_looking_for_trail_begin) = 0; yy_act &= ~YY_TRAILING_HEAD_MASK; break; } } else if ( yy_act & YY_TRAILING_MASK ) { (yy_looking_for_trail_begin) = yy_act & ~YY_TRAILING_MASK; (yy_looking_for_trail_begin) |= YY_TRAILING_HEAD_MASK; (yy_full_match) = yy_cp; (yy_full_state) = (yy_state_ptr); (yy_full_lp) = (yy_lp); } else { (yy_full_match) = yy_cp; (yy_full_state) = (yy_state_ptr); (yy_full_lp) = (yy_lp); break; } ++(yy_lp); goto find_rule; } --yy_cp; yy_current_state = *--(yy_state_ptr); (yy_lp) = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 1: YY_RULE_SETUP #line 399 "vhdlscanner.l" { /* nothing */ } YY_BREAK case 2: YY_RULE_SETUP #line 400 "vhdlscanner.l" { return(t_Ampersand); } YY_BREAK case 3: YY_RULE_SETUP #line 401 "vhdlscanner.l" { return(t_Apostrophe); } YY_BREAK case 4: YY_RULE_SETUP #line 402 "vhdlscanner.l" { return(t_LeftParen); } YY_BREAK case 5: YY_RULE_SETUP #line 403 "vhdlscanner.l" { return(t_RightParen); } YY_BREAK case 6: YY_RULE_SETUP #line 404 "vhdlscanner.l" { return(t_DoubleStar); } YY_BREAK case 7: YY_RULE_SETUP #line 405 "vhdlscanner.l" { return(t_Star); } YY_BREAK case 8: YY_RULE_SETUP #line 406 "vhdlscanner.l" { return(t_Plus); } YY_BREAK case 9: YY_RULE_SETUP #line 407 "vhdlscanner.l" { return(t_Comma); } YY_BREAK case 10: YY_RULE_SETUP #line 408 "vhdlscanner.l" { return(t_Minus); } YY_BREAK case 11: YY_RULE_SETUP #line 409 "vhdlscanner.l" { return(t_VarAsgn); } YY_BREAK case 12: YY_RULE_SETUP #line 410 "vhdlscanner.l" { return(t_Colon); } YY_BREAK case 13: YY_RULE_SETUP #line 411 "vhdlscanner.l" { return(t_Semicolon); } YY_BREAK case 14: YY_RULE_SETUP #line 412 "vhdlscanner.l" { return(t_LESym); } YY_BREAK case 15: YY_RULE_SETUP #line 413 "vhdlscanner.l" { return(t_GESym); } YY_BREAK case 16: YY_RULE_SETUP #line 414 "vhdlscanner.l" { return(t_LTSym); } YY_BREAK case 17: YY_RULE_SETUP #line 415 "vhdlscanner.l" { return(t_GTSym); } YY_BREAK case 18: YY_RULE_SETUP #line 416 "vhdlscanner.l" { return(t_EQSym); } YY_BREAK case 19: YY_RULE_SETUP #line 417 "vhdlscanner.l" { return(t_NESym); } YY_BREAK case 20: YY_RULE_SETUP #line 418 "vhdlscanner.l" { return(t_Arrow); } YY_BREAK case 21: YY_RULE_SETUP #line 419 "vhdlscanner.l" { return(t_Box); } YY_BREAK case 22: YY_RULE_SETUP #line 420 "vhdlscanner.l" { return(t_SLSL); } YY_BREAK case 23: YY_RULE_SETUP #line 421 "vhdlscanner.l" { return(t_SRSR); } YY_BREAK case 24: YY_RULE_SETUP #line 422 "vhdlscanner.l" { return(t_QQ); } YY_BREAK case 25: YY_RULE_SETUP #line 423 "vhdlscanner.l" { return(t_QGT); } YY_BREAK case 26: YY_RULE_SETUP #line 424 "vhdlscanner.l" { return(t_QLT); } YY_BREAK case 27: YY_RULE_SETUP #line 425 "vhdlscanner.l" { return(t_QG); } YY_BREAK case 28: YY_RULE_SETUP #line 426 "vhdlscanner.l" { return(t_QL); } YY_BREAK case 29: YY_RULE_SETUP #line 427 "vhdlscanner.l" { return(t_QEQU); } YY_BREAK case 30: YY_RULE_SETUP #line 428 "vhdlscanner.l" { return(t_QNEQU); } YY_BREAK case 31: YY_RULE_SETUP #line 429 "vhdlscanner.l" { return(t_Q); } YY_BREAK case 32: YY_RULE_SETUP #line 430 "vhdlscanner.l" { return(t_Bar); } YY_BREAK case 33: YY_RULE_SETUP #line 431 "vhdlscanner.l" { return(t_Dot); } YY_BREAK case 34: YY_RULE_SETUP #line 432 "vhdlscanner.l" { return(t_Slash); } YY_BREAK case 35: YY_RULE_SETUP #line 433 "vhdlscanner.l" { return(t_At); } YY_BREAK case 36: YY_RULE_SETUP #line 434 "vhdlscanner.l" { return(t_Neg); } YY_BREAK case 37: YY_RULE_SETUP #line 435 "vhdlscanner.l" { return(t_LEFTBR); } YY_BREAK case 38: YY_RULE_SETUP #line 436 "vhdlscanner.l" { return(t_RIGHTBR); } YY_BREAK case 39: YY_RULE_SETUP #line 439 "vhdlscanner.l" { int itoken=find_keyword(vhdlscannerYYtext); // fprintf(stderr,"\n <<<< search tok: %s %d %d>>>\n",vhdlscannerYYtext,itoken,yyLineNr); // tokens in vhdlparser.hpp 258..412 if (itoken>200 && itoken<500 && prevToken!=t_END) { // printf("\n <<<< insert tok: %s %d %d>>>\n",vhdlscannerYYtext,itoken,yyLineNr); lineIndex[itoken]=yyLineNr; } // global members if (( itoken==t_ARCHITECTURE ) || ( itoken==t_ENTITY) || ( itoken==t_PACKAGE ) || ( itoken==t_LIBRARY ) || ( itoken==t_USE ) || ( itoken==t_CONFIGURATION ) || ( itoken==t_CONTEXT ) ) { lineIndex[itoken]=yyLineNr; } prevToken=itoken; yycont->qstr=vhdlscannerYYtext; yycont->yyLineNr=yyLineNr; if (itoken== -1) { yycont->iLine=yyLineNr; return ( t_LETTER ); } else { return ( itoken ); } } YY_BREAK case 40: YY_RULE_SETUP #line 478 "vhdlscanner.l" { yycont->qstr=vhdlscannerYYtext; return ( t_ABSTRLIST ); } YY_BREAK case 41: YY_RULE_SETUP #line 483 "vhdlscanner.l" { QCString q(vhdlscannerYYtext); yycont->qstr=vhdlscannerYYtext; if (q=="'('") // std_logic'('1') ? { char c=yy_hold_char; if (isalpha(c) || isdigit(c)) { unput('\''); unput('('); return(t_Apostrophe); } else { return ( t_CHARLIST ); } } return ( t_CHARLIST ); } YY_BREAK case 42: YY_RULE_SETUP #line 504 "vhdlscanner.l" { yycont->qstr=vhdlscannerYYtext; yycont->iLine=yyLineNr; return ( t_STRING ); } YY_BREAK case 43: YY_RULE_SETUP #line 510 "vhdlscanner.l" { yycont->qstr=vhdlscannerYYtext; yycont->iLine=yyLineNr; return ( t_DIGIT ); } YY_BREAK case 44: YY_RULE_SETUP #line 516 "vhdlscanner.l" { yycont->qstr=vhdlscannerYYtext; yycont->iLine=yyLineNr; return(t_ToolDir); } YY_BREAK case 45: /* rule 45 can match eol */ YY_RULE_SETUP #line 522 "vhdlscanner.l" { yyLineNr++; yycont->yyLineNr=yyLineNr; } YY_BREAK case 46: YY_RULE_SETUP #line 527 "vhdlscanner.l" { /* comment */ QCString qcs(vhdlscannerYYtext); // vhdl comment ? if (qcs.stripPrefix("--!")) { REJECT; } else if (qcs.stripPrefix("--#")) { if (VhdlDocGen::getFlowMember()) { FlowChart::addFlowChart(FlowChart::COMMENT_NO,0,0,qcs.data()); } } } YY_BREAK case 47: YY_RULE_SETUP #line 543 "vhdlscanner.l" { /* unknown characters */ } YY_BREAK case 48: /* rule 48 can match eol */ YY_RULE_SETUP #line 546 "vhdlscanner.l" { // multi line comment if (iDocLine==-1) iDocLine=yyLineNr; QCString qc(vhdlscannerYYtext); int len=qc.contains('\n')+yyLineNr-1; if (YY_START!=Comment) // Start of the comment block { startComment=yyLineNr; g_lastCommentContext=YY_START; } if(!checkMultiComment(qc,len)) { strComment+=vhdlscannerYYtext; } lineCount(); BEGIN(Comment); } YY_BREAK case 49: YY_RULE_SETUP #line 564 "vhdlscanner.l" { if (iDocLine==-1) iDocLine=yyLineNr; strComment+=vhdlscannerYYtext; int index=strComment.find("\\code"); if (index>0) { startCodeBlock(index); doxComment=TRUE; } lineCount(); BEGIN(Comment); } YY_BREAK case 50: /* rule 50 can match eol */ YY_RULE_SETUP #line 577 "vhdlscanner.l" { // found end of comment block int index =strComment.find("\\code"); if (index>0) { startCodeBlock(index); } VhdlDocGen::prepareComment(strComment); if (index==-1 && !doxComment) { handleCommentBlock(strComment,FALSE); } strComment.resize(0);; unput(*vhdlscannerYYtext); doxComment=FALSE; BEGIN(g_lastCommentContext); } YY_BREAK case 51: YY_RULE_SETUP #line 599 "vhdlscanner.l" { // one line comment if (iDocLine==-1) iDocLine=yyLineNr; QCString qcs(vhdlscannerYYtext); bool isEndCode=qcs.contains("\\endcode"); int index = qcs.find("\\code"); if (isEndCode) { int end=inputVhdlString.find(qcs.data(),iCodeLen); makeInlineDoc(end); } else if (index > 0 ) { // assert(false); strComment=qcs; startCodeBlock(index); strComment.resize(0); } //printf("--> handleCommentBlock line %d\n",yyLineNr); if (!isEndCode && index==-1) { int j=qcs.find("--!"); qcs=qcs.right(qcs.length()-3-j); if(!checkMultiComment(qcs,yyLineNr)) { handleCommentBlock(qcs,TRUE); } }//endcode } YY_BREAK case 52: YY_RULE_SETUP #line 632 "vhdlscanner.l" { strComment+=vhdlscannerYYtext; if (yy_hold_char=='!') // found comment starting with "/*!" { doxComment=TRUE; } BEGIN(Vhdl2008Comment); } YY_BREAK case 53: /* rule 53 can match eol */ YY_RULE_SETUP #line 641 "vhdlscanner.l" { QCString tt(vhdlscannerYYtext); int len=tt.length(); yyLineNr+=tt.contains('\n'); // delete * from comments // /*! // * see vim ! // */ if (vhdlscannerYYtext[len-1]=='*' && tt.contains('\n')) { QCString ss=tt; VhdlDocGen::deleteAllChars(ss,' '); VhdlDocGen::deleteAllChars(ss,'\t'); if (ss.data() && ss.at(ss.length()-2)=='\n') { tt=tt.left(len-1); len--; } } // fprintf(stderr,"\n << %s >>",tt.data()); strComment+=tt; char c=yy_hold_char; if (c =='/') { unput('*'); BEGIN(EndVhdl2008Comment); } else { BEGIN(Vhdl2008Comment); } } YY_BREAK case 54: YY_RULE_SETUP #line 677 "vhdlscanner.l" { if (doxComment) { strComment.stripPrefix("/*!"); strComment= strComment.left( strComment.length()-1); handleCommentBlock( strComment,TRUE); } doxComment=FALSE; strComment.resize(0); BEGIN(INITIAL); } YY_BREAK case 55: YY_RULE_SETUP #line 690 "vhdlscanner.l" ECHO; YY_BREAK #line 1966 "" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(Comment): case YY_STATE_EOF(Vhdl2008Comment): case YY_STATE_EOF(EndVhdl2008Comment): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed vhdlscannerYYin at a new source and called * vhdlscannerYYlex(). If so, then we have to assure * consistency between YY_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. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = vhdlscannerYYin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_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 ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_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). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = (yy_c_buf_p); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( vhdlscannerYYwrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * vhdlscannerYYtext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of vhdlscannerYYlex */ /* yy_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 yy_get_next_buffer (void) { register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_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) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; vhdlscannerYYrestart(vhdlscannerYYin ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) vhdlscannerYYrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); (yy_state_ptr) = (yy_state_buf); *(yy_state_ptr)++ = yy_current_state; for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 217 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; *(yy_state_ptr)++ = yy_current_state; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { register int yy_is_jam; register YY_CHAR yy_c = 1; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 217 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 216); if ( ! yy_is_jam ) *(yy_state_ptr)++ = yy_current_state; return yy_is_jam ? 0 : yy_current_state; } static void yyunput (int c, register char * yy_bp ) { register char *yy_cp; yy_cp = (yy_c_buf_p); /* undo effects of setting up vhdlscannerYYtext */ *yy_cp = (yy_hold_char); if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register yy_size_t number_to_move = (yy_n_chars) + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; (yytext_ptr) = yy_bp; (yy_hold_char) = *yy_cp; (yy_c_buf_p) = yy_cp; } #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_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 ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_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. */ vhdlscannerYYrestart(vhdlscannerYYin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( vhdlscannerYYwrap( ) ) return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve vhdlscannerYYtext */ (yy_hold_char) = *++(yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void vhdlscannerYYrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ vhdlscannerYYensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = vhdlscannerYY_create_buffer(vhdlscannerYYin,YY_BUF_SIZE ); } vhdlscannerYY_init_buffer(YY_CURRENT_BUFFER,input_file ); vhdlscannerYY_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void vhdlscannerYY_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * vhdlscannerYYpop_buffer_state(); * vhdlscannerYYpush_buffer_state(new_buffer); */ vhdlscannerYYensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; vhdlscannerYY_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (vhdlscannerYYwrap()) processing, but the only time this flag * is looked at is after vhdlscannerYYwrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } static void vhdlscannerYY_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; vhdlscannerYYin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE vhdlscannerYY_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) vhdlscannerYYalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in vhdlscannerYY_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) vhdlscannerYYalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in vhdlscannerYY_create_buffer()" ); b->yy_is_our_buffer = 1; vhdlscannerYY_init_buffer(b,file ); return b; } /** Destroy the buffer. * @param b a buffer created with vhdlscannerYY_create_buffer() * */ void vhdlscannerYY_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) vhdlscannerYYfree((void *) b->yy_ch_buf ); vhdlscannerYYfree((void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a vhdlscannerYYrestart() or at EOF. */ static void vhdlscannerYY_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; vhdlscannerYY_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then vhdlscannerYY_init_buffer was _probably_ * called from vhdlscannerYYrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void vhdlscannerYY_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; b->yy_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->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) vhdlscannerYY_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void vhdlscannerYYpush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; vhdlscannerYYensure_buffer_stack(); /* This block is copied from vhdlscannerYY_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from vhdlscannerYY_switch_to_buffer. */ vhdlscannerYY_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void vhdlscannerYYpop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; vhdlscannerYY_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { vhdlscannerYY_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void vhdlscannerYYensure_buffer_stack (void) { yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state**)vhdlscannerYYalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in vhdlscannerYYensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)vhdlscannerYYrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in vhdlscannerYYensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE vhdlscannerYY_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) vhdlscannerYYalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in vhdlscannerYY_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; vhdlscannerYY_switch_to_buffer(b ); return b; } /** Setup the input buffer state to scan a string. The next call to vhdlscannerYYlex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * vhdlscannerYY_scan_bytes() instead. */ YY_BUFFER_STATE vhdlscannerYY_scan_string (yyconst char * yystr ) { return vhdlscannerYY_scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to vhdlscannerYYlex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE vhdlscannerYY_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) vhdlscannerYYalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in vhdlscannerYY_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = vhdlscannerYY_scan_buffer(buf,n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in vhdlscannerYY_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yy_fatal_error (yyconst char* msg ) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up vhdlscannerYYtext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ vhdlscannerYYtext[vhdlscannerYYleng] = (yy_hold_char); \ (yy_c_buf_p) = vhdlscannerYYtext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ vhdlscannerYYleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int vhdlscannerYYget_lineno (void) { return vhdlscannerYYlineno; } /** Get the input stream. * */ FILE *vhdlscannerYYget_in (void) { return vhdlscannerYYin; } /** Get the output stream. * */ FILE *vhdlscannerYYget_out (void) { return vhdlscannerYYout; } /** Get the length of the current token. * */ yy_size_t vhdlscannerYYget_leng (void) { return vhdlscannerYYleng; } /** Get the current token. * */ char *vhdlscannerYYget_text (void) { return vhdlscannerYYtext; } /** Set the current line number. * @param line_number * */ void vhdlscannerYYset_lineno (int line_number ) { vhdlscannerYYlineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. * * @see vhdlscannerYY_switch_to_buffer */ void vhdlscannerYYset_in (FILE * in_str ) { vhdlscannerYYin = in_str ; } void vhdlscannerYYset_out (FILE * out_str ) { vhdlscannerYYout = out_str ; } int vhdlscannerYYget_debug (void) { return vhdlscannerYY_flex_debug; } void vhdlscannerYYset_debug (int bdebug ) { vhdlscannerYY_flex_debug = bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from vhdlscannerYYlex_destroy(), so don't allocate here. */ (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = (char *) 0; (yy_init) = 0; (yy_start) = 0; (yy_state_buf) = 0; (yy_state_ptr) = 0; (yy_full_match) = 0; (yy_lp) = 0; /* Defined in main.c */ #ifdef YY_STDINIT vhdlscannerYYin = stdin; vhdlscannerYYout = stdout; #else vhdlscannerYYin = (FILE *) 0; vhdlscannerYYout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by * vhdlscannerYYlex_init() */ return 0; } /* vhdlscannerYYlex_destroy is for both reentrant and non-reentrant scanners. */ int vhdlscannerYYlex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ vhdlscannerYY_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; vhdlscannerYYpop_buffer_state(); } /* Destroy the stack itself. */ vhdlscannerYYfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; vhdlscannerYYfree ( (yy_state_buf) ); (yy_state_buf) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * vhdlscannerYYlex() is called, initialization will occur. */ yy_init_globals( ); return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *vhdlscannerYYalloc (yy_size_t size ) { return (void *) malloc( size ); } void *vhdlscannerYYrealloc (void * ptr, yy_size_t size ) { /* 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 ); } void vhdlscannerYYfree (void * ptr ) { free( (char *) ptr ); /* see vhdlscannerYYrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 690 "vhdlscanner.l" static void parserInit() { num_chars=0; lineIndex=(int*)malloc(500*sizeof(int)); if (!g_lexInit) { VhdlDocGen::init(); el_mc oop; int p=0; while ((oop=tab_mc[p++]).kval!=-1) { QCString q(&oop.nom[0]); keyMap.insert(q,oop.kval); } } } void vhdlscanFreeScanner() { #if defined(YY_FLEX_SUBMINOR_VERSION) if (g_lexInit) { vhdlscannerYYlex_destroy(); } #endif } void VHDLLanguageScanner::resetCodeParserState() { } bool VHDLLanguageScanner::needsPreprocessing(const QCString & /*extension*/) { return TRUE; } void VHDLLanguageScanner::parsePrototype(const char *text) { varName=text; varr=TRUE; } // do parsing //int VhdlParser::doLex() //{ // int token=vhdlscannerYYlex(); // //fprintf(stderr,"\ntoken: %d at line: %d",token,yyLineNr); // return token; //} void VHDLLanguageScanner::parseInput(const char *fileName, const char *fileBuf, Entry *root, bool /*sameTranslationUnit*/, QStrList & /*filesInSameTranslationUnit*/) { yyFileName=QCString(fileName); bool xilinx_ucf=isConstraintFile(yyFileName,".ucf"); bool altera_qsf=isConstraintFile(yyFileName,".qsf"); // support XILINX(ucf) and ALTERA (qsf) file if (xilinx_ucf) { VhdlDocGen::parseUCF(fileBuf,root,yyFileName,FALSE); return; } if (altera_qsf) { VhdlDocGen::parseUCF(fileBuf,root,yyFileName,TRUE); return; } printlex(vhdlscannerYY_flex_debug, TRUE, __FILE__, fileName); ::parserInit(); yycont=getVhdlCont(); yycont->root=root; yycont->fileName=fileName; initVhdlParser(); QCString pPuffer(" "); pPuffer+=fileBuf; inputFile.setName(fileName); if (g_lexInit) { vhdlscannerYYrestart( vhdlscannerYYin ); } g_lexInit=TRUE; g_thisParser=this; inputPosition=0; inputVhdlString=fileBuf; yyLineNr=1; current_root=root; groupEnterFile(fileName,yyLineNr); vhdlParse(); Entry* curr=getCurrentVhdlEntry(); // delete last current delete curr; curr=0; free(lineIndex); inputFile.close(); mapLibPackage(root); printlex(vhdlscannerYY_flex_debug, FALSE, __FILE__, fileName); } void VHDLLanguageScanner::parseCode(CodeOutputInterface &codeOutIntf, const char *scopeName, const QCString &input, SrcLangExt /*lang*/, bool isExampleBlock, const char *exampleName, FileDef *fileDef, int startLine, int endLine, bool inlineFragment, MemberDef *memberDef, bool showLineNumbers, Definition *searchCtx, bool collectXRefs ) { ::parseVhdlCode(codeOutIntf,scopeName,input,isExampleBlock,exampleName, fileDef,startLine,endLine,inlineFragment,memberDef, showLineNumbers,searchCtx,collectXRefs); } /* * adds the library|use statements to the next class (entity|package|architecture|package body * library ieee * entity xxx * ..... * library * package * enity zzz * ..... * and so on.. */ static void mapLibPackage( Entry* root) { QList epp=getLibUse(); EntryListIterator eli(epp); Entry *rt; for (;(rt=eli.current());++eli) { if (addLibUseClause(rt->name)) { Entry *current; EntryListIterator eLib(*root->children()); bool bFound=FALSE; for (eLib.toFirst();(current=eLib.current());++eLib) { if (VhdlDocGen::isVhdlClass(current)) if (current->startLine > rt->startLine) { bFound=TRUE; current->addSubEntry(rt); break; } }//for if (!bFound) { root->addSubEntry(rt); } } //if }// for epp.clear(); }//MapLib static bool addLibUseClause(const QCString &type) { static bool showIEEESTD=Config_getBool("FORCE_LOCAL_INCLUDES"); if (showIEEESTD) // all standard packages and libraries will not be shown { if (type.lower().stripPrefix("ieee")) return FALSE; if (type.lower().stripPrefix("std")) return FALSE; } return TRUE; } static void handleCommentBlock(const QCString &doc,bool brief) { int position=0; // empty comment --! if (doc.isEmpty()) return; bool needsEntry=FALSE; Protection protection=Public; int lineNr = iDocLine; Entry* current=getCurrentVhdlEntry(); if (oldEntry==current) { //printf("\n find pending message < %s > at line: %d \n ",doc.data(),iDocLine); str_doc.doc=doc; str_doc.iDocLine=iDocLine; str_doc.brief=brief; str_doc.pending=TRUE; return; } oldEntry=current; if (brief) { current->briefLine = iDocLine; } else { current->docLine = iDocLine; } // printf("parseCommentBlock file<%s>\n [%s]\n",yyFileName.data(),doc.data()); while (parseCommentBlock( g_thisParser, current, doc, // text yyFileName, // file lineNr, // line of block start brief, 0, FALSE, protection, position, needsEntry ) ) { //printf("parseCommentBlock position=%d [%s]\n",position,doc.data()+position); if (needsEntry) newVhdlEntry(); } if (needsEntry) { if (varr) { varr=FALSE; current->name=varName; current->section=Entry::VARIABLEDOC_SEC; varName=""; strComment.resize(0); } newVhdlEntry(); } iDocLine=-1; strComment.resize(0); } // returns the vhdl parsed types at line xxx QList* getEntryAtLine(const Entry* ce,int line) { EntryListIterator eli(*ce->children()); Entry *rt; for (;(rt=eli.current());++eli) { if (rt->bodyLine==line) { lineEntry.insert(0,rt); } // if getEntryAtLine(rt,line); } return &lineEntry; } // token index in vhdlparser.hpp 258..416 int getParsedLine(int object) { //assert(object>254 && object <416); return lineIndex [object]; } void isVhdlDocPending() { if (!str_doc.pending) { return; } str_doc.pending=FALSE; oldEntry=0; // prevents endless recursion iDocLine=str_doc.iDocLine; handleCommentBlock(str_doc.doc,str_doc.brief); iDocLine=-1; } static bool checkMultiComment(QCString& qcs,int line) { QList *pTemp=getEntryAtLine(current_root,line); if (pTemp->isEmpty()) return false; //int ii=pTemp->count(); qcs.stripPrefix("--!"); while (!pTemp->isEmpty()) { Entry *e=(Entry*)pTemp->getFirst(); e->briefLine=line; e->brief+=qcs; iDocLine=-1; pTemp->removeFirst(); //ii=pTemp->count(); } return true; }