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