/* A Bison parser, made by GNU Bison 3.4.2.  */

/* Bison implementation for Yacc-like parsers in C

   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
   Inc.

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.  */

/* As a special exception, you may create a larger work that contains
   part or all of the Bison parser skeleton and distribute that work
   under terms of your choice, so long as that work isn't itself a
   parser generator using the skeleton or a modified version thereof
   as a parser skeleton.  Alternatively, if you modify or redistribute
   the parser skeleton itself, you may (at your option) remove this
   special exception, which will cause the skeleton and the resulting
   Bison output files to be licensed under the GNU General Public
   License without this special exception.

   This special exception was added by the Free Software Foundation in
   version 2.2 of Bison.  */

/* C LALR(1) parser skeleton written by Richard Stallman, by
   simplifying the original so-called "semantic" parser.  */

/* All symbols defined below should begin with yy or YY, to avoid
   infringing on user name space.  This should be done even for local
   variables, as they might otherwise be expanded by user macros.
   There are some unavoidable exceptions within include files to
   define necessary library symbols; they are noted "INFRINGES ON
   USER NAME SPACE" below.  */

/* Undocumented macros, especially those whose name start with YY_,
   are private implementation details.  Do not rely on them.  */

/* Identify Bison output.  */
#define YYBISON 1

/* Bison version.  */
#define YYBISON_VERSION "3.4.2"

/* Skeleton name.  */
#define YYSKELETON_NAME "yacc.c"

/* Pure parsers.  */
#define YYPURE 1

/* Push parsers.  */
#define YYPUSH 0

/* Pull parsers.  */
#define YYPULL 1




/* First part of user prologue.  */
#line 7 "parse.y"

/*
 * Copyright (c) 2011-2013 Stephen Williams (steve@icarus.com)
 * Copyright CERN 2012-2014 / Stephen Williams (steve@icarus.com),
 * @author Maciej Suminski (maciej.suminski@cern.ch)
 *
 *    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 "vhdlpp_config.h"
# include "vhdlint.h"
# include "vhdlreal.h"
# include "compiler.h"
# include "parse_api.h"
# include "parse_misc.h"
# include "architec.h"
# include "expression.h"
# include "sequential.h"
# include "subprogram.h"
# include "package.h"
# include "vsignal.h"
# include "vtype.h"
# include "std_funcs.h"
# include "std_types.h"
# include  <cstdarg>
# include  <cstring>
# include  <list>
# include  <stack>
# include  <map>
# include  <vector>
# include  "parse_types.h"
# include  <ivl_assert.h>
# include  <assert.h>

inline void FILE_NAME(LineInfo*tmp, const struct yyltype&where)
{
      tmp->set_lineno(where.first_line);
      tmp->set_file(filename_strings.make(where.text));
}


/* Recent version of bison expect that the user supply a
   YYLLOC_DEFAULT macro that makes up a yylloc value from existing
   values. I need to supply an explicit version to account for the
   text field, that otherwise won't be copied. */
# define YYLLOC_DEFAULT(Current, Rhs, N)  do {       \
  (Current).first_line   = (Rhs)[1].first_line;      \
  (Current).text         = file_path; /*(Rhs)[1].text;*/   } while (0)

static void yyerror(YYLTYPE*yyllocp,yyscan_t yyscanner,const char*file_path,bool, const char*msg);

int parse_errors = 0;
int parse_sorrys = 0;

/*
 * The parser calls yylex to get the next lexical token. It is only
 * called by the bison-generated parser.
 */
extern int yylex(union YYSTYPE*yylvalp,YYLTYPE*yyllocp,yyscan_t yyscanner);


/*
 * Create an initial scope that collects all the global
 * declarations. Also save a stack of previous scopes, as a way to
 * manage lexical scopes.
 */
static ActiveScope*active_scope = new ActiveScope;
static stack<ActiveScope*> scope_stack;
static SubprogramHeader*active_sub = NULL;

// perm_strings for attributes
const static perm_string left_attr = perm_string::literal("left");
const static perm_string right_attr = perm_string::literal("right");

/*
 * When a scope boundary starts, call the push_scope function to push
 * a scope context. Preload this scope context with the contents of
 * the parent scope, then make this the current scope. When the scope
 * is done, the pop_scope function pops the scope off the stack and
 * resumes the scope that was the parent.
 */
static void push_scope(void)
{
      assert(active_scope);
      scope_stack.push(active_scope);
      active_scope = new ActiveScope (active_scope);
}

static void pop_scope(void)
{
      delete active_scope;
      assert(! scope_stack.empty());
      active_scope = scope_stack.top();
      scope_stack.pop();
}

static bool is_subprogram_param(perm_string name)
{
    if(!active_sub)
        return false;

    return (active_sub->find_param(name) != NULL);
}

void preload_global_types(void)
{
      generate_global_types(active_scope);
}

//Remove the scope created at the beginning of parser's work.
//After the parsing active_scope should keep it's address

static void delete_global_scope(void)
{
    active_scope->destroy_global_scope();
    delete active_scope;
}

//delete global entities that were gathered over the parsing process
static void delete_design_entities(void)
{
      for(map<perm_string,Entity*>::iterator cur = design_entities.begin()
      ; cur != design_entities.end(); ++cur)
        delete cur->second;
}

//clean the mess caused by the parser
void parser_cleanup(void)
{
    delete_design_entities();
    delete_global_scope();
    delete_std_funcs();
    lex_strings.cleanup();
}

const VType*parse_type_by_name(perm_string name)
{
      return active_scope->find_type(name);
}

// This function is called when an aggregate expression is detected by
// the parser. It makes the ExpAggregate. It also tries to detect the
// special case that the aggregate is really a primary. The problem is
// that this:
//   ( <expression> )
// also matches the pattern:
//   ( [ choices => ] <expression> ... )
// so try to assume that a single expression in parentheses is a
// primary and fix the parse by returning an Expression instead of an
// ExpAggregate.
static Expression*aggregate_or_primary(const YYLTYPE&loc, std::list<ExpAggregate::element_t*>*el)
{
      if (el->size() != 1) {
	    ExpAggregate*tmp = new ExpAggregate(el);
	    FILE_NAME(tmp,loc);
	    return tmp;
      }

      ExpAggregate::element_t*el1 = el->front();
      if (el1->count_choices() > 0) {
	    ExpAggregate*tmp = new ExpAggregate(el);
	    FILE_NAME(tmp,loc);
	    return tmp;
      }

      return el1->extract_expression();
}

static list<VTypeRecord::element_t*>* record_elements(list<perm_string>*names,
						      const VType*type)
{
      list<VTypeRecord::element_t*>*res = new list<VTypeRecord::element_t*>;

      for (list<perm_string>::iterator cur = names->begin()
		 ; cur != names->end() ; ++cur) {
	    res->push_back(new VTypeRecord::element_t(*cur, type));
      }

      return res;
}

static void touchup_interface_for_functions(std::list<InterfacePort*>*ports)
{
      for (list<InterfacePort*>::iterator cur = ports->begin()
		 ; cur != ports->end() ; ++cur) {
	    InterfacePort*curp = *cur;
	    if (curp->mode == PORT_NONE)
		  curp->mode = PORT_IN;
      }
}


#line 276 "parse.cc"

# ifndef YY_NULLPTR
#  if defined __cplusplus
#   if 201103L <= __cplusplus
#    define YY_NULLPTR nullptr
#   else
#    define YY_NULLPTR 0
#   endif
#  else
#   define YY_NULLPTR ((void*)0)
#  endif
# endif

/* Enabling verbose error messages.  */
#ifdef YYERROR_VERBOSE
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
# define YYERROR_VERBOSE 0
#endif

/* Use api.header.include to #include this header
   instead of duplicating it here.  */
#ifndef YY_YY_PARSE_HH_INCLUDED
# define YY_YY_PARSE_HH_INCLUDED
/* Debug traces.  */
#ifndef YYDEBUG
# define YYDEBUG 1
#endif
#if YYDEBUG
extern int yydebug;
#endif

/* Token type.  */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
  enum yytokentype
  {
    K_abs = 258,
    K_access = 259,
    K_after = 260,
    K_alias = 261,
    K_all = 262,
    K_and = 263,
    K_architecture = 264,
    K_array = 265,
    K_assert = 266,
    K_assume = 267,
    K_assume_guarantee = 268,
    K_attribute = 269,
    K_begin = 270,
    K_block = 271,
    K_body = 272,
    K_buffer = 273,
    K_bus = 274,
    K_case = 275,
    K_component = 276,
    K_configuration = 277,
    K_constant = 278,
    K_context = 279,
    K_cover = 280,
    K_default = 281,
    K_disconnect = 282,
    K_downto = 283,
    K_else = 284,
    K_elsif = 285,
    K_end = 286,
    K_entity = 287,
    K_exit = 288,
    K_fairness = 289,
    K_file = 290,
    K_for = 291,
    K_force = 292,
    K_function = 293,
    K_generate = 294,
    K_generic = 295,
    K_group = 296,
    K_guarded = 297,
    K_if = 298,
    K_impure = 299,
    K_in = 300,
    K_inertial = 301,
    K_inout = 302,
    K_is = 303,
    K_label = 304,
    K_library = 305,
    K_linkage = 306,
    K_literal = 307,
    K_loop = 308,
    K_map = 309,
    K_mod = 310,
    K_nand = 311,
    K_new = 312,
    K_next = 313,
    K_nor = 314,
    K_not = 315,
    K_null = 316,
    K_of = 317,
    K_on = 318,
    K_open = 319,
    K_or = 320,
    K_others = 321,
    K_out = 322,
    K_package = 323,
    K_parameter = 324,
    K_port = 325,
    K_postponed = 326,
    K_procedure = 327,
    K_process = 328,
    K_property = 329,
    K_protected = 330,
    K_pure = 331,
    K_range = 332,
    K_record = 333,
    K_register = 334,
    K_reject = 335,
    K_release = 336,
    K_rem = 337,
    K_report = 338,
    K_restrict = 339,
    K_restrict_guarantee = 340,
    K_return = 341,
    K_reverse_range = 342,
    K_rol = 343,
    K_ror = 344,
    K_select = 345,
    K_sequence = 346,
    K_severity = 347,
    K_signal = 348,
    K_shared = 349,
    K_sla = 350,
    K_sll = 351,
    K_sra = 352,
    K_srl = 353,
    K_strong = 354,
    K_subtype = 355,
    K_then = 356,
    K_to = 357,
    K_transport = 358,
    K_type = 359,
    K_unaffected = 360,
    K_units = 361,
    K_until = 362,
    K_use = 363,
    K_variable = 364,
    K_vmode = 365,
    K_vprop = 366,
    K_vunit = 367,
    K_wait = 368,
    K_when = 369,
    K_while = 370,
    K_with = 371,
    K_xnor = 372,
    K_xor = 373,
    IDENTIFIER = 374,
    INT_LITERAL = 375,
    REAL_LITERAL = 376,
    STRING_LITERAL = 377,
    CHARACTER_LITERAL = 378,
    BITSTRING_LITERAL = 379,
    LEQ = 380,
    GEQ = 381,
    VASSIGN = 382,
    NE = 383,
    BOX = 384,
    EXP = 385,
    ARROW = 386,
    DLT = 387,
    DGT = 388,
    CC = 389,
    M_EQ = 390,
    M_NE = 391,
    M_LT = 392,
    M_LEQ = 393,
    M_GT = 394,
    M_GEQ = 395
  };
#endif
/* Tokens.  */
#define K_abs 258
#define K_access 259
#define K_after 260
#define K_alias 261
#define K_all 262
#define K_and 263
#define K_architecture 264
#define K_array 265
#define K_assert 266
#define K_assume 267
#define K_assume_guarantee 268
#define K_attribute 269
#define K_begin 270
#define K_block 271
#define K_body 272
#define K_buffer 273
#define K_bus 274
#define K_case 275
#define K_component 276
#define K_configuration 277
#define K_constant 278
#define K_context 279
#define K_cover 280
#define K_default 281
#define K_disconnect 282
#define K_downto 283
#define K_else 284
#define K_elsif 285
#define K_end 286
#define K_entity 287
#define K_exit 288
#define K_fairness 289
#define K_file 290
#define K_for 291
#define K_force 292
#define K_function 293
#define K_generate 294
#define K_generic 295
#define K_group 296
#define K_guarded 297
#define K_if 298
#define K_impure 299
#define K_in 300
#define K_inertial 301
#define K_inout 302
#define K_is 303
#define K_label 304
#define K_library 305
#define K_linkage 306
#define K_literal 307
#define K_loop 308
#define K_map 309
#define K_mod 310
#define K_nand 311
#define K_new 312
#define K_next 313
#define K_nor 314
#define K_not 315
#define K_null 316
#define K_of 317
#define K_on 318
#define K_open 319
#define K_or 320
#define K_others 321
#define K_out 322
#define K_package 323
#define K_parameter 324
#define K_port 325
#define K_postponed 326
#define K_procedure 327
#define K_process 328
#define K_property 329
#define K_protected 330
#define K_pure 331
#define K_range 332
#define K_record 333
#define K_register 334
#define K_reject 335
#define K_release 336
#define K_rem 337
#define K_report 338
#define K_restrict 339
#define K_restrict_guarantee 340
#define K_return 341
#define K_reverse_range 342
#define K_rol 343
#define K_ror 344
#define K_select 345
#define K_sequence 346
#define K_severity 347
#define K_signal 348
#define K_shared 349
#define K_sla 350
#define K_sll 351
#define K_sra 352
#define K_srl 353
#define K_strong 354
#define K_subtype 355
#define K_then 356
#define K_to 357
#define K_transport 358
#define K_type 359
#define K_unaffected 360
#define K_units 361
#define K_until 362
#define K_use 363
#define K_variable 364
#define K_vmode 365
#define K_vprop 366
#define K_vunit 367
#define K_wait 368
#define K_when 369
#define K_while 370
#define K_with 371
#define K_xnor 372
#define K_xor 373
#define IDENTIFIER 374
#define INT_LITERAL 375
#define REAL_LITERAL 376
#define STRING_LITERAL 377
#define CHARACTER_LITERAL 378
#define BITSTRING_LITERAL 379
#define LEQ 380
#define GEQ 381
#define VASSIGN 382
#define NE 383
#define BOX 384
#define EXP 385
#define ARROW 386
#define DLT 387
#define DGT 388
#define CC 389
#define M_EQ 390
#define M_NE 391
#define M_LT 392
#define M_LEQ 393
#define M_GT 394
#define M_GEQ 395

/* Value type.  */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
union YYSTYPE
{
#line 214 "parse.y"

      port_mode_t port_mode;

      char*text;

      std::list<perm_string>* name_list;

      bool flag;
      int64_t uni_integer;
      double  uni_real;

      Expression*expr;
      std::list<Expression*>* expr_list;

      SequentialStmt* sequ;
      std::list<SequentialStmt*>*sequ_list;

      IfSequential::Elsif*elsif;
      std::list<IfSequential::Elsif*>*elsif_list;

      ExpConditional::case_t*exp_options;
      std::list<ExpConditional::case_t*>*exp_options_list;

      CaseSeqStmt::CaseStmtAlternative* case_alt;
      std::list<CaseSeqStmt::CaseStmtAlternative*>* case_alt_list;

      named_expr_t*named_expr;
      std::list<named_expr_t*>*named_expr_list;
      entity_aspect_t* entity_aspect;
      instant_list_t* instantiation_list;
      std::pair<instant_list_t*, ExpName*>* component_specification;

      const VType* vtype;

      prange_t* range;
      std::list<prange_t*>*range_list;

      ExpArithmetic::fun_t arithmetic_op;
      std::list<struct adding_term>*adding_terms;

      ExpAggregate::choice_t*choice;
      std::list<ExpAggregate::choice_t*>*choice_list;
      ExpAggregate::element_t*element;
      std::list<ExpAggregate::element_t*>*element_list;

      std::list<VTypeRecord::element_t*>*record_elements;

      std::list<InterfacePort*>* interface_list;

      Architecture::Statement* arch_statement;
      std::list<Architecture::Statement*>* arch_statement_list;

      ReportStmt::severity_t severity;

      SubprogramHeader*subprogram;

#line 656 "parse.cc"

};
typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif

/* Location type.  */
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
typedef struct YYLTYPE YYLTYPE;
struct YYLTYPE
{
  int first_line;
  int first_column;
  int last_line;
  int last_column;
};
# define YYLTYPE_IS_DECLARED 1
# define YYLTYPE_IS_TRIVIAL 1
#endif



int yyparse (yyscan_t yyscanner, const char*file_path, perm_string parse_library_name);

#endif /* !YY_YY_PARSE_HH_INCLUDED  */



#ifdef short
# undef short
#endif

#ifdef YYTYPE_UINT8
typedef YYTYPE_UINT8 yytype_uint8;
#else
typedef unsigned char yytype_uint8;
#endif

#ifdef YYTYPE_INT8
typedef YYTYPE_INT8 yytype_int8;
#else
typedef signed char yytype_int8;
#endif

#ifdef YYTYPE_UINT16
typedef YYTYPE_UINT16 yytype_uint16;
#else
typedef unsigned short yytype_uint16;
#endif

#ifdef YYTYPE_INT16
typedef YYTYPE_INT16 yytype_int16;
#else
typedef short yytype_int16;
#endif

#ifndef YYSIZE_T
# ifdef __SIZE_TYPE__
#  define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
#  define YYSIZE_T size_t
# elif ! defined YYSIZE_T
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
#  define YYSIZE_T size_t
# else
#  define YYSIZE_T unsigned
# endif
#endif

#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)

#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
#  if ENABLE_NLS
#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
#  endif
# endif
# ifndef YY_
#  define YY_(Msgid) Msgid
# endif
#endif

#ifndef YY_ATTRIBUTE
# if (defined __GNUC__                                               \
      && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
     || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
#  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
# else
#  define YY_ATTRIBUTE(Spec) /* empty */
# endif
#endif

#ifndef YY_ATTRIBUTE_PURE
# define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
#endif

#ifndef YY_ATTRIBUTE_UNUSED
# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
#endif

/* Suppress unused-variable warnings by "using" E.  */
#if ! defined lint || defined __GNUC__
# define YYUSE(E) ((void) (E))
#else
# define YYUSE(E) /* empty */
#endif

#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
    _Pragma ("GCC diagnostic push") \
    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
    _Pragma ("GCC diagnostic pop")
#else
# define YY_INITIAL_VALUE(Value) Value
#endif
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
#endif
#ifndef YY_INITIAL_VALUE
# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif


#define YY_ASSERT(E) ((void) (0 && (E)))

#if ! defined yyoverflow || YYERROR_VERBOSE

/* The parser invokes alloca or malloc; define the necessary symbols.  */

# ifdef YYSTACK_USE_ALLOCA
#  if YYSTACK_USE_ALLOCA
#   ifdef __GNUC__
#    define YYSTACK_ALLOC __builtin_alloca
#   elif defined __BUILTIN_VA_ARG_INCR
#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
#   elif defined _AIX
#    define YYSTACK_ALLOC __alloca
#   elif defined _MSC_VER
#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
#    define alloca _alloca
#   else
#    define YYSTACK_ALLOC alloca
#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
#     ifndef EXIT_SUCCESS
#      define EXIT_SUCCESS 0
#     endif
#    endif
#   endif
#  endif
# endif

# ifdef YYSTACK_ALLOC
   /* Pacify GCC's 'empty if-body' warning.  */
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
#  ifndef YYSTACK_ALLOC_MAXIMUM
    /* The OS might guarantee only one guard page at the bottom of the stack,
       and a page size can be as small as 4096 bytes.  So we cannot safely
       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
       to allow for a few compiler-allocated temporary stack slots.  */
#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
#  endif
# else
#  define YYSTACK_ALLOC YYMALLOC
#  define YYSTACK_FREE YYFREE
#  ifndef YYSTACK_ALLOC_MAXIMUM
#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
#  endif
#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
       && ! ((defined YYMALLOC || defined malloc) \
             && (defined YYFREE || defined free)))
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
#   ifndef EXIT_SUCCESS
#    define EXIT_SUCCESS 0
#   endif
#  endif
#  ifndef YYMALLOC
#   define YYMALLOC malloc
#   if ! defined malloc && ! defined EXIT_SUCCESS
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
#   endif
#  endif
#  ifndef YYFREE
#   define YYFREE free
#   if ! defined free && ! defined EXIT_SUCCESS
void free (void *); /* INFRINGES ON USER NAME SPACE */
#   endif
#  endif
# endif
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */


#if (! defined yyoverflow \
     && (! defined __cplusplus \
         || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
             && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))

/* A type that is properly aligned for any stack member.  */
union yyalloc
{
  yytype_int16 yyss_alloc;
  YYSTYPE yyvs_alloc;
  YYLTYPE yyls_alloc;
};

/* The size of the maximum gap between one aligned stack and the next.  */
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)

/* The size of an array large to enough to hold all stacks, each with
   N elements.  */
# define YYSTACK_BYTES(N) \
     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
      + 2 * YYSTACK_GAP_MAXIMUM)

# define YYCOPY_NEEDED 1

/* Relocate STACK from its old location to the new one.  The
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
   elements in the stack, and YYPTR gives the new location of the
   stack.  Advance YYPTR to a properly aligned location for the next
   stack.  */
# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
    do                                                                  \
      {                                                                 \
        YYSIZE_T yynewbytes;                                            \
        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
        Stack = &yyptr->Stack_alloc;                                    \
        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
        yyptr += yynewbytes / sizeof (*yyptr);                          \
      }                                                                 \
    while (0)

#endif

#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
/* Copy COUNT objects from SRC to DST.  The source and destination do
   not overlap.  */
# ifndef YYCOPY
#  if defined __GNUC__ && 1 < __GNUC__
#   define YYCOPY(Dst, Src, Count) \
      __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
#  else
#   define YYCOPY(Dst, Src, Count)              \
      do                                        \
        {                                       \
          YYSIZE_T yyi;                         \
          for (yyi = 0; yyi < (Count); yyi++)   \
            (Dst)[yyi] = (Src)[yyi];            \
        }                                       \
      while (0)
#  endif
# endif
#endif /* !YYCOPY_NEEDED */

/* YYFINAL -- State number of the termination state.  */
#define YYFINAL  3
/* YYLAST -- Last index in YYTABLE.  */
#define YYLAST   1217

/* YYNTOKENS -- Number of terminals.  */
#define YYNTOKENS  157
/* YYNNTS -- Number of nonterminals.  */
#define YYNNTS  189
/* YYNRULES -- Number of rules.  */
#define YYNRULES  430
/* YYNSTATES -- Number of states.  */
#define YYNSTATES  851

#define YYUNDEFTOK  2
#define YYMAXUTOK   395

/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
   as returned by yylex, with out-of-bounds checking.  */
#define YYTRANSLATE(YYX)                                                \
  ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)

/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
   as returned by yylex.  */
static const yytype_uint8 yytranslate[] =
{
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,   143,   150,
     148,   149,   155,   141,   145,   142,   154,   156,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,   146,   144,
     152,   151,   153,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,   147,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
      55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
      65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
      75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
      85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
      95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
     105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
     115,   116,   117,   118,   119,   120,   121,   122,   123,   124,
     125,   126,   127,   128,   129,   130,   131,   132,   133,   134,
     135,   136,   137,   138,   139,   140
};

#if YYDEBUG
  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
static const yytype_uint16 yyrline[] =
{
       0,   390,   390,   390,   393,   394,   395,   401,   399,   419,
     429,   434,   440,   448,   456,   464,   469,   474,   482,   487,
     495,   505,   506,   510,   518,   519,   523,   535,   537,   539,
     541,   543,   545,   549,   551,   562,   563,   567,   568,   572,
     583,   588,   603,   641,   643,   645,   650,   655,   663,   672,
     680,   699,   708,   709,   713,   724,   733,   743,   750,   757,
     766,   782,   798,   809,   814,   822,   827,   835,   837,   842,
     844,   849,   851,   853,   859,   868,   869,   870,   871,   875,
     885,   893,   897,   898,   902,   903,   907,   908,   912,   913,
     917,   918,   922,   930,   937,   947,   952,   959,   959,   962,
     963,   967,   968,   973,   974,   978,   979,   983,   983,   986,
     991,   998,  1003,  1011,  1018,  1023,  1029,  1035,  1041,  1049,
    1050,  1054,  1071,  1079,  1088,  1097,  1104,  1109,  1117,  1145,
    1146,  1151,  1156,  1161,  1166,  1171,  1179,  1181,  1189,  1191,
    1199,  1201,  1209,  1211,  1219,  1221,  1226,  1231,  1239,  1260,
    1274,  1275,  1279,  1283,  1286,  1290,  1292,  1300,  1301,  1305,
    1307,  1315,  1321,  1329,  1329,  1331,  1331,  1338,  1357,  1368,
    1377,  1383,  1391,  1392,  1396,  1401,  1409,  1415,  1423,  1425,
    1431,  1435,  1437,  1446,  1450,  1451,  1455,  1460,  1465,  1474,
    1492,  1493,  1497,  1503,  1510,  1514,  1521,  1522,  1525,  1528,
    1534,  1543,  1567,  1586,  1605,  1606,  1607,  1610,  1610,  1613,
    1620,  1627,  1639,  1645,  1650,  1659,  1664,  1672,  1690,  1698,
    1707,  1708,  1712,  1713,  1716,  1717,  1721,  1722,  1723,  1724,
    1725,  1726,  1727,  1734,  1735,  1739,  1740,  1744,  1755,  1767,
    1781,  1785,  1786,  1790,  1792,  1799,  1799,  1802,  1804,  1811,
    1812,  1817,  1822,  1824,  1832,  1838,  1843,  1848,  1854,  1860,
    1895,  1903,  1910,  1911,  1912,  1916,  1922,  1928,  1935,  1944,
    1948,  1952,  1963,  1967,  1968,  1972,  1973,  1977,  2001,  2018,
    2020,  2026,  2030,  2037,  2042,  2046,  2060,  2077,  2082,  2090,
    2097,  2099,  2104,  2109,  2114,  2119,  2124,  2132,  2140,  2145,
    2150,  2160,  2161,  2165,  2174,  2184,  2189,  2200,  2204,  2209,
    2218,  2219,  2223,  2239,  2244,  2252,  2257,  2265,  2271,  2280,
    2281,  2285,  2286,  2287,  2288,  2289,  2290,  2291,  2292,  2293,
    2294,  2295,  2296,  2304,  2321,  2322,  2325,  2326,  2331,  2336,
    2341,  2346,  2352,  2361,  2362,  2366,  2367,  2390,  2394,  2399,
    2401,  2418,  2426,  2437,  2443,  2452,  2453,  2459,  2469,  2490,
    2503,  2508,  2512,  2513,  2517,  2518,  2522,  2523,  2526,  2526,
    2529,  2530,  2538,  2542,  2554,  2563,  2572,  2583,  2585,  2587,
    2594,  2596,  2601,  2606,  2611,  2619,  2640,  2647,  2652,  2659,
    2664,  2670,  2672,  2677,  2678,  2683,  2684,  2688,  2689,  2693,
    2694,  2700,  2705,  2711,  2720,  2731,  2738,  2739,  2743,  2748,
    2753,  2761,  2763,  2768,  2773,  2781,  2783,  2789,  2789,  2790,
    2790,  2791,  2791,  2792,  2792,  2793,  2793,  2794,  2794,  2795,
    2795
};
#endif

#if YYDEBUG || YYERROR_VERBOSE || 0
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
static const char *const yytname[] =
{
  "$end", "error", "$undefined", "K_abs", "K_access", "K_after",
  "K_alias", "K_all", "K_and", "K_architecture", "K_array", "K_assert",
  "K_assume", "K_assume_guarantee", "K_attribute", "K_begin", "K_block",
  "K_body", "K_buffer", "K_bus", "K_case", "K_component",
  "K_configuration", "K_constant", "K_context", "K_cover", "K_default",
  "K_disconnect", "K_downto", "K_else", "K_elsif", "K_end", "K_entity",
  "K_exit", "K_fairness", "K_file", "K_for", "K_force", "K_function",
  "K_generate", "K_generic", "K_group", "K_guarded", "K_if", "K_impure",
  "K_in", "K_inertial", "K_inout", "K_is", "K_label", "K_library",
  "K_linkage", "K_literal", "K_loop", "K_map", "K_mod", "K_nand", "K_new",
  "K_next", "K_nor", "K_not", "K_null", "K_of", "K_on", "K_open", "K_or",
  "K_others", "K_out", "K_package", "K_parameter", "K_port", "K_postponed",
  "K_procedure", "K_process", "K_property", "K_protected", "K_pure",
  "K_range", "K_record", "K_register", "K_reject", "K_release", "K_rem",
  "K_report", "K_restrict", "K_restrict_guarantee", "K_return",
  "K_reverse_range", "K_rol", "K_ror", "K_select", "K_sequence",
  "K_severity", "K_signal", "K_shared", "K_sla", "K_sll", "K_sra", "K_srl",
  "K_strong", "K_subtype", "K_then", "K_to", "K_transport", "K_type",
  "K_unaffected", "K_units", "K_until", "K_use", "K_variable", "K_vmode",
  "K_vprop", "K_vunit", "K_wait", "K_when", "K_while", "K_with", "K_xnor",
  "K_xor", "IDENTIFIER", "INT_LITERAL", "REAL_LITERAL", "STRING_LITERAL",
  "CHARACTER_LITERAL", "BITSTRING_LITERAL", "LEQ", "GEQ", "VASSIGN", "NE",
  "BOX", "EXP", "ARROW", "DLT", "DGT", "CC", "M_EQ", "M_NE", "M_LT",
  "M_LEQ", "M_GT", "M_GEQ", "'+'", "'-'", "'&'", "';'", "','", "':'",
  "'|'", "'('", "')'", "'\\''", "'='", "'<'", "'>'", "'.'", "'*'", "'/'",
  "$accept", "design_file", "$@1", "adding_operator", "architecture_body",
  "$@2", "architecture_body_start", "architecture_statement_part",
  "assertion_statement", "association_element", "association_list",
  "binding_indication", "binding_indication_semicolon_opt",
  "block_configuration", "block_configuration_opt",
  "block_declarative_item", "block_declarative_items",
  "block_declarative_items_opt", "case_statement",
  "case_statement_alternative_list", "case_statement_alternative",
  "choice", "choices", "component_configuration", "component_declaration",
  "instantiated_unit", "component_instantiation_statement",
  "component_specification", "composite_type_definition",
  "concurrent_conditional_signal_assignment",
  "concurrent_simple_signal_assignment", "else_when_waveforms",
  "else_when_waveform", "concurrent_signal_assignment_statement",
  "concurrent_statement", "configuration_declaration",
  "configuration_declarative_item", "configuration_declarative_items",
  "configuration_declarative_part", "configuration_item",
  "configuration_items", "configuration_items_opt", "constant_declaration",
  "context_clause", "context_item", "context_items", "design_unit",
  "design_units", "direction", "element_association",
  "element_association_list", "element_declaration",
  "element_declaration_list", "entity_aspect", "entity_aspect_opt",
  "entity_declaration", "enumeration_literal", "enumeration_literal_list",
  "expression_list", "expression", "expression_logical",
  "expression_logical_and", "expression_logical_or",
  "expression_logical_xnor", "expression_logical_xor", "factor",
  "for_generate_statement", "function_specification", "generate_statement",
  "generate_statement_body", "generic_clause_opt", "generic_clause",
  "generic_map_aspect_opt", "generic_map_aspect", "identifier_list",
  "identifier_opt", "identifier_colon_opt", "if_generate_statement",
  "if_statement", "if_statement_elsif_list_opt", "if_statement_elsif_list",
  "if_statement_elsif", "if_statement_else", "index_constraint",
  "index_subtype_definition", "index_subtype_definition_list",
  "instantiation_list", "interface_element",
  "interface_element_expression", "interface_list", "library_clause",
  "library_unit", "logical_name", "logical_name_list", "loop_statement",
  "mode", "mode_opt", "name", "name_list", "package_declaration",
  "package_declaration_start", "package_body_declarative_item",
  "package_body_declarative_items", "package_body_declarative_part_opt",
  "package_declarative_item", "package_declarative_items",
  "package_declarative_part_opt", "package_body", "package_body_start",
  "parameter_list", "parameter_list_opt", "port_clause", "port_clause_opt",
  "port_map_aspect", "port_map_aspect_opt", "prefix", "primary",
  "primary_unit", "procedure_call", "procedure_call_statement",
  "procedure_specification", "process_declarative_item",
  "process_declarative_part", "process_declarative_part_opt",
  "process_statement", "process_sensitivity_list_opt",
  "process_sensitivity_list", "range", "range_list",
  "record_type_definition", "relation", "report_statement",
  "return_statement", "secondary_unit", "selected_name", "selected_names",
  "selected_name_lib", "selected_names_lib", "selected_signal_assignment",
  "selected_waveform", "selected_waveform_list", "list_of_statements",
  "sequence_of_statements", "sequential_statement", "severity",
  "severity_opt", "shift_expression", "sign",
  "signal_declaration_assign_opt", "simple_expression",
  "simple_expression_2", "simple_expression_terms", "signal_assignment",
  "signal_assignment_statement", "subprogram_body_start",
  "subprogram_body", "subprogram_declaration",
  "subprogram_declarative_item", "subprogram_declarative_item_list",
  "subprogram_declarative_part", "subprogram_kind", "subprogram_kind_opt",
  "subprogram_specification", "subprogram_statement_part",
  "subtype_declaration", "subtype_indication", "suffix", "term",
  "type_declaration", "type_definition", "use_clause", "use_clause_lib",
  "use_clauses_lib", "use_clauses_opt", "variable_assignment_statement",
  "variable_assignment", "variable_declaration",
  "variable_declaration_assign_opt", "wait_statement", "waveform",
  "waveform_elements", "waveform_element", "K_architecture_opt",
  "K_configuration_opt", "K_entity_opt", "K_is_opt", "K_package_opt",
  "K_postponed_opt", "K_shared_opt", YY_NULLPTR
};
#endif

# ifdef YYPRINT
/* YYTOKNUM[NUM] -- (External) token number corresponding to the
   (internal) symbol number NUM (which must be that of a token).  */
static const yytype_uint16 yytoknum[] =
{
       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
     295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
     305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
     315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
     325,   326,   327,   328,   329,   330,   331,   332,   333,   334,
     335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
     345,   346,   347,   348,   349,   350,   351,   352,   353,   354,
     355,   356,   357,   358,   359,   360,   361,   362,   363,   364,
     365,   366,   367,   368,   369,   370,   371,   372,   373,   374,
     375,   376,   377,   378,   379,   380,   381,   382,   383,   384,
     385,   386,   387,   388,   389,   390,   391,   392,   393,   394,
     395,    43,    45,    38,    59,    44,    58,   124,    40,    41,
      39,    61,    60,    62,    46,    42,    47
};
# endif

#define YYPACT_NINF -693

#define yypact_value_is_default(Yystate) \
  (!!((Yystate) == (-693)))

#define YYTABLE_NINF -431

#define yytable_value_is_error(Yytable_value) \
  0

  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
     STATE-NUM.  */
static const yytype_int16 yypact[] =
{
    -693,   126,  1109,  -693,  -693,    13,    38,   438,  -693,    14,
    -693,   583,  -693,  -693,   -92,  -693,  -693,   -79,   165,    99,
    -693,   262,   230,    59,    62,    15,  -693,   296,  -693,  -693,
    -693,  -693,   328,  -693,   341,  -693,  -693,  -693,  -693,  -693,
    -693,   279,  -693,    49,  -693,   307,  -693,   398,   375,   419,
     420,   383,  -693,   476,   944,   242,  -693,  -693,   333,  -693,
     582,   500,   592,   591,  -693,  -693,     2,   517,    79,   519,
     521,   526,    93,    95,  -693,  -693,  -693,  -693,  1102,   616,
    -693,  -693,   505,  -693,  -693,  -693,   631,  -693,   193,   649,
     222,  -693,   634,  -693,    94,  -693,   575,   653,  -693,   575,
     556,   635,  -693,   658,   645,  -693,   667,   572,  -693,   362,
     569,   569,   670,   576,    -3,   -67,   577,  -693,   570,   291,
     391,   579,  -693,   645,  -693,   645,  -693,   645,  -693,  -693,
     222,   711,  -693,   618,  -693,  -693,  -693,  -693,   590,   624,
     593,    97,   595,   594,  -693,   710,   753,  -693,   575,  -693,
     355,  -693,   625,    98,   636,   657,  -693,  -693,   637,  -693,
      37,  -693,  -693,   111,   554,   111,   554,  -693,   104,   575,
     575,   575,  -693,   993,   107,  -693,  -693,   624,   727,  -693,
    -693,   615,   406,  -693,   275,  -693,   109,   621,   592,   622,
     129,  -693,   847,   752,  -693,  -693,  -693,  -693,    44,  -693,
    -693,   628,   738,   635,  -693,   639,   -15,   227,   654,   640,
     641,   627,   636,   662,  -693,  -693,   643,  -693,  -693,  -693,
    -693,   642,    52,    52,   644,   663,  -693,  -693,  -693,  -693,
    -693,  -693,   374,   368,  -693,  -693,   212,   379,   659,   646,
     263,   655,   518,    16,   477,  -693,   315,  -693,   656,   669,
     291,   650,   660,   677,    42,   554,   554,   588,   679,   666,
     218,    21,   384,  -693,  -693,   255,  -693,  -693,   460,  -693,
    -693,  -693,  -693,   844,  -693,  -693,  -693,  -693,   762,  -693,
    -693,  -693,   680,   432,  -693,   703,   796,   686,   285,   636,
    -693,   682,  -693,   575,  -693,   688,   522,  -693,   274,  -693,
     812,   803,  -693,   554,   629,  -693,   638,  -693,  -693,  -693,
    -693,   678,   774,  -693,    72,   541,  -693,  -693,   378,  -693,
     387,  -693,  -693,   687,  -693,  -693,  -693,   -56,  -693,   393,
    -693,  -693,   423,   554,  -693,    16,    16,    16,    16,   292,
      52,  -693,   554,   554,   554,   554,   554,   554,   554,   554,
     554,   554,   554,   554,  -693,  -693,   554,   554,   554,   554,
     554,   554,  -693,   554,  -693,  -693,  -693,    16,   315,  -693,
    -693,  -693,  -693,  -693,     6,   554,  -693,   137,   568,   795,
     -11,   743,  -693,   755,   261,  -693,   712,   554,   554,   554,
    -693,    68,   718,   739,  1038,   554,   164,   730,   442,  -693,
       6,  -693,   637,   757,   582,  -693,  -693,  -693,  -693,  -693,
     637,  -693,   719,   723,  -693,   637,   258,   554,   329,   122,
    -693,  -693,  -693,  -693,  -693,  -693,  -693,   798,  -693,   751,
    -693,  -693,   575,   856,     7,   300,  -693,   400,     7,   266,
     737,   205,  -693,   401,   637,   804,  -693,   637,   662,  -693,
     764,   145,  -693,   431,   554,   374,   374,  -693,  -693,  -693,
    -693,  -693,  -693,  -693,  -693,  -693,  -693,   876,  -693,  -693,
    -693,   821,  -693,   771,  -693,   772,  -693,  -693,  -693,  -693,
    -693,  -693,  -693,  -693,  -693,  -693,  -693,  -693,  -693,  -693,
    -693,    16,  -693,  -693,  -693,   575,   747,   773,  -693,  -693,
     749,   781,   853,   878,   893,   756,  -693,  -693,   758,   759,
     766,   150,   446,  -693,  -693,  -693,   320,   448,   467,   854,
     870,   858,  -693,  -693,  -693,   128,   761,  -693,   269,   768,
     575,   788,  -693,   757,   880,   575,   790,  -693,  -693,   791,
     164,  -693,   830,   373,   238,   916,  -693,  -693,   855,   176,
     782,   575,   554,  -693,   554,  -693,  -693,  -693,   805,   813,
     871,  -693,  -693,   793,  -693,   440,   816,  -693,  -693,  -693,
       7,  -693,   554,   554,   554,   554,  -693,   794,  -693,  -693,
    -693,   374,     5,  -693,   797,   912,    55,   912,  -693,  -693,
    -693,  -693,   800,   806,   808,   554,   894,  1038,   554,  -693,
     479,  -693,  -693,   822,   554,   824,  -693,   149,  -693,  -693,
    -693,   880,   917,   825,   554,  -693,   554,   826,   833,   104,
     837,   841,   554,   305,    11,  -693,  -693,   849,  -693,  -693,
     575,   801,   264,   243,  -693,   839,  -693,  -693,  -693,   904,
    -693,   637,  -693,   642,  -693,  -693,   857,  -693,  -693,  -693,
    -693,  -693,  -693,   204,   964,  -693,  -693,   554,   957,   912,
    -693,   946,   957,  -693,  -693,  -693,   934,   575,   961,   967,
    -693,  -693,  -693,  -693,  -693,  -693,    12,    23,   860,   852,
    -693,   965,  -693,  -693,  -693,  -693,  -693,   875,  -693,   962,
     963,   865,   960,   941,  -693,   343,   873,    33,   667,   554,
    -693,   554,  -693,  -693,  -693,   979,   874,   918,  1052,   989,
    -693,   877,   992,  1038,   882,   974,   164,   999,   350,   887,
     727,   104,   889,   164,   554,   274,  -693,   886,   981,  -693,
     897,   136,  -693,   327,  -693,   883,   898,   896,   222,  1009,
    1009,  -693,  -693,   942,   442,  -693,  1004,  -693,  1007,  1011,
    -693,   575,   907,  1020,   104,   104,  -693,  -693,   941,  -693,
    -693,  1028,   883,  -693,  -693,   548,   950,  1021,   191,  1035,
     144,   920,  -693,  -693,   104,  -693,  -693,   222,  1055,  -693,
     164,    45,  -693,    53,   442,  -693,   927,   929,  1022,   936,
    -693,  -693,   883,   883,  1042,  1048,  -693,   164,   487,   274,
    1039,   938,   468,   147,   883,  -693,  1066,   971,  -693,  -693,
    -693,  -693,  -693,   575,  -693,  -693,   945,  -693,  -693,  -693,
    1059,   575,  -693,  -693,   947,   473,    57,  1069,   554,   970,
    -693,  1062,   972,  -693,  -693,   798,   798,  -693,  -693,   575,
    -693,  1031,  1034,   973,   575,   575,  -693,   976,   978,  -693,
    -693
};

  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
     Performed when YYTABLE does not specify something else to do.  Zero
     means the default is an error.  */
static const yytype_uint16 yydefact[] =
{
       2,     0,     0,     1,   104,     0,     0,     0,   102,    97,
     106,     0,    99,   100,     0,   198,   200,     0,     0,     0,
     311,     0,     0,     0,     0,     0,   301,     0,   263,   262,
     103,   264,     0,   302,     0,   196,   197,   101,   105,   195,
     194,     0,   394,     0,   393,     0,     9,     0,     0,     0,
       0,     0,   219,     0,     0,     0,   199,   307,     0,   310,
     420,     0,   422,   154,   239,     7,     0,     0,     0,     0,
       0,     0,     0,     0,   226,   227,   370,   234,     0,     0,
     371,   228,     0,   229,   230,   231,     0,   223,   224,     0,
     365,   221,     0,   220,     0,   419,   164,     0,   421,   164,
       0,   246,   153,     0,   426,   232,   424,     0,   162,     0,
       0,   242,     0,     0,     0,     0,   209,   251,     0,   306,
       0,     0,   233,   426,   360,   426,   222,   426,   429,   363,
     364,     0,   361,     0,   357,   308,   309,   163,     0,    85,
       0,     0,     0,     0,   245,     0,     0,   425,   164,   423,
       0,    96,     0,     0,     0,     0,   241,   271,     0,   388,
       0,   386,   392,     0,     0,     0,     0,   391,     0,   164,
     164,   164,   362,     0,     0,    80,    83,    84,     0,    81,
     122,     0,     0,   193,     0,   155,     0,     0,   422,     0,
       0,    36,     0,     0,    27,    28,    30,    29,     0,    31,
      32,     0,     0,   246,   161,     0,   374,     0,     0,     0,
       0,     0,     0,     0,   390,    59,     0,   379,   377,   378,
     304,     0,     0,     0,   209,   255,   256,   257,   254,   258,
     343,   344,     0,     0,   127,   128,   380,   252,   144,     0,
     129,   210,   290,     0,   336,   348,   349,   303,     0,     0,
     305,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,   209,   329,   324,     0,   321,   326,   251,   270,
     325,   328,   327,     0,   372,   318,   355,   322,     0,   323,
     399,   330,     0,     0,    82,     0,     0,     0,   208,     0,
     240,     0,   243,   164,    34,     0,     0,    35,     0,   218,
       0,     0,    95,     0,     0,   375,     0,    93,   149,   373,
     387,     0,     0,   115,     0,     0,   123,   125,     0,   385,
     252,   146,   147,     0,   259,    44,    47,     0,   112,     0,
     110,    45,   336,     0,   211,     0,     0,     0,     0,     0,
       0,   212,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,   347,   108,     0,     0,     0,     0,
       0,     0,   107,     0,     4,     5,     6,     0,   350,   214,
     213,   217,   238,   237,   369,     0,   332,   335,   336,     0,
       0,     0,   331,   335,     0,   299,     0,     0,     0,     0,
     265,     0,     0,     0,     0,     0,     0,     0,     0,   317,
     369,   405,     0,   398,   420,   156,   204,   206,   205,   207,
       0,   192,     0,     0,    33,     0,     0,     0,   209,     0,
      75,    69,    67,    76,    11,   151,    77,   428,   150,   251,
      78,    71,   164,     0,     0,     0,   287,     0,     0,     0,
       0,   209,   185,     0,     0,     0,   114,     0,     0,   389,
       0,   209,    19,     0,     0,     0,     0,   261,   126,   383,
     384,   381,   382,   285,   286,   253,   145,   130,   136,   133,
     134,   131,   138,   135,   140,   132,   142,   294,   295,   296,
     291,   292,   293,   342,   341,   340,   338,   339,   337,   284,
     351,     0,   366,   367,   368,   164,     0,     0,    13,   334,
       0,     0,     0,     0,     0,     0,   300,   298,     0,     0,
       0,     0,   209,   269,   356,   400,     0,     0,     0,     0,
       0,     0,   416,   412,   415,     0,   411,   414,     0,     0,
     164,   407,   396,   397,    91,   164,   191,   244,   121,   346,
       0,    12,     0,     0,     0,   418,    10,   427,     0,     0,
       0,   164,     0,   182,     0,   181,    94,    92,     0,     0,
       0,    57,   289,     0,   124,     0,     0,   260,   109,    46,
      43,   111,     0,     0,     0,     0,   352,     0,   403,   333,
      14,     0,     0,    41,     0,   173,     0,   173,   297,   408,
     409,   410,     0,     0,   211,     0,     0,     0,     0,   353,
       0,   402,   401,     0,     0,     0,   395,     0,    86,    87,
      89,    90,     0,     0,     0,   189,     0,     0,     0,     0,
       0,     0,     0,    52,     0,    70,    68,   251,    72,   417,
     164,   281,     0,     0,    51,     0,   376,   288,   183,     0,
     184,     0,   113,    17,    16,    15,     0,    18,   137,   139,
     141,   143,   359,     0,     0,    40,   171,     0,   180,   172,
     175,     0,   180,   268,   266,   267,     0,   164,     0,     0,
     413,   358,   406,   404,   188,   187,   162,     0,   186,     0,
      88,     0,    79,   190,   345,    26,    74,   251,    53,     0,
       0,     0,     0,   250,   157,     0,     0,     0,   424,     0,
      73,     0,    62,    50,    58,     0,     0,     0,     0,     0,
     174,     0,     0,     0,     0,     0,     0,     0,   120,     0,
      25,     0,     0,     0,     0,     0,    55,     0,     0,   249,
       0,     0,     8,     0,   282,   216,   283,     0,   276,     0,
       0,    42,    39,     0,   179,   178,     0,   170,     0,     0,
     203,   164,     0,     0,     0,     0,   118,   119,   250,    21,
      24,     0,    56,    23,   316,     0,     0,     0,     0,     0,
       0,     0,    54,   280,     0,   279,   274,   275,     0,   272,
       0,     0,    64,     0,   177,   176,     0,     0,     0,     0,
     354,    49,   117,   116,   158,     0,   312,     0,     0,     0,
       0,     0,     0,     0,   215,   273,     0,    66,    61,    63,
      60,   169,   168,   164,   201,    20,     0,   315,   314,   313,
       0,   164,   160,   159,     0,     0,     0,     0,     0,     0,
      48,     0,     0,   248,   247,   428,   428,    65,   202,   164,
     167,     0,     0,     0,   164,   164,   148,     0,     0,   278,
     277
};

  /* YYPGOTO[NTERM-NUM].  */
static const yytype_int16 yypgoto[] =
{
    -693,  -693,  -693,   760,  -693,  -693,  -693,   817,  -693,   545,
    -382,  -693,  -693,  -177,  -693,   937,  -693,  -693,  -693,  -693,
     544,   675,   551,  -693,  -109,  -693,  -693,  -693,  -693,   596,
     599,   394,  -158,  -693,  -413,  -693,   959,  -693,  -693,   532,
    -693,  -693,   -85,  -693,  1128,  -693,  1133,  -693,   713,   689,
    -693,   832,  -693,  -693,  -693,  -693,   700,  -693,   763,  -143,
     765,  -693,  -693,  -693,  -693,   323,  -693,  -693,  -693,   351,
    1006,  -693,   360,  -693,   -63,   -99,  -290,  -693,  -693,   571,
    -693,   502,   501,   951,   605,  -693,  -693,   879,  -693,  -693,
    -693,  -693,  1125,  -693,  -693,  -693,  -693,   -71,  -693,  -693,
    -693,  1081,  -693,  -693,  1092,  -693,  -693,  -693,  -693,   -43,
    -693,  -693,   969,  -693,   415,  -693,  -181,  -693,   784,  -693,
    -693,   399,  -693,  -693,  -693,  -693,  -693,  -157,  -693,  -693,
    -316,   807,  -693,  -693,   197,  -693,  1135,  -693,   647,   381,
    -693,  -693,  -379,   909,  -693,   809,   464,  -693,  -693,  -153,
     940,  -693,   802,  -693,  -693,   133,   169,  1056,  -693,  -693,
    -693,   787,   -30,  -693,  -693,  -155,  1023,  -349,   181,  -693,
     -33,  -142,  -693,  -693,  -693,   810,  -692,  -693,  -693,  -380,
    -693,   589,  -693,   792,  1003,   496,   376,  -136,  -693
};

  /* YYDEFGOTO[NTERM-NUM].  */
static const yytype_int16 yydefgoto[] =
{
      -1,     1,     2,   367,    26,   103,    27,   768,   263,   452,
     453,   719,   720,   608,   761,   191,   192,   193,   264,   582,
     583,   326,   327,   609,    74,   624,   420,   677,   214,   421,
     422,   781,   782,   423,   424,    28,   176,   177,   178,   610,
     611,   612,    75,     7,     8,     9,    10,    11,   363,   328,
     329,   313,   314,   757,   758,    29,   317,   318,   233,   524,
     235,   467,   471,   473,   475,   236,   425,    76,   426,   769,
     101,   102,   693,   694,   182,   138,   265,   428,   266,   658,
     659,   660,   709,   305,   442,   443,   679,   183,   615,   184,
      12,    30,    16,    17,   267,   409,   410,   320,   736,    31,
      32,    87,    88,    89,    77,    78,    79,    33,    34,   142,
     157,   144,   145,   729,   730,   118,   238,    35,   269,   270,
      80,   776,   777,   778,   430,   698,   737,   331,   437,   215,
     240,   271,   272,    36,   241,   120,    20,    21,   431,   764,
     765,   273,   274,   275,   499,   500,   242,   243,   617,   378,
     245,   368,   276,   277,    90,    91,    81,   129,   130,   131,
     494,   495,    82,   278,    83,   207,   220,   246,    84,   216,
      85,    13,   533,   534,   279,   280,   132,   605,   281,   633,
     526,   527,   630,    96,    99,   150,   148,   548,   133
};

  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
     positive, shift that token.  If negative, reduce the rule whose
     number is the opposite.  If YYTABLE_NINF, syntax error.  */
static const yytype_int16 yytable[] =
{
     140,   286,   117,   209,   200,   109,   546,   239,   427,   249,
     517,   244,   691,   244,    14,   520,   525,   221,   490,   222,
     502,   234,    93,   248,   717,    92,   468,   469,   470,   472,
     474,   476,    51,   104,   733,   355,   654,   194,   210,    18,
     734,   321,   322,  -398,   492,   160,   779,   211,  -398,   201,
     200,   692,    39,   221,   -22,    93,    57,   387,    92,   -22,
      47,   195,   303,    49,     5,    40,    41,   155,   156,   511,
     251,   252,   253,   374,   780,   454,   223,   162,   493,   332,
     107,  -158,   780,   194,   388,   779,   661,   163,   835,   330,
     503,   455,   134,   237,   113,   237,   115,   117,   181,   205,
     187,   135,   268,   445,  -165,   221,   179,   195,   282,   362,
     291,   283,   377,   379,   381,   212,   198,   386,   217,   581,
       6,  -165,     6,   544,   585,   587,     3,   296,   389,   427,
     295,   718,    15,   304,    52,   224,   225,   226,   227,   228,
     229,   161,   576,   163,   179,   801,   105,   436,   824,   315,
     434,   438,   116,   545,   436,  -158,   674,    19,   438,   466,
     618,   237,   198,   440,   232,   221,   239,   222,    58,   375,
     244,   224,   225,   226,   227,   228,   229,   632,    48,   222,
     234,    50,   375,  -165,   375,   213,   376,   512,   124,   808,
     458,   108,   544,  -166,   413,  -166,   163,   810,   108,   376,
     232,   376,   268,   483,   484,   485,   486,   487,   488,   163,
     489,   163,   114,   136,   116,   675,   108,   206,   668,   384,
     259,   222,  -152,   116,   223,   522,   108,   429,   108,   497,
     218,    69,   496,   237,   219,   239,   223,   522,   417,   244,
     237,   418,   598,    86,   508,   509,   510,   531,   108,   234,
     699,   315,   237,    43,   529,   536,   648,   649,   650,   651,
     539,   532,  -166,   646,  -166,    70,   646,   335,   676,   523,
     119,   342,   599,  -225,   542,   416,   565,   375,   223,   196,
      69,   523,   558,   224,   225,   226,   227,   228,   229,   561,
     163,   393,   563,   323,   336,   224,   225,   226,   227,   228,
     229,    73,   570,   332,   163,   230,   231,   417,   394,    42,
     418,   568,   232,   330,    70,   197,   128,   230,   231,   343,
     268,   237,   344,   268,   232,   196,   741,   199,   345,   745,
     406,  -430,   407,   550,   749,   705,   752,   224,   225,   226,
     227,   228,   229,   766,   731,  -166,   222,  -166,   429,    46,
      73,   455,   408,   323,   306,   546,   202,   701,    53,   230,
     231,   197,   385,   540,   785,   250,   232,   337,   338,   463,
     395,   307,   754,   199,   221,   221,    54,   222,   699,   464,
     346,   347,   755,   540,   237,   237,  -154,   702,   802,    55,
     417,   606,   163,   418,   620,   100,   577,   637,    15,   636,
     807,   438,   541,   223,   522,   506,    44,    45,   700,   621,
     556,   465,   163,   601,   756,   163,   622,   766,   163,   289,
     163,   825,   645,   163,   290,  -154,    19,   827,   570,    60,
    -209,   603,   268,   268,   223,   427,   613,    61,   666,   166,
     325,   643,   438,   222,  -165,  -210,  -165,    22,   523,   553,
      62,   355,   635,   164,   163,   669,   364,   365,   366,  -209,
      23,   672,   224,   225,   226,   227,   228,   229,    63,   592,
      24,   683,   627,   684,   163,   543,   773,   164,   427,   690,
     221,   163,   222,   237,   230,   231,   704,    94,   221,   417,
     222,   232,   623,   224,   225,   226,   227,   228,   229,   169,
     223,   170,    64,   171,   644,   355,    25,   152,   153,   427,
     237,   356,   357,   333,   707,   230,   231,   334,   358,   359,
     360,   361,   232,   448,   237,   362,   268,   449,   390,   339,
     391,   696,   392,  -251,   532,   167,   168,   450,   456,   223,
     522,  -251,   457,   760,   678,   554,   559,   223,   687,   555,
     560,   152,   288,   818,   -43,   221,   739,   222,   740,   224,
     225,   226,   227,   228,   229,   356,   357,   767,   714,   375,
     -43,   438,   358,   359,   360,   361,   566,   152,   402,   362,
     567,   230,   231,    -3,     4,   396,   376,   397,   232,   380,
     390,   222,   -98,   566,   392,    65,   163,   593,   224,   225,
     226,   227,   228,   229,    95,   -98,   224,   225,   226,   227,
     228,   229,   333,   566,   223,   -98,   594,   823,   566,    97,
     230,   231,   834,   809,    98,   809,   735,   232,   230,   231,
     435,   100,   222,     5,   268,   232,   106,   268,   110,   439,
     111,   222,   268,   348,   349,   112,   350,   123,   223,   124,
     762,   -98,   789,   237,   429,   819,   356,   357,   459,   460,
     461,   462,   125,   358,   359,   360,   361,   152,   415,   351,
     352,   353,   268,   224,   225,   226,   227,   228,   229,   435,
     127,   222,   134,   792,   793,   837,   152,   447,   221,   223,
     222,     6,   796,   797,   137,   230,   231,   429,   223,   841,
     842,   139,   232,   804,   141,   143,   146,   224,   225,   226,
     227,   228,   229,   147,   829,   149,   151,   154,   158,   516,
     159,   222,   832,   105,   165,   164,   173,   174,   429,   230,
     231,   528,    73,   222,   175,   268,   232,   180,   223,   185,
     843,   188,   186,   208,   204,   847,   848,   223,   224,   225,
     226,   227,   228,   229,   189,   108,   206,   224,   225,   226,
     227,   228,   229,   285,   287,   292,   294,   298,   -38,   300,
     230,   231,   299,   308,    67,   311,    68,   232,   223,   230,
     231,   316,   324,   302,   309,   310,   232,   319,   383,   340,
     223,    69,   323,   400,   371,   341,   163,   441,   225,   226,
     227,   228,   229,   166,   372,   369,   451,   225,   226,   227,
     228,   229,   477,   478,   479,   480,   481,   482,   370,   230,
     231,   373,   403,   382,   401,    70,   232,   404,   230,   231,
     405,   412,   414,   432,   433,   232,   444,   451,   225,   226,
     227,   228,   229,   501,   504,   398,   190,   497,   189,   224,
     225,   226,   227,   228,   229,   255,   507,    72,   519,   230,
     231,     6,   -37,   537,   256,     6,   232,   538,    67,   547,
      68,   230,   231,  -319,  -319,  -319,   549,   551,   232,   398,
    -166,   557,   562,   465,   572,    69,   573,   257,   574,   255,
     575,   578,   579,   580,   586,   581,   584,  -166,   256,   595,
     588,   596,   589,   590,   255,   258,   600,  -320,  -320,  -320,
     591,   597,   602,   256,  -166,   604,   607,   614,   616,    70,
     619,   257,  -320,  -320,  -320,   629,   634,   259,   631,  -166,
     260,  -166,   639,   641,   638,   646,   257,   642,   652,   258,
     190,   656,   657,   784,   663,    66,  -166,   667,   681,   697,
     664,    72,   665,   255,   258,     6,   688,   261,  -319,  -166,
     689,   259,   256,   262,   260,    67,   671,    68,   673,   682,
     685,  -320,  -320,  -320,   695,  -236,   259,   686,  -166,   260,
     398,   558,    69,   703,   706,   257,   708,   713,   565,   711,
     255,   261,   715,  -166,   254,  -166,   716,   262,   721,   256,
     723,   722,   725,   258,   255,   152,   261,   724,  -166,   726,
    -320,   728,   262,   256,   727,  -166,    70,   732,   742,   743,
     746,   747,   257,   748,  -320,   259,   750,   751,   260,  -166,
     753,   759,  -166,   763,   770,   771,   257,  -251,   780,   398,
     258,   772,   788,   774,    71,   775,  -166,   786,    72,   255,
     787,   790,    73,   744,   258,   261,   791,  -166,   256,   795,
     799,   262,   259,   255,   798,   260,   800,   826,   803,  -320,
     806,   811,   256,   812,  -166,   813,   259,   255,   821,   260,
     814,   257,   692,  -320,   816,   828,   256,   822,  -166,   830,
     831,  -166,   261,  -320,  -166,   257,   833,  -320,   262,   258,
     836,   839,  -166,   121,   844,  -166,   261,   845,  -166,   257,
       4,   647,   262,   258,   838,   419,   840,   846,   -98,  -166,
     849,   259,   850,    67,   260,    68,   655,   258,   491,   297,
     569,   -98,   653,  -235,   783,   259,   284,    37,   260,   625,
      69,   -98,   626,   680,    38,   571,   446,   552,   564,   259,
     820,   261,   260,  -166,   815,   518,   203,   262,   662,     5,
     521,   710,   312,   712,   640,   261,    56,  -166,   411,   126,
     122,   262,   301,   794,    70,   513,   805,   -98,   817,   261,
      59,  -166,   399,   354,   498,   262,   172,   530,   247,   670,
     628,   293,   505,   514,   738,     0,   535,     0,     0,     0,
       0,   515,    71,     0,     0,     0,    72,     0,     0,     0,
      73,     0,     0,     0,     0,     0,     0,     6
};

static const yytype_int16 yycheck[] =
{
      99,   178,    73,   158,   146,    68,   419,   164,   298,   166,
     392,   164,     1,   166,     1,   394,   396,     1,   367,     3,
      31,   164,    55,   166,     1,    55,   342,   343,   344,   345,
     346,   347,    17,    31,     1,    28,    31,   146,     1,     1,
       7,   222,   223,    31,    38,    48,   738,    10,    36,   148,
     192,    40,   144,     1,    31,    88,     7,    36,    88,    36,
       1,   146,    77,     1,    50,   144,   145,   110,   111,     1,
     169,   170,   171,    31,    29,   131,    60,   144,    72,   232,
       1,    70,    29,   192,    63,   777,    31,   154,    31,   232,
     101,   147,    48,   164,     1,   166,     1,   168,     1,     1,
     143,     7,   173,    31,    36,     1,   139,   192,     1,   102,
       1,   174,   255,   256,   257,    78,   146,   260,     7,   114,
     108,    53,   108,     1,   503,   504,     0,   190,   107,   419,
       1,   108,   119,   148,   119,   119,   120,   121,   122,   123,
     124,   144,   491,   154,   177,     1,   144,   304,     1,   212,
     303,   304,   119,    31,   311,   144,     7,   119,   311,   340,
     540,   232,   192,   306,   148,     1,   323,     3,   119,   127,
     323,   119,   120,   121,   122,   123,   124,     1,   119,     3,
     323,   119,   127,   115,   127,   148,   144,   119,   144,   144,
     333,   119,     1,    71,   293,    73,   154,   144,   119,   144,
     148,   144,   273,   356,   357,   358,   359,   360,   361,   154,
     363,   154,   119,   119,   119,    66,   119,   119,   597,     1,
      83,     3,    31,   119,    60,    61,   119,   298,   119,    92,
     119,    38,   375,   304,   123,   392,    60,    61,   116,   392,
     311,   119,   114,     1,   387,   388,   389,   402,   119,   392,
     114,   314,   323,   154,   397,   410,   572,   573,   574,   575,
     415,   403,    71,   119,    73,    72,   119,    55,   119,   105,
      73,     8,   144,    31,   417,     1,   131,   127,    60,   146,
      38,   105,    77,   119,   120,   121,   122,   123,   124,   444,
     154,    36,   447,   148,    82,   119,   120,   121,   122,   123,
     124,   108,   455,   456,   154,   141,   142,   116,    53,   144,
     119,   454,   148,   456,    72,   146,    94,   141,   142,    56,
     391,   392,    59,   394,   148,   192,   705,   146,    65,   708,
      45,   109,    47,   432,   713,   131,   716,   119,   120,   121,
     122,   123,   124,   723,     1,    71,     3,    73,   419,   119,
     108,   147,    67,   148,   127,   768,     1,   114,    62,   141,
     142,   192,   144,   125,   743,   168,   148,   155,   156,    77,
     115,   144,    22,   192,     1,     1,    48,     3,   114,    87,
     117,   118,    32,   125,   455,   456,    31,   144,   770,    48,
     116,   533,   154,   119,    21,    40,   495,   554,   119,   552,
     780,   554,   144,    60,    61,   144,   144,   145,   144,    36,
     144,   119,   154,   144,    64,   154,    43,   797,   154,   144,
     154,   803,   565,   154,   149,    70,   119,   806,   581,    31,
     125,   530,   503,   504,    60,   725,   535,    62,   595,   148,
      66,     1,   595,     3,    71,   154,    73,     9,   105,   149,
      31,    28,   551,   148,   154,   598,   141,   142,   143,   154,
      22,   604,   119,   120,   121,   122,   123,   124,    48,   149,
      32,   614,   543,   616,   154,   146,   149,   148,   768,   622,
       1,   154,     3,   554,   141,   142,   641,   154,     1,   116,
       3,   148,   119,   119,   120,   121,   122,   123,   124,   123,
      60,   125,   119,   127,    64,    28,    68,   145,   146,   799,
     581,    88,    89,   145,   657,   141,   142,   149,    95,    96,
      97,    98,   148,   145,   595,   102,   597,   149,   144,   150,
     146,   630,   148,   154,   676,   144,   145,   150,   145,    60,
      61,   154,   149,   720,   607,   145,   145,    60,   619,   149,
     149,   145,   146,    66,   131,     1,   699,     3,   701,   119,
     120,   121,   122,   123,   124,    88,    89,   724,   667,   127,
     147,   724,    95,    96,    97,    98,   145,   145,   146,   102,
     149,   141,   142,     0,     1,   125,   144,   127,   148,     1,
     144,     3,     9,   145,   148,   119,   154,   149,   119,   120,
     121,   122,   123,   124,    22,    22,   119,   120,   121,   122,
     123,   124,   145,   145,    60,    32,   149,   149,   145,   119,
     141,   142,   149,   781,    32,   783,   697,   148,   141,   142,
       1,    40,     3,    50,   705,   148,   119,   708,   119,     1,
     119,     3,   713,   125,   126,   119,   128,    31,    60,   144,
     721,    68,   751,   724,   725,   798,    88,    89,   335,   336,
     337,   338,    31,    95,    96,    97,    98,   145,   146,   151,
     152,   153,   743,   119,   120,   121,   122,   123,   124,     1,
      31,     3,    48,   754,   755,   828,   145,   146,     1,    60,
       3,   108,   144,   145,   119,   141,   142,   768,    60,   835,
     836,    48,   148,   774,   148,    70,    48,   119,   120,   121,
     122,   123,   124,    68,   813,    48,   144,   148,    48,     1,
     144,     3,   821,   144,   154,   148,    15,   109,   799,   141,
     142,     1,   108,     3,   144,   806,   148,   144,    60,   144,
     839,    31,   148,    86,   119,   844,   845,    60,   119,   120,
     121,   122,   123,   124,     1,   119,   119,   119,   120,   121,
     122,   123,   124,    36,   149,   144,   144,    15,    15,    31,
     141,   142,   144,   119,    21,   148,    23,   148,    60,   141,
     142,   119,   119,   144,   144,   144,   148,   144,   122,   130,
      60,    38,   148,    31,   144,   149,   154,   119,   120,   121,
     122,   123,   124,   148,   144,   149,   119,   120,   121,   122,
     123,   124,   348,   349,   350,   351,   352,   353,   149,   141,
     142,   144,   119,   144,   144,    72,   148,    31,   141,   142,
     144,   149,   144,    21,    31,   148,    62,   119,   120,   121,
     122,   123,   124,    48,   101,     1,    93,    92,     1,   119,
     120,   121,   122,   123,   124,    11,   144,   104,   119,   141,
     142,   108,    15,   144,    20,   108,   148,   144,    21,    71,
      23,   141,   142,    29,    30,    31,   125,    21,   148,     1,
      36,   144,    78,   119,     8,    38,    65,    43,   117,    11,
     118,   144,   119,   144,     1,   114,    43,    53,    20,    45,
     144,    31,   144,   144,    11,    61,   145,    29,    30,    31,
     144,    53,   144,    20,    36,   127,    36,   127,   127,    72,
      90,    43,    29,    30,    31,     9,   144,    83,    73,    36,
      86,    53,   119,    62,   129,   119,    43,   144,   144,    61,
      93,   144,    30,     1,   144,     1,    53,    53,    31,   148,
     144,   104,   144,    11,    61,   108,   119,   113,   114,   115,
     119,    83,    20,   119,    86,    21,   144,    23,   144,   144,
     144,    29,    30,    31,   125,    31,    83,   144,    36,    86,
       1,    77,    38,   144,    20,    43,    29,    53,   131,    43,
      11,   113,    31,   115,     1,    53,    29,   119,   146,    20,
     125,    36,    39,    61,    11,   145,   113,    45,   115,   144,
      31,    70,   119,    20,    54,    36,    72,   144,   144,   101,
      31,   144,    43,    31,    31,    83,   144,    53,    86,    36,
      31,   144,    53,   144,   148,    54,    43,   154,    29,     1,
      61,   144,    31,   145,   100,   149,    53,    43,   104,    11,
      43,   144,   108,     1,    61,   113,    36,   115,    20,    31,
      39,   119,    83,    11,   114,    86,    31,     1,   148,    31,
      15,   144,    20,   144,    36,    53,    83,    11,    39,    86,
     144,    43,    40,    31,    36,   114,    20,   149,    36,   144,
      31,    53,   113,   114,   115,    43,   149,    31,   119,    61,
      31,    39,    36,     1,    73,    53,   113,    73,   115,    43,
       1,   566,   119,    61,   144,   298,   144,   144,     9,    53,
     144,    83,   144,    21,    86,    23,   582,    61,   368,   192,
     455,    22,   581,    31,   740,    83,   177,     9,    86,   543,
      38,    32,   543,   611,    11,   456,   314,   434,   448,    83,
     799,   113,    86,   115,   794,   392,   150,   119,   587,    50,
     395,   659,   211,   662,   559,   113,    41,   115,   289,    88,
      78,   119,   203,   758,    72,   391,   777,    68,   797,   113,
      45,   115,   273,   243,   377,   119,   130,   400,   165,   600,
     543,   188,   383,   391,   698,    -1,   404,    -1,    -1,    -1,
      -1,   391,   100,    -1,    -1,    -1,   104,    -1,    -1,    -1,
     108,    -1,    -1,    -1,    -1,    -1,    -1,   108
};

  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
     symbol of state STATE-NUM.  */
static const yytype_uint16 yystos[] =
{
       0,   158,   159,     0,     1,    50,   108,   200,   201,   202,
     203,   204,   247,   328,     1,   119,   249,   250,     1,   119,
     293,   294,     9,    22,    32,    68,   161,   163,   192,   212,
     248,   256,   257,   264,   265,   274,   290,   201,   203,   144,
     144,   145,   144,   154,   144,   145,   119,     1,   119,     1,
     119,    17,   119,    62,    48,    48,   249,     7,   119,   293,
      31,    62,    31,    48,   119,   119,     1,    21,    23,    38,
      72,   100,   104,   108,   181,   199,   224,   261,   262,   263,
     277,   313,   319,   321,   325,   327,     1,   258,   259,   260,
     311,   312,   319,   327,   154,    22,   340,   119,    32,   341,
      40,   227,   228,   162,    31,   144,   119,     1,   119,   231,
     119,   119,   119,     1,   119,     1,   119,   254,   272,   291,
     292,     1,   261,    31,   144,    31,   258,    31,    94,   314,
     315,   316,   333,   345,    48,     7,   119,   119,   232,    48,
     232,   148,   266,    70,   268,   269,    48,    68,   343,    48,
     342,   144,   145,   146,   148,   266,   266,   267,    48,   144,
      48,   144,   144,   154,   148,   154,   148,   144,   145,   343,
     343,   343,   314,    15,   109,   144,   193,   194,   195,   327,
     144,     1,   231,   244,   246,   144,   148,   266,    31,     1,
      93,   172,   173,   174,   181,   199,   312,   313,   319,   325,
     328,   232,     1,   227,   119,     1,   119,   322,    86,   322,
       1,    10,    78,   148,   185,   286,   326,     7,   119,   123,
     323,     1,     3,    60,   119,   120,   121,   122,   123,   124,
     141,   142,   148,   215,   216,   217,   222,   254,   273,   284,
     287,   291,   303,   304,   306,   307,   324,   323,   216,   284,
     291,   232,   232,   232,     1,    11,    20,    43,    61,    83,
      86,   113,   119,   165,   175,   233,   235,   251,   254,   275,
     276,   288,   289,   298,   299,   300,   309,   310,   320,   331,
     332,   335,     1,   231,   193,    36,   170,   149,   146,   144,
     149,     1,   144,   341,   144,     1,   231,   172,    15,   144,
      31,   269,   144,    77,   148,   240,   127,   144,   119,   144,
     144,   148,   240,   208,   209,   231,   119,   213,   214,   144,
     254,   273,   273,   148,   119,    66,   178,   179,   206,   207,
     216,   284,   306,   145,   149,    55,    82,   155,   156,   150,
     130,   149,     8,    56,    59,    65,   117,   118,   125,   126,
     128,   151,   152,   153,   307,    28,    88,    89,    95,    96,
      97,    98,   102,   205,   141,   142,   143,   160,   308,   149,
     149,   144,   144,   144,    31,   127,   144,   216,   306,   216,
       1,   216,   144,   122,     1,   144,   216,    36,    63,   107,
     144,   146,   148,    36,    53,   115,   125,   127,     1,   300,
      31,   144,   146,   119,    31,   144,    45,    47,    67,   252,
     253,   244,   149,   232,   144,   146,     1,   116,   119,   164,
     183,   186,   187,   190,   191,   223,   225,   233,   234,   254,
     281,   295,    21,    31,   306,     1,   284,   285,   306,     1,
     216,   119,   241,   242,    62,    31,   208,   146,   145,   149,
     150,   119,   166,   167,   131,   147,   145,   149,   216,   222,
     222,   222,   222,    77,    87,   119,   273,   218,   287,   287,
     287,   219,   287,   220,   287,   221,   287,   303,   303,   303,
     303,   303,   303,   306,   306,   306,   306,   306,   306,   306,
     324,   160,    38,    72,   317,   318,   216,    92,   288,   301,
     302,    48,    31,   101,   101,   302,   144,   144,   216,   216,
     216,     1,   119,   275,   309,   332,     1,   167,   215,   119,
     299,   217,    61,   105,   216,   336,   337,   338,     1,   216,
     318,   322,   328,   329,   330,   340,   322,   144,   144,   322,
     125,   144,   216,   146,     1,    31,   191,    71,   344,   125,
     232,    21,   205,   149,   145,   149,   144,   144,    77,   145,
     149,   322,    78,   322,   213,   131,   145,   149,   216,   178,
     306,   206,     8,    65,   117,   118,   324,   232,   144,   119,
     144,   114,   176,   177,    43,   299,     1,   299,   144,   144,
     144,   144,   149,   149,   149,    45,    31,    53,   114,   144,
     145,   144,   144,   232,   127,   334,   328,    36,   170,   180,
     196,   197,   198,   232,   127,   245,   127,   305,   336,    90,
      21,    36,    43,   119,   182,   186,   187,   254,   295,     9,
     339,    73,     1,   336,   144,   232,   306,   284,   129,   119,
     241,    62,   144,     1,    64,   216,   119,   166,   287,   287,
     287,   287,   144,   179,    31,   177,   144,    30,   236,   237,
     238,    31,   236,   144,   144,   144,   284,    53,   299,   216,
     338,   144,   216,   144,     7,    66,   119,   184,   231,   243,
     196,    31,   144,   216,   216,   144,   144,   254,   119,   119,
     216,     1,    40,   229,   230,   125,   232,   148,   282,   114,
     144,   114,   144,   144,   322,   131,    20,   216,    29,   239,
     238,    43,   239,    53,   232,    31,    29,     1,   108,   168,
     169,   146,    36,   125,    45,    39,   144,    54,    70,   270,
     271,     1,   144,     1,     7,   254,   255,   283,   342,   216,
     216,   299,   144,   101,     1,   299,    31,   144,    31,   299,
     144,    53,   336,    31,    22,    32,    64,   210,   211,   144,
     170,   171,   254,   144,   296,   297,   336,   284,   164,   226,
     148,    54,   144,   149,   145,   149,   278,   279,   280,   333,
      29,   188,   189,   188,     1,   299,    43,    43,    31,   232,
     144,    36,   254,   254,   271,    31,   144,   145,   114,    39,
      31,     1,   167,   148,   254,   278,    15,   336,   144,   189,
     144,   144,   144,    53,   144,   229,    36,   296,    66,   216,
     226,    39,   149,   149,     1,   167,     1,   299,   114,   232,
     144,    31,   232,   149,   149,    31,    31,   216,   144,    39,
     144,   344,   344,   232,    73,    73,   144,   232,   232,   144,
     144
};

  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
static const yytype_uint16 yyr1[] =
{
       0,   157,   159,   158,   160,   160,   160,   162,   161,   163,
     164,   164,   164,   165,   165,   166,   166,   166,   167,   167,
     168,   169,   169,   170,   171,   171,   172,   172,   172,   172,
     172,   172,   172,   172,   172,   173,   173,   174,   174,   175,
     176,   176,   177,   178,   178,   178,   179,   179,   180,   180,
     181,   181,   182,   182,   183,   183,   184,   185,   185,   185,
     186,   186,   187,   188,   188,   189,   189,   190,   190,   190,
     190,   190,   190,   190,   190,   191,   191,   191,   191,   192,
     192,   193,   194,   194,   195,   195,   196,   196,   197,   197,
     198,   198,   199,   199,   199,   199,   199,   200,   200,   201,
     201,   202,   202,   203,   203,   204,   204,   205,   205,   206,
     206,   207,   207,   208,   209,   209,   210,   210,   210,   211,
     211,   212,   212,   213,   214,   214,   215,   215,   216,   217,
     217,   217,   217,   217,   217,   217,   218,   218,   219,   219,
     220,   220,   221,   221,   222,   222,   222,   222,   223,   224,
     225,   225,   226,   227,   227,   228,   228,   229,   229,   230,
     230,   231,   231,   232,   232,   233,   233,   234,   235,   235,
     235,   235,   236,   236,   237,   237,   238,   238,   239,   239,
     239,   240,   240,   241,   242,   242,   243,   243,   243,   244,
     245,   245,   246,   246,   247,   247,   248,   248,   249,   250,
     250,   251,   251,   251,   252,   252,   252,   253,   253,   254,
     254,   254,   254,   254,   254,   255,   255,   256,   256,   257,
     258,   258,   259,   259,   260,   260,   261,   261,   261,   261,
     261,   261,   261,   262,   262,   263,   263,   264,   264,   265,
     266,   267,   267,   268,   268,   269,   269,   270,   270,   271,
     271,   272,   273,   273,   273,   273,   273,   273,   273,   273,
     273,   273,   274,   274,   274,   275,   275,   275,   275,   276,
     276,   277,   278,   279,   279,   280,   280,   281,   281,   282,
     282,   282,   283,   283,   284,   284,   284,   285,   285,   286,
     287,   287,   287,   287,   287,   287,   287,   288,   289,   289,
     289,   290,   290,   291,   291,   292,   292,   293,   293,   293,
     294,   294,   295,   296,   296,   297,   297,   298,   298,   299,
     299,   300,   300,   300,   300,   300,   300,   300,   300,   300,
     300,   300,   300,   301,   302,   302,   303,   303,   303,   303,
     303,   303,   303,   304,   304,   305,   305,   306,   306,   307,
     307,   308,   308,   309,   309,   310,   310,   311,   312,   312,
     313,   314,   315,   315,   316,   316,   317,   317,   318,   318,
     319,   319,   320,   321,   322,   322,   322,   323,   323,   323,
     324,   324,   324,   324,   324,   325,   325,   325,   325,   326,
     326,   327,   327,   328,   328,   329,   329,   330,   330,   331,
     331,   332,   332,   332,   333,   333,   334,   334,   335,   335,
     335,   336,   336,   337,   337,   338,   338,   339,   339,   340,
     340,   341,   341,   342,   342,   343,   343,   344,   344,   345,
     345
};

  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
static const yytype_uint8 yyr2[] =
{
       0,     2,     0,     2,     1,     1,     1,     0,    12,     2,
       2,     1,     2,     3,     4,     3,     3,     3,     3,     1,
       4,     2,     0,     7,     1,     0,     6,     1,     1,     1,
       1,     1,     1,     3,     2,     2,     1,     1,     0,     7,
       2,     1,     4,     1,     1,     1,     3,     1,     7,     5,
       9,     8,     1,     2,     6,     5,     3,     4,     6,     1,
       7,     7,     4,     2,     1,     4,     2,     1,     3,     1,
       3,     1,     3,     4,     4,     1,     1,     1,     1,    11,
       6,     1,     2,     1,     1,     0,     1,     1,     2,     1,
       1,     0,     7,     5,     7,     5,     3,     1,     0,     1,
       1,     2,     1,     2,     1,     2,     1,     1,     1,     3,
       1,     3,     1,     4,     2,     1,     2,     2,     1,     1,
       0,     9,     6,     1,     3,     1,     3,     1,     1,     1,
       3,     3,     3,     3,     3,     3,     1,     3,     1,     3,
       1,     3,     1,     3,     1,     3,     2,     2,    12,     5,
       1,     1,     1,     1,     0,     3,     5,     1,     0,     5,
       5,     3,     1,     1,     0,     2,     0,    10,     9,     9,
       7,     5,     1,     0,     2,     1,     4,     4,     2,     2,
       0,     3,     3,     3,     3,     1,     1,     1,     1,     5,
       2,     0,     3,     1,     3,     3,     1,     1,     1,     3,
       1,     9,    11,     7,     1,     1,     1,     1,     0,     1,
       1,     4,     4,     4,     4,     3,     1,     7,     7,     2,
       1,     1,     2,     1,     1,     0,     1,     1,     1,     1,
       1,     1,     2,     2,     1,     1,     0,     7,     7,     3,
       3,     1,     0,     3,     5,     1,     0,     5,     5,     1,
       0,     1,     1,     3,     1,     1,     1,     1,     1,     2,
       4,     3,     1,     1,     1,     2,     5,     5,     5,     3,
       1,     3,     1,     2,     1,     1,     0,    13,    13,     3,
       3,     0,     1,     1,     3,     3,     3,     1,     3,     4,
       1,     3,     3,     3,     3,     3,     3,     4,     3,     2,
       3,     1,     1,     3,     3,     3,     1,     3,     5,     5,
       3,     1,     7,     3,     3,     3,     1,     2,     1,     1,
       0,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     2,     2,     2,     1,     0,     1,     3,     3,     3,
       3,     3,     3,     1,     1,     2,     0,     2,     1,     1,
       2,     2,     3,     4,     8,     1,     3,     2,     8,     8,
       2,     1,     2,     1,     1,     0,     1,     1,     1,     0,
       1,     1,     1,     5,     1,     2,     5,     1,     1,     1,
       1,     3,     3,     3,     3,     5,     3,     5,     3,     3,
       1,     3,     3,     3,     3,     2,     1,     1,     0,     1,
       3,     4,     4,     4,     7,     4,     2,     0,     4,     4,
       4,     1,     1,     3,     1,     1,     1,     1,     0,     1,
       0,     1,     0,     1,     0,     1,     0,     1,     0,     1,
       0
};


#define yyerrok         (yyerrstatus = 0)
#define yyclearin       (yychar = YYEMPTY)
#define YYEMPTY         (-2)
#define YYEOF           0

#define YYACCEPT        goto yyacceptlab
#define YYABORT         goto yyabortlab
#define YYERROR         goto yyerrorlab


#define YYRECOVERING()  (!!yyerrstatus)

#define YYBACKUP(Token, Value)                                    \
  do                                                              \
    if (yychar == YYEMPTY)                                        \
      {                                                           \
        yychar = (Token);                                         \
        yylval = (Value);                                         \
        YYPOPSTACK (yylen);                                       \
        yystate = *yyssp;                                         \
        goto yybackup;                                            \
      }                                                           \
    else                                                          \
      {                                                           \
        yyerror (&yylloc, yyscanner, file_path, parse_library_name, YY_("syntax error: cannot back up")); \
        YYERROR;                                                  \
      }                                                           \
  while (0)

/* Error token number */
#define YYTERROR        1
#define YYERRCODE       256


/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
   If N is 0, then set CURRENT to the empty location which ends
   the previous symbol: RHS[0] (always defined).  */

#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N)                                \
    do                                                                  \
      if (N)                                                            \
        {                                                               \
          (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
          (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
          (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
          (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
        }                                                               \
      else                                                              \
        {                                                               \
          (Current).first_line   = (Current).last_line   =              \
            YYRHSLOC (Rhs, 0).last_line;                                \
          (Current).first_column = (Current).last_column =              \
            YYRHSLOC (Rhs, 0).last_column;                              \
        }                                                               \
    while (0)
#endif

#define YYRHSLOC(Rhs, K) ((Rhs)[K])


/* Enable debugging if requested.  */
#if YYDEBUG

# ifndef YYFPRINTF
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
#  define YYFPRINTF fprintf
# endif

# define YYDPRINTF(Args)                        \
do {                                            \
  if (yydebug)                                  \
    YYFPRINTF Args;                             \
} while (0)


/* YY_LOCATION_PRINT -- Print the location on the stream.
   This macro was not mandated originally: define only if we know
   we won't break user code: when these are the locations we know.  */

#ifndef YY_LOCATION_PRINT
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL

/* Print *YYLOCP on YYO.  Private, do not rely on its existence. */

YY_ATTRIBUTE_UNUSED
static int
yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
{
  int res = 0;
  int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
  if (0 <= yylocp->first_line)
    {
      res += YYFPRINTF (yyo, "%d", yylocp->first_line);
      if (0 <= yylocp->first_column)
        res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
    }
  if (0 <= yylocp->last_line)
    {
      if (yylocp->first_line < yylocp->last_line)
        {
          res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
          if (0 <= end_col)
            res += YYFPRINTF (yyo, ".%d", end_col);
        }
      else if (0 <= end_col && yylocp->first_column < end_col)
        res += YYFPRINTF (yyo, "-%d", end_col);
    }
  return res;
 }

#  define YY_LOCATION_PRINT(File, Loc)          \
  yy_location_print_ (File, &(Loc))

# else
#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
# endif
#endif


# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
do {                                                                      \
  if (yydebug)                                                            \
    {                                                                     \
      YYFPRINTF (stderr, "%s ", Title);                                   \
      yy_symbol_print (stderr,                                            \
                  Type, Value, Location, yyscanner, file_path, parse_library_name); \
      YYFPRINTF (stderr, "\n");                                           \
    }                                                                     \
} while (0)


/*-----------------------------------.
| Print this symbol's value on YYO.  |
`-----------------------------------*/

static void
yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, yyscan_t yyscanner, const char*file_path, perm_string parse_library_name)
{
  FILE *yyoutput = yyo;
  YYUSE (yyoutput);
  YYUSE (yylocationp);
  YYUSE (yyscanner);
  YYUSE (file_path);
  YYUSE (parse_library_name);
  if (!yyvaluep)
    return;
# ifdef YYPRINT
  if (yytype < YYNTOKENS)
    YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
# endif
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  YYUSE (yytype);
  YY_IGNORE_MAYBE_UNINITIALIZED_END
}


/*---------------------------.
| Print this symbol on YYO.  |
`---------------------------*/

static void
yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, yyscan_t yyscanner, const char*file_path, perm_string parse_library_name)
{
  YYFPRINTF (yyo, "%s %s (",
             yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);

  YY_LOCATION_PRINT (yyo, *yylocationp);
  YYFPRINTF (yyo, ": ");
  yy_symbol_value_print (yyo, yytype, yyvaluep, yylocationp, yyscanner, file_path, parse_library_name);
  YYFPRINTF (yyo, ")");
}

/*------------------------------------------------------------------.
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
| TOP (included).                                                   |
`------------------------------------------------------------------*/

static void
yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
{
  YYFPRINTF (stderr, "Stack now");
  for (; yybottom <= yytop; yybottom++)
    {
      int yybot = *yybottom;
      YYFPRINTF (stderr, " %d", yybot);
    }
  YYFPRINTF (stderr, "\n");
}

# define YY_STACK_PRINT(Bottom, Top)                            \
do {                                                            \
  if (yydebug)                                                  \
    yy_stack_print ((Bottom), (Top));                           \
} while (0)


/*------------------------------------------------.
| Report that the YYRULE is going to be reduced.  |
`------------------------------------------------*/

static void
yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, yyscan_t yyscanner, const char*file_path, perm_string parse_library_name)
{
  unsigned long yylno = yyrline[yyrule];
  int yynrhs = yyr2[yyrule];
  int yyi;
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
             yyrule - 1, yylno);
  /* The symbols being reduced.  */
  for (yyi = 0; yyi < yynrhs; yyi++)
    {
      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
      yy_symbol_print (stderr,
                       yystos[yyssp[yyi + 1 - yynrhs]],
                       &yyvsp[(yyi + 1) - (yynrhs)]
                       , &(yylsp[(yyi + 1) - (yynrhs)])                       , yyscanner, file_path, parse_library_name);
      YYFPRINTF (stderr, "\n");
    }
}

# define YY_REDUCE_PRINT(Rule)          \
do {                                    \
  if (yydebug)                          \
    yy_reduce_print (yyssp, yyvsp, yylsp, Rule, yyscanner, file_path, parse_library_name); \
} while (0)

/* Nonzero means print parse trace.  It is left uninitialized so that
   multiple parsers can coexist.  */
int yydebug;
#else /* !YYDEBUG */
# define YYDPRINTF(Args)
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#endif /* !YYDEBUG */


/* YYINITDEPTH -- initial size of the parser's stacks.  */
#ifndef YYINITDEPTH
# define YYINITDEPTH 200
#endif

/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
   if the built-in stack extension method is used).

   Do not make this value too large; the results are undefined if
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
   evaluated with infinite-precision integer arithmetic.  */

#ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000
#endif


#if YYERROR_VERBOSE

# ifndef yystrlen
#  if defined __GLIBC__ && defined _STRING_H
#   define yystrlen strlen
#  else
/* Return the length of YYSTR.  */
static YYSIZE_T
yystrlen (const char *yystr)
{
  YYSIZE_T yylen;
  for (yylen = 0; yystr[yylen]; yylen++)
    continue;
  return yylen;
}
#  endif
# endif

# ifndef yystpcpy
#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
#   define yystpcpy stpcpy
#  else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
   YYDEST.  */
static char *
yystpcpy (char *yydest, const char *yysrc)
{
  char *yyd = yydest;
  const char *yys = yysrc;

  while ((*yyd++ = *yys++) != '\0')
    continue;

  return yyd - 1;
}
#  endif
# endif

# ifndef yytnamerr
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
   quotes and backslashes, so that it's suitable for yyerror.  The
   heuristic is that double-quoting is unnecessary unless the string
   contains an apostrophe, a comma, or backslash (other than
   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
   null, do not copy; instead, return the length of what the result
   would have been.  */
static YYSIZE_T
yytnamerr (char *yyres, const char *yystr)
{
  if (*yystr == '"')
    {
      YYSIZE_T yyn = 0;
      char const *yyp = yystr;

      for (;;)
        switch (*++yyp)
          {
          case '\'':
          case ',':
            goto do_not_strip_quotes;

          case '\\':
            if (*++yyp != '\\')
              goto do_not_strip_quotes;
            else
              goto append;

          append:
          default:
            if (yyres)
              yyres[yyn] = *yyp;
            yyn++;
            break;

          case '"':
            if (yyres)
              yyres[yyn] = '\0';
            return yyn;
          }
    do_not_strip_quotes: ;
    }

  if (! yyres)
    return yystrlen (yystr);

  return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres);
}
# endif

/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
   about the unexpected token YYTOKEN for the state stack whose top is
   YYSSP.

   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
   not large enough to hold the message.  In that case, also set
   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
   required number of bytes is too large to store.  */
static int
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
                yytype_int16 *yyssp, int yytoken)
{
  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
  YYSIZE_T yysize = yysize0;
  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
  /* Internationalized format string. */
  const char *yyformat = YY_NULLPTR;
  /* Arguments of yyformat. */
  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
  /* Number of reported tokens (one for the "unexpected", one per
     "expected"). */
  int yycount = 0;

  /* There are many possibilities here to consider:
     - If this state is a consistent state with a default action, then
       the only way this function was invoked is if the default action
       is an error action.  In that case, don't check for expected
       tokens because there are none.
     - The only way there can be no lookahead present (in yychar) is if
       this state is a consistent state with a default action.  Thus,
       detecting the absence of a lookahead is sufficient to determine
       that there is no unexpected or expected token to report.  In that
       case, just report a simple "syntax error".
     - Don't assume there isn't a lookahead just because this state is a
       consistent state with a default action.  There might have been a
       previous inconsistent state, consistent state with a non-default
       action, or user semantic action that manipulated yychar.
     - Of course, the expected token list depends on states to have
       correct lookahead information, and it depends on the parser not
       to perform extra reductions after fetching a lookahead from the
       scanner and before detecting a syntax error.  Thus, state merging
       (from LALR or IELR) and default reductions corrupt the expected
       token list.  However, the list is correct for canonical LR with
       one exception: it will still contain any token that will not be
       accepted due to an error action in a later state.
  */
  if (yytoken != YYEMPTY)
    {
      int yyn = yypact[*yyssp];
      yyarg[yycount++] = yytname[yytoken];
      if (!yypact_value_is_default (yyn))
        {
          /* Start YYX at -YYN if negative to avoid negative indexes in
             YYCHECK.  In other words, skip the first -YYN actions for
             this state because they are default actions.  */
          int yyxbegin = yyn < 0 ? -yyn : 0;
          /* Stay within bounds of both yycheck and yytname.  */
          int yychecklim = YYLAST - yyn + 1;
          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
          int yyx;

          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
                && !yytable_value_is_error (yytable[yyx + yyn]))
              {
                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
                  {
                    yycount = 1;
                    yysize = yysize0;
                    break;
                  }
                yyarg[yycount++] = yytname[yyx];
                {
                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
                  if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
                    yysize = yysize1;
                  else
                    return 2;
                }
              }
        }
    }

  switch (yycount)
    {
# define YYCASE_(N, S)                      \
      case N:                               \
        yyformat = S;                       \
      break
    default: /* Avoid compiler warnings. */
      YYCASE_(0, YY_("syntax error"));
      YYCASE_(1, YY_("syntax error, unexpected %s"));
      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
# undef YYCASE_
    }

  {
    YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
    if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
      yysize = yysize1;
    else
      return 2;
  }

  if (*yymsg_alloc < yysize)
    {
      *yymsg_alloc = 2 * yysize;
      if (! (yysize <= *yymsg_alloc
             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
      return 1;
    }

  /* Avoid sprintf, as that infringes on the user's name space.
     Don't have undefined behavior even if the translation
     produced a string with the wrong number of "%s"s.  */
  {
    char *yyp = *yymsg;
    int yyi = 0;
    while ((*yyp = *yyformat) != '\0')
      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
        {
          yyp += yytnamerr (yyp, yyarg[yyi++]);
          yyformat += 2;
        }
      else
        {
          yyp++;
          yyformat++;
        }
  }
  return 0;
}
#endif /* YYERROR_VERBOSE */

/*-----------------------------------------------.
| Release the memory associated to this symbol.  |
`-----------------------------------------------*/

static void
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, yyscan_t yyscanner, const char*file_path, perm_string parse_library_name)
{
  YYUSE (yyvaluep);
  YYUSE (yylocationp);
  YYUSE (yyscanner);
  YYUSE (file_path);
  YYUSE (parse_library_name);
  if (!yymsg)
    yymsg = "Deleting";
  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);

  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  YYUSE (yytype);
  YY_IGNORE_MAYBE_UNINITIALIZED_END
}




/*----------.
| yyparse.  |
`----------*/

int
yyparse (yyscan_t yyscanner, const char*file_path, perm_string parse_library_name)
{
/* The lookahead symbol.  */
int yychar;


/* The semantic value of the lookahead symbol.  */
/* Default value used for initialization, for pacifying older GCCs
   or non-GCC compilers.  */
YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);

/* Location data for the lookahead symbol.  */
static YYLTYPE yyloc_default
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
  = { 1, 1, 1, 1 }
# endif
;
YYLTYPE yylloc = yyloc_default;

    /* Number of syntax errors so far.  */
    int yynerrs;

    int yystate;
    /* Number of tokens to shift before error messages enabled.  */
    int yyerrstatus;

    /* The stacks and their tools:
       'yyss': related to states.
       'yyvs': related to semantic values.
       'yyls': related to locations.

       Refer to the stacks through separate pointers, to allow yyoverflow
       to reallocate them elsewhere.  */

    /* The state stack.  */
    yytype_int16 yyssa[YYINITDEPTH];
    yytype_int16 *yyss;
    yytype_int16 *yyssp;

    /* The semantic value stack.  */
    YYSTYPE yyvsa[YYINITDEPTH];
    YYSTYPE *yyvs;
    YYSTYPE *yyvsp;

    /* The location stack.  */
    YYLTYPE yylsa[YYINITDEPTH];
    YYLTYPE *yyls;
    YYLTYPE *yylsp;

    /* The locations where the error started and ended.  */
    YYLTYPE yyerror_range[3];

    YYSIZE_T yystacksize;

  int yyn;
  int yyresult;
  /* Lookahead token as an internal (translated) token number.  */
  int yytoken = 0;
  /* The variables used to return semantic value and location from the
     action routines.  */
  YYSTYPE yyval;
  YYLTYPE yyloc;

#if YYERROR_VERBOSE
  /* Buffer for error messages, and its allocated size.  */
  char yymsgbuf[128];
  char *yymsg = yymsgbuf;
  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif

#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N), yylsp -= (N))

  /* The number of symbols on the RHS of the reduced rule.
     Keep to zero when no symbol should be popped.  */
  int yylen = 0;

  yyssp = yyss = yyssa;
  yyvsp = yyvs = yyvsa;
  yylsp = yyls = yylsa;
  yystacksize = YYINITDEPTH;

  YYDPRINTF ((stderr, "Starting parse\n"));

  yystate = 0;
  yyerrstatus = 0;
  yynerrs = 0;
  yychar = YYEMPTY; /* Cause a token to be read.  */
  yylsp[0] = yylloc;
  goto yysetstate;


/*------------------------------------------------------------.
| yynewstate -- push a new state, which is found in yystate.  |
`------------------------------------------------------------*/
yynewstate:
  /* In all cases, when you get here, the value and location stacks
     have just been pushed.  So pushing a state here evens the stacks.  */
  yyssp++;


/*--------------------------------------------------------------------.
| yynewstate -- set current state (the top of the stack) to yystate.  |
`--------------------------------------------------------------------*/
yysetstate:
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
  *yyssp = (yytype_int16) yystate;

  if (yyss + yystacksize - 1 <= yyssp)
#if !defined yyoverflow && !defined YYSTACK_RELOCATE
    goto yyexhaustedlab;
#else
    {
      /* Get the current used size of the three stacks, in elements.  */
      YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);

# if defined yyoverflow
      {
        /* Give user a chance to reallocate the stack.  Use copies of
           these so that the &'s don't force the real ones into
           memory.  */
        YYSTYPE *yyvs1 = yyvs;
        yytype_int16 *yyss1 = yyss;
        YYLTYPE *yyls1 = yyls;

        /* Each stack pointer address is followed by the size of the
           data in use in that stack, in bytes.  This used to be a
           conditional around just the two extra args, but that might
           be undefined if yyoverflow is a macro.  */
        yyoverflow (YY_("memory exhausted"),
                    &yyss1, yysize * sizeof (*yyssp),
                    &yyvs1, yysize * sizeof (*yyvsp),
                    &yyls1, yysize * sizeof (*yylsp),
                    &yystacksize);
        yyss = yyss1;
        yyvs = yyvs1;
        yyls = yyls1;
      }
# else /* defined YYSTACK_RELOCATE */
      /* Extend the stack our own way.  */
      if (YYMAXDEPTH <= yystacksize)
        goto yyexhaustedlab;
      yystacksize *= 2;
      if (YYMAXDEPTH < yystacksize)
        yystacksize = YYMAXDEPTH;

      {
        yytype_int16 *yyss1 = yyss;
        union yyalloc *yyptr =
          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
        if (! yyptr)
          goto yyexhaustedlab;
        YYSTACK_RELOCATE (yyss_alloc, yyss);
        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
        YYSTACK_RELOCATE (yyls_alloc, yyls);
# undef YYSTACK_RELOCATE
        if (yyss1 != yyssa)
          YYSTACK_FREE (yyss1);
      }
# endif

      yyssp = yyss + yysize - 1;
      yyvsp = yyvs + yysize - 1;
      yylsp = yyls + yysize - 1;

      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
                  (unsigned long) yystacksize));

      if (yyss + yystacksize - 1 <= yyssp)
        YYABORT;
    }
#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */

  if (yystate == YYFINAL)
    YYACCEPT;

  goto yybackup;


/*-----------.
| yybackup.  |
`-----------*/
yybackup:
  /* Do appropriate processing given the current state.  Read a
     lookahead token if we need one and don't already have one.  */

  /* First try to decide what to do without reference to lookahead token.  */
  yyn = yypact[yystate];
  if (yypact_value_is_default (yyn))
    goto yydefault;

  /* Not known => get a lookahead token if don't already have one.  */

  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
  if (yychar == YYEMPTY)
    {
      YYDPRINTF ((stderr, "Reading a token: "));
      yychar = yylex (&yylval, &yylloc, yyscanner);
    }

  if (yychar <= YYEOF)
    {
      yychar = yytoken = YYEOF;
      YYDPRINTF ((stderr, "Now at end of input.\n"));
    }
  else
    {
      yytoken = YYTRANSLATE (yychar);
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
    }

  /* If the proper action on seeing token YYTOKEN is to reduce or to
     detect an error, take that action.  */
  yyn += yytoken;
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
    goto yydefault;
  yyn = yytable[yyn];
  if (yyn <= 0)
    {
      if (yytable_value_is_error (yyn))
        goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }

  /* Count tokens shifted since error; after three, turn off error
     status.  */
  if (yyerrstatus)
    yyerrstatus--;

  /* Shift the lookahead token.  */
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);

  /* Discard the shifted token.  */
  yychar = YYEMPTY;

  yystate = yyn;
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  *++yyvsp = yylval;
  YY_IGNORE_MAYBE_UNINITIALIZED_END
  *++yylsp = yylloc;
  goto yynewstate;


/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state.  |
`-----------------------------------------------------------*/
yydefault:
  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;
  goto yyreduce;


/*-----------------------------.
| yyreduce -- do a reduction.  |
`-----------------------------*/
yyreduce:
  /* yyn is the number of a rule to reduce with.  */
  yylen = yyr2[yyn];

  /* If YYLEN is nonzero, implement the default value of the action:
     '$$ = $1'.

     Otherwise, the following line sets YYVAL to garbage.
     This behavior is undocumented and Bison
     users should not rely upon it.  Assigning to YYVAL
     unconditionally makes the parser a bit smaller, and it avoids a
     GCC warning that YYVAL may be used uninitialized.  */
  yyval = yyvsp[1-yylen];

  /* Default location. */
  YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
  yyerror_range[1] = yyloc;
  YY_REDUCE_PRINT (yyn);
  switch (yyn)
    {
  case 2:
#line 390 "parse.y"
    { yylloc.text = file_path; }
#line 2644 "parse.cc"
    break;

  case 4:
#line 393 "parse.y"
    { (yyval.arithmetic_op) = ExpArithmetic::PLUS; }
#line 2650 "parse.cc"
    break;

  case 5:
#line 394 "parse.y"
    { (yyval.arithmetic_op) = ExpArithmetic::MINUS; }
#line 2656 "parse.cc"
    break;

  case 6:
#line 395 "parse.y"
    { (yyval.arithmetic_op) = ExpArithmetic::xCONCAT; }
#line 2662 "parse.cc"
    break;

  case 7:
#line 401 "parse.y"
    { bind_entity_to_active_scope((yyvsp[0].text), active_scope); }
#line 2668 "parse.cc"
    break;

  case 8:
#line 404 "parse.y"
    { Architecture*tmp = new Architecture(lex_strings.make((yyvsp[-11].text)),
					    *active_scope, *(yyvsp[-4].arch_statement_list));
	FILE_NAME(tmp, (yylsp[-11]));
	bind_architecture_to_entity((yyvsp[-9].text), tmp);
	if ((yyvsp[-1].text) && tmp->get_name() != (yyvsp[-1].text))
	      errormsg((yylsp[-11]), "Architecture name doesn't match closing name.\n");
	delete[](yyvsp[-11].text);
	delete[](yyvsp[-9].text);
	delete (yyvsp[-4].arch_statement_list);
	pop_scope();
	if ((yyvsp[-1].text)) delete[](yyvsp[-1].text);
      }
#line 2685 "parse.cc"
    break;

  case 9:
#line 420 "parse.y"
    { (yyval.text) = (yyvsp[0].text);
	push_scope();
      }
#line 2693 "parse.cc"
    break;

  case 10:
#line 430 "parse.y"
    { std::list<Architecture::Statement*>*tmp = (yyvsp[-1].arch_statement_list);
	if ((yyvsp[0].arch_statement)) tmp->push_back((yyvsp[0].arch_statement));
	(yyval.arch_statement_list) = tmp;
      }
#line 2702 "parse.cc"
    break;

  case 11:
#line 435 "parse.y"
    { std::list<Architecture::Statement*>*tmp = new std::list<Architecture::Statement*>;
	if ((yyvsp[0].arch_statement)) tmp->push_back((yyvsp[0].arch_statement));
	(yyval.arch_statement_list) = tmp;
      }
#line 2711 "parse.cc"
    break;

  case 12:
#line 441 "parse.y"
    { (yyval.arch_statement_list) = 0;
	errormsg((yylsp[-1]), "Syntax error in architecture statement.\n");
	yyerrok;
      }
#line 2720 "parse.cc"
    break;

  case 13:
#line 449 "parse.y"
    { ReportStmt*report = dynamic_cast<ReportStmt*>((yyvsp[0].sequ));
        assert(report);
	AssertStmt*tmp = new AssertStmt((yyvsp[-1].expr), report->message().c_str(), report->severity());
        delete report;
	FILE_NAME(tmp,(yylsp[-1]));
	(yyval.sequ) = tmp;
      }
#line 2732 "parse.cc"
    break;

  case 14:
#line 457 "parse.y"
    { AssertStmt*tmp = new AssertStmt((yyvsp[-2].expr), NULL, (yyvsp[-1].severity));
	FILE_NAME(tmp,(yylsp[-2]));
	(yyval.sequ) = tmp;
      }
#line 2741 "parse.cc"
    break;

  case 15:
#line 465 "parse.y"
    { named_expr_t*tmp = new named_expr_t(lex_strings.make((yyvsp[-2].text)), (yyvsp[0].expr));
	delete[](yyvsp[-2].text);
	(yyval.named_expr) = tmp;
	}
#line 2750 "parse.cc"
    break;

  case 16:
#line 470 "parse.y"
    { named_expr_t*tmp = new named_expr_t(lex_strings.make((yyvsp[-2].text)), 0);
	delete[](yyvsp[-2].text);
	(yyval.named_expr) = tmp;
      }
#line 2759 "parse.cc"
    break;

  case 17:
#line 475 "parse.y"
    { errormsg((yylsp[0]), "Invalid target for port map association.\n");
	yyerrok;
	(yyval.named_expr) = 0;
      }
#line 2768 "parse.cc"
    break;

  case 18:
#line 483 "parse.y"
    { std::list<named_expr_t*>*tmp = (yyvsp[-2].named_expr_list);
	tmp->push_back((yyvsp[0].named_expr));
	(yyval.named_expr_list) = tmp;
      }
#line 2777 "parse.cc"
    break;

  case 19:
#line 488 "parse.y"
    { std::list<named_expr_t*>*tmp = new std::list<named_expr_t*>;
	tmp->push_back((yyvsp[0].named_expr));
	(yyval.named_expr_list) = tmp;
      }
#line 2786 "parse.cc"
    break;

  case 20:
#line 496 "parse.y"
    { (yyval.entity_aspect) = (yyvsp[-2].entity_aspect);
	if ((yyvsp[-1].named_expr_list)) sorrymsg((yylsp[-1]), "Port map aspect not supported here. (binding_indication)\n");
	if ((yyvsp[0].named_expr_list)) sorrymsg((yylsp[0]), "Generic map aspect not supported here. (binding_indication)\n");
	delete (yyvsp[-1].named_expr_list);
	delete (yyvsp[0].named_expr_list);
      }
#line 2797 "parse.cc"
    break;

  case 21:
#line 505 "parse.y"
    { (yyval.entity_aspect) = (yyvsp[-1].entity_aspect); }
#line 2803 "parse.cc"
    break;

  case 22:
#line 506 "parse.y"
    { (yyval.entity_aspect) = 0; }
#line 2809 "parse.cc"
    break;

  case 23:
#line 514 "parse.y"
    { delete[] (yyvsp[-5].text); }
#line 2815 "parse.cc"
    break;

  case 26:
#line 525 "parse.y"
    { /* Save the signal declaration in the block_signals map. */
	for (std::list<perm_string>::iterator cur = (yyvsp[-4].name_list)->begin()
		   ; cur != (yyvsp[-4].name_list)->end() ; ++cur) {
	      Signal*sig = new Signal(*cur, (yyvsp[-2].vtype), (yyvsp[-1].expr));
	      FILE_NAME(sig, (yylsp[-5]));
	      active_scope->bind_name(*cur, sig);
	}
	delete (yyvsp[-4].name_list);
      }
#line 2829 "parse.cc"
    break;

  case 33:
#line 550 "parse.y"
    { errormsg((yylsp[-1]), "Syntax error declaring signals.\n"); yyerrok; }
#line 2835 "parse.cc"
    break;

  case 34:
#line 552 "parse.y"
    { errormsg((yylsp[-1]), "Syntax error in block declarations.\n"); yyerrok; }
#line 2841 "parse.cc"
    break;

  case 39:
#line 575 "parse.y"
    { CaseSeqStmt* tmp = new CaseSeqStmt((yyvsp[-5].expr), (yyvsp[-3].case_alt_list));
	FILE_NAME(tmp, (yylsp[-6]));
	delete (yyvsp[-3].case_alt_list);
	(yyval.sequ) = tmp;
      }
#line 2851 "parse.cc"
    break;

  case 40:
#line 584 "parse.y"
    { std::list<CaseSeqStmt::CaseStmtAlternative*>* tmp = (yyvsp[-1].case_alt_list);
	tmp->push_back((yyvsp[0].case_alt));
	(yyval.case_alt_list) = tmp;
      }
#line 2860 "parse.cc"
    break;

  case 41:
#line 589 "parse.y"
    { std::list<CaseSeqStmt::CaseStmtAlternative*>*tmp
		  = new std::list<CaseSeqStmt::CaseStmtAlternative*>();
	tmp->push_back((yyvsp[0].case_alt));
	(yyval.case_alt_list) = tmp;
      }
#line 2870 "parse.cc"
    break;

  case 42:
#line 604 "parse.y"
    { CaseSeqStmt::CaseStmtAlternative* tmp;
        std::list<ExpAggregate::choice_t*>*choices = (yyvsp[-2].choice_list);
        std::list<Expression*>*exp_list = new std::list<Expression*>;
        bool others = false;

        for(std::list<ExpAggregate::choice_t*>::iterator it = choices->begin();
                it != choices->end(); ++it) {
            if((*it)->others() || others)
                // If there is one "others", then it also covers all other alternatives
                // Continue the loop to delete every choice_t, but do not
                // bother to add the expressions to the exp_list (we are going to
                // delete them very soon)
                others = true;
            else
                exp_list->push_back((*it)->simple_expression());

            delete (*it);
        }

        if(others) {
            tmp = new CaseSeqStmt::CaseStmtAlternative(0, (yyvsp[0].sequ_list));
            for(std::list<Expression*>::iterator it = exp_list->begin();
                    it != exp_list->end(); ++it) {
                delete (*it);
            }
        } else {
            tmp = new CaseSeqStmt::CaseStmtAlternative(exp_list, (yyvsp[0].sequ_list));
        }
        if (tmp) FILE_NAME(tmp, (yylsp[-3]));

        delete choices;
        delete (yyvsp[0].sequ_list);
        (yyval.case_alt) = tmp;
      }
#line 2909 "parse.cc"
    break;

  case 43:
#line 642 "parse.y"
    { (yyval.choice) = new ExpAggregate::choice_t((yyvsp[0].expr));}
#line 2915 "parse.cc"
    break;

  case 44:
#line 644 "parse.y"
    { (yyval.choice) = new ExpAggregate::choice_t; }
#line 2921 "parse.cc"
    break;

  case 45:
#line 646 "parse.y"
    { (yyval.choice) = new ExpAggregate::choice_t((yyvsp[0].range)); }
#line 2927 "parse.cc"
    break;

  case 46:
#line 651 "parse.y"
    { std::list<ExpAggregate::choice_t*>*tmp = (yyvsp[-2].choice_list);
	tmp->push_back((yyvsp[0].choice));
	(yyval.choice_list) = tmp;
      }
#line 2936 "parse.cc"
    break;

  case 47:
#line 656 "parse.y"
    { std::list<ExpAggregate::choice_t*>*tmp = new std::list<ExpAggregate::choice_t*>;
	tmp->push_back((yyvsp[0].choice));
	(yyval.choice_list) = tmp;
      }
#line 2945 "parse.cc"
    break;

  case 48:
#line 667 "parse.y"
    {
    sorrymsg((yylsp[-6]), "Component configuration in not yet supported\n");
    if((yyvsp[-4].entity_aspect)) delete (yyvsp[-4].entity_aspect);
    delete (yyvsp[-5].component_specification);
      }
#line 2955 "parse.cc"
    break;

  case 49:
#line 673 "parse.y"
    {
    errormsg((yylsp[-4]), "Error in component configuration statement.\n");
    delete (yyvsp[-3].component_specification);
      }
#line 2964 "parse.cc"
    break;

  case 50:
#line 683 "parse.y"
    { perm_string name = lex_strings.make((yyvsp[-7].text));
	if((yyvsp[-1].text) && name != (yyvsp[-1].text)) {
	      errormsg((yylsp[-1]), "Identifier %s doesn't match component name %s.\n",
		       (yyvsp[-1].text), name.str());
	}

	ComponentBase*comp = new ComponentBase(name);
	comp->set_interface((yyvsp[-5].interface_list), (yyvsp[-4].interface_list));
	if ((yyvsp[-5].interface_list)) delete (yyvsp[-5].interface_list);
	if ((yyvsp[-4].interface_list)) delete (yyvsp[-4].interface_list);

	active_scope->bind_name(name, comp);
	delete[](yyvsp[-7].text);
	if ((yyvsp[-1].text)) delete[] (yyvsp[-1].text);
      }
#line 2984 "parse.cc"
    break;

  case 51:
#line 700 "parse.y"
    { errormsg((yylsp[-4]), "Syntax error in component declaration.\n");
	delete[] (yyvsp[-6].text);
	if((yyvsp[-1].text)) delete[] (yyvsp[-1].text);
	yyerrok;
      }
#line 2994 "parse.cc"
    break;

  case 53:
#line 709 "parse.y"
    { (yyval.text) = (yyvsp[0].text); }
#line 3000 "parse.cc"
    break;

  case 54:
#line 714 "parse.y"
    { perm_string iname = lex_strings.make((yyvsp[-5].text));
	perm_string cname = lex_strings.make((yyvsp[-3].text));
	ComponentInstantiation*tmp = new ComponentInstantiation(iname, cname, (yyvsp[-2].named_expr_list), (yyvsp[-1].named_expr_list));
	delete (yyvsp[-2].named_expr_list);
	delete (yyvsp[-1].named_expr_list);
	FILE_NAME(tmp, (yylsp[-5]));
	delete[](yyvsp[-5].text);
	delete[](yyvsp[-3].text);
	(yyval.arch_statement) = tmp;
      }
#line 3015 "parse.cc"
    break;

  case 55:
#line 725 "parse.y"
    { errormsg((yylsp[-1]), "Errors in component instantiation.\n");
	delete[](yyvsp[-4].text);
	delete[](yyvsp[-2].text);
	(yyval.arch_statement) = 0;
      }
#line 3025 "parse.cc"
    break;

  case 56:
#line 734 "parse.y"
    {
    ExpName* name = dynamic_cast<ExpName*>((yyvsp[0].expr));
    std::pair<instant_list_t*, ExpName*>* tmp = new std::pair<instant_list_t*, ExpName*>((yyvsp[-2].instantiation_list), name);
    (yyval.component_specification) = tmp;
      }
#line 3035 "parse.cc"
    break;

  case 57:
#line 744 "parse.y"
    { VTypeArray*tmp = new VTypeArray((yyvsp[0].vtype), (yyvsp[-2].range_list));
	delete (yyvsp[-2].range_list);
	(yyval.vtype) = tmp;
      }
#line 3044 "parse.cc"
    break;

  case 58:
#line 751 "parse.y"
    { std::list<prange_t*> r;
	r.push_back(new prange_t(NULL, NULL, true));   // NULL boundaries indicate unbounded array type
	VTypeArray*tmp = new VTypeArray((yyvsp[0].vtype), &r);
	(yyval.vtype) = tmp;
      }
#line 3054 "parse.cc"
    break;

  case 59:
#line 758 "parse.y"
    { (yyval.vtype) = (yyvsp[0].vtype); }
#line 3060 "parse.cc"
    break;

  case 60:
#line 767 "parse.y"
    { ExpConditional*tmp = new ExpConditional((yyvsp[-2].expr), (yyvsp[-4].expr_list), (yyvsp[-1].exp_options_list));
	FILE_NAME(tmp, (yylsp[-4]));
	delete (yyvsp[-4].expr_list);
	delete (yyvsp[-1].exp_options_list);

        ExpName*name = dynamic_cast<ExpName*> ((yyvsp[-6].expr));
	assert(name);
	SignalAssignment*tmpa = new SignalAssignment(name, tmp);
	FILE_NAME(tmpa, (yylsp[-6]));

	(yyval.arch_statement) = tmpa;
      }
#line 3077 "parse.cc"
    break;

  case 61:
#line 783 "parse.y"
    { errormsg((yylsp[-4]), "Syntax error in waveform of conditional signal assignment.\n");
	ExpConditional*tmp = new ExpConditional((yyvsp[-2].expr), 0, (yyvsp[-1].exp_options_list));
	FILE_NAME(tmp, (yylsp[-4]));
	delete (yyvsp[-1].exp_options_list);

        ExpName*name = dynamic_cast<ExpName*> ((yyvsp[-6].expr));
	assert(name);
	SignalAssignment*tmpa = new SignalAssignment(name, tmp);
	FILE_NAME(tmpa, (yylsp[-6]));

	(yyval.arch_statement) = tmpa;
      }
#line 3094 "parse.cc"
    break;

  case 62:
#line 799 "parse.y"
    { ExpName*name = dynamic_cast<ExpName*> ((yyvsp[-3].expr));
	assert(name);
	SignalAssignment*tmp = new SignalAssignment(name, *(yyvsp[-1].expr_list));
	FILE_NAME(tmp, (yylsp[-3]));

	(yyval.arch_statement) = tmp;
	delete (yyvsp[-1].expr_list);
      }
#line 3107 "parse.cc"
    break;

  case 63:
#line 810 "parse.y"
    { list<ExpConditional::case_t*>*tmp = (yyvsp[-1].exp_options_list);
	tmp ->push_back((yyvsp[0].exp_options));
	(yyval.exp_options_list) = tmp;
      }
#line 3116 "parse.cc"
    break;

  case 64:
#line 815 "parse.y"
    { list<ExpConditional::case_t*>*tmp = new list<ExpConditional::case_t*>;
	tmp->push_back((yyvsp[0].exp_options));
	(yyval.exp_options_list) = tmp;
      }
#line 3125 "parse.cc"
    break;

  case 65:
#line 823 "parse.y"
    { ExpConditional::case_t*tmp = new ExpConditional::case_t((yyvsp[0].expr), (yyvsp[-2].expr_list));
	FILE_NAME(tmp, (yylsp[-3]));
	(yyval.exp_options) = tmp;
      }
#line 3134 "parse.cc"
    break;

  case 66:
#line 828 "parse.y"
    { ExpConditional::case_t*tmp = new ExpConditional::case_t(0,  (yyvsp[0].expr_list));
	FILE_NAME(tmp, (yylsp[-1]));
	(yyval.exp_options) = tmp;
      }
#line 3143 "parse.cc"
    break;

  case 68:
#line 838 "parse.y"
    { delete[] (yyvsp[-2].text);
	(yyval.arch_statement) = (yyvsp[0].arch_statement);
      }
#line 3151 "parse.cc"
    break;

  case 70:
#line 845 "parse.y"
    { delete[] (yyvsp[-2].text);
	(yyval.arch_statement) = (yyvsp[0].arch_statement);
      }
#line 3159 "parse.cc"
    break;

  case 72:
#line 851 "parse.y"
    { (yyval.arch_statement) = (yyvsp[0].arch_statement); }
#line 3165 "parse.cc"
    break;

  case 73:
#line 854 "parse.y"
    { errormsg((yylsp[-2]), "Syntax error in signal assignment waveform.\n");
	delete (yyvsp[-3].expr);
	(yyval.arch_statement) = 0;
	yyerrok;
      }
#line 3175 "parse.cc"
    break;

  case 74:
#line 860 "parse.y"
    { errormsg((yylsp[-3]), "Syntax error in l-value of signal assignment.\n");
	yyerrok;
	delete (yyvsp[-1].expr_list);
	(yyval.arch_statement) = 0;
      }
#line 3185 "parse.cc"
    break;

  case 79:
#line 879 "parse.y"
    {
  if(design_entities.find(lex_strings.make((yyvsp[-7].text))) == design_entities.end())
      errormsg((yylsp[-7]), "Couldn't find entity %s used in configuration declaration\n", (yyvsp[-7].text));
  //choose_architecture_for_entity();
  sorrymsg((yylsp[-10]), "Configuration declaration is not yet supported.\n");
     }
#line 3196 "parse.cc"
    break;

  case 80:
#line 886 "parse.y"
    { errormsg((yylsp[-4]), "Too many errors, giving up on configuration declaration.\n");
    if((yyvsp[-1].text)) delete (yyvsp[-1].text);
    yyerrok;
      }
#line 3205 "parse.cc"
    break;

  case 92:
#line 923 "parse.y"
    { // The syntax allows multiple names to have the same type/value.
	for (std::list<perm_string>::iterator cur = (yyvsp[-5].name_list)->begin()
		   ; cur != (yyvsp[-5].name_list)->end() ; ++cur) {
	      active_scope->bind_name(*cur, (yyvsp[-3].vtype), (yyvsp[-1].expr));
	}
	delete (yyvsp[-5].name_list);
      }
#line 3217 "parse.cc"
    break;

  case 93:
#line 931 "parse.y"
    { sorrymsg((yylsp[-4]), "Deferred constant declarations not supported\n");
	delete (yyvsp[-3].name_list);
      }
#line 3225 "parse.cc"
    break;

  case 94:
#line 938 "parse.y"
    { // The syntax allows multiple names to have the same type/value.
	errormsg((yylsp[-1]), "Error in value expression for constants.\n");
	yyerrok;
	for (std::list<perm_string>::iterator cur = (yyvsp[-5].name_list)->begin()
		   ; cur != (yyvsp[-5].name_list)->end() ; ++cur) {
	      active_scope->bind_name(*cur, (yyvsp[-3].vtype), 0);
	}
	delete (yyvsp[-5].name_list);
      }
#line 3239 "parse.cc"
    break;

  case 95:
#line 948 "parse.y"
    { errormsg((yylsp[-1]), "Syntax error in constant declaration type.\n");
	yyerrok;
	delete (yyvsp[-3].name_list);
      }
#line 3248 "parse.cc"
    break;

  case 96:
#line 953 "parse.y"
    { errormsg((yylsp[-1]), "Syntax error in constant declaration.\n");
	yyerrok;
      }
#line 3256 "parse.cc"
    break;

  case 104:
#line 974 "parse.y"
    { errormsg((yylsp[0]), "Invalid design_unit\n"); }
#line 3262 "parse.cc"
    break;

  case 107:
#line 983 "parse.y"
    { (yyval.flag) = false; }
#line 3268 "parse.cc"
    break;

  case 108:
#line 983 "parse.y"
    { (yyval.flag) = true; }
#line 3274 "parse.cc"
    break;

  case 109:
#line 987 "parse.y"
    { ExpAggregate::element_t*tmp = new ExpAggregate::element_t((yyvsp[-2].choice_list), (yyvsp[0].expr));
	delete (yyvsp[-2].choice_list);
	(yyval.element) = tmp;
      }
#line 3283 "parse.cc"
    break;

  case 110:
#line 992 "parse.y"
    { ExpAggregate::element_t*tmp = new ExpAggregate::element_t(0, (yyvsp[0].expr));
	(yyval.element) = tmp;
      }
#line 3291 "parse.cc"
    break;

  case 111:
#line 999 "parse.y"
    { std::list<ExpAggregate::element_t*>*tmp = (yyvsp[-2].element_list);
	tmp->push_back((yyvsp[0].element));
	(yyval.element_list) = tmp;
      }
#line 3300 "parse.cc"
    break;

  case 112:
#line 1004 "parse.y"
    { std::list<ExpAggregate::element_t*>*tmp = new std::list<ExpAggregate::element_t*>;
	tmp->push_back((yyvsp[0].element));
	(yyval.element_list) = tmp;
      }
#line 3309 "parse.cc"
    break;

  case 113:
#line 1012 "parse.y"
    { (yyval.record_elements) = record_elements((yyvsp[-3].name_list), (yyvsp[-1].vtype));
        delete (yyvsp[-3].name_list);
      }
#line 3317 "parse.cc"
    break;

  case 114:
#line 1019 "parse.y"
    { (yyval.record_elements) = (yyvsp[-1].record_elements);
	(yyval.record_elements)->splice((yyval.record_elements)->end(), *(yyvsp[0].record_elements));
	delete (yyvsp[0].record_elements);
      }
#line 3326 "parse.cc"
    break;

  case 115:
#line 1024 "parse.y"
    { (yyval.record_elements) = (yyvsp[0].record_elements); }
#line 3332 "parse.cc"
    break;

  case 116:
#line 1030 "parse.y"
    {
    ExpName* name = dynamic_cast<ExpName*>((yyvsp[0].expr));
    entity_aspect_t* tmp = new entity_aspect_t(entity_aspect_t::ENTITY, name);
    (yyval.entity_aspect) = tmp;
      }
#line 3342 "parse.cc"
    break;

  case 117:
#line 1036 "parse.y"
    {
    ExpName* name = dynamic_cast<ExpName*>((yyvsp[0].expr));
    entity_aspect_t* tmp = new entity_aspect_t(entity_aspect_t::CONFIGURATION, name);
    (yyval.entity_aspect) = tmp;
      }
#line 3352 "parse.cc"
    break;

  case 118:
#line 1042 "parse.y"
    {
    entity_aspect_t* tmp = new entity_aspect_t(entity_aspect_t::OPEN, 0);
    (yyval.entity_aspect) = tmp;
      }
#line 3361 "parse.cc"
    break;

  case 119:
#line 1049 "parse.y"
    { (yyval.entity_aspect) = (yyvsp[0].entity_aspect); }
#line 3367 "parse.cc"
    break;

  case 120:
#line 1050 "parse.y"
    { (yyval.entity_aspect) = 0; }
#line 3373 "parse.cc"
    break;

  case 121:
#line 1057 "parse.y"
    { Entity*tmp = new Entity(lex_strings.make((yyvsp[-7].text)));
	FILE_NAME(tmp, (yylsp[-8]));
	  // Transfer the ports
	tmp->set_interface((yyvsp[-5].interface_list), (yyvsp[-4].interface_list));
	delete (yyvsp[-5].interface_list);
	delete (yyvsp[-4].interface_list);
	  // Save the entity in the entity map.
	design_entities[tmp->get_name()] = tmp;
	delete[](yyvsp[-7].text);
	if((yyvsp[-1].text) && tmp->get_name() != (yyvsp[-1].text)) {
	      errormsg((yylsp[-8]), "Syntax error in entity clause. Closing name doesn't match.\n");
        }
        delete[](yyvsp[-1].text);
      }
#line 3392 "parse.cc"
    break;

  case 122:
#line 1072 "parse.y"
    { errormsg((yylsp[-5]), "Too many errors, giving up on entity declaration.\n");
	yyerrok;
	if ((yyvsp[-1].text)) delete[](yyvsp[-1].text);
      }
#line 3401 "parse.cc"
    break;

  case 123:
#line 1080 "parse.y"
    { list<perm_string>*tmp = new list<perm_string>;
	tmp->push_back(lex_strings.make((yyvsp[0].text)));
	delete[](yyvsp[0].text);
	(yyval.name_list) = tmp;
      }
#line 3411 "parse.cc"
    break;

  case 124:
#line 1089 "parse.y"
    { list<perm_string>*tmp = (yyvsp[-2].name_list);
	list<perm_string>*tmp3 = (yyvsp[0].name_list);
	if (tmp3) {
	      tmp->splice(tmp->end(), *tmp3);
	      delete tmp3;
	}
	(yyval.name_list) = tmp;
      }
#line 3424 "parse.cc"
    break;

  case 125:
#line 1098 "parse.y"
    { list<perm_string>*tmp = (yyvsp[0].name_list);
	(yyval.name_list) = tmp;
      }
#line 3432 "parse.cc"
    break;

  case 126:
#line 1105 "parse.y"
    { list<Expression*>*tmp = (yyvsp[-2].expr_list);
	tmp->push_back((yyvsp[0].expr));
	(yyval.expr_list) = tmp;
      }
#line 3441 "parse.cc"
    break;

  case 127:
#line 1110 "parse.y"
    { list<Expression*>*tmp = new list<Expression*>;
	tmp->push_back((yyvsp[0].expr));
	(yyval.expr_list) = tmp;
      }
#line 3450 "parse.cc"
    break;

  case 128:
#line 1118 "parse.y"
    { (yyval.expr) = (yyvsp[0].expr); }
#line 3456 "parse.cc"
    break;

  case 129:
#line 1145 "parse.y"
    { (yyval.expr) = (yyvsp[0].expr); }
#line 3462 "parse.cc"
    break;

  case 130:
#line 1147 "parse.y"
    { ExpLogical*tmp = new ExpLogical(ExpLogical::AND, (yyvsp[-2].expr), (yyvsp[0].expr));
	FILE_NAME(tmp, (yylsp[-1]));
	(yyval.expr) = tmp;
      }
#line 3471 "parse.cc"
    break;

  case 131:
#line 1152 "parse.y"
    { ExpLogical*tmp = new ExpLogical(ExpLogical::OR, (yyvsp[-2].expr), (yyvsp[0].expr));
	FILE_NAME(tmp, (yylsp[-1]));
	(yyval.expr) = tmp;
      }
#line 3480 "parse.cc"
    break;

  case 132:
#line 1157 "parse.y"
    { ExpLogical*tmp = new ExpLogical(ExpLogical::XOR, (yyvsp[-2].expr), (yyvsp[0].expr));
	FILE_NAME(tmp, (yylsp[-1]));
	(yyval.expr) = tmp;
      }
#line 3489 "parse.cc"
    break;

  case 133:
#line 1162 "parse.y"
    { ExpLogical*tmp = new ExpLogical(ExpLogical::NAND, (yyvsp[-2].expr), (yyvsp[0].expr));
	FILE_NAME(tmp, (yylsp[-1]));
	(yyval.expr) = tmp;
      }
#line 3498 "parse.cc"
    break;

  case 134:
#line 1167 "parse.y"
    { ExpLogical*tmp = new ExpLogical(ExpLogical::NOR, (yyvsp[-2].expr), (yyvsp[0].expr));
	FILE_NAME(tmp, (yylsp[-1]));
	(yyval.expr) = tmp;
      }
#line 3507 "parse.cc"
    break;

  case 135:
#line 1172 "parse.y"
    { ExpLogical*tmp = new ExpLogical(ExpLogical::XNOR, (yyvsp[-2].expr), (yyvsp[0].expr));
	FILE_NAME(tmp, (yylsp[-1]));
	(yyval.expr) = tmp;
      }
#line 3516 "parse.cc"
    break;

  case 136:
#line 1180 "parse.y"
    { (yyval.expr) = (yyvsp[0].expr); }
#line 3522 "parse.cc"
    break;

  case 137:
#line 1182 "parse.y"
    { ExpLogical*tmp = new ExpLogical(ExpLogical::AND, (yyvsp[-2].expr), (yyvsp[0].expr));
	FILE_NAME(tmp, (yylsp[-1]));
	(yyval.expr) = tmp;
      }
#line 3531 "parse.cc"
    break;

  case 138:
#line 1190 "parse.y"
    { (yyval.expr) = (yyvsp[0].expr); }
#line 3537 "parse.cc"
    break;

  case 139:
#line 1192 "parse.y"
    { ExpLogical*tmp = new ExpLogical(ExpLogical::OR, (yyvsp[-2].expr), (yyvsp[0].expr));
	FILE_NAME(tmp, (yylsp[-1]));
	(yyval.expr) = tmp;
      }
#line 3546 "parse.cc"
    break;

  case 140:
#line 1200 "parse.y"
    { (yyval.expr) = (yyvsp[0].expr); }
#line 3552 "parse.cc"
    break;

  case 141:
#line 1202 "parse.y"
    { ExpLogical*tmp = new ExpLogical(ExpLogical::XNOR, (yyvsp[-2].expr), (yyvsp[0].expr));
	FILE_NAME(tmp, (yylsp[-1]));
	(yyval.expr) = tmp;
      }
#line 3561 "parse.cc"
    break;

  case 142:
#line 1210 "parse.y"
    { (yyval.expr) = (yyvsp[0].expr); }
#line 3567 "parse.cc"
    break;

  case 143:
#line 1212 "parse.y"
    { ExpLogical*tmp = new ExpLogical(ExpLogical::XOR, (yyvsp[-2].expr), (yyvsp[0].expr));
	FILE_NAME(tmp, (yylsp[-1]));
	(yyval.expr) = tmp;
      }
#line 3576 "parse.cc"
    break;

  case 144:
#line 1220 "parse.y"
    { (yyval.expr) = (yyvsp[0].expr); }
#line 3582 "parse.cc"
    break;

  case 145:
#line 1222 "parse.y"
    { ExpArithmetic*tmp = new ExpArithmetic(ExpArithmetic::POW, (yyvsp[-2].expr), (yyvsp[0].expr));
	FILE_NAME(tmp, (yylsp[-1]));
	(yyval.expr) = tmp;
      }
#line 3591 "parse.cc"
    break;

  case 146:
#line 1227 "parse.y"
    { ExpUAbs*tmp = new ExpUAbs((yyvsp[0].expr));
	FILE_NAME(tmp, (yylsp[-1]));
	(yyval.expr) = tmp;
      }
#line 3600 "parse.cc"
    break;

  case 147:
#line 1232 "parse.y"
    { ExpUNot*tmp = new ExpUNot((yyvsp[0].expr));
	FILE_NAME(tmp, (yylsp[-1]));
	(yyval.expr) = tmp;
      }
#line 3609 "parse.cc"
    break;

  case 148:
#line 1242 "parse.y"
    { perm_string name = lex_strings.make((yyvsp[-11].text));
	perm_string gvar = lex_strings.make((yyvsp[-8].text));
	ForGenerate*tmp = new ForGenerate(name, gvar, (yyvsp[-6].range), *(yyvsp[-4].arch_statement_list));
	FILE_NAME(tmp, (yylsp[-11]));

	if ((yyvsp[-1].text) && name != (yyvsp[-1].text)) {
	      errormsg((yylsp[-11]), "for-generate name %s does not match closing name %s\n",
		       name.str(), (yyvsp[-1].text));
	}
	delete[](yyvsp[-11].text);
	delete[](yyvsp[-8].text);
	delete (yyvsp[-4].arch_statement_list);
	delete[](yyvsp[-1].text);
	(yyval.arch_statement) = tmp;
      }
#line 3629 "parse.cc"
    break;

  case 149:
#line 1261 "parse.y"
    { perm_string type_name = lex_strings.make((yyvsp[0].text));
	perm_string name = lex_strings.make((yyvsp[-3].text));
	const VType*type_mark = active_scope->find_type(type_name);
	touchup_interface_for_functions((yyvsp[-2].interface_list));
	SubprogramHeader*tmp = new SubprogramHeader(name, (yyvsp[-2].interface_list), type_mark);
	FILE_NAME(tmp, (yylsp[-4]));
	delete[](yyvsp[-3].text);
	delete[](yyvsp[0].text);
	(yyval.subprogram) = tmp;
      }
#line 3644 "parse.cc"
    break;

  case 152:
#line 1279 "parse.y"
    { (yyval.arch_statement_list) = (yyvsp[0].arch_statement_list); }
#line 3650 "parse.cc"
    break;

  case 153:
#line 1284 "parse.y"
    { (yyval.interface_list) = (yyvsp[0].interface_list);}
#line 3656 "parse.cc"
    break;

  case 154:
#line 1286 "parse.y"
    { (yyval.interface_list) = 0; }
#line 3662 "parse.cc"
    break;

  case 155:
#line 1291 "parse.y"
    { (yyval.interface_list) = (yyvsp[-1].interface_list); }
#line 3668 "parse.cc"
    break;

  case 156:
#line 1293 "parse.y"
    { errormsg((yylsp[-2]), "Error in interface list for generic.\n");
	yyerrok;
	(yyval.interface_list) = 0;
      }
#line 3677 "parse.cc"
    break;

  case 157:
#line 1300 "parse.y"
    { (yyval.named_expr_list) = (yyvsp[0].named_expr_list); }
#line 3683 "parse.cc"
    break;

  case 158:
#line 1301 "parse.y"
    { (yyval.named_expr_list) = 0; }
#line 3689 "parse.cc"
    break;

  case 159:
#line 1306 "parse.y"
    { (yyval.named_expr_list) = (yyvsp[-1].named_expr_list); }
#line 3695 "parse.cc"
    break;

  case 160:
#line 1308 "parse.y"
    { errormsg((yylsp[-1]), "Error in association list for generic map.\n");
	yyerrok;
	(yyval.named_expr_list) = 0;
      }
#line 3704 "parse.cc"
    break;

  case 161:
#line 1316 "parse.y"
    { std::list<perm_string>* tmp = (yyvsp[-2].name_list);
	tmp->push_back(lex_strings.make((yyvsp[0].text)));
	delete[](yyvsp[0].text);
	(yyval.name_list) = tmp;
      }
#line 3714 "parse.cc"
    break;

  case 162:
#line 1322 "parse.y"
    { std::list<perm_string>*tmp = new std::list<perm_string>;
	tmp->push_back(lex_strings.make((yyvsp[0].text)));
	delete[](yyvsp[0].text);
	(yyval.name_list) = tmp;
      }
#line 3724 "parse.cc"
    break;

  case 163:
#line 1329 "parse.y"
    { (yyval.text) = (yyvsp[0].text); }
#line 3730 "parse.cc"
    break;

  case 164:
#line 1329 "parse.y"
    { (yyval.text) = 0; }
#line 3736 "parse.cc"
    break;

  case 165:
#line 1331 "parse.y"
    { (yyval.text) = (yyvsp[-1].text); }
#line 3742 "parse.cc"
    break;

  case 166:
#line 1331 "parse.y"
    { (yyval.text) = 0; }
#line 3748 "parse.cc"
    break;

  case 167:
#line 1341 "parse.y"
    { perm_string name = lex_strings.make((yyvsp[-9].text));
	IfGenerate*tmp = new IfGenerate(name, (yyvsp[-6].expr), *(yyvsp[-4].arch_statement_list));
	FILE_NAME(tmp, (yylsp[-7]));

	if ((yyvsp[-1].text) && name != (yyvsp[-1].text)) {
	      errormsg((yylsp[-9]), "if-generate name %s does not match closing name %s\n",
		       name.str(), (yyvsp[-1].text));
	}
	delete[](yyvsp[-9].text);
	delete  (yyvsp[-4].arch_statement_list);
	delete[](yyvsp[-1].text);
	(yyval.arch_statement) = tmp;
      }
#line 3766 "parse.cc"
    break;

  case 168:
#line 1360 "parse.y"
    { IfSequential*tmp = new IfSequential((yyvsp[-7].expr), (yyvsp[-5].sequ_list), (yyvsp[-4].elsif_list), (yyvsp[-3].sequ_list));
	FILE_NAME(tmp, (yylsp[-8]));
	delete (yyvsp[-5].sequ_list);
	delete (yyvsp[-4].elsif_list);
	delete (yyvsp[-3].sequ_list);
	(yyval.sequ) = tmp;
      }
#line 3778 "parse.cc"
    break;

  case 169:
#line 1371 "parse.y"
    { errormsg((yylsp[-7]), "Error in if_statement condition expression.\n");
	yyerrok;
	(yyval.sequ) = 0;
	delete (yyvsp[-5].sequ_list);
      }
#line 3788 "parse.cc"
    break;

  case 170:
#line 1378 "parse.y"
    { errormsg((yylsp[-3]), "Too many errors in sequence within if_statement.\n");
	yyerrok;
	(yyval.sequ) = 0;
      }
#line 3797 "parse.cc"
    break;

  case 171:
#line 1384 "parse.y"
    { errormsg((yylsp[-3]), "Too many errors in if_statement.\n");
	yyerrok;
	(yyval.sequ) = 0;
      }
#line 3806 "parse.cc"
    break;

  case 172:
#line 1391 "parse.y"
    { (yyval.elsif_list) = (yyvsp[0].elsif_list); }
#line 3812 "parse.cc"
    break;

  case 173:
#line 1392 "parse.y"
    { (yyval.elsif_list) = 0;  }
#line 3818 "parse.cc"
    break;

  case 174:
#line 1397 "parse.y"
    { list<IfSequential::Elsif*>*tmp = (yyvsp[-1].elsif_list);
	tmp->push_back((yyvsp[0].elsif));
	(yyval.elsif_list) = tmp;
      }
#line 3827 "parse.cc"
    break;

  case 175:
#line 1402 "parse.y"
    { list<IfSequential::Elsif*>*tmp = new list<IfSequential::Elsif*>;
	tmp->push_back((yyvsp[0].elsif));
	(yyval.elsif_list) = tmp;
      }
#line 3836 "parse.cc"
    break;

  case 176:
#line 1410 "parse.y"
    { IfSequential::Elsif*tmp = new IfSequential::Elsif((yyvsp[-2].expr), (yyvsp[0].sequ_list));
	FILE_NAME(tmp, (yylsp[-3]));
	delete (yyvsp[0].sequ_list);
	(yyval.elsif) = tmp;
      }
#line 3846 "parse.cc"
    break;

  case 177:
#line 1416 "parse.y"
    { errormsg((yylsp[0]), "Too many errors in elsif sub-statements.\n");
	yyerrok;
	(yyval.elsif) = 0;
      }
#line 3855 "parse.cc"
    break;

  case 178:
#line 1424 "parse.y"
    { (yyval.sequ_list) = (yyvsp[0].sequ_list); }
#line 3861 "parse.cc"
    break;

  case 179:
#line 1426 "parse.y"
    { errormsg((yylsp[0]), "Too many errors in else sub-statements.\n");
	yyerrok;
	(yyval.sequ_list) = 0;
      }
#line 3870 "parse.cc"
    break;

  case 180:
#line 1431 "parse.y"
    { (yyval.sequ_list) = 0; }
#line 3876 "parse.cc"
    break;

  case 181:
#line 1436 "parse.y"
    { (yyval.range_list) = (yyvsp[-1].range_list); }
#line 3882 "parse.cc"
    break;

  case 182:
#line 1438 "parse.y"
    { errormsg((yylsp[-1]), "Errors in the index constraint.\n");
	yyerrok;
	(yyval.range_list) = new list<prange_t*>;
      }
#line 3891 "parse.cc"
    break;

  case 186:
#line 1456 "parse.y"
    {
  instant_list_t* tmp = new instant_list_t(instant_list_t::NONE, (yyvsp[0].name_list));
  (yyval.instantiation_list) = tmp;
     }
#line 3900 "parse.cc"
    break;

  case 187:
#line 1461 "parse.y"
    {
  instant_list_t* tmp = new instant_list_t(instant_list_t::OTHERS, 0);
  (yyval.instantiation_list) = tmp;
     }
#line 3909 "parse.cc"
    break;

  case 188:
#line 1466 "parse.y"
    {
  instant_list_t* tmp = new instant_list_t(instant_list_t::ALL, 0);
  (yyval.instantiation_list) = tmp;
   }
#line 3918 "parse.cc"
    break;

  case 189:
#line 1475 "parse.y"
    { std::list<InterfacePort*>*tmp = new std::list<InterfacePort*>;
	for (std::list<perm_string>::iterator cur = (yyvsp[-4].name_list)->begin()
		   ; cur != (yyvsp[-4].name_list)->end() ; ++cur) {
	      InterfacePort*port = new InterfacePort;
	      FILE_NAME(port, (yylsp[-4]));
	      port->mode = (yyvsp[-2].port_mode);
	      port->name = *(cur);
	      port->type = (yyvsp[-1].vtype);
	      port->expr = (yyvsp[0].expr);
	      tmp->push_back(port);
	}
	delete (yyvsp[-4].name_list);
	(yyval.interface_list) = tmp;
      }
#line 3937 "parse.cc"
    break;

  case 190:
#line 1492 "parse.y"
    { (yyval.expr) = (yyvsp[0].expr); }
#line 3943 "parse.cc"
    break;

  case 191:
#line 1493 "parse.y"
    { (yyval.expr) = 0; }
#line 3949 "parse.cc"
    break;

  case 192:
#line 1498 "parse.y"
    { std::list<InterfacePort*>*tmp = (yyvsp[-2].interface_list);
	tmp->splice(tmp->end(), *(yyvsp[0].interface_list));
	delete (yyvsp[0].interface_list);
	(yyval.interface_list) = tmp;
      }
#line 3959 "parse.cc"
    break;

  case 193:
#line 1504 "parse.y"
    { std::list<InterfacePort*>*tmp = (yyvsp[0].interface_list);
	(yyval.interface_list) = tmp;
      }
#line 3967 "parse.cc"
    break;

  case 194:
#line 1511 "parse.y"
    { library_import((yylsp[-2]), (yyvsp[-1].name_list));
	delete (yyvsp[-1].name_list);
      }
#line 3975 "parse.cc"
    break;

  case 195:
#line 1515 "parse.y"
    { errormsg((yylsp[-2]), "Syntax error in library clause.\n"); yyerrok; }
#line 3981 "parse.cc"
    break;

  case 198:
#line 1525 "parse.y"
    { (yyval.text) = (yyvsp[0].text); }
#line 3987 "parse.cc"
    break;

  case 199:
#line 1529 "parse.y"
    { std::list<perm_string>*tmp = (yyvsp[-2].name_list);
	tmp->push_back(lex_strings.make((yyvsp[0].text)));
	delete[](yyvsp[0].text);
	(yyval.name_list) = tmp;
      }
#line 3997 "parse.cc"
    break;

  case 200:
#line 1535 "parse.y"
    { std::list<perm_string>*tmp = new std::list<perm_string>;
	tmp->push_back(lex_strings.make((yyvsp[0].text)));
	delete[](yyvsp[0].text);
	(yyval.name_list) = tmp;
      }
#line 4007 "parse.cc"
    break;

  case 201:
#line 1547 "parse.y"
    { perm_string loop_name = (yyvsp[-8].text)? lex_strings.make((yyvsp[-8].text)) : perm_string() ;
	if ((yyvsp[-1].text) && !(yyvsp[-8].text)) {
	      errormsg((yylsp[-1]), "Loop statement closing name %s for un-named statement\n", (yyvsp[-1].text));
	} else if((yyvsp[-1].text) && loop_name != (yyvsp[-1].text)) {
	      errormsg((yylsp[-8]), "Loop statement name %s doesn't match closing name %s.\n", loop_name.str(), (yyvsp[-1].text));
	}
	if((yyvsp[-8].text)) delete[](yyvsp[-8].text);
	if((yyvsp[-1].text)) delete[](yyvsp[-1].text);

	ExpLogical* cond = dynamic_cast<ExpLogical*>((yyvsp[-6].expr));
	if(!cond) {
	      errormsg((yylsp[-6]), "Iteration condition is not a correct logical expression.\n");
	}
	WhileLoopStatement* tmp = new WhileLoopStatement(loop_name, cond, (yyvsp[-4].sequ_list));
	FILE_NAME(tmp, (yylsp[-8]));

	sorrymsg((yylsp[-8]), "Loop statements are not supported.\n");
	(yyval.sequ) = tmp;
      }
#line 4031 "parse.cc"
    break;

  case 202:
#line 1570 "parse.y"
    { perm_string loop_name = (yyvsp[-10].text)? lex_strings.make((yyvsp[-10].text)) : perm_string() ;
	perm_string index_name = lex_strings.make((yyvsp[-8].text));
	if ((yyvsp[-1].text) && !(yyvsp[-10].text)) {
	      errormsg((yylsp[-1]), "Loop statement closing name %s for un-named statement\n", (yyvsp[-1].text));
	} else if((yyvsp[-1].text) && loop_name != (yyvsp[-1].text)) {
	      errormsg((yylsp[-10]), "Loop statement name %s doesn't match closing name %s.\n", loop_name.str(), (yyvsp[-1].text));
	}
	if((yyvsp[-10].text))  delete[] (yyvsp[-10].text);
	delete[] (yyvsp[-8].text);
	if((yyvsp[-1].text)) delete[] (yyvsp[-1].text);

	ForLoopStatement* tmp = new ForLoopStatement(loop_name, index_name, (yyvsp[-6].range), (yyvsp[-4].sequ_list));
	FILE_NAME(tmp, (yylsp[-10]));
	(yyval.sequ) = tmp;
      }
#line 4051 "parse.cc"
    break;

  case 203:
#line 1588 "parse.y"
    { perm_string loop_name = (yyvsp[-6].text)? lex_strings.make((yyvsp[-6].text)) : perm_string() ;
	if ((yyvsp[-1].text) && !(yyvsp[-6].text)) {
	      errormsg((yylsp[-1]), "Loop statement closing name %s for un-named statement\n", (yyvsp[-1].text));
	} else if((yyvsp[-1].text) && loop_name != (yyvsp[-1].text)) {
	      errormsg((yylsp[-6]), "Loop statement name %s doesn't match closing name %s.\n", loop_name.str(), (yyvsp[-1].text));
	}
	if((yyvsp[-6].text)) delete[](yyvsp[-6].text);
	if((yyvsp[-1].text)) delete[](yyvsp[-1].text);

	BasicLoopStatement* tmp = new BasicLoopStatement(loop_name, (yyvsp[-4].sequ_list));
	FILE_NAME(tmp, (yylsp[-5]));

	sorrymsg((yylsp[-6]), "Loop statements are not supported.\n");
	(yyval.sequ) = tmp;
      }
#line 4071 "parse.cc"
    break;

  case 204:
#line 1605 "parse.y"
    { (yyval.port_mode) = PORT_IN; }
#line 4077 "parse.cc"
    break;

  case 205:
#line 1606 "parse.y"
    { (yyval.port_mode) = PORT_OUT; }
#line 4083 "parse.cc"
    break;

  case 206:
#line 1607 "parse.y"
    { (yyval.port_mode) = PORT_INOUT; }
#line 4089 "parse.cc"
    break;

  case 207:
#line 1610 "parse.y"
    {(yyval.port_mode) = (yyvsp[0].port_mode);}
#line 4095 "parse.cc"
    break;

  case 208:
#line 1610 "parse.y"
    {(yyval.port_mode) = PORT_NONE;}
#line 4101 "parse.cc"
    break;

  case 209:
#line 1614 "parse.y"
    { Expression*tmp = new ExpName(lex_strings.make((yyvsp[0].text)));
        FILE_NAME(tmp, (yylsp[0]));
        delete[](yyvsp[0].text);
        (yyval.expr) = tmp;
      }
#line 4111 "parse.cc"
    break;

  case 210:
#line 1621 "parse.y"
    { (yyval.expr) = (yyvsp[0].expr); }
#line 4117 "parse.cc"
    break;

  case 211:
#line 1628 "parse.y"
    { perm_string name = lex_strings.make((yyvsp[-3].text));
	delete[](yyvsp[-3].text);
	if (active_scope->is_vector_name(name) || is_subprogram_param(name)) {
	      ExpName*tmp = new ExpName(name, (yyvsp[-1].expr_list));
	      (yyval.expr) = tmp;
	} else {
	      ExpFunc*tmp = new ExpFunc(name, (yyvsp[-1].expr_list));
	      (yyval.expr) = tmp;
	}
	FILE_NAME((yyval.expr), (yylsp[-3]));
      }
#line 4133 "parse.cc"
    break;

  case 212:
#line 1640 "parse.y"
    { ExpName*tmp = new ExpName(lex_strings.make((yyvsp[-3].text)), (yyvsp[-1].range)->msb(), (yyvsp[-1].range)->lsb());
	FILE_NAME(tmp, (yylsp[-3]));
	delete[](yyvsp[-3].text);
	(yyval.expr) = tmp;
      }
#line 4143 "parse.cc"
    break;

  case 213:
#line 1646 "parse.y"
    { ExpName*tmp = dynamic_cast<ExpName*> ((yyvsp[-3].expr));
	tmp->set_range((yyvsp[-1].range)->msb(), (yyvsp[-1].range)->lsb());
	(yyval.expr) = tmp;
      }
#line 4152 "parse.cc"
    break;

  case 214:
#line 1651 "parse.y"
    { ExpName*tmp = dynamic_cast<ExpName*> ((yyvsp[-3].expr));
	tmp->set_range((yyvsp[-1].expr), NULL);
	(yyval.expr) = tmp;
      }
#line 4161 "parse.cc"
    break;

  case 215:
#line 1660 "parse.y"
    { std::list<Expression*>*tmp = (yyvsp[-2].expr_list);
	tmp->push_back((yyvsp[0].expr));
	(yyval.expr_list) = tmp;
      }
#line 4170 "parse.cc"
    break;

  case 216:
#line 1665 "parse.y"
    { std::list<Expression*>*tmp = new std::list<Expression*>;
	tmp->push_back((yyvsp[0].expr));
	(yyval.expr_list) = tmp;
      }
#line 4179 "parse.cc"
    break;

  case 217:
#line 1675 "parse.y"
    { perm_string name = lex_strings.make((yyvsp[-6].text));
	if((yyvsp[-1].text) && name != (yyvsp[-1].text)) {
	      errormsg((yylsp[-6]), "Identifier %s doesn't match package name %s.\n",
		       (yyvsp[-1].text), name.str());
        }
	Package*tmp = new Package(name, *active_scope);
	FILE_NAME(tmp, (yylsp[-6]));
	delete[](yyvsp[-6].text);
        if ((yyvsp[-1].text)) delete[](yyvsp[-1].text);
	pop_scope();
	  /* Put this package into the work library, or the currently
	     parsed library. Note that parse_library_name is an
	     argument to the parser. */
	library_save_package(parse_library_name, tmp);
      }
#line 4199 "parse.cc"
    break;

  case 218:
#line 1691 "parse.y"
    { errormsg((yylsp[-4]), "Syntax error in package clause.\n");
      yyerrok;
      pop_scope();
    }
#line 4208 "parse.cc"
    break;

  case 219:
#line 1699 "parse.y"
    { push_scope();
	(yyval.text) = (yyvsp[0].text);
      }
#line 4216 "parse.cc"
    break;

  case 232:
#line 1728 "parse.y"
    { errormsg((yylsp[-1]), "Syntax error in package declarative item.\n");
	yyerrok;
      }
#line 4224 "parse.cc"
    break;

  case 237:
#line 1747 "parse.y"
    { perm_string name = lex_strings.make((yyvsp[-6].text));
	if ((yyvsp[-1].text) && name != (yyvsp[-1].text))
	      errormsg((yylsp[-1]), "Package name (%s) doesn't match closing name (%s).\n", (yyvsp[-6].text), (yyvsp[-1].text));
	delete[] (yyvsp[-6].text);
	if((yyvsp[-1].text)) delete[](yyvsp[-1].text);
	pop_scope();
      }
#line 4236 "parse.cc"
    break;

  case 238:
#line 1756 "parse.y"
    { errormsg((yylsp[-6]), "Errors in package %s body.\n", (yyvsp[-6].text));
	yyerrok;
	pop_scope();
      }
#line 4245 "parse.cc"
    break;

  case 239:
#line 1768 "parse.y"
    { perm_string name = lex_strings.make((yyvsp[0].text));
	push_scope();
	Package*pkg = library_recall_package(parse_library_name, name);
	if (pkg != 0) {
	      active_scope->set_package_header(pkg);
	} else {
	      errormsg((yylsp[-2]), "Package body for %s has no matching header.\n", (yyvsp[0].text));
	}
	(yyval.text) = (yyvsp[0].text);
      }
#line 4260 "parse.cc"
    break;

  case 240:
#line 1781 "parse.y"
    { (yyval.interface_list) = (yyvsp[-1].interface_list); }
#line 4266 "parse.cc"
    break;

  case 241:
#line 1785 "parse.y"
    { (yyval.interface_list) = (yyvsp[0].interface_list); }
#line 4272 "parse.cc"
    break;

  case 242:
#line 1786 "parse.y"
    { (yyval.interface_list) = 0; }
#line 4278 "parse.cc"
    break;

  case 243:
#line 1791 "parse.y"
    { (yyval.interface_list) = (yyvsp[-1].interface_list); }
#line 4284 "parse.cc"
    break;

  case 244:
#line 1793 "parse.y"
    { errormsg((yylsp[-4]), "Syntax error in port list.\n");
	yyerrok;
	(yyval.interface_list) = 0;
      }
#line 4293 "parse.cc"
    break;

  case 245:
#line 1799 "parse.y"
    {(yyval.interface_list) = (yyvsp[0].interface_list);}
#line 4299 "parse.cc"
    break;

  case 246:
#line 1799 "parse.y"
    {(yyval.interface_list) = 0;}
#line 4305 "parse.cc"
    break;

  case 247:
#line 1803 "parse.y"
    { (yyval.named_expr_list) = (yyvsp[-1].named_expr_list); }
#line 4311 "parse.cc"
    break;

  case 248:
#line 1805 "parse.y"
    { errormsg((yylsp[-4]), "Syntax error in port map aspect.\n");
	yyerrok;
      }
#line 4319 "parse.cc"
    break;

  case 249:
#line 1811 "parse.y"
    { (yyval.named_expr_list) = (yyvsp[0].named_expr_list); }
#line 4325 "parse.cc"
    break;

  case 250:
#line 1812 "parse.y"
    { (yyval.named_expr_list) = 0; }
#line 4331 "parse.cc"
    break;

  case 251:
#line 1818 "parse.y"
    { (yyval.expr) = (yyvsp[0].expr); }
#line 4337 "parse.cc"
    break;

  case 252:
#line 1823 "parse.y"
    { (yyval.expr) = (yyvsp[0].expr); }
#line 4343 "parse.cc"
    break;

  case 253:
#line 1825 "parse.y"
    { perm_string name = lex_strings.make((yyvsp[0].text));
	ExpName*base = dynamic_cast<ExpName*> ((yyvsp[-2].expr));
	ExpAttribute*tmp = new ExpAttribute(base, name);
	FILE_NAME(tmp, (yylsp[0]));
	delete[](yyvsp[0].text);
	(yyval.expr) = tmp;
      }
#line 4355 "parse.cc"
    break;

  case 254:
#line 1833 "parse.y"
    { ExpCharacter*tmp = new ExpCharacter((yyvsp[0].text)[0]);
	FILE_NAME(tmp,(yylsp[0]));
	delete[](yyvsp[0].text);
	(yyval.expr) = tmp;
      }
#line 4365 "parse.cc"
    break;

  case 255:
#line 1839 "parse.y"
    { ExpInteger*tmp = new ExpInteger((yyvsp[0].uni_integer));
	FILE_NAME(tmp, (yylsp[0]));
	(yyval.expr) = tmp;
      }
#line 4374 "parse.cc"
    break;

  case 256:
#line 1844 "parse.y"
    { ExpReal*tmp = new ExpReal((yyvsp[0].uni_real));
    FILE_NAME(tmp, (yylsp[0]));
    (yyval.expr) = tmp;
      }
#line 4383 "parse.cc"
    break;

  case 257:
#line 1849 "parse.y"
    { ExpString*tmp = new ExpString((yyvsp[0].text));
	FILE_NAME(tmp,(yylsp[0]));
	delete[](yyvsp[0].text);
	(yyval.expr) = tmp;
      }
#line 4393 "parse.cc"
    break;

  case 258:
#line 1855 "parse.y"
    { ExpBitstring*tmp = new ExpBitstring((yyvsp[0].text));
	FILE_NAME(tmp, (yylsp[0]));
	delete[](yyvsp[0].text);
	(yyval.expr) = tmp;
      }
#line 4403 "parse.cc"
    break;

  case 259:
#line 1861 "parse.y"
    { ExpTime::timeunit_t unit = ExpTime::FS;

        if(!strcasecmp((yyvsp[0].text), "us"))
            unit = ExpTime::US;
        else if(!strcasecmp((yyvsp[0].text), "ms"))
            unit = ExpTime::MS;
        else if(!strcasecmp((yyvsp[0].text), "ns"))
            unit = ExpTime::NS;
        else if(!strcasecmp((yyvsp[0].text), "s"))
            unit = ExpTime::S;
        else if(!strcasecmp((yyvsp[0].text), "ps"))
            unit = ExpTime::PS;
        else if(!strcasecmp((yyvsp[0].text), "fs"))
            unit = ExpTime::FS;
        else
            errormsg((yylsp[0]), "Invalid time unit (accepted are fs, ps, ns, us, ms, s).\n");

        if((yyvsp[-1].uni_integer) < 0)
            errormsg((yylsp[-1]), "Time cannot be negative.\n");

        ExpTime*tmp = new ExpTime((yyvsp[-1].uni_integer), unit);
        FILE_NAME(tmp, (yylsp[-1]));
        delete[] (yyvsp[0].text);
        (yyval.expr) = tmp;
      }
#line 4433 "parse.cc"
    break;

  case 260:
#line 1896 "parse.y"
    { sorrymsg((yylsp[-3]), "Function calls not supported\n");
	delete[] (yyvsp[-3].text);
	(yyval.expr) = 0;
      }
#line 4442 "parse.cc"
    break;

  case 261:
#line 1904 "parse.y"
    { Expression*tmp = aggregate_or_primary((yylsp[-2]), (yyvsp[-1].element_list));
	(yyval.expr) = tmp;
      }
#line 4450 "parse.cc"
    break;

  case 265:
#line 1917 "parse.y"
    {
    ProcedureCall* tmp = new ProcedureCall(lex_strings.make((yyvsp[-1].text)));
    delete[] (yyvsp[-1].text);
    (yyval.sequ) = tmp;
      }
#line 4460 "parse.cc"
    break;

  case 266:
#line 1923 "parse.y"
    {
    ProcedureCall* tmp = new ProcedureCall(lex_strings.make((yyvsp[-4].text)), (yyvsp[-2].named_expr_list));
    delete[] (yyvsp[-4].text);
    (yyval.sequ) = tmp;
      }
#line 4470 "parse.cc"
    break;

  case 267:
#line 1929 "parse.y"
    {
    ProcedureCall* tmp = new ProcedureCall(lex_strings.make((yyvsp[-4].text)), (yyvsp[-2].expr_list));
    delete[] (yyvsp[-4].text);
    delete (yyvsp[-2].expr_list); // parameters are copied in this variant
    (yyval.sequ) = tmp;
      }
#line 4481 "parse.cc"
    break;

  case 268:
#line 1936 "parse.y"
    { errormsg((yylsp[-4]), "Errors in procedure call.\n");
	yyerrok;
	delete[](yyvsp[-4].text);
	(yyval.sequ) = 0;
      }
#line 4491 "parse.cc"
    break;

  case 269:
#line 1945 "parse.y"
    { delete[] (yyvsp[-2].text);
	(yyval.sequ) = (yyvsp[0].sequ);
      }
#line 4499 "parse.cc"
    break;

  case 270:
#line 1948 "parse.y"
    { (yyval.sequ) = (yyvsp[0].sequ); }
#line 4505 "parse.cc"
    break;

  case 271:
#line 1953 "parse.y"
    { perm_string name = lex_strings.make((yyvsp[-1].text));
	touchup_interface_for_functions((yyvsp[0].interface_list));
	SubprogramHeader*tmp = new SubprogramHeader(name, (yyvsp[0].interface_list), NULL);
	FILE_NAME(tmp, (yylsp[-2]));
	delete[](yyvsp[-1].text);
	(yyval.subprogram) = tmp;
      }
#line 4517 "parse.cc"
    break;

  case 277:
#line 1982 "parse.y"
    { perm_string iname = (yyvsp[-12].text)? lex_strings.make((yyvsp[-12].text)) : perm_string();
	if ((yyvsp[-12].text)) delete[](yyvsp[-12].text);
	if ((yyvsp[-1].text)) {
	      if (iname.nil()) {
		    errormsg((yylsp[-1]), "Process end name %s for un-named processes.\n", (yyvsp[-1].text));
	      } else if (iname != (yyvsp[-1].text)) {
		    errormsg((yylsp[-1]), "Process name %s does not match opening name %s.\n",
			     (yyvsp[-1].text), (yyvsp[-12].text));
	      }
	      delete[](yyvsp[-1].text);
	}

	ProcessStatement*tmp = new ProcessStatement(iname, (yyvsp[-9].expr_list), (yyvsp[-5].sequ_list));
	FILE_NAME(tmp, (yylsp[-10]));
	delete (yyvsp[-9].expr_list);
	delete (yyvsp[-5].sequ_list);
	(yyval.arch_statement) = tmp;
      }
#line 4540 "parse.cc"
    break;

  case 278:
#line 2006 "parse.y"
    { errormsg((yylsp[-6]), "Too many errors in process sequential statements.\n");
	yyerrok;
	(yyval.arch_statement) = 0;
      }
#line 4549 "parse.cc"
    break;

  case 279:
#line 2019 "parse.y"
    { (yyval.expr_list) = (yyvsp[-1].expr_list); }
#line 4555 "parse.cc"
    break;

  case 280:
#line 2021 "parse.y"
    { errormsg((yylsp[-1]), "Error in process sensitivity list\n");
	yyerrok;
	(yyval.expr_list) = 0;
      }
#line 4564 "parse.cc"
    break;

  case 281:
#line 2026 "parse.y"
    { (yyval.expr_list) = 0; }
#line 4570 "parse.cc"
    break;

  case 282:
#line 2031 "parse.y"
    { std::list<Expression*>*tmp = new std::list<Expression*>;
	ExpName*all = new ExpNameALL;
	FILE_NAME(all, (yylsp[0]));
	tmp->push_back(all);
	(yyval.expr_list) = tmp;
      }
#line 4581 "parse.cc"
    break;

  case 283:
#line 2038 "parse.y"
    { (yyval.expr_list) = (yyvsp[0].expr_list); }
#line 4587 "parse.cc"
    break;

  case 284:
#line 2043 "parse.y"
    { prange_t* tmp = new prange_t((yyvsp[-2].expr), (yyvsp[0].expr), (yyvsp[-1].flag));
	(yyval.range) = tmp;
      }
#line 4595 "parse.cc"
    break;

  case 285:
#line 2047 "parse.y"
    {
        prange_t*tmp = NULL;
        ExpName*name = NULL;
        if((name = dynamic_cast<ExpName*>((yyvsp[-2].expr)))) {
            ExpAttribute*left = new ExpAttribute(name, left_attr);
            ExpAttribute*right = new ExpAttribute(name, right_attr);
            tmp = new prange_t(left, right, true);
            tmp->set_auto_dir();
        } else {
	    errormsg((yylsp[-2]), "'range attribute can be used with named expressions only");
        }
        (yyval.range) = tmp;
      }
#line 4613 "parse.cc"
    break;

  case 286:
#line 2061 "parse.y"
    {
        prange_t*tmp = NULL;
        ExpName*name = NULL;
        if((name = dynamic_cast<ExpName*>((yyvsp[-2].expr)))) {
            ExpAttribute*left = new ExpAttribute(name, left_attr);
            ExpAttribute*right = new ExpAttribute(name, right_attr);
            tmp = new prange_t(left, right, false);
            tmp->set_auto_dir();
        } else {
	    errormsg((yylsp[-2]), "'reverse_range attribute can be used with named expressions only");
        }
        (yyval.range) = tmp;
      }
#line 4631 "parse.cc"
    break;

  case 287:
#line 2078 "parse.y"
    { list<prange_t*>*tmp = new list<prange_t*>;
	tmp->push_back((yyvsp[0].range));
	(yyval.range_list) = tmp;
      }
#line 4640 "parse.cc"
    break;

  case 288:
#line 2083 "parse.y"
    { list<prange_t*>*tmp = (yyvsp[-2].range_list);
	tmp->push_back((yyvsp[0].range));
	(yyval.range_list) = tmp;
      }
#line 4649 "parse.cc"
    break;

  case 289:
#line 2091 "parse.y"
    { VTypeRecord*tmp = new VTypeRecord((yyvsp[-2].record_elements));
	(yyval.vtype) = tmp;
      }
#line 4657 "parse.cc"
    break;

  case 290:
#line 2098 "parse.y"
    { (yyval.expr) = (yyvsp[0].expr); }
#line 4663 "parse.cc"
    break;

  case 291:
#line 2100 "parse.y"
    { ExpRelation*tmp = new ExpRelation(ExpRelation::EQ, (yyvsp[-2].expr), (yyvsp[0].expr));
        FILE_NAME(tmp, (yylsp[-1]));
	(yyval.expr) = tmp;
      }
#line 4672 "parse.cc"
    break;

  case 292:
#line 2105 "parse.y"
    { ExpRelation*tmp = new ExpRelation(ExpRelation::LT, (yyvsp[-2].expr), (yyvsp[0].expr));
        FILE_NAME(tmp, (yylsp[-1]));
	(yyval.expr) = tmp;
      }
#line 4681 "parse.cc"
    break;

  case 293:
#line 2110 "parse.y"
    { ExpRelation*tmp = new ExpRelation(ExpRelation::GT, (yyvsp[-2].expr), (yyvsp[0].expr));
        FILE_NAME(tmp, (yylsp[-1]));
	(yyval.expr) = tmp;
      }
#line 4690 "parse.cc"
    break;

  case 294:
#line 2115 "parse.y"
    { ExpRelation*tmp = new ExpRelation(ExpRelation::LE, (yyvsp[-2].expr), (yyvsp[0].expr));
        FILE_NAME(tmp, (yylsp[-1]));
	(yyval.expr) = tmp;
      }
#line 4699 "parse.cc"
    break;

  case 295:
#line 2120 "parse.y"
    { ExpRelation*tmp = new ExpRelation(ExpRelation::GE, (yyvsp[-2].expr), (yyvsp[0].expr));
        FILE_NAME(tmp, (yylsp[-1]));
	(yyval.expr) = tmp;
      }
#line 4708 "parse.cc"
    break;

  case 296:
#line 2125 "parse.y"
    { ExpRelation*tmp = new ExpRelation(ExpRelation::NEQ, (yyvsp[-2].expr), (yyvsp[0].expr));
        FILE_NAME(tmp, (yylsp[-1]));
	(yyval.expr) = tmp;
      }
#line 4717 "parse.cc"
    break;

  case 297:
#line 2133 "parse.y"
    { ReportStmt*tmp = new ReportStmt((yyvsp[-2].text), (yyvsp[-1].severity));
	FILE_NAME(tmp,(yylsp[-2]));
	delete[](yyvsp[-2].text);
	(yyval.sequ) = tmp;
      }
#line 4727 "parse.cc"
    break;

  case 298:
#line 2141 "parse.y"
    { ReturnStmt*tmp = new ReturnStmt((yyvsp[-1].expr));
	FILE_NAME(tmp, (yylsp[-2]));
	(yyval.sequ) = tmp;
      }
#line 4736 "parse.cc"
    break;

  case 299:
#line 2146 "parse.y"
    { ReturnStmt*tmp = new ReturnStmt(0);
	FILE_NAME(tmp, (yylsp[-1]));
	(yyval.sequ) = tmp;
      }
#line 4745 "parse.cc"
    break;

  case 300:
#line 2151 "parse.y"
    { ReturnStmt*tmp = new ReturnStmt(0);
	FILE_NAME(tmp, (yylsp[-2]));
	(yyval.sequ) = tmp;
	errormsg((yylsp[-1]), "Error in expression in return statement.\n");
	yyerrok;
      }
#line 4756 "parse.cc"
    break;

  case 303:
#line 2166 "parse.y"
    { Expression*pfx = (yyvsp[-2].expr);
	ExpName*pfx1 = dynamic_cast<ExpName*>(pfx);
	assert(pfx1);
	perm_string tmp = lex_strings.make((yyvsp[0].text));
	(yyval.expr) = new ExpName(pfx1, tmp);
	FILE_NAME((yyval.expr), (yylsp[0]));
	delete[](yyvsp[0].text);
      }
#line 4769 "parse.cc"
    break;

  case 304:
#line 2175 "parse.y"
    { errormsg((yylsp[-2]), "Syntax error in prefix in front of \"%s\".\n", (yyvsp[0].text));
        yyerrok;
	(yyval.expr) = new ExpName(lex_strings.make((yyvsp[0].text)));
	FILE_NAME((yyval.expr), (yylsp[0]));
	delete[](yyvsp[0].text);
      }
#line 4780 "parse.cc"
    break;

  case 305:
#line 2185 "parse.y"
    { std::list<Expression*>* tmp = (yyvsp[-2].expr_list);
	tmp->push_back((yyvsp[0].expr));
	(yyval.expr_list) = tmp;
      }
#line 4789 "parse.cc"
    break;

  case 306:
#line 2190 "parse.y"
    { std::list<Expression*>* tmp = new std::list<Expression*>();
	tmp->push_back((yyvsp[0].expr));
	(yyval.expr_list) = tmp;
      }
#line 4798 "parse.cc"
    break;

  case 307:
#line 2201 "parse.y"
    { library_use((yylsp[-2]), active_scope, 0, (yyvsp[-2].text), 0);
	delete[](yyvsp[-2].text);
      }
#line 4806 "parse.cc"
    break;

  case 308:
#line 2205 "parse.y"
    { library_use((yylsp[-4]), active_scope, (yyvsp[-4].text), (yyvsp[-2].text), 0);
	delete[](yyvsp[-4].text);
	delete[](yyvsp[-2].text);
      }
#line 4815 "parse.cc"
    break;

  case 309:
#line 2210 "parse.y"
    { library_use((yylsp[-4]), active_scope, (yyvsp[-4].text), (yyvsp[-2].text), (yyvsp[0].text));
	delete[](yyvsp[-4].text);
	delete[](yyvsp[-2].text);
	delete[](yyvsp[0].text);
      }
#line 4825 "parse.cc"
    break;

  case 312:
#line 2224 "parse.y"
    { ExpSelected*tmp = new ExpSelected((yyvsp[-5].expr), (yyvsp[-1].exp_options_list));
	FILE_NAME(tmp, (yylsp[-4]));
        delete (yyvsp[-5].expr);
	delete (yyvsp[-1].exp_options_list);

	ExpName*name = dynamic_cast<ExpName*>((yyvsp[-3].expr));
	assert(name);
	SignalAssignment*tmpa = new SignalAssignment(name, tmp);
	FILE_NAME(tmpa, (yylsp[-6]));

	(yyval.arch_statement) = tmpa;
      }
#line 4842 "parse.cc"
    break;

  case 313:
#line 2240 "parse.y"
    { ExpConditional::case_t*tmp = new ExpConditional::case_t((yyvsp[0].expr), (yyvsp[-2].expr_list));
	FILE_NAME(tmp, (yylsp[-2]));
	(yyval.exp_options) = tmp;
      }
#line 4851 "parse.cc"
    break;

  case 314:
#line 2245 "parse.y"
    { ExpConditional::case_t*tmp = new ExpConditional::case_t(0,  (yyvsp[-2].expr_list));
	FILE_NAME(tmp, (yylsp[-2]));
	(yyval.exp_options) = tmp;
      }
#line 4860 "parse.cc"
    break;

  case 315:
#line 2253 "parse.y"
    { list<ExpConditional::case_t*>*tmp = (yyvsp[-2].exp_options_list);
	tmp->push_back((yyvsp[0].exp_options));
	(yyval.exp_options_list) = tmp;
      }
#line 4869 "parse.cc"
    break;

  case 316:
#line 2258 "parse.y"
    { list<ExpConditional::case_t*>*tmp = new list<ExpConditional::case_t*>;
	tmp->push_back((yyvsp[0].exp_options));
	(yyval.exp_options_list) = tmp;
      }
#line 4878 "parse.cc"
    break;

  case 317:
#line 2266 "parse.y"
    { std::list<SequentialStmt*>*tmp = (yyvsp[-1].sequ_list);
    if((yyvsp[0].sequ))
        tmp->push_back((yyvsp[0].sequ));
	(yyval.sequ_list) = tmp;
      }
#line 4888 "parse.cc"
    break;

  case 318:
#line 2272 "parse.y"
    { std::list<SequentialStmt*>*tmp = new std::list<SequentialStmt*>;
    if((yyvsp[0].sequ))
        tmp->push_back((yyvsp[0].sequ));
	(yyval.sequ_list) = tmp;
      }
#line 4898 "parse.cc"
    break;

  case 319:
#line 2280 "parse.y"
    { (yyvsp[0].sequ_list) = (yyval.sequ_list); }
#line 4904 "parse.cc"
    break;

  case 320:
#line 2281 "parse.y"
    { (yyval.sequ_list) = NULL; }
#line 4910 "parse.cc"
    break;

  case 321:
#line 2285 "parse.y"
    { (yyval.sequ) = (yyvsp[0].sequ); }
#line 4916 "parse.cc"
    break;

  case 322:
#line 2286 "parse.y"
    { (yyval.sequ) = (yyvsp[0].sequ); }
#line 4922 "parse.cc"
    break;

  case 323:
#line 2287 "parse.y"
    { (yyval.sequ) = (yyvsp[0].sequ); }
#line 4928 "parse.cc"
    break;

  case 324:
#line 2288 "parse.y"
    { (yyval.sequ) = (yyvsp[0].sequ); }
#line 4934 "parse.cc"
    break;

  case 325:
#line 2289 "parse.y"
    { (yyval.sequ) = (yyvsp[0].sequ); }
#line 4940 "parse.cc"
    break;

  case 326:
#line 2290 "parse.y"
    { (yyval.sequ) = (yyvsp[0].sequ); }
#line 4946 "parse.cc"
    break;

  case 327:
#line 2291 "parse.y"
    { (yyval.sequ) = (yyvsp[0].sequ); }
#line 4952 "parse.cc"
    break;

  case 328:
#line 2292 "parse.y"
    { (yyval.sequ) = (yyvsp[0].sequ); }
#line 4958 "parse.cc"
    break;

  case 329:
#line 2293 "parse.y"
    { (yyval.sequ) = (yyvsp[0].sequ); }
#line 4964 "parse.cc"
    break;

  case 330:
#line 2294 "parse.y"
    { (yyval.sequ) = (yyvsp[0].sequ); }
#line 4970 "parse.cc"
    break;

  case 331:
#line 2295 "parse.y"
    { (yyval.sequ) = 0; }
#line 4976 "parse.cc"
    break;

  case 332:
#line 2297 "parse.y"
    { errormsg((yylsp[-1]), "Syntax error in sequential statement.\n");
	(yyval.sequ) = 0;
	yyerrok;
      }
#line 4985 "parse.cc"
    break;

  case 333:
#line 2305 "parse.y"
    { if(!strcasecmp((yyvsp[0].text), "NOTE"))
        (yyval.severity) = ReportStmt::NOTE;
    else if(!strcasecmp((yyvsp[0].text), "WARNING"))
        (yyval.severity) = ReportStmt::WARNING;
    else if(!strcasecmp((yyvsp[0].text), "ERROR"))
        (yyval.severity) = ReportStmt::ERROR;
    else if(!strcasecmp((yyvsp[0].text), "FAILURE"))
        (yyval.severity) = ReportStmt::FAILURE;
    else {
        errormsg((yylsp[-1]), "Invalid severity level (possible values: NOTE, WARNING, ERROR, FAILURE).\n");
        (yyval.severity) = ReportStmt::UNSPECIFIED;
    }
    delete[] (yyvsp[0].text);
  }
#line 5004 "parse.cc"
    break;

  case 334:
#line 2321 "parse.y"
    { (yyval.severity) = (yyvsp[0].severity); }
#line 5010 "parse.cc"
    break;

  case 335:
#line 2322 "parse.y"
    { (yyval.severity) = ReportStmt::UNSPECIFIED; }
#line 5016 "parse.cc"
    break;

  case 337:
#line 2327 "parse.y"
    { ExpShift*tmp = new ExpShift(ExpShift::SRL, (yyvsp[-2].expr), (yyvsp[0].expr));
        FILE_NAME(tmp, (yylsp[-1]));
        (yyval.expr) = tmp;
      }
#line 5025 "parse.cc"
    break;

  case 338:
#line 2332 "parse.y"
    { ExpShift*tmp = new ExpShift(ExpShift::SLL, (yyvsp[-2].expr), (yyvsp[0].expr));
        FILE_NAME(tmp, (yylsp[-1]));
        (yyval.expr) = tmp;
      }
#line 5034 "parse.cc"
    break;

  case 339:
#line 2337 "parse.y"
    { ExpShift*tmp = new ExpShift(ExpShift::SRA, (yyvsp[-2].expr), (yyvsp[0].expr));
        FILE_NAME(tmp, (yylsp[-1]));
        (yyval.expr) = tmp;
      }
#line 5043 "parse.cc"
    break;

  case 340:
#line 2342 "parse.y"
    { ExpShift*tmp = new ExpShift(ExpShift::SLA, (yyvsp[-2].expr), (yyvsp[0].expr));
        FILE_NAME(tmp, (yylsp[-1]));
        (yyval.expr) = tmp;
      }
#line 5052 "parse.cc"
    break;

  case 341:
#line 2347 "parse.y"
    { sorrymsg((yylsp[-1]), "ROR is not supported.\n");
        ExpShift*tmp = new ExpShift(ExpShift::ROR, (yyvsp[-2].expr), (yyvsp[0].expr));
        FILE_NAME(tmp, (yylsp[-1]));
        (yyval.expr) = tmp;
      }
#line 5062 "parse.cc"
    break;

  case 342:
#line 2353 "parse.y"
    { sorrymsg((yylsp[-1]), "ROL is not supported.\n");
        ExpShift*tmp = new ExpShift(ExpShift::ROL, (yyvsp[-2].expr), (yyvsp[0].expr));
        FILE_NAME(tmp, (yylsp[-1]));
        (yyval.expr) = tmp;
      }
#line 5072 "parse.cc"
    break;

  case 345:
#line 2366 "parse.y"
    { (yyval.expr) = (yyvsp[0].expr); }
#line 5078 "parse.cc"
    break;

  case 346:
#line 2367 "parse.y"
    { (yyval.expr) = 0;  }
#line 5084 "parse.cc"
    break;

  case 347:
#line 2391 "parse.y"
    { sorrymsg((yylsp[-1]), "Unary expression +- not supported.\n");
	(yyval.expr) = (yyvsp[0].expr);
      }
#line 5092 "parse.cc"
    break;

  case 348:
#line 2395 "parse.y"
    { (yyval.expr) = (yyvsp[0].expr); }
#line 5098 "parse.cc"
    break;

  case 349:
#line 2400 "parse.y"
    { (yyval.expr) = (yyvsp[0].expr); }
#line 5104 "parse.cc"
    break;

  case 350:
#line 2402 "parse.y"
    { Expression*tmp = (yyvsp[-1].expr);
	list<struct adding_term>*lst = (yyvsp[0].adding_terms);
	while (! lst->empty()) {
	      struct adding_term item = lst->front();
	      lst->pop_front();
	      if (item.op == ExpArithmetic::xCONCAT)
		    tmp = new ExpConcat(tmp, item.term);
	      else
		    tmp = new ExpArithmetic(item.op, tmp, item.term);
	}
	delete lst;
	(yyval.expr) = tmp;
      }
#line 5122 "parse.cc"
    break;

  case 351:
#line 2419 "parse.y"
    { struct adding_term item;
	item.op = (yyvsp[-1].arithmetic_op);
	item.term = (yyvsp[0].expr);
	list<adding_term>*tmp = new list<adding_term>;
	tmp->push_back(item);
	(yyval.adding_terms) = tmp;
      }
#line 5134 "parse.cc"
    break;

  case 352:
#line 2427 "parse.y"
    { list<adding_term>*tmp = (yyvsp[-2].adding_terms);
	struct adding_term item;
	item.op = (yyvsp[-1].arithmetic_op);
	item.term = (yyvsp[0].expr);
	tmp->push_back(item);
	(yyval.adding_terms) = tmp;
      }
#line 5146 "parse.cc"
    break;

  case 353:
#line 2438 "parse.y"
    { SignalSeqAssignment*tmp = new SignalSeqAssignment((yyvsp[-3].expr), (yyvsp[-1].expr_list));
	FILE_NAME(tmp, (yylsp[-3]));
	delete (yyvsp[-1].expr_list);
	(yyval.sequ) = tmp;
      }
#line 5156 "parse.cc"
    break;

  case 354:
#line 2444 "parse.y"
    { SignalSeqAssignment*tmp = new SignalSeqAssignment((yyvsp[-7].expr), (yyvsp[-5].expr_list));
	FILE_NAME(tmp, (yylsp[-7]));
	sorrymsg((yylsp[-4]), "Conditional signal assignment not supported.\n");
	(yyval.sequ) = tmp;
      }
#line 5166 "parse.cc"
    break;

  case 356:
#line 2454 "parse.y"
    { delete[] (yyvsp[-2].text);
	(yyval.sequ) = (yyvsp[0].sequ);
      }
#line 5174 "parse.cc"
    break;

  case 357:
#line 2460 "parse.y"
    { assert(!active_sub);
        active_sub = (yyvsp[-1].subprogram);
        (yyval.subprogram) = (yyvsp[-1].subprogram); }
#line 5182 "parse.cc"
    break;

  case 358:
#line 2472 "parse.y"
    { SubprogramHeader*prog = (yyvsp[-7].subprogram);
	SubprogramHeader*tmp = active_scope->recall_subprogram(prog->name());
	if (tmp && prog->compare_specification(tmp)) {
	      delete prog;
	      prog = tmp;
	} else if (tmp) {
	      errormsg((yylsp[-7]), "Subprogram specification for %s doesn't match specification in package header.\n", prog->name().str());
	}

	SubprogramBody*body = new SubprogramBody();
	body->transfer_from(*active_scope, ScopeBase::VARIABLES);
	body->set_statements((yyvsp[-4].sequ_list));

	prog->set_body(body);
	active_scope->bind_name(prog->name(), prog);
	active_sub = NULL;
      }
#line 5204 "parse.cc"
    break;

  case 359:
#line 2494 "parse.y"
    { errormsg((yylsp[-6]), "Syntax errors in subprogram body.\n");
	yyerrok;
	active_sub = NULL;
	if ((yyvsp[-7].subprogram)) delete (yyvsp[-7].subprogram);
	if ((yyvsp[-1].text)) delete[](yyvsp[-1].text);
      }
#line 5215 "parse.cc"
    break;

  case 360:
#line 2504 "parse.y"
    { if ((yyvsp[-1].subprogram)) active_scope->bind_name((yyvsp[-1].subprogram)->name(), (yyvsp[-1].subprogram)); }
#line 5221 "parse.cc"
    break;

  case 370:
#line 2529 "parse.y"
    { (yyval.subprogram) = (yyvsp[0].subprogram); }
#line 5227 "parse.cc"
    break;

  case 371:
#line 2530 "parse.y"
    { (yyval.subprogram) = (yyvsp[0].subprogram); }
#line 5233 "parse.cc"
    break;

  case 372:
#line 2538 "parse.y"
    { (yyval.sequ_list) = (yyvsp[0].sequ_list); }
#line 5239 "parse.cc"
    break;

  case 373:
#line 2543 "parse.y"
    { perm_string name = lex_strings.make((yyvsp[-3].text));
	delete[] (yyvsp[-3].text);
	if ((yyvsp[-1].vtype) == 0) {
	      errormsg((yylsp[-4]), "Failed to declare type name %s.\n", name.str());
	} else {
	      active_scope->bind_name(name, (yyvsp[-1].vtype));
	}
      }
#line 5252 "parse.cc"
    break;

  case 374:
#line 2555 "parse.y"
    { const VType*tmp = parse_type_by_name(lex_strings.make((yyvsp[0].text)));
	if (tmp == 0) {
	      errormsg((yylsp[0]), "Can't find type name `%s'\n", (yyvsp[0].text));
	      tmp = new VTypeERROR;
	}
	delete[](yyvsp[0].text);
	(yyval.vtype) = tmp;
      }
#line 5265 "parse.cc"
    break;

  case 375:
#line 2564 "parse.y"
    { const VType*tmp = calculate_subtype_array((yylsp[-1]), (yyvsp[-1].text), active_scope, (yyvsp[0].range_list));
	if (tmp == 0) {
	      errormsg((yylsp[-1]), "Unable to calculate bounds for array of %s.\n", (yyvsp[-1].text));
	}
	delete[](yyvsp[-1].text);
	delete  (yyvsp[0].range_list);
	(yyval.vtype) = tmp;
      }
#line 5278 "parse.cc"
    break;

  case 376:
#line 2573 "parse.y"
    { const VType*tmp = calculate_subtype_range((yylsp[-4]), (yyvsp[-4].text), active_scope, (yyvsp[-2].expr), (yyvsp[-1].flag), (yyvsp[0].expr));
	if (tmp == 0) {
	      errormsg((yylsp[-4]), "Unable to calculate bounds for range of %s.\n", (yyvsp[-4].text));
	}
	delete[](yyvsp[-4].text);
	(yyval.vtype) = tmp;
      }
#line 5290 "parse.cc"
    break;

  case 377:
#line 2584 "parse.y"
    { (yyval.text) = (yyvsp[0].text); }
#line 5296 "parse.cc"
    break;

  case 378:
#line 2586 "parse.y"
    { (yyval.text) = (yyvsp[0].text); }
#line 5302 "parse.cc"
    break;

  case 379:
#line 2588 "parse.y"
    { //do not have now better idea than using char constant
	(yyval.text) = strdup("all");
      }
#line 5310 "parse.cc"
    break;

  case 380:
#line 2595 "parse.y"
    { (yyval.expr) = (yyvsp[0].expr); }
#line 5316 "parse.cc"
    break;

  case 381:
#line 2597 "parse.y"
    { ExpArithmetic*tmp = new ExpArithmetic(ExpArithmetic::MULT, (yyvsp[-2].expr), (yyvsp[0].expr));
	FILE_NAME(tmp, (yylsp[-1]));
	(yyval.expr) = tmp;
      }
#line 5325 "parse.cc"
    break;

  case 382:
#line 2602 "parse.y"
    { ExpArithmetic*tmp = new ExpArithmetic(ExpArithmetic::DIV, (yyvsp[-2].expr), (yyvsp[0].expr));
	FILE_NAME(tmp, (yylsp[-1]));
	(yyval.expr) = tmp;
      }
#line 5334 "parse.cc"
    break;

  case 383:
#line 2607 "parse.y"
    { ExpArithmetic*tmp = new ExpArithmetic(ExpArithmetic::MOD, (yyvsp[-2].expr), (yyvsp[0].expr));
	FILE_NAME(tmp, (yylsp[-1]));
	(yyval.expr) = tmp;
      }
#line 5343 "parse.cc"
    break;

  case 384:
#line 2612 "parse.y"
    { ExpArithmetic*tmp = new ExpArithmetic(ExpArithmetic::REM, (yyvsp[-2].expr), (yyvsp[0].expr));
	FILE_NAME(tmp, (yylsp[-1]));
	(yyval.expr) = tmp;
      }
#line 5352 "parse.cc"
    break;

  case 385:
#line 2620 "parse.y"
    { perm_string name = lex_strings.make((yyvsp[-3].text));
	if ((yyvsp[-1].vtype) == 0) {
	      errormsg((yylsp[-4]), "Failed to declare type name %s.\n", name.str());
	} else {
	      VTypeDef*tmp;
	      map<perm_string,VTypeDef*>::iterator cur = active_scope->incomplete_types.find(name);
	      if (cur == active_scope->incomplete_types.end()) {
		    tmp = new VTypeDef(name, (yyvsp[-1].vtype));
		    active_scope->bind_name(name, tmp);
	      } else {
		    tmp = cur->second;
		    tmp->set_definition((yyvsp[-1].vtype));
		    active_scope->incomplete_types.erase(cur);
	      }
	      if(const VTypeEnum*enum_type = dynamic_cast<const VTypeEnum*>((yyvsp[-1].vtype))) {
		    active_scope->use_enum(enum_type);
	      }
	}
	delete[](yyvsp[-3].text);
      }
#line 5377 "parse.cc"
    break;

  case 386:
#line 2641 "parse.y"
    { perm_string name = lex_strings.make((yyvsp[-1].text));
	VTypeDef*tmp = new VTypeDef(name);
	active_scope->incomplete_types[name] = tmp;
	active_scope->bind_name(name, tmp);
	delete[](yyvsp[-1].text);
      }
#line 5388 "parse.cc"
    break;

  case 387:
#line 2648 "parse.y"
    { errormsg((yylsp[-1]), "Error in type definition for %s\n", (yyvsp[-3].text));
	yyerrok;
	delete[](yyvsp[-3].text);
      }
#line 5397 "parse.cc"
    break;

  case 388:
#line 2653 "parse.y"
    { errormsg((yylsp[-2]), "Error in type definition\n");
	yyerrok;
      }
#line 5405 "parse.cc"
    break;

  case 389:
#line 2660 "parse.y"
    { VTypeEnum*tmp = new VTypeEnum((yyvsp[-1].name_list));
	delete (yyvsp[-1].name_list);
	(yyval.vtype) = tmp;
      }
#line 5414 "parse.cc"
    break;

  case 390:
#line 2665 "parse.y"
    { (yyval.vtype) = (yyvsp[0].vtype); }
#line 5420 "parse.cc"
    break;

  case 391:
#line 2671 "parse.y"
    { (yyval.expr_list) = (yyvsp[-1].expr_list); }
#line 5426 "parse.cc"
    break;

  case 392:
#line 2673 "parse.y"
    { errormsg((yylsp[-2]), "Syntax error in use clause.\n"); yyerrok; }
#line 5432 "parse.cc"
    break;

  case 394:
#line 2679 "parse.y"
    { errormsg((yylsp[-2]), "Syntax error in use clause.\n"); yyerrok; }
#line 5438 "parse.cc"
    break;

  case 400:
#line 2695 "parse.y"
    { delete[] (yyvsp[-2].text);
	(yyval.sequ) = (yyvsp[0].sequ);
      }
#line 5446 "parse.cc"
    break;

  case 401:
#line 2701 "parse.y"
    { VariableSeqAssignment*tmp = new VariableSeqAssignment((yyvsp[-3].expr), (yyvsp[-1].expr));
	FILE_NAME(tmp, (yylsp[-3]));
	(yyval.sequ) = tmp;
      }
#line 5455 "parse.cc"
    break;

  case 402:
#line 2706 "parse.y"
    { errormsg((yylsp[-1]), "Syntax error in r-value expression of assignment.\n");
	yyerrok;
	delete (yyvsp[-3].expr);
	(yyval.sequ) = 0;
      }
#line 5465 "parse.cc"
    break;

  case 403:
#line 2712 "parse.y"
    { errormsg((yylsp[-3]), "Syntax error in l-value expression of assignment.\n");
	yyerrok;
	delete (yyvsp[-1].expr);
	(yyval.sequ) = 0;
      }
#line 5475 "parse.cc"
    break;

  case 404:
#line 2722 "parse.y"
    { /* Save the signal declaration in the block_signals map. */
	for (std::list<perm_string>::iterator cur = (yyvsp[-4].name_list)->begin()
		   ; cur != (yyvsp[-4].name_list)->end() ; ++cur) {
	      Variable*sig = new Variable(*cur, (yyvsp[-2].vtype), (yyvsp[-1].expr));
	      FILE_NAME(sig, (yylsp[-5]));
	      active_scope->bind_name(*cur, sig);
	}
	delete (yyvsp[-4].name_list);
      }
#line 5489 "parse.cc"
    break;

  case 405:
#line 2732 "parse.y"
    { errormsg((yylsp[-2]), "Syntax error in variable declaration.\n");
	yyerrok;
      }
#line 5497 "parse.cc"
    break;

  case 406:
#line 2738 "parse.y"
    { (yyval.expr) = (yyvsp[0].expr); }
#line 5503 "parse.cc"
    break;

  case 407:
#line 2739 "parse.y"
    { (yyval.expr) = 0;  }
#line 5509 "parse.cc"
    break;

  case 408:
#line 2744 "parse.y"
    { WaitForStmt*tmp = new WaitForStmt((yyvsp[-1].expr));
	FILE_NAME(tmp, (yylsp[-3]));
	(yyval.sequ) = tmp;
      }
#line 5518 "parse.cc"
    break;

  case 409:
#line 2749 "parse.y"
    { WaitStmt*tmp = new WaitStmt(WaitStmt::ON, (yyvsp[-1].expr));
        FILE_NAME(tmp, (yylsp[-3]));
        (yyval.sequ) = tmp;
      }
#line 5527 "parse.cc"
    break;

  case 410:
#line 2754 "parse.y"
    { WaitStmt*tmp = new WaitStmt(WaitStmt::UNTIL, (yyvsp[-1].expr));
        FILE_NAME(tmp, (yylsp[-3]));
        (yyval.sequ) = tmp;
      }
#line 5536 "parse.cc"
    break;

  case 411:
#line 2762 "parse.y"
    { (yyval.expr_list) = (yyvsp[0].expr_list); }
#line 5542 "parse.cc"
    break;

  case 412:
#line 2764 "parse.y"
    { (yyval.expr_list) = 0; }
#line 5548 "parse.cc"
    break;

  case 413:
#line 2769 "parse.y"
    { std::list<Expression*>*tmp = (yyvsp[-2].expr_list);
	tmp->push_back((yyvsp[0].expr));
	(yyval.expr_list) = tmp;
      }
#line 5557 "parse.cc"
    break;

  case 414:
#line 2774 "parse.y"
    { std::list<Expression*>*tmp = new std::list<Expression*>;
	tmp->push_back((yyvsp[0].expr));
	(yyval.expr_list) = tmp;
      }
#line 5566 "parse.cc"
    break;

  case 415:
#line 2782 "parse.y"
    { (yyval.expr) = (yyvsp[0].expr); }
#line 5572 "parse.cc"
    break;

  case 416:
#line 2784 "parse.y"
    { (yyval.expr) = 0; }
#line 5578 "parse.cc"
    break;


#line 5582 "parse.cc"

      default: break;
    }
  /* User semantic actions sometimes alter yychar, and that requires
     that yytoken be updated with the new translation.  We take the
     approach of translating immediately before every use of yytoken.
     One alternative is translating here after every semantic action,
     but that translation would be missed if the semantic action invokes
     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
     incorrect destructor might then be invoked immediately.  In the
     case of YYERROR or YYBACKUP, subsequent parser actions might lead
     to an incorrect destructor call or verbose syntax error message
     before the lookahead is translated.  */
  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);

  YYPOPSTACK (yylen);
  yylen = 0;
  YY_STACK_PRINT (yyss, yyssp);

  *++yyvsp = yyval;
  *++yylsp = yyloc;

  /* Now 'shift' the result of the reduction.  Determine what state
     that goes to, based on the state we popped back to and the rule
     number reduced by.  */
  {
    const int yylhs = yyr1[yyn] - YYNTOKENS;
    const int yyi = yypgoto[yylhs] + *yyssp;
    yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
               ? yytable[yyi]
               : yydefgoto[yylhs]);
  }

  goto yynewstate;


/*--------------------------------------.
| yyerrlab -- here on detecting error.  |
`--------------------------------------*/
yyerrlab:
  /* Make sure we have latest lookahead translation.  See comments at
     user semantic actions for why this is necessary.  */
  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);

  /* If not already recovering from an error, report this error.  */
  if (!yyerrstatus)
    {
      ++yynerrs;
#if ! YYERROR_VERBOSE
      yyerror (&yylloc, yyscanner, file_path, parse_library_name, YY_("syntax error"));
#else
# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
                                        yyssp, yytoken)
      {
        char const *yymsgp = YY_("syntax error");
        int yysyntax_error_status;
        yysyntax_error_status = YYSYNTAX_ERROR;
        if (yysyntax_error_status == 0)
          yymsgp = yymsg;
        else if (yysyntax_error_status == 1)
          {
            if (yymsg != yymsgbuf)
              YYSTACK_FREE (yymsg);
            yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
            if (!yymsg)
              {
                yymsg = yymsgbuf;
                yymsg_alloc = sizeof yymsgbuf;
                yysyntax_error_status = 2;
              }
            else
              {
                yysyntax_error_status = YYSYNTAX_ERROR;
                yymsgp = yymsg;
              }
          }
        yyerror (&yylloc, yyscanner, file_path, parse_library_name, yymsgp);
        if (yysyntax_error_status == 2)
          goto yyexhaustedlab;
      }
# undef YYSYNTAX_ERROR
#endif
    }

  yyerror_range[1] = yylloc;

  if (yyerrstatus == 3)
    {
      /* If just tried and failed to reuse lookahead token after an
         error, discard it.  */

      if (yychar <= YYEOF)
        {
          /* Return failure if at end of input.  */
          if (yychar == YYEOF)
            YYABORT;
        }
      else
        {
          yydestruct ("Error: discarding",
                      yytoken, &yylval, &yylloc, yyscanner, file_path, parse_library_name);
          yychar = YYEMPTY;
        }
    }

  /* Else will try to reuse lookahead token after shifting the error
     token.  */
  goto yyerrlab1;


/*---------------------------------------------------.
| yyerrorlab -- error raised explicitly by YYERROR.  |
`---------------------------------------------------*/
yyerrorlab:
  /* Pacify compilers when the user code never invokes YYERROR and the
     label yyerrorlab therefore never appears in user code.  */
  if (0)
    YYERROR;

  /* Do not reclaim the symbols of the rule whose action triggered
     this YYERROR.  */
  YYPOPSTACK (yylen);
  yylen = 0;
  YY_STACK_PRINT (yyss, yyssp);
  yystate = *yyssp;
  goto yyerrlab1;


/*-------------------------------------------------------------.
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
`-------------------------------------------------------------*/
yyerrlab1:
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */

  for (;;)
    {
      yyn = yypact[yystate];
      if (!yypact_value_is_default (yyn))
        {
          yyn += YYTERROR;
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
            {
              yyn = yytable[yyn];
              if (0 < yyn)
                break;
            }
        }

      /* Pop the current state because it cannot handle the error token.  */
      if (yyssp == yyss)
        YYABORT;

      yyerror_range[1] = *yylsp;
      yydestruct ("Error: popping",
                  yystos[yystate], yyvsp, yylsp, yyscanner, file_path, parse_library_name);
      YYPOPSTACK (1);
      yystate = *yyssp;
      YY_STACK_PRINT (yyss, yyssp);
    }

  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  *++yyvsp = yylval;
  YY_IGNORE_MAYBE_UNINITIALIZED_END

  yyerror_range[2] = yylloc;
  /* Using YYLLOC is tempting, but would change the location of
     the lookahead.  YYLOC is available though.  */
  YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
  *++yylsp = yyloc;

  /* Shift the error token.  */
  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);

  yystate = yyn;
  goto yynewstate;


/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here.  |
`-------------------------------------*/
yyacceptlab:
  yyresult = 0;
  goto yyreturn;


/*-----------------------------------.
| yyabortlab -- YYABORT comes here.  |
`-----------------------------------*/
yyabortlab:
  yyresult = 1;
  goto yyreturn;


#if !defined yyoverflow || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here.  |
`-------------------------------------------------*/
yyexhaustedlab:
  yyerror (&yylloc, yyscanner, file_path, parse_library_name, YY_("memory exhausted"));
  yyresult = 2;
  /* Fall through.  */
#endif


/*-----------------------------------------------------.
| yyreturn -- parsing is finished, return the result.  |
`-----------------------------------------------------*/
yyreturn:
  if (yychar != YYEMPTY)
    {
      /* Make sure we have latest lookahead translation.  See comments at
         user semantic actions for why this is necessary.  */
      yytoken = YYTRANSLATE (yychar);
      yydestruct ("Cleanup: discarding lookahead",
                  yytoken, &yylval, &yylloc, yyscanner, file_path, parse_library_name);
    }
  /* Do not reclaim the symbols of the rule whose action triggered
     this YYABORT or YYACCEPT.  */
  YYPOPSTACK (yylen);
  YY_STACK_PRINT (yyss, yyssp);
  while (yyssp != yyss)
    {
      yydestruct ("Cleanup: popping",
                  yystos[*yyssp], yyvsp, yylsp, yyscanner, file_path, parse_library_name);
      YYPOPSTACK (1);
    }
#ifndef yyoverflow
  if (yyss != yyssa)
    YYSTACK_FREE (yyss);
#endif
#if YYERROR_VERBOSE
  if (yymsg != yymsgbuf)
    YYSTACK_FREE (yymsg);
#endif
  return yyresult;
}
#line 2796 "parse.y"


static void yyerror(YYLTYPE*loc, yyscan_t, const char*, bool, const char*msg)
{
      fprintf(stderr, "%s:%u: %s\n", loc->text, loc->first_line, msg);
      parse_errors += 1;
}

void errormsg(const YYLTYPE&loc, const char*fmt, ...)
{
      va_list ap;
      va_start(ap, fmt);

      fprintf(stderr, "%s:%u: error: ", loc.text, loc.first_line);
      vfprintf(stderr, fmt, ap);
      va_end(ap);
      parse_errors += 1;
}

void sorrymsg(const YYLTYPE&loc, const char*fmt, ...)
{
      va_list ap;
      va_start(ap, fmt);

      fprintf(stderr, "%s:%u: sorry: ", loc.text, loc.first_line);
      vfprintf(stderr, fmt, ap);
      va_end(ap);
      parse_sorrys += 1;
}


/*
 * The reset_lexor function takes the fd and makes it the input file
 * for the lexor. The path argument is used in lexor/parser error messages.
 */
extern yyscan_t prepare_lexor(FILE*fd);
extern void destroy_lexor(yyscan_t scanner);

int parse_source_file(const char*file_path, perm_string parse_library_name)
{
      FILE*fd = fopen(file_path, "r");
      if (fd == 0) {
	    perror(file_path);
	    return -1;
      }

      yyscan_t scanner = prepare_lexor(fd);
      int rc = yyparse(scanner, file_path, parse_library_name);
      fclose(fd);
      destroy_lexor(scanner);

      return rc;
}
