
#line 3 "<stdout>"

#define  YY_INT_ALIGNED short int

/* A lexical scanner generated by flex */

#define yy_create_buffer vhdlScanYY_create_buffer
#define yy_delete_buffer vhdlScanYY_delete_buffer
#define yy_flex_debug vhdlScanYY_flex_debug
#define yy_init_buffer vhdlScanYY_init_buffer
#define yy_flush_buffer vhdlScanYY_flush_buffer
#define yy_load_buffer_state vhdlScanYY_load_buffer_state
#define yy_switch_to_buffer vhdlScanYY_switch_to_buffer
#define yyin vhdlScanYYin
#define yyleng vhdlScanYYleng
#define yylex vhdlScanYYlex
#define yylineno vhdlScanYYlineno
#define yyout vhdlScanYYout
#define yyrestart vhdlScanYYrestart
#define yytext vhdlScanYYtext
#define yywrap vhdlScanYYwrap
#define yyalloc vhdlScanYYalloc
#define yyrealloc vhdlScanYYrealloc
#define yyfree vhdlScanYYfree

#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 35
#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 <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>

/* end standard C headers. */

/* flex integer type definitions */

#ifndef FLEXINT_H
#define FLEXINT_H

/* C99 systems have <inttypes.h>. 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 <inttypes.h>
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;
#endif /* ! C99 */

/* 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 /* ! 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 vhdlScanYYrestart(vhdlScanYYin  )

#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 vhdlScanYYleng;

extern FILE *vhdlScanYYin, *vhdlScanYYout;

#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 vhdlScanYYtext. */ \
        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 vhdlScanYYtext 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 vhdlScanYYrestart()), so that the user can continue scanning by
	 * just pointing vhdlScanYYin 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 vhdlScanYYtext 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 vhdlScanYYleng;

/* 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 vhdlScanYYwrap()'s to do buffer switches
 * instead of setting up a fresh vhdlScanYYin.  A bit of a hack ...
 */
static int yy_did_buffer_switch_on_eof;

void vhdlScanYYrestart (FILE *input_file  );
void vhdlScanYY_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
YY_BUFFER_STATE vhdlScanYY_create_buffer (FILE *file,int size  );
void vhdlScanYY_delete_buffer (YY_BUFFER_STATE b  );
void vhdlScanYY_flush_buffer (YY_BUFFER_STATE b  );
void vhdlScanYYpush_buffer_state (YY_BUFFER_STATE new_buffer  );
void vhdlScanYYpop_buffer_state (void );

static void vhdlScanYYensure_buffer_stack (void );
static void vhdlScanYY_load_buffer_state (void );
static void vhdlScanYY_init_buffer (YY_BUFFER_STATE b,FILE *file  );

#define YY_FLUSH_BUFFER vhdlScanYY_flush_buffer(YY_CURRENT_BUFFER )

YY_BUFFER_STATE vhdlScanYY_scan_buffer (char *base,yy_size_t size  );
YY_BUFFER_STATE vhdlScanYY_scan_string (yyconst char *yy_str  );
YY_BUFFER_STATE vhdlScanYY_scan_bytes (yyconst char *bytes,yy_size_t len  );

void *vhdlScanYYalloc (yy_size_t  );
void *vhdlScanYYrealloc (void *,yy_size_t  );
void vhdlScanYYfree (void *  );

#define yy_new_buffer vhdlScanYY_create_buffer

#define yy_set_interactive(is_interactive) \
	{ \
	if ( ! YY_CURRENT_BUFFER ){ \
        vhdlScanYYensure_buffer_stack (); \
		YY_CURRENT_BUFFER_LVALUE =    \
            vhdlScanYY_create_buffer(vhdlScanYYin,YY_BUF_SIZE ); \
	} \
	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
	}

#define yy_set_bol(at_bol) \
	{ \
	if ( ! YY_CURRENT_BUFFER ){\
        vhdlScanYYensure_buffer_stack (); \
		YY_CURRENT_BUFFER_LVALUE =    \
            vhdlScanYY_create_buffer(vhdlScanYYin,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 vhdlScanYYwrap(n) 1
#define YY_SKIP_YYWRAP

typedef unsigned char YY_CHAR;

FILE *vhdlScanYYin = (FILE *) 0, *vhdlScanYYout = (FILE *) 0;

typedef int yy_state_type;

extern int vhdlScanYYlineno;

int vhdlScanYYlineno = 1;

extern char *vhdlScanYYtext;
#define yytext_ptr vhdlScanYYtext

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 vhdlScanYYtext.
 */
#define YY_DO_BEFORE_ACTION \
	(yytext_ptr) = yy_bp; \
	vhdlScanYYleng = (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[229] =
    {   0,
       56,   47,   55,    1,   47,   55,   45,   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,   46,   51,   40,   40,   40,   40,   43,   49,   46,
       49,   51,   46,   49,   51,   46,   51,   46,   51,   53,

       46,   51,   46,   51,16432,   49,   49,   46,   49,   51,
       53,   46,   51,16432,   46,   51,   53,   46,   51,   53,
       40,   40,   49,   53,   40,   40, 8240, 8240
    } ;

static yyconst flex_int16_t yy_accept[222] =
    {   0,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    2,
        4,    7,    9,   11,   13,   16,   19,   22,   25,   28,
       31,   34,   37,   40,   43,   46,   49,   52,   55,   58,
       61,   64,   67,   70,   73,   76,   79,   82,   85,   88,
       91,   93,   96,   99,  101,  104,  106,  108,  110,  112,
      114,  116,  117,  118,  120,  121,  122,  123,  124,  125,
      126,  127,  127,  127,  127,  128,  128,  128,  129,  129,
      129,  129,  130,  131,  132,  133,  133,  133,  134,  134,
      134,  134,  134,  134,  134,  134,  134,  134,  135,  136,
      137,  138,  139,  140,  141,  141,  142,  143,  144,  145,

      146,  147,  147,  147,  147,  148,  149,  150,  151,  152,
      153,  153,  153,  154,  155,  156,  156,  156,  157,  157,
      158,  158,  158,  159,  161,  162,  162,  163,  164,  166,
      166,  167,  167,  167,  168,  168,  168,  168,  168,  168,
      168,  169,  170,  171,  172,  172,  172,  172,  175,  175,
      176,  178,  180,  180,  182,  184,  185,  185,  185,  185,
      186,  186,  186,  186,  187,  187,  188,  188,  189,  189,
      189,  189,  189,  190,  193,  196,  196,  198,  201,  203,
      203,  205,  206,  206,  206,  206,  206,  207,  208,  211,
      211,  212,  214,  215,  218,  221,  221,  221,  221,  221,

      222,  222,  222,  222,  222,  222,  223,  224,  224,  225,
      225,  225,  225,  226,  226,  227,  227,  227,  228,  229,
      229
    } ;

static yyconst flex_int32_t yy_ec[256] =
    {   0,
        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    2,    4,    5,    6,    7,    8,    9,   10,   11,
       12,   13,   14,   15,   16,   17,   18,   19,   19,   19,
       19,   19,   19,   19,   19,   19,   19,   20,   21,   22,
       23,   24,   25,   26,   27,   28,   27,   29,   30,   27,
       31,   31,   31,   31,   31,   31,   31,   31,   32,   31,
       31,   31,   33,   31,   34,   31,   31,   35,   31,   31,
       36,   37,   38,   39,   40,   41,   27,   42,   27,   43,

       30,   27,   31,   31,   31,   31,   31,   31,   31,   31,
       44,   31,   31,   31,   45,   31,   46,   31,   31,   47,
       31,   31,   48,   49,   48,    7,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,

        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1
    } ;

static yyconst flex_int32_t yy_meta[50] =
    {   0,
        1,    2,    3,    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,   11,    2
    } ;

static yyconst flex_int16_t yy_base[251] =
    {   0,
        0,    0,   48,   49,   55,   56,   68,   74,  900,  901,
       59,  901,   91,  139,  901,  187,  901,  901,  886,  901,
      901,  882,  901,   39,  231,  874,  901,   31,  872,   36,
      220,  901,   37,  248,    0,    0,  284,  251,    0,  901,
      330,  901,  901,  353,  901,  901,   78,  860,  846,  238,
      842,  791,  239,  769,   66,  758,  901,  256,  732,  712,
      711,  266,  705,    0,  715,    0,    0,  711,    0,  702,
      692,  901,  676,  901,  901,  272,  642,    0,  278,   80,
      241,  271,  276,  373,  374,  305,  640,  901,  901,  901,
      901,  901,  901,  901,  635,  632,  901,  596,  901,  317,

      319,  277,  384,  403,    0,    0,    0,    0,    0,    0,
        0,    0,    0,  420,    0,  278,  602,  613,  602,  601,
      391,  317,  421,  600,  901,  608,  901,    0,  563,  451,
      439,  419,  591,  370,  330,  386,  430,  432,  436,  465,
      455,  901,  901,  901,  264,  420,  603,  558,  305,  244,
      468,  589,    0,  598,    0,  542,  459,  477,  477,  463,
      551,  481,  495,  507,  499,  437,  517,  901,  485,  503,
      513,  520,  449,  489,    0,  531,  416,  548,  551,  440,
      420,  482,  524,  436,   43,  541,  389,    0,  387,  553,
      555,  556,  565,  562,  316,  308,  497,  254,  243,  533,

      474,  555,  283,  561,  220,  552,  187,  573,  574,  592,
      580,  138,  576,   72,  580,   70,  596,  901,   65,  901,
      620,  631,  642,  646,  655,  666,  677,  688,  699,  706,
      708,  714,  717,  725,  736,  747,  757,  768,  779,  790,
      801,  812,  823,  834,  845,  852,  853,  862,  873,  884
    } ;

static yyconst flex_int16_t yy_def[251] =
    {   0,
      220,    1,  221,  221,  222,  222,  223,  223,  220,  220,
      220,  220,  220,  220,  220,  220,  220,  220,  220,  220,
      220,  220,  220,  220,  220,  220,  220,  220,  220,  220,
      220,  220,  224,  224,   34,   34,   34,   37,   34,  220,
      220,  220,  220,  225,  220,  220,  220,  220,  220,  220,
      220,  226,  226,  220,  226,  226,  220,  220,  220,  220,
      220,  220,  220,   13,  220,   13,   14,  220,   14,  220,
      220,  220,  227,  220,  220,  220,  220,   25,  220,  220,
      220,  220,  220,  220,  220,  220,  220,  220,  220,  220,
      220,  220,  220,  220,  220,  220,  220,  220,  220,   34,

       34,  224,  220,  220,   34,   34,   34,   34,   34,   34,
       41,   41,   41,  225,  114,  220,  220,  227,  226,  220,
      226,  226,  228,  220,  220,  220,  220,  227,  229,  230,
      220,  231,  220,  220,  220,  220,  220,  220,  220,  220,
      220,  220,  220,  220,  232,  233,  220,  234,  226,  228,
      235,  227,  236,  237,  238,  220,  220,  230,  220,  220,
      220,  220,  231,  220,  220,  220,  220,  220,  232,  220,
      233,  220,  239,  240,  241,  242,  243,  237,  244,  245,
      237,  220,  220,  246,  247,  220,  248,  249,  240,  250,
      245,  243,  226,  237,  238,  245,  220,  220,  220,  220,

      246,  220,  247,  220,  220,  220,  248,  250,  245,  226,
      226,  220,  220,  220,  220,  220,  226,  220,  226,    0,
      220,  220,  220,  220,  220,  220,  220,  220,  220,  220,
      220,  220,  220,  220,  220,  220,  220,  220,  220,  220,
      220,  220,  220,  220,  220,  220,  220,  220,  220,  220
    } ;

static yyconst flex_int16_t yy_nxt[951] =
    {   0,
       10,   11,   12,   10,   13,   10,   10,   14,   15,   16,
       17,   18,   19,   20,   21,   22,   23,   24,   25,   26,
       27,   28,   29,   30,   31,   32,   33,   34,   35,   33,
       33,   36,   37,   38,   39,   40,   41,   42,   43,   10,
       44,   34,   35,   36,   37,   38,   39,   10,   45,   47,
       50,   74,   89,   90,   91,  100,   53,   53,   93,   94,
       62,   75,  164,   48,   51,   49,   49,   54,   54,   58,
       55,   55,   56,   56,   63,   58,  102,  120,  120,   62,
       59,  123,  204,   60,  103,   61,   59,  104,  215,   60,
      213,   61,   64,   63,   64,   65,   64,   64,   64,   64,

       64,   64,   64,   64,   64,   64,   64,   64,   64,   64,
       64,   64,   64,   64,   64,   64,   64,   66,   66,   66,
       66,   66,   66,   66,   66,   66,   64,   64,   64,   64,
       64,   64,   66,   66,   66,   66,   66,   66,   64,   64,
       67,  218,   67,   67,   67,   67,   68,   67,   67,   67,
       67,   67,   67,   67,   67,   67,   67,   67,   67,   67,
       67,   67,   67,   67,   67,   69,   69,   69,   69,   69,
       69,   69,   69,   69,   67,   67,   67,   67,   67,   67,
       69,   69,   69,   69,   69,   69,   67,   67,   70,  182,
       70,   70,   70,   70,   70,   70,   70,   70,   70,   70,

       70,   70,   70,   70,   70,   70,   70,   70,   70,   70,
       70,   70,   70,   71,   71,   71,   71,   71,   71,   71,
       71,   71,   70,   70,   70,   70,   70,   70,   71,   71,
       71,   71,   71,   71,   70,   70,   76,   95,  206,  116,
      121,   96,   97,   98,   99,  103,  119,   77,  104,   78,
       79,  120,  103,  117,  122,  104,  152,   62,   80,   81,
       82,  200,   83,   84,   85,   86,  100,   62,  168,  212,
       87,   63,   80,   81,   83,   84,   85,   86,  108,  116,
      103,   63,  109,  104,  133,  110,  133,  102,  220,  134,
      130,  220,  108,  117,  109,  100,  132,  110,  130,  130,

      130,  130,  164,  170,  132,  132,  132,  132,  176,  103,
      182,  105,  104,  130,  130,  106,  220,  120,  107,  132,
      132,  220,  204,  220,  220,  105,  220,  106,  195,  120,
      107,  111,  149,  111,  103,  111,  111,  104,  111,  111,
      111,  111,  111,  111,  111,  111,  111,  111,  111,  111,
      111,  111,  111,  111,  111,  111,  112,  112,  112,  112,
      112,  112,  112,  112,  112,  111,  113,  111,  111,  111,
      111,  112,  112,  112,  112,  112,  112,  111,  111,  115,
      115,  115,  115,  115,  115,  115,  115,  115,  166,  182,
      103,  182,  121,  104,  115,  115,  115,  115,  115,  115,

      135,  138,  145,  120,  136,  139,  122,  137,  140,  167,
      145,  145,  145,  145,  135,  138,  136,  139,  193,  137,
      140,  146,  182,  119,  151,  145,  145,  168,  194,  146,
      146,  146,  146,  152,  103,  162,  103,  104,  164,  104,
      103,  156,  182,  104,  146,  146,  115,  115,  115,  115,
      115,  115,  115,  115,  115,  166,  156,  160,  165,  172,
       76,  115,  115,  115,  115,  115,  115,  157,   82,  103,
      119,   77,  104,  141,   79,  202,  167,  184,  161,  156,
      178,  160,  156,  197,   82,  184,  184,  184,  184,  168,
      159,  182,   82,  157,   87,  158,  188,  198,  197,  185,

      184,  184,  161,  158,  158,  158,  158,  185,  185,  185,
      185,  162,  198,  202,  164,  179,  159,  163,  158,  158,
      168,  169,  185,  185,  170,  163,  163,  163,  163,  169,
      169,  169,  169,  119,  165,  166,  186,  199,  171,  199,
      163,  163,  200,  191,  169,  169,  171,  171,  171,  171,
      182,  213,  172,  119,  205,  193,  205,  182,  193,  206,
      194,  171,  171,  195,  182,  209,  210,  209,  194,  160,
      215,  183,  214,  201,  194,  193,  182,  120,  119,  203,
      211,  201,  201,  201,  201,  209,  209,  203,  203,  203,
      203,  216,  120,  210,  213,  217,  201,  201,  215,  219,

      182,  152,  203,  203,  120,  175,  173,  211,  120,  134,
      155,  153,  120,  120,  120,  214,  148,  147,  144,  216,
       46,   46,   46,   46,   46,   46,   46,   46,   46,   46,
       46,   52,   52,   52,   52,   52,   52,   52,   52,   52,
       52,   52,   57,   57,   57,   57,   57,   57,   57,   57,
       57,   57,   57,  101,  143,  101,  114,  142,  141,  114,
      131,  114,  114,  114,  114,  114,  119,  119,  119,  119,
      119,  119,  119,  119,  119,  119,  119,  128,  128,  129,
      128,  128,  128,  128,  128,  128,  128,  128,  150,  150,
      150,  150,  150,  150,  150,  150,  150,  150,  150,  154,

      154,  127,  154,  154,  154,  154,  154,  154,  154,  154,
      158,  127,  158,  158,  163,  163,  163,  169,   67,   64,
      126,  169,  171,   74,  171,  174,  174,   73,  174,  174,
      174,  174,  174,  174,  174,  174,  177,  177,  177,  177,
      177,  177,  177,  177,  177,  177,  177,  180,  180,  125,
      180,  180,  180,  180,  180,  180,  180,  181,  181,  181,
      181,  181,  181,  181,  181,  181,  181,  181,  155,  155,
      124,  155,  155,  155,  155,  155,  155,  155,  155,  187,
      187,  120,  187,  187,  187,  187,  187,  187,  187,  187,
      189,  189,  189,  189,  189,  189,  189,  189,  189,  189,

      189,  175,  175,  120,  175,  175,  175,  175,  175,  175,
      175,  175,  190,  190,  190,  190,  190,  190,  190,  190,
      190,  190,  190,  192,  192,  192,  192,  192,  192,  192,
      192,  192,  192,  192,  179,  179,  179,  179,  179,  179,
      179,  179,  179,  179,  179,  196,  196,  196,  196,  196,
      196,  196,  196,  196,  196,  196,  201,  118,   74,  201,
      203,  203,  207,  207,  207,  207,  207,  207,  207,  207,
      207,  207,  207,  188,  188,   73,  188,  188,  188,  188,
      188,  188,  188,  188,  208,  208,  208,  208,  208,  208,
      208,  208,  208,  208,  208,   92,   88,   73,   72,  220,

        9,  220,  220,  220,  220,  220,  220,  220,  220,  220,
      220,  220,  220,  220,  220,  220,  220,  220,  220,  220,
      220,  220,  220,  220,  220,  220,  220,  220,  220,  220,
      220,  220,  220,  220,  220,  220,  220,  220,  220,  220,
      220,  220,  220,  220,  220,  220,  220,  220,  220,  220
    } ;

static yyconst flex_int16_t yy_chk[951] =
    {   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,    3,
        4,   24,   28,   28,   28,   33,    5,    6,   30,   30,
       11,   24,  185,    3,    4,    3,    4,    5,    6,    7,
        5,    6,    5,    6,   11,    8,   33,  219,   55,   47,
        7,   55,  185,    7,   80,    7,    8,   80,  216,    8,
      214,    8,   13,   47,   13,   13,   13,   13,   13,   13,

       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
       14,  212,   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,   16,  207,
       16,   16,   16,   16,   16,   16,   16,   16,   16,   16,

       16,   16,   16,   16,   16,   16,   16,   16,   16,   16,
       16,   16,   16,   16,   16,   16,   16,   16,   16,   16,
       16,   16,   16,   16,   16,   16,   16,   16,   16,   16,
       16,   16,   16,   16,   16,   16,   25,   31,  205,   50,
       53,   31,   31,   31,   31,   81,  150,   25,   81,   25,
       25,   53,   34,   50,   53,   34,  150,   58,   25,   25,
       25,  199,   25,   25,   25,   25,   34,   62,  145,  198,
       25,   58,   25,   25,   25,   25,   25,   25,   38,  116,
       83,   62,   38,   83,   82,   38,   82,   34,   37,   82,
       76,   37,   38,  116,   38,  102,   79,   38,   76,   76,

       76,   76,  203,  145,   79,   79,   79,   79,  149,   86,
      196,   37,   86,   76,   76,   37,  102,  149,   37,   79,
       79,  100,  203,  101,  100,   37,  101,   37,  195,  122,
       37,   41,  122,   41,  135,   41,   41,  135,   41,   41,
       41,   41,   41,   41,   41,   41,   41,   41,   41,   41,
       41,   41,   41,   41,   41,   41,   41,   41,   41,   41,
       41,   41,   41,   41,   41,   41,   41,   41,   41,   41,
       41,   41,   41,   41,   41,   41,   41,   41,   41,   44,
       44,   44,   44,   44,   44,   44,   44,   44,  134,  189,
      136,  187,  121,  136,   44,   44,   44,   44,   44,   44,

       84,   85,  103,  121,   84,   85,  121,   84,   85,  134,
      103,  103,  103,  103,   84,   85,   84,   85,  177,   84,
       85,  104,  181,  123,  123,  103,  103,  146,  177,  104,
      104,  104,  104,  123,  137,  132,  138,  137,  132,  138,
      139,  184,  180,  139,  104,  104,  114,  114,  114,  114,
      114,  114,  114,  114,  114,  166,  130,  131,  132,  146,
      141,  114,  114,  114,  114,  114,  114,  130,  131,  140,
      151,  141,  140,  141,  141,  184,  166,  157,  131,  201,
      151,  160,  158,  182,  141,  157,  157,  157,  157,  169,
      130,  174,  160,  158,  141,  159,  173,  182,  197,  162,

      157,  157,  160,  159,  159,  159,  159,  162,  162,  162,
      162,  163,  197,  201,  163,  151,  158,  165,  159,  159,
      171,  170,  162,  162,  169,  165,  165,  165,  165,  170,
      170,  170,  170,  176,  163,  167,  164,  183,  172,  183,
      165,  165,  183,  176,  170,  170,  172,  172,  172,  172,
      178,  200,  171,  179,  186,  190,  186,  191,  192,  186,
      178,  172,  172,  179,  194,  190,  193,  191,  192,  161,
      206,  156,  200,  202,  194,  208,  209,  193,  176,  204,
      193,  202,  202,  202,  202,  208,  209,  204,  204,  204,
      204,  206,  211,  210,  213,  211,  202,  202,  215,  217,

      154,  152,  204,  204,  210,  148,  147,  210,  217,  133,
      129,  126,  124,  120,  119,  213,  118,  117,   98,  215,
      221,  221,  221,  221,  221,  221,  221,  221,  221,  221,
      221,  222,  222,  222,  222,  222,  222,  222,  222,  222,
      222,  222,  223,  223,  223,  223,  223,  223,  223,  223,
      223,  223,  223,  224,   96,  224,  225,   95,   87,  225,
       77,  225,  225,  225,  225,  225,  226,  226,  226,  226,
      226,  226,  226,  226,  226,  226,  226,  227,  227,   73,
      227,  227,  227,  227,  227,  227,  227,  227,  228,  228,
      228,  228,  228,  228,  228,  228,  228,  228,  228,  229,

      229,   71,  229,  229,  229,  229,  229,  229,  229,  229,
      230,   70,  230,  230,  231,  231,  231,  232,   68,   65,
       63,  232,  233,   61,  233,  234,  234,   60,  234,  234,
      234,  234,  234,  234,  234,  234,  235,  235,  235,  235,
      235,  235,  235,  235,  235,  235,  235,  236,  236,   59,
      236,  236,  236,  236,  236,  236,  236,  237,  237,  237,
      237,  237,  237,  237,  237,  237,  237,  237,  238,  238,
       56,  238,  238,  238,  238,  238,  238,  238,  238,  239,
      239,   54,  239,  239,  239,  239,  239,  239,  239,  239,
      240,  240,  240,  240,  240,  240,  240,  240,  240,  240,

      240,  241,  241,   52,  241,  241,  241,  241,  241,  241,
      241,  241,  242,  242,  242,  242,  242,  242,  242,  242,
      242,  242,  242,  243,  243,  243,  243,  243,  243,  243,
      243,  243,  243,  243,  244,  244,  244,  244,  244,  244,
      244,  244,  244,  244,  244,  245,  245,  245,  245,  245,
      245,  245,  245,  245,  245,  245,  246,   51,   49,  246,
      247,  247,  248,  248,  248,  248,  248,  248,  248,  248,
      248,  248,  248,  249,  249,   48,  249,  249,  249,  249,
      249,  249,  249,  249,  250,  250,  250,  250,  250,  250,
      250,  250,  250,  250,  250,   29,   26,   22,   19,    9,

      220,  220,  220,  220,  220,  220,  220,  220,  220,  220,
      220,  220,  220,  220,  220,  220,  220,  220,  220,  220,
      220,  220,  220,  220,  220,  220,  220,  220,  220,  220,
      220,  220,  220,  220,  220,  220,  220,  220,  220,  220,
      220,  220,  220,  220,  220,  220,  220,  220,  220,  220
    } ;

extern int vhdlScanYY_flex_debug;
int vhdlScanYY_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 vhdlScanYYtext */ \
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 *vhdlScanYYtext;
#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/2002/2008 
 ******************************************************************************/
#line 40 "vhdlscanner.l"

#ifndef YYSTYPE
	typedef int YYSTYPE;
#endif

#include <ctype.h>
#include <search.h>

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <ctype.h>
#include "commentscan.h"
#include "vhdlparser.h"
#include "vhdlscanner.h"

#include "doxygen.h"
#include "searchindex.h"
#include <ctype.h>
#include "scanner.h"
#include "vhdldocgen.h"
#include "util.h"
#include "bufstr.h"
#include "message.h"
#include "vhdlcode.h"
#include <qmap.h>
#include "entry.h"

static MyParserVhdl *pconv;

static bool          g_lexInit = FALSE;
static ParserInterface *g_thisParser;
static struct s_contVhdl* yycont=NULL;
static Entry* current_root;
static Entry   gBlock;

static int yyLineNr =1;
//static int yyPrevLine=1;
//static int yyEndLine=1;
static int   g_lastCommentContext;
static int              inputPosition;
//static int defineLineContinue=0;
static int startComment;
//static int iSize=0;
static QCString inputVhdlString;
static QFile            inputFile;
static QCString         yyFileName;
static QList<QCString> qlist;

static QCString lastLetter;
//static int totLines=0;

//static bool multLineComment=FALSE;
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 const char *  g_inputString;       //!< the    code fragment as text
//static int           g_inputLines=0;      //!<number of line in the code fragment
//static bool          g_needsTermination;
static	QMap<QCString, int> keyMap;

static void handleCommentBlock(const QCString &doc,bool brief);
static void mapLibPackage(const Entry* ce);
static Entry* getEntryAtLine(const Entry* ce,int line);
static bool addLibUseClause(const QCString &type);


#define YY_NEVER_INTERACTIVE 1
#define YY_USER_ACTION num_chars += vhdlScanYYleng;

#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<QCString, int>::Iterator it = keyMap.find(word);
  if (it.key())
	return it.data();

  return -1;
}

// update current line
static void lineCount()
{
  for (const char* c=vhdlScanYYtext ; *c ; ++c )
  {
    yyLineNr += (*c == '\n') ;
  }
}


static void startCodeBlock(int index){
  int ll=strComment.length();
  iCodeLen=inputVhdlString.findRev(strComment.data(),num_chars)+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=vhdlScanYYread(buf,max_size);


static int vhdlScanYYread(char *buf,int max_size)
{
  int c=0;
  while ( c < max_size && inputVhdlString.at(inputPosition) )
  {
	*buf = inputVhdlString.at(inputPosition++) ;
	c++; buf++;
  }
  return c;
}




#line 1160 "<stdout>"

#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 <unistd.h>
#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 vhdlScanYYlex_destroy (void );

int vhdlScanYYget_debug (void );

void vhdlScanYYset_debug (int debug_flag  );

YY_EXTRA_TYPE vhdlScanYYget_extra (void );

void vhdlScanYYset_extra (YY_EXTRA_TYPE user_defined  );

FILE *vhdlScanYYget_in (void );

void vhdlScanYYset_in  (FILE * in_str  );

FILE *vhdlScanYYget_out (void );

void vhdlScanYYset_out  (FILE * out_str  );

yy_size_t vhdlScanYYget_leng (void );

char *vhdlScanYYget_text (void );

int vhdlScanYYget_lineno (void );

void vhdlScanYYset_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 vhdlScanYYwrap (void );
#else
extern int vhdlScanYYwrap (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 fwrite( vhdlScanYYtext, vhdlScanYYleng, 1, vhdlScanYYout )
#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 = '*'; \
		yy_size_t n; \
		for ( n = 0; n < max_size && \
			     (c = getc( vhdlScanYYin )) != EOF && c != '\n'; ++n ) \
			buf[n] = (char) c; \
		if ( c == '\n' ) \
			buf[n++] = (char) c; \
		if ( c == EOF && ferror( vhdlScanYYin ) ) \
			YY_FATAL_ERROR( "input in flex scanner failed" ); \
		result = n; \
		} \
	else \
		{ \
		errno=0; \
		while ( (result = fread(buf, 1, max_size, vhdlScanYYin))==0 && ferror(vhdlScanYYin)) \
			{ \
			if( errno != EINTR) \
				{ \
				YY_FATAL_ERROR( "input in flex scanner failed" ); \
				break; \
				} \
			errno=0; \
			clearerr(vhdlScanYYin); \
			} \
		}\
\

#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 vhdlScanYYlex (void);

#define YY_DECL int vhdlScanYYlex (void)
#endif /* !YY_DECL */

/* Code executed at the beginning of each rule, after vhdlScanYYtext and vhdlScanYYleng
 * 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 ( vhdlScanYYleng > 0 ) \
		YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
				(vhdlScanYYtext[vhdlScanYYleng - 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 396 "vhdlscanner.l"


#line 1351 "<stdout>"

	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 *)vhdlScanYYalloc(YY_STATE_BUF_SIZE  );
            if ( ! (yy_state_buf) )
                YY_FATAL_ERROR( "out of dynamic memory in vhdlScanYYlex()" );

		if ( ! (yy_start) )
			(yy_start) = 1;	/* first start state */

		if ( ! vhdlScanYYin )
			vhdlScanYYin = stdin;

		if ( ! vhdlScanYYout )
			vhdlScanYYout = stdout;

		if ( ! YY_CURRENT_BUFFER ) {
			vhdlScanYYensure_buffer_stack ();
			YY_CURRENT_BUFFER_LVALUE =
				vhdlScanYY_create_buffer(vhdlScanYYin,YY_BUF_SIZE );
		}

		vhdlScanYY_load_buffer_state( );
		}

	while ( 1 )		/* loops until end-of-file is reached */
		{
		yy_cp = (yy_c_buf_p);

		/* Support of vhdlScanYYtext. */
		*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 >= 221 )
					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];
goto find_rule; /* Shut up GCC warning -Wall */
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 398 "vhdlscanner.l"
{ /* nothing */ }
	YY_BREAK
case 2:
YY_RULE_SETUP
#line 399 "vhdlscanner.l"
{ return(t_Ampersand); }
	YY_BREAK
case 3:
YY_RULE_SETUP
#line 400 "vhdlscanner.l"
{ return(t_Apostrophe); }
	YY_BREAK
case 4:
YY_RULE_SETUP
#line 401 "vhdlscanner.l"
{ return(t_LeftParen); }
	YY_BREAK
case 5:
YY_RULE_SETUP
#line 402 "vhdlscanner.l"
{ return(t_RightParen); }
	YY_BREAK
case 6:
YY_RULE_SETUP
#line 403 "vhdlscanner.l"
{ return(t_DoubleStar); }
	YY_BREAK
case 7:
YY_RULE_SETUP
#line 404 "vhdlscanner.l"
{ return(t_Star); }
	YY_BREAK
case 8:
YY_RULE_SETUP
#line 405 "vhdlscanner.l"
{ return(t_Plus); }
	YY_BREAK
case 9:
YY_RULE_SETUP
#line 406 "vhdlscanner.l"
{ return(t_Comma); }
	YY_BREAK
case 10:
YY_RULE_SETUP
#line 407 "vhdlscanner.l"
{ return(t_Minus); }
	YY_BREAK
case 11:
YY_RULE_SETUP
#line 408 "vhdlscanner.l"
{ return(t_VarAsgn); }
	YY_BREAK
case 12:
YY_RULE_SETUP
#line 409 "vhdlscanner.l"
{ return(t_Colon); }
	YY_BREAK
case 13:
YY_RULE_SETUP
#line 410 "vhdlscanner.l"
{ return(t_Semicolon); }
	YY_BREAK
case 14:
YY_RULE_SETUP
#line 411 "vhdlscanner.l"
{ return(t_LESym); }
	YY_BREAK
case 15:
YY_RULE_SETUP
#line 412 "vhdlscanner.l"
{ return(t_GESym); }
	YY_BREAK
case 16:
YY_RULE_SETUP
#line 413 "vhdlscanner.l"
{ return(t_LTSym); }
	YY_BREAK
case 17:
YY_RULE_SETUP
#line 414 "vhdlscanner.l"
{ return(t_GTSym); }
	YY_BREAK
case 18:
YY_RULE_SETUP
#line 415 "vhdlscanner.l"
{ return(t_EQSym); }
	YY_BREAK
case 19:
YY_RULE_SETUP
#line 416 "vhdlscanner.l"
{ return(t_NESym); }
	YY_BREAK
case 20:
YY_RULE_SETUP
#line 417 "vhdlscanner.l"
{ return(t_Arrow); }
	YY_BREAK
case 21:
YY_RULE_SETUP
#line 418 "vhdlscanner.l"
{ return(t_Box); }
	YY_BREAK
case 22:
YY_RULE_SETUP
#line 419 "vhdlscanner.l"
{ return(t_SLSL); }
	YY_BREAK
case 23:
YY_RULE_SETUP
#line 420 "vhdlscanner.l"
{ return(t_SRSR); }
	YY_BREAK
case 24:
YY_RULE_SETUP
#line 421 "vhdlscanner.l"
{ return(t_QQ); }
	YY_BREAK
case 25:
YY_RULE_SETUP
#line 422 "vhdlscanner.l"
{ return(t_QGT); }
	YY_BREAK
case 26:
YY_RULE_SETUP
#line 423 "vhdlscanner.l"
{ return(t_QLT); }
	YY_BREAK
case 27:
YY_RULE_SETUP
#line 424 "vhdlscanner.l"
{ return(t_QG); }
	YY_BREAK
case 28:
YY_RULE_SETUP
#line 425 "vhdlscanner.l"
{ return(t_QL); }
	YY_BREAK
case 29:
YY_RULE_SETUP
#line 426 "vhdlscanner.l"
{ return(t_QEQU); }
	YY_BREAK
case 30:
YY_RULE_SETUP
#line 427 "vhdlscanner.l"
{ return(t_QNEQU); }
	YY_BREAK
case 31:
YY_RULE_SETUP
#line 428 "vhdlscanner.l"
{ return(t_Q); }
	YY_BREAK
case 32:
YY_RULE_SETUP
#line 429 "vhdlscanner.l"
{ return(t_Bar); }
	YY_BREAK
case 33:
YY_RULE_SETUP
#line 430 "vhdlscanner.l"
{ return(t_Dot); }
	YY_BREAK
case 34:
YY_RULE_SETUP
#line 431 "vhdlscanner.l"
{ return(t_Slash); }
	YY_BREAK
case 35:
YY_RULE_SETUP
#line 432 "vhdlscanner.l"
{ return(t_At); }
	YY_BREAK
case 36:
YY_RULE_SETUP
#line 433 "vhdlscanner.l"
{ return(t_Neg); }
	YY_BREAK
case 37:
YY_RULE_SETUP
#line 434 "vhdlscanner.l"
{ return(t_LEFTBR); }
	YY_BREAK
case 38:
YY_RULE_SETUP
#line 435 "vhdlscanner.l"
{ return(t_RIGHTBR); }
	YY_BREAK
case 39:
YY_RULE_SETUP
#line 438 "vhdlscanner.l"
{
          int itoken=find_keyword(vhdlScanYYtext);
        
          //	fprintf(stderr,"\n <<<< search tok:  %s %d %d>>>\n",vhdlScanYYtext,itoken,yyLineNr);
        
          // tokens in vhdlparser.hpp 258..412
	  if (itoken>200  && itoken<500 && prevToken!=t_END)
	  {
	    //  	printf("\n <<<< insert tok:  %s %d %d>>>\n",vhdlScanYYtext,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=vhdlScanYYtext;
          yycont->yyLineNr=yyLineNr;
          if (itoken== -1)  
          {
            yycont->iLine=yyLineNr;
            return ( t_LETTER );
          }
          else 
          {
            return ( itoken );
          }
        }
	YY_BREAK
case 40:
YY_RULE_SETUP
#line 477 "vhdlscanner.l"
{
          yycont->qstr=vhdlScanYYtext;
          return ( t_ABSTRLIST );
        }
	YY_BREAK
case 41:
YY_RULE_SETUP
#line 482 "vhdlscanner.l"
{
          QCString q(vhdlScanYYtext);	       
          yycont->qstr=vhdlScanYYtext; 
        
          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 503 "vhdlscanner.l"
{
          yycont->qstr=vhdlScanYYtext;
          yycont->iLine=yyLineNr;
	  return ( t_STRING );
        } 
	YY_BREAK
case 43:
YY_RULE_SETUP
#line 509 "vhdlscanner.l"
{
	  yycont->qstr=vhdlScanYYtext;
	  yycont->iLine=yyLineNr;
	  return ( t_DIGIT );
        }
	YY_BREAK
case 44:
YY_RULE_SETUP
#line 515 "vhdlscanner.l"
{
	  yycont->qstr=vhdlScanYYtext;
	  yycont->iLine=yyLineNr;
	  return(t_ToolDir);
        }	
	YY_BREAK
case 45:
/* rule 45 can match eol */
YY_RULE_SETUP
#line 521 "vhdlscanner.l"
{
	  yyLineNr++;
          yycont->yyLineNr=yyLineNr;
        }
	YY_BREAK
case 46:
YY_RULE_SETUP
#line 526 "vhdlscanner.l"
{
          /* comment */
	  QCString qcs(vhdlScanYYtext);
	  //  vhdl comment ?
	  if (qcs.stripPrefix("--!"))
	  {
	    REJECT;
	  }
        }               
	YY_BREAK
case 47:
YY_RULE_SETUP
#line 535 "vhdlscanner.l"
{ /* unknown characters */ }
	YY_BREAK
case 48:
/* rule 48 can match eol */
YY_RULE_SETUP
#line 538 "vhdlscanner.l"
{ // multi line comment
  if (iDocLine==-1) iDocLine=yyLineNr;
  QCString qc(vhdlScanYYtext);
  int len=qc.contains('\n')+yyLineNr-1;
  if (YY_START!=Comment) // Start of the comment block
  {
    startComment=yyLineNr;
    g_lastCommentContext=YY_START;
  }

  Entry* pTemp=getEntryAtLine(current_root,len);
  if (pTemp)
  { // found one line comment, add it to the entry on this line
    pTemp->briefLine=yyLineNr;
    pTemp->brief+=vhdlScanYYtext;
    pTemp->briefFile=yyFileName;
    VhdlDocGen::prepareComment(pTemp->brief);
  }
  else 
  {
    strComment+=vhdlScanYYtext;
  }
  lineCount();
  BEGIN(Comment);
}
	YY_BREAK
case 49:
YY_RULE_SETUP
#line 564 "vhdlscanner.l"
{
  if (iDocLine==-1) iDocLine=yyLineNr;
  strComment+=vhdlScanYYtext;
  int index=strComment.find("\\code");
  if (index>0)
  {
    startCodeBlock(index);
  }
  lineCount();
  BEGIN(Comment);
}
	YY_BREAK
case 50:
/* rule 50 can match eol */
YY_RULE_SETUP
#line 576 "vhdlscanner.l"
{
          // found end of comment block
          
          int index =strComment.find("\\code");
          if (index>0)
          {
            startCodeBlock(index);
          }

          VhdlDocGen::prepareComment(strComment);


          if (index==-1) 
          {
            handleCommentBlock(strComment,FALSE);
          }
          strComment.resize(0);;
          unput(*vhdlScanYYtext);
          BEGIN(g_lastCommentContext);
        }
	YY_BREAK
case 51:
YY_RULE_SETUP
#line 597 "vhdlscanner.l"
{ // one line comment
          if (iDocLine==-1) iDocLine=yyLineNr;
          QCString qcs(vhdlScanYYtext);

	  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);
	  Entry* pTemp=getEntryAtLine(current_root,yyLineNr);

	  if (!isEndCode)
	  {
	    int j=qcs.find("--!");
	    qcs=qcs.right(qcs.length()-3-j);

	    if (pTemp)
	    {
	      pTemp->briefLine=yyLineNr;
	      qcs=qcs.stripWhiteSpace();
	      pTemp->brief+=qcs;

	      pTemp->briefFile=yyFileName;
	      iDocLine=-1;
	    }
	    else
	    {
	      handleCommentBlock(qcs,TRUE);
	    }
	  }//endcode
        }
	YY_BREAK
case 52:
YY_RULE_SETUP
#line 641 "vhdlscanner.l"
{
	  strComment+=vhdlScanYYtext;
	  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 650 "vhdlscanner.l"
{
    	  QCString tt(vhdlScanYYtext);
	  int len=tt.length();
	  yyLineNr+=tt.contains('\n');

	  // delete * from comments 
	  // /*! 
	  // *   see vim !
	  // */

	  if (vhdlScanYYtext[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 686 "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 699 "vhdlscanner.l"
ECHO;
	YY_BREAK
#line 1975 "<stdout>"
			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 vhdlScanYYin at a new source and called
			 * vhdlScanYYlex().  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 = vhdlScanYYin;
			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 ( vhdlScanYYwrap( ) )
					{
					/* Note: because we've taken care in
					 * yy_get_next_buffer() to have set up
					 * vhdlScanYYtext, 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 vhdlScanYYlex */

/* 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;
			vhdlScanYYrestart(vhdlScanYYin  );
			}

		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 *) vhdlScanYYrealloc((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 >= 221 )
				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 >= 221 )
			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 == 220);
	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 vhdlScanYYtext */
	*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. */
					vhdlScanYYrestart(vhdlScanYYin );

					/*FALLTHROUGH*/

				case EOB_ACT_END_OF_FILE:
					{
					if ( vhdlScanYYwrap( ) )
						return 0;

					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 vhdlScanYYtext */
	(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 vhdlScanYYrestart  (FILE * input_file )
{
    
	if ( ! YY_CURRENT_BUFFER ){
        vhdlScanYYensure_buffer_stack ();
		YY_CURRENT_BUFFER_LVALUE =
            vhdlScanYY_create_buffer(vhdlScanYYin,YY_BUF_SIZE );
	}

	vhdlScanYY_init_buffer(YY_CURRENT_BUFFER,input_file );
	vhdlScanYY_load_buffer_state( );
}

/** Switch to a different input buffer.
 * @param new_buffer The new input buffer.
 * 
 */
    void vhdlScanYY_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
{
    
	/* TODO. We should be able to replace this entire function body
	 * with
	 *		vhdlScanYYpop_buffer_state();
	 *		vhdlScanYYpush_buffer_state(new_buffer);
     */
	vhdlScanYYensure_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;
	vhdlScanYY_load_buffer_state( );

	/* We don't actually know whether we did this switch during
	 * EOF (vhdlScanYYwrap()) processing, but the only time this flag
	 * is looked at is after vhdlScanYYwrap() is called, so it's safe
	 * to go ahead and always set it.
	 */
	(yy_did_buffer_switch_on_eof) = 1;
}

static void vhdlScanYY_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;
	vhdlScanYYin = 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 vhdlScanYY_create_buffer  (FILE * file, int  size )
{
	YY_BUFFER_STATE b;
    
	b = (YY_BUFFER_STATE) vhdlScanYYalloc(sizeof( struct yy_buffer_state )  );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in vhdlScanYY_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 *) vhdlScanYYalloc(b->yy_buf_size + 2  );
	if ( ! b->yy_ch_buf )
		YY_FATAL_ERROR( "out of dynamic memory in vhdlScanYY_create_buffer()" );

	b->yy_is_our_buffer = 1;

	vhdlScanYY_init_buffer(b,file );

	return b;
}

/** Destroy the buffer.
 * @param b a buffer created with vhdlScanYY_create_buffer()
 * 
 */
    void vhdlScanYY_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 )
		vhdlScanYYfree((void *) b->yy_ch_buf  );

	vhdlScanYYfree((void *) b  );
}

#ifndef __cplusplus
extern int isatty (int );
#endif /* __cplusplus */
    
/* Initializes or reinitializes a buffer.
 * This function is sometimes called more than once on the same buffer,
 * such as during a vhdlScanYYrestart() or at EOF.
 */
    static void vhdlScanYY_init_buffer  (YY_BUFFER_STATE  b, FILE * file )

{
	int oerrno = errno;
    
	vhdlScanYY_flush_buffer(b );

	b->yy_input_file = file;
	b->yy_fill_buffer = 1;

    /* If b is the current buffer, then vhdlScanYY_init_buffer was _probably_
     * called from vhdlScanYYrestart() 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 vhdlScanYY_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 )
		vhdlScanYY_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 vhdlScanYYpush_buffer_state (YY_BUFFER_STATE new_buffer )
{
    	if (new_buffer == NULL)
		return;

	vhdlScanYYensure_buffer_stack();

	/* This block is copied from vhdlScanYY_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 vhdlScanYY_switch_to_buffer. */
	vhdlScanYY_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 vhdlScanYYpop_buffer_state (void)
{
    	if (!YY_CURRENT_BUFFER)
		return;

	vhdlScanYY_delete_buffer(YY_CURRENT_BUFFER );
	YY_CURRENT_BUFFER_LVALUE = NULL;
	if ((yy_buffer_stack_top) > 0)
		--(yy_buffer_stack_top);

	if (YY_CURRENT_BUFFER) {
		vhdlScanYY_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 vhdlScanYYensure_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**)vhdlScanYYalloc
								(num_to_alloc * sizeof(struct yy_buffer_state*)
								);
		if ( ! (yy_buffer_stack) )
			YY_FATAL_ERROR( "out of dynamic memory in vhdlScanYYensure_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**)vhdlScanYYrealloc
								((yy_buffer_stack),
								num_to_alloc * sizeof(struct yy_buffer_state*)
								);
		if ( ! (yy_buffer_stack) )
			YY_FATAL_ERROR( "out of dynamic memory in vhdlScanYYensure_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 vhdlScanYY_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) vhdlScanYYalloc(sizeof( struct yy_buffer_state )  );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in vhdlScanYY_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;

	vhdlScanYY_switch_to_buffer(b  );

	return b;
}

/** Setup the input buffer state to scan a string. The next call to vhdlScanYYlex() 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
 *       vhdlScanYY_scan_bytes() instead.
 */
YY_BUFFER_STATE vhdlScanYY_scan_string (yyconst char * yystr )
{
    
	return vhdlScanYY_scan_bytes(yystr,strlen(yystr) );
}

/** Setup the input buffer state to scan the given bytes. The next call to vhdlScanYYlex() will
 * scan from a @e copy of @a bytes.
 * @param bytes the byte buffer to scan
 * @param len the number of bytes in the buffer pointed to by @a bytes.
 * 
 * @return the newly allocated buffer state object.
 */
YY_BUFFER_STATE vhdlScanYY_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len )
{
	YY_BUFFER_STATE b;
	char *buf;
	yy_size_t n, i;
    
	/* Get memory for full buffer, including space for trailing EOB's. */
	n = _yybytes_len + 2;
	buf = (char *) vhdlScanYYalloc(n  );
	if ( ! buf )
		YY_FATAL_ERROR( "out of dynamic memory in vhdlScanYY_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 = vhdlScanYY_scan_buffer(buf,n );
	if ( ! b )
		YY_FATAL_ERROR( "bad buffer in vhdlScanYY_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 vhdlScanYYtext. */ \
        int yyless_macro_arg = (n); \
        YY_LESS_LINENO(yyless_macro_arg);\
		vhdlScanYYtext[vhdlScanYYleng] = (yy_hold_char); \
		(yy_c_buf_p) = vhdlScanYYtext + yyless_macro_arg; \
		(yy_hold_char) = *(yy_c_buf_p); \
		*(yy_c_buf_p) = '\0'; \
		vhdlScanYYleng = yyless_macro_arg; \
		} \
	while ( 0 )

/* Accessor  methods (get/set functions) to struct members. */

/** Get the current line number.
 * 
 */
int vhdlScanYYget_lineno  (void)
{
        
    return vhdlScanYYlineno;
}

/** Get the input stream.
 * 
 */
FILE *vhdlScanYYget_in  (void)
{
        return vhdlScanYYin;
}

/** Get the output stream.
 * 
 */
FILE *vhdlScanYYget_out  (void)
{
        return vhdlScanYYout;
}

/** Get the length of the current token.
 * 
 */
yy_size_t vhdlScanYYget_leng  (void)
{
        return vhdlScanYYleng;
}

/** Get the current token.
 * 
 */

char *vhdlScanYYget_text  (void)
{
        return vhdlScanYYtext;
}

/** Set the current line number.
 * @param line_number
 * 
 */
void vhdlScanYYset_lineno (int  line_number )
{
    
    vhdlScanYYlineno = line_number;
}

/** Set the input stream. This does not discard the current
 * input buffer.
 * @param in_str A readable stream.
 * 
 * @see vhdlScanYY_switch_to_buffer
 */
void vhdlScanYYset_in (FILE *  in_str )
{
        vhdlScanYYin = in_str ;
}

void vhdlScanYYset_out (FILE *  out_str )
{
        vhdlScanYYout = out_str ;
}

int vhdlScanYYget_debug  (void)
{
        return vhdlScanYY_flex_debug;
}

void vhdlScanYYset_debug (int  bdebug )
{
        vhdlScanYY_flex_debug = bdebug ;
}

static int yy_init_globals (void)
{
        /* Initialization is the same as for the non-reentrant scanner.
     * This function is called from vhdlScanYYlex_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
    vhdlScanYYin = stdin;
    vhdlScanYYout = stdout;
#else
    vhdlScanYYin = (FILE *) 0;
    vhdlScanYYout = (FILE *) 0;
#endif

    /* For future reference: Set errno on error, since we are called by
     * vhdlScanYYlex_init()
     */
    return 0;
}

/* vhdlScanYYlex_destroy is for both reentrant and non-reentrant scanners. */
int vhdlScanYYlex_destroy  (void)
{
    
    /* Pop the buffer stack, destroying each element. */
	while(YY_CURRENT_BUFFER){
		vhdlScanYY_delete_buffer(YY_CURRENT_BUFFER  );
		YY_CURRENT_BUFFER_LVALUE = NULL;
		vhdlScanYYpop_buffer_state();
	}

	/* Destroy the stack itself. */
	vhdlScanYYfree((yy_buffer_stack) );
	(yy_buffer_stack) = NULL;

    vhdlScanYYfree ( (yy_state_buf) );
    (yy_state_buf)  = NULL;

    /* Reset the globals. This is important in a non-reentrant scanner so the next time
     * vhdlScanYYlex() 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 *vhdlScanYYalloc (yy_size_t  size )
{
	return (void *) malloc( size );
}

void *vhdlScanYYrealloc  (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 vhdlScanYYfree (void * ptr )
{
	free( (char *) ptr );	/* see vhdlScanYYrealloc() for (char *) cast */
}

#define YYTABLES_NAME "yytables"

#line 699 "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)
  {
    vhdlScanYYlex_destroy();
  }
#endif
}

void VHDLLanguageScanner::resetCodeParserState()
{
}

bool VHDLLanguageScanner::needsPreprocessing(const QCString & /*extension*/)
{ 
  return TRUE; 
}

void VHDLLanguageScanner::parsePrototype(const char * /*text*/)
{ 
  assert(FALSE); 
}

// do parsing
int MyParserVhdl::doLex()
{
  int token=vhdlScanYYlex();
  //fprintf(stderr,"\ntoken: %d at line: %d",token,yyLineNr);
  return token;
}

void VHDLLanguageScanner::parseInput(const char *fileName,const char *fileBuf,Entry *root)
{
  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; 
  }

  ::parserInit();
  yycont=getVhdlCont();
  yycont->root=root;
  yycont->fileName=fileName;
  initVhdlParser();
  QCString pPuffer(" ");
  pPuffer+=fileBuf;

  inputFile.setName(fileName);
  if (g_lexInit)
  {
    vhdlScanYYrestart( vhdlScanYYin );
  }
  g_lexInit=TRUE;
  g_thisParser=this;
  inputPosition=0;
  inputVhdlString=fileBuf;
  yyLineNr=1;
  current_root=root;
  pconv=new MyParserVhdl();
  groupEnterFile(fileName,yyLineNr);
  pconv->parse(pconv);
  //    resetScanner(NULL,pconv);
  delete pconv;	  	  
  Entry* curr=getCurrentVhdlEntry(); // delete last current
  delete curr;
  curr=0;
  free(lineIndex);
  inputFile.close();
  mapLibPackage(root);
}

void VHDLLanguageScanner::parseCode(CodeOutputInterface &codeOutIntf,
    const char *scopeName,
    const QCString &input,
    bool isExampleBlock,
    const char *exampleName,
    FileDef *fileDef,
    int startLine,
    int endLine,
    bool inlineFragment,
    MemberDef *memberDef,
    bool showLineNumbers
    )
{
  ::parseVhdlCode(codeOutIntf,scopeName,input,isExampleBlock,exampleName,
                  fileDef,startLine,endLine,inlineFragment,memberDef,
                  showLineNumbers);
}

/*
 * 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(const Entry* ce)
{
  Entry *lastComp=0;
  while (TRUE)
  {
    bool found = FALSE;
    Entry *rt=0;
    //const QList<Entry> *epp=ce->children();
    EntryListIterator eli(*ce->children());
    EntryListIterator eli1=eli;
    for (;(rt=eli.current()),eli1=eli;++eli)
    {
      if (rt->spec==VhdlDocGen::LIBRARY || rt->spec==VhdlDocGen::USE)
        // top level library or use statement
      {
        Entry *temp=0;
        if(!addLibUseClause(rt->name))
        {
          rt->spec=-1;
          rt->section=0;
          //  continue;
        }

        for (;(temp=eli1.current());++eli1) // find next entity
        {
          if (temp->spec==VhdlDocGen::ENTITY || 
              temp->spec==VhdlDocGen::PACKAGE || 
              temp->spec==VhdlDocGen::ARCHITECTURE || 
              temp->spec==VhdlDocGen::PACKAGE_BODY)
          {
            Entry *ee=new Entry(*rt); //append a copy to entries sublist
            temp->addSubEntry(ee);
            found=TRUE;
            rt->spec=-1; //nullify entry
            rt->section=0;
            lastComp=temp;
            break;
          }
        }//for
        if (lastComp && rt->spec!=-1)
        {
          Entry *ee=new Entry(*rt); //append a copy to entries sublist
          lastComp->addSubEntry(ee);
          found=TRUE;
          rt->spec=-1; //nullify entry
          rt->section=0;
        }
      }//if
    }//for
    if (!found) // nothing left to do
    {
      return; 
    }
  }//while
}//MapLib

static bool addLibUseClause(const QCString &type)
{
  static bool show=Config_getBool("SHOW_INCLUDE_FILES");
  static bool showIEEESTD=Config_getBool("FORCE_LOCAL_INCLUDES");

  if (!show)  // all libraries and included packages will not  be shown
  {
    return FALSE;
  }

  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;
  bool needsEntry=FALSE;
  Protection protection=Public;
  int lineNr = iDocLine;

  Entry* current=getCurrentVhdlEntry();

  if (brief) 
    current->briefLine = iDocLine; 
  else 
    current->docLine = iDocLine;

  //printf("parseCommentBlock %p [%s]\n",current,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)
  {
    newVhdlEntry();
  }
  iDocLine=-1;
  strComment.resize(0);
}

// returns the vhdl type parsed at line xxx
static Entry* getEntryAtLine(const Entry* ce,int line)
{
  EntryListIterator eli(*ce->children());
  Entry *found=0;
  Entry *rt;
  for (;(rt=eli.current());++eli)
  {
    if (rt->bodyLine==line)
    {
      found=rt;
    } // if
    if (!found) 
    {
      found=getEntryAtLine(rt,line);
    }
  }
  return found;
}// getEntryAtLine

// token index in vhdlparser.hpp 258..416
int getParsedLine(int object)
{
  //assert(object>254 && object <416);
  return lineIndex [object];
}



