Subversion Repositories Vertical

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /* A Bison parser, made by GNU Bison 3.0.4.  */
  2.  
  3. /* Bison implementation for Yacc-like parsers in C
  4.  
  5.    Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
  6.  
  7.    This program is free software: you can redistribute it and/or modify
  8.    it under the terms of the GNU General Public License as published by
  9.    the Free Software Foundation, either version 3 of the License, or
  10.    (at your option) any later version.
  11.  
  12.    This program is distributed in the hope that it will be useful,
  13.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.    GNU General Public License for more details.
  16.  
  17.    You should have received a copy of the GNU General Public License
  18.    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
  19.  
  20. /* As a special exception, you may create a larger work that contains
  21.    part or all of the Bison parser skeleton and distribute that work
  22.    under terms of your choice, so long as that work isn't itself a
  23.    parser generator using the skeleton or a modified version thereof
  24.    as a parser skeleton.  Alternatively, if you modify or redistribute
  25.    the parser skeleton itself, you may (at your option) remove this
  26.    special exception, which will cause the skeleton and the resulting
  27.    Bison output files to be licensed under the GNU General Public
  28.    License without this special exception.
  29.  
  30.    This special exception was added by the Free Software Foundation in
  31.    version 2.2 of Bison.  */
  32.  
  33. /* C LALR(1) parser skeleton written by Richard Stallman, by
  34.    simplifying the original so-called "semantic" parser.  */
  35.  
  36. /* All symbols defined below should begin with yy or YY, to avoid
  37.    infringing on user name space.  This should be done even for local
  38.    variables, as they might otherwise be expanded by user macros.
  39.    There are some unavoidable exceptions within include files to
  40.    define necessary library symbols; they are noted "INFRINGES ON
  41.    USER NAME SPACE" below.  */
  42.  
  43. /* Identify Bison output.  */
  44. #define YYBISON 1
  45.  
  46. /* Bison version.  */
  47. #define YYBISON_VERSION "3.0.4"
  48.  
  49. /* Skeleton name.  */
  50. #define YYSKELETON_NAME "yacc.c"
  51.  
  52. /* Pure parsers.  */
  53. #define YYPURE 0
  54.  
  55. /* Push parsers.  */
  56. #define YYPUSH 0
  57.  
  58. /* Pull parsers.  */
  59. #define YYPULL 1
  60.  
  61. /* Copy the first part of user declarations.  */
  62. #line 1 "cdi_yacc.y" /* yacc.c:339  */
  63.  
  64. /*
  65.  * $Id: cdi_yacc.y,v 1.1.1.1 2003/11/04 23:34:57 mjames Exp $
  66.  *
  67.  * $Log: cdi_yacc.y,v $
  68.  * Revision 1.1.1.1  2003/11/04 23:34:57  mjames
  69.  * Imported into local repositrory
  70.  *
  71.  * Revision 1.8  2002/10/02 19:37:30  MJAMES
  72.  * Moved dummy functions to a separate support file.
  73.  *
  74.  * Used correct number of arguments to define_pin
  75.  *
  76.  * Revision 1.7  2002/09/09 10:36:19  mjames
  77.  * Checkpoint checkin
  78.  *
  79.  * Revision 1.6  2001/10/31 22:19:58  mjames
  80.  * Tidying up problematical comments caused by CVS
  81.  * 'intelligent' comment guessing
  82.  *
  83.  * Revision 1.5  2001/10/02 20:55:37  mjames
  84.  * Moved documentation about code to main program module.
  85.  *
  86.  * Revision 1.4  2001/09/16 19:59:47  mjames
  87.  * tidying
  88.  *
  89.  * Revision 1.3  2001/06/06 12:10:26  mjames
  90.  * Move from HPUX
  91.  *
  92.  * Revision 1.2  2000/12/04 13:14:02  mjames
  93.  * Imported all of the PCB syntax readers.
  94.  *
  95.  * Converted "a/b" to mean "a" divided by "b" insted of a single string
  96.  * "a/b" in Verilog
  97.  *
  98.  * Revision 1.1.1.1  2000/10/19 21:58:34  mjames
  99.  * Mike put it here
  100.  *
  101.  *
  102.  * Revision 1.32  2000/10/04  10:37:01  10:37:01  mjames (Mike James)
  103.  * Modified to become part of vertical2, complete
  104.  * with VHDL COMPONENT and SIGNAL declarations.
  105.  *
  106.  * Revision 1.29  2000/09/27  10:41:53  10:41:53  mjames (Mike James)
  107.  * Modified to use correct return code from yyparse.
  108.  *
  109.  * Revision 1.28  2000/09/21  10:15:37  10:15:37  mjames (Mike James)
  110.  * Part of Release Sep21Alpha
  111.  *
  112.  * Revision 1.27  2000/08/25  09:57:06  09:57:06  mjames (Mike James)
  113.  * Part of Release Aug25_alpha
  114.  *
  115.  * Revision 1.26  2000/08/16  08:57:23  08:57:23  mjames (Mike James)
  116.  * Part of Release CD01_Aug2000
  117.  *
  118.  * Revision 1.25  2000/08/14  14:45:06  14:45:06  mjames (Mike James)
  119.  * Part of Release Aug_14_2000
  120.  *
  121.  * Revision 1.24  2000/08/11  08:30:26  08:30:26  mjames (Mike James)
  122.  * Part of Release Aug_11_2000
  123.  *
  124.  * Revision 1.23  2000/08/09  10:31:39  10:31:39  mjames (Mike James)
  125.  * Part of Release Aug__9_2000
  126.  *
  127.  * Revision 1.22  2000/05/31  11:42:45  11:42:45  mjames (Mike James)
  128.  * Part of Release May_31_2000
  129.  *
  130.  * Revision 1.21  2000/05/08  17:01:31  17:01:31  mjames (Mike James)
  131.  * Part of Release May__8_2000
  132.  *
  133.  * Revision 1.20  2000/05/08  16:59:24  16:59:24  mjames (Mike James)
  134.  * Part of Release May__8_2000
  135.  *
  136.  * Revision 1.19  2000/05/08  16:57:00  16:57:00  mjames (Mike James)
  137.  * Part of Release May__8_2000
  138.  *
  139.  * Revision 1.18  2000/05/08  16:42:54  16:42:54  mjames (Mike James)
  140.  * Added a null action to a terminal pattern .
  141.  * Makes Bison happy.
  142.  *
  143.  * Revision 1.17  2000/03/08  16:17:30  16:17:30  mjames (Mike James)
  144.  * Removed syntactically confused 'junk'
  145.  *
  146.  * Revision 1.14  2000/01/20  15:58:39  15:58:39  mjames (Mike James)
  147.  * Part of Release R22
  148.  *
  149.  * Revision 1.13  99/12/22  11:15:19  11:15:19  mjames (Mike James)
  150.  * Part of Release Dec_22_1999
  151.  *
  152.  * Revision 1.12  99/06/25  14:34:27  14:34:27  mjames (Mike James)
  153.  * Added in reference to expression.h, but no changes made
  154.  * to the function of acfread yet.
  155.  *
  156.  * Revision 1.11  99/06/18  09:06:38  09:06:38  mjames (Mike James)
  157.  * Checkin before major design changes
  158.  *
  159.  * Revision 1.10  1999/06/14  10:47:18  mjames
  160.  * *** empty log message ***
  161.  *
  162.  * Revision 1.10  1999/06/14  10:47:18  mjames
  163.  * *** empty log message ***
  164.  *
  165.  * Revision 1.9  1999/06/11  14:21:15  mjames
  166.  * *** empty log message ***
  167.  *
  168.  * Revision 1.9  1999/06/11  14:21:15  mjames
  169.  * *** empty log message ***
  170.  *
  171.  * Revision 1.8  99/05/04  09:48:19  09:48:19  mjames (Mike James)
  172.  *
  173.  *
  174.  * Revision 1.5  98/07/14  13:22:06  13:22:06  mjames (Mike James)
  175.  * Altered calling of some database functions
  176.  *
  177.  * Revision 1.4  98/03/16  11:35:31  11:35:31  mjames (Mike James)
  178.  * Made compatible with newer example of .cdi file
  179.  *
  180.  * Revision 1.3  98/02/11  11:24:59  11:24:59  mjames (Mike James)
  181.  * Checked in for version 6.2a
  182.  *
  183.  * Revision 1.2  97/04/23  08:45:08  08:45:08  mjames (Mike James)
  184.  * CHecked in for release rel23041997
  185.  *
  186.  * Revision 1.1  97/01/03  13:43:13  13:43:13  mjames (Mike James)
  187.  * Initial revision
  188.  *
  189.  *
  190.  *  */
  191.  
  192. #include "database.h"
  193. #include "expression.h"
  194. #include "generic.h"
  195.  
  196. #include <stdio.h>
  197. #include <stdlib.h>
  198. #include <string.h>
  199.  
  200. static char IDstr[] = "@(#)$Header: C:/cvsroot/Vert03/cdi_src/cdi_yacc.y,v 1.1.1.1 2003/11/04 "
  201.                       "23:34:57 mjames Exp $";
  202.  
  203. static socket_t *current_chip;
  204. static char curr_net_id[MAXIDLEN];
  205. int inside_block;
  206.  
  207. #line 211 "cdi_yacc.c" /* yacc.c:339  */
  208.  
  209. #ifndef YY_NULLPTR
  210. #if defined __cplusplus && 201103L <= __cplusplus
  211. #define YY_NULLPTR nullptr
  212. #else
  213. #define YY_NULLPTR 0
  214. #endif
  215. #endif
  216.  
  217. /* Enabling verbose error messages.  */
  218. #ifdef YYERROR_VERBOSE
  219. #undef YYERROR_VERBOSE
  220. #define YYERROR_VERBOSE 1
  221. #else
  222. #define YYERROR_VERBOSE 0
  223. #endif
  224.  
  225. /* Debug traces.  */
  226. #ifndef YYDEBUG
  227. #define YYDEBUG 0
  228. #endif
  229. #if YYDEBUG
  230. extern int yydebug;
  231. #endif
  232.  
  233. /* Token type.  */
  234. #ifndef YYTOKENTYPE
  235. #define YYTOKENTYPE
  236. enum yytokentype
  237. {
  238.         ASS = 258,
  239.         IMP = 259,
  240.         COM = 260,
  241.         CSP = 261,
  242.         PCB = 262,
  243.         CON = 263,
  244.         COD = 264,
  245.         REM = 265,
  246.         EOD = 266,
  247.         NL = 267,
  248.         QUOTE = 268,
  249.         ASTRING = 269
  250. };
  251. #endif
  252. /* Tokens.  */
  253. #define ASS 258
  254. #define IMP 259
  255. #define COM 260
  256. #define CSP 261
  257. #define PCB 262
  258. #define CON 263
  259. #define COD 264
  260. #define REM 265
  261. #define EOD 266
  262. #define NL 267
  263. #define QUOTE 268
  264. #define ASTRING 269
  265.  
  266. /* Value type.  */
  267. #if !defined YYSTYPE && !defined YYSTYPE_IS_DECLARED
  268.  
  269. union YYSTYPE
  270. {
  271. #line 145 "cdi_yacc.y" /* yacc.c:355  */
  272.         char *string;
  273.  
  274. #line 279 "cdi_yacc.c" /* yacc.c:355  */
  275. };
  276.  
  277. typedef union YYSTYPE YYSTYPE;
  278. #define YYSTYPE_IS_TRIVIAL 1
  279. #define YYSTYPE_IS_DECLARED 1
  280. #endif
  281.  
  282. extern YYSTYPE yylval;
  283.  
  284. int yyparse (void);
  285.  
  286. /* Copy the second part of user declarations.  */
  287.  
  288. #line 296 "cdi_yacc.c" /* yacc.c:358  */
  289.  
  290. #ifdef short
  291. #undef short
  292. #endif
  293.  
  294. #ifdef YYTYPE_UINT8
  295. typedef YYTYPE_UINT8 yytype_uint8;
  296. #else
  297. typedef unsigned char yytype_uint8;
  298. #endif
  299.  
  300. #ifdef YYTYPE_INT8
  301. typedef YYTYPE_INT8 yytype_int8;
  302. #else
  303. typedef signed char yytype_int8;
  304. #endif
  305.  
  306. #ifdef YYTYPE_UINT16
  307. typedef YYTYPE_UINT16 yytype_uint16;
  308. #else
  309. typedef unsigned short int yytype_uint16;
  310. #endif
  311.  
  312. #ifdef YYTYPE_INT16
  313. typedef YYTYPE_INT16 yytype_int16;
  314. #else
  315. typedef short int yytype_int16;
  316. #endif
  317.  
  318. #ifndef YYSIZE_T
  319. #ifdef __SIZE_TYPE__
  320. #define YYSIZE_T __SIZE_TYPE__
  321. #elif defined size_t
  322. #define YYSIZE_T size_t
  323. #elif !defined YYSIZE_T
  324. #include <stddef.h> /* INFRINGES ON USER NAME SPACE */
  325. #define YYSIZE_T size_t
  326. #else
  327. #define YYSIZE_T unsigned int
  328. #endif
  329. #endif
  330.  
  331. #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
  332.  
  333. #ifndef YY_
  334. #if defined YYENABLE_NLS && YYENABLE_NLS
  335. #if ENABLE_NLS
  336. #include <libintl.h> /* INFRINGES ON USER NAME SPACE */
  337. #define YY_(Msgid) dgettext ("bison-runtime", Msgid)
  338. #endif
  339. #endif
  340. #ifndef YY_
  341. #define YY_(Msgid) Msgid
  342. #endif
  343. #endif
  344.  
  345. #ifndef YY_ATTRIBUTE
  346. #if (defined __GNUC__ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) ||        \
  347.     defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
  348. #define YY_ATTRIBUTE(Spec) __attribute__ (Spec)
  349. #else
  350. #define YY_ATTRIBUTE(Spec) /* empty */
  351. #endif
  352. #endif
  353.  
  354. #ifndef YY_ATTRIBUTE_PURE
  355. #define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
  356. #endif
  357.  
  358. #ifndef YY_ATTRIBUTE_UNUSED
  359. #define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
  360. #endif
  361.  
  362. #if !defined _Noreturn && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
  363. #if defined _MSC_VER && 1200 <= _MSC_VER
  364. #define _Noreturn __declspec(noreturn)
  365. #else
  366. #define _Noreturn YY_ATTRIBUTE((__noreturn__))
  367. #endif
  368. #endif
  369.  
  370. /* Suppress unused-variable warnings by "using" E.  */
  371. #if !defined lint || defined __GNUC__
  372. #define YYUSE(E) ((void) (E))
  373. #else
  374. #define YYUSE(E) /* empty */
  375. #endif
  376.  
  377. #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
  378. /* Suppress an incorrect diagnostic about yylval being uninitialized.  */
  379. #define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                                                   \
  380.         _Pragma ("GCC diagnostic push") _Pragma ("GCC diagnostic ignored "                    \
  381.                                                  "\"-Wuninitialized\"")                       \
  382.             _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
  383. #define YY_IGNORE_MAYBE_UNINITIALIZED_END _Pragma ("GCC diagnostic pop")
  384. #else
  385. #define YY_INITIAL_VALUE(Value) Value
  386. #endif
  387. #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  388. #define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  389. #define YY_IGNORE_MAYBE_UNINITIALIZED_END
  390. #endif
  391. #ifndef YY_INITIAL_VALUE
  392. #define YY_INITIAL_VALUE(Value) /* Nothing. */
  393. #endif
  394.  
  395. #if !defined yyoverflow || YYERROR_VERBOSE
  396.  
  397. /* The parser invokes alloca or malloc; define the necessary symbols.  */
  398.  
  399. #ifdef YYSTACK_USE_ALLOCA
  400. #if YYSTACK_USE_ALLOCA
  401. #ifdef __GNUC__
  402. #define YYSTACK_ALLOC __builtin_alloca
  403. #elif defined __BUILTIN_VA_ARG_INCR
  404. #include <alloca.h> /* INFRINGES ON USER NAME SPACE */
  405. #elif defined _AIX
  406. #define YYSTACK_ALLOC __alloca
  407. #elif defined _MSC_VER
  408. #include <malloc.h> /* INFRINGES ON USER NAME SPACE */
  409. #define alloca _alloca
  410. #else
  411. #define YYSTACK_ALLOC alloca
  412. #if !defined _ALLOCA_H && !defined EXIT_SUCCESS
  413. #include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  414. /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
  415. #ifndef EXIT_SUCCESS
  416. #define EXIT_SUCCESS 0
  417. #endif
  418. #endif
  419. #endif
  420. #endif
  421. #endif
  422.  
  423. #ifdef YYSTACK_ALLOC
  424. /* Pacify GCC's 'empty if-body' warning.  */
  425. #define YYSTACK_FREE(Ptr)                                                                     \
  426.         do                                                                                    \
  427.         { /* empty */                                                                         \
  428.                 ;                                                                             \
  429.         } while (0)
  430. #ifndef YYSTACK_ALLOC_MAXIMUM
  431. /* The OS might guarantee only one guard page at the bottom of the stack,
  432.    and a page size can be as small as 4096 bytes.  So we cannot safely
  433.    invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
  434.    to allow for a few compiler-allocated temporary stack slots.  */
  435. #define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
  436. #endif
  437. #else
  438. #define YYSTACK_ALLOC YYMALLOC
  439. #define YYSTACK_FREE YYFREE
  440. #ifndef YYSTACK_ALLOC_MAXIMUM
  441. #define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
  442. #endif
  443. #if (                                                                                         \
  444.     defined __cplusplus && !defined EXIT_SUCCESS &&                                           \
  445.     !((defined YYMALLOC || defined malloc) && (defined YYFREE || defined free)))
  446. #include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  447. #ifndef EXIT_SUCCESS
  448. #define EXIT_SUCCESS 0
  449. #endif
  450. #endif
  451. #ifndef YYMALLOC
  452. #define YYMALLOC malloc
  453. #if !defined malloc && !defined EXIT_SUCCESS
  454. void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
  455. #endif
  456. #endif
  457. #ifndef YYFREE
  458. #define YYFREE free
  459. #if !defined free && !defined EXIT_SUCCESS
  460. void free (void *);      /* INFRINGES ON USER NAME SPACE */
  461. #endif
  462. #endif
  463. #endif
  464. #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
  465.  
  466. #if (                                                                                         \
  467.     !defined yyoverflow &&                                                                    \
  468.     (!defined __cplusplus || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
  469.  
  470. /* A type that is properly aligned for any stack member.  */
  471. union yyalloc
  472. {
  473.         yytype_int16 yyss_alloc;
  474.         YYSTYPE yyvs_alloc;
  475. };
  476.  
  477. /* The size of the maximum gap between one aligned stack and the next.  */
  478. #define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
  479.  
  480. /* The size of an array large to enough to hold all stacks, each with
  481.    N elements.  */
  482. #define YYSTACK_BYTES(N)                                                                      \
  483.         ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) + YYSTACK_GAP_MAXIMUM)
  484.  
  485. #define YYCOPY_NEEDED 1
  486.  
  487. /* Relocate STACK from its old location to the new one.  The
  488.    local variables YYSIZE and YYSTACKSIZE give the old and new number of
  489.    elements in the stack, and YYPTR gives the new location of the
  490.    stack.  Advance YYPTR to a properly aligned location for the next
  491.    stack.  */
  492. #define YYSTACK_RELOCATE(Stack_alloc, Stack)                                                  \
  493.         do                                                                                    \
  494.         {                                                                                     \
  495.                 YYSIZE_T yynewbytes;                                                          \
  496.                 YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                                  \
  497.                 Stack = &yyptr->Stack_alloc;                                                  \
  498.                 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM;             \
  499.                 yyptr += yynewbytes / sizeof (*yyptr);                                        \
  500.         } while (0)
  501.  
  502. #endif
  503.  
  504. #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
  505. /* Copy COUNT objects from SRC to DST.  The source and destination do
  506.    not overlap.  */
  507. #ifndef YYCOPY
  508. #if defined __GNUC__ && 1 < __GNUC__
  509. #define YYCOPY(Dst, Src, Count) __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
  510. #else
  511. #define YYCOPY(Dst, Src, Count)                                                               \
  512.         do                                                                                    \
  513.         {                                                                                     \
  514.                 YYSIZE_T yyi;                                                                 \
  515.                 for (yyi = 0; yyi < (Count); yyi++)                                           \
  516.                         (Dst)[yyi] = (Src)[yyi];                                              \
  517.         } while (0)
  518. #endif
  519. #endif
  520. #endif /* !YYCOPY_NEEDED */
  521.  
  522. /* YYFINAL -- State number of the termination state.  */
  523. #define YYFINAL 18
  524. /* YYLAST -- Last index in YYTABLE.  */
  525. #define YYLAST 59
  526.  
  527. /* YYNTOKENS -- Number of terminals.  */
  528. #define YYNTOKENS 15
  529. /* YYNNTS -- Number of nonterminals.  */
  530. #define YYNNTS 20
  531. /* YYNRULES -- Number of rules.  */
  532. #define YYNRULES 40
  533. /* YYNSTATES -- Number of states.  */
  534. #define YYNSTATES 57
  535.  
  536. /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
  537.    by yylex, with out-of-bounds checking.  */
  538. #define YYUNDEFTOK 2
  539. #define YYMAXUTOK 269
  540.  
  541. #define YYTRANSLATE(YYX) ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
  542.  
  543. /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
  544.    as returned by yylex, without out-of-bounds checking.  */
  545. static const yytype_uint8 yytranslate[] = {
  546.     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,
  547.     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,
  548.     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,
  549.     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,
  550.     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,
  551.     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,
  552.     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,
  553.     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,
  554.     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,
  555.     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};
  556.  
  557. #if YYDEBUG
  558. /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
  559. static const yytype_uint8 yyrline[] = {0,   153, 153, 154, 158, 159, 160, 161, 166, 168, 168,
  560.                                        168, 168, 170, 171, 172, 175, 178, 178, 180, 181, 184,
  561.                                        189, 190, 195, 196, 197, 198, 199, 201, 203, 205, 207,
  562.                                        208, 211, 214, 215, 219, 227, 228, 229};
  563. #endif
  564.  
  565. #if YYDEBUG || YYERROR_VERBOSE || 0
  566. /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
  567.    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
  568. static const char *const yytname[] = {"$end",
  569.                                       "error",
  570.                                       "$undefined",
  571.                                       "ASS",
  572.                                       "IMP",
  573.                                       "COM",
  574.                                       "CSP",
  575.                                       "PCB",
  576.                                       "CON",
  577.                                       "COD",
  578.                                       "REM",
  579.                                       "EOD",
  580.                                       "NL",
  581.                                       "QUOTE",
  582.                                       "ASTRING",
  583.                                       "$accept",
  584.                                       "objects",
  585.                                       "object",
  586.                                       "junk_line",
  587.                                       "junk_line_start",
  588.                                       "words",
  589.                                       "junk_block",
  590.                                       "junk_block_start",
  591.                                       "lines",
  592.                                       "line",
  593.                                       "netlist",
  594.                                       "netnodes",
  595.                                       "rem_part",
  596.                                       "name_part",
  597.                                       "cod_part",
  598.                                       "nodelines",
  599.                                       "nodeline",
  600.                                       "nodes",
  601.                                       "node",
  602.                                       "gap",
  603.                                       YY_NULLPTR};
  604. #endif
  605.  
  606. #ifdef YYPRINT
  607. /* YYTOKNUM[NUM] -- (External) token number corresponding to the
  608.    (internal) symbol number NUM (which must be that of a token).  */
  609. static const yytype_uint16 yytoknum[] = {
  610.     0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269};
  611. #endif
  612.  
  613. #define YYPACT_NINF -12
  614.  
  615. #define yypact_value_is_default(Yystate) (!!((Yystate) == (-12)))
  616.  
  617. #define YYTABLE_NINF -16
  618.  
  619. #define yytable_value_is_error(Yytable_value) 0
  620.  
  621. /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
  622.    STATE-NUM.  */
  623. static const yytype_int8 yypact[] = {
  624.     10,  -12, -12, -12, -12, -12, -11, -12, -10, 0,   -12, -12, 17, -12, 24,
  625.     -12, 20,  -12, -12, -12, -12, 25,  17,  26,  27,  -12, 28,  29, 14,  -12,
  626.     -12, -12, -12, 30,  -12, -3,  -12, -12, 7,   -12, 23,  33,  32, 34,  -12,
  627.     -12, -12, -12, -12, -12, -12, -12, -12, 36,  37,  -12, -12};
  628.  
  629. /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
  630.    Performed when YYTABLE does not specify something else to do.  Zero
  631.    means the default is an error.  */
  632. static const yytype_uint8 yydefact[] = {
  633.     40, 17, 12, 18, 9, 10, 0,  11, 39, 0,  3,  4,  15, 5,  0,  7,  0, 38, 1,
  634.     2,  14, 8,  15, 0, 0,  28, 0,  0,  0,  23, 24, 25, 26, 27, 33, 0, 36, 13,
  635.     0,  16, 20, 0,  0, 0,  37, 6,  22, 32, 34, 35, 21, 19, 31, 0,  0, 29, 30};
  636.  
  637. /* YYPGOTO[NTERM-NUM].  */
  638. static const yytype_int8 yypgoto[] = {-12, -12, 41,  -12, -12, 39,  -12, -12, -2, -12,
  639.                                       -12, 31,  -12, -12, -12, -12, 19,  -12, 18, 46};
  640.  
  641. /* YYDEFGOTO[NTERM-NUM].  */
  642. static const yytype_int8 yydefgoto[] = {-1, 9,  10, 11, 12, 38, 13, 14, 39, 40,
  643.                                         28, 29, 30, 31, 32, 33, 34, 35, 36, 15};
  644.  
  645. /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
  646.    positive, shift that token.  If negative, reduce the rule whose
  647.    number is the opposite.  If YYTABLE_NINF, syntax error.  */
  648. static const yytype_int8 yytable[] = {
  649.     18, 16, 8,  1,  2,  3,  4,  5,  6,  48, 7,  27, 8,  1,  2,  3,   4,  5,  6,  50,
  650.     7,  37, 8,  23, 24, 45, 25, 26, 27, 23, 24, 20, 25, 26, 27, -15, 22, 20, 51, 37,
  651.     41, 42, 43, 44, 27, 52, 53, 54, 55, 56, 19, 21, 47, 49, 17, 0,   0,  0,  0,  46};
  652.  
  653. static const yytype_int8 yycheck[] = {
  654.     0,  12, 12, 3,  4,  5,  6,  7,  8,  12, 10, 14, 12, 3,  4,  5,  6,  7,  8,  12,
  655.     10, 14, 12, 9,  10, 11, 12, 13, 14, 9,  10, 14, 12, 13, 14, 12, 12, 14, 40, 14,
  656.     14, 14, 14, 14, 14, 12, 14, 13, 12, 12, 9,  12, 33, 35, 8,  -1, -1, -1, -1, 28};
  657.  
  658. /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
  659.    symbol of state STATE-NUM.  */
  660. static const yytype_uint8 yystos[] = {
  661.     0,  3,  4,  5,  6,  7,  8,  10, 12, 16, 17, 18, 19, 21, 22, 34, 12, 34, 0,
  662.     17, 14, 20, 12, 9,  10, 12, 13, 14, 25, 26, 27, 28, 29, 30, 31, 32, 33, 14,
  663.     20, 23, 24, 14, 14, 14, 14, 11, 26, 31, 12, 33, 12, 23, 12, 14, 13, 12, 12};
  664.  
  665. /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
  666. static const yytype_uint8 yyr1[] = {0,  15, 16, 16, 17, 17, 17, 17, 18, 19, 19, 19, 19, 20,
  667.                                     20, 20, 21, 22, 22, 23, 23, 24, 25, 25, 26, 26, 26, 26,
  668.                                     26, 27, 28, 29, 30, 30, 31, 32, 32, 33, 34, 34, 34};
  669.  
  670. /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
  671. static const yytype_uint8 yyr2[] = {0, 2, 2, 1, 1, 1, 4, 1, 2, 1, 1, 1, 1, 2,
  672.                                     1, 0, 3, 1, 1, 2, 1, 2, 2, 1, 1, 1, 1, 1,
  673.                                     1, 4, 4, 3, 2, 1, 2, 2, 1, 2, 2, 1, 0};
  674.  
  675. #define yyerrok (yyerrstatus = 0)
  676. #define yyclearin (yychar = YYEMPTY)
  677. #define YYEMPTY (-2)
  678. #define YYEOF 0
  679.  
  680. #define YYACCEPT goto yyacceptlab
  681. #define YYABORT goto yyabortlab
  682. #define YYERROR goto yyerrorlab
  683.  
  684. #define YYRECOVERING() (!!yyerrstatus)
  685.  
  686. #define YYBACKUP(Token, Value)                                                                \
  687.         do                                                                                    \
  688.                 if (yychar == YYEMPTY)                                                        \
  689.                 {                                                                             \
  690.                         yychar = (Token);                                                     \
  691.                         yylval = (Value);                                                     \
  692.                         YYPOPSTACK (yylen);                                                   \
  693.                         yystate = *yyssp;                                                     \
  694.                         goto yybackup;                                                        \
  695.                 }                                                                             \
  696.                 else                                                                          \
  697.                 {                                                                             \
  698.                         yyerror (YY_ ("syntax error: cannot back up"));                       \
  699.                         YYERROR;                                                              \
  700.                 }                                                                             \
  701.         while (0)
  702.  
  703. /* Error token number */
  704. #define YYTERROR 1
  705. #define YYERRCODE 256
  706.  
  707. /* Enable debugging if requested.  */
  708. #if YYDEBUG
  709.  
  710. #ifndef YYFPRINTF
  711. #include <stdio.h> /* INFRINGES ON USER NAME SPACE */
  712. #define YYFPRINTF fprintf
  713. #endif
  714.  
  715. #define YYDPRINTF(Args)                                                                       \
  716.         do                                                                                    \
  717.         {                                                                                     \
  718.                 if (yydebug)                                                                  \
  719.                         YYFPRINTF Args;                                                       \
  720.         } while (0)
  721.  
  722. /* This macro is provided for backward compatibility. */
  723. #ifndef YY_LOCATION_PRINT
  724. #define YY_LOCATION_PRINT(File, Loc) ((void) 0)
  725. #endif
  726.  
  727. #define YY_SYMBOL_PRINT(Title, Type, Value, Location)                                         \
  728.         do                                                                                    \
  729.         {                                                                                     \
  730.                 if (yydebug)                                                                  \
  731.                 {                                                                             \
  732.                         YYFPRINTF (stderr, "%s ", Title);                                     \
  733.                         yy_symbol_print (stderr, Type, Value);                                \
  734.                         YYFPRINTF (stderr, "\n");                                             \
  735.                 }                                                                             \
  736.         } while (0)
  737.  
  738. /*----------------------------------------.
  739. | Print this symbol's value on YYOUTPUT.  |
  740. `----------------------------------------*/
  741.  
  742. static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep)
  743. {
  744.         FILE *yyo = yyoutput;
  745.         YYUSE (yyo);
  746.         if (!yyvaluep)
  747.                 return;
  748. #ifdef YYPRINT
  749.         if (yytype < YYNTOKENS)
  750.                 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
  751. #endif
  752.         YYUSE (yytype);
  753. }
  754.  
  755. /*--------------------------------.
  756. | Print this symbol on YYOUTPUT.  |
  757. `--------------------------------*/
  758.  
  759. static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep)
  760. {
  761.         YYFPRINTF (
  762.             yyoutput, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
  763.  
  764.         yy_symbol_value_print (yyoutput, yytype, yyvaluep);
  765.         YYFPRINTF (yyoutput, ")");
  766. }
  767.  
  768. /*------------------------------------------------------------------.
  769. | yy_stack_print -- Print the state stack from its BOTTOM up to its |
  770. | TOP (included).                                                   |
  771. `------------------------------------------------------------------*/
  772.  
  773. static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
  774. {
  775.         YYFPRINTF (stderr, "Stack now");
  776.         for (; yybottom <= yytop; yybottom++)
  777.         {
  778.                 int yybot = *yybottom;
  779.                 YYFPRINTF (stderr, " %d", yybot);
  780.         }
  781.         YYFPRINTF (stderr, "\n");
  782. }
  783.  
  784. #define YY_STACK_PRINT(Bottom, Top)                                                           \
  785.         do                                                                                    \
  786.         {                                                                                     \
  787.                 if (yydebug)                                                                  \
  788.                         yy_stack_print ((Bottom), (Top));                                     \
  789.         } while (0)
  790.  
  791. /*------------------------------------------------.
  792. | Report that the YYRULE is going to be reduced.  |
  793. `------------------------------------------------*/
  794.  
  795. static void yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
  796. {
  797.         unsigned long int yylno = yyrline[yyrule];
  798.         int yynrhs = yyr2[yyrule];
  799.         int yyi;
  800.         YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno);
  801.         /* The symbols being reduced.  */
  802.         for (yyi = 0; yyi < yynrhs; yyi++)
  803.         {
  804.                 YYFPRINTF (stderr, "   $%d = ", yyi + 1);
  805.                 yy_symbol_print (
  806.                     stderr, yystos[yyssp[yyi + 1 - yynrhs]], &(yyvsp[(yyi + 1) - (yynrhs)]));
  807.                 YYFPRINTF (stderr, "\n");
  808.         }
  809. }
  810.  
  811. #define YY_REDUCE_PRINT(Rule)                                                                 \
  812.         do                                                                                    \
  813.         {                                                                                     \
  814.                 if (yydebug)                                                                  \
  815.                         yy_reduce_print (yyssp, yyvsp, Rule);                                 \
  816.         } while (0)
  817.  
  818. /* Nonzero means print parse trace.  It is left uninitialized so that
  819.    multiple parsers can coexist.  */
  820. int yydebug;
  821. #else /* !YYDEBUG */
  822. #define YYDPRINTF(Args)
  823. #define YY_SYMBOL_PRINT(Title, Type, Value, Location)
  824. #define YY_STACK_PRINT(Bottom, Top)
  825. #define YY_REDUCE_PRINT(Rule)
  826. #endif /* !YYDEBUG */
  827.  
  828. /* YYINITDEPTH -- initial size of the parser's stacks.  */
  829. #ifndef YYINITDEPTH
  830. #define YYINITDEPTH 200
  831. #endif
  832.  
  833. /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
  834.    if the built-in stack extension method is used).
  835.  
  836.    Do not make this value too large; the results are undefined if
  837.    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
  838.    evaluated with infinite-precision integer arithmetic.  */
  839.  
  840. #ifndef YYMAXDEPTH
  841. #define YYMAXDEPTH 10000
  842. #endif
  843.  
  844. #if YYERROR_VERBOSE
  845.  
  846. #ifndef yystrlen
  847. #if defined __GLIBC__ && defined _STRING_H
  848. #define yystrlen strlen
  849. #else
  850. /* Return the length of YYSTR.  */
  851. static YYSIZE_T yystrlen (const char *yystr)
  852. {
  853.         YYSIZE_T yylen;
  854.         for (yylen = 0; yystr[yylen]; yylen++)
  855.                 continue;
  856.         return yylen;
  857. }
  858. #endif
  859. #endif
  860.  
  861. #ifndef yystpcpy
  862. #if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
  863. #define yystpcpy stpcpy
  864. #else
  865. /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
  866.    YYDEST.  */
  867. static char *yystpcpy (char *yydest, const char *yysrc)
  868. {
  869.         char *yyd = yydest;
  870.         const char *yys = yysrc;
  871.  
  872.         while ((*yyd++ = *yys++) != '\0')
  873.                 continue;
  874.  
  875.         return yyd - 1;
  876. }
  877. #endif
  878. #endif
  879.  
  880. #ifndef yytnamerr
  881. /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
  882.    quotes and backslashes, so that it's suitable for yyerror.  The
  883.    heuristic is that double-quoting is unnecessary unless the string
  884.    contains an apostrophe, a comma, or backslash (other than
  885.    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
  886.    null, do not copy; instead, return the length of what the result
  887.    would have been.  */
  888. static YYSIZE_T yytnamerr (char *yyres, const char *yystr)
  889. {
  890.         if (*yystr == '"')
  891.         {
  892.                 YYSIZE_T yyn = 0;
  893.                 char const *yyp = yystr;
  894.  
  895.                 for (;;)
  896.                         switch (*++yyp)
  897.                         {
  898.                         case '\'':
  899.                         case ',':
  900.                                 goto do_not_strip_quotes;
  901.  
  902.                         case '\\':
  903.                                 if (*++yyp != '\\')
  904.                                         goto do_not_strip_quotes;
  905.                                 /* Fall through.  */
  906.                         default:
  907.                                 if (yyres)
  908.                                         yyres[yyn] = *yyp;
  909.                                 yyn++;
  910.                                 break;
  911.  
  912.                         case '"':
  913.                                 if (yyres)
  914.                                         yyres[yyn] = '\0';
  915.                                 return yyn;
  916.                         }
  917.         do_not_strip_quotes:;
  918.         }
  919.  
  920.         if (!yyres)
  921.                 return yystrlen (yystr);
  922.  
  923.         return yystpcpy (yyres, yystr) - yyres;
  924. }
  925. #endif
  926.  
  927. /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
  928.    about the unexpected token YYTOKEN for the state stack whose top is
  929.    YYSSP.
  930.  
  931.    Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
  932.    not large enough to hold the message.  In that case, also set
  933.    *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
  934.    required number of bytes is too large to store.  */
  935. static int
  936. yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken)
  937. {
  938.         YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
  939.         YYSIZE_T yysize = yysize0;
  940.         enum
  941.         {
  942.                 YYERROR_VERBOSE_ARGS_MAXIMUM = 5
  943.         };
  944.         /* Internationalized format string. */
  945.         const char *yyformat = YY_NULLPTR;
  946.         /* Arguments of yyformat. */
  947.         char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
  948.         /* Number of reported tokens (one for the "unexpected", one per
  949.            "expected"). */
  950.         int yycount = 0;
  951.  
  952.         /* There are many possibilities here to consider:
  953.            - If this state is a consistent state with a default action, then
  954.              the only way this function was invoked is if the default action
  955.              is an error action.  In that case, don't check for expected
  956.              tokens because there are none.
  957.            - The only way there can be no lookahead present (in yychar) is if
  958.              this state is a consistent state with a default action.  Thus,
  959.              detecting the absence of a lookahead is sufficient to determine
  960.              that there is no unexpected or expected token to report.  In that
  961.              case, just report a simple "syntax error".
  962.            - Don't assume there isn't a lookahead just because this state is a
  963.              consistent state with a default action.  There might have been a
  964.              previous inconsistent state, consistent state with a non-default
  965.              action, or user semantic action that manipulated yychar.
  966.            - Of course, the expected token list depends on states to have
  967.              correct lookahead information, and it depends on the parser not
  968.              to perform extra reductions after fetching a lookahead from the
  969.              scanner and before detecting a syntax error.  Thus, state merging
  970.              (from LALR or IELR) and default reductions corrupt the expected
  971.              token list.  However, the list is correct for canonical LR with
  972.              one exception: it will still contain any token that will not be
  973.              accepted due to an error action in a later state.
  974.         */
  975.         if (yytoken != YYEMPTY)
  976.         {
  977.                 int yyn = yypact[*yyssp];
  978.                 yyarg[yycount++] = yytname[yytoken];
  979.                 if (!yypact_value_is_default (yyn))
  980.                 {
  981.                         /* Start YYX at -YYN if negative to avoid negative indexes in
  982.                            YYCHECK.  In other words, skip the first -YYN actions for
  983.                            this state because they are default actions.  */
  984.                         int yyxbegin = yyn < 0 ? -yyn : 0;
  985.                         /* Stay within bounds of both yycheck and yytname.  */
  986.                         int yychecklim = YYLAST - yyn + 1;
  987.                         int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
  988.                         int yyx;
  989.  
  990.                         for (yyx = yyxbegin; yyx < yyxend; ++yyx)
  991.                                 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR &&
  992.                                     !yytable_value_is_error (yytable[yyx + yyn]))
  993.                                 {
  994.                                         if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
  995.                                         {
  996.                                                 yycount = 1;
  997.                                                 yysize = yysize0;
  998.                                                 break;
  999.                                         }
  1000.                                         yyarg[yycount++] = yytname[yyx];
  1001.                                         {
  1002.                                                 YYSIZE_T yysize1 =
  1003.                                                     yysize +
  1004.                                                     yytnamerr (YY_NULLPTR, yytname[yyx]);
  1005.                                                 if (!(yysize <= yysize1 &&
  1006.                                                       yysize1 <= YYSTACK_ALLOC_MAXIMUM))
  1007.                                                         return 2;
  1008.                                                 yysize = yysize1;
  1009.                                         }
  1010.                                 }
  1011.                 }
  1012.         }
  1013.  
  1014.         switch (yycount)
  1015.         {
  1016. #define YYCASE_(N, S)                                                                         \
  1017.         case N:                                                                               \
  1018.                 yyformat = S;                                                                 \
  1019.                 break
  1020.                 YYCASE_ (0, YY_ ("syntax error"));
  1021.                 YYCASE_ (1, YY_ ("syntax error, unexpected %s"));
  1022.                 YYCASE_ (2, YY_ ("syntax error, unexpected %s, expecting %s"));
  1023.                 YYCASE_ (3, YY_ ("syntax error, unexpected %s, expecting %s or %s"));
  1024.                 YYCASE_ (4, YY_ ("syntax error, unexpected %s, expecting %s or %s or %s"));
  1025.                 YYCASE_ (
  1026.                     5, YY_ ("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
  1027. #undef YYCASE_
  1028.         }
  1029.  
  1030.         {
  1031.                 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
  1032.                 if (!(yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
  1033.                         return 2;
  1034.                 yysize = yysize1;
  1035.         }
  1036.  
  1037.         if (*yymsg_alloc < yysize)
  1038.         {
  1039.                 *yymsg_alloc = 2 * yysize;
  1040.                 if (!(yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
  1041.                         *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
  1042.                 return 1;
  1043.         }
  1044.  
  1045.         /* Avoid sprintf, as that infringes on the user's name space.
  1046.            Don't have undefined behavior even if the translation
  1047.            produced a string with the wrong number of "%s"s.  */
  1048.         {
  1049.                 char *yyp = *yymsg;
  1050.                 int yyi = 0;
  1051.                 while ((*yyp = *yyformat) != '\0')
  1052.                         if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
  1053.                         {
  1054.                                 yyp += yytnamerr (yyp, yyarg[yyi++]);
  1055.                                 yyformat += 2;
  1056.                         }
  1057.                         else
  1058.                         {
  1059.                                 yyp++;
  1060.                                 yyformat++;
  1061.                         }
  1062.         }
  1063.         return 0;
  1064. }
  1065. #endif /* YYERROR_VERBOSE */
  1066.  
  1067. /*-----------------------------------------------.
  1068. | Release the memory associated to this symbol.  |
  1069. `-----------------------------------------------*/
  1070.  
  1071. static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
  1072. {
  1073.         YYUSE (yyvaluep);
  1074.         if (!yymsg)
  1075.                 yymsg = "Deleting";
  1076.         YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
  1077.  
  1078.         YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  1079.         YYUSE (yytype);
  1080.         YY_IGNORE_MAYBE_UNINITIALIZED_END
  1081. }
  1082.  
  1083. /* The lookahead symbol.  */
  1084. int yychar;
  1085.  
  1086. /* The semantic value of the lookahead symbol.  */
  1087. YYSTYPE yylval;
  1088. /* Number of syntax errors so far.  */
  1089. int yynerrs;
  1090.  
  1091. /*----------.
  1092. | yyparse.  |
  1093. `----------*/
  1094.  
  1095. int yyparse (void)
  1096. {
  1097.         int yystate;
  1098.         /* Number of tokens to shift before error messages enabled.  */
  1099.         int yyerrstatus;
  1100.  
  1101.         /* The stacks and their tools:
  1102.            'yyss': related to states.
  1103.            'yyvs': related to semantic values.
  1104.  
  1105.            Refer to the stacks through separate pointers, to allow yyoverflow
  1106.            to reallocate them elsewhere.  */
  1107.  
  1108.         /* The state stack.  */
  1109.         yytype_int16 yyssa[YYINITDEPTH];
  1110.         yytype_int16 *yyss;
  1111.         yytype_int16 *yyssp;
  1112.  
  1113.         /* The semantic value stack.  */
  1114.         YYSTYPE yyvsa[YYINITDEPTH];
  1115.         YYSTYPE *yyvs;
  1116.         YYSTYPE *yyvsp;
  1117.  
  1118.         YYSIZE_T yystacksize;
  1119.  
  1120.         int yyn;
  1121.         int yyresult;
  1122.         /* Lookahead token as an internal (translated) token number.  */
  1123.         int yytoken = 0;
  1124.         /* The variables used to return semantic value and location from the
  1125.            action routines.  */
  1126.         YYSTYPE yyval;
  1127.  
  1128. #if YYERROR_VERBOSE
  1129.         /* Buffer for error messages, and its allocated size.  */
  1130.         char yymsgbuf[128];
  1131.         char *yymsg = yymsgbuf;
  1132.         YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
  1133. #endif
  1134.  
  1135. #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
  1136.  
  1137.         /* The number of symbols on the RHS of the reduced rule.
  1138.            Keep to zero when no symbol should be popped.  */
  1139.         int yylen = 0;
  1140.  
  1141.         yyssp = yyss = yyssa;
  1142.         yyvsp = yyvs = yyvsa;
  1143.         yystacksize = YYINITDEPTH;
  1144.  
  1145.         YYDPRINTF ((stderr, "Starting parse\n"));
  1146.  
  1147.         yystate = 0;
  1148.         yyerrstatus = 0;
  1149.         yynerrs = 0;
  1150.         yychar = YYEMPTY; /* Cause a token to be read.  */
  1151.         goto yysetstate;
  1152.  
  1153.         /*------------------------------------------------------------.
  1154.         | yynewstate -- Push a new state, which is found in yystate.  |
  1155.         `------------------------------------------------------------*/
  1156. yynewstate:
  1157.         /* In all cases, when you get here, the value and location stacks
  1158.            have just been pushed.  So pushing a state here evens the stacks.  */
  1159.         yyssp++;
  1160.  
  1161. yysetstate:
  1162.         *yyssp = yystate;
  1163.  
  1164.         if (yyss + yystacksize - 1 <= yyssp)
  1165.         {
  1166.                 /* Get the current used size of the three stacks, in elements.  */
  1167.                 YYSIZE_T yysize = yyssp - yyss + 1;
  1168.  
  1169. #ifdef yyoverflow
  1170.                 {
  1171.                         /* Give user a chance to reallocate the stack.  Use copies of
  1172.                            these so that the &'s don't force the real ones into
  1173.                            memory.  */
  1174.                         YYSTYPE *yyvs1 = yyvs;
  1175.                         yytype_int16 *yyss1 = yyss;
  1176.  
  1177.                         /* Each stack pointer address is followed by the size of the
  1178.                            data in use in that stack, in bytes.  This used to be a
  1179.                            conditional around just the two extra args, but that might
  1180.                            be undefined if yyoverflow is a macro.  */
  1181.                         yyoverflow (
  1182.                             YY_ ("memory exhausted"),
  1183.                             &yyss1,
  1184.                             yysize * sizeof (*yyssp),
  1185.                             &yyvs1,
  1186.                             yysize * sizeof (*yyvsp),
  1187.                             &yystacksize);
  1188.  
  1189.                         yyss = yyss1;
  1190.                         yyvs = yyvs1;
  1191.                 }
  1192. #else /* no yyoverflow */
  1193. #ifndef YYSTACK_RELOCATE
  1194.                 goto yyexhaustedlab;
  1195. #else
  1196.                 /* Extend the stack our own way.  */
  1197.                 if (YYMAXDEPTH <= yystacksize)
  1198.                         goto yyexhaustedlab;
  1199.                 yystacksize *= 2;
  1200.                 if (YYMAXDEPTH < yystacksize)
  1201.                         yystacksize = YYMAXDEPTH;
  1202.  
  1203.                 {
  1204.                         yytype_int16 *yyss1 = yyss;
  1205.                         union yyalloc *yyptr =
  1206.                             (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
  1207.                         if (!yyptr)
  1208.                                 goto yyexhaustedlab;
  1209.                         YYSTACK_RELOCATE (yyss_alloc, yyss);
  1210.                         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
  1211. #undef YYSTACK_RELOCATE
  1212.                         if (yyss1 != yyssa)
  1213.                                 YYSTACK_FREE (yyss1);
  1214.                 }
  1215. #endif
  1216. #endif /* no yyoverflow */
  1217.  
  1218.                 yyssp = yyss + yysize - 1;
  1219.                 yyvsp = yyvs + yysize - 1;
  1220.  
  1221.                 YYDPRINTF ((
  1222.                     stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize));
  1223.  
  1224.                 if (yyss + yystacksize - 1 <= yyssp)
  1225.                         YYABORT;
  1226.         }
  1227.  
  1228.         YYDPRINTF ((stderr, "Entering state %d\n", yystate));
  1229.  
  1230.         if (yystate == YYFINAL)
  1231.                 YYACCEPT;
  1232.  
  1233.         goto yybackup;
  1234.  
  1235. /*-----------.
  1236. | yybackup.  |
  1237. `-----------*/
  1238. yybackup:
  1239.  
  1240.         /* Do appropriate processing given the current state.  Read a
  1241.            lookahead token if we need one and don't already have one.  */
  1242.  
  1243.         /* First try to decide what to do without reference to lookahead token.  */
  1244.         yyn = yypact[yystate];
  1245.         if (yypact_value_is_default (yyn))
  1246.                 goto yydefault;
  1247.  
  1248.         /* Not known => get a lookahead token if don't already have one.  */
  1249.  
  1250.         /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
  1251.         if (yychar == YYEMPTY)
  1252.         {
  1253.                 YYDPRINTF ((stderr, "Reading a token: "));
  1254.                 yychar = yylex ();
  1255.         }
  1256.  
  1257.         if (yychar <= YYEOF)
  1258.         {
  1259.                 yychar = yytoken = YYEOF;
  1260.                 YYDPRINTF ((stderr, "Now at end of input.\n"));
  1261.         }
  1262.         else
  1263.         {
  1264.                 yytoken = YYTRANSLATE (yychar);
  1265.                 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
  1266.         }
  1267.  
  1268.         /* If the proper action on seeing token YYTOKEN is to reduce or to
  1269.            detect an error, take that action.  */
  1270.         yyn += yytoken;
  1271.         if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
  1272.                 goto yydefault;
  1273.         yyn = yytable[yyn];
  1274.         if (yyn <= 0)
  1275.         {
  1276.                 if (yytable_value_is_error (yyn))
  1277.                         goto yyerrlab;
  1278.                 yyn = -yyn;
  1279.                 goto yyreduce;
  1280.         }
  1281.  
  1282.         /* Count tokens shifted since error; after three, turn off error
  1283.            status.  */
  1284.         if (yyerrstatus)
  1285.                 yyerrstatus--;
  1286.  
  1287.         /* Shift the lookahead token.  */
  1288.         YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
  1289.  
  1290.         /* Discard the shifted token.  */
  1291.         yychar = YYEMPTY;
  1292.  
  1293.         yystate = yyn;
  1294.         YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  1295.         *++yyvsp = yylval;
  1296.         YY_IGNORE_MAYBE_UNINITIALIZED_END
  1297.  
  1298.         goto yynewstate;
  1299.  
  1300. /*-----------------------------------------------------------.
  1301. | yydefault -- do the default action for the current state.  |
  1302. `-----------------------------------------------------------*/
  1303. yydefault:
  1304.         yyn = yydefact[yystate];
  1305.         if (yyn == 0)
  1306.                 goto yyerrlab;
  1307.         goto yyreduce;
  1308.  
  1309. /*-----------------------------.
  1310. | yyreduce -- Do a reduction.  |
  1311. `-----------------------------*/
  1312. yyreduce:
  1313.         /* yyn is the number of a rule to reduce with.  */
  1314.         yylen = yyr2[yyn];
  1315.  
  1316.         /* If YYLEN is nonzero, implement the default value of the action:
  1317.            '$$ = $1'.
  1318.  
  1319.            Otherwise, the following line sets YYVAL to garbage.
  1320.            This behavior is undocumented and Bison
  1321.            users should not rely upon it.  Assigning to YYVAL
  1322.            unconditionally makes the parser a bit smaller, and it avoids a
  1323.            GCC warning that YYVAL may be used uninitialized.  */
  1324.         yyval = yyvsp[1 - yylen];
  1325.  
  1326.         YY_REDUCE_PRINT (yyn);
  1327.         switch (yyn)
  1328.         {
  1329.         case 14:
  1330. #line 171 "cdi_yacc.y" /* yacc.c:1646  */
  1331.         {
  1332.         }
  1333. #line 1405 "cdi_yacc.c" /* yacc.c:1646  */
  1334.         break;
  1335.  
  1336.         case 29:
  1337. #line 201 "cdi_yacc.y" /* yacc.c:1646  */
  1338.         {
  1339.                 sprintf (curr_net_id, "%s_%s", (yyvsp[-2].string), (yyvsp[-1].string));
  1340.         }
  1341. #line 1411 "cdi_yacc.c" /* yacc.c:1646  */
  1342.         break;
  1343.  
  1344.         case 30:
  1345. #line 203 "cdi_yacc.y" /* yacc.c:1646  */
  1346.         {
  1347.                 strcpy (curr_net_id, (yyvsp[-2].string));
  1348.         }
  1349. #line 1417 "cdi_yacc.c" /* yacc.c:1646  */
  1350.         break;
  1351.  
  1352.         case 37:
  1353. #line 219 "cdi_yacc.y" /* yacc.c:1646  */
  1354.         {
  1355.                 current_chip = find_socket (Ident, (yyvsp[-1].string), Create, &socket_head);
  1356.                 define_pin (
  1357.                     &routed_list,
  1358.                     current_chip,
  1359.                     curr_net_id,
  1360.                     BIDIR,
  1361.                     0,
  1362.                     (yyvsp[0].string),
  1363.                     default_vhdl_datatype,
  1364.                     NULL);
  1365.         }
  1366. #line 1427 "cdi_yacc.c" /* yacc.c:1646  */
  1367.         break;
  1368.  
  1369. #line 1431 "cdi_yacc.c" /* yacc.c:1646  */
  1370.         default:
  1371.                 break;
  1372.         }
  1373.         /* User semantic actions sometimes alter yychar, and that requires
  1374.            that yytoken be updated with the new translation.  We take the
  1375.            approach of translating immediately before every use of yytoken.
  1376.            One alternative is translating here after every semantic action,
  1377.            but that translation would be missed if the semantic action invokes
  1378.            YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
  1379.            if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
  1380.            incorrect destructor might then be invoked immediately.  In the
  1381.            case of YYERROR or YYBACKUP, subsequent parser actions might lead
  1382.            to an incorrect destructor call or verbose syntax error message
  1383.            before the lookahead is translated.  */
  1384.         YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
  1385.  
  1386.         YYPOPSTACK (yylen);
  1387.         yylen = 0;
  1388.         YY_STACK_PRINT (yyss, yyssp);
  1389.  
  1390.         *++yyvsp = yyval;
  1391.  
  1392.         /* Now 'shift' the result of the reduction.  Determine what state
  1393.            that goes to, based on the state we popped back to and the rule
  1394.            number reduced by.  */
  1395.  
  1396.         yyn = yyr1[yyn];
  1397.  
  1398.         yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
  1399.         if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  1400.                 yystate = yytable[yystate];
  1401.         else
  1402.                 yystate = yydefgoto[yyn - YYNTOKENS];
  1403.  
  1404.         goto yynewstate;
  1405.  
  1406. /*--------------------------------------.
  1407. | yyerrlab -- here on detecting error.  |
  1408. `--------------------------------------*/
  1409. yyerrlab:
  1410.         /* Make sure we have latest lookahead translation.  See comments at
  1411.            user semantic actions for why this is necessary.  */
  1412.         yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
  1413.  
  1414.         /* If not already recovering from an error, report this error.  */
  1415.         if (!yyerrstatus)
  1416.         {
  1417.                 ++yynerrs;
  1418. #if !YYERROR_VERBOSE
  1419.                 yyerror (YY_ ("syntax error"));
  1420. #else
  1421. #define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, yyssp, yytoken)
  1422.                 {
  1423.                         char const *yymsgp = YY_ ("syntax error");
  1424.                         int yysyntax_error_status;
  1425.                         yysyntax_error_status = YYSYNTAX_ERROR;
  1426.                         if (yysyntax_error_status == 0)
  1427.                                 yymsgp = yymsg;
  1428.                         else if (yysyntax_error_status == 1)
  1429.                         {
  1430.                                 if (yymsg != yymsgbuf)
  1431.                                         YYSTACK_FREE (yymsg);
  1432.                                 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
  1433.                                 if (!yymsg)
  1434.                                 {
  1435.                                         yymsg = yymsgbuf;
  1436.                                         yymsg_alloc = sizeof yymsgbuf;
  1437.                                         yysyntax_error_status = 2;
  1438.                                 }
  1439.                                 else
  1440.                                 {
  1441.                                         yysyntax_error_status = YYSYNTAX_ERROR;
  1442.                                         yymsgp = yymsg;
  1443.                                 }
  1444.                         }
  1445.                         yyerror (yymsgp);
  1446.                         if (yysyntax_error_status == 2)
  1447.                                 goto yyexhaustedlab;
  1448.                 }
  1449. #undef YYSYNTAX_ERROR
  1450. #endif
  1451.         }
  1452.  
  1453.         if (yyerrstatus == 3)
  1454.         {
  1455.                 /* If just tried and failed to reuse lookahead token after an
  1456.                    error, discard it.  */
  1457.  
  1458.                 if (yychar <= YYEOF)
  1459.                 {
  1460.                         /* Return failure if at end of input.  */
  1461.                         if (yychar == YYEOF)
  1462.                                 YYABORT;
  1463.                 }
  1464.                 else
  1465.                 {
  1466.                         yydestruct ("Error: discarding", yytoken, &yylval);
  1467.                         yychar = YYEMPTY;
  1468.                 }
  1469.         }
  1470.  
  1471.         /* Else will try to reuse lookahead token after shifting the error
  1472.            token.  */
  1473.         goto yyerrlab1;
  1474.  
  1475. /*---------------------------------------------------.
  1476. | yyerrorlab -- error raised explicitly by YYERROR.  |
  1477. `---------------------------------------------------*/
  1478. yyerrorlab:
  1479.  
  1480.         /* Pacify compilers like GCC when the user code never invokes
  1481.            YYERROR and the label yyerrorlab therefore never appears in user
  1482.            code.  */
  1483.         if (/*CONSTCOND*/ 0)
  1484.                 goto yyerrorlab;
  1485.  
  1486.         /* Do not reclaim the symbols of the rule whose action triggered
  1487.            this YYERROR.  */
  1488.         YYPOPSTACK (yylen);
  1489.         yylen = 0;
  1490.         YY_STACK_PRINT (yyss, yyssp);
  1491.         yystate = *yyssp;
  1492.         goto yyerrlab1;
  1493.  
  1494. /*-------------------------------------------------------------.
  1495. | yyerrlab1 -- common code for both syntax error and YYERROR.  |
  1496. `-------------------------------------------------------------*/
  1497. yyerrlab1:
  1498.         yyerrstatus = 3; /* Each real token shifted decrements this.  */
  1499.  
  1500.         for (;;)
  1501.         {
  1502.                 yyn = yypact[yystate];
  1503.                 if (!yypact_value_is_default (yyn))
  1504.                 {
  1505.                         yyn += YYTERROR;
  1506.                         if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
  1507.                         {
  1508.                                 yyn = yytable[yyn];
  1509.                                 if (0 < yyn)
  1510.                                         break;
  1511.                         }
  1512.                 }
  1513.  
  1514.                 /* Pop the current state because it cannot handle the error token.  */
  1515.                 if (yyssp == yyss)
  1516.                         YYABORT;
  1517.  
  1518.                 yydestruct ("Error: popping", yystos[yystate], yyvsp);
  1519.                 YYPOPSTACK (1);
  1520.                 yystate = *yyssp;
  1521.                 YY_STACK_PRINT (yyss, yyssp);
  1522.         }
  1523.  
  1524.         YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  1525.         *++yyvsp = yylval;
  1526.         YY_IGNORE_MAYBE_UNINITIALIZED_END
  1527.  
  1528.         /* Shift the error token.  */
  1529.         YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
  1530.  
  1531.         yystate = yyn;
  1532.         goto yynewstate;
  1533.  
  1534. /*-------------------------------------.
  1535. | yyacceptlab -- YYACCEPT comes here.  |
  1536. `-------------------------------------*/
  1537. yyacceptlab:
  1538.         yyresult = 0;
  1539.         goto yyreturn;
  1540.  
  1541. /*-----------------------------------.
  1542. | yyabortlab -- YYABORT comes here.  |
  1543. `-----------------------------------*/
  1544. yyabortlab:
  1545.         yyresult = 1;
  1546.         goto yyreturn;
  1547.  
  1548. #if !defined yyoverflow || YYERROR_VERBOSE
  1549. /*-------------------------------------------------.
  1550. | yyexhaustedlab -- memory exhaustion comes here.  |
  1551. `-------------------------------------------------*/
  1552. yyexhaustedlab:
  1553.         yyerror (YY_ ("memory exhausted"));
  1554.         yyresult = 2;
  1555.         /* Fall through.  */
  1556. #endif
  1557.  
  1558. yyreturn:
  1559.         if (yychar != YYEMPTY)
  1560.         {
  1561.                 /* Make sure we have latest lookahead translation.  See comments at
  1562.                    user semantic actions for why this is necessary.  */
  1563.                 yytoken = YYTRANSLATE (yychar);
  1564.                 yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval);
  1565.         }
  1566.         /* Do not reclaim the symbols of the rule whose action triggered
  1567.            this YYABORT or YYACCEPT.  */
  1568.         YYPOPSTACK (yylen);
  1569.         YY_STACK_PRINT (yyss, yyssp);
  1570.         while (yyssp != yyss)
  1571.         {
  1572.                 yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp);
  1573.                 YYPOPSTACK (1);
  1574.         }
  1575. #ifndef yyoverflow
  1576.         if (yyss != yyssa)
  1577.                 YYSTACK_FREE (yyss);
  1578. #endif
  1579. #if YYERROR_VERBOSE
  1580.         if (yymsg != yymsgbuf)
  1581.                 YYSTACK_FREE (yymsg);
  1582. #endif
  1583.         return yyresult;
  1584. }
  1585. #line 233 "cdi_yacc.y" /* yacc.c:1906  */
  1586.  
  1587. /* defining lineno here */
  1588.  
  1589. int lineno;
  1590. extern char *yytext;
  1591.  
  1592. int yyerror (char *x)
  1593. {
  1594.         int token;
  1595.         printf ("Error --> %s near string (%s) at line %d\n", x, yytext, lineno);
  1596.         /*  for(token = yylex();token >= 0 && token!=NL;token = yylex()); */
  1597.         return 1;
  1598. }
  1599.  
  1600. int yywrap (void)
  1601. {
  1602.         return 1;
  1603. }
  1604.