
#line 2 "<stdout>"

#define  YY_INT_ALIGNED short int

/* A lexical scanner generated by flex */

#define yy_create_buffer VL_create_buffer
#define yy_delete_buffer VL_delete_buffer
#define yy_scan_buffer VL_scan_buffer
#define yy_scan_string VL_scan_string
#define yy_scan_bytes VL_scan_bytes
#define yy_init_buffer VL_init_buffer
#define yy_flush_buffer VL_flush_buffer
#define yy_load_buffer_state VL_load_buffer_state
#define yy_switch_to_buffer VL_switch_to_buffer
#define yypush_buffer_state VLpush_buffer_state
#define yypop_buffer_state VLpop_buffer_state
#define yyensure_buffer_stack VLensure_buffer_stack
#define yy_flex_debug VL_flex_debug
#define yyin VLin
#define yyleng VLleng
#define yylex VLlex
#define yylineno VLlineno
#define yyout VLout
#define yyrestart VLrestart
#define yytext VLtext
#define yywrap VLwrap
#define yyalloc VLalloc
#define yyrealloc VLrealloc
#define yyfree VLfree

#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 6
#define YY_FLEX_SUBMINOR_VERSION 4
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif

#ifdef yy_create_buffer
#define VL_create_buffer_ALREADY_DEFINED
#else
#define yy_create_buffer VL_create_buffer
#endif

#ifdef yy_delete_buffer
#define VL_delete_buffer_ALREADY_DEFINED
#else
#define yy_delete_buffer VL_delete_buffer
#endif

#ifdef yy_scan_buffer
#define VL_scan_buffer_ALREADY_DEFINED
#else
#define yy_scan_buffer VL_scan_buffer
#endif

#ifdef yy_scan_string
#define VL_scan_string_ALREADY_DEFINED
#else
#define yy_scan_string VL_scan_string
#endif

#ifdef yy_scan_bytes
#define VL_scan_bytes_ALREADY_DEFINED
#else
#define yy_scan_bytes VL_scan_bytes
#endif

#ifdef yy_init_buffer
#define VL_init_buffer_ALREADY_DEFINED
#else
#define yy_init_buffer VL_init_buffer
#endif

#ifdef yy_flush_buffer
#define VL_flush_buffer_ALREADY_DEFINED
#else
#define yy_flush_buffer VL_flush_buffer
#endif

#ifdef yy_load_buffer_state
#define VL_load_buffer_state_ALREADY_DEFINED
#else
#define yy_load_buffer_state VL_load_buffer_state
#endif

#ifdef yy_switch_to_buffer
#define VL_switch_to_buffer_ALREADY_DEFINED
#else
#define yy_switch_to_buffer VL_switch_to_buffer
#endif

#ifdef yypush_buffer_state
#define VLpush_buffer_state_ALREADY_DEFINED
#else
#define yypush_buffer_state VLpush_buffer_state
#endif

#ifdef yypop_buffer_state
#define VLpop_buffer_state_ALREADY_DEFINED
#else
#define yypop_buffer_state VLpop_buffer_state
#endif

#ifdef yyensure_buffer_stack
#define VLensure_buffer_stack_ALREADY_DEFINED
#else
#define yyensure_buffer_stack VLensure_buffer_stack
#endif

#ifdef yylex
#define VLlex_ALREADY_DEFINED
#else
#define yylex VLlex
#endif

#ifdef yyrestart
#define VLrestart_ALREADY_DEFINED
#else
#define yyrestart VLrestart
#endif

#ifdef yylex_init
#define VLlex_init_ALREADY_DEFINED
#else
#define yylex_init VLlex_init
#endif

#ifdef yylex_init_extra
#define VLlex_init_extra_ALREADY_DEFINED
#else
#define yylex_init_extra VLlex_init_extra
#endif

#ifdef yylex_destroy
#define VLlex_destroy_ALREADY_DEFINED
#else
#define yylex_destroy VLlex_destroy
#endif

#ifdef yyget_debug
#define VLget_debug_ALREADY_DEFINED
#else
#define yyget_debug VLget_debug
#endif

#ifdef yyset_debug
#define VLset_debug_ALREADY_DEFINED
#else
#define yyset_debug VLset_debug
#endif

#ifdef yyget_extra
#define VLget_extra_ALREADY_DEFINED
#else
#define yyget_extra VLget_extra
#endif

#ifdef yyset_extra
#define VLset_extra_ALREADY_DEFINED
#else
#define yyset_extra VLset_extra
#endif

#ifdef yyget_in
#define VLget_in_ALREADY_DEFINED
#else
#define yyget_in VLget_in
#endif

#ifdef yyset_in
#define VLset_in_ALREADY_DEFINED
#else
#define yyset_in VLset_in
#endif

#ifdef yyget_out
#define VLget_out_ALREADY_DEFINED
#else
#define yyget_out VLget_out
#endif

#ifdef yyset_out
#define VLset_out_ALREADY_DEFINED
#else
#define yyset_out VLset_out
#endif

#ifdef yyget_leng
#define VLget_leng_ALREADY_DEFINED
#else
#define yyget_leng VLget_leng
#endif

#ifdef yyget_text
#define VLget_text_ALREADY_DEFINED
#else
#define yyget_text VLget_text
#endif

#ifdef yyget_lineno
#define VLget_lineno_ALREADY_DEFINED
#else
#define yyget_lineno VLget_lineno
#endif

#ifdef yyset_lineno
#define VLset_lineno_ALREADY_DEFINED
#else
#define yyset_lineno VLset_lineno
#endif

#ifdef yywrap
#define VLwrap_ALREADY_DEFINED
#else
#define yywrap VLwrap
#endif

#ifdef yyalloc
#define VLalloc_ALREADY_DEFINED
#else
#define yyalloc VLalloc
#endif

#ifdef yyrealloc
#define VLrealloc_ALREADY_DEFINED
#else
#define yyrealloc VLrealloc
#endif

#ifdef yyfree
#define VLfree_ALREADY_DEFINED
#else
#define yyfree VLfree
#endif

#ifdef yytext
#define VLtext_ALREADY_DEFINED
#else
#define yytext VLtext
#endif

#ifdef yyleng
#define VLleng_ALREADY_DEFINED
#else
#define yyleng VLleng
#endif

#ifdef yyin
#define VLin_ALREADY_DEFINED
#else
#define yyin VLin
#endif

#ifdef yyout
#define VLout_ALREADY_DEFINED
#else
#define yyout VLout
#endif

#ifdef yy_flex_debug
#define VL_flex_debug_ALREADY_DEFINED
#else
#define yy_flex_debug VL_flex_debug
#endif

#ifdef yylineno
#define VLlineno_ALREADY_DEFINED
#else
#define yylineno VLlineno
#endif

/* First, we deal with  platform-specific or compiler-specific issues. */

/* begin standard C headers. */
#ifdef _LIBC
#include "namespace.h"
#endif
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>

/* end standard C headers. */

/*	$NetBSD: flexint.h,v 1.3 2018/12/23 16:27:17 christos Exp $	*/

/* 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;

/* 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

#ifndef SIZE_MAX
#define SIZE_MAX               (~(size_t)0)
#endif

#endif /* ! C99 */

#endif /* ! FLEXINT_H */

/* begin standard C++ headers. */

/* TODO: this is always defined, so inline it */
#define yyconst const

#if defined(__GNUC__) && __GNUC__ >= 3
#define yynoreturn __attribute__((__noreturn__))
#else
#define yynoreturn
#endif

/* Returned upon end-of-file. */
#define YY_NULL 0

/* Promotes a possibly negative, possibly signed char to an
 *   integer in range [0..255] for use as an array index.
 */
#define YY_SC_TO_UI(c) ((YY_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 yyrestart( yyin  )
#define YY_END_OF_BUFFER_CHAR 0

/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k.
 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
 * Ditto for the __ia64__ case accordingly.
 */
#define YY_BUF_SIZE 32768
#else
#define YY_BUF_SIZE 16384
#endif /* __ia64__ */
#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 yyleng;

extern FILE *yyin, *yyout;

#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
    
    #define YY_LESS_LINENO(n)
    #define YY_LINENO_REWIND_TO(ptr)
    
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
	do \
		{ \
		/* Undo effects of setting up yytext. */ \
        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 yytext 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.
	 */
	size_t yy_buf_size;

	/* Number of characters read into yy_ch_buf, not including EOB
	 * characters.
	 */
	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 yyrestart()), so that the user can continue scanning by
	 * just pointing yyin 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 = NULL; /**< 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 yytext 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 yyleng;

/* Points to current character in buffer. */
static char *yy_c_buf_p = NULL;
static int yy_init = 0;		/* whether we need to initialize */
static int yy_start = 0;	/* start state number */

/* Flag which is used to allow yywrap()'s to do buffer switches
 * instead of setting up a fresh yyin.  A bit of a hack ...
 */
static int yy_did_buffer_switch_on_eof;

void yyrestart ( FILE *input_file  );
void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer  );
YY_BUFFER_STATE yy_create_buffer ( FILE *file, yy_size_t size  );
void yy_delete_buffer ( YY_BUFFER_STATE b  );
void yy_flush_buffer ( YY_BUFFER_STATE b  );
void yypush_buffer_state ( YY_BUFFER_STATE new_buffer  );
void yypop_buffer_state ( void );

static void yyensure_buffer_stack ( void );
static void yy_load_buffer_state ( void );
static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file  );
#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )

YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size  );
YY_BUFFER_STATE yy_scan_string ( const char *yy_str  );
YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, yy_size_t len  );

void *yyalloc ( yy_size_t  );
void *yyrealloc ( void *, yy_size_t  );
void yyfree ( void *  );

#define yy_new_buffer yy_create_buffer
#define yy_set_interactive(is_interactive) \
	{ \
	if ( ! YY_CURRENT_BUFFER ){ \
        yyensure_buffer_stack (); \
		YY_CURRENT_BUFFER_LVALUE =    \
            yy_create_buffer( yyin, YY_BUF_SIZE ); \
	} \
	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
	}
#define yy_set_bol(at_bol) \
	{ \
	if ( ! YY_CURRENT_BUFFER ){\
        yyensure_buffer_stack (); \
		YY_CURRENT_BUFFER_LVALUE =    \
            yy_create_buffer( yyin, 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 */
typedef flex_uint8_t YY_CHAR;

FILE *yyin = NULL, *yyout = NULL;

typedef int yy_state_type;

extern int yylineno;
int yylineno = 1;

extern char *yytext;
#ifdef yytext_ptr
#undef yytext_ptr
#endif
#define yytext_ptr yytext

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 yynoreturn yy_fatal_error ( const char* msg  );

/* Done after the current pattern has been matched and before the
 * corresponding action - sets up yytext.
 */
#define YY_DO_BEFORE_ACTION \
	(yytext_ptr) = yy_bp; \
	(yytext_ptr) -= (yy_more_len); \
	yyleng = (yy_size_t)(yy_cp - (yytext_ptr)); \
	(yy_hold_char) = *yy_cp; \
	*yy_cp = '\0'; \
	(yy_c_buf_p) = yy_cp;
#define YY_NUM_RULES 160
#define YY_END_OF_BUFFER 161
/* 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 const flex_int16_t yy_acclist[481] =
    {   0,
      119,  119,  125,  125,  147,  147,  144,  144,  161,  158,
      159,  160,    3,  158,  159,  160,    4,  159,  160,   60,
      158,  159,  160,   61,  158,  159,  160,   60,  158,  159,
      160,  158,  159,  160,   60,  158,  159,  160,   60,  158,
      159,  160,  158,  159,  160,   60,  158,  159,  160,   60,
      158,  159,  160,   60,  158,  159,  160,   60,  158,  159,
      160,   60,  158,  159,  160,   60,  158,  159,  160,  111,
      158,  159,  160,   60,  158,  159,  160,   60,  158,  159,
      160,   60,  158,  159,  160,   60,  158,  159,  160,  102,
      158,  159,  160,  158,  159,  160,   60,  158,  159,  160,

      158,  159,  160,   60,  158,  159,  160,   60,  158,  159,
      160,    3,  158,  159,  160,    3,  158,  159,  160,   60,
      158,  159,  160,  158,  159,  160,   11,  159,  160,   12,
      159,  160,   11,  159,  160,  159,  160,    8,  159,  160,
        9,  159,  160,   66,  159,  160,   64,  159,  160,   65,
       66,  159,  160,   66,  159,  160,   60,  158,  159,  160,
       60,   91,  158,  159,  160,   60,   91,  158,  159,  160,
       91,  111,  158,  159,  160,   60,   91,  158,  159,  160,
       60,   91,  158,  159,  160,   83,  102,  158,  159,  160,
       86,  102,  158,  159,  160,   85,  102,  158,  159,  160,

       84,  102,  158,  159,  160,   89,  102,  158,  159,  160,
       90,  102,  158,  159,  160,   87,  102,  158,  159,  160,
       88,  102,  158,  159,  160,  119,  159,  160,  120,  159,
      160,  125,  159,  160,  126,  159,  160,  147,  159,  160,
      148,  159,  160,  144,  159,  160,  144,  159,  160,  111,
      158,  159,  160,  111,  158,  159,  160,   59,   60,  158,
      159,  160,  102,  158,  159,  160,  102,  158,  159,  160,
      115,  159,  160,   28,  104,   46,   32,   47,  110,   56,
       14,   15,   21,   44,   26,   54,   39,   42,   55,   40,
       43,   38,   16,   10,    7,   45,  111,  114,  114,  112,

       57,   41,   17,   22,   27,   24,   23,   19,  102,  103,
       49,   36,  157,   48,   31,   37,   35,   34,   13,   63,
       62,  119,  125,  147,  144,  144,  143,  144,   92,  111,
       93,   94,   95,  111,   96,   97,   98,  102,   99,  102,
      100,  102,  101,  102,   30,   33,  107,  105,  106,  109,
      108,   58,   25,  116,  117,   18,   50,   29,   51,   20,
      143,  144,  143,  144,  143,  144,  107,  105,  106,  109,
      108,  116,  113,  113,  117,   52,   53,   71,   76,   72,
       77,   79,   78,   67,   68,   70,   69,   80,   81,   82,
       74,   75,   73,  116,  150,  116,  150,  150,  151,  152,

      153,  156,    1,    1,  149,  151,  151,  152,  152,  153,
      153,  154,    2,    2,  128,  156,  156,  141,  139,  149,
      149,  154,  154,  155,  128,  128,  141,  141,  155,  155,
      123,  123,  118,  137,  121,  121,  145,  145,  145,  122,
      142,  122,  146,  142,  132,  133,  134,  140,  146,  132,
      132,  133,  133,  134,  134,  140,  140,  136,  138,  124,
      129,  135,  136,  136,  138,  138,  129,  129,  135,  135,
      127,  127,  131,  130,  131,  131,    5,  130,  130,    6
    } ;

static const flex_int16_t yy_accept[654] =
    {   0,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    2,    3,    4,    5,    6,    7,    8,
        9,    9,    9,    9,    9,   10,   13,   17,   20,   24,
       28,   32,   35,   39,   43,   46,   50,   54,   58,   62,
       66,   70,   74,   78,   82,   86,   90,   94,   97,  101,
      104,  108,  112,  116,  120,  124,  127,  130,  133,  136,
      138,  141,  144,  147,  150,  154,  157,  161,  166,  171,
      176,  181,  186,  191,  196,  201,  206,  211,  216,  221,
      226,  229,  232,  235,  238,  241,  244,  247,  250,  254,
      258,  263,  267,  271,  274,  275,  276,  277,  278,  279,

      280,  280,  280,  280,  280,  280,  281,  281,  282,  283,
      284,  285,  286,  287,  288,  289,  290,  291,  292,  293,
      294,  295,  296,  297,  297,  298,  298,  299,  300,  301,
      302,  303,  304,  305,  306,  307,  308,  309,  310,  311,
      312,  313,  314,  314,  314,  314,  315,  316,  317,  318,
      319,  319,  319,  319,  319,  319,  319,  319,  319,  319,
      319,  319,  319,  319,  319,  319,  319,  320,  321,  322,
      322,  322,  322,  322,  322,  323,  324,  325,  326,  327,
      329,  331,  332,  333,  335,  336,  337,  339,  341,  343,
      345,  346,  347,  347,  348,  348,  349,  350,  350,  351,

      351,  352,  352,  352,  353,  354,  354,  354,  355,  355,
      356,  357,  358,  359,  360,  361,  361,  361,  361,  361,
      361,  361,  361,  361,  361,  361,  361,  361,  361,  361,
      361,  361,  361,  361,  361,  361,  361,  361,  361,  361,
      361,  361,  361,  361,  361,  361,  361,  361,  361,  361,
      361,  361,  361,  361,  361,  361,  361,  363,  365,  367,
      368,  369,  370,  371,  372,  372,  373,  373,  374,  375,
      376,  377,  378,  378,  378,  378,  378,  378,  378,  378,
      378,  378,  378,  378,  378,  378,  378,  378,  378,  378,
      378,  378,  378,  378,  378,  378,  378,  378,  378,  378,

      378,  378,  379,  380,  381,  382,  383,  384,  385,  386,
      387,  388,  389,  390,  391,  392,  393,  394,  394,  394,
      395,  395,  395,  395,  395,  395,  395,  395,  395,  395,
      395,  395,  395,  396,  396,  396,  396,  396,  396,  396,
      396,  396,  396,  396,  396,  396,  396,  396,  396,  396,
      396,  396,  396,  397,  397,  397,  397,  397,  397,  397,
      397,  397,  397,  397,  397,  398,  399,  400,  400,  400,
      400,  401,  402,  402,  402,  402,  402,  402,  402,  402,
      402,  402,  402,  403,  403,  403,  403,  403,  403,  403,
      404,  405,  405,  405,  405,  406,  406,  406,  407,  408,

      408,  408,  408,  409,  410,  411,  412,  413,  413,  414,
      415,  415,  415,  416,  416,  416,  416,  416,  417,  418,
      419,  419,  419,  419,  420,  420,  420,  420,  420,  421,
      422,  422,  422,  422,  422,  422,  423,  424,  425,  425,
      425,  426,  427,  427,  427,  427,  427,  428,  429,  429,
      429,  429,  429,  429,  429,  429,  429,  429,  429,  429,
      429,  430,  431,  431,  431,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  433,  433,  434,  434,  434,  434,
      435,  435,  436,  436,  436,  436,  436,  436,  436,  436,

      436,  436,  436,  436,  436,  436,  436,  437,  437,  437,
      437,  437,  437,  437,  437,  437,  437,  437,  437,  437,
      437,  437,  437,  437,  437,  437,  437,  437,  437,  437,
      438,  438,  438,  438,  438,  438,  438,  438,  438,  438,
      438,  438,  438,  438,  438,  438,  438,  439,  440,  441,
      441,  441,  441,  441,  441,  441,  442,  442,  442,  442,
      442,  442,  442,  442,  442,  443,  443,  443,  443,  443,
      443,  444,  445,  445,  445,  445,  446,  447,  448,  448,
      448,  448,  448,  449,  449,  449,  450,  450,  450,  450,
      451,  452,  453,  454,  455,  456,  456,  456,  456,  456,

      457,  458,  458,  458,  458,  458,  458,  458,  459,  460,
      460,  461,  461,  462,  462,  462,  463,  464,  465,  466,
      467,  467,  467,  468,  469,  469,  469,  470,  471,  472,
      472,  472,  472,  473,  473,  473,  473,  473,  473,  474,
      474,  474,  475,  476,  477,  477,  477,  478,  479,  480,
      480,  481,  481
    } ;

static const YY_CHAR yy_ec[256] =
    {   0,
        1,    1,    1,    1,    1,    1,    1,    2,    3,    4,
        1,    2,    2,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    5,    6,    7,    8,    9,   10,   11,   12,   13,
       14,   15,   16,   17,   18,   19,   20,   21,   22,   23,
       23,   23,   23,   23,   23,   24,   24,   25,   26,   27,
       28,   29,   30,   31,   32,   33,   32,   34,   35,   36,
       37,   38,   39,   39,   37,   40,   37,   41,   42,   43,
       39,   44,   45,   37,   39,   39,   39,   46,   39,   47,
       31,   48,   49,   50,   51,   52,   53,   54,   55,   56,

       57,   58,   59,   60,   61,   39,   62,   63,   64,   65,
       66,   67,   39,   68,   69,   70,   71,   72,   73,   74,
       75,   76,   77,   78,   31,   79,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,

        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    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 const YY_CHAR yy_meta[80] =
    {   0,
        1,    2,    3,    4,    3,    1,    1,    1,    5,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        6,    6,    6,    6,    1,    1,    1,    1,    1,    7,
        1,    6,    6,    6,    6,    6,    5,    5,    5,    5,
        5,    5,    5,    5,    5,    6,    6,    1,    1,    1,
        8,    1,    6,    6,    6,    6,    6,    6,    5,    5,
        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
        5,    5,    5,    6,    5,    6,    1,    1,    1
    } ;

static const flex_int16_t yy_base[696] =
    {   0,
        0,   78,   78,   80,    0,    0, 1484, 1483,   81,   83,
      119,   94, 1482, 1481, 1480, 1479, 1478, 1477,   85,   87,
       90,   98,  130,  138, 1480, 1489, 1489, 1489, 1451, 1489,
     1489,    0, 1450,   87,  189,  102,   94,  100,  188, 1462,
       98,  248, 1451,  108,  114,  125,    0,    0,   82,  223,
       93,  140,  235,  239, 1412,  318, 1489, 1489, 1454, 1489,
     1489, 1489, 1489, 1489, 1489,  120,  322,  218,  232,    0,
     1448, 1489,    0,    0,    0,    0,    0,    0,    0,    0,
        0, 1489,    0, 1489,    0, 1489,    0,  396,  177,  199,
     1489,  148,  159, 1489, 1444,    0, 1489, 1460, 1489, 1489,

      387,  390,  153,  435,  262, 1489,  279,  327, 1489, 1489,
     1489, 1489, 1489, 1489, 1441, 1489, 1489, 1440, 1489, 1489,
     1489,  331, 1489,  324,    0,  333, 1489, 1399, 1489, 1489,
     1489,  180, 1489, 1439, 1489, 1489,  186,    0,    0, 1489,
     1489,  306, 1409, 1400, 1396, 1489, 1489, 1489, 1489, 1489,
      358,  422,  458, 1402, 1405, 1404,  128,  113,  154, 1399,
     1393, 1390, 1400, 1385, 1394,  183, 1489, 1489, 1489,  320,
      332,  421,  256,  448,    0,    0,    0,    0,  529,  608,
        0, 1489, 1489,    0, 1489, 1489,    0,    0,    0,    0,
     1489, 1489,  540,  517,  596,  408, 1403,  251,    0,  600,

      631,  483,  496, 1489, 1489,  399, 1378,  687,  431,  482,
     1424, 1489, 1489, 1489, 1423, 1392, 1393, 1382,  207,  211,
     1389, 1378,  223, 1380, 1385, 1380,   75, 1373, 1372,  168,
      174, 1385, 1374,  269,  236, 1369, 1370, 1372,  242, 1378,
     1420, 1419, 1418, 1417, 1416, 1415, 1414, 1413, 1412, 1411,
     1410, 1409, 1408, 1407, 1406, 1405,    0,  758,    0,  520,
      551, 1367,    0,  643, 1352,    0,  675, 1489, 1347,  561,
     1489, 1489, 1362, 1347, 1343,  268,  206, 1359, 1356, 1353,
     1348, 1345,  306, 1354, 1353,  246, 1351,  537, 1347, 1347,
     1339, 1344, 1329, 1334, 1339, 1340, 1329, 1338, 1328, 1336,

     1329, 1489, 1489, 1489, 1489, 1489, 1489, 1489, 1489, 1489,
     1489, 1489, 1489, 1489, 1489, 1489, 1489, 1321,  627,  679,
     1319, 1321, 1331,  316,  620,  377, 1322, 1330, 1314, 1319,
     1308, 1328,  515, 1323, 1317, 1317, 1321, 1319, 1318, 1318,
     1303,  402, 1306, 1317, 1307, 1300, 1301, 1299, 1302, 1308,
     1304, 1304,  691, 1300, 1296, 1306, 1289,  436, 1308, 1301,
     1294, 1299, 1304, 1291,    0,  532,  622, 1296, 1295, 1288,
      718,  723, 1292, 1293,  457, 1281, 1281, 1289, 1292, 1287,
     1288, 1277,  729, 1287, 1283, 1269, 1268, 1267, 1273,    0,
      497, 1273, 1276, 1263,  734, 1268, 1274,    0,  745, 1279,

     1254, 1265,    0,  761,    0,  765,  769, 1270,    0,  541,
     1258, 1260,  774, 1261, 1254, 1269, 1264,    0,  788,  792,
     1251, 1268, 1257, 1489, 1236, 1241, 1229, 1231,    0,  796,
     1208, 1215, 1191, 1177, 1186,    0,  800,  809, 1177, 1161,
        0,  813, 1155, 1141, 1139, 1139,    0,  817, 1125, 1113,
     1115, 1111, 1079, 1081,  575, 1082, 1063, 1053, 1047, 1055,
        0,  821, 1037, 1041,  825, 1039, 1025, 1004,  997, 1008,
      994,  314,  988, 1000,  928,  905,  912,  895,  889,  885,
      891,  876,  886,  829,  879, 1489,  876,  836,  859, 1489,
      859,  840,  866,  856,  861,  840,  834,  844,  835,  841,

      818,  831,  824,  844,  806,  804,  848,  815,  796,  612,
      790,  798,  783,  783,  786,  783,  762,  778,  757,  746,
      761,  738,  747,  739,  743,  727,  725,  723,  727,  852,
      718,  720,  713,  699,  701,  702,  686,  677,  692,  682,
      666,  663,  668,  659,  665,  645,    0,  856,  860,  635,
      653,  625,  624,  619,  623,  864,  599,  616,  593,  602,
      585,  578,  570,  569,  868,  566,  557,  531,  536,  526,
      872,  876,  529,  520,  508,  880,  884,  888,  506,  495,
      483,  484,  892,  479,  485,  896,  476,  454,  455,    0,
      900,    0,  904,    0,  908,  438,  438,  427,  423,    0,

      913,  423,  419,  414,  382,  395,  366,  917,  921,  356,
     1489,  349,  925,  361,  344,  929,    0,  933,    0,  937,
      334,  314,    0,  941,  299,  269,    0,  945,  949,  284,
      255,  236,  953,  163,  134,  142,  300,   88,  957,   56,
      961,  965,    0,  969,  973,  977, 1489,    0,  981,  985,
     1489, 1489,  990,  998, 1006, 1014, 1022, 1030, 1038, 1046,
     1050, 1054, 1062, 1070, 1078, 1086, 1094, 1102, 1108, 1115,
     1118, 1126, 1134, 1142, 1150, 1158, 1166, 1174, 1182, 1190,
     1198, 1206, 1214, 1222, 1230, 1238, 1246, 1254, 1262, 1270,
     1278, 1286, 1294, 1302, 1310

    } ;

static const flex_int16_t yy_def[696] =
    {   0,
      652,    1,  653,  653,  654,  654,  655,  655,  656,  656,
        1,   11,  657,  657,  658,  658,  659,  659,  660,  660,
        1,    1,  654,  654,  652,  652,  652,  652,  652,  652,
      652,  661,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  662,  663,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,   42,
      652,  652,  662,  662,  662,  662,  662,  662,  662,  662,
      664,  652,  665,  652,  666,  652,  667,  668,   42,   42,
      652,  662,  662,  652,  652,  661,  652,  652,  652,  652,

      652,  652,  669,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,   42,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  662,  663,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  664,  665,  666,  667,  668,  670,
       42,  652,  652,   42,  652,  652,  662,  662,  662,  662,
      652,  652,  652,  652,  652,  652,  652,  669,  671,  652,

      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  672,  670,  258,  652,
      652,  652,  671,  652,  652,  208,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,

      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  673,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  674,  652,  652,
      652,  652,  652,  652,  673,  673,  675,  652,  652,  652,
      676,  677,  652,  652,  678,  652,  652,  652,  652,  652,
      652,  652,  679,  652,  652,  652,  652,  652,  652,  674,
      674,  652,  652,  652,  680,  652,  652,  675,  675,  652,

      652,  652,  676,  676,  677,  677,  681,  652,  678,  678,
      652,  652,  682,  652,  652,  652,  652,  679,  679,  683,
      652,  652,  652,  652,  652,  652,  652,  652,  680,  680,
      652,  652,  652,  652,  652,  681,  681,  684,  652,  652,
      682,  682,  652,  652,  652,  652,  683,  683,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      684,  684,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,

      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  685,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  685,  685,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  686,  687,  688,  652,  652,
      652,  652,  689,  652,  652,  652,  652,  652,  652,  686,
      686,  687,  687,  688,  688,  652,  652,  652,  652,  689,

      689,  652,  652,  652,  652,  652,  652,  690,  691,  652,
      652,  652,  692,  652,  652,  693,  690,  690,  691,  691,
      652,  652,  692,  692,  652,  652,  693,  693,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  694,  652,
      652,  695,  694,  694,  652,  652,  652,  695,  695,  652,
      652,    0,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652

    } ;

static const flex_int16_t yy_nxt[1569] =
    {   0,
       26,   27,   27,   28,   27,   29,   30,   31,   32,   33,
       34,   35,   36,   31,   37,   38,   31,   39,   40,   41,
       42,   42,   42,   42,   43,   31,   44,   45,   46,   31,
       31,   47,   47,   47,   47,   47,   47,   47,   47,   47,
       47,   47,   47,   47,   47,   47,   47,   48,   31,   49,
       47,   50,   47,   47,   47,   47,   47,   47,   47,   47,
       47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
       47,   47,   47,   47,   47,   47,   31,   51,   52,   53,
       54,   58,   54,   58,   64,   55,   64,   65,   60,   65,
       60,   88,   59,   88,   59,   53,   54,   98,   54,   53,

       54,   55,   54,  107,  107,   55,  107,  109,  110,  140,
       89,   90,  121,  645,   99,  113,  108,  122,   89,   90,
      146,  111,  112,  131,  114,  123,  168,  115,   66,   56,
       66,   67,  283,   68,  132,  133,   69,  284,   91,   70,
       70,  134,  135,   71,   72,   56,   91,  642,   72,   56,
      148,   73,  136,  137,   74,  198,   75,  198,   76,   77,
      141,   78,   79,   92,   80,   93,   94,  169,  187,  188,
      147,   92,   73,   93,   94,  229,   74,  230,   75,  189,
      190,   76,   94,   77,  227,   78,   79,   94,  228,  149,
       94,   94,   80,   94,   94,   94,   94,  639,  181,   94,

       94,   94,   94,  638,   94,  116,  211,  212,   94,  100,
      100,  231,  117,  214,  215,  118,  119,  150,  232,  184,
      287,  101,  102,  288,  142,  142,  103,  142,  637,  289,
      104,  109,  110,  105,  100,  100,  151,  151,  290,  151,
      151,  151,  101,  151,  102,  111,  112,  239,  103,  116,
      182,  240,  183,  198,  104,  198,  117,  105,  287,  118,
      119,  325,  100,  276,  100,  106,  124,  228,  125,  125,
      125,  125,  185,  229,  186,  277,  251,  252,  143,  144,
      107,  107,  126,  107,  127,  253,  152,  279,  295,  145,
      153,  240,  636,  202,  101,  102,  299,  300,  125,  103,

      127,  275,  333,  104,  126,  128,  334,  142,  142,  127,
      142,  128,  128,  635,  128,  101,  129,  102,  128,  142,
      142,  103,  142,  107,  107,  324,  107,  104,  203,  203,
      284,  203,  206,  206,  634,  206,  108,  293,  632,  294,
      204,  241,  170,  171,  208,  208,  208,  208,  209,  242,
      209,  172,  244,  210,  210,  210,  210,  640,  329,  151,
      151,  245,  151,  631,  641,  243,  330,  173,  357,  475,
      630,  155,  156,  157,  158,  174,  330,  246,  159,  358,
      160,  358,  161,  476,  162,  163,  164,  165,  166,  193,
      629,  193,  195,  243,  195,  173,  178,  178,  178,  207,

      206,  206,  180,  206,  375,  246,  375,  194,  194,  152,
      196,  196,  196,  196,  626,  178,  194,  625,  622,  197,
      178,  178,  178,  178,  178,  178,  178,  621,  261,  261,
      261,  261,  194,  194,  616,  197,  197,  200,  391,  200,
      391,  247,  248,  178,  178,  178,  178,  178,  615,  614,
      249,  210,  210,  210,  210,  201,  201,  201,  261,  410,
      194,  410,  194,  197,  201,  197,  250,  207,  254,  255,
      613,  612,  178,  178,  178,  155,  156,  219,  220,  611,
      201,  201,  221,  610,  203,  203,  161,  203,  222,  163,
      164,  165,  223,  256,  250,  609,  204,  203,  203,  391,

      203,  391,  270,  270,  270,  270,  608,  607,  201,  204,
      201,  155,  156,  219,  220,  606,  366,  366,  221,  366,
      160,  256,  161,  605,  222,  163,  164,  165,  223,  178,
      178,  178,  270,  366,  366,  180,  366,  260,  260,  604,
      260,  260,  193,  410,  193,  410,  260,  603,  178,  260,
      602,  599,  598,  178,  178,  178,  178,  178,  178,  178,
      194,  194,  260,  260,  597,  260,  260,  260,  596,  194,
      260,  261,  261,  261,  261,  589,  178,  178,  178,  178,
      178,  270,  270,  270,  270,  194,  194,  336,  588,  587,
      260,  337,  260,  260,  585,  260,  584,  338,  195,  583,

      195,  261,  200,  322,  200,  178,  178,  178,  257,  257,
      257,  270,  582,  194,  259,  194,  196,  196,  196,  196,
      201,  201,  201,  399,  399,  197,  399,  257,  581,  201,
      475,  580,  257,  257,  257,  257,  257,  257,  257,  470,
      579,  197,  197,  578,  476,  201,  201,  320,  320,  320,
      320,  264,  264,  264,  577,  257,  257,  257,  257,  257,
      264,  576,  575,  264,  264,  264,  574,  524,  573,  197,
      336,  197,  264,  201,  337,  201,  264,  264,  525,  571,
      338,  264,  526,  570,  257,  257,  257,  527,  264,  264,
      319,  569,  319,  264,  568,  320,  320,  320,  320,  353,

      353,  353,  353,  567,  264,  566,  264,  266,  266,  266,
      266,  353,  353,  353,  353,  564,  264,  563,  264,  404,
      404,  267,  404,  268,  406,  406,  562,  406,  561,  353,
      419,  419,  560,  419,  559,  430,  430,  266,  430,  268,
      558,  353,  557,  267,  269,  556,  399,  399,  268,  399,
      269,  269,  555,  269,  554,  129,  553,  269,  257,  257,
      257,  552,  404,  404,  259,  404,  406,  406,  551,  406,
      437,  437,  550,  437,  549,  442,  442,  257,  442,  546,
      545,  544,  257,  257,  257,  257,  257,  257,  257,  419,
      419,  543,  419,  448,  448,  542,  448,  430,  430,  541,

      430,  437,  437,  540,  437,  257,  257,  257,  257,  257,
      462,  462,  539,  462,  442,  442,  538,  442,  448,  448,
      537,  448,  462,  462,  536,  462,  484,  484,  535,  484,
      484,  484,  534,  484,  257,  257,  257,  504,  504,  533,
      504,  507,  507,  532,  507,  504,  504,  531,  504,  507,
      507,  530,  507,  548,  548,  529,  548,  548,  548,  528,
      548,  565,  565,  523,  565,  572,  572,  522,  572,  565,
      565,  521,  565,  586,  586,  520,  586,  572,  572,  518,
      572,  591,  591,  517,  591,  593,  593,  516,  593,  595,
      595,  515,  595,  601,  601,  514,  601,  586,  586,  513,

      586,  591,  591,  512,  591,  593,  593,  511,  593,  595,
      595,  510,  595,  519,  601,  601,  509,  601,  618,  618,
      508,  618,  620,  620,  506,  620,  624,  624,  505,  624,
      628,  628,  503,  628,  618,  618,  502,  618,  620,  620,
      501,  620,  624,  624,  500,  624,  628,  628,  499,  628,
      633,  633,  498,  633,  633,  633,  497,  633,  644,  644,
      496,  644,  646,  646,  647,  646,  649,  649,  495,  649,
      644,  644,  494,  644,  650,  650,  651,  650,  646,  646,
      647,  646,  649,  649,  493,  649,  650,  650,  651,  650,
       57,   57,   57,   57,   57,   57,   57,   57,   60,   60,

       60,   60,   60,   60,   60,   60,   61,   61,   61,   61,
       61,   61,   61,   61,   63,   63,   63,   63,   63,   63,
       63,   63,   81,   81,   81,   81,   81,   81,   81,   81,
       83,   83,   83,   83,   83,   83,   83,   83,   85,   85,
       85,   85,   85,   85,   85,   85,   87,   87,   87,   87,
       87,   87,   87,   87,   96,   96,  492,   96,  138,  138,
      491,  138,  139,  490,  489,  488,  139,  139,  139,  139,
      175,  175,  175,  487,  175,  175,  175,  175,  176,  176,
      176,  486,  176,  176,  176,  176,  177,  177,  177,  485,
      177,  177,  177,  177,  178,  178,  178,  483,  178,  178,

      178,  178,  179,  179,  179,  482,  179,  179,  179,  179,
      199,  481,  480,  199,  199,  258,  258,  258,  479,  258,
      258,  258,  258,  263,  263,  263,  257,  257,  257,  478,
      257,  257,  257,  257,  365,  365,  365,  477,  365,  365,
      365,  365,  390,  390,  390,  474,  390,  390,  390,  390,
      398,  398,  398,  473,  398,  398,  398,  398,  403,  403,
      403,  472,  403,  403,  403,  403,  405,  405,  405,  471,
      405,  405,  405,  405,  409,  409,  409,  470,  409,  409,
      409,  409,  418,  418,  418,  469,  418,  418,  418,  418,
      429,  429,  429,  468,  429,  429,  429,  429,  436,  436,

      436,  467,  436,  436,  436,  436,  441,  441,  441,  466,
      441,  441,  441,  441,  447,  447,  447,  465,  447,  447,
      447,  447,  461,  461,  461,  464,  461,  461,  461,  461,
      547,  547,  547,  463,  547,  547,  547,  547,  590,  590,
      590,  460,  590,  590,  590,  590,  592,  592,  592,  459,
      592,  592,  592,  592,  594,  594,  594,  458,  594,  594,
      594,  594,  600,  600,  600,  457,  600,  600,  600,  600,
      617,  617,  617,  456,  617,  617,  617,  617,  619,  619,
      619,  455,  619,  619,  619,  619,  623,  623,  623,  454,
      623,  623,  623,  623,  627,  627,  627,  453,  627,  627,

      627,  627,  643,  643,  643,  452,  643,  643,  643,  643,
      648,  648,  648,  451,  648,  648,  648,  648,  450,  449,
      446,  445,  444,  443,  440,  439,  438,  435,  434,  433,
      432,  431,  428,  427,  426,  425,  424,  423,  422,  421,
      420,  417,  416,  415,  414,  413,  412,  411,  408,  407,
      402,  401,  400,  397,  396,  395,  394,  393,  392,  389,
      388,  387,  386,  385,  384,  383,  382,  381,  380,  379,
      378,  377,  376,  374,  373,  372,  371,  370,  369,  368,
      367,  364,  363,  362,  361,  360,  359,  356,  355,  354,
      352,  351,  350,  349,  348,  347,  346,  345,  344,  343,

      342,  341,  340,  339,  335,  332,  331,  328,  327,  326,
      299,  295,  323,  322,  321,  129,  318,  262,  317,  316,
      315,  314,  313,  312,  311,  310,  309,  308,  307,  306,
      305,  304,  303,  302,  301,  298,  297,  296,  292,  291,
      286,  285,  282,  281,  280,  278,  231,  275,  274,  273,
      272,  271,  265,  262,  238,  237,  236,  235,  234,  233,
      226,  225,  224,  218,  217,  216,  213,  129,  205,  205,
      192,  191,  130,  167,  154,  130,  120,   97,   95,  652,
       86,   86,   84,   84,   82,   82,   62,   62,   25,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,

      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652
    } ;

static const flex_int16_t yy_chk[1569] =
    {   0,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    2,
        2,    3,    2,    4,    9,    2,   10,    9,   19,   10,
       20,   19,    3,   20,    4,   12,   12,   34,   12,   22,

       22,   12,   22,   36,   36,   22,   36,   37,   37,   49,
       21,   21,   41,  640,   34,   38,   36,   41,   22,   22,
       51,   37,   37,   44,   38,   41,   66,   38,    9,    2,
       10,   11,  227,   11,   44,   44,   11,  227,   21,   11,
       11,   45,   45,   11,   11,   12,   22,  638,   11,   22,
       52,   11,   46,   46,   11,  103,   11,  103,   11,   11,
       49,   11,   11,   21,   11,   21,   23,   66,   92,   92,
       51,   22,   11,   22,   24,  158,   11,  158,   11,   93,
       93,   11,   23,   11,  157,   11,   11,   23,  157,   52,
       24,   23,   11,   23,   23,   24,   23,  636,   89,   24,

       23,   24,   24,  635,   24,   39,  132,  132,   24,   35,
       35,  159,   39,  137,  137,   39,   39,   52,  159,   90,
      230,   35,   35,  230,   50,   50,   35,   50,  634,  231,
       35,   68,   68,   35,   35,   35,   53,   53,  231,   53,
       54,   54,   35,   54,   35,   68,   68,  166,   35,   69,
       89,  166,   89,  198,   35,  198,   69,   35,  277,   69,
       69,  277,   35,  219,   35,   35,   42,  219,   42,   42,
       42,   42,   90,  220,   90,  220,  173,  173,   50,   50,
      107,  107,   42,  107,   42,  173,   53,  223,  235,   50,
       54,  223,  632,  107,  105,  105,  239,  239,   42,  105,

       42,  235,  286,  105,   42,   42,  286,  142,  142,   42,
      142,   42,   42,  631,   42,  105,   42,  105,   42,   56,
       56,  105,   56,   67,   67,  276,   67,  105,  108,  108,
      276,  108,  122,  122,  630,  122,   67,  234,  626,  234,
      108,  170,   67,   67,  124,  124,  124,  124,  126,  170,
      126,   67,  171,  126,  126,  126,  126,  637,  283,  151,
      151,  171,  151,  625,  637,  170,  283,   67,  324,  472,
      622,   56,   56,   56,   56,   67,  324,  171,   56,  326,
       56,  326,   56,  472,   56,   56,   56,   56,   56,  101,
      621,  101,  102,  170,  102,   67,   88,   88,   88,  122,

      206,  206,   88,  206,  342,  171,  342,  101,  101,  151,
      102,  102,  102,  102,  615,   88,  101,  614,  612,  102,
       88,   88,   88,   88,   88,   88,   88,  610,  196,  196,
      196,  196,  101,  101,  607,  102,  102,  104,  358,  104,
      358,  172,  172,   88,   88,   88,   88,   88,  606,  605,
      172,  209,  209,  209,  209,  104,  104,  104,  196,  375,
      101,  375,  101,  102,  104,  102,  172,  206,  174,  174,
      604,  603,   88,   88,   88,  152,  152,  152,  152,  602,
      104,  104,  152,  599,  202,  202,  152,  202,  152,  152,
      152,  152,  152,  174,  172,  598,  202,  203,  203,  391,

      203,  391,  210,  210,  210,  210,  597,  596,  104,  203,
      104,  153,  153,  153,  153,  589,  333,  333,  153,  333,
      153,  174,  153,  588,  153,  153,  153,  153,  153,  179,
      179,  179,  210,  366,  366,  179,  366,  194,  194,  587,
      260,  260,  193,  410,  193,  410,  194,  585,  179,  260,
      584,  582,  581,  179,  179,  179,  179,  179,  179,  179,
      193,  193,  194,  194,  580,  260,  260,  194,  579,  193,
      260,  261,  261,  261,  261,  575,  179,  179,  179,  179,
      179,  270,  270,  270,  270,  193,  193,  288,  574,  573,
      194,  288,  194,  260,  570,  260,  569,  288,  195,  568,

      195,  261,  200,  288,  200,  179,  179,  179,  180,  180,
      180,  270,  567,  193,  180,  193,  195,  195,  195,  195,
      200,  200,  200,  367,  367,  195,  367,  180,  566,  200,
      455,  564,  180,  180,  180,  180,  180,  180,  180,  455,
      563,  195,  195,  562,  455,  200,  200,  319,  319,  319,
      319,  201,  201,  201,  561,  180,  180,  180,  180,  180,
      201,  560,  559,  264,  264,  264,  558,  510,  557,  195,
      325,  195,  264,  200,  325,  200,  201,  201,  510,  555,
      325,  201,  510,  554,  180,  180,  180,  510,  264,  264,
      267,  553,  267,  264,  552,  267,  267,  267,  267,  320,

      320,  320,  320,  551,  201,  550,  201,  208,  208,  208,
      208,  353,  353,  353,  353,  546,  264,  545,  264,  371,
      371,  208,  371,  208,  372,  372,  544,  372,  543,  320,
      383,  383,  542,  383,  541,  395,  395,  208,  395,  208,
      540,  353,  539,  208,  208,  538,  399,  399,  208,  399,
      208,  208,  537,  208,  536,  208,  535,  208,  258,  258,
      258,  534,  404,  404,  258,  404,  406,  406,  533,  406,
      407,  407,  532,  407,  531,  413,  413,  258,  413,  529,
      528,  527,  258,  258,  258,  258,  258,  258,  258,  419,
      419,  526,  419,  420,  420,  525,  420,  430,  430,  524,

      430,  437,  437,  523,  437,  258,  258,  258,  258,  258,
      438,  438,  522,  438,  442,  442,  521,  442,  448,  448,
      520,  448,  462,  462,  519,  462,  465,  465,  518,  465,
      484,  484,  517,  484,  258,  258,  258,  488,  488,  516,
      488,  492,  492,  515,  492,  504,  504,  514,  504,  507,
      507,  513,  507,  530,  530,  512,  530,  548,  548,  511,
      548,  549,  549,  509,  549,  556,  556,  508,  556,  565,
      565,  506,  565,  571,  571,  505,  571,  572,  572,  503,
      572,  576,  576,  502,  576,  577,  577,  501,  577,  578,
      578,  500,  578,  583,  583,  499,  583,  586,  586,  498,

      586,  591,  591,  497,  591,  593,  593,  496,  593,  595,
      595,  495,  595,  504,  601,  601,  494,  601,  608,  608,
      493,  608,  609,  609,  491,  609,  613,  613,  489,  613,
      616,  616,  487,  616,  618,  618,  485,  618,  620,  620,
      483,  620,  624,  624,  482,  624,  628,  628,  481,  628,
      629,  629,  480,  629,  633,  633,  479,  633,  639,  639,
      478,  639,  641,  641,  641,  641,  642,  642,  477,  642,
      644,  644,  476,  644,  645,  645,  645,  645,  646,  646,
      646,  646,  649,  649,  475,  649,  650,  650,  650,  650,
      653,  653,  653,  653,  653,  653,  653,  653,  654,  654,

      654,  654,  654,  654,  654,  654,  655,  655,  655,  655,
      655,  655,  655,  655,  656,  656,  656,  656,  656,  656,
      656,  656,  657,  657,  657,  657,  657,  657,  657,  657,
      658,  658,  658,  658,  658,  658,  658,  658,  659,  659,
      659,  659,  659,  659,  659,  659,  660,  660,  660,  660,
      660,  660,  660,  660,  661,  661,  474,  661,  662,  662,
      473,  662,  663,  471,  470,  469,  663,  663,  663,  663,
      664,  664,  664,  468,  664,  664,  664,  664,  665,  665,
      665,  467,  665,  665,  665,  665,  666,  666,  666,  466,
      666,  666,  666,  666,  667,  667,  667,  464,  667,  667,

      667,  667,  668,  668,  668,  463,  668,  668,  668,  668,
      669,  460,  459,  669,  669,  670,  670,  670,  458,  670,
      670,  670,  670,  671,  671,  671,  672,  672,  672,  457,
      672,  672,  672,  672,  673,  673,  673,  456,  673,  673,
      673,  673,  674,  674,  674,  454,  674,  674,  674,  674,
      675,  675,  675,  453,  675,  675,  675,  675,  676,  676,
      676,  452,  676,  676,  676,  676,  677,  677,  677,  451,
      677,  677,  677,  677,  678,  678,  678,  450,  678,  678,
      678,  678,  679,  679,  679,  449,  679,  679,  679,  679,
      680,  680,  680,  446,  680,  680,  680,  680,  681,  681,

      681,  445,  681,  681,  681,  681,  682,  682,  682,  444,
      682,  682,  682,  682,  683,  683,  683,  443,  683,  683,
      683,  683,  684,  684,  684,  440,  684,  684,  684,  684,
      685,  685,  685,  439,  685,  685,  685,  685,  686,  686,
      686,  435,  686,  686,  686,  686,  687,  687,  687,  434,
      687,  687,  687,  687,  688,  688,  688,  433,  688,  688,
      688,  688,  689,  689,  689,  432,  689,  689,  689,  689,
      690,  690,  690,  431,  690,  690,  690,  690,  691,  691,
      691,  428,  691,  691,  691,  691,  692,  692,  692,  427,
      692,  692,  692,  692,  693,  693,  693,  426,  693,  693,

      693,  693,  694,  694,  694,  425,  694,  694,  694,  694,
      695,  695,  695,  423,  695,  695,  695,  695,  422,  421,
      417,  416,  415,  414,  412,  411,  408,  402,  401,  400,
      397,  396,  394,  393,  392,  389,  388,  387,  386,  385,
      384,  382,  381,  380,  379,  378,  377,  376,  374,  373,
      370,  369,  368,  364,  363,  362,  361,  360,  359,  357,
      356,  355,  354,  352,  351,  350,  349,  348,  347,  346,
      345,  344,  343,  341,  340,  339,  338,  337,  336,  335,
      334,  332,  331,  330,  329,  328,  327,  323,  322,  321,
      318,  301,  300,  299,  298,  297,  296,  295,  294,  293,

      292,  291,  290,  289,  287,  285,  284,  282,  281,  280,
      279,  278,  275,  274,  273,  269,  265,  262,  256,  255,
      254,  253,  252,  251,  250,  249,  248,  247,  246,  245,
      244,  243,  242,  241,  240,  238,  237,  236,  233,  232,
      229,  228,  226,  225,  224,  222,  221,  218,  217,  216,
      215,  211,  207,  197,  165,  164,  163,  162,  161,  160,
      156,  155,  154,  145,  144,  143,  134,  128,  118,  115,
       98,   95,   71,   59,   55,   43,   40,   33,   29,   25,
       18,   17,   16,   15,   14,   13,    8,    7,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,

      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
      652,  652,  652,  652,  652,  652,  652,  652
    } ;

extern int yy_flex_debug;
int yy_flex_debug = 0;

static yy_state_type *yy_state_buf=0, *yy_state_ptr=0;
static char *yy_full_match;
static int yy_lp;
#define REJECT \
{ \
*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ \
yy_cp = (yy_full_match); /* restore poss. backed-over text */ \
++(yy_lp); \
goto find_rule; \
}

static int yy_more_flag = 0;
static int yy_more_len = 0;
#define yymore() ((yy_more_flag) = 1)
#define YY_MORE_ADJ (yy_more_len)
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
#line 1 "lexor.lex"
#line 6 "lexor.lex"
/*
 * Copyright (c) 1998-2015 Stephen Williams (steve@icarus.com)
 *
 *    This source code is free software; you can redistribute it
 *    and/or modify it in source code form under the terms of the GNU
 *    General Public License as published by the Free Software
 *    Foundation; either version 2 of the License, or (at your option)
 *    any later version.
 *
 *    This program is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with this program; if not, write to the Free Software
 *    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

# include "config.h"

      //# define YYSTYPE lexval

# include  <iostream>
# include  "compiler.h"
# include  "parse_misc.h"
# include  "parse_api.h"
# include  "parse.h"
# include  <cctype>
# include  <cstring>
# include  "lexor_keyword.h"
# include  "discipline.h"
# include  <list>

# define YY_USER_INIT reset_lexor();
# define yylval VLlval

# define YY_NO_INPUT

/*
 * Lexical location information is passed in the yylloc variable to th
 * parser. The file names, strings, are kept in a list so that I can
 * re-use them. The set_file_name function will return a pointer to
 * the name as it exists in the list (and delete the passed string.)
 * If the name is new, it will be added to the list.
 */
extern YYLTYPE yylloc;

char* strdupnew(char const *str)
{
       return str ? strcpy(new char [strlen(str)+1], str) : 0;
}

static const char* set_file_name(char*text)
{
      perm_string path = filename_strings.make(text);
      delete[]text;

	/* Check this file name with the list of library file
	   names. If there is a match, then turn on the
	   pform_library_flag. This is how the parser knows that
	   modules declared in this file are library modules. */
      pform_library_flag = library_file_map[path];
      return path;
}

void reset_lexor();
static void line_directive();
static void line_directive2();

verinum*make_unsized_binary(const char*txt);
verinum*make_undef_highz_dec(const char*txt);
verinum*make_unsized_dec(const char*txt);
verinum*make_unsized_octal(const char*txt);
verinum*make_unsized_hex(const char*txt);

static int dec_buf_div2(char *buf);

static void process_timescale(const char*txt);
static void process_ucdrive(const char*txt);

static list<int> keyword_mask_stack;

static int comment_enter;
static bool in_module = false;
static bool in_UDP = false;
bool in_celldefine = false;
UCDriveType uc_drive = UCD_NONE;

/*
 * The parser sometimes needs to indicate to the lexor that the next
 * identifier needs to be understood in the context of a package. The
 * parser feeds back that left context with calls to the
 * lex_in_package_scope.
 */
static PPackage* in_package_scope = 0;
void lex_in_package_scope(PPackage*pkg)
{
      in_package_scope = pkg;
}

#line 1441 "<stdout>"

#line 1443 "<stdout>"

#define INITIAL 0
#define CCOMMENT 1
#define PCOMMENT 2
#define LCOMMENT 3
#define CSTRING 4
#define UDPTABLE 5
#define PPTIMESCALE 6
#define PPUCDRIVE 7
#define PPDEFAULT_NETTYPE 8
#define PPBEGIN_KEYWORDS 9
#define EDGES 10
#define REAL_SCALE 11

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

int yyget_debug ( void );

void yyset_debug ( int debug_flag  );

YY_EXTRA_TYPE yyget_extra ( void );

void yyset_extra ( YY_EXTRA_TYPE user_defined  );

FILE *yyget_in ( void );

void yyset_in  ( FILE * _in_str  );

FILE *yyget_out ( void );

void yyset_out  ( FILE * _out_str  );

			yy_size_t yyget_leng ( void );

char *yyget_text ( void );

int yyget_lineno ( void );

void yyset_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 yywrap ( void );
#else
extern int yywrap ( void );
#endif
#endif

#ifndef YY_NO_UNPUT
    
#endif

#ifndef yytext_ptr
static void yy_flex_strncpy ( char *, const char *, int );
#endif

#ifdef YY_NEED_STRLEN
static int yy_flex_strlen ( const 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
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k */
#define YY_READ_BUF_SIZE 16384
#else
#define YY_READ_BUF_SIZE 8192
#endif /* __ia64__ */
#endif

/* Copy whatever the last rule matched to the standard output. */
#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
 * we now use fwrite().
 */
#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
#endif

/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
 * is returned in "result".
 */
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
		{ \
		int c = '*'; \
		yy_size_t n; \
		for ( n = 0; n < max_size && \
			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
			buf[n] = (char) c; \
		if ( c == '\n' ) \
			buf[n++] = (char) c; \
		if ( c == EOF && ferror( yyin ) ) \
			YY_FATAL_ERROR( "input in flex scanner failed" ); \
		result = n; \
		} \
	else \
		{ \
		errno=0; \
		while ( (result = fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
			{ \
			if( errno != EINTR) \
				{ \
				YY_FATAL_ERROR( "input in flex scanner failed" ); \
				break; \
				} \
			errno=0; \
			clearerr(yyin); \
			} \
		}\
\

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

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

/* Code executed at the beginning of each rule, after yytext and yyleng
 * 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 /*LINTED*/break;
#endif

#define YY_RULE_SETUP \
	if ( yyleng > 0 ) \
		YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
				(yytext[yyleng - 1] == '\n'); \
	YY_USER_ACTION

/** The main scanner function which does all the work.
 */
YY_DECL
{
	yy_state_type yy_current_state;
	char *yy_cp, *yy_bp;
	int yy_act;
    
	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 *)yyalloc(YY_STATE_BUF_SIZE  );
            if ( ! (yy_state_buf) )
                YY_FATAL_ERROR( "out of dynamic memory in yylex()" );

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

		if ( ! yyin )
			yyin = stdin;

		if ( ! yyout )
			yyout = stdout;

		if ( ! YY_CURRENT_BUFFER ) {
			yyensure_buffer_stack ();
			YY_CURRENT_BUFFER_LVALUE =
				yy_create_buffer( yyin, YY_BUF_SIZE );
		}

		yy_load_buffer_state(  );
		}

	{
#line 127 "lexor.lex"


#line 130 "lexor.lex"
  /* Recognize the various line directives. */
#line 1683 "<stdout>"

	while ( /*CONSTCOND*/1 )		/* loops until end-of-file is reached */
		{
		(yy_more_len) = 0;
		if ( (yy_more_flag) )
			{
			(yy_more_len) = (int) ((yy_c_buf_p) - (yytext_ptr));
			(yy_more_flag) = 0;
			}
		yy_cp = (yy_c_buf_p);

		/* Support of yytext. */
		*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
			{
			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 >= 653 )
					yy_c = yy_meta[yy_c];
				}
			yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
			*(yy_state_ptr)++ = yy_current_state;
			++yy_cp;
			}
		while ( yy_current_state != 652 );

yy_find_action:
		yy_current_state = *--(yy_state_ptr);
		(yy_lp) = yy_accept[yy_current_state];

find_rule: /* we branch to this label when backing up */

		for ( ; ; ) /* until we find what rule we matched */
			{
			if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] )
				{
				yy_act = yy_acclist[(yy_lp)];
					{
					(yy_full_match) = yy_cp;
					break;
					}
				}
			--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 131 "lexor.lex"
{ line_directive(); }
	YY_BREAK
case 2:
YY_RULE_SETUP
#line 132 "lexor.lex"
{ line_directive2(); }
	YY_BREAK
case 3:
YY_RULE_SETUP
#line 134 "lexor.lex"
{ ; }
	YY_BREAK
case 4:
/* rule 4 can match eol */
YY_RULE_SETUP
#line 135 "lexor.lex"
{ yylloc.first_line += 1; }
	YY_BREAK
/* C++ style comments start with / / and run to the end of the
     current line. These are very easy to handle. The meta-comments
     format is a little more tricky to handle, but do what we can. */
/* The lexor detects "// synthesis translate_on/off" meta-comments,
     we handle them here by turning on/off a flag. The pform uses
     that flag to attach implicit attributes to "initial" and
     "always" statements. */
case 5:
/* rule 5 can match eol */
YY_RULE_SETUP
#line 146 "lexor.lex"
{ pform_mc_translate_on(true); }
	YY_BREAK
case 6:
/* rule 6 can match eol */
YY_RULE_SETUP
#line 147 "lexor.lex"
{ pform_mc_translate_on(false); }
	YY_BREAK
case 7:
YY_RULE_SETUP
#line 148 "lexor.lex"
{ comment_enter = YY_START; BEGIN(LCOMMENT); }
	YY_BREAK
case 8:
YY_RULE_SETUP
#line 149 "lexor.lex"
{ yymore(); }
	YY_BREAK
case 9:
/* rule 9 can match eol */
YY_RULE_SETUP
#line 150 "lexor.lex"
{ yylloc.first_line += 1; BEGIN(comment_enter); }
	YY_BREAK
/* The contents of C-style comments are ignored, like white space. */
case 10:
YY_RULE_SETUP
#line 155 "lexor.lex"
{ comment_enter = YY_START; BEGIN(CCOMMENT); }
	YY_BREAK
case 11:
YY_RULE_SETUP
#line 156 "lexor.lex"
{ ; }
	YY_BREAK
case 12:
/* rule 12 can match eol */
YY_RULE_SETUP
#line 157 "lexor.lex"
{ yylloc.first_line += 1; }
	YY_BREAK
case 13:
YY_RULE_SETUP
#line 158 "lexor.lex"
{ BEGIN(comment_enter); }
	YY_BREAK
case 14:
YY_RULE_SETUP
#line 161 "lexor.lex"
{ return K_PSTAR; }
	YY_BREAK
case 15:
YY_RULE_SETUP
#line 162 "lexor.lex"
{ return K_STARP; }
	YY_BREAK
case 16:
YY_RULE_SETUP
#line 163 "lexor.lex"
{ return K_DOTSTAR; }
	YY_BREAK
case 17:
YY_RULE_SETUP
#line 164 "lexor.lex"
{ return K_LS; }
	YY_BREAK
case 18:
YY_RULE_SETUP
#line 165 "lexor.lex"
{ return K_LS; /* Note: Functionally, <<< is the same as <<. */}
	YY_BREAK
case 19:
YY_RULE_SETUP
#line 166 "lexor.lex"
{ return K_RS; }
	YY_BREAK
case 20:
YY_RULE_SETUP
#line 167 "lexor.lex"
{ return K_RSS; }
	YY_BREAK
case 21:
YY_RULE_SETUP
#line 168 "lexor.lex"
{ return K_POW; }
	YY_BREAK
case 22:
YY_RULE_SETUP
#line 169 "lexor.lex"
{ return K_LE; }
	YY_BREAK
case 23:
YY_RULE_SETUP
#line 170 "lexor.lex"
{ return K_GE; }
	YY_BREAK
case 24:
YY_RULE_SETUP
#line 171 "lexor.lex"
{ return K_EG; }
	YY_BREAK
case 25:
YY_RULE_SETUP
#line 172 "lexor.lex"
{
			/*
			 * Resolve the ambiguity between the += assignment
			 * operator and +=> polarity edge path operator
			 *
			 * +=> should be treated as two separate tokens '+' and
			 * '=>' (K_EG), therefore we only consume the first
			 * character of the matched pattern i.e. either + or -
			 * and push back the rest of the matches text (=>) in
			 * the input stream.
			 */
			yyless(1);
			return yytext[0];
		}
	YY_BREAK
case 26:
YY_RULE_SETUP
#line 186 "lexor.lex"
{ return K_SG; }
	YY_BREAK
case 27:
YY_RULE_SETUP
#line 187 "lexor.lex"
{ return K_EQ; }
	YY_BREAK
case 28:
YY_RULE_SETUP
#line 188 "lexor.lex"
{ return K_NE; }
	YY_BREAK
case 29:
YY_RULE_SETUP
#line 189 "lexor.lex"
{ return K_CEQ; }
	YY_BREAK
case 30:
YY_RULE_SETUP
#line 190 "lexor.lex"
{ return K_CNE; }
	YY_BREAK
case 31:
YY_RULE_SETUP
#line 191 "lexor.lex"
{ return K_LOR; }
	YY_BREAK
case 32:
YY_RULE_SETUP
#line 192 "lexor.lex"
{ return K_LAND; }
	YY_BREAK
case 33:
YY_RULE_SETUP
#line 193 "lexor.lex"
{ return K_TAND; }
	YY_BREAK
case 34:
YY_RULE_SETUP
#line 194 "lexor.lex"
{ return K_NOR; }
	YY_BREAK
case 35:
YY_RULE_SETUP
#line 195 "lexor.lex"
{ return K_NXOR; }
	YY_BREAK
case 36:
YY_RULE_SETUP
#line 196 "lexor.lex"
{ return K_NXOR; }
	YY_BREAK
case 37:
YY_RULE_SETUP
#line 197 "lexor.lex"
{ return K_NAND; }
	YY_BREAK
case 38:
YY_RULE_SETUP
#line 198 "lexor.lex"
{ return K_TRIGGER; }
	YY_BREAK
case 39:
YY_RULE_SETUP
#line 199 "lexor.lex"
{ return K_PO_POS; }
	YY_BREAK
case 40:
YY_RULE_SETUP
#line 200 "lexor.lex"
{ return K_PO_NEG; }
	YY_BREAK
case 41:
YY_RULE_SETUP
#line 201 "lexor.lex"
{ return K_CONTRIBUTE; }
	YY_BREAK
case 42:
YY_RULE_SETUP
#line 202 "lexor.lex"
{ return K_PLUS_EQ; }
	YY_BREAK
case 43:
YY_RULE_SETUP
#line 203 "lexor.lex"
{ return K_MINUS_EQ; }
	YY_BREAK
case 44:
YY_RULE_SETUP
#line 204 "lexor.lex"
{ return K_MUL_EQ; }
	YY_BREAK
case 45:
YY_RULE_SETUP
#line 205 "lexor.lex"
{ return K_DIV_EQ; }
	YY_BREAK
case 46:
YY_RULE_SETUP
#line 206 "lexor.lex"
{ return K_MOD_EQ; }
	YY_BREAK
case 47:
YY_RULE_SETUP
#line 207 "lexor.lex"
{ return K_AND_EQ; }
	YY_BREAK
case 48:
YY_RULE_SETUP
#line 208 "lexor.lex"
{ return K_OR_EQ; }
	YY_BREAK
case 49:
YY_RULE_SETUP
#line 209 "lexor.lex"
{ return K_XOR_EQ; }
	YY_BREAK
case 50:
YY_RULE_SETUP
#line 210 "lexor.lex"
{ return K_LS_EQ; }
	YY_BREAK
case 51:
YY_RULE_SETUP
#line 211 "lexor.lex"
{ return K_RS_EQ; }
	YY_BREAK
case 52:
YY_RULE_SETUP
#line 212 "lexor.lex"
{ return K_LS_EQ; }
	YY_BREAK
case 53:
YY_RULE_SETUP
#line 213 "lexor.lex"
{ return K_RSS_EQ; }
	YY_BREAK
case 54:
YY_RULE_SETUP
#line 214 "lexor.lex"
{ return K_INCR; }
	YY_BREAK
case 55:
YY_RULE_SETUP
#line 215 "lexor.lex"
{return K_DECR; }
	YY_BREAK
case 56:
YY_RULE_SETUP
#line 216 "lexor.lex"
{ return K_LP; }
	YY_BREAK
case 57:
YY_RULE_SETUP
#line 217 "lexor.lex"
{ return K_SCOPE_RES; }
	YY_BREAK
/* Watch out for the tricky case of (*). Cannot parse this as "(*"
     and ")", but since I know that this is really ( * ), replace it
     with "*" and return that. */
case 58:
YY_RULE_SETUP
#line 222 "lexor.lex"
{ return '*'; }
	YY_BREAK
case 59:
YY_RULE_SETUP
#line 224 "lexor.lex"
{ BEGIN(0); return yytext[0]; }
	YY_BREAK
case 60:
YY_RULE_SETUP
#line 225 "lexor.lex"
{ return yytext[0]; }
	YY_BREAK
case 61:
YY_RULE_SETUP
#line 227 "lexor.lex"
{ BEGIN(CSTRING); }
	YY_BREAK
case 62:
YY_RULE_SETUP
#line 228 "lexor.lex"
{ yymore(); /* Catch \\, which is a \ escaping itself */ }
	YY_BREAK
case 63:
YY_RULE_SETUP
#line 229 "lexor.lex"
{ yymore(); /* Catch \", which is an escaped quote */ }
	YY_BREAK
case 64:
/* rule 64 can match eol */
YY_RULE_SETUP
#line 230 "lexor.lex"
{ BEGIN(0);
                yylval.text = strdupnew(yytext);
		VLerror(yylloc, "Missing close quote of string.");
		yylloc.first_line += 1;
		return STRING; }
	YY_BREAK
case 65:
YY_RULE_SETUP
#line 235 "lexor.lex"
{ BEGIN(0);
                yylval.text = strdupnew(yytext);
		yylval.text[strlen(yytext)-1] = 0;
		return STRING; }
	YY_BREAK
case 66:
YY_RULE_SETUP
#line 239 "lexor.lex"
{ yymore(); }
	YY_BREAK
/* The UDP Table is a unique lexical environment. These are most
     tokens that we can expect in a table. */
case 67:
YY_RULE_SETUP
#line 243 "lexor.lex"
{ return '_'; }
	YY_BREAK
case 68:
YY_RULE_SETUP
#line 244 "lexor.lex"
{ return '+'; }
	YY_BREAK
case 69:
YY_RULE_SETUP
#line 245 "lexor.lex"
{ return '%'; }
	YY_BREAK
case 70:
YY_RULE_SETUP
#line 246 "lexor.lex"
{ return '*'; }
	YY_BREAK
case 71:
YY_RULE_SETUP
#line 247 "lexor.lex"
{ return 'r'; }
	YY_BREAK
case 72:
YY_RULE_SETUP
#line 248 "lexor.lex"
{ return 'Q'; }
	YY_BREAK
case 73:
YY_RULE_SETUP
#line 249 "lexor.lex"
{ return 'q'; }
	YY_BREAK
case 74:
YY_RULE_SETUP
#line 250 "lexor.lex"
{ return 'f'; /* b0 is 10|00, but only 10 is meaningful */}
	YY_BREAK
case 75:
YY_RULE_SETUP
#line 251 "lexor.lex"
{ return 'r'; /* b1 is 11|01, but only 01 is meaningful */}
	YY_BREAK
case 76:
YY_RULE_SETUP
#line 252 "lexor.lex"
{ return 'P'; }
	YY_BREAK
case 77:
YY_RULE_SETUP
#line 253 "lexor.lex"
{ return 'f'; }
	YY_BREAK
case 78:
YY_RULE_SETUP
#line 254 "lexor.lex"
{ return 'M'; }
	YY_BREAK
case 79:
YY_RULE_SETUP
#line 255 "lexor.lex"
{ return 'N'; }
	YY_BREAK
case 80:
YY_RULE_SETUP
#line 256 "lexor.lex"
{ return 'F'; }
	YY_BREAK
case 81:
YY_RULE_SETUP
#line 257 "lexor.lex"
{ return 'R'; }
	YY_BREAK
case 82:
YY_RULE_SETUP
#line 258 "lexor.lex"
{ return 'B'; }
	YY_BREAK
case 83:
YY_RULE_SETUP
#line 259 "lexor.lex"
{ return 'b'; }
	YY_BREAK
case 84:
YY_RULE_SETUP
#line 260 "lexor.lex"
{ return 'l'; /* IVL extension */ }
	YY_BREAK
case 85:
YY_RULE_SETUP
#line 261 "lexor.lex"
{ return 'h'; /* IVL extension */ }
	YY_BREAK
case 86:
YY_RULE_SETUP
#line 262 "lexor.lex"
{ return 'f'; }
	YY_BREAK
case 87:
YY_RULE_SETUP
#line 263 "lexor.lex"
{ return 'r'; }
	YY_BREAK
case 88:
YY_RULE_SETUP
#line 264 "lexor.lex"
{ return 'x'; }
	YY_BREAK
case 89:
YY_RULE_SETUP
#line 265 "lexor.lex"
{ return 'n'; }
	YY_BREAK
case 90:
YY_RULE_SETUP
#line 266 "lexor.lex"
{ return 'p'; }
	YY_BREAK
case 91:
YY_RULE_SETUP
#line 267 "lexor.lex"
{ return yytext[0]; }
	YY_BREAK
case 92:
YY_RULE_SETUP
#line 269 "lexor.lex"
{ return K_edge_descriptor; }
	YY_BREAK
case 93:
YY_RULE_SETUP
#line 270 "lexor.lex"
{ return K_edge_descriptor; }
	YY_BREAK
case 94:
YY_RULE_SETUP
#line 271 "lexor.lex"
{ return K_edge_descriptor; }
	YY_BREAK
case 95:
YY_RULE_SETUP
#line 272 "lexor.lex"
{ return K_edge_descriptor; }
	YY_BREAK
case 96:
YY_RULE_SETUP
#line 273 "lexor.lex"
{ return K_edge_descriptor; }
	YY_BREAK
case 97:
YY_RULE_SETUP
#line 274 "lexor.lex"
{ return K_edge_descriptor; }
	YY_BREAK
case 98:
YY_RULE_SETUP
#line 275 "lexor.lex"
{ return K_edge_descriptor; }
	YY_BREAK
case 99:
YY_RULE_SETUP
#line 276 "lexor.lex"
{ return K_edge_descriptor; }
	YY_BREAK
case 100:
YY_RULE_SETUP
#line 277 "lexor.lex"
{ return K_edge_descriptor; }
	YY_BREAK
case 101:
YY_RULE_SETUP
#line 278 "lexor.lex"
{ return K_edge_descriptor; }
	YY_BREAK
case 102:
YY_RULE_SETUP
#line 280 "lexor.lex"
{
      int rc = lexor_keyword_code(yytext, yyleng);
      switch (rc) {
	  case IDENTIFIER:
	    yylval.text = strdupnew(yytext);
	    if (strncmp(yylval.text,"PATHPULSE$", 10) == 0)
		  rc = PATHPULSE_IDENTIFIER;
	    break;

	  case K_edge:
	    BEGIN(EDGES);
	    break;

	  case K_module:
	  case K_macromodule:
	    in_module = true;
	    break;

	  case K_endmodule:
	    in_module = false;
	    break;

	  case K_primitive:
	    in_UDP = true;
	    break;

	  case K_endprimitive:
	    in_UDP = false;
	    break;

	  case K_table:
	    BEGIN(UDPTABLE);
	    break;

	    /* Translate these to checks if we already have or are
	     * outside the declaration region. */
	  case K_timeunit:
	    if (have_timeunit_decl) rc = K_timeunit_check;
	    break;
	  case K_timeprecision:
	    if (have_timeprec_decl) rc = K_timeprecision_check;
	    break;

	  default:
	    yylval.text = 0;
	    break;
      }

	/* Special case: If this is part of a scoped name, then check
	   the package for identifier details. For example, if the
	   source file is  foo::bar, the parse.y will note the
	   PACKAGE_IDENTIFIER and "::" token and mark the
	   "in_package_scope" variable. Then this lexor will see the
	   identifier here and interpret it in the package scope. */
      if (in_package_scope) {
	    if (rc == IDENTIFIER) {
		  if (data_type_t*type = pform_test_type_identifier(in_package_scope, yylval.text)) {
			yylval.type_identifier.text = yylval.text;
			yylval.type_identifier.type = type;
			rc = TYPE_IDENTIFIER;
		  }
	    }
	    in_package_scope = 0;
	    return rc;
      }

	/* If this identifier names a discipline, then return this as
	   a DISCIPLINE_IDENTIFIER and return the discipline as the
	   value instead. */
      if (rc == IDENTIFIER && gn_verilog_ams_flag) {
	    perm_string tmp = lex_strings.make(yylval.text);
	    map<perm_string,ivl_discipline_t>::iterator cur = disciplines.find(tmp);
	    if (cur != disciplines.end()) {
		  delete[]yylval.text;
		  yylval.discipline = (*cur).second;
		  rc = DISCIPLINE_IDENTIFIER;
	    }
      }

	/* If this identifier names a previously declared package, then
	   return this as a PACKAGE_IDENTIFIER instead. */
      if (rc == IDENTIFIER && gn_system_verilog()) {
	    if (PPackage*pkg = pform_test_package_identifier(yylval.text)) {
		  delete[]yylval.text;
		  yylval.package = pkg;
		  rc = PACKAGE_IDENTIFIER;
	    }
      }

	/* If this identifier names a previously declared type, then
	   return this as a TYPE_IDENTIFIER instead. */
      if (rc == IDENTIFIER && gn_system_verilog()) {
	    if (data_type_t*type = pform_test_type_identifier(yylval.text)) {
		  yylval.type_identifier.text = yylval.text;
		  yylval.type_identifier.type = type;
		  rc = TYPE_IDENTIFIER;
	    }
      }

      return rc;
  }
	YY_BREAK
case 103:
YY_RULE_SETUP
#line 383 "lexor.lex"
{
      yylval.text = strdupnew(yytext+1);
      if (gn_system_verilog()) {
	    if (PPackage*pkg = pform_test_package_identifier(yylval.text)) {
		  delete[]yylval.text;
		  yylval.package = pkg;
		  return PACKAGE_IDENTIFIER;
	    }
      }
      if (gn_system_verilog()) {
	    if (data_type_t*type = pform_test_type_identifier(yylval.text)) {
		  yylval.type_identifier.text = yylval.text;
		  yylval.type_identifier.type = type;
		  return TYPE_IDENTIFIER;
	    }
      }
      return IDENTIFIER;
  }
	YY_BREAK
case 104:
YY_RULE_SETUP
#line 402 "lexor.lex"
{
	/* The 1364-1995 timing checks. */
      if (strcmp(yytext,"$hold") == 0)
	    return K_Shold;
      if (strcmp(yytext,"$nochange") == 0)
	    return K_Snochange;
      if (strcmp(yytext,"$period") == 0)
	    return K_Speriod;
      if (strcmp(yytext,"$recovery") == 0)
	    return K_Srecovery;
      if (strcmp(yytext,"$setup") == 0)
	    return K_Ssetup;
      if (strcmp(yytext,"$setuphold") == 0)
	    return K_Ssetuphold;
      if (strcmp(yytext,"$skew") == 0)
	    return K_Sskew;
      if (strcmp(yytext,"$width") == 0)
	    return K_Swidth;
	/* The new 1364-2001 timing checks. */
      if (strcmp(yytext,"$fullskew") == 0)
	    return K_Sfullskew;
      if (strcmp(yytext,"$recrem") == 0)
	    return K_Srecrem;
      if (strcmp(yytext,"$removal") == 0)
	    return K_Sremoval;
      if (strcmp(yytext,"$timeskew") == 0)
	    return K_Stimeskew;

      if (strcmp(yytext,"$attribute") == 0)
	    return KK_attribute;
      yylval.text = strdupnew(yytext);
      return SYSTEM_IDENTIFIER; }
	YY_BREAK
case 105:
YY_RULE_SETUP
#line 436 "lexor.lex"
{
      yylval.number = make_unsized_dec(yytext);
      return BASED_NUMBER;
}
	YY_BREAK
case 106:
YY_RULE_SETUP
#line 440 "lexor.lex"
{
      yylval.number = make_undef_highz_dec(yytext);
      return BASED_NUMBER;
}
	YY_BREAK
case 107:
YY_RULE_SETUP
#line 444 "lexor.lex"
{
      yylval.number = make_unsized_binary(yytext);
      return BASED_NUMBER;
}
	YY_BREAK
case 108:
YY_RULE_SETUP
#line 448 "lexor.lex"
{
      yylval.number = make_unsized_octal(yytext);
      return BASED_NUMBER;
}
	YY_BREAK
case 109:
YY_RULE_SETUP
#line 452 "lexor.lex"
{
      yylval.number = make_unsized_hex(yytext);
      return BASED_NUMBER;
}
	YY_BREAK
case 110:
YY_RULE_SETUP
#line 456 "lexor.lex"
{
      if (generation_flag < GN_VER2005_SV) {
	    cerr << yylloc.text << ":" << yylloc.first_line << ": warning: "
		 << "Using SystemVerilog 'N bit vector.  Use at least "
		 << "-g2005-sv to remove this warning." << endl;
      }
      generation_t generation_save = generation_flag;
      generation_flag = GN_VER2005_SV;
      yylval.number = make_unsized_binary(yytext);
      generation_flag = generation_save;
      return UNBASED_NUMBER; }
	YY_BREAK
/* Decimal numbers are the usual. But watch out for the UDPTABLE
     mode, where there are no decimal numbers. Reject the match if we
     are in the UDPTABLE state. */
case 111:
YY_RULE_SETUP
#line 471 "lexor.lex"
{
      if (YY_START==UDPTABLE) {
	    REJECT;
      } else {
	    yylval.number = make_unsized_dec(yytext);
	    based_size = yylval.number->as_ulong();
	    return DEC_NUMBER;
      }
}
	YY_BREAK
/* This rule handles scaled time values for SystemVerilog. */
case 112:
YY_RULE_SETUP
#line 482 "lexor.lex"
{
      if(generation_flag & (GN_VER2005_SV | GN_VER2009 | GN_VER2012)) {
	    yylval.text = strdupnew(yytext);
	    return TIME_LITERAL;
      } else REJECT; }
	YY_BREAK
/* These rules handle the scaled real literals from Verilog-AMS. The
     value is a number with a single letter scale factor. If
     verilog-ams is not enabled, then reject this rule. If it is
     enabled, then collect the scale and use it to scale the value. */
case 113:
*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
(yy_c_buf_p) = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
#line 492 "lexor.lex"
{
      if (!gn_verilog_ams_flag) REJECT;
      BEGIN(REAL_SCALE);
      yymore();  }
	YY_BREAK
case 114:
*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
(yy_c_buf_p) = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
#line 497 "lexor.lex"
{
      if (!gn_verilog_ams_flag) REJECT;
      BEGIN(REAL_SCALE);
      yymore();  }
	YY_BREAK
case 115:
YY_RULE_SETUP
#line 502 "lexor.lex"
{
      size_t token_len = strlen(yytext);
      char*tmp = new char[token_len + 5];
      int scale = 0;
      strcpy(tmp, yytext);
      switch (tmp[token_len-1]) {
	  case 'a': scale = -18; break; /* atto- */
	  case 'f': scale = -15; break; /* femto- */
	  case 'p': scale = -12; break; /* pico- */
	  case 'n': scale = -9;  break; /* nano- */
	  case 'u': scale = -6;  break; /* micro- */
	  case 'm': scale = -3;  break; /* milli- */
	  case 'k': scale = 3;  break; /* kilo- */
	  case 'K': scale = 3;  break; /* kilo- */
	  case 'M': scale = 6;  break; /* mega- */
	  case 'G': scale = 9;  break; /* giga- */
	  case 'T': scale = 12; break; /* tera- */
	  default: assert(0); break;
      }
      snprintf(tmp+token_len-1, 5, "e%d", scale);
      yylval.realtime = new verireal(tmp);
      delete[]tmp;

      BEGIN(0);
      return REALTIME;  }
	YY_BREAK
case 116:
YY_RULE_SETUP
#line 528 "lexor.lex"
{
      yylval.realtime = new verireal(yytext);
      return REALTIME; }
	YY_BREAK
case 117:
YY_RULE_SETUP
#line 532 "lexor.lex"
{
      yylval.realtime = new verireal(yytext);
      return REALTIME; }
	YY_BREAK
/* Notice and handle the `timescale directive. */
case 118:
YY_RULE_SETUP
#line 539 "lexor.lex"
{ BEGIN(PPTIMESCALE); }
	YY_BREAK
case 119:
YY_RULE_SETUP
#line 540 "lexor.lex"
{ process_timescale(yytext); }
	YY_BREAK
case 120:
/* rule 120 can match eol */
YY_RULE_SETUP
#line 541 "lexor.lex"
{
      if (in_module) {
	    cerr << yylloc.text << ":" << yylloc.first_line << ": error: "
		    "`timescale directive can not be inside a module "
		    "definition." << endl;
	    error_count += 1;
      }
      yylloc.first_line += 1;
      BEGIN(0); }
	YY_BREAK
/* Notice and handle the `celldefine and `endcelldefine directives. */
case 121:
YY_RULE_SETUP
#line 553 "lexor.lex"
{ in_celldefine = true; }
	YY_BREAK
case 122:
YY_RULE_SETUP
#line 554 "lexor.lex"
{ in_celldefine = false; }
	YY_BREAK
/* Notice and handle the resetall directive. */
case 123:
YY_RULE_SETUP
#line 558 "lexor.lex"
{
      if (in_module) {
	    cerr << yylloc.text << ":" << yylloc.first_line << ": error: "
		    "`resetall directive can not be inside a module "
		    "definition." << endl;
	    error_count += 1;
      } else if (in_UDP) {
	    cerr << yylloc.text << ":" << yylloc.first_line << ": error: "
		    "`resetall directive can not be inside a UDP "
		    "definition." << endl;
	    error_count += 1;
      } else {
	    pform_set_default_nettype(NetNet::WIRE, yylloc.text,
	                              yylloc.first_line);
	    in_celldefine = false;
	    uc_drive = UCD_NONE;
	    pform_set_timescale(def_ts_units, def_ts_prec, 0, 0);
      } }
	YY_BREAK
/* Notice and handle the `unconnected_drive directive. */
case 124:
YY_RULE_SETUP
#line 578 "lexor.lex"
{ BEGIN(PPUCDRIVE); }
	YY_BREAK
case 125:
YY_RULE_SETUP
#line 579 "lexor.lex"
{ process_ucdrive(yytext); }
	YY_BREAK
case 126:
/* rule 126 can match eol */
YY_RULE_SETUP
#line 580 "lexor.lex"
{
      if (in_module) {
	    cerr << yylloc.text << ":" << yylloc.first_line << ": error: "
		    "`unconnected_drive directive can not be inside a "
		    "module definition." << endl;
	    error_count += 1;
      }
      yylloc.first_line += 1;
      BEGIN(0); }
	YY_BREAK
case 127:
YY_RULE_SETUP
#line 590 "lexor.lex"
{
      if (in_module) {
	    cerr << yylloc.text << ":" << yylloc.first_line << ": error: "
		    "`nounconnected_drive directive can not be inside a "
		    "module definition." << endl;
	    error_count += 1;
      }
      uc_drive = UCD_NONE; }
	YY_BREAK
/* These are directives that I do not yet support. I think that IVL
     should handle these, not an external preprocessor. */
/* From 1364-2005 Chapter 19. */
case 128:
YY_RULE_SETUP
#line 602 "lexor.lex"
{  }
	YY_BREAK
/* From 1364-2005 Annex D. */
case 129:
YY_RULE_SETUP
#line 605 "lexor.lex"
{  }
	YY_BREAK
case 130:
YY_RULE_SETUP
#line 606 "lexor.lex"
{  }
	YY_BREAK
case 131:
YY_RULE_SETUP
#line 607 "lexor.lex"
{  }
	YY_BREAK
case 132:
YY_RULE_SETUP
#line 608 "lexor.lex"
{  }
	YY_BREAK
case 133:
YY_RULE_SETUP
#line 609 "lexor.lex"
{  }
	YY_BREAK
case 134:
YY_RULE_SETUP
#line 610 "lexor.lex"
{  }
	YY_BREAK
/* From other places. */
case 135:
YY_RULE_SETUP
#line 613 "lexor.lex"
{  }
	YY_BREAK
case 136:
YY_RULE_SETUP
#line 614 "lexor.lex"
{  }
	YY_BREAK
case 137:
YY_RULE_SETUP
#line 615 "lexor.lex"
{  }
	YY_BREAK
case 138:
YY_RULE_SETUP
#line 616 "lexor.lex"
{  }
	YY_BREAK
case 139:
YY_RULE_SETUP
#line 617 "lexor.lex"
{  }
	YY_BREAK
case 140:
YY_RULE_SETUP
#line 618 "lexor.lex"
{  }
	YY_BREAK
case 141:
YY_RULE_SETUP
#line 619 "lexor.lex"
{  }
	YY_BREAK
case 142:
YY_RULE_SETUP
#line 621 "lexor.lex"
{ BEGIN(PPBEGIN_KEYWORDS); }
	YY_BREAK
case 143:
YY_RULE_SETUP
#line 623 "lexor.lex"
{
      keyword_mask_stack.push_front(lexor_keyword_mask);

      char*word = yytext+1;
      char*tail = strchr(word, '"');
      tail[0] = 0;
      if (strcmp(word,"1364-1995") == 0) {
	    lexor_keyword_mask = GN_KEYWORDS_1364_1995;
      } else if (strcmp(word,"1364-2001") == 0) {
	    lexor_keyword_mask = GN_KEYWORDS_1364_1995
		                |GN_KEYWORDS_1364_2001
		                |GN_KEYWORDS_1364_2001_CONFIG;
      } else if (strcmp(word,"1364-2001-noconfig") == 0) {
	    lexor_keyword_mask = GN_KEYWORDS_1364_1995
		                |GN_KEYWORDS_1364_2001;
      } else if (strcmp(word,"1364-2005") == 0) {
	    lexor_keyword_mask = GN_KEYWORDS_1364_1995
		                |GN_KEYWORDS_1364_2001
		                |GN_KEYWORDS_1364_2001_CONFIG
		                |GN_KEYWORDS_1364_2005;
      } else if (strcmp(word,"1800-2005") == 0) {
	    lexor_keyword_mask = GN_KEYWORDS_1364_1995
		                |GN_KEYWORDS_1364_2001
		                |GN_KEYWORDS_1364_2001_CONFIG
		                |GN_KEYWORDS_1364_2005
		                |GN_KEYWORDS_1800_2005;
      } else if (strcmp(word,"1800-2009") == 0) {
	    lexor_keyword_mask = GN_KEYWORDS_1364_1995
		                |GN_KEYWORDS_1364_2001
		                |GN_KEYWORDS_1364_2001_CONFIG
		                |GN_KEYWORDS_1364_2005
		                |GN_KEYWORDS_1800_2005
		                |GN_KEYWORDS_1800_2009;
      } else if (strcmp(word,"1800-2012") == 0) {
	    lexor_keyword_mask = GN_KEYWORDS_1364_1995
		                |GN_KEYWORDS_1364_2001
		                |GN_KEYWORDS_1364_2001_CONFIG
		                |GN_KEYWORDS_1364_2005
		                |GN_KEYWORDS_1800_2005
		                |GN_KEYWORDS_1800_2009
		                |GN_KEYWORDS_1800_2012;
      } else if (strcmp(word,"VAMS-2.3") == 0) {
	    lexor_keyword_mask = GN_KEYWORDS_1364_1995
		                |GN_KEYWORDS_1364_2001
		                |GN_KEYWORDS_1364_2001_CONFIG
		                |GN_KEYWORDS_1364_2005
		                |GN_KEYWORDS_VAMS_2_3;
      } else {
	    fprintf(stderr, "%s:%d: Ignoring unknown keywords string: %s\n",
		    yylloc.text, yylloc.first_line, word);
      }
      BEGIN(0);
 }
	YY_BREAK
case 144:
YY_RULE_SETUP
#line 677 "lexor.lex"
{
      fprintf(stderr, "%s:%d: Malformed keywords specification: %s\n",
	      yylloc.text, yylloc.first_line, yytext);
      BEGIN(0);
 }
	YY_BREAK
case 145:
YY_RULE_SETUP
#line 683 "lexor.lex"
{
      if (!keyword_mask_stack.empty()) {
	    lexor_keyword_mask = keyword_mask_stack.front();
	    keyword_mask_stack.pop_front();
      } else {
	    fprintf(stderr, "%s:%d: Mismatched end_keywords directive\n",
		    yylloc.text, yylloc.first_line);
      }
 }
	YY_BREAK
/* Notice and handle the default_nettype directive. The lexor
     detects the default_nettype keyword, and the second part of the
     rule collects the rest of the line and processes it. We only need
     to look for the first work, and interpret it. */
case 146:
YY_RULE_SETUP
#line 698 "lexor.lex"
{ BEGIN(PPDEFAULT_NETTYPE); }
	YY_BREAK
case 147:
YY_RULE_SETUP
#line 699 "lexor.lex"
{
      NetNet::Type net_type;
      size_t wordlen = strcspn(yytext, " \t\f\r\n");
      yytext[wordlen] = 0;
  /* Add support for other wire types and better error detection. */
      if (strcmp(yytext,"wire") == 0) {
	    net_type = NetNet::WIRE;

      } else if (strcmp(yytext,"tri") == 0) {
	    net_type = NetNet::TRI;

      } else if (strcmp(yytext,"tri0") == 0) {
	    net_type = NetNet::TRI0;

      } else if (strcmp(yytext,"tri1") == 0) {
	    net_type = NetNet::TRI1;

      } else if (strcmp(yytext,"wand") == 0) {
	    net_type = NetNet::WAND;

      } else if (strcmp(yytext,"triand") == 0) {
	    net_type = NetNet::TRIAND;

      } else if (strcmp(yytext,"wor") == 0) {
	    net_type = NetNet::WOR;

      } else if (strcmp(yytext,"trior") == 0) {
	    net_type = NetNet::TRIOR;

      } else if (strcmp(yytext,"none") == 0) {
	    net_type = NetNet::NONE;

      } else {
	    cerr << yylloc.text << ":" << yylloc.first_line
		 << ": error: Net type " << yytext
		 << " is not a valid (or supported)"
		 << " default net type." << endl;
	    net_type = NetNet::WIRE;
	    error_count += 1;
      }
      pform_set_default_nettype(net_type, yylloc.text, yylloc.first_line);
  }
	YY_BREAK
case 148:
/* rule 148 can match eol */
YY_RULE_SETUP
#line 741 "lexor.lex"
{
      yylloc.first_line += 1;
      BEGIN(0); }
	YY_BREAK
/* These are directives that are not supported by me and should have
     been handled by an external preprocessor such as ivlpp. */
case 149:
YY_RULE_SETUP
#line 749 "lexor.lex"
{
      cerr << yylloc.text << ":" << yylloc.first_line <<
	    ": warning: `define not supported. Use an external preprocessor."
	   << endl;
  }
	YY_BREAK
case 150:
YY_RULE_SETUP
#line 755 "lexor.lex"
{
      cerr << yylloc.text << ":" << yylloc.first_line <<
	    ": warning: `else not supported. Use an external preprocessor."
	   << endl;
  }
	YY_BREAK
case 151:
YY_RULE_SETUP
#line 761 "lexor.lex"
{
      cerr << yylloc.text << ":" << yylloc.first_line <<
	    ": warning: `elsif not supported. Use an external preprocessor."
	   << endl;
  }
	YY_BREAK
case 152:
YY_RULE_SETUP
#line 767 "lexor.lex"
{
      cerr << yylloc.text << ":" << yylloc.first_line <<
	    ": warning: `endif not supported. Use an external preprocessor."
	   << endl;
  }
	YY_BREAK
case 153:
YY_RULE_SETUP
#line 773 "lexor.lex"
{
      cerr << yylloc.text << ":" << yylloc.first_line <<
	    ": warning: `ifdef not supported. Use an external preprocessor."
	   << endl;
  }
	YY_BREAK
case 154:
YY_RULE_SETUP
#line 779 "lexor.lex"
{
      cerr << yylloc.text << ":" << yylloc.first_line <<
	    ": warning: `ifndef not supported. Use an external preprocessor."
	   << endl;
  }
	YY_BREAK
case 155:
YY_RULE_SETUP
#line 785 "lexor.lex"
{
      cerr << yylloc.text << ":" << yylloc.first_line <<
	    ": warning: `include not supported. Use an external preprocessor."
	   << endl;
  }
	YY_BREAK
case 156:
YY_RULE_SETUP
#line 791 "lexor.lex"
{
      cerr << yylloc.text << ":" << yylloc.first_line <<
	    ": warning: `undef not supported. Use an external preprocessor."
	   << endl;
  }
	YY_BREAK
case 157:
YY_RULE_SETUP
#line 798 "lexor.lex"
{ cerr << yylloc.text << ":" << yylloc.first_line << ": error: "
	    << "Stray tic (`) here. Perhaps you put white space" << endl;
       cerr << yylloc.text << ":" << yylloc.first_line << ":      : "
	    << "between the tic and preprocessor directive?"
	    << endl;
       error_count += 1; }
	YY_BREAK
case 158:
YY_RULE_SETUP
#line 805 "lexor.lex"
{ return yytext[0]; }
	YY_BREAK
/* Final catchall. something got lost or mishandled. */
/* XXX Should we tell the user something about the lexical state? */
case 159:
/* rule 159 can match eol */
YY_RULE_SETUP
#line 810 "lexor.lex"
{   cerr << yylloc.text << ":" << yylloc.first_line
	   << ": error: unmatched character (";
      if (isprint(yytext[0]))
	    cerr << yytext[0];
      else
	    cerr << "hex " << hex << ((unsigned char) yytext[0]);

      cerr << ")" << endl;
      error_count += 1; }
	YY_BREAK
case 160:
YY_RULE_SETUP
#line 820 "lexor.lex"
YY_FATAL_ERROR( "flex scanner jammed" );
	YY_BREAK
#line 3037 "<stdout>"
			case YY_STATE_EOF(INITIAL):
			case YY_STATE_EOF(CCOMMENT):
			case YY_STATE_EOF(PCOMMENT):
			case YY_STATE_EOF(LCOMMENT):
			case YY_STATE_EOF(CSTRING):
			case YY_STATE_EOF(UDPTABLE):
			case YY_STATE_EOF(PPTIMESCALE):
			case YY_STATE_EOF(PPUCDRIVE):
			case YY_STATE_EOF(PPDEFAULT_NETTYPE):
			case YY_STATE_EOF(PPBEGIN_KEYWORDS):
			case YY_STATE_EOF(EDGES):
			case YY_STATE_EOF(REAL_SCALE):
				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 yyin at a new source and called
			 * yylex().  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 = yyin;
			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 ( yywrap(  ) )
					{
					/* Note: because we've taken care in
					 * yy_get_next_buffer() to have set up
					 * yytext, 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 user's declarations */
} /* end of yylex */

/* 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)
{
    	char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
	char *source = (yytext_ptr);
	yy_size_t 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 = (yy_size_t) ((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;
			yyrestart( yyin  );
			}

		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_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 *) yyrealloc(
			(void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size  );
		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
		/* "- 2" to take care of EOB's */
		YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (yy_size_t) (new_size - 2);
	}

	(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)
{
	yy_state_type yy_current_state;
	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 )
		{
		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 >= 653 )
				yy_c = yy_meta[yy_c];
			}
		yy_current_state = yy_nxt[yy_base[yy_current_state] + 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 )
{
	int yy_is_jam;
    
	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 >= 653 )
			yy_c = yy_meta[yy_c];
		}
	yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
	yy_is_jam = (yy_current_state == 652);
	if ( ! yy_is_jam )
		*(yy_state_ptr)++ = yy_current_state;

		return yy_is_jam ? 0 : yy_current_state;
}

#ifndef YY_NO_UNPUT

#endif

#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 = (int) ((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. */
					yyrestart( yyin );

					/*FALLTHROUGH*/

				case EOB_ACT_END_OF_FILE:
					{
					if ( yywrap(  ) )
						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 yytext */
	(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 yyrestart  (FILE * input_file )
{
    
	if ( ! YY_CURRENT_BUFFER ){
        yyensure_buffer_stack ();
		YY_CURRENT_BUFFER_LVALUE =
            yy_create_buffer( yyin, YY_BUF_SIZE );
	}

	yy_init_buffer( YY_CURRENT_BUFFER, input_file );
	yy_load_buffer_state(  );
}

/** Switch to a different input buffer.
 * @param new_buffer The new input buffer.
 * 
 */
    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
{
    
	/* TODO. We should be able to replace this entire function body
	 * with
	 *		yypop_buffer_state();
	 *		yypush_buffer_state(new_buffer);
     */
	yyensure_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;
	yy_load_buffer_state(  );

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

static void yy_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;
	yyin = 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 yy_create_buffer  (FILE * file, yy_size_t  size )
{
	YY_BUFFER_STATE b;
    
	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state )  );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in yy_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 *) yyalloc( (yy_size_t) (b->yy_buf_size + 2)  );
	if ( ! b->yy_ch_buf )
		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

	b->yy_is_our_buffer = 1;

	yy_init_buffer( b, file );

	return b;
}

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

	yyfree( (void *) b  );
}

/* Initializes or reinitializes a buffer.
 * This function is sometimes called more than once on the same buffer,
 * such as during a yyrestart() or at EOF.
 */
    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )

{
	int oerrno = errno;
    
	yy_flush_buffer( b );

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

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

	yyensure_buffer_stack();

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

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

	if (YY_CURRENT_BUFFER) {
		yy_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 yyensure_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; /* After all that talk, this was set to 1 anyways... */
		(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
								(num_to_alloc * sizeof(struct yy_buffer_state*)
								);
		if ( ! (yy_buffer_stack) )
			YY_FATAL_ERROR( "out of dynamic memory in yyensure_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. */
		yy_size_t grow_size = 8 /* arbitrary grow size */;

		num_to_alloc = (yy_buffer_stack_max) + grow_size;
		(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
								((yy_buffer_stack),
								num_to_alloc * sizeof(struct yy_buffer_state*)
								);
		if ( ! (yy_buffer_stack) )
			YY_FATAL_ERROR( "out of dynamic memory in yyensure_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 yy_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 NULL;

	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state )  );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in yy_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 = NULL;
	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;

	yy_switch_to_buffer( b  );

	return b;
}

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

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

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

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

/** Get the input stream.
 * 
 */
FILE *yyget_in  (void)
{
        return yyin;
}

/** Get the output stream.
 * 
 */
FILE *yyget_out  (void)
{
        return yyout;
}

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

/** Get the current token.
 * 
 */

char *yyget_text  (void)
{
        return yytext;
}

/** Set the current line number.
 * @param _line_number line number
 * 
 */
void yyset_lineno (int  _line_number )
{
    
    yylineno = _line_number;
}

/** Set the input stream. This does not discard the current
 * input buffer.
 * @param _in_str A readable stream.
 * 
 * @see yy_switch_to_buffer
 */
void yyset_in (FILE *  _in_str )
{
        yyin = _in_str ;
}

void yyset_out (FILE *  _out_str )
{
        yyout = _out_str ;
}

int yyget_debug  (void)
{
        return yy_flex_debug;
}

void yyset_debug (int  _bdebug )
{
        yy_flex_debug = _bdebug ;
}

static int yy_init_globals (void)
{
        /* Initialization is the same as for the non-reentrant scanner.
     * This function is called from yylex_destroy(), so don't allocate here.
     */

    (yy_buffer_stack) = NULL;
    (yy_buffer_stack_top) = 0;
    (yy_buffer_stack_max) = 0;
    (yy_c_buf_p) = NULL;
    (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
    yyin = stdin;
    yyout = stdout;
#else
    yyin = NULL;
    yyout = NULL;
#endif

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

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

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

    yyfree ( (yy_state_buf) );
    (yy_state_buf)  = NULL;

    /* Reset the globals. This is important in a non-reentrant scanner so the next time
     * yylex() is called, initialization will occur. */
    yy_init_globals( );

    return 0;
}

/*
 * Internal utility routines.
 */

#ifndef yytext_ptr
static void yy_flex_strncpy (char* s1, const char * s2, int n )
{
		
	int i;
	for ( i = 0; i < n; ++i )
		s1[i] = s2[i];
}
#endif

#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (const char * s )
{
	int n;
	for ( n = 0; s[n]; ++n )
		;

	return n;
}
#endif

void *yyalloc (yy_size_t  size )
{
			return malloc(size);
}

void *yyrealloc  (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 realloc(ptr, size);
}

void yyfree (void * ptr )
{
			free( (char *) ptr );	/* see yyrealloc() for (char *) cast */
}

#define YYTABLES_NAME "yytables"

#line 820 "lexor.lex"


/*
 * The UDP state table needs some slightly different treatment by the
 * lexor. The level characters are normally accepted as other things,
 * so the parser needs to switch my mode when it believes in needs to.
 */
void lex_end_table()
{
      BEGIN(INITIAL);
}

static unsigned truncate_to_integer_width(verinum::V*bits, unsigned size)
{
      if (size <= integer_width) return size;

      verinum::V pad = bits[size-1];
      if (pad == verinum::V1) pad = verinum::V0;

      for (unsigned idx = integer_width; idx < size; idx += 1) {
	    if (bits[idx] != pad) {
		  yywarn(yylloc, "Unsized numeric constant truncated to integer width.");
		  break;
	    }
      }
      return integer_width;
}

verinum*make_unsized_binary(const char*txt)
{
      bool sign_flag = false;
      bool single_flag = false;
      const char*ptr = txt;
      assert(*ptr == '\'');
      ptr += 1;

      if (tolower(*ptr) == 's') {
	    sign_flag = true;
	    ptr += 1;
      }

      assert((tolower(*ptr) == 'b') || (generation_flag >= GN_VER2005_SV));
      if (tolower(*ptr) == 'b') {
	    ptr += 1;
      } else {
	    assert(sign_flag == false);
	    single_flag = true;
      }

      while (*ptr && ((*ptr == ' ') || (*ptr == '\t')))
	    ptr += 1;

      unsigned size = 0;
      for (const char*idx = ptr ;  *idx ;  idx += 1)
	    if (*idx != '_') size += 1;

      if ((based_size > 0) && (size > based_size)) yywarn(yylloc,
          "extra digits given for sized binary constant.");

      verinum::V*bits = new verinum::V[size];

      unsigned idx = size;
      while (*ptr) {
	    switch (ptr[0]) {
		case '0':
		  bits[--idx] = verinum::V0;
		  break;
		case '1':
		  bits[--idx] = verinum::V1;
		  break;
		case 'z': case 'Z': case '?':
		  bits[--idx] = verinum::Vz;
		  break;
		case 'x': case 'X':
		  bits[--idx] = verinum::Vx;
		  break;
		  case '_':
		  break;
		default:
		  fprintf(stderr, "%c\n", ptr[0]);
		  assert(0);
	    }
	    ptr += 1;
      }

      if (gn_strict_expr_width_flag && (based_size == 0))
	    size = truncate_to_integer_width(bits, size);

      verinum*out = new verinum(bits, size, false);
      out->has_sign(sign_flag);
      out->is_single(single_flag);
      delete[]bits;
      return out;
}


verinum*make_unsized_octal(const char*txt)
{
      bool sign_flag = false;
      const char*ptr = txt;
      assert(*ptr == '\'');
      ptr += 1;

      if (tolower(*ptr) == 's') {
	    sign_flag = true;
	    ptr += 1;
      }

      assert(tolower(*ptr) == 'o');
      ptr += 1;

      while (*ptr && ((*ptr == ' ') || (*ptr == '\t')))
	    ptr += 1;

      unsigned size = 0;
      for (const char*idx = ptr ;  *idx ;  idx += 1)
	    if (*idx != '_') size += 3;

      if (based_size > 0) {
            int rem = based_size % 3;
	    if (rem != 0) based_size += 3 - rem;
	    if (size > based_size) yywarn(yylloc,
	        "extra digits given for sized octal constant.");
      }

      verinum::V*bits = new verinum::V[size];

      unsigned idx = size;
      while (*ptr) {
	    unsigned val;
	    switch (ptr[0]) {
		case '0': case '1': case '2': case '3':
		case '4': case '5': case '6': case '7':
		  val = *ptr - '0';
		  bits[--idx] = (val&4) ? verinum::V1 : verinum::V0;
		  bits[--idx] = (val&2) ? verinum::V1 : verinum::V0;
		  bits[--idx] = (val&1) ? verinum::V1 : verinum::V0;
		  break;
		case 'x': case 'X':
		  bits[--idx] = verinum::Vx;
		  bits[--idx] = verinum::Vx;
		  bits[--idx] = verinum::Vx;
		  break;
		case 'z': case 'Z': case '?':
		  bits[--idx] = verinum::Vz;
		  bits[--idx] = verinum::Vz;
		  bits[--idx] = verinum::Vz;
		  break;
		case '_':
		  break;
		default:
		  assert(0);
	    }
	    ptr += 1;
      }

      if (gn_strict_expr_width_flag && (based_size == 0))
	    size = truncate_to_integer_width(bits, size);

      verinum*out = new verinum(bits, size, false);
      out->has_sign(sign_flag);
      delete[]bits;
      return out;
}


verinum*make_unsized_hex(const char*txt)
{
      bool sign_flag = false;
      const char*ptr = txt;
      assert(*ptr == '\'');
      ptr += 1;

      if (tolower(*ptr) == 's') {
	    sign_flag = true;
	    ptr += 1;
      }
      assert(tolower(*ptr) == 'h');

      ptr += 1;
      while (*ptr && ((*ptr == ' ') || (*ptr == '\t')))
	    ptr += 1;

      unsigned size = 0;
      for (const char*idx = ptr ;  *idx ;  idx += 1)
	    if (*idx != '_') size += 4;

      if (based_size > 0) {
            int rem = based_size % 4;
	    if (rem != 0) based_size += 4 - rem;
	    if (size > based_size) yywarn(yylloc,
	        "extra digits given for sized hex constant.");
      }

      verinum::V*bits = new verinum::V[size];

      unsigned idx = size;
      while (*ptr) {
	    unsigned val;
	    switch (ptr[0]) {
		case '0': case '1': case '2': case '3': case '4':
		case '5': case '6': case '7': case '8': case '9':
		  val = *ptr - '0';
		  bits[--idx] = (val&8) ? verinum::V1 : verinum::V0;
		  bits[--idx] = (val&4) ? verinum::V1 : verinum::V0;
		  bits[--idx] = (val&2) ? verinum::V1 : verinum::V0;
		  bits[--idx] = (val&1) ? verinum::V1 : verinum::V0;
		  break;
		case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
		case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
		  val = tolower(*ptr) - 'a' + 10;
		  bits[--idx] = (val&8) ? verinum::V1 : verinum::V0;
		  bits[--idx] = (val&4) ? verinum::V1 : verinum::V0;
		  bits[--idx] = (val&2) ? verinum::V1 : verinum::V0;
		  bits[--idx] = (val&1) ? verinum::V1 : verinum::V0;
		  break;
		case 'x': case 'X':
		  bits[--idx] = verinum::Vx;
		  bits[--idx] = verinum::Vx;
		  bits[--idx] = verinum::Vx;
		  bits[--idx] = verinum::Vx;
		  break;
		case 'z': case 'Z': case '?':
		  bits[--idx] = verinum::Vz;
		  bits[--idx] = verinum::Vz;
		  bits[--idx] = verinum::Vz;
		  bits[--idx] = verinum::Vz;
		  break;
		case '_':
		  break;
		default:
		  assert(0);
	    }
	    ptr += 1;
      }

      if (gn_strict_expr_width_flag && (based_size == 0))
	    size = truncate_to_integer_width(bits, size);

      verinum*out = new verinum(bits, size, false);
      out->has_sign(sign_flag);
      delete[]bits;
      return out;
}


/* Divide the integer given by the string by 2. Return the remainder bit. */
static int dec_buf_div2(char *buf)
{
    int partial;
    int len = strlen(buf);
    char *dst_ptr;
    int pos;

    partial = 0;
    pos = 0;

    /* dst_ptr overwrites buf, but all characters that are overwritten
       were already used by the reader. */
    dst_ptr = buf;

    while(buf[pos] == '0')
	++pos;

    for(; pos<len; ++pos){
	if (buf[pos]=='_')
	    continue;

	assert(isdigit(buf[pos]));

	partial= partial*10 + (buf[pos]-'0');

	if (partial >= 2){
	    *dst_ptr = partial/2 + '0';
	    partial = partial & 1;

	    ++dst_ptr;
	}
	else{
	    *dst_ptr = '0';
	    ++dst_ptr;
	}
    }

    // If result of division was zero string, it should remain that way.
    // Don't eat the last zero...
    if (dst_ptr == buf){
	*dst_ptr = '0';
	++dst_ptr;
    }
    *dst_ptr = 0;

    return partial;
}

/* Support a single x, z or ? as a decimal constant (from 1364-2005). */
verinum* make_undef_highz_dec(const char* ptr)
{
      bool signed_flag = false;

      assert(*ptr == '\'');
      /* The number may have decorations of the form 'sd<code>,
         possibly with space between the d and the <code>.
         Also, the 's' is optional, and marks the number as signed. */
      ptr += 1;

      if (tolower(*ptr) == 's') {
	  signed_flag = true;
	  ptr += 1;
      }

      assert(tolower(*ptr) == 'd');
      ptr += 1;

      while (*ptr && ((*ptr == ' ') || (*ptr == '\t')))
	  ptr += 1;

	/* Process the code. */
      verinum::V* bits = new verinum::V[1];
      switch (*ptr) {
	  case 'x':
	  case 'X':
	    bits[0] = verinum::Vx;
	    break;
	  case 'z':
	  case 'Z':
	  case '?':
	    bits[0] = verinum::Vz;
	    break;
	  default:
	    assert(0);
      }
      ptr += 1;
      while (*ptr == '_') ptr += 1;
      assert(*ptr == 0);

      verinum*out = new verinum(bits, 1, false);
      out->has_sign(signed_flag);
      delete[]bits;
      return out;
}

/*
 * Making a decimal number is much easier than the other base numbers
 * because there are no z or x values to worry about. It is much
 * harder than other base numbers because the width needed in bits is
 * hard to calculate.
 */

verinum*make_unsized_dec(const char*ptr)
{
      char buf[4096];
      bool signed_flag = false;
      unsigned idx;

      if (ptr[0] == '\'') {
	      /* The number has decorations of the form 'sd<digits>,
		 possibly with space between the d and the <digits>.
		 Also, the 's' is optional, and marks the number as
		 signed. */
	    ptr += 1;

	    if (tolower(*ptr) == 's') {
		  signed_flag = true;
		  ptr += 1;
	    }

	    assert(tolower(*ptr) == 'd');
	    ptr += 1;

	    while (*ptr && ((*ptr == ' ') || (*ptr == '\t')))
		  ptr += 1;

      } else {
	      /* ... or an undecorated decimal number is passed
		 it. These numbers are treated as signed decimal. */
	    assert(isdigit(*ptr));
	    signed_flag = true;
      }


	/* Copy the digits into a buffer that I can use to do in-place
	   decimal divides. */
      idx = 0;
      while ((idx < sizeof buf) && (*ptr != 0)) {
	    if (*ptr == '_') {
		  ptr += 1;
		  continue;
	    }

	    buf[idx++] = *ptr++;
      }

      if (idx == sizeof buf) {
	    fprintf(stderr, "Ridiculously long"
		    " decimal constant will be truncated!\n");
	    idx -= 1;
      }

      buf[idx] = 0;
      unsigned tmp_size = idx * 4 + 1;
      verinum::V *bits = new verinum::V[tmp_size];

      idx = 0;
      while (idx < tmp_size) {
	    int rem = dec_buf_div2(buf);
	    bits[idx++] = (rem == 1) ? verinum::V1 : verinum::V0;
      }

      assert(strcmp(buf, "0") == 0);

	/* Now calculate the minimum number of bits needed to
	   represent this unsigned number. */
      unsigned size = tmp_size;
      while ((size > 1) && (bits[size-1] == verinum::V0))
	    size -= 1;

	/* Now account for the signedness. Don't leave a 1 in the high
	   bit if this is a signed number. */
      if (signed_flag && (bits[size-1] == verinum::V1)) {
	    size += 1;
	    assert(size <= tmp_size);
      }

        /* Since we never have the real number of bits that a decimal
           number represents we do not check for extra bits. */
//      if (based_size > 0) { }

      if (gn_strict_expr_width_flag && (based_size == 0))
	    size = truncate_to_integer_width(bits, size);

      verinum*res = new verinum(bits, size, false);
      res->has_sign(signed_flag);

      delete[]bits;
      return res;
}

/*
 * Convert the string to a time unit or precision.
 * Returns true on failure.
 */
static bool get_timescale_const(const char *&cp, int &res, bool is_unit)
{
	/* Check for the 1 digit. */
      if (*cp != '1') {
	    if (is_unit) {
		  VLerror(yylloc, "Invalid `timescale unit constant "
		                  "(1st digit)");
	    } else {
		  VLerror(yylloc, "Invalid `timescale precision constant "
		                  "(1st digit)");
	    }
	    return true;
      }
      cp += 1;

	/* Check the number of zeros after the 1. */
      res = strspn(cp, "0");
      if (res > 2) {
	    if (is_unit) {
		  VLerror(yylloc, "Invalid `timescale unit constant "
		                  "(number of zeros)");
	    } else {
		  VLerror(yylloc, "Invalid `timescale precision constant "
		                  "(number of zeros)");
	    }
	    return true;
      }
      cp += res;

	/* Skip any space between the digits and the scaling string. */
      cp += strspn(cp, " \t");

	/* Now process the scaling string. */
      if (strncmp("s", cp, 1) == 0) {
	    res -= 0;
	    cp += 1;
	    return false;

      } else if (strncmp("ms", cp, 2) == 0) {
	    res -= 3;
	    cp += 2;
	    return false;

      } else if (strncmp("us", cp, 2) == 0) {
	    res -= 6;
	    cp += 2;
	    return false;

      } else if (strncmp("ns", cp, 2) == 0) {
	    res -= 9;
	    cp += 2;
	    return false;

      } else if (strncmp("ps", cp, 2) == 0) {
	    res -= 12;
	    cp += 2;
	    return false;

      } else if (strncmp("fs", cp, 2) == 0) {
	    res -= 15;
	    cp += 2;
	    return false;

      }

      if (is_unit) {
	    VLerror(yylloc, "Invalid `timescale unit scale");
      } else {
	    VLerror(yylloc, "Invalid `timescale precision scale");
      }
      return true;
}


/*
 * process either a pull0 or a pull1.
 */
static void process_ucdrive(const char*txt)
{
      UCDriveType ucd = UCD_NONE;
      const char*cp = txt + strspn(txt, " \t");

	/* Skip the space after the `unconnected_drive directive. */
      if (cp == txt) {
	    VLerror(yylloc, "Space required after `unconnected_drive "
	                    "directive.");
	    return;
      }

	/* Check for the pull keyword. */
      if (strncmp("pull", cp, 4) != 0) {
	    VLerror(yylloc, "pull required for `unconnected_drive "
	                    "directive.");
	    return;
      }
      cp += 4;
      if (*cp == '0') ucd = UCD_PULL0;
      else if (*cp == '1') ucd = UCD_PULL1;
      else {
	    cerr << yylloc.text << ":" << yylloc.first_line << ": error: "
		    "`unconnected_drive does not support 'pull" << *cp
	         << "'." << endl;
	    error_count += 1;
	    return;
      }
      cp += 1;

	/* Verify that only space and/or a single line comment is left. */
      cp += strspn(cp, " \t");
      if (strncmp(cp, "//", 2) != 0 &&
          (size_t)(cp-yytext) != strlen(yytext)) {
	    VLerror(yylloc, "Invalid `unconnected_drive directive (extra "
	                    "garbage after precision).");
	    return;
      }

      uc_drive = ucd;
}

/*
 * The timescale parameter has the form:
 *      " <num> xs / <num> xs"
 */
static void process_timescale(const char*txt)
{
      const char*cp = txt + strspn(txt, " \t");

	/* Skip the space after the `timescale directive. */
      if (cp == txt) {
	    VLerror(yylloc, "Space required after `timescale directive.");
	    return;
      }

      int unit = 0;
      int prec = 0;

	/* Get the time units. */
      if (get_timescale_const(cp, unit, true)) return;

	/* Skip any space after the time units, the '/' and any
	 * space after the '/'. */
      cp += strspn(cp, " \t");
      if (*cp != '/') {
	    VLerror(yylloc, "`timescale separator '/' appears to be missing.");
	    return;
      }
      cp += 1;
      cp += strspn(cp, " \t");

	/* Get the time precision. */
      if (get_timescale_const(cp, prec, false)) return;

	/* Verify that only space and/or a single line comment is left. */
      cp += strspn(cp, " \t");
      if (strncmp(cp, "//", 2) != 0 &&
          (size_t)(cp-yytext) != strlen(yytext)) {
	    VLerror(yylloc, "Invalid `timescale directive (extra garbage "
	                    "after precision).");
	    return;
      }

	/* The time unit must be greater than or equal to the precision. */
      if (unit < prec) {
	    VLerror(yylloc, "error: `timescale unit must not be less than "
	                    "the precision.");
	    return;
      }

      pform_set_timescale(unit, prec, yylloc.text, yylloc.first_line);
}

int yywrap()
{
      return 1;
}

/*
 * The line directive matches lines of the form #line "foo" N and
 * calls this function. Here I parse out the file name and line
 * number, and change the yylloc to suite.
 */
static void line_directive()
{
      char *cpr;
	/* Skip any leading space. */
      char *cp = strchr(yytext, '#');
	/* Skip the #line directive. */
      assert(strncmp(cp, "#line", 5) == 0);
      cp += 5;
	/* Skip the space after the #line directive. */
      cp += strspn(cp, " \t");

	/* Find the starting " and skip it. */
      char*fn_start = strchr(cp, '"');
      if (cp != fn_start) {
	    VLerror(yylloc, "Invalid #line directive (file name start).");
	    return;
      }
      fn_start += 1;

	/* Find the last ". */
      char*fn_end = strrchr(fn_start, '"');
      if (!fn_end) {
	    VLerror(yylloc, "Invalid #line directive (file name end).");
	    return;
      }

	/* Copy the file name and assign it to yylloc. */
      char*buf = new char[fn_end-fn_start+1];
      strncpy(buf, fn_start, fn_end-fn_start);
      buf[fn_end-fn_start] = 0;

	/* Skip the space after the file name. */
      cp = fn_end;
      cp += 1;
      cpr = cp;
      cpr += strspn(cp, " \t");
      if (cp == cpr) {
	    VLerror(yylloc, "Invalid #line directive (missing space after "
	                    "file name).");
	    delete[] buf;
	    return;
      }
      cp = cpr;

	/* Get the line number and verify that it is correct. */
      unsigned long lineno = strtoul(cp, &cpr, 10);
      if (cp == cpr) {
	    VLerror(yylloc, "Invalid line number for #line directive.");
	    delete[] buf;
	    return;
      }
      cp = cpr;

	/* Verify that only space is left. */
      cpr += strspn(cp, " \t");
      if ((size_t)(cpr-yytext) != strlen(yytext)) {
	    VLerror(yylloc, "Invalid #line directive (extra garbage after "
	                    "line number).");
	    delete[] buf;
	    return;
      }

	/* Now we can assign the new values to yyloc. */
      yylloc.text = set_file_name(buf);
      yylloc.first_line = lineno;
}

/*
 * The line directive matches lines of the form `line N "foo" M and
 * calls this function. Here I parse out the file name and line
 * number, and change the yylloc to suite. M is ignored.
 */
static void line_directive2()
{
      char *cpr;
	/* Skip any leading space. */
      char *cp = strchr(yytext, '`');
	/* Skip the `line directive. */
      assert(strncmp(cp, "`line", 5) == 0);
      cp += 5;

	/* strtoul skips leading space. */
      unsigned long lineno = strtoul(cp, &cpr, 10);
      if (cp == cpr) {
	    VLerror(yylloc, "Invalid line number for `line directive.");
	    return;
      }
      lineno -= 1;
      cp = cpr;

	/* Skip the space between the line number and the file name. */
      cpr += strspn(cp, " \t");
      if (cp == cpr) {
	    VLerror(yylloc, "Invalid `line directive (missing space after "
	                    "line number).");
	    return;
      }
      cp = cpr;

	/* Find the starting " and skip it. */
      char*fn_start = strchr(cp, '"');
      if (cp != fn_start) {
	    VLerror(yylloc, "Invalid `line directive (file name start).");
	    return;
      }
      fn_start += 1;

	/* Find the last ". */
      char*fn_end = strrchr(fn_start, '"');
      if (!fn_end) {
	    VLerror(yylloc, "Invalid `line directive (file name end).");
	    return;
      }

	/* Skip the space after the file name. */
      cp = fn_end + 1;
      cpr = cp;
      cpr += strspn(cp, " \t");
      if (cp == cpr) {
	    VLerror(yylloc, "Invalid `line directive (missing space after "
	                    "file name).");
	    return;
      }
      cp = cpr;

	/* Check that the level is correct, we do not need the level. */
      if (strspn(cp, "012") != 1) {
	    VLerror(yylloc, "Invalid level for `line directive.");
	    return;
      }
      cp += 1;

	/* Verify that only space and/or a single line comment is left. */
      cp += strspn(cp, " \t");
      if (strncmp(cp, "//", 2) != 0 &&
          (size_t)(cp-yytext) != strlen(yytext)) {
	    VLerror(yylloc, "Invalid `line directive (extra garbage after "
	                    "level).");
	    return;
      }

	/* Copy the file name and assign it and the line number to yylloc. */
      char*buf = new char[fn_end-fn_start+1];
      strncpy(buf, fn_start, fn_end-fn_start);
      buf[fn_end-fn_start] = 0;

      yylloc.text = set_file_name(buf);
      yylloc.first_line = lineno;
}

extern FILE*vl_input;
void reset_lexor()
{
      yyrestart(vl_input);
      yylloc.first_line = 1;

	/* Announce the first file name. */
      yylloc.text = set_file_name(strdupnew(vl_file.c_str()));
}

/*
 * Modern version of flex (>=2.5.9) can clean up the scanner data.
 */
void destroy_lexor()
{
# ifdef FLEX_SCANNER
#   if YY_FLEX_MAJOR_VERSION >= 2 && YY_FLEX_MINOR_VERSION >= 5
#     if defined(YY_FLEX_SUBMINOR_VERSION) && YY_FLEX_SUBMINOR_VERSION >= 9
    yylex_destroy();
#     endif
#   endif
# endif
}

