4 #define YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
8 #define yy_create_buffer vhdlScanYY_create_buffer
9 #define yy_delete_buffer vhdlScanYY_delete_buffer
10 #define yy_flex_debug vhdlScanYY_flex_debug
11 #define yy_init_buffer vhdlScanYY_init_buffer
12 #define yy_flush_buffer vhdlScanYY_flush_buffer
13 #define yy_load_buffer_state vhdlScanYY_load_buffer_state
14 #define yy_switch_to_buffer vhdlScanYY_switch_to_buffer
15 #define yyin vhdlScanYYin
16 #define yyleng vhdlScanYYleng
17 #define yylex vhdlScanYYlex
18 #define yylineno vhdlScanYYlineno
19 #define yyout vhdlScanYYout
20 #define yyrestart vhdlScanYYrestart
21 #define yytext vhdlScanYYtext
22 #define yywrap vhdlScanYYwrap
23 #define yyalloc vhdlScanYYalloc
24 #define yyrealloc vhdlScanYYrealloc
25 #define yyfree vhdlScanYYfree
28 #define YY_FLEX_MAJOR_VERSION 2
29 #define YY_FLEX_MINOR_VERSION 5
30 #define YY_FLEX_SUBMINOR_VERSION 35
31 #if YY_FLEX_SUBMINOR_VERSION > 0
35 /* First, we deal with platform-specific or compiler-specific issues. */
37 /* begin standard C headers. */
43 /* end standard C headers. */
45 /* flex integer type definitions */
50 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
52 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
54 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
55 * if you want the limit (max/min) macros for int types.
57 #ifndef __STDC_LIMIT_MACROS
58 #define __STDC_LIMIT_MACROS 1
62 typedef int8_t flex_int8_t;
63 typedef uint8_t flex_uint8_t;
64 typedef int16_t flex_int16_t;
65 typedef uint16_t flex_uint16_t;
66 typedef int32_t flex_int32_t;
67 typedef uint32_t flex_uint32_t;
68 typedef uint64_t flex_uint64_t;
70 typedef signed char flex_int8_t;
71 typedef short int flex_int16_t;
72 typedef int flex_int32_t;
73 typedef unsigned char flex_uint8_t;
74 typedef unsigned short int flex_uint16_t;
75 typedef unsigned int flex_uint32_t;
78 /* Limits of integral types. */
80 #define INT8_MIN (-128)
83 #define INT16_MIN (-32767-1)
86 #define INT32_MIN (-2147483647-1)
89 #define INT8_MAX (127)
92 #define INT16_MAX (32767)
95 #define INT32_MAX (2147483647)
98 #define UINT8_MAX (255U)
101 #define UINT16_MAX (65535U)
104 #define UINT32_MAX (4294967295U)
107 #endif /* ! FLEXINT_H */
111 /* The "const" storage-class-modifier is valid. */
114 #else /* ! __cplusplus */
116 /* C99 requires __STDC__ to be defined as 1. */
117 #if defined (__STDC__)
121 #endif /* defined (__STDC__) */
122 #endif /* ! __cplusplus */
125 #define yyconst const
130 /* Returned upon end-of-file. */
133 /* Promotes a possibly negative, possibly signed char to an unsigned
134 * integer for use as an array index. If the signed char is negative,
135 * we want to instead treat it as an 8-bit unsigned char, hence the
138 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
140 /* Enter a start condition. This macro really ought to take a parameter,
141 * but we do it the disgusting crufty way forced on us by the ()-less
142 * definition of BEGIN.
144 #define BEGIN (yy_start) = 1 + 2 *
146 /* Translate the current start state into a value that can be later handed
147 * to BEGIN to return to the state. The YYSTATE alias is for lex
150 #define YY_START (((yy_start) - 1) / 2)
151 #define YYSTATE YY_START
153 /* Action number for EOF rule of a given start state. */
154 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
156 /* Special action meaning "start processing a new file". */
157 #define YY_NEW_FILE vhdlScanYYrestart(vhdlScanYYin )
159 #define YY_END_OF_BUFFER_CHAR 0
161 /* Size of default input buffer. */
163 #define YY_BUF_SIZE 262144
166 /* The state buf must be large enough to hold one state per character in the main buffer.
168 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
170 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
171 #define YY_TYPEDEF_YY_BUFFER_STATE
172 typedef struct yy_buffer_state *YY_BUFFER_STATE;
175 #ifndef YY_TYPEDEF_YY_SIZE_T
176 #define YY_TYPEDEF_YY_SIZE_T
177 typedef size_t yy_size_t;
180 extern yy_size_t vhdlScanYYleng;
182 extern FILE *vhdlScanYYin, *vhdlScanYYout;
184 #define EOB_ACT_CONTINUE_SCAN 0
185 #define EOB_ACT_END_OF_FILE 1
186 #define EOB_ACT_LAST_MATCH 2
188 #define YY_LESS_LINENO(n)
190 /* Return all but the first "n" matched characters back to the input stream. */
194 /* Undo effects of setting up vhdlScanYYtext. */ \
195 int yyless_macro_arg = (n); \
196 YY_LESS_LINENO(yyless_macro_arg);\
197 *yy_cp = (yy_hold_char); \
198 YY_RESTORE_YY_MORE_OFFSET \
199 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
200 YY_DO_BEFORE_ACTION; /* set up vhdlScanYYtext again */ \
204 #define unput(c) yyunput( c, (yytext_ptr) )
206 #ifndef YY_STRUCT_YY_BUFFER_STATE
207 #define YY_STRUCT_YY_BUFFER_STATE
208 struct yy_buffer_state
212 char *yy_ch_buf; /* input buffer */
213 char *yy_buf_pos; /* current position in input buffer */
215 /* Size of input buffer in bytes, not including room for EOB
218 yy_size_t yy_buf_size;
220 /* Number of characters read into yy_ch_buf, not including EOB
223 yy_size_t yy_n_chars;
225 /* Whether we "own" the buffer - i.e., we know we created it,
226 * and can realloc() it to grow it, and should free() it to
229 int yy_is_our_buffer;
231 /* Whether this is an "interactive" input source; if so, and
232 * if we're using stdio for input, then we want to use getc()
233 * instead of fread(), to make sure we stop fetching input after
236 int yy_is_interactive;
238 /* Whether we're considered to be at the beginning of a line.
239 * If so, '^' rules will be active on the next match, otherwise
244 int yy_bs_lineno; /**< The line count. */
245 int yy_bs_column; /**< The column count. */
247 /* Whether to try to fill the input buffer when we reach the
252 int yy_buffer_status;
254 #define YY_BUFFER_NEW 0
255 #define YY_BUFFER_NORMAL 1
256 /* When an EOF's been seen but there's still some text to process
257 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
258 * shouldn't try reading from the input source any more. We might
259 * still have a bunch of tokens to match, though, because of
260 * possible backing-up.
262 * When we actually see the EOF, we change the status to "new"
263 * (via vhdlScanYYrestart()), so that the user can continue scanning by
264 * just pointing vhdlScanYYin at a new input file.
266 #define YY_BUFFER_EOF_PENDING 2
269 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
271 /* Stack of input buffers. */
272 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
273 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
274 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
276 /* We provide macros for accessing buffer states in case in the
277 * future we want to put the buffer states in a more general
280 * Returns the top of the stack, or NULL.
282 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
283 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
286 /* Same as previous macro, but useful when we know that the buffer stack is not
287 * NULL or when we need an lvalue. For internal use only.
289 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
291 /* yy_hold_char holds the character lost when vhdlScanYYtext is formed. */
292 static char yy_hold_char;
293 static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
294 yy_size_t vhdlScanYYleng;
296 /* Points to current character in buffer. */
297 static char *yy_c_buf_p = (char *) 0;
298 static int yy_init = 0; /* whether we need to initialize */
299 static int yy_start = 0; /* start state number */
301 /* Flag which is used to allow vhdlScanYYwrap()'s to do buffer switches
302 * instead of setting up a fresh vhdlScanYYin. A bit of a hack ...
304 static int yy_did_buffer_switch_on_eof;
306 void vhdlScanYYrestart (FILE *input_file );
307 void vhdlScanYY_switch_to_buffer (YY_BUFFER_STATE new_buffer );
308 YY_BUFFER_STATE vhdlScanYY_create_buffer (FILE *file,int size );
309 void vhdlScanYY_delete_buffer (YY_BUFFER_STATE b );
310 void vhdlScanYY_flush_buffer (YY_BUFFER_STATE b );
311 void vhdlScanYYpush_buffer_state (YY_BUFFER_STATE new_buffer );
312 void vhdlScanYYpop_buffer_state (void );
314 static void vhdlScanYYensure_buffer_stack (void );
315 static void vhdlScanYY_load_buffer_state (void );
316 static void vhdlScanYY_init_buffer (YY_BUFFER_STATE b,FILE *file );
318 #define YY_FLUSH_BUFFER vhdlScanYY_flush_buffer(YY_CURRENT_BUFFER )
320 YY_BUFFER_STATE vhdlScanYY_scan_buffer (char *base,yy_size_t size );
321 YY_BUFFER_STATE vhdlScanYY_scan_string (yyconst char *yy_str );
322 YY_BUFFER_STATE vhdlScanYY_scan_bytes (yyconst char *bytes,yy_size_t len );
324 void *vhdlScanYYalloc (yy_size_t );
325 void *vhdlScanYYrealloc (void *,yy_size_t );
326 void vhdlScanYYfree (void * );
328 #define yy_new_buffer vhdlScanYY_create_buffer
330 #define yy_set_interactive(is_interactive) \
332 if ( ! YY_CURRENT_BUFFER ){ \
333 vhdlScanYYensure_buffer_stack (); \
334 YY_CURRENT_BUFFER_LVALUE = \
335 vhdlScanYY_create_buffer(vhdlScanYYin,YY_BUF_SIZE ); \
337 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
340 #define yy_set_bol(at_bol) \
342 if ( ! YY_CURRENT_BUFFER ){\
343 vhdlScanYYensure_buffer_stack (); \
344 YY_CURRENT_BUFFER_LVALUE = \
345 vhdlScanYY_create_buffer(vhdlScanYYin,YY_BUF_SIZE ); \
347 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
350 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
352 /* Begin user sect3 */
354 #define vhdlScanYYwrap(n) 1
355 #define YY_SKIP_YYWRAP
357 typedef unsigned char YY_CHAR;
359 FILE *vhdlScanYYin = (FILE *) 0, *vhdlScanYYout = (FILE *) 0;
361 typedef int yy_state_type;
363 extern int vhdlScanYYlineno;
365 int vhdlScanYYlineno = 1;
367 extern char *vhdlScanYYtext;
368 #define yytext_ptr vhdlScanYYtext
370 static yy_state_type yy_get_previous_state (void );
371 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
372 static int yy_get_next_buffer (void );
373 static void yy_fatal_error (yyconst char msg[] );
375 /* Done after the current pattern has been matched and before the
376 * corresponding action - sets up vhdlScanYYtext.
378 #define YY_DO_BEFORE_ACTION \
379 (yytext_ptr) = yy_bp; \
380 vhdlScanYYleng = (yy_size_t) (yy_cp - yy_bp); \
381 (yy_hold_char) = *yy_cp; \
383 (yy_c_buf_p) = yy_cp;
385 #define YY_NUM_RULES 55
386 #define YY_END_OF_BUFFER 56
387 /* This struct is not used in this scanner,
388 but its presence is necessary. */
391 flex_int32_t yy_verify;
394 static yyconst flex_int16_t yy_acclist[231] =
396 56, 47, 55, 1, 47, 55, 45, 55, 47, 55,
397 47, 55, 47, 55, 2, 47, 55, 3, 47, 55,
398 4, 47, 55, 5, 47, 55, 7, 47, 55, 8,
399 47, 55, 9, 47, 55, 10, 47, 55, 33, 47,
400 55, 34, 47, 55, 40, 47, 55, 12, 47, 55,
401 13, 47, 55, 16, 47, 55, 18, 47, 55, 17,
402 47, 55, 31, 47, 55, 35, 47, 55, 39, 47,
403 55, 39, 47, 55, 39, 47, 55, 39, 47, 55,
404 39, 47, 55, 39, 47, 55, 39, 47, 55, 37,
405 47, 55, 47, 55, 38, 47, 55, 36, 47, 55,
407 47, 55, 32, 47, 55, 50, 55, 50, 55, 50,
408 55, 50, 55, 50, 55, 50, 55, 55, 55, 53,
409 55, 55, 55, 55, 55, 55, 55, 55, 42, 42,
410 6, 46, 52, 19, 40, 11, 22, 14, 21, 20,
411 15, 23, 28, 29, 27, 24, 39, 39, 39, 39,
412 39, 39, 39, 39, 39, 44, 44, 46, 53, 46,
413 52, 53, 54, 41, 46, 46, 51, 40, 40, 40,
414 30, 26, 25, 46, 49, 51, 46, 46, 51, 46,
415 53, 46, 51, 46, 51, 40, 40, 40, 40, 43,
416 49, 46, 49, 51, 46, 49, 51, 46, 51, 46,
418 51, 53, 46, 51, 46, 51,16432, 49, 49, 46,
419 49, 51, 53, 46, 51,16432, 46, 51, 53, 46,
420 51, 53, 40, 40, 49, 53, 40, 40, 8240, 8240
423 static yyconst flex_int16_t yy_accept[223] =
425 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
426 4, 7, 9, 11, 13, 15, 18, 21, 24, 27,
427 30, 33, 36, 39, 42, 45, 48, 51, 54, 57,
428 60, 63, 66, 69, 72, 75, 78, 81, 84, 87,
429 90, 93, 95, 98, 101, 103, 106, 108, 110, 112,
430 114, 116, 118, 119, 120, 122, 123, 124, 125, 126,
431 127, 128, 129, 129, 129, 129, 130, 130, 130, 131,
432 131, 131, 131, 132, 133, 134, 135, 135, 135, 136,
433 136, 136, 136, 136, 136, 136, 136, 136, 136, 137,
434 138, 139, 140, 141, 142, 143, 143, 144, 145, 146,
436 147, 148, 149, 149, 149, 149, 150, 151, 152, 153,
437 154, 155, 155, 155, 156, 157, 158, 158, 158, 159,
438 159, 160, 160, 160, 161, 163, 164, 164, 165, 166,
439 168, 168, 169, 169, 169, 170, 170, 170, 170, 170,
440 170, 170, 171, 172, 173, 174, 174, 174, 174, 177,
441 177, 178, 180, 182, 182, 184, 186, 187, 187, 187,
442 187, 188, 188, 188, 188, 189, 189, 190, 190, 191,
443 191, 191, 191, 191, 192, 195, 198, 198, 200, 203,
444 205, 205, 207, 208, 208, 208, 208, 208, 209, 210,
445 213, 213, 214, 216, 217, 220, 223, 223, 223, 223,
447 223, 224, 224, 224, 224, 224, 224, 225, 226, 226,
448 227, 227, 227, 227, 228, 228, 229, 229, 229, 230,
452 static yyconst flex_int32_t yy_ec[256] =
454 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
455 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
456 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
457 1, 2, 5, 6, 7, 8, 9, 10, 11, 12,
458 13, 14, 15, 16, 17, 18, 19, 20, 20, 20,
459 20, 20, 20, 20, 20, 20, 20, 21, 22, 23,
460 24, 25, 26, 27, 28, 29, 28, 30, 31, 28,
461 32, 32, 32, 32, 32, 32, 32, 32, 33, 32,
462 32, 32, 34, 32, 35, 32, 32, 36, 32, 32,
463 37, 38, 39, 40, 41, 42, 28, 43, 28, 44,
465 31, 28, 32, 32, 32, 32, 32, 32, 32, 32,
466 45, 32, 32, 32, 46, 32, 47, 32, 32, 48,
467 32, 32, 49, 50, 49, 8, 1, 1, 1, 1,
468 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
469 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
470 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
471 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
472 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
473 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
474 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
476 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
477 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
478 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
479 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
480 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
484 static yyconst flex_int32_t yy_meta[51] =
486 1, 2, 3, 1, 2, 4, 5, 2, 6, 2,
487 2, 2, 2, 2, 2, 2, 2, 7, 2, 8,
488 9, 2, 2, 2, 2, 2, 2, 8, 8, 8,
489 8, 10, 10, 10, 10, 10, 2, 2, 2, 2,
490 8, 2, 8, 8, 10, 10, 10, 10, 11, 2
493 static yyconst flex_int16_t yy_base[252] =
495 0, 0, 49, 52, 56, 60, 78, 82, 937, 938,
496 85, 101, 104, 120, 169, 938, 218, 938, 938, 922,
497 938, 938, 918, 938, 43, 262, 910, 938, 86, 908,
498 66, 251, 938, 52, 279, 0, 0, 315, 282, 0,
499 938, 362, 938, 938, 385, 938, 938, 269, 915, 917,
500 329, 913, 896, 333, 879, 98, 878, 938, 336, 819,
501 799, 791, 339, 767, 0, 756, 0, 0, 749, 0,
502 744, 743, 938, 748, 938, 938, 406, 726, 0, 423,
503 107, 108, 264, 114, 412, 429, 281, 716, 938, 938,
504 938, 938, 938, 938, 938, 690, 671, 938, 669, 938,
506 295, 307, 78, 450, 455, 0, 0, 0, 0, 0,
507 0, 0, 0, 0, 472, 0, 421, 675, 684, 639,
508 636, 507, 300, 352, 632, 938, 640, 938, 0, 595,
509 271, 451, 308, 621, 282, 313, 353, 359, 433, 438,
510 450, 505, 938, 938, 938, 59, 454, 635, 588, 340,
511 80, 473, 608, 0, 618, 0, 587, 509, 523, 514,
512 528, 597, 542, 510, 557, 546, 420, 562, 938, 491,
513 563, 455, 567, 531, 552, 0, 551, 546, 547, 553,
514 524, 488, 59, 564, 287, 447, 584, 486, 0, 470,
515 599, 600, 602, 606, 612, 432, 424, 561, 405, 351,
517 449, 293, 599, 492, 604, 202, 494, 218, 622, 635,
518 637, 595, 168, 527, 152, 611, 104, 347, 938, 64,
519 938, 654, 665, 676, 680, 689, 700, 711, 722, 733,
520 740, 742, 748, 751, 759, 770, 781, 791, 802, 813,
521 824, 835, 846, 857, 868, 879, 886, 887, 896, 907,
525 static yyconst flex_int16_t yy_def[252] =
527 221, 1, 222, 222, 223, 223, 224, 224, 221, 221,
528 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
529 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
530 221, 221, 221, 225, 225, 35, 35, 35, 38, 35,
531 221, 221, 221, 221, 226, 221, 221, 221, 221, 221,
532 221, 221, 227, 227, 221, 227, 227, 221, 221, 221,
533 221, 221, 221, 221, 14, 221, 14, 15, 221, 15,
534 221, 221, 221, 228, 221, 221, 221, 221, 26, 221,
535 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
536 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
538 35, 35, 225, 221, 221, 35, 35, 35, 35, 35,
539 35, 42, 42, 42, 226, 115, 221, 221, 228, 227,
540 221, 227, 227, 229, 221, 221, 221, 221, 228, 230,
541 231, 221, 232, 221, 221, 221, 221, 221, 221, 221,
542 221, 221, 221, 221, 221, 233, 234, 221, 235, 227,
543 229, 236, 228, 237, 238, 239, 221, 221, 231, 221,
544 221, 221, 221, 232, 221, 221, 221, 221, 221, 233,
545 221, 234, 221, 240, 241, 242, 243, 244, 238, 245,
546 246, 238, 221, 221, 247, 248, 221, 249, 250, 241,
547 251, 246, 244, 227, 238, 239, 246, 221, 221, 221,
549 221, 247, 221, 248, 221, 221, 221, 249, 251, 246,
550 227, 227, 221, 221, 221, 221, 221, 227, 221, 227,
551 0, 221, 221, 221, 221, 221, 221, 221, 221, 221,
552 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
553 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
557 static yyconst flex_int16_t yy_nxt[989] =
559 10, 11, 12, 13, 10, 14, 10, 10, 15, 16,
560 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
561 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
562 34, 34, 37, 38, 39, 40, 41, 42, 43, 44,
563 10, 45, 35, 36, 37, 38, 39, 40, 10, 46,
564 48, 48, 48, 51, 48, 48, 75, 54, 54, 54,
565 198, 54, 54, 54, 169, 49, 76, 50, 52, 55,
566 50, 101, 56, 55, 57, 199, 56, 121, 57, 59,
567 59, 59, 120, 59, 59, 59, 63, 63, 63, 94,
568 95, 60, 103, 153, 61, 60, 62, 101, 61, 171,
570 62, 64, 63, 63, 63, 63, 63, 63, 90, 91,
571 92, 121, 104, 104, 124, 105, 105, 64, 221, 104,
572 64, 65, 105, 216, 65, 66, 65, 65, 65, 65,
573 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
574 65, 65, 65, 65, 65, 65, 65, 67, 67, 67,
575 67, 67, 67, 67, 67, 67, 65, 65, 65, 65,
576 65, 65, 67, 67, 67, 67, 67, 67, 65, 65,
577 68, 214, 219, 68, 68, 68, 68, 69, 68, 68,
578 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
579 68, 68, 68, 68, 68, 68, 70, 70, 70, 70,
581 70, 70, 70, 70, 70, 68, 68, 68, 68, 68,
582 68, 70, 70, 70, 70, 70, 70, 68, 68, 71,
583 183, 207, 71, 71, 71, 71, 71, 71, 71, 71,
584 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
585 71, 71, 71, 71, 71, 72, 72, 72, 72, 72,
586 72, 72, 72, 72, 71, 71, 71, 71, 71, 71,
587 72, 72, 72, 72, 72, 72, 71, 71, 77, 96,
588 63, 63, 63, 97, 98, 99, 100, 157, 134, 78,
589 134, 79, 80, 135, 104, 64, 104, 105, 158, 105,
590 81, 82, 83, 157, 84, 85, 86, 87, 101, 157,
592 221, 167, 88, 221, 81, 82, 84, 85, 86, 87,
593 109, 160, 221, 121, 110, 221, 150, 111, 104, 103,
594 221, 105, 168, 221, 109, 163, 110, 203, 165, 111,
595 117, 63, 63, 203, 122, 122, 122, 63, 63, 63,
596 63, 63, 63, 106, 177, 118, 121, 107, 166, 123,
597 108, 220, 64, 121, 120, 64, 152, 106, 104, 107,
598 121, 105, 108, 112, 104, 153, 112, 105, 112, 112,
599 201, 112, 112, 112, 112, 112, 112, 112, 112, 112,
600 112, 112, 112, 112, 112, 112, 112, 112, 112, 113,
601 113, 113, 113, 113, 113, 113, 113, 113, 112, 114,
603 112, 112, 112, 112, 113, 113, 113, 113, 113, 113,
604 112, 112, 116, 116, 116, 116, 116, 116, 116, 116,
605 116, 213, 117, 63, 63, 131, 183, 116, 116, 116,
606 116, 116, 116, 131, 131, 131, 131, 118, 104, 167,
607 136, 105, 133, 104, 137, 196, 105, 138, 131, 131,
608 133, 133, 133, 133, 136, 104, 137, 139, 105, 138,
609 168, 140, 169, 169, 141, 133, 133, 165, 214, 146,
610 161, 139, 183, 140, 147, 120, 141, 146, 146, 146,
611 146, 83, 147, 147, 147, 147, 179, 205, 183, 215,
612 183, 162, 146, 146, 173, 173, 169, 147, 147, 116,
614 116, 116, 116, 116, 116, 116, 116, 116, 122, 122,
615 122, 77, 165, 216, 116, 116, 116, 116, 116, 116,
616 121, 180, 78, 123, 142, 80, 183, 163, 185, 157,
617 165, 171, 205, 159, 217, 83, 185, 185, 185, 185,
618 158, 159, 159, 159, 159, 88, 214, 161, 194, 183,
619 166, 185, 185, 120, 183, 120, 159, 159, 83, 195,
620 195, 186, 198, 160, 192, 164, 196, 215, 162, 186,
621 186, 186, 186, 164, 164, 164, 164, 199, 200, 189,
622 200, 167, 170, 201, 186, 186, 172, 187, 164, 164,
623 170, 170, 170, 170, 172, 172, 172, 172, 206, 120,
625 206, 194, 183, 207, 194, 170, 170, 211, 121, 172,
626 172, 218, 210, 210, 183, 195, 161, 184, 202, 121,
627 183, 153, 212, 204, 194, 195, 202, 202, 202, 202,
628 216, 204, 204, 204, 204, 210, 176, 183, 211, 174,
629 135, 202, 202, 156, 154, 121, 204, 204, 210, 121,
630 121, 217, 121, 212, 47, 47, 47, 47, 47, 47,
631 47, 47, 47, 47, 47, 53, 53, 53, 53, 53,
632 53, 53, 53, 53, 53, 53, 58, 58, 58, 58,
633 58, 58, 58, 58, 58, 58, 58, 102, 149, 102,
634 115, 148, 145, 115, 144, 115, 115, 115, 115, 115,
636 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
637 120, 129, 129, 143, 129, 129, 129, 129, 129, 129,
638 129, 129, 151, 151, 151, 151, 151, 151, 151, 151,
639 151, 151, 151, 155, 155, 142, 155, 155, 155, 155,
640 155, 155, 155, 155, 159, 132, 159, 159, 164, 164,
641 164, 170, 130, 128, 128, 170, 172, 68, 172, 175,
642 175, 65, 175, 175, 175, 175, 175, 175, 175, 175,
643 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
644 178, 181, 181, 127, 181, 181, 181, 181, 181, 181,
645 181, 182, 182, 182, 182, 182, 182, 182, 182, 182,
647 182, 182, 156, 156, 75, 156, 156, 156, 156, 156,
648 156, 156, 156, 188, 188, 74, 188, 188, 188, 188,
649 188, 188, 188, 188, 190, 190, 190, 190, 190, 190,
650 190, 190, 190, 190, 190, 176, 176, 126, 176, 176,
651 176, 176, 176, 176, 176, 176, 191, 191, 191, 191,
652 191, 191, 191, 191, 191, 191, 191, 193, 193, 193,
653 193, 193, 193, 193, 193, 193, 193, 193, 180, 180,
654 180, 180, 180, 180, 180, 180, 180, 180, 180, 197,
655 197, 197, 197, 197, 197, 197, 197, 197, 197, 197,
656 202, 125, 121, 202, 204, 204, 208, 208, 208, 208,
658 208, 208, 208, 208, 208, 208, 208, 189, 189, 121,
659 189, 189, 189, 189, 189, 189, 189, 189, 209, 209,
660 209, 209, 209, 209, 209, 209, 209, 209, 209, 119,
661 75, 74, 93, 89, 74, 73, 221, 9, 221, 221,
662 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
663 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
664 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
665 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
666 221, 221, 221, 221, 221, 221, 221, 221
669 static yyconst flex_int16_t yy_chk[989] =
671 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
672 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
673 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
674 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
675 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
676 3, 3, 3, 4, 4, 4, 25, 5, 5, 5,
677 183, 6, 6, 6, 146, 3, 25, 3, 4, 5,
678 4, 34, 5, 6, 5, 183, 6, 220, 6, 7,
679 7, 7, 151, 8, 8, 8, 11, 11, 11, 31,
680 31, 7, 34, 151, 7, 8, 7, 103, 8, 146,
682 8, 11, 12, 12, 12, 13, 13, 13, 29, 29,
683 29, 56, 81, 82, 56, 81, 82, 12, 103, 84,
684 13, 14, 84, 217, 14, 14, 14, 14, 14, 14,
685 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
686 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
687 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
688 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
689 15, 215, 213, 15, 15, 15, 15, 15, 15, 15,
690 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
691 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
693 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
694 15, 15, 15, 15, 15, 15, 15, 15, 15, 17,
695 208, 206, 17, 17, 17, 17, 17, 17, 17, 17,
696 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
697 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
698 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
699 17, 17, 17, 17, 17, 17, 17, 17, 26, 32,
700 48, 48, 48, 32, 32, 32, 32, 131, 83, 26,
701 83, 26, 26, 83, 35, 48, 87, 35, 131, 87,
702 26, 26, 26, 185, 26, 26, 26, 26, 35, 202,
704 101, 135, 26, 101, 26, 26, 26, 26, 26, 26,
705 39, 131, 102, 123, 39, 102, 123, 39, 136, 35,
706 38, 136, 135, 38, 39, 133, 39, 185, 133, 39,
707 51, 51, 51, 202, 54, 54, 54, 59, 59, 59,
708 63, 63, 63, 38, 150, 51, 54, 38, 133, 54,
709 38, 218, 59, 150, 124, 63, 124, 38, 137, 38,
710 218, 137, 38, 42, 138, 124, 42, 138, 42, 42,
711 200, 42, 42, 42, 42, 42, 42, 42, 42, 42,
712 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
713 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
715 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
716 42, 42, 45, 45, 45, 45, 45, 45, 45, 45,
717 45, 199, 117, 117, 117, 77, 197, 45, 45, 45,
718 45, 45, 45, 77, 77, 77, 77, 117, 139, 167,
719 85, 139, 80, 140, 85, 196, 140, 85, 77, 77,
720 80, 80, 80, 80, 85, 141, 85, 86, 141, 85,
721 167, 86, 147, 172, 86, 80, 80, 186, 201, 104,
722 132, 86, 190, 86, 105, 152, 86, 104, 104, 104,
723 104, 132, 105, 105, 105, 105, 152, 186, 188, 201,
724 182, 132, 104, 104, 147, 172, 170, 105, 105, 115,
726 115, 115, 115, 115, 115, 115, 115, 115, 122, 122,
727 122, 142, 204, 207, 115, 115, 115, 115, 115, 115,
728 122, 152, 142, 122, 142, 142, 181, 164, 158, 159,
729 164, 170, 204, 160, 207, 142, 158, 158, 158, 158,
730 159, 160, 160, 160, 160, 142, 214, 161, 178, 179,
731 164, 158, 158, 177, 175, 180, 160, 160, 161, 178,
732 179, 163, 198, 159, 177, 166, 180, 214, 161, 163,
733 163, 163, 163, 166, 166, 166, 166, 198, 184, 174,
734 184, 168, 171, 184, 163, 163, 173, 165, 166, 166,
735 171, 171, 171, 171, 173, 173, 173, 173, 187, 177,
737 187, 191, 192, 187, 193, 171, 171, 194, 212, 173,
738 173, 212, 191, 192, 195, 193, 162, 157, 203, 194,
739 155, 153, 194, 205, 209, 195, 203, 203, 203, 203,
740 216, 205, 205, 205, 205, 209, 149, 210, 211, 148,
741 134, 203, 203, 130, 127, 125, 205, 205, 210, 121,
742 211, 216, 120, 211, 222, 222, 222, 222, 222, 222,
743 222, 222, 222, 222, 222, 223, 223, 223, 223, 223,
744 223, 223, 223, 223, 223, 223, 224, 224, 224, 224,
745 224, 224, 224, 224, 224, 224, 224, 225, 119, 225,
746 226, 118, 99, 226, 97, 226, 226, 226, 226, 226,
748 227, 227, 227, 227, 227, 227, 227, 227, 227, 227,
749 227, 228, 228, 96, 228, 228, 228, 228, 228, 228,
750 228, 228, 229, 229, 229, 229, 229, 229, 229, 229,
751 229, 229, 229, 230, 230, 88, 230, 230, 230, 230,
752 230, 230, 230, 230, 231, 78, 231, 231, 232, 232,
753 232, 233, 74, 72, 71, 233, 234, 69, 234, 235,
754 235, 66, 235, 235, 235, 235, 235, 235, 235, 235,
755 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
756 236, 237, 237, 64, 237, 237, 237, 237, 237, 237,
757 237, 238, 238, 238, 238, 238, 238, 238, 238, 238,
759 238, 238, 239, 239, 62, 239, 239, 239, 239, 239,
760 239, 239, 239, 240, 240, 61, 240, 240, 240, 240,
761 240, 240, 240, 240, 241, 241, 241, 241, 241, 241,
762 241, 241, 241, 241, 241, 242, 242, 60, 242, 242,
763 242, 242, 242, 242, 242, 242, 243, 243, 243, 243,
764 243, 243, 243, 243, 243, 243, 243, 244, 244, 244,
765 244, 244, 244, 244, 244, 244, 244, 244, 245, 245,
766 245, 245, 245, 245, 245, 245, 245, 245, 245, 246,
767 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
768 247, 57, 55, 247, 248, 248, 249, 249, 249, 249,
770 249, 249, 249, 249, 249, 249, 249, 250, 250, 53,
771 250, 250, 250, 250, 250, 250, 250, 250, 251, 251,
772 251, 251, 251, 251, 251, 251, 251, 251, 251, 52,
773 50, 49, 30, 27, 23, 20, 9, 221, 221, 221,
774 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
775 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
776 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
777 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
778 221, 221, 221, 221, 221, 221, 221, 221
781 extern int vhdlScanYY_flex_debug;
782 int vhdlScanYY_flex_debug = 0;
784 static yy_state_type *yy_state_buf=0, *yy_state_ptr=0;
785 static char *yy_full_match;
787 static int yy_looking_for_trail_begin = 0;
788 static int yy_full_lp;
789 static int *yy_full_state;
790 #define YY_TRAILING_MASK 0x2000
791 #define YY_TRAILING_HEAD_MASK 0x4000
794 *yy_cp = (yy_hold_char); /* undo effects of setting up vhdlScanYYtext */ \
795 yy_cp = (yy_full_match); /* restore poss. backed-over text */ \
796 (yy_lp) = (yy_full_lp); /* restore orig. accepting pos. */ \
797 (yy_state_ptr) = (yy_full_state); /* restore orig. state */ \
798 yy_current_state = *(yy_state_ptr); /* restore curr. state */ \
803 #define yymore() yymore_used_but_not_detected
804 #define YY_MORE_ADJ 0
805 #define YY_RESTORE_YY_MORE_OFFSET
806 char *vhdlScanYYtext;
807 #line 1 "vhdlscanner.l"
808 /************** VHDL scanner in LEX format **********
810 * Version 0.2 Wed Aug 11, 1993
812 * This scanner is derived from a scanner of the ALLIANCE CAD toolset,
813 * release 1.1. That toolset was written from:
814 * MASI/CAO-VLSI CAD Team
815 * Laboratoire MASI/CAO-VLSI
816 * Tour 55-65, 2eme etage, Porte 13
817 * Universite Pierre et Marie Curie (PARIS VI)
818 * 4, place Jussieu 75252 PARIS Cedex 05, FRANCE
819 * The ALLIANCE CAD Toolset can be obtained from ftp site : ftp-masi.ibp.fr
821 * This scanner is avail at: ftp.cs.utwente.nl in pub/src/VHDL/Grammar
822 * A corresponding Yacc grammar is available at the same site
824 * author of this derived scanner version:
826 * Dortmund University
827 * Dept. of Computer Scienc, LS1
829 * D-44221 Dortmund (Germany)
830 * Phone: +49-231-755-6464
831 * e-mail: dettmer@ls1.informatik.uni-dortmund.de
834 ****************************************************************
836 * This file is intended not to be used for commercial purposes
837 * without permission of the University of Dortmund
839 * NOTE THAT THERE IS NO WARRANTY FOR CORRECTNES, COMPLETENESS, SUPPORT
841 *******************************************************/
842 /******************************************************************************
843 * modified for doxygen by M. Kreis
844 * extended to VHDL 93/2002/2008
845 ******************************************************************************/
846 #line 40 "vhdlscanner.l"
860 #include "commentscan.h"
861 #include "vhdlparser.h"
862 #include "vhdlscanner.h"
865 #include "searchindex.h"
868 #include "vhdldocgen.h"
872 #include "vhdlcode.h"
876 #define YY_NO_INPUT 1
878 extern void vhdlParse(); // defined in vhdlparser.y
880 static bool g_lexInit = FALSE;
881 static ParserInterface *g_thisParser;
882 static VhdlContainer* yycont=NULL;
883 static Entry* current_root;
886 static int yyLineNr =1;
887 static int g_lastCommentContext;
888 static int inputPosition;
889 static int startComment;
890 static QCString inputVhdlString;
891 static QFile inputFile;
892 static QCString yyFileName;
893 static QList<QCString> qlist;
894 static QCString lastLetter;
896 static bool doxComment=FALSE; // doxygen comment ?
897 static QCString strComment;
898 static int iDocLine=-1;
899 static int* lineIndex=NULL;
900 static int num_chars;
901 static int prevToken;
904 static QMap<QCString, int> keyMap;
905 static QList<Entry> lineEntry;
906 static bool checkMultiComment(QCString& qcs,int line);
907 static void handleCommentBlock(const QCString &doc,bool brief);
908 static void mapLibPackage(const Entry* ce);
909 static QList<Entry>* getEntryAtLine(const Entry* ce,int line);
910 static bool addLibUseClause(const QCString &type);
911 static Entry* oldEntry;
912 static bool varr=FALSE;
913 static QCString varName;
923 #define YY_NEVER_INTERACTIVE 1
924 #define YY_USER_ACTION num_chars += vhdlScanYYleng;
926 #define MAX_KEYWORD_LEN 20
930 char nom[MAX_KEYWORD_LEN];
934 static el_mc tab_mc []=
937 { "access", t_ACCESS },
938 { "after", t_AFTER },
939 { "alias", t_ALIAS },
942 { "architecture", t_ARCHITECTURE },
943 { "array", t_ARRAY },
944 { "assert", t_ASSERT },
945 { "assume", t_ASSUME },
946 { "assume_guarantee", t_ASSUME_GUARANTEE },
947 { "attribute", t_ATTRIBUTE },
949 { "begin", t_BEGIN },
950 { "block", t_BLOCK },
952 { "buffer", t_BUFFER },
956 { "component", t_COMPONENT },
957 { "configuration", t_CONFIGURATION },
958 { "constant", t_CONSTANT },
959 { "context", t_CONTEXT },
960 { "cover", t_COVER },
962 { "default", t_DEFAULT },
963 { "disconnect", t_DISCONNECT },
964 { "downto", t_DOWNTO },
967 { "elsif", t_ELSIF },
969 { "entity", t_ENTITY },
972 { "fairness", t_FAIRNESS },
975 { "force", t_FORCE },
976 { "function", t_FUNCTION },
978 { "generate", t_GENERATE },
979 { "generic", t_GENERIC },
980 { "group", t_GROUP },
981 { "guarded", t_GUARDED },
984 { "impure", t_IMPURE },
986 { "inertial", t_INERTIAL },
987 { "inout", t_INOUT },
990 { "label", t_LABEL },
991 { "library", t_LIBRARY },
992 { "linkage", t_LINKAGE },
993 { "literal", t_LITERAL },
1010 { "others", t_OTHERS },
1013 { "package", t_PACKAGE },
1014 { "parameter", t_PARAMETER },
1016 { "postponed", t_POSTPONED },
1017 { "procedure", t_PROCEDURE },
1018 { "process", t_PROCESS },
1019 { "property", t_PROPERTY },
1020 { "protected", t_PROTECTED },
1023 { "range", t_RANGE },
1024 { "record", t_RECORD },
1025 { "register", t_REGISTER },
1026 { "reject", t_REJECT },
1027 { "release", t_RELEASE },
1028 { "restrict", t_RESTRICT },
1029 { "restrict_guarantee", t_RESTRICT_GUARANTEE },
1031 { "report", t_REPORT },
1034 { "return", t_RETURN },
1036 { "select", t_SELECT },
1037 { "sequence", t_SEQUENCE },
1038 { "severity", t_SEVERITY },
1039 { "signal", t_SIGNAL },
1040 { "shared", t_SHARED },
1045 { "strong", t_STRONG },
1046 { "subtype", t_SUBTYPE },
1050 { "transport", t_TRANSPORT },
1053 { "unaffected", t_UNAFFECTED },
1054 { "units", t_UNITS },
1055 { "until", t_UNTIL },
1058 { "variable", t_VARIABLE },
1059 { "vmode", t_VMODE },
1060 { "vprop", t_VPROP },
1061 { "vunit", t_VUNIT },
1065 { "while", t_WHILE },
1070 { "zz", -1 } // list end
1074 static int find_keyword(char *s)
1078 if (word.length() > MAX_KEYWORD_LEN)
1082 QMap<QCString, int>::Iterator it = keyMap.find(word);
1089 // update current line
1090 static void lineCount()
1092 for (const char* c=vhdlScanYYtext ; *c ; ++c )
1094 yyLineNr += (*c == '\n') ;
1099 static void startCodeBlock(int index){
1100 int ll=strComment.length();
1101 iCodeLen=inputVhdlString.findRev(strComment.data())+ll;
1102 // fprintf(stderr,"\n startin code..%d %d %d\n",iCodeLen,num_chars,ll);
1105 int len=strComment.length();
1106 QCString name=strComment.right(len-index);//
1107 name=VhdlDocGen::getIndexWord(name.data(),1);
1109 gBlock.name="misc"+ VhdlDocGen::getRecordNumber();
1112 strComment=strComment.left(index);
1113 gBlock.startLine=yyLineNr+1;
1114 gBlock.bodyLine=yyLineNr+1;
1115 VhdlDocGen::prepareComment(strComment);
1116 gBlock.brief+=strComment;
1118 static void makeInlineDoc(int endCode)
1120 int len=endCode-iCodeLen;
1121 QCString par=inputVhdlString.mid(iCodeLen,len);
1123 gBlock.inbodyDocs=par;
1124 gBlock.section=Entry::VARIABLE_SEC;
1125 gBlock.spec=VhdlDocGen::MISCELLANEOUS;
1126 gBlock.fileName = yyFileName;
1127 gBlock.endBodyLine=yyLineNr-1;
1128 gBlock.lang=SrcLangExt_VHDL;
1129 Entry *temp=new Entry(gBlock);
1131 Entry* compound=getVhdlCompound();
1135 compound->addSubEntry(temp);
1139 temp->type="misc"; // global code like library ieee...
1140 current_root->addSubEntry(temp);
1142 strComment.resize(0);
1148 static bool isConstraintFile(const QCString &fileName,const QCString &ext)
1150 return fileName.right(ext.length())==ext;
1153 //static void resetScanner(const char* s,MyParserVhdl* parse);
1156 #define YY_INPUT(buf,result,max_size) result=vhdlScanYYread(buf,max_size);
1159 static int vhdlScanYYread(char *buf,int max_size)
1162 while ( c < max_size && inputVhdlString.at(inputPosition) )
1164 *buf = inputVhdlString.at(inputPosition++) ;
1173 #line 1174 "<stdout>"
1177 #define Vhdl2008Comment 2
1178 #define EndVhdl2008Comment 3
1180 #ifndef YY_NO_UNISTD_H
1181 /* Special case for "unistd.h", since it is non-ANSI. We include it way
1182 * down here because we want the user's section 1 to have been scanned first.
1183 * The user has a chance to override it with an option.
1188 #ifndef YY_EXTRA_TYPE
1189 #define YY_EXTRA_TYPE void *
1192 static int yy_init_globals (void );
1194 /* Accessor methods to globals.
1195 These are made visible to non-reentrant scanners for convenience. */
1197 int vhdlScanYYlex_destroy (void );
1199 int vhdlScanYYget_debug (void );
1201 void vhdlScanYYset_debug (int debug_flag );
1203 YY_EXTRA_TYPE vhdlScanYYget_extra (void );
1205 void vhdlScanYYset_extra (YY_EXTRA_TYPE user_defined );
1207 FILE *vhdlScanYYget_in (void );
1209 void vhdlScanYYset_in (FILE * in_str );
1211 FILE *vhdlScanYYget_out (void );
1213 void vhdlScanYYset_out (FILE * out_str );
1215 yy_size_t vhdlScanYYget_leng (void );
1217 char *vhdlScanYYget_text (void );
1219 int vhdlScanYYget_lineno (void );
1221 void vhdlScanYYset_lineno (int line_number );
1223 /* Macros after this point can all be overridden by user definitions in
1227 #ifndef YY_SKIP_YYWRAP
1229 extern "C" int vhdlScanYYwrap (void );
1231 extern int vhdlScanYYwrap (void );
1235 static void yyunput (int c,char *buf_ptr );
1238 static void yy_flex_strncpy (char *,yyconst char *,int );
1241 #ifdef YY_NEED_STRLEN
1242 static int yy_flex_strlen (yyconst char * );
1248 static int yyinput (void );
1250 static int input (void );
1255 /* Amount of stuff to slurp up with each read. */
1256 #ifndef YY_READ_BUF_SIZE
1257 #define YY_READ_BUF_SIZE 262144
1260 /* Copy whatever the last rule matched to the standard output. */
1262 /* This used to be an fputs(), but since the string might contain NUL's,
1263 * we now use fwrite().
1265 #define ECHO fwrite( vhdlScanYYtext, vhdlScanYYleng, 1, vhdlScanYYout )
1268 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1269 * is returned in "result".
1272 #define YY_INPUT(buf,result,max_size) \
1273 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1277 for ( n = 0; n < max_size && \
1278 (c = getc( vhdlScanYYin )) != EOF && c != '\n'; ++n ) \
1279 buf[n] = (char) c; \
1281 buf[n++] = (char) c; \
1282 if ( c == EOF && ferror( vhdlScanYYin ) ) \
1283 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1289 while ( (result = fread(buf, 1, max_size, vhdlScanYYin))==0 && ferror(vhdlScanYYin)) \
1291 if( errno != EINTR) \
1293 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1297 clearerr(vhdlScanYYin); \
1304 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1305 * we don't want an extra ';' after the "return" because that will cause
1306 * some compilers to complain about unreachable statements.
1309 #define yyterminate() return YY_NULL
1312 /* Number of entries by which start-condition stack grows. */
1313 #ifndef YY_START_STACK_INCR
1314 #define YY_START_STACK_INCR 25
1317 /* Report a fatal error. */
1318 #ifndef YY_FATAL_ERROR
1319 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1322 /* end tables serialization structures and prototypes */
1324 /* Default declaration of generated scanner - a define so the user can
1325 * easily add parameters.
1328 #define YY_DECL_IS_OURS 1
1330 extern int vhdlScanYYlex (void);
1332 #define YY_DECL int vhdlScanYYlex (void)
1333 #endif /* !YY_DECL */
1335 /* Code executed at the beginning of each rule, after vhdlScanYYtext and vhdlScanYYleng
1338 #ifndef YY_USER_ACTION
1339 #define YY_USER_ACTION
1342 /* Code executed at the end of each rule. */
1344 #define YY_BREAK break;
1347 #define YY_RULE_SETUP \
1348 if ( vhdlScanYYleng > 0 ) \
1349 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1350 (vhdlScanYYtext[vhdlScanYYleng - 1] == '\n'); \
1353 /** The main scanner function which does all the work.
1357 register yy_state_type yy_current_state;
1358 register char *yy_cp, *yy_bp;
1359 register int yy_act;
1361 #line 399 "vhdlscanner.l"
1364 #line 1365 "<stdout>"
1374 /* Create the reject buffer large enough to save one state per allowed character. */
1375 if ( ! (yy_state_buf) )
1376 (yy_state_buf) = (yy_state_type *)vhdlScanYYalloc(YY_STATE_BUF_SIZE );
1377 if ( ! (yy_state_buf) )
1378 YY_FATAL_ERROR( "out of dynamic memory in vhdlScanYYlex()" );
1381 (yy_start) = 1; /* first start state */
1383 if ( ! vhdlScanYYin )
1384 vhdlScanYYin = stdin;
1386 if ( ! vhdlScanYYout )
1387 vhdlScanYYout = stdout;
1389 if ( ! YY_CURRENT_BUFFER ) {
1390 vhdlScanYYensure_buffer_stack ();
1391 YY_CURRENT_BUFFER_LVALUE =
1392 vhdlScanYY_create_buffer(vhdlScanYYin,YY_BUF_SIZE );
1395 vhdlScanYY_load_buffer_state( );
1398 while ( 1 ) /* loops until end-of-file is reached */
1400 yy_cp = (yy_c_buf_p);
1402 /* Support of vhdlScanYYtext. */
1403 *yy_cp = (yy_hold_char);
1405 /* yy_bp points to the position in yy_ch_buf of the start of
1410 yy_current_state = (yy_start);
1411 yy_current_state += YY_AT_BOL();
1413 (yy_state_ptr) = (yy_state_buf);
1414 *(yy_state_ptr)++ = yy_current_state;
1419 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1420 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1422 yy_current_state = (int) yy_def[yy_current_state];
1423 if ( yy_current_state >= 222 )
1424 yy_c = yy_meta[(unsigned int) yy_c];
1426 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1427 *(yy_state_ptr)++ = yy_current_state;
1430 while ( yy_base[yy_current_state] != 938 );
1433 yy_current_state = *--(yy_state_ptr);
1434 (yy_lp) = yy_accept[yy_current_state];
1435 goto find_rule; /* Shut up GCC warning -Wall */
1436 find_rule: /* we branch to this label when backing up */
1437 for ( ; ; ) /* until we find what rule we matched */
1439 if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] )
1441 yy_act = yy_acclist[(yy_lp)];
1442 if ( yy_act & YY_TRAILING_HEAD_MASK ||
1443 (yy_looking_for_trail_begin) )
1445 if ( yy_act == (yy_looking_for_trail_begin) )
1447 (yy_looking_for_trail_begin) = 0;
1448 yy_act &= ~YY_TRAILING_HEAD_MASK;
1452 else if ( yy_act & YY_TRAILING_MASK )
1454 (yy_looking_for_trail_begin) = yy_act & ~YY_TRAILING_MASK;
1455 (yy_looking_for_trail_begin) |= YY_TRAILING_HEAD_MASK;
1456 (yy_full_match) = yy_cp;
1457 (yy_full_state) = (yy_state_ptr);
1458 (yy_full_lp) = (yy_lp);
1462 (yy_full_match) = yy_cp;
1463 (yy_full_state) = (yy_state_ptr);
1464 (yy_full_lp) = (yy_lp);
1471 yy_current_state = *--(yy_state_ptr);
1472 (yy_lp) = yy_accept[yy_current_state];
1475 YY_DO_BEFORE_ACTION;
1477 do_action: /* This label is used only to access EOF actions. */
1480 { /* beginning of action switch */
1483 #line 401 "vhdlscanner.l"
1488 #line 402 "vhdlscanner.l"
1489 { return(t_Ampersand); }
1493 #line 403 "vhdlscanner.l"
1494 { return(t_Apostrophe); }
1498 #line 404 "vhdlscanner.l"
1499 { return(t_LeftParen); }
1503 #line 405 "vhdlscanner.l"
1504 { return(t_RightParen); }
1508 #line 406 "vhdlscanner.l"
1509 { return(t_DoubleStar); }
1513 #line 407 "vhdlscanner.l"
1518 #line 408 "vhdlscanner.l"
1523 #line 409 "vhdlscanner.l"
1524 { return(t_Comma); }
1528 #line 410 "vhdlscanner.l"
1529 { return(t_Minus); }
1533 #line 411 "vhdlscanner.l"
1534 { return(t_VarAsgn); }
1538 #line 412 "vhdlscanner.l"
1539 { return(t_Colon); }
1543 #line 413 "vhdlscanner.l"
1544 { return(t_Semicolon); }
1548 #line 414 "vhdlscanner.l"
1549 { return(t_LESym); }
1553 #line 415 "vhdlscanner.l"
1554 { return(t_GESym); }
1558 #line 416 "vhdlscanner.l"
1559 { return(t_LTSym); }
1563 #line 417 "vhdlscanner.l"
1564 { return(t_GTSym); }
1568 #line 418 "vhdlscanner.l"
1569 { return(t_EQSym); }
1573 #line 419 "vhdlscanner.l"
1574 { return(t_NESym); }
1578 #line 420 "vhdlscanner.l"
1579 { return(t_Arrow); }
1583 #line 421 "vhdlscanner.l"
1588 #line 422 "vhdlscanner.l"
1593 #line 423 "vhdlscanner.l"
1598 #line 424 "vhdlscanner.l"
1603 #line 425 "vhdlscanner.l"
1608 #line 426 "vhdlscanner.l"
1613 #line 427 "vhdlscanner.l"
1618 #line 428 "vhdlscanner.l"
1623 #line 429 "vhdlscanner.l"
1628 #line 430 "vhdlscanner.l"
1629 { return(t_QNEQU); }
1633 #line 431 "vhdlscanner.l"
1638 #line 432 "vhdlscanner.l"
1643 #line 433 "vhdlscanner.l"
1648 #line 434 "vhdlscanner.l"
1649 { return(t_Slash); }
1653 #line 435 "vhdlscanner.l"
1658 #line 436 "vhdlscanner.l"
1663 #line 437 "vhdlscanner.l"
1664 { return(t_LEFTBR); }
1668 #line 438 "vhdlscanner.l"
1669 { return(t_RIGHTBR); }
1673 #line 441 "vhdlscanner.l"
1675 int itoken=find_keyword(vhdlScanYYtext);
1677 // fprintf(stderr,"\n <<<< search tok: %s %d %d>>>\n",vhdlScanYYtext,itoken,yyLineNr);
1679 // tokens in vhdlparser.hpp 258..412
1680 if (itoken>200 && itoken<500 && prevToken!=t_END)
1682 // printf("\n <<<< insert tok: %s %d %d>>>\n",vhdlScanYYtext,itoken,yyLineNr);
1683 lineIndex[itoken]=yyLineNr;
1687 if (( itoken==t_ARCHITECTURE ) ||
1688 ( itoken==t_ENTITY) ||
1689 ( itoken==t_PACKAGE ) ||
1690 ( itoken==t_LIBRARY ) ||
1691 ( itoken==t_USE ) ||
1692 ( itoken==t_CONFIGURATION ) ||
1693 ( itoken==t_CONTEXT ) )
1695 lineIndex[itoken]=yyLineNr;
1700 yycont->qstr=vhdlScanYYtext;
1701 yycont->yyLineNr=yyLineNr;
1704 yycont->iLine=yyLineNr;
1705 return ( t_LETTER );
1715 #line 480 "vhdlscanner.l"
1717 yycont->qstr=vhdlScanYYtext;
1718 return ( t_ABSTRLIST );
1723 #line 485 "vhdlscanner.l"
1725 QCString q(vhdlScanYYtext);
1726 yycont->qstr=vhdlScanYYtext;
1728 if (q=="'('") // std_logic'('1') ?
1730 char c=yy_hold_char;
1731 if (isalpha(c) || isdigit(c))
1735 return(t_Apostrophe);
1739 return ( t_CHARLIST );
1742 return ( t_CHARLIST );
1747 #line 506 "vhdlscanner.l"
1749 yycont->qstr=vhdlScanYYtext;
1750 yycont->iLine=yyLineNr;
1751 return ( t_STRING );
1756 #line 512 "vhdlscanner.l"
1758 yycont->qstr=vhdlScanYYtext;
1759 yycont->iLine=yyLineNr;
1765 #line 518 "vhdlscanner.l"
1767 yycont->qstr=vhdlScanYYtext;
1768 yycont->iLine=yyLineNr;
1773 /* rule 45 can match eol */
1775 #line 524 "vhdlscanner.l"
1778 yycont->yyLineNr=yyLineNr;
1783 #line 529 "vhdlscanner.l"
1786 QCString qcs(vhdlScanYYtext);
1788 if (qcs.stripPrefix("--!"))
1796 #line 538 "vhdlscanner.l"
1797 { /* unknown characters */ }
1800 /* rule 48 can match eol */
1802 #line 541 "vhdlscanner.l"
1803 { // multi line comment
1804 if (iDocLine==-1) iDocLine=yyLineNr;
1805 QCString qc(vhdlScanYYtext);
1806 int len=qc.contains('\n')+yyLineNr-1;
1807 if (YY_START!=Comment) // Start of the comment block
1809 startComment=yyLineNr;
1810 g_lastCommentContext=YY_START;
1813 if(!checkMultiComment(qc,len))
1815 strComment+=vhdlScanYYtext;
1823 #line 559 "vhdlscanner.l"
1825 if (iDocLine==-1) iDocLine=yyLineNr;
1826 strComment+=vhdlScanYYtext;
1827 int index=strComment.find("\\code");
1830 startCodeBlock(index);
1838 /* rule 50 can match eol */
1840 #line 572 "vhdlscanner.l"
1842 // found end of comment block
1844 int index =strComment.find("\\code");
1847 startCodeBlock(index);
1850 VhdlDocGen::prepareComment(strComment);
1853 if (index==-1 && !doxComment)
1855 handleCommentBlock(strComment,FALSE);
1857 strComment.resize(0);;
1858 unput(*vhdlScanYYtext);
1860 BEGIN(g_lastCommentContext);
1865 #line 594 "vhdlscanner.l"
1866 { // one line comment
1867 if (iDocLine==-1) iDocLine=yyLineNr;
1868 QCString qcs(vhdlScanYYtext);
1870 bool isEndCode=qcs.contains("\\endcode");
1872 int index = qcs.find("\\code");
1875 int end=inputVhdlString.find(qcs.data(),iCodeLen);
1878 else if (index > 0 )
1882 startCodeBlock(index);
1883 strComment.resize(0);
1886 //printf("--> handleCommentBlock line %d\n",yyLineNr);
1887 if (!isEndCode && index==-1)
1889 int j=qcs.find("--!");
1890 qcs=qcs.right(qcs.length()-3-j);
1892 if(!checkMultiComment(qcs,yyLineNr))
1894 handleCommentBlock(qcs,TRUE);
1901 #line 627 "vhdlscanner.l"
1903 strComment+=vhdlScanYYtext;
1904 if (yy_hold_char=='!') // found comment starting with "/*!"
1908 BEGIN(Vhdl2008Comment);
1912 /* rule 53 can match eol */
1914 #line 636 "vhdlscanner.l"
1916 QCString tt(vhdlScanYYtext);
1917 int len=tt.length();
1918 yyLineNr+=tt.contains('\n');
1920 // delete * from comments
1925 if (vhdlScanYYtext[len-1]=='*' && tt.contains('\n'))
1928 VhdlDocGen::deleteAllChars(ss,' ');
1929 VhdlDocGen::deleteAllChars(ss,'\t');
1930 if (ss.data() && ss.at(ss.length()-2)=='\n')
1937 // fprintf(stderr,"\n << %s >>",tt.data());
1939 char c=yy_hold_char;
1943 BEGIN(EndVhdl2008Comment);
1947 BEGIN(Vhdl2008Comment);
1953 #line 672 "vhdlscanner.l"
1957 strComment.stripPrefix("/*!");
1958 strComment= strComment.left( strComment.length()-1);
1959 handleCommentBlock( strComment,TRUE);
1962 strComment.resize(0);
1968 #line 685 "vhdlscanner.l"
1971 #line 1972 "<stdout>"
1972 case YY_STATE_EOF(INITIAL):
1973 case YY_STATE_EOF(Comment):
1974 case YY_STATE_EOF(Vhdl2008Comment):
1975 case YY_STATE_EOF(EndVhdl2008Comment):
1978 case YY_END_OF_BUFFER:
1980 /* Amount of text matched not including the EOB char. */
1981 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1983 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1984 *yy_cp = (yy_hold_char);
1985 YY_RESTORE_YY_MORE_OFFSET
1987 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1989 /* We're scanning a new file or input source. It's
1990 * possible that this happened because the user
1991 * just pointed vhdlScanYYin at a new source and called
1992 * vhdlScanYYlex(). If so, then we have to assure
1993 * consistency between YY_CURRENT_BUFFER and our
1994 * globals. Here is the right place to do so, because
1995 * this is the first action (other than possibly a
1996 * back-up) that will match for the new input source.
1998 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1999 YY_CURRENT_BUFFER_LVALUE->yy_input_file = vhdlScanYYin;
2000 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2003 /* Note that here we test for yy_c_buf_p "<=" to the position
2004 * of the first EOB in the buffer, since yy_c_buf_p will
2005 * already have been incremented past the NUL character
2006 * (since all states make transitions on EOB to the
2007 * end-of-buffer state). Contrast this with the test
2010 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2011 { /* This was really a NUL. */
2012 yy_state_type yy_next_state;
2014 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
2016 yy_current_state = yy_get_previous_state( );
2018 /* Okay, we're now positioned to make the NUL
2019 * transition. We couldn't have
2020 * yy_get_previous_state() go ahead and do it
2021 * for us because it doesn't know how to deal
2022 * with the possibility of jamming (and we don't
2023 * want to build jamming into it because then it
2024 * will run more slowly).
2027 yy_next_state = yy_try_NUL_trans( yy_current_state );
2029 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2031 if ( yy_next_state )
2033 /* Consume the NUL. */
2034 yy_cp = ++(yy_c_buf_p);
2035 yy_current_state = yy_next_state;
2041 yy_cp = (yy_c_buf_p);
2042 goto yy_find_action;
2046 else switch ( yy_get_next_buffer( ) )
2048 case EOB_ACT_END_OF_FILE:
2050 (yy_did_buffer_switch_on_eof) = 0;
2052 if ( vhdlScanYYwrap( ) )
2054 /* Note: because we've taken care in
2055 * yy_get_next_buffer() to have set up
2056 * vhdlScanYYtext, we can now set up
2057 * yy_c_buf_p so that if some total
2058 * hoser (like flex itself) wants to
2059 * call the scanner after we return the
2060 * YY_NULL, it'll still work - another
2061 * YY_NULL will get returned.
2063 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
2065 yy_act = YY_STATE_EOF(YY_START);
2071 if ( ! (yy_did_buffer_switch_on_eof) )
2077 case EOB_ACT_CONTINUE_SCAN:
2079 (yytext_ptr) + yy_amount_of_matched_text;
2081 yy_current_state = yy_get_previous_state( );
2083 yy_cp = (yy_c_buf_p);
2084 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2087 case EOB_ACT_LAST_MATCH:
2089 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
2091 yy_current_state = yy_get_previous_state( );
2093 yy_cp = (yy_c_buf_p);
2094 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2095 goto yy_find_action;
2102 "fatal flex scanner internal error--no action found" );
2103 } /* end of action switch */
2104 } /* end of scanning one token */
2105 } /* end of vhdlScanYYlex */
2107 /* yy_get_next_buffer - try to read in a new buffer
2109 * Returns a code representing an action:
2110 * EOB_ACT_LAST_MATCH -
2111 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2112 * EOB_ACT_END_OF_FILE - end of file
2114 static int yy_get_next_buffer (void)
2116 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2117 register char *source = (yytext_ptr);
2118 register int number_to_move, i;
2121 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
2123 "fatal flex scanner internal error--end of buffer missed" );
2125 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2126 { /* Don't try to fill the buffer, so this is an EOF. */
2127 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
2129 /* We matched a single character, the EOB, so
2130 * treat this as a final EOF.
2132 return EOB_ACT_END_OF_FILE;
2137 /* We matched some text prior to the EOB, first
2140 return EOB_ACT_LAST_MATCH;
2144 /* Try to read more data. */
2146 /* First move last chars to start of buffer. */
2147 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
2149 for ( i = 0; i < number_to_move; ++i )
2150 *(dest++) = *(source++);
2152 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2153 /* don't do the read, it's not guaranteed to return an EOF,
2156 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
2160 yy_size_t num_to_read =
2161 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2163 while ( num_to_read <= 0 )
2164 { /* Not enough room in the buffer - grow it. */
2167 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
2171 if ( num_to_read > YY_READ_BUF_SIZE )
2172 num_to_read = YY_READ_BUF_SIZE;
2174 /* Read in more data. */
2175 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2176 (yy_n_chars), num_to_read );
2178 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2181 if ( (yy_n_chars) == 0 )
2183 if ( number_to_move == YY_MORE_ADJ )
2185 ret_val = EOB_ACT_END_OF_FILE;
2186 vhdlScanYYrestart(vhdlScanYYin );
2191 ret_val = EOB_ACT_LAST_MATCH;
2192 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2193 YY_BUFFER_EOF_PENDING;
2198 ret_val = EOB_ACT_CONTINUE_SCAN;
2200 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2201 /* Extend the array by 50%, plus the number we really need. */
2202 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
2203 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) vhdlScanYYrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
2204 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2205 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2208 (yy_n_chars) += number_to_move;
2209 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
2210 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
2212 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2217 /* yy_get_previous_state - get the state just before the EOB char was reached */
2219 static yy_state_type yy_get_previous_state (void)
2221 register yy_state_type yy_current_state;
2222 register char *yy_cp;
2224 yy_current_state = (yy_start);
2225 yy_current_state += YY_AT_BOL();
2227 (yy_state_ptr) = (yy_state_buf);
2228 *(yy_state_ptr)++ = yy_current_state;
2230 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
2232 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2233 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2235 yy_current_state = (int) yy_def[yy_current_state];
2236 if ( yy_current_state >= 222 )
2237 yy_c = yy_meta[(unsigned int) yy_c];
2239 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2240 *(yy_state_ptr)++ = yy_current_state;
2243 return yy_current_state;
2246 /* yy_try_NUL_trans - try to make a transition on the NUL character
2249 * next_state = yy_try_NUL_trans( current_state );
2251 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
2253 register int yy_is_jam;
2255 register YY_CHAR yy_c = 1;
2256 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2258 yy_current_state = (int) yy_def[yy_current_state];
2259 if ( yy_current_state >= 222 )
2260 yy_c = yy_meta[(unsigned int) yy_c];
2262 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2263 yy_is_jam = (yy_current_state == 221);
2265 *(yy_state_ptr)++ = yy_current_state;
2267 return yy_is_jam ? 0 : yy_current_state;
2270 static void yyunput (int c, register char * yy_bp )
2272 register char *yy_cp;
2274 yy_cp = (yy_c_buf_p);
2276 /* undo effects of setting up vhdlScanYYtext */
2277 *yy_cp = (yy_hold_char);
2279 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2280 { /* need to shift things up to make room */
2281 /* +2 for EOB chars. */
2282 register yy_size_t number_to_move = (yy_n_chars) + 2;
2283 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
2284 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
2285 register char *source =
2286 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
2288 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2289 *--dest = *--source;
2291 yy_cp += (int) (dest - source);
2292 yy_bp += (int) (dest - source);
2293 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
2294 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
2296 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2297 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2300 *--yy_cp = (char) c;
2302 (yytext_ptr) = yy_bp;
2303 (yy_hold_char) = *yy_cp;
2304 (yy_c_buf_p) = yy_cp;
2309 static int yyinput (void)
2311 static int input (void)
2317 *(yy_c_buf_p) = (yy_hold_char);
2319 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
2321 /* yy_c_buf_p now points to the character we want to return.
2322 * If this occurs *before* the EOB characters, then it's a
2323 * valid NUL; if not, then we've hit the end of the buffer.
2325 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2326 /* This was really a NUL. */
2327 *(yy_c_buf_p) = '\0';
2330 { /* need more input */
2331 yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
2334 switch ( yy_get_next_buffer( ) )
2336 case EOB_ACT_LAST_MATCH:
2337 /* This happens because yy_g_n_b()
2338 * sees that we've accumulated a
2339 * token and flags that we need to
2340 * try matching the token before
2341 * proceeding. But for input(),
2342 * there's no matching to consider.
2343 * So convert the EOB_ACT_LAST_MATCH
2344 * to EOB_ACT_END_OF_FILE.
2347 /* Reset buffer status. */
2348 vhdlScanYYrestart(vhdlScanYYin );
2352 case EOB_ACT_END_OF_FILE:
2354 if ( vhdlScanYYwrap( ) )
2357 if ( ! (yy_did_buffer_switch_on_eof) )
2366 case EOB_ACT_CONTINUE_SCAN:
2367 (yy_c_buf_p) = (yytext_ptr) + offset;
2373 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
2374 *(yy_c_buf_p) = '\0'; /* preserve vhdlScanYYtext */
2375 (yy_hold_char) = *++(yy_c_buf_p);
2377 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
2381 #endif /* ifndef YY_NO_INPUT */
2383 /** Immediately switch to a different input stream.
2384 * @param input_file A readable stream.
2386 * @note This function does not reset the start condition to @c INITIAL .
2388 void vhdlScanYYrestart (FILE * input_file )
2391 if ( ! YY_CURRENT_BUFFER ){
2392 vhdlScanYYensure_buffer_stack ();
2393 YY_CURRENT_BUFFER_LVALUE =
2394 vhdlScanYY_create_buffer(vhdlScanYYin,YY_BUF_SIZE );
2397 vhdlScanYY_init_buffer(YY_CURRENT_BUFFER,input_file );
2398 vhdlScanYY_load_buffer_state( );
2401 /** Switch to a different input buffer.
2402 * @param new_buffer The new input buffer.
2405 void vhdlScanYY_switch_to_buffer (YY_BUFFER_STATE new_buffer )
2408 /* TODO. We should be able to replace this entire function body
2410 * vhdlScanYYpop_buffer_state();
2411 * vhdlScanYYpush_buffer_state(new_buffer);
2413 vhdlScanYYensure_buffer_stack ();
2414 if ( YY_CURRENT_BUFFER == new_buffer )
2417 if ( YY_CURRENT_BUFFER )
2419 /* Flush out information for old buffer. */
2420 *(yy_c_buf_p) = (yy_hold_char);
2421 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2422 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2425 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2426 vhdlScanYY_load_buffer_state( );
2428 /* We don't actually know whether we did this switch during
2429 * EOF (vhdlScanYYwrap()) processing, but the only time this flag
2430 * is looked at is after vhdlScanYYwrap() is called, so it's safe
2431 * to go ahead and always set it.
2433 (yy_did_buffer_switch_on_eof) = 1;
2436 static void vhdlScanYY_load_buffer_state (void)
2438 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2439 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2440 vhdlScanYYin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2441 (yy_hold_char) = *(yy_c_buf_p);
2444 /** Allocate and initialize an input buffer state.
2445 * @param file A readable stream.
2446 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2448 * @return the allocated buffer state.
2450 YY_BUFFER_STATE vhdlScanYY_create_buffer (FILE * file, int size )
2454 b = (YY_BUFFER_STATE) vhdlScanYYalloc(sizeof( struct yy_buffer_state ) );
2456 YY_FATAL_ERROR( "out of dynamic memory in vhdlScanYY_create_buffer()" );
2458 b->yy_buf_size = size;
2460 /* yy_ch_buf has to be 2 characters longer than the size given because
2461 * we need to put in 2 end-of-buffer characters.
2463 b->yy_ch_buf = (char *) vhdlScanYYalloc(b->yy_buf_size + 2 );
2464 if ( ! b->yy_ch_buf )
2465 YY_FATAL_ERROR( "out of dynamic memory in vhdlScanYY_create_buffer()" );
2467 b->yy_is_our_buffer = 1;
2469 vhdlScanYY_init_buffer(b,file );
2474 /** Destroy the buffer.
2475 * @param b a buffer created with vhdlScanYY_create_buffer()
2478 void vhdlScanYY_delete_buffer (YY_BUFFER_STATE b )
2484 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2485 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2487 if ( b->yy_is_our_buffer )
2488 vhdlScanYYfree((void *) b->yy_ch_buf );
2490 vhdlScanYYfree((void *) b );
2494 extern int isatty (int );
2495 #endif /* __cplusplus */
2497 /* Initializes or reinitializes a buffer.
2498 * This function is sometimes called more than once on the same buffer,
2499 * such as during a vhdlScanYYrestart() or at EOF.
2501 static void vhdlScanYY_init_buffer (YY_BUFFER_STATE b, FILE * file )
2506 vhdlScanYY_flush_buffer(b );
2508 b->yy_input_file = file;
2509 b->yy_fill_buffer = 1;
2511 /* If b is the current buffer, then vhdlScanYY_init_buffer was _probably_
2512 * called from vhdlScanYYrestart() or through yy_get_next_buffer.
2513 * In that case, we don't want to reset the lineno or column.
2515 if (b != YY_CURRENT_BUFFER){
2516 b->yy_bs_lineno = 1;
2517 b->yy_bs_column = 0;
2520 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2525 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2526 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2529 void vhdlScanYY_flush_buffer (YY_BUFFER_STATE b )
2536 /* We always need two end-of-buffer characters. The first causes
2537 * a transition to the end-of-buffer state. The second causes
2538 * a jam in that state.
2540 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2541 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2543 b->yy_buf_pos = &b->yy_ch_buf[0];
2546 b->yy_buffer_status = YY_BUFFER_NEW;
2548 if ( b == YY_CURRENT_BUFFER )
2549 vhdlScanYY_load_buffer_state( );
2552 /** Pushes the new state onto the stack. The new state becomes
2553 * the current state. This function will allocate the stack
2555 * @param new_buffer The new state.
2558 void vhdlScanYYpush_buffer_state (YY_BUFFER_STATE new_buffer )
2560 if (new_buffer == NULL)
2563 vhdlScanYYensure_buffer_stack();
2565 /* This block is copied from vhdlScanYY_switch_to_buffer. */
2566 if ( YY_CURRENT_BUFFER )
2568 /* Flush out information for old buffer. */
2569 *(yy_c_buf_p) = (yy_hold_char);
2570 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2571 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2574 /* Only push if top exists. Otherwise, replace top. */
2575 if (YY_CURRENT_BUFFER)
2576 (yy_buffer_stack_top)++;
2577 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2579 /* copied from vhdlScanYY_switch_to_buffer. */
2580 vhdlScanYY_load_buffer_state( );
2581 (yy_did_buffer_switch_on_eof) = 1;
2584 /** Removes and deletes the top of the stack, if present.
2585 * The next element becomes the new top.
2588 void vhdlScanYYpop_buffer_state (void)
2590 if (!YY_CURRENT_BUFFER)
2593 vhdlScanYY_delete_buffer(YY_CURRENT_BUFFER );
2594 YY_CURRENT_BUFFER_LVALUE = NULL;
2595 if ((yy_buffer_stack_top) > 0)
2596 --(yy_buffer_stack_top);
2598 if (YY_CURRENT_BUFFER) {
2599 vhdlScanYY_load_buffer_state( );
2600 (yy_did_buffer_switch_on_eof) = 1;
2604 /* Allocates the stack if it does not exist.
2605 * Guarantees space for at least one push.
2607 static void vhdlScanYYensure_buffer_stack (void)
2609 yy_size_t num_to_alloc;
2611 if (!(yy_buffer_stack)) {
2613 /* First allocation is just for 2 elements, since we don't know if this
2614 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2615 * immediate realloc on the next call.
2618 (yy_buffer_stack) = (struct yy_buffer_state**)vhdlScanYYalloc
2619 (num_to_alloc * sizeof(struct yy_buffer_state*)
2621 if ( ! (yy_buffer_stack) )
2622 YY_FATAL_ERROR( "out of dynamic memory in vhdlScanYYensure_buffer_stack()" );
2624 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2626 (yy_buffer_stack_max) = num_to_alloc;
2627 (yy_buffer_stack_top) = 0;
2631 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2633 /* Increase the buffer to prepare for a possible push. */
2634 int grow_size = 8 /* arbitrary grow size */;
2636 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2637 (yy_buffer_stack) = (struct yy_buffer_state**)vhdlScanYYrealloc
2639 num_to_alloc * sizeof(struct yy_buffer_state*)
2641 if ( ! (yy_buffer_stack) )
2642 YY_FATAL_ERROR( "out of dynamic memory in vhdlScanYYensure_buffer_stack()" );
2644 /* zero only the new slots.*/
2645 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2646 (yy_buffer_stack_max) = num_to_alloc;
2650 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2651 * @param base the character buffer
2652 * @param size the size in bytes of the character buffer
2654 * @return the newly allocated buffer state object.
2656 YY_BUFFER_STATE vhdlScanYY_scan_buffer (char * base, yy_size_t size )
2661 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2662 base[size-1] != YY_END_OF_BUFFER_CHAR )
2663 /* They forgot to leave room for the EOB's. */
2666 b = (YY_BUFFER_STATE) vhdlScanYYalloc(sizeof( struct yy_buffer_state ) );
2668 YY_FATAL_ERROR( "out of dynamic memory in vhdlScanYY_scan_buffer()" );
2670 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2671 b->yy_buf_pos = b->yy_ch_buf = base;
2672 b->yy_is_our_buffer = 0;
2673 b->yy_input_file = 0;
2674 b->yy_n_chars = b->yy_buf_size;
2675 b->yy_is_interactive = 0;
2677 b->yy_fill_buffer = 0;
2678 b->yy_buffer_status = YY_BUFFER_NEW;
2680 vhdlScanYY_switch_to_buffer(b );
2685 /** Setup the input buffer state to scan a string. The next call to vhdlScanYYlex() will
2686 * scan from a @e copy of @a str.
2687 * @param yystr a NUL-terminated string to scan
2689 * @return the newly allocated buffer state object.
2690 * @note If you want to scan bytes that may contain NUL values, then use
2691 * vhdlScanYY_scan_bytes() instead.
2693 YY_BUFFER_STATE vhdlScanYY_scan_string (yyconst char * yystr )
2696 return vhdlScanYY_scan_bytes(yystr,strlen(yystr) );
2699 /** Setup the input buffer state to scan the given bytes. The next call to vhdlScanYYlex() will
2700 * scan from a @e copy of @a bytes.
2701 * @param bytes the byte buffer to scan
2702 * @param len the number of bytes in the buffer pointed to by @a bytes.
2704 * @return the newly allocated buffer state object.
2706 YY_BUFFER_STATE vhdlScanYY_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
2712 /* Get memory for full buffer, including space for trailing EOB's. */
2713 n = _yybytes_len + 2;
2714 buf = (char *) vhdlScanYYalloc(n );
2716 YY_FATAL_ERROR( "out of dynamic memory in vhdlScanYY_scan_bytes()" );
2718 for ( i = 0; i < _yybytes_len; ++i )
2719 buf[i] = yybytes[i];
2721 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2723 b = vhdlScanYY_scan_buffer(buf,n );
2725 YY_FATAL_ERROR( "bad buffer in vhdlScanYY_scan_bytes()" );
2727 /* It's okay to grow etc. this buffer, and we should throw it
2728 * away when we're done.
2730 b->yy_is_our_buffer = 1;
2735 #ifndef YY_EXIT_FAILURE
2736 #define YY_EXIT_FAILURE 2
2739 static void yy_fatal_error (yyconst char* msg )
2741 (void) fprintf( stderr, "%s\n", msg );
2742 exit( YY_EXIT_FAILURE );
2745 /* Redefine yyless() so it works in section 3 code. */
2751 /* Undo effects of setting up vhdlScanYYtext. */ \
2752 int yyless_macro_arg = (n); \
2753 YY_LESS_LINENO(yyless_macro_arg);\
2754 vhdlScanYYtext[vhdlScanYYleng] = (yy_hold_char); \
2755 (yy_c_buf_p) = vhdlScanYYtext + yyless_macro_arg; \
2756 (yy_hold_char) = *(yy_c_buf_p); \
2757 *(yy_c_buf_p) = '\0'; \
2758 vhdlScanYYleng = yyless_macro_arg; \
2762 /* Accessor methods (get/set functions) to struct members. */
2764 /** Get the current line number.
2767 int vhdlScanYYget_lineno (void)
2770 return vhdlScanYYlineno;
2773 /** Get the input stream.
2776 FILE *vhdlScanYYget_in (void)
2778 return vhdlScanYYin;
2781 /** Get the output stream.
2784 FILE *vhdlScanYYget_out (void)
2786 return vhdlScanYYout;
2789 /** Get the length of the current token.
2792 yy_size_t vhdlScanYYget_leng (void)
2794 return vhdlScanYYleng;
2797 /** Get the current token.
2801 char *vhdlScanYYget_text (void)
2803 return vhdlScanYYtext;
2806 /** Set the current line number.
2807 * @param line_number
2810 void vhdlScanYYset_lineno (int line_number )
2813 vhdlScanYYlineno = line_number;
2816 /** Set the input stream. This does not discard the current
2818 * @param in_str A readable stream.
2820 * @see vhdlScanYY_switch_to_buffer
2822 void vhdlScanYYset_in (FILE * in_str )
2824 vhdlScanYYin = in_str ;
2827 void vhdlScanYYset_out (FILE * out_str )
2829 vhdlScanYYout = out_str ;
2832 int vhdlScanYYget_debug (void)
2834 return vhdlScanYY_flex_debug;
2837 void vhdlScanYYset_debug (int bdebug )
2839 vhdlScanYY_flex_debug = bdebug ;
2842 static int yy_init_globals (void)
2844 /* Initialization is the same as for the non-reentrant scanner.
2845 * This function is called from vhdlScanYYlex_destroy(), so don't allocate here.
2848 (yy_buffer_stack) = 0;
2849 (yy_buffer_stack_top) = 0;
2850 (yy_buffer_stack_max) = 0;
2851 (yy_c_buf_p) = (char *) 0;
2857 (yy_full_match) = 0;
2860 /* Defined in main.c */
2862 vhdlScanYYin = stdin;
2863 vhdlScanYYout = stdout;
2865 vhdlScanYYin = (FILE *) 0;
2866 vhdlScanYYout = (FILE *) 0;
2869 /* For future reference: Set errno on error, since we are called by
2870 * vhdlScanYYlex_init()
2875 /* vhdlScanYYlex_destroy is for both reentrant and non-reentrant scanners. */
2876 int vhdlScanYYlex_destroy (void)
2879 /* Pop the buffer stack, destroying each element. */
2880 while(YY_CURRENT_BUFFER){
2881 vhdlScanYY_delete_buffer(YY_CURRENT_BUFFER );
2882 YY_CURRENT_BUFFER_LVALUE = NULL;
2883 vhdlScanYYpop_buffer_state();
2886 /* Destroy the stack itself. */
2887 vhdlScanYYfree((yy_buffer_stack) );
2888 (yy_buffer_stack) = NULL;
2890 vhdlScanYYfree ( (yy_state_buf) );
2891 (yy_state_buf) = NULL;
2893 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2894 * vhdlScanYYlex() is called, initialization will occur. */
2901 * Internal utility routines.
2905 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2908 for ( i = 0; i < n; ++i )
2913 #ifdef YY_NEED_STRLEN
2914 static int yy_flex_strlen (yyconst char * s )
2917 for ( n = 0; s[n]; ++n )
2924 void *vhdlScanYYalloc (yy_size_t size )
2926 return (void *) malloc( size );
2929 void *vhdlScanYYrealloc (void * ptr, yy_size_t size )
2931 /* The cast to (char *) in the following accommodates both
2932 * implementations that use char* generic pointers, and those
2933 * that use void* generic pointers. It works with the latter
2934 * because both ANSI C and C++ allow castless assignment from
2935 * any pointer type to void*, and deal with argument conversions
2936 * as though doing an assignment.
2938 return (void *) realloc( (char *) ptr, size );
2941 void vhdlScanYYfree (void * ptr )
2943 free( (char *) ptr ); /* see vhdlScanYYrealloc() for (char *) cast */
2946 #define YYTABLES_NAME "yytables"
2948 #line 685 "vhdlscanner.l"
2952 static void parserInit()
2955 lineIndex=(int*)malloc(500*sizeof(int));
2962 while ((oop=tab_mc[p++]).kval!=-1)
2964 QCString q(&oop.nom[0]);
2965 keyMap.insert(q,oop.kval);
2970 void vhdlscanFreeScanner()
2972 #if defined(YY_FLEX_SUBMINOR_VERSION)
2975 vhdlScanYYlex_destroy();
2980 void VHDLLanguageScanner::resetCodeParserState()
2984 bool VHDLLanguageScanner::needsPreprocessing(const QCString & /*extension*/)
2989 void VHDLLanguageScanner::parsePrototype(const char *text)
2996 //int VhdlParser::doLex()
2998 // int token=vhdlScanYYlex();
2999 // //fprintf(stderr,"\ntoken: %d at line: %d",token,yyLineNr);
3003 void VHDLLanguageScanner::parseInput(const char *fileName,const char *fileBuf,Entry *root)
3005 yyFileName=QCString(fileName);
3007 bool xilinx_ucf=isConstraintFile(yyFileName,".ucf");
3008 bool altera_qsf=isConstraintFile(yyFileName,".qsf");
3010 // support XILINX(ucf) and ALTERA (qsf) file
3014 VhdlDocGen::parseUCF(fileBuf,root,yyFileName,FALSE);
3019 VhdlDocGen::parseUCF(fileBuf,root,yyFileName,TRUE);
3024 yycont=getVhdlCont();
3026 yycont->fileName=fileName;
3028 QCString pPuffer(" ");
3031 inputFile.setName(fileName);
3034 vhdlScanYYrestart( vhdlScanYYin );
3039 inputVhdlString=fileBuf;
3042 groupEnterFile(fileName,yyLineNr);
3044 Entry* curr=getCurrentVhdlEntry(); // delete last current
3049 mapLibPackage(root);
3052 void VHDLLanguageScanner::parseCode(CodeOutputInterface &codeOutIntf,
3053 const char *scopeName,
3054 const QCString &input,
3055 bool isExampleBlock,
3056 const char *exampleName,
3060 bool inlineFragment,
3061 MemberDef *memberDef,
3062 bool showLineNumbers,
3063 Definition *searchCtx
3066 ::parseVhdlCode(codeOutIntf,scopeName,input,isExampleBlock,exampleName,
3067 fileDef,startLine,endLine,inlineFragment,memberDef,
3068 showLineNumbers,searchCtx);
3072 * adds the library|use statements to the next class (entity|package|architecture|package body
3082 static void mapLibPackage(const Entry* ce)
3089 //const QList<Entry> *epp=ce->children();
3090 EntryListIterator eli(*ce->children());
3091 EntryListIterator eli1=eli;
3092 for (;(rt=eli.current()),eli1=eli;++eli)
3094 if (rt->spec==VhdlDocGen::LIBRARY || rt->spec==VhdlDocGen::USE)
3095 // top level library or use statement
3098 if(!addLibUseClause(rt->name))
3105 for (;(temp=eli1.current());++eli1) // find next entity
3107 if (temp->spec==VhdlDocGen::ENTITY ||
3108 temp->spec==VhdlDocGen::PACKAGE ||
3109 temp->spec==VhdlDocGen::ARCHITECTURE ||
3110 temp->spec==VhdlDocGen::PACKAGE_BODY)
3112 Entry *ee=new Entry(*rt); //append a copy to entries sublist
3113 temp->addSubEntry(ee);
3115 rt->spec=-1; //nullify entry
3121 if (lastComp && rt->spec!=-1)
3123 Entry *ee=new Entry(*rt); //append a copy to entries sublist
3124 lastComp->addSubEntry(ee);
3126 rt->spec=-1; //nullify entry
3131 if (!found) // nothing left to do
3138 static bool addLibUseClause(const QCString &type)
3140 static bool show=Config_getBool("SHOW_INCLUDE_FILES");
3141 static bool showIEEESTD=Config_getBool("FORCE_LOCAL_INCLUDES");
3143 if (!show) // all libraries and included packages will not be shown
3148 if (!showIEEESTD) // all standard packages and libraries will not be shown
3150 if (type.lower().stripPrefix("ieee")) return FALSE;
3151 if (type.lower().stripPrefix("std")) return FALSE;
3156 static void handleCommentBlock(const QCString &doc,bool brief)
3160 // empty comment --!
3161 if (doc.isEmpty()) return;
3163 bool needsEntry=FALSE;
3164 Protection protection=Public;
3165 int lineNr = iDocLine;
3167 Entry* current=getCurrentVhdlEntry();
3169 if (oldEntry==current)
3171 //printf("\n find pending message < %s > at line: %d \n ",doc.data(),iDocLine);
3173 str_doc.iDocLine=iDocLine;
3174 str_doc.brief=brief;
3175 str_doc.pending=TRUE;
3183 current->briefLine = iDocLine;
3187 current->docLine = iDocLine;
3190 // printf("parseCommentBlock file<%s>\n [%s]\n",yyFileName.data(),doc.data());
3191 while (parseCommentBlock(
3196 lineNr, // line of block start
3206 //printf("parseCommentBlock position=%d [%s]\n",position,doc.data()+position);
3207 if (needsEntry) newVhdlEntry();
3214 current->name=varName;
3215 current->section=Entry::VARIABLEDOC_SEC;
3217 strComment.resize(0);
3223 strComment.resize(0);
3226 // returns the vhdl parsed types at line xxx
3227 QList<Entry>* getEntryAtLine(const Entry* ce,int line)
3229 EntryListIterator eli(*ce->children());
3231 for (;(rt=eli.current());++eli)
3233 if (rt->bodyLine==line)
3235 lineEntry.insert(0,rt);
3238 getEntryAtLine(rt,line);
3243 // token index in vhdlparser.hpp 258..416
3244 int getParsedLine(int object)
3246 //assert(object>254 && object <416);
3247 return lineIndex [object];
3250 void isVhdlDocPending()
3252 if (!str_doc.pending)
3254 str_doc.pending=FALSE;
3255 oldEntry=0; // prevents endless recursion
3256 iDocLine=str_doc.iDocLine;
3257 handleCommentBlock(str_doc.doc,str_doc.brief);
3261 static bool checkMultiComment(QCString& qcs,int line)
3263 QList<Entry> *pTemp=getEntryAtLine(current_root,line);
3265 if (pTemp->isEmpty()) return false;
3267 //int ii=pTemp->count();
3268 qcs.stripPrefix("--!");
3269 while (!pTemp->isEmpty())
3271 Entry *e=(Entry*)pTemp->first();
3275 pTemp->removeFirst();
3276 //ii=pTemp->count();