My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
parse_netlist.cpp
Go to the documentation of this file.
1 
2 /* A Bison parser, made by GNU Bison 2.4.1. */
3 
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 
6  Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7  Free Software Foundation, Inc.
8 
9  This program is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 
22 /* As a special exception, you may create a larger work that contains
23  part or all of the Bison parser skeleton and distribute that work
24  under terms of your choice, so long as that work isn't itself a
25  parser generator using the skeleton or a modified version thereof
26  as a parser skeleton. Alternatively, if you modify or redistribute
27  the parser skeleton itself, you may (at your option) remove this
28  special exception, which will cause the skeleton and the resulting
29  Bison output files to be licensed under the GNU General Public
30  License without this special exception.
31 
32  This special exception was added by the Free Software Foundation in
33  version 2.2 of Bison. */
34 
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36  simplifying the original so-called "semantic" parser. */
37 
38 /* All symbols defined below should begin with yy or YY, to avoid
39  infringing on user name space. This should be done even for local
40  variables, as they might otherwise be expanded by user macros.
41  There are some unavoidable exceptions within include files to
42  define necessary library symbols; they are noted "INFRINGES ON
43  USER NAME SPACE" below. */
44 
45 /* Identify Bison output. */
46 #define YYBISON 1
47 
48 /* Bison version. */
49 #define YYBISON_VERSION "2.4.1"
50 
51 /* Skeleton name. */
52 #define YYSKELETON_NAME "yacc.c"
53 
54 /* Pure parsers. */
55 #define YYPURE 0
56 
57 /* Push parsers. */
58 #define YYPUSH 0
59 
60 /* Pull parsers. */
61 #define YYPULL 1
62 
63 /* Using locations. */
64 #define YYLSP_NEEDED 0
65 
66 /* Substitute the variable and function names. */
67 #define yyparse netlist_parse
68 #define yylex netlist_lex
69 #define yyerror netlist_error
70 #define yylval netlist_lval
71 #define yychar netlist_char
72 #define yydebug netlist_debug
73 #define yynerrs netlist_nerrs
74 
75 
76 /* Copy the first part of user declarations. */
77 
78 /* Line 189 of yacc.c */
79 #line 3 "parse_netlist.y"
80 
81 /*
82  * parse_netlist.y - parser for the Qucs netlist
83  *
84  * Copyright (C) 2003, 2004, 2005, 2006, 2007 Stefan Jahn <stefan@lkcc.org>
85  *
86  * This is free software; you can redistribute it and/or modify
87  * it under the terms of the GNU General Public License as published by
88  * the Free Software Foundation; either version 2, or (at your option)
89  * any later version.
90  *
91  * This software is distributed in the hope that it will be useful,
92  * but WITHOUT ANY WARRANTY; without even the implied warranty of
93  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
94  * GNU General Public License for more details.
95  *
96  * You should have received a copy of the GNU General Public License
97  * along with this package; see the file COPYING. If not, write to
98  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
99  * Boston, MA 02110-1301, USA.
100  *
101  * $Id: parse_netlist.y 1825 2011-03-11 20:42:14Z ela $
102  *
103  */
104 
105 #if HAVE_CONFIG_H
106 # include <config.h>
107 #endif
108 
109 #include <stdio.h>
110 #include <stdlib.h>
111 #include <string.h>
112 
113 #define YYERROR_VERBOSE 42
114 #define YYDEBUG 1
115 #define YYMAXDEPTH 1000000
116 
117 #include "check_netlist.h"
118 #include "logging.h"
119 #include "equation.h"
120 #include "range.h"
121 
122 
123 
124 /* Line 189 of yacc.c */
125 #line 126 "parse_netlist.cpp"
126 
127 /* Enabling traces. */
128 #ifndef YYDEBUG
129 # define YYDEBUG 0
130 #endif
131 
132 /* Enabling verbose error messages. */
133 #ifdef YYERROR_VERBOSE
134 # undef YYERROR_VERBOSE
135 # define YYERROR_VERBOSE 1
136 #else
137 # define YYERROR_VERBOSE 0
138 #endif
139 
140 /* Enabling the token table. */
141 #ifndef YYTOKEN_TABLE
142 # define YYTOKEN_TABLE 0
143 #endif
144 
145 
146 /* Tokens. */
147 #ifndef YYTOKENTYPE
148 # define YYTOKENTYPE
149  /* Put the tokens into the symbol table, so that GDB and other debuggers
150  know about them. */
151  enum yytokentype {
153  Identifier = 259,
154  Assign = 260,
155  ScaleOrUnit = 261,
156  Eol = 262,
157  Eqn = 263,
158  DefSub = 264,
159  EndSub = 265,
160  REAL = 266,
161  IMAG = 267,
162  COMPLEX = 268,
163  Character = 269,
164  STRING = 270,
165  Or = 271,
166  And = 272,
167  Equal = 273,
168  NotEqual = 274,
170  LessOrEqual = 276,
171  Greater = 277,
172  Less = 278,
173  Not = 279,
174  NEG = 280,
175  POS = 281
176  };
177 #endif
178 /* Tokens. */
179 #define InvalidCharacter 258
180 #define Identifier 259
181 #define Assign 260
182 #define ScaleOrUnit 261
183 #define Eol 262
184 #define Eqn 263
185 #define DefSub 264
186 #define EndSub 265
187 #define REAL 266
188 #define IMAG 267
189 #define COMPLEX 268
190 #define Character 269
191 #define STRING 270
192 #define Or 271
193 #define And 272
194 #define Equal 273
195 #define NotEqual 274
196 #define GreaterOrEqual 275
197 #define LessOrEqual 276
198 #define Greater 277
199 #define Less 278
200 #define Not 279
201 #define NEG 280
202 #define POS 281
203 
204 
205 
206 
207 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
208 typedef union YYSTYPE
209 {
210 
211 /* Line 214 of yacc.c */
212 #line 76 "parse_netlist.y"
213 
214  char * ident;
215  char * str;
216  double d;
217  char chr;
218  struct definition_t * definition;
219  struct definition_t * subcircuit;
220  struct node_t * node;
221  struct pair_t * pair;
222  struct value_t * value;
223  struct {
224  double r;
225  double i;
226  } c;
232 
233 
234 
235 /* Line 214 of yacc.c */
236 #line 237 "parse_netlist.cpp"
237 } YYSTYPE;
238 # define YYSTYPE_IS_TRIVIAL 1
239 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
240 # define YYSTYPE_IS_DECLARED 1
241 #endif
242 
243 
244 /* Copy the second part of user declarations. */
245 
246 
247 /* Line 264 of yacc.c */
248 #line 249 "parse_netlist.cpp"
249 
250 #ifdef short
251 # undef short
252 #endif
253 
254 #ifdef YYTYPE_UINT8
255 typedef YYTYPE_UINT8 yytype_uint8;
256 #else
257 typedef unsigned char yytype_uint8;
258 #endif
259 
260 #ifdef YYTYPE_INT8
261 typedef YYTYPE_INT8 yytype_int8;
262 #elif (defined __STDC__ || defined __C99__FUNC__ \
263  || defined __cplusplus || defined _MSC_VER)
264 typedef signed char yytype_int8;
265 #else
266 typedef short int yytype_int8;
267 #endif
268 
269 #ifdef YYTYPE_UINT16
270 typedef YYTYPE_UINT16 yytype_uint16;
271 #else
272 typedef unsigned short int yytype_uint16;
273 #endif
274 
275 #ifdef YYTYPE_INT16
276 typedef YYTYPE_INT16 yytype_int16;
277 #else
278 typedef short int yytype_int16;
279 #endif
280 
281 #ifndef YYSIZE_T
282 # ifdef __SIZE_TYPE__
283 # define YYSIZE_T __SIZE_TYPE__
284 # elif defined size_t
285 # define YYSIZE_T size_t
286 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
287  || defined __cplusplus || defined _MSC_VER)
288 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
289 # define YYSIZE_T size_t
290 # else
291 # define YYSIZE_T unsigned int
292 # endif
293 #endif
294 
295 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
296 
297 #ifndef YY_
298 # if YYENABLE_NLS
299 # if ENABLE_NLS
300 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
301 # define YY_(msgid) dgettext ("bison-runtime", msgid)
302 # endif
303 # endif
304 # ifndef YY_
305 # define YY_(msgid) msgid
306 # endif
307 #endif
308 
309 /* Suppress unused-variable warnings by "using" E. */
310 #if ! defined lint || defined __GNUC__
311 # define YYUSE(e) ((void) (e))
312 #else
313 # define YYUSE(e) /* empty */
314 #endif
315 
316 /* Identity function, used to suppress warnings about constant conditions. */
317 #ifndef lint
318 # define YYID(n) (n)
319 #else
320 #if (defined __STDC__ || defined __C99__FUNC__ \
321  || defined __cplusplus || defined _MSC_VER)
322 static int
323 YYID (int yyi)
324 #else
325 static int
326 YYID (yyi)
327  int yyi;
328 #endif
329 {
330  return yyi;
331 }
332 #endif
333 
334 #if ! defined yyoverflow || YYERROR_VERBOSE
335 
336 /* The parser invokes alloca or malloc; define the necessary symbols. */
337 
338 # ifdef YYSTACK_USE_ALLOCA
339 # if YYSTACK_USE_ALLOCA
340 # ifdef __GNUC__
341 # define YYSTACK_ALLOC __builtin_alloca
342 # elif defined __BUILTIN_VA_ARG_INCR
343 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
344 # elif defined _AIX
345 # define YYSTACK_ALLOC __alloca
346 # elif defined _MSC_VER
347 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
348 # define alloca _alloca
349 # else
350 # define YYSTACK_ALLOC alloca
351 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
352  || defined __cplusplus || defined _MSC_VER)
353 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
354 # ifndef _STDLIB_H
355 # define _STDLIB_H 1
356 # endif
357 # endif
358 # endif
359 # endif
360 # endif
361 
362 # ifdef YYSTACK_ALLOC
363  /* Pacify GCC's `empty if-body' warning. */
364 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
365 # ifndef YYSTACK_ALLOC_MAXIMUM
366  /* The OS might guarantee only one guard page at the bottom of the stack,
367  and a page size can be as small as 4096 bytes. So we cannot safely
368  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
369  to allow for a few compiler-allocated temporary stack slots. */
370 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
371 # endif
372 # else
373 # define YYSTACK_ALLOC YYMALLOC
374 # define YYSTACK_FREE YYFREE
375 # ifndef YYSTACK_ALLOC_MAXIMUM
376 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
377 # endif
378 # if (defined __cplusplus && ! defined _STDLIB_H \
379  && ! ((defined YYMALLOC || defined malloc) \
380  && (defined YYFREE || defined free)))
381 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
382 # ifndef _STDLIB_H
383 # define _STDLIB_H 1
384 # endif
385 # endif
386 # ifndef YYMALLOC
387 # define YYMALLOC malloc
388 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
389  || defined __cplusplus || defined _MSC_VER)
390 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
391 # endif
392 # endif
393 # ifndef YYFREE
394 # define YYFREE free
395 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
396  || defined __cplusplus || defined _MSC_VER)
397 void free (void *); /* INFRINGES ON USER NAME SPACE */
398 # endif
399 # endif
400 # endif
401 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
402 
403 
404 #if (! defined yyoverflow \
405  && (! defined __cplusplus \
406  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
407 
408 /* A type that is properly aligned for any stack member. */
409 union yyalloc
410 {
413 };
414 
415 /* The size of the maximum gap between one aligned stack and the next. */
416 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
417 
418 /* The size of an array large to enough to hold all stacks, each with
419  N elements. */
420 # define YYSTACK_BYTES(N) \
421  ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
422  + YYSTACK_GAP_MAXIMUM)
423 
424 /* Copy COUNT objects from FROM to TO. The source and destination do
425  not overlap. */
426 # ifndef YYCOPY
427 # if defined __GNUC__ && 1 < __GNUC__
428 # define YYCOPY(To, From, Count) \
429  __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
430 # else
431 # define YYCOPY(To, From, Count) \
432  do \
433  { \
434  YYSIZE_T yyi; \
435  for (yyi = 0; yyi < (Count); yyi++) \
436  (To)[yyi] = (From)[yyi]; \
437  } \
438  while (YYID (0))
439 # endif
440 # endif
441 
442 /* Relocate STACK from its old location to the new one. The
443  local variables YYSIZE and YYSTACKSIZE give the old and new number of
444  elements in the stack, and YYPTR gives the new location of the
445  stack. Advance YYPTR to a properly aligned location for the next
446  stack. */
447 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
448  do \
449  { \
450  YYSIZE_T yynewbytes; \
451  YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
452  Stack = &yyptr->Stack_alloc; \
453  yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
454  yyptr += yynewbytes / sizeof (*yyptr); \
455  } \
456  while (YYID (0))
457 
458 #endif
459 
460 /* YYFINAL -- State number of the termination state. */
461 #define YYFINAL 20
462 /* YYLAST -- Last index in YYTABLE. */
463 #define YYLAST 292
464 
465 /* YYNTOKENS -- Number of terminals. */
466 #define YYNTOKENS 44
467 /* YYNNTS -- Number of nonterminals. */
468 #define YYNNTS 36
469 /* YYNRULES -- Number of rules. */
470 #define YYNRULES 96
471 /* YYNRULES -- Number of states. */
472 #define YYNSTATES 164
473 
474 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
475 #define YYUNDEFTOK 2
476 #define YYMAXUTOK 281
477 
478 #define YYTRANSLATE(YYX) \
479  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
480 
481 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
482 static const yytype_uint8 yytranslate[] =
483 {
484  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
485  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
486  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
487  2, 2, 2, 2, 37, 2, 2, 31, 2, 2,
488  41, 42, 29, 28, 43, 27, 36, 30, 2, 2,
489  2, 2, 2, 2, 2, 2, 2, 2, 18, 40,
490  2, 16, 2, 17, 2, 2, 2, 2, 2, 2,
491  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
492  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
493  2, 38, 2, 39, 35, 2, 2, 2, 2, 2,
494  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
495  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
496  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
497  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
498  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
499  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
500  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
501  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
502  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
503  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
504  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
505  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
506  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
507  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
508  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
509  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
510  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
511  15, 19, 20, 21, 22, 23, 24, 25, 26, 32,
512  33, 34
513 };
514 
515 #if YYDEBUG
516 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
517  YYRHS. */
518 static const yytype_uint16 yyprhs[] =
519 {
520  0, 0, 3, 5, 6, 9, 11, 13, 15, 17,
521  19, 26, 33, 35, 37, 39, 41, 42, 45, 46,
522  50, 54, 55, 58, 60, 64, 66, 69, 73, 75,
523  77, 81, 85, 86, 88, 92, 99, 100, 103, 108,
524  110, 112, 114, 118, 122, 126, 129, 130, 134, 136,
525  138, 139, 143, 148, 150, 152, 154, 156, 158, 162,
526  165, 168, 170, 172, 177, 182, 186, 190, 194, 198,
527  202, 205, 208, 212, 218, 222, 226, 230, 234, 238,
528  242, 245, 249, 253, 254, 256, 258, 262, 266, 270,
529  276, 277, 280, 283, 285, 287, 289
530 };
531 
532 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
533 static const yytype_int8 yyrhs[] =
534 {
535  45, 0, -1, 46, -1, -1, 47, 46, -1, 75,
536  -1, 59, -1, 48, -1, 49, -1, 7, -1, 36,
537  4, 18, 50, 53, 7, -1, 4, 18, 50, 52,
538  53, 7, -1, 4, -1, 6, -1, 4, -1, 6,
539  -1, -1, 51, 52, -1, -1, 5, 55, 53, -1,
540  5, 54, 53, -1, -1, 37, 37, -1, 57, -1,
541  37, 57, 37, -1, 11, -1, 11, 6, -1, 11,
542  6, 6, -1, 56, -1, 50, -1, 38, 50, 39,
543  -1, 38, 58, 39, -1, -1, 56, -1, 56, 40,
544  58, -1, 8, 18, 50, 61, 60, 7, -1, -1,
545  61, 60, -1, 5, 37, 62, 37, -1, 70, -1,
546  72, -1, 73, -1, 41, 62, 42, -1, 38, 66,
547  39, -1, 38, 69, 39, -1, 62, 64, -1, -1,
548  43, 62, 64, -1, 63, -1, 65, -1, -1, 40,
549  63, 67, -1, 63, 40, 63, 67, -1, 68, -1,
550  11, -1, 12, -1, 14, -1, 15, -1, 62, 18,
551  62, -1, 18, 62, -1, 62, 18, -1, 18, -1,
552  4, -1, 4, 41, 74, 42, -1, 72, 38, 74,
553  39, -1, 62, 28, 62, -1, 62, 27, 62, -1,
554  62, 29, 62, -1, 62, 30, 62, -1, 62, 31,
555  62, -1, 28, 62, -1, 27, 62, -1, 62, 35,
556  62, -1, 62, 17, 62, 18, 62, -1, 62, 26,
557  62, -1, 62, 25, 62, -1, 62, 23, 62, -1,
558  62, 24, 62, -1, 62, 21, 62, -1, 62, 22,
559  62, -1, 32, 62, -1, 62, 20, 62, -1, 62,
560  19, 62, -1, -1, 62, -1, 71, -1, 62, 43,
561  74, -1, 71, 43, 74, -1, 76, 77, 78, -1,
562  9, 50, 52, 53, 7, -1, -1, 79, 77, -1,
563  10, 7, -1, 49, -1, 59, -1, 75, -1, 7,
564  -1
565 };
566 
567 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
568 static const yytype_uint16 yyrline[] =
569 {
570  0, 120, 120, 125, 126, 137, 140, 141, 142, 143,
571  149, 160, 172, 173, 177, 178, 181, 182, 189, 190,
572  196, 209, 210, 214, 217, 223, 227, 232, 241, 244,
573  248, 252, 257, 258, 262, 269, 283, 284, 291, 299,
574  302, 305, 308, 311, 314, 320, 326, 327, 334, 338,
575  346, 347, 357, 368, 377, 381, 385, 389, 396, 403,
576  412, 421, 435, 442, 448, 455, 462, 469, 476, 483,
577  490, 496, 502, 509, 517, 524, 531, 538, 545, 552,
578  559, 565, 572, 581, 582, 585, 588, 592, 599, 607,
579  619, 620, 632, 636, 640, 644, 645
580 };
581 #endif
582 
583 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
584 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
585  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
586 static const char *const yytname[] =
587 {
588  "$end", "error", "$undefined", "InvalidCharacter", "Identifier",
589  "Assign", "ScaleOrUnit", "Eol", "Eqn", "DefSub", "EndSub", "REAL",
590  "IMAG", "COMPLEX", "Character", "STRING", "'='", "'?'", "':'", "Or",
591  "And", "Equal", "NotEqual", "GreaterOrEqual", "LessOrEqual", "Greater",
592  "Less", "'-'", "'+'", "'*'", "'/'", "'%'", "Not", "NEG", "POS", "'^'",
593  "'.'", "'\"'", "'['", "']'", "';'", "'('", "')'", "','", "$accept",
594  "Input", "InputList", "InputLine", "ActionLine", "DefinitionLine",
595  "InstanceIdentifier", "NodeIdentifier", "NodeList", "PairList",
596  "NoneValue", "Value", "PropertyReal", "PropertyValue", "ValueList",
597  "EquationLine", "EquationList", "Equation", "Expression",
598  "ExpressionCol", "ExpressionColList", "ExpressionVector", "Vector",
599  "ExpressionRowList", "ExpressionMatrix", "Matrix", "Constant", "Range",
600  "Reference", "Application", "ExpressionList", "SubcircuitBody",
601  "DefBegin", "DefBody", "DefEnd", "DefBodyLine", 0
602 };
603 #endif
604 
605 # ifdef YYPRINT
606 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
607  token YYLEX-NUM. */
608 static const yytype_uint16 yytoknum[] =
609 {
610  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
611  265, 266, 267, 268, 269, 270, 61, 63, 58, 271,
612  272, 273, 274, 275, 276, 277, 278, 45, 43, 42,
613  47, 37, 279, 280, 281, 94, 46, 34, 91, 93,
614  59, 40, 41, 44
615 };
616 # endif
617 
618 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
619 static const yytype_uint8 yyr1[] =
620 {
621  0, 44, 45, 46, 46, 47, 47, 47, 47, 47,
622  48, 49, 50, 50, 51, 51, 52, 52, 53, 53,
623  53, 54, 54, 55, 55, 56, 56, 56, 57, 57,
624  57, 57, 58, 58, 58, 59, 60, 60, 61, 62,
625  62, 62, 62, 62, 62, 63, 64, 64, 65, 66,
626  67, 67, 68, 69, 70, 70, 70, 70, 71, 71,
627  71, 71, 72, 73, 73, 73, 73, 73, 73, 73,
628  73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
629  73, 73, 73, 74, 74, 74, 74, 74, 75, 76,
630  77, 77, 78, 79, 79, 79, 79
631 };
632 
633 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
634 static const yytype_uint8 yyr2[] =
635 {
636  0, 2, 1, 0, 2, 1, 1, 1, 1, 1,
637  6, 6, 1, 1, 1, 1, 0, 2, 0, 3,
638  3, 0, 2, 1, 3, 1, 2, 3, 1, 1,
639  3, 3, 0, 1, 3, 6, 0, 2, 4, 1,
640  1, 1, 3, 3, 3, 2, 0, 3, 1, 1,
641  0, 3, 4, 1, 1, 1, 1, 1, 3, 2,
642  2, 1, 1, 4, 4, 3, 3, 3, 3, 3,
643  2, 2, 3, 5, 3, 3, 3, 3, 3, 3,
644  2, 3, 3, 0, 1, 1, 3, 3, 3, 5,
645  0, 2, 2, 1, 1, 1, 1
646 };
647 
648 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
649  STATE-NUM when YYTABLE doesn't specify something else to do. Zero
650  means the default is an error. */
651 static const yytype_uint8 yydefact[] =
652 {
653  3, 0, 9, 0, 0, 0, 0, 2, 3, 7,
654  8, 6, 5, 90, 0, 0, 12, 13, 16, 0,
655  1, 4, 96, 93, 94, 95, 0, 90, 16, 0,
656  14, 15, 16, 18, 0, 0, 88, 91, 18, 0,
657  36, 17, 21, 0, 18, 92, 0, 0, 0, 36,
658  25, 0, 32, 29, 18, 18, 28, 23, 89, 0,
659  11, 62, 54, 55, 56, 57, 0, 0, 0, 0,
660  0, 0, 39, 40, 41, 35, 37, 26, 22, 0,
661  0, 33, 0, 20, 19, 10, 83, 71, 70, 80,
662  46, 48, 49, 0, 53, 0, 0, 0, 0, 0,
663  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
664  0, 0, 38, 83, 27, 24, 30, 32, 31, 61,
665  84, 85, 0, 0, 45, 0, 43, 44, 42, 0,
666  82, 81, 78, 79, 76, 77, 75, 74, 66, 65,
667  67, 68, 69, 72, 0, 34, 59, 60, 83, 83,
668  63, 46, 50, 0, 64, 58, 86, 87, 47, 0,
669  52, 73, 50, 51
670 };
671 
672 /* YYDEFGOTO[NTERM-NUM]. */
673 static const yytype_int16 yydefgoto[] =
674 {
675  -1, 6, 7, 8, 9, 10, 53, 32, 33, 43,
676  54, 55, 56, 57, 82, 11, 48, 49, 120, 91,
677  124, 92, 93, 160, 94, 95, 72, 121, 73, 74,
678  122, 12, 13, 26, 36, 27
679 };
680 
681 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
682  STATE-NUM. */
683 #define YYPACT_NINF -118
684 static const yytype_int16 yypact[] =
685 {
686  81, -4, -118, 15, 98, 39, 44, -118, 81, -118,
687  -118, -118, -118, 107, 98, 98, -118, -118, 99, 30,
688  -118, -118, -118, -118, -118, -118, 58, 107, 99, 65,
689  -118, -118, 99, 66, 98, 42, -118, -118, 66, 49,
690  65, -118, 0, 72, 66, -118, 80, 69, 91, 65,
691  131, 71, 63, -118, 66, 66, -118, -118, -118, 106,
692  -118, 97, -118, -118, -118, -118, 69, 69, 69, 69,
693  69, 175, -118, 102, -118, -118, -118, 135, -118, 105,
694  119, 120, 123, -118, -118, -118, -2, 124, 124, 124,
695  126, 125, -118, 127, -118, 128, 151, 69, 69, 69,
696  69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
697  69, 69, -118, -2, -118, -118, -118, 152, -118, 69,
698  101, 121, 141, 69, -118, 69, -118, -118, -118, 196,
699  229, 244, 257, 257, 64, 64, 64, 64, 104, 104,
700  124, 124, 124, 124, 145, -118, 213, 69, -2, -2,
701  -118, 126, 147, 69, -118, 213, -118, -118, -118, 69,
702  -118, 213, 147, -118
703 };
704 
705 /* YYPGOTO[NTERM-NUM]. */
706 static const yytype_int16 yypgoto[] =
707 {
708  -118, -118, 177, -118, -118, 2, 13, -118, -25, -20,
709  -118, -118, -51, 137, 73, 18, 140, 162, -47, -117,
710  56, -118, -118, 46, -118, -118, -118, -118, -118, -118,
711  -108, 19, -118, 182, -118, -118
712 };
713 
714 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
715  positive, shift that token. If negative, reduce the rule which
716  number is the opposite. If zero, do what YYDEFACT says.
717  If YYTABLE_NINF, syntax error. */
718 #define YYTABLE_NINF -1
719 static const yytype_uint8 yytable[] =
720 {
721  71, 81, 61, 38, 16, 144, 17, 41, 152, 62,
722  63, 50, 64, 65, 14, 23, 119, 18, 46, 87,
723  88, 89, 90, 96, 59, 66, 67, 28, 29, 23,
724  68, 24, 25, 15, 83, 84, 69, 51, 52, 70,
725  156, 157, 162, 19, 20, 24, 25, 44, 34, 45,
726  129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
727  139, 140, 141, 142, 143, 80, 81, 16, 35, 17,
728  39, 42, 146, 61, 50, 16, 151, 17, 90, 58,
729  62, 63, 50, 64, 65, 1, 47, 60, 2, 3,
730  4, 106, 107, 108, 109, 110, 66, 67, 75, 111,
731  155, 68, 16, 30, 17, 31, 161, 69, 78, 52,
732  70, 1, 90, 85, 22, 3, 4, 5, 97, 147,
733  98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
734  108, 109, 110, 108, 109, 110, 111, 77, 86, 111,
735  113, 114, 115, 97, 148, 98, 99, 100, 101, 102,
736  103, 104, 105, 106, 107, 108, 109, 110, 116, 111,
737  117, 111, 118, 50, 149, 125, 126, 127, 97, 123,
738  98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
739  108, 109, 110, 150, 154, 21, 111, 159, 79, 76,
740  145, 40, 97, 128, 98, 99, 100, 101, 102, 103,
741  104, 105, 106, 107, 108, 109, 110, 158, 163, 37,
742  111, 0, 112, 97, 153, 98, 99, 100, 101, 102,
743  103, 104, 105, 106, 107, 108, 109, 110, 0, 0,
744  97, 111, 98, 99, 100, 101, 102, 103, 104, 105,
745  106, 107, 108, 109, 110, 0, 0, 0, 111, 99,
746  100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
747  110, 0, 0, 0, 111, 100, 101, 102, 103, 104,
748  105, 106, 107, 108, 109, 110, 0, 0, 0, 111,
749  102, 103, 104, 105, 106, 107, 108, 109, 110, 0,
750  0, 0, 111
751 };
752 
753 static const yytype_int16 yycheck[] =
754 {
755  47, 52, 4, 28, 4, 113, 6, 32, 125, 11,
756  12, 11, 14, 15, 18, 13, 18, 4, 38, 66,
757  67, 68, 69, 70, 44, 27, 28, 14, 15, 27,
758  32, 13, 13, 18, 54, 55, 38, 37, 38, 41,
759  148, 149, 159, 4, 0, 27, 27, 34, 18, 7,
760  97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
761  107, 108, 109, 110, 111, 52, 117, 4, 10, 6,
762  5, 5, 119, 4, 11, 4, 123, 6, 125, 7,
763  11, 12, 11, 14, 15, 4, 37, 7, 7, 8,
764  9, 27, 28, 29, 30, 31, 27, 28, 7, 35,
765  147, 32, 4, 4, 6, 6, 153, 38, 37, 38,
766  41, 4, 159, 7, 7, 8, 9, 36, 17, 18,
767  19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
768  29, 30, 31, 29, 30, 31, 35, 6, 41, 35,
769  38, 6, 37, 17, 43, 19, 20, 21, 22, 23,
770  24, 25, 26, 27, 28, 29, 30, 31, 39, 35,
771  40, 35, 39, 11, 43, 40, 39, 39, 17, 43,
772  19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
773  29, 30, 31, 42, 39, 8, 35, 40, 51, 49,
774  117, 29, 17, 42, 19, 20, 21, 22, 23, 24,
775  25, 26, 27, 28, 29, 30, 31, 151, 162, 27,
776  35, -1, 37, 17, 18, 19, 20, 21, 22, 23,
777  24, 25, 26, 27, 28, 29, 30, 31, -1, -1,
778  17, 35, 19, 20, 21, 22, 23, 24, 25, 26,
779  27, 28, 29, 30, 31, -1, -1, -1, 35, 20,
780  21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
781  31, -1, -1, -1, 35, 21, 22, 23, 24, 25,
782  26, 27, 28, 29, 30, 31, -1, -1, -1, 35,
783  23, 24, 25, 26, 27, 28, 29, 30, 31, -1,
784  -1, -1, 35
785 };
786 
787 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
788  symbol of state STATE-NUM. */
789 static const yytype_uint8 yystos[] =
790 {
791  0, 4, 7, 8, 9, 36, 45, 46, 47, 48,
792  49, 59, 75, 76, 18, 18, 4, 6, 50, 4,
793  0, 46, 7, 49, 59, 75, 77, 79, 50, 50,
794  4, 6, 51, 52, 18, 10, 78, 77, 52, 5,
795  61, 52, 5, 53, 50, 7, 53, 37, 60, 61,
796  11, 37, 38, 50, 54, 55, 56, 57, 7, 53,
797  7, 4, 11, 12, 14, 15, 27, 28, 32, 38,
798  41, 62, 70, 72, 73, 7, 60, 6, 37, 57,
799  50, 56, 58, 53, 53, 7, 41, 62, 62, 62,
800  62, 63, 65, 66, 68, 69, 62, 17, 19, 20,
801  21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
802  31, 35, 37, 38, 6, 37, 39, 40, 39, 18,
803  62, 71, 74, 43, 64, 40, 39, 39, 42, 62,
804  62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
805  62, 62, 62, 62, 74, 58, 62, 18, 43, 43,
806  42, 62, 63, 18, 39, 62, 74, 74, 64, 40,
807  67, 62, 63, 67
808 };
809 
810 #define yyerrok (yyerrstatus = 0)
811 #define yyclearin (yychar = YYEMPTY)
812 #define YYEMPTY (-2)
813 #define YYEOF 0
814 
815 #define YYACCEPT goto yyacceptlab
816 #define YYABORT goto yyabortlab
817 #define YYERROR goto yyerrorlab
818 
819 
820 /* Like YYERROR except do call yyerror. This remains here temporarily
821  to ease the transition to the new meaning of YYERROR, for GCC.
822  Once GCC version 2 has supplanted version 1, this can go. */
823 
824 #define YYFAIL goto yyerrlab
825 
826 #define YYRECOVERING() (!!yyerrstatus)
827 
828 #define YYBACKUP(Token, Value) \
829 do \
830  if (yychar == YYEMPTY && yylen == 1) \
831  { \
832  yychar = (Token); \
833  yylval = (Value); \
834  yytoken = YYTRANSLATE (yychar); \
835  YYPOPSTACK (1); \
836  goto yybackup; \
837  } \
838  else \
839  { \
840  yyerror (YY_("syntax error: cannot back up")); \
841  YYERROR; \
842  } \
843 while (YYID (0))
844 
845 
846 #define YYTERROR 1
847 #define YYERRCODE 256
848 
849 
850 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
851  If N is 0, then set CURRENT to the empty location which ends
852  the previous symbol: RHS[0] (always defined). */
853 
854 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
855 #ifndef YYLLOC_DEFAULT
856 # define YYLLOC_DEFAULT(Current, Rhs, N) \
857  do \
858  if (YYID (N)) \
859  { \
860  (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
861  (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
862  (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
863  (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
864  } \
865  else \
866  { \
867  (Current).first_line = (Current).last_line = \
868  YYRHSLOC (Rhs, 0).last_line; \
869  (Current).first_column = (Current).last_column = \
870  YYRHSLOC (Rhs, 0).last_column; \
871  } \
872  while (YYID (0))
873 #endif
874 
875 
876 /* YY_LOCATION_PRINT -- Print the location on the stream.
877  This macro was not mandated originally: define only if we know
878  we won't break user code: when these are the locations we know. */
879 
880 #ifndef YY_LOCATION_PRINT
881 # if YYLTYPE_IS_TRIVIAL
882 # define YY_LOCATION_PRINT(File, Loc) \
883  fprintf (File, "%d.%d-%d.%d", \
884  (Loc).first_line, (Loc).first_column, \
885  (Loc).last_line, (Loc).last_column)
886 # else
887 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
888 # endif
889 #endif
890 
891 
892 /* YYLEX -- calling `yylex' with the right arguments. */
893 
894 #ifdef YYLEX_PARAM
895 # define YYLEX yylex (YYLEX_PARAM)
896 #else
897 # define YYLEX yylex ()
898 #endif
899 
900 /* Enable debugging if requested. */
901 #if YYDEBUG
902 
903 # ifndef YYFPRINTF
904 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
905 # define YYFPRINTF fprintf
906 # endif
907 
908 # define YYDPRINTF(Args) \
909 do { \
910  if (yydebug) \
911  YYFPRINTF Args; \
912 } while (YYID (0))
913 
914 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
915 do { \
916  if (yydebug) \
917  { \
918  YYFPRINTF (stderr, "%s ", Title); \
919  yy_symbol_print (stderr, \
920  Type, Value); \
921  YYFPRINTF (stderr, "\n"); \
922  } \
923 } while (YYID (0))
924 
925 
926 /*--------------------------------.
927 | Print this symbol on YYOUTPUT. |
928 `--------------------------------*/
929 
930 /*ARGSUSED*/
931 #if (defined __STDC__ || defined __C99__FUNC__ \
932  || defined __cplusplus || defined _MSC_VER)
933 static void
934 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
935 #else
936 static void
937 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
938  FILE *yyoutput;
939  int yytype;
940  YYSTYPE const * const yyvaluep;
941 #endif
942 {
943  if (!yyvaluep)
944  return;
945 # ifdef YYPRINT
946  if (yytype < YYNTOKENS)
947  YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
948 # else
949  YYUSE (yyoutput);
950 # endif
951  switch (yytype)
952  {
953  default:
954  break;
955  }
956 }
957 
958 
959 /*--------------------------------.
960 | Print this symbol on YYOUTPUT. |
961 `--------------------------------*/
962 
963 #if (defined __STDC__ || defined __C99__FUNC__ \
964  || defined __cplusplus || defined _MSC_VER)
965 static void
966 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
967 #else
968 static void
969 yy_symbol_print (yyoutput, yytype, yyvaluep)
970  FILE *yyoutput;
971  int yytype;
972  YYSTYPE const * const yyvaluep;
973 #endif
974 {
975  if (yytype < YYNTOKENS)
976  YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
977  else
978  YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
979 
980  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
981  YYFPRINTF (yyoutput, ")");
982 }
983 
984 /*------------------------------------------------------------------.
985 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
986 | TOP (included). |
987 `------------------------------------------------------------------*/
988 
989 #if (defined __STDC__ || defined __C99__FUNC__ \
990  || defined __cplusplus || defined _MSC_VER)
991 static void
992 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
993 #else
994 static void
995 yy_stack_print (yybottom, yytop)
996  yytype_int16 *yybottom;
997  yytype_int16 *yytop;
998 #endif
999 {
1000  YYFPRINTF (stderr, "Stack now");
1001  for (; yybottom <= yytop; yybottom++)
1002  {
1003  int yybot = *yybottom;
1004  YYFPRINTF (stderr, " %d", yybot);
1005  }
1006  YYFPRINTF (stderr, "\n");
1007 }
1008 
1009 # define YY_STACK_PRINT(Bottom, Top) \
1010 do { \
1011  if (yydebug) \
1012  yy_stack_print ((Bottom), (Top)); \
1013 } while (YYID (0))
1014 
1015 
1016 /*------------------------------------------------.
1017 | Report that the YYRULE is going to be reduced. |
1018 `------------------------------------------------*/
1019 
1020 #if (defined __STDC__ || defined __C99__FUNC__ \
1021  || defined __cplusplus || defined _MSC_VER)
1022 static void
1023 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1024 #else
1025 static void
1026 yy_reduce_print (yyvsp, yyrule)
1027  YYSTYPE *yyvsp;
1028  int yyrule;
1029 #endif
1031  int yynrhs = yyr2[yyrule];
1032  int yyi;
1033  unsigned long int yylno = yyrline[yyrule];
1034  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1035  yyrule - 1, yylno);
1036  /* The symbols being reduced. */
1037  for (yyi = 0; yyi < yynrhs; yyi++)
1038  {
1039  YYFPRINTF (stderr, " $%d = ", yyi + 1);
1040  yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1041  &(yyvsp[(yyi + 1) - (yynrhs)])
1042  );
1043  YYFPRINTF (stderr, "\n");
1044  }
1045 }
1046 
1047 # define YY_REDUCE_PRINT(Rule) \
1048 do { \
1049  if (yydebug) \
1050  yy_reduce_print (yyvsp, Rule); \
1051 } while (YYID (0))
1052 
1053 /* Nonzero means print parse trace. It is left uninitialized so that
1054  multiple parsers can coexist. */
1056 #else /* !YYDEBUG */
1057 # define YYDPRINTF(Args)
1058 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1059 # define YY_STACK_PRINT(Bottom, Top)
1060 # define YY_REDUCE_PRINT(Rule)
1061 #endif /* !YYDEBUG */
1062 
1063 
1064 /* YYINITDEPTH -- initial size of the parser's stacks. */
1065 #ifndef YYINITDEPTH
1066 # define YYINITDEPTH 200
1067 #endif
1068 
1069 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1070  if the built-in stack extension method is used).
1071 
1072  Do not make this value too large; the results are undefined if
1073  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1074  evaluated with infinite-precision integer arithmetic. */
1075 
1076 #ifndef YYMAXDEPTH
1077 # define YYMAXDEPTH 10000
1078 #endif
1079 
1080 
1081 
1082 #if YYERROR_VERBOSE
1083 
1084 # ifndef yystrlen
1085 # if defined __GLIBC__ && defined _STRING_H
1086 # define yystrlen strlen
1087 # else
1088 /* Return the length of YYSTR. */
1089 #if (defined __STDC__ || defined __C99__FUNC__ \
1090  || defined __cplusplus || defined _MSC_VER)
1091 static YYSIZE_T
1092 yystrlen (const char *yystr)
1093 #else
1094 static YYSIZE_T
1095 yystrlen (yystr)
1096  const char *yystr;
1097 #endif
1098 {
1099  YYSIZE_T yylen;
1100  for (yylen = 0; yystr[yylen]; yylen++)
1101  continue;
1102  return yylen;
1103 }
1104 # endif
1105 # endif
1106 
1107 # ifndef yystpcpy
1108 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1109 # define yystpcpy stpcpy
1110 # else
1111 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1112  YYDEST. */
1113 #if (defined __STDC__ || defined __C99__FUNC__ \
1114  || defined __cplusplus || defined _MSC_VER)
1115 static char *
1116 yystpcpy (char *yydest, const char *yysrc)
1117 #else
1118 static char *
1119 yystpcpy (yydest, yysrc)
1120  char *yydest;
1121  const char *yysrc;
1122 #endif
1123 {
1124  char *yyd = yydest;
1125  const char *yys = yysrc;
1126 
1127  while ((*yyd++ = *yys++) != '\0')
1128  continue;
1129 
1130  return yyd - 1;
1131 }
1132 # endif
1133 # endif
1134 
1135 # ifndef yytnamerr
1136 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1137  quotes and backslashes, so that it's suitable for yyerror. The
1138  heuristic is that double-quoting is unnecessary unless the string
1139  contains an apostrophe, a comma, or backslash (other than
1140  backslash-backslash). YYSTR is taken from yytname. If YYRES is
1141  null, do not copy; instead, return the length of what the result
1142  would have been. */
1143 static YYSIZE_T
1144 yytnamerr (char *yyres, const char *yystr)
1145 {
1146  if (*yystr == '"')
1147  {
1148  YYSIZE_T yyn = 0;
1149  char const *yyp = yystr;
1150 
1151  for (;;)
1152  switch (*++yyp)
1153  {
1154  case '\'':
1155  case ',':
1156  goto do_not_strip_quotes;
1157 
1158  case '\\':
1159  if (*++yyp != '\\')
1160  goto do_not_strip_quotes;
1161  /* Fall through. */
1162  default:
1163  if (yyres)
1164  yyres[yyn] = *yyp;
1165  yyn++;
1166  break;
1167 
1168  case '"':
1169  if (yyres)
1170  yyres[yyn] = '\0';
1171  return yyn;
1172  }
1173  do_not_strip_quotes: ;
1174  }
1175 
1176  if (! yyres)
1177  return yystrlen (yystr);
1178 
1179  return yystpcpy (yyres, yystr) - yyres;
1180 }
1181 # endif
1182 
1183 /* Copy into YYRESULT an error message about the unexpected token
1184  YYCHAR while in state YYSTATE. Return the number of bytes copied,
1185  including the terminating null byte. If YYRESULT is null, do not
1186  copy anything; just return the number of bytes that would be
1187  copied. As a special case, return 0 if an ordinary "syntax error"
1188  message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1189  size calculation. */
1190 static YYSIZE_T
1191 yysyntax_error (char *yyresult, int yystate, int yychar)
1192 {
1193  int yyn = yypact[yystate];
1194 
1195  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1196  return 0;
1197  else
1198  {
1199  int yytype = YYTRANSLATE (yychar);
1200  YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1201  YYSIZE_T yysize = yysize0;
1202  YYSIZE_T yysize1;
1203  int yysize_overflow = 0;
1204  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1205  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1206  int yyx;
1207 
1208 # if 0
1209  /* This is so xgettext sees the translatable formats that are
1210  constructed on the fly. */
1211  YY_("syntax error, unexpected %s");
1212  YY_("syntax error, unexpected %s, expecting %s");
1213  YY_("syntax error, unexpected %s, expecting %s or %s");
1214  YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1215  YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1216 # endif
1217  char *yyfmt;
1218  char const *yyf;
1219  static char const yyunexpected[] = "syntax error, unexpected %s";
1220  static char const yyexpecting[] = ", expecting %s";
1221  static char const yyor[] = " or %s";
1222  char yyformat[sizeof yyunexpected
1223  + sizeof yyexpecting - 1
1224  + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1225  * (sizeof yyor - 1))];
1226  char const *yyprefix = yyexpecting;
1227 
1228  /* Start YYX at -YYN if negative to avoid negative indexes in
1229  YYCHECK. */
1230  int yyxbegin = yyn < 0 ? -yyn : 0;
1231 
1232  /* Stay within bounds of both yycheck and yytname. */
1233  int yychecklim = YYLAST - yyn + 1;
1234  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1235  int yycount = 1;
1236 
1237  yyarg[0] = yytname[yytype];
1238  yyfmt = yystpcpy (yyformat, yyunexpected);
1239 
1240  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1241  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1242  {
1243  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1244  {
1245  yycount = 1;
1246  yysize = yysize0;
1247  yyformat[sizeof yyunexpected - 1] = '\0';
1248  break;
1249  }
1250  yyarg[yycount++] = yytname[yyx];
1251  yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1252  yysize_overflow |= (yysize1 < yysize);
1253  yysize = yysize1;
1254  yyfmt = yystpcpy (yyfmt, yyprefix);
1255  yyprefix = yyor;
1256  }
1257 
1258  yyf = YY_(yyformat);
1259  yysize1 = yysize + yystrlen (yyf);
1260  yysize_overflow |= (yysize1 < yysize);
1261  yysize = yysize1;
1262 
1263  if (yysize_overflow)
1264  return YYSIZE_MAXIMUM;
1265 
1266  if (yyresult)
1267  {
1268  /* Avoid sprintf, as that infringes on the user's name space.
1269  Don't have undefined behavior even if the translation
1270  produced a string with the wrong number of "%s"s. */
1271  char *yyp = yyresult;
1272  int yyi = 0;
1273  while ((*yyp = *yyf) != '\0')
1274  {
1275  if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1276  {
1277  yyp += yytnamerr (yyp, yyarg[yyi++]);
1278  yyf += 2;
1279  }
1280  else
1281  {
1282  yyp++;
1283  yyf++;
1284  }
1285  }
1286  }
1287  return yysize;
1288  }
1289 }
1290 #endif /* YYERROR_VERBOSE */
1291 
1292 
1293 /*-----------------------------------------------.
1294 | Release the memory associated to this symbol. |
1295 `-----------------------------------------------*/
1296 
1297 /*ARGSUSED*/
1298 #if (defined __STDC__ || defined __C99__FUNC__ \
1299  || defined __cplusplus || defined _MSC_VER)
1300 static void
1301 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1302 #else
1303 static void
1304 yydestruct (yymsg, yytype, yyvaluep)
1305  const char *yymsg;
1306  int yytype;
1307  YYSTYPE *yyvaluep;
1308 #endif
1309 {
1310  YYUSE (yyvaluep);
1311 
1312  if (!yymsg)
1313  yymsg = "Deleting";
1314  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1315 
1316  switch (yytype)
1317  {
1318 
1319  default:
1320  break;
1321  }
1322 }
1323 
1324 /* Prevent warnings from -Wmissing-prototypes. */
1325 #ifdef YYPARSE_PARAM
1326 #if defined __STDC__ || defined __cplusplus
1327 int yyparse (void *YYPARSE_PARAM);
1328 #else
1329 int yyparse ();
1330 #endif
1331 #else /* ! YYPARSE_PARAM */
1332 #if defined __STDC__ || defined __cplusplus
1333 int yyparse (void);
1334 #else
1335 int yyparse ();
1336 #endif
1337 #endif /* ! YYPARSE_PARAM */
1338 
1339 
1340 /* The lookahead symbol. */
1342 
1343 /* The semantic value of the lookahead symbol. */
1345 
1346 /* Number of syntax errors so far. */
1348 
1349 
1350 
1351 /*-------------------------.
1352 | yyparse or yypush_parse. |
1353 `-------------------------*/
1354 
1355 #ifdef YYPARSE_PARAM
1356 #if (defined __STDC__ || defined __C99__FUNC__ \
1357  || defined __cplusplus || defined _MSC_VER)
1358 int
1359 yyparse (void *YYPARSE_PARAM)
1360 #else
1361 int
1362 yyparse (YYPARSE_PARAM)
1363  void *YYPARSE_PARAM;
1364 #endif
1365 #else /* ! YYPARSE_PARAM */
1366 #if (defined __STDC__ || defined __C99__FUNC__ \
1367  || defined __cplusplus || defined _MSC_VER)
1368 int
1369 yyparse (void)
1370 #else
1371 int
1372 yyparse ()
1373 
1374 #endif
1375 #endif
1376 {
1377 
1378 
1379  int yystate;
1380  /* Number of tokens to shift before error messages enabled. */
1381  int yyerrstatus;
1382 
1383  /* The stacks and their tools:
1384  `yyss': related to states.
1385  `yyvs': related to semantic values.
1386 
1387  Refer to the stacks thru separate pointers, to allow yyoverflow
1388  to reallocate them elsewhere. */
1389 
1390  /* The state stack. */
1391  yytype_int16 yyssa[YYINITDEPTH];
1392  yytype_int16 *yyss;
1393  yytype_int16 *yyssp;
1394 
1395  /* The semantic value stack. */
1396  YYSTYPE yyvsa[YYINITDEPTH];
1397  YYSTYPE *yyvs;
1398  YYSTYPE *yyvsp;
1399 
1400  YYSIZE_T yystacksize;
1401 
1402  int yyn;
1403  int yyresult;
1404  /* Lookahead token as an internal (translated) token number. */
1405  int yytoken;
1406  /* The variables used to return semantic value and location from the
1407  action routines. */
1408  YYSTYPE yyval;
1409 
1410 #if YYERROR_VERBOSE
1411  /* Buffer for error messages, and its allocated size. */
1412  char yymsgbuf[128];
1413  char *yymsg = yymsgbuf;
1414  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1415 #endif
1416 
1417 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1418 
1419  /* The number of symbols on the RHS of the reduced rule.
1420  Keep to zero when no symbol should be popped. */
1421  int yylen = 0;
1422 
1423  yytoken = 0;
1424  yyss = yyssa;
1425  yyvs = yyvsa;
1426  yystacksize = YYINITDEPTH;
1427 
1428  YYDPRINTF ((stderr, "Starting parse\n"));
1429 
1430  yystate = 0;
1431  yyerrstatus = 0;
1432  yynerrs = 0;
1433  yychar = YYEMPTY; /* Cause a token to be read. */
1434 
1435  /* Initialize stack pointers.
1436  Waste one element of value and location stack
1437  so that they stay on the same level as the state stack.
1438  The wasted elements are never initialized. */
1439  yyssp = yyss;
1440  yyvsp = yyvs;
1441 
1442  goto yysetstate;
1443 
1444 /*------------------------------------------------------------.
1445 | yynewstate -- Push a new state, which is found in yystate. |
1446 `------------------------------------------------------------*/
1447  yynewstate:
1448  /* In all cases, when you get here, the value and location stacks
1449  have just been pushed. So pushing a state here evens the stacks. */
1450  yyssp++;
1451 
1452  yysetstate:
1453  *yyssp = yystate;
1454 
1455  if (yyss + yystacksize - 1 <= yyssp)
1456  {
1457  /* Get the current used size of the three stacks, in elements. */
1458  YYSIZE_T yysize = yyssp - yyss + 1;
1459 
1460 #ifdef yyoverflow
1461  {
1462  /* Give user a chance to reallocate the stack. Use copies of
1463  these so that the &'s don't force the real ones into
1464  memory. */
1465  YYSTYPE *yyvs1 = yyvs;
1466  yytype_int16 *yyss1 = yyss;
1467 
1468  /* Each stack pointer address is followed by the size of the
1469  data in use in that stack, in bytes. This used to be a
1470  conditional around just the two extra args, but that might
1471  be undefined if yyoverflow is a macro. */
1472  yyoverflow (YY_("memory exhausted"),
1473  &yyss1, yysize * sizeof (*yyssp),
1474  &yyvs1, yysize * sizeof (*yyvsp),
1475  &yystacksize);
1476 
1477  yyss = yyss1;
1478  yyvs = yyvs1;
1479  }
1480 #else /* no yyoverflow */
1481 # ifndef YYSTACK_RELOCATE
1482  goto yyexhaustedlab;
1483 # else
1484  /* Extend the stack our own way. */
1485  if (YYMAXDEPTH <= yystacksize)
1486  goto yyexhaustedlab;
1487  yystacksize *= 2;
1488  if (YYMAXDEPTH < yystacksize)
1489  yystacksize = YYMAXDEPTH;
1490 
1491  {
1492  yytype_int16 *yyss1 = yyss;
1493  union yyalloc *yyptr =
1494  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1495  if (! yyptr)
1496  goto yyexhaustedlab;
1497  YYSTACK_RELOCATE (yyss_alloc, yyss);
1498  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1499 # undef YYSTACK_RELOCATE
1500  if (yyss1 != yyssa)
1501  YYSTACK_FREE (yyss1);
1502  }
1503 # endif
1504 #endif /* no yyoverflow */
1505 
1506  yyssp = yyss + yysize - 1;
1507  yyvsp = yyvs + yysize - 1;
1508 
1509  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1510  (unsigned long int) yystacksize));
1511 
1512  if (yyss + yystacksize - 1 <= yyssp)
1513  YYABORT;
1514  }
1515 
1516  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1517 
1518  if (yystate == YYFINAL)
1519  YYACCEPT;
1520 
1521  goto yybackup;
1522 
1523 /*-----------.
1524 | yybackup. |
1525 `-----------*/
1526 yybackup:
1527 
1528  /* Do appropriate processing given the current state. Read a
1529  lookahead token if we need one and don't already have one. */
1530 
1531  /* First try to decide what to do without reference to lookahead token. */
1532  yyn = yypact[yystate];
1533  if (yyn == YYPACT_NINF)
1534  goto yydefault;
1535 
1536  /* Not known => get a lookahead token if don't already have one. */
1537 
1538  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1539  if (yychar == YYEMPTY)
1540  {
1541  YYDPRINTF ((stderr, "Reading a token: "));
1542  yychar = YYLEX;
1543  }
1544 
1545  if (yychar <= YYEOF)
1546  {
1547  yychar = yytoken = YYEOF;
1548  YYDPRINTF ((stderr, "Now at end of input.\n"));
1549  }
1550  else
1551  {
1552  yytoken = YYTRANSLATE (yychar);
1553  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1554  }
1555 
1556  /* If the proper action on seeing token YYTOKEN is to reduce or to
1557  detect an error, take that action. */
1558  yyn += yytoken;
1559  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1560  goto yydefault;
1561  yyn = yytable[yyn];
1562  if (yyn <= 0)
1563  {
1564  if (yyn == 0 || yyn == YYTABLE_NINF)
1565  goto yyerrlab;
1566  yyn = -yyn;
1567  goto yyreduce;
1568  }
1569 
1570  /* Count tokens shifted since error; after three, turn off error
1571  status. */
1572  if (yyerrstatus)
1573  yyerrstatus--;
1574 
1575  /* Shift the lookahead token. */
1576  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1577 
1578  /* Discard the shifted token. */
1579  yychar = YYEMPTY;
1580 
1581  yystate = yyn;
1582  *++yyvsp = yylval;
1583 
1584  goto yynewstate;
1585 
1586 
1587 /*-----------------------------------------------------------.
1588 | yydefault -- do the default action for the current state. |
1589 `-----------------------------------------------------------*/
1590 yydefault:
1591  yyn = yydefact[yystate];
1592  if (yyn == 0)
1593  goto yyerrlab;
1594  goto yyreduce;
1595 
1596 
1597 /*-----------------------------.
1598 | yyreduce -- Do a reduction. |
1599 `-----------------------------*/
1600 yyreduce:
1601  /* yyn is the number of a rule to reduce with. */
1602  yylen = yyr2[yyn];
1603 
1604  /* If YYLEN is nonzero, implement the default value of the action:
1605  `$$ = $1'.
1606 
1607  Otherwise, the following line sets YYVAL to garbage.
1608  This behavior is undocumented and Bison
1609  users should not rely upon it. Assigning to YYVAL
1610  unconditionally makes the parser a bit smaller, and it avoids a
1611  GCC warning that YYVAL may be used uninitialized. */
1612  yyval = yyvsp[1-yylen];
1613 
1614 
1615  YY_REDUCE_PRINT (yyn);
1616  switch (yyn)
1617  {
1618  case 2:
1619 
1620 /* Line 1455 of yacc.c */
1621 #line 120 "parse_netlist.y"
1622  {
1623  definition_root = (yyvsp[(1) - (1)].definition);
1624  }
1625  break;
1626 
1627  case 3:
1628 
1629 /* Line 1455 of yacc.c */
1630 #line 125 "parse_netlist.y"
1631  { (yyval.definition) = NULL; }
1632  break;
1633 
1634  case 4:
1635 
1636 /* Line 1455 of yacc.c */
1637 #line 126 "parse_netlist.y"
1638  {
1639  if ((yyvsp[(1) - (2)].definition)) {
1640  (yyvsp[(1) - (2)].definition)->next = (yyvsp[(2) - (2)].definition);
1641  (yyval.definition) = (yyvsp[(1) - (2)].definition);
1642  } else {
1643  (yyval.definition) = (yyvsp[(2) - (2)].definition);
1644  }
1645  }
1646  break;
1647 
1648  case 5:
1649 
1650 /* Line 1455 of yacc.c */
1651 #line 137 "parse_netlist.y"
1652  {
1653  (yyval.definition) = (yyvsp[(1) - (1)].subcircuit);
1654  }
1655  break;
1656 
1657  case 9:
1658 
1659 /* Line 1455 of yacc.c */
1660 #line 143 "parse_netlist.y"
1661  {
1662  (yyval.definition) = NULL;
1663  }
1664  break;
1665 
1666  case 10:
1667 
1668 /* Line 1455 of yacc.c */
1669 #line 149 "parse_netlist.y"
1670  {
1671  (yyval.definition) = (struct definition_t *) calloc (sizeof (struct definition_t), 1);
1672  (yyval.definition)->action = PROP_ACTION;
1673  (yyval.definition)->type = (yyvsp[(2) - (6)].ident);
1674  (yyval.definition)->instance = (yyvsp[(4) - (6)].ident);
1675  (yyval.definition)->pairs = (yyvsp[(5) - (6)].pair);
1676  (yyval.definition)->line = netlist_lineno;
1677  }
1678  break;
1679 
1680  case 11:
1681 
1682 /* Line 1455 of yacc.c */
1683 #line 160 "parse_netlist.y"
1684  {
1685  (yyval.definition) = (struct definition_t *) calloc (sizeof (struct definition_t), 1);
1686  (yyval.definition)->action = PROP_COMPONENT;
1687  (yyval.definition)->type = (yyvsp[(1) - (6)].ident);
1688  (yyval.definition)->instance = (yyvsp[(3) - (6)].ident);
1689  (yyval.definition)->nodes = (yyvsp[(4) - (6)].node);
1690  (yyval.definition)->pairs = (yyvsp[(5) - (6)].pair);
1691  (yyval.definition)->line = netlist_lineno;
1692  }
1693  break;
1694 
1695  case 12:
1696 
1697 /* Line 1455 of yacc.c */
1698 #line 172 "parse_netlist.y"
1699  { (yyval.ident) = (yyvsp[(1) - (1)].ident); }
1700  break;
1701 
1702  case 13:
1703 
1704 /* Line 1455 of yacc.c */
1705 #line 173 "parse_netlist.y"
1706  { (yyval.ident) = (yyvsp[(1) - (1)].str); }
1707  break;
1708 
1709  case 14:
1710 
1711 /* Line 1455 of yacc.c */
1712 #line 177 "parse_netlist.y"
1713  { (yyval.ident) = (yyvsp[(1) - (1)].ident); }
1714  break;
1715 
1716  case 15:
1717 
1718 /* Line 1455 of yacc.c */
1719 #line 178 "parse_netlist.y"
1720  { (yyval.ident) = (yyvsp[(1) - (1)].str); }
1721  break;
1722 
1723  case 16:
1724 
1725 /* Line 1455 of yacc.c */
1726 #line 181 "parse_netlist.y"
1727  { (yyval.node) = NULL; }
1728  break;
1729 
1730  case 17:
1731 
1732 /* Line 1455 of yacc.c */
1733 #line 182 "parse_netlist.y"
1734  {
1735  (yyval.node) = (struct node_t *) calloc (sizeof (struct node_t), 1);
1736  (yyval.node)->node = (yyvsp[(1) - (2)].ident);
1737  (yyval.node)->next = (yyvsp[(2) - (2)].node);
1738  }
1739  break;
1740 
1741  case 18:
1742 
1743 /* Line 1455 of yacc.c */
1744 #line 189 "parse_netlist.y"
1745  { (yyval.pair) = NULL; }
1746  break;
1747 
1748  case 19:
1749 
1750 /* Line 1455 of yacc.c */
1751 #line 190 "parse_netlist.y"
1752  {
1753  (yyval.pair) = (struct pair_t *) calloc (sizeof (struct pair_t), 1);
1754  (yyval.pair)->key = (yyvsp[(1) - (3)].ident);
1755  (yyval.pair)->value = (yyvsp[(2) - (3)].value);
1756  (yyval.pair)->next = (yyvsp[(3) - (3)].pair);
1757  }
1758  break;
1759 
1760  case 20:
1761 
1762 /* Line 1455 of yacc.c */
1763 #line 196 "parse_netlist.y"
1764  {
1765  if (0) {
1766  (yyval.pair) = (struct pair_t *) calloc (sizeof (struct pair_t), 1);
1767  (yyval.pair)->key = (yyvsp[(1) - (3)].ident);
1768  (yyval.pair)->value = NULL;
1769  (yyval.pair)->next = (yyvsp[(3) - (3)].pair);
1770  } else {
1771  free ((yyvsp[(1) - (3)].ident));
1772  (yyval.pair) = (yyvsp[(3) - (3)].pair);
1773  }
1774  }
1775  break;
1776 
1777  case 21:
1778 
1779 /* Line 1455 of yacc.c */
1780 #line 209 "parse_netlist.y"
1781  { /* nothing */ }
1782  break;
1783 
1784  case 22:
1785 
1786 /* Line 1455 of yacc.c */
1787 #line 210 "parse_netlist.y"
1788  { /* also nothing */ }
1789  break;
1790 
1791  case 23:
1792 
1793 /* Line 1455 of yacc.c */
1794 #line 214 "parse_netlist.y"
1795  {
1796  (yyval.value) = (yyvsp[(1) - (1)].value);
1797  }
1798  break;
1799 
1800  case 24:
1801 
1802 /* Line 1455 of yacc.c */
1803 #line 217 "parse_netlist.y"
1804  {
1805  (yyval.value) = (yyvsp[(2) - (3)].value);
1806  }
1807  break;
1808 
1809  case 25:
1810 
1811 /* Line 1455 of yacc.c */
1812 #line 223 "parse_netlist.y"
1813  {
1814  (yyval.value) = create_value ();
1815  (yyval.value)->value = (yyvsp[(1) - (1)].d);
1816  }
1817  break;
1818 
1819  case 26:
1820 
1821 /* Line 1455 of yacc.c */
1822 #line 227 "parse_netlist.y"
1823  {
1824  (yyval.value) = create_value ();
1825  (yyval.value)->value = (yyvsp[(1) - (2)].d);
1826  (yyval.value)->scale = (yyvsp[(2) - (2)].str);
1827  }
1828  break;
1829 
1830  case 27:
1831 
1832 /* Line 1455 of yacc.c */
1833 #line 232 "parse_netlist.y"
1834  {
1835  (yyval.value) = create_value ();
1836  (yyval.value)->value = (yyvsp[(1) - (3)].d);
1837  (yyval.value)->scale = (yyvsp[(2) - (3)].str);
1838  (yyval.value)->unit = (yyvsp[(3) - (3)].str);
1839  }
1840  break;
1841 
1842  case 28:
1843 
1844 /* Line 1455 of yacc.c */
1845 #line 241 "parse_netlist.y"
1846  {
1847  (yyval.value) = (yyvsp[(1) - (1)].value);
1848  }
1849  break;
1850 
1851  case 29:
1852 
1853 /* Line 1455 of yacc.c */
1854 #line 244 "parse_netlist.y"
1855  {
1856  (yyval.value) = create_value ();
1857  (yyval.value)->ident = (yyvsp[(1) - (1)].ident);
1858  }
1859  break;
1860 
1861  case 30:
1862 
1863 /* Line 1455 of yacc.c */
1864 #line 248 "parse_netlist.y"
1865  {
1866  (yyval.value) = create_value ();
1867  (yyval.value)->ident = (yyvsp[(2) - (3)].ident);
1868  }
1869  break;
1870 
1871  case 31:
1872 
1873 /* Line 1455 of yacc.c */
1874 #line 252 "parse_netlist.y"
1875  {
1876  (yyval.value) = (yyvsp[(2) - (3)].value);
1877  }
1878  break;
1879 
1880  case 32:
1881 
1882 /* Line 1455 of yacc.c */
1883 #line 257 "parse_netlist.y"
1884  { (yyval.value) = NULL; }
1885  break;
1886 
1887  case 33:
1888 
1889 /* Line 1455 of yacc.c */
1890 #line 258 "parse_netlist.y"
1891  {
1892  (yyvsp[(1) - (1)].value)->next = NULL;
1893  (yyval.value) = (yyvsp[(1) - (1)].value);
1894  }
1895  break;
1896 
1897  case 34:
1898 
1899 /* Line 1455 of yacc.c */
1900 #line 262 "parse_netlist.y"
1901  {
1902  (yyvsp[(1) - (3)].value)->next = (yyvsp[(3) - (3)].value);
1903  (yyval.value) = (yyvsp[(1) - (3)].value);
1904  }
1905  break;
1906 
1907  case 35:
1908 
1909 /* Line 1455 of yacc.c */
1910 #line 269 "parse_netlist.y"
1911  {
1912  /* create equation definition */
1913  (yyval.definition) = (struct definition_t *) calloc (sizeof (struct definition_t), 1);
1914  (yyval.definition)->type = strdup ("Eqn");
1915  (yyval.definition)->instance = (yyvsp[(3) - (6)].ident);
1916  (yyval.definition)->action = PROP_ACTION;
1917  (yyval.definition)->line = netlist_lineno;
1918  (yyvsp[(4) - (6)].assign)->setInstance ((yyvsp[(3) - (6)].ident));
1919  (yyvsp[(4) - (6)].assign)->setNext ((yyvsp[(5) - (6)].eqn));
1920  (yyvsp[(4) - (6)].assign)->applyInstance ();
1921  (yyval.definition)->eqns = (yyvsp[(4) - (6)].assign);
1922  }
1923  break;
1924 
1925  case 36:
1926 
1927 /* Line 1455 of yacc.c */
1928 #line 283 "parse_netlist.y"
1929  { (yyval.eqn) = NULL; }
1930  break;
1931 
1932  case 37:
1933 
1934 /* Line 1455 of yacc.c */
1935 #line 284 "parse_netlist.y"
1936  {
1937  (yyvsp[(1) - (2)].assign)->setNext ((yyvsp[(2) - (2)].eqn));
1938  (yyval.eqn) = (yyvsp[(1) - (2)].assign);
1939  }
1940  break;
1941 
1942  case 38:
1943 
1944 /* Line 1455 of yacc.c */
1945 #line 291 "parse_netlist.y"
1946  {
1947  (yyval.assign) = new eqn::assignment ();
1948  (yyval.assign)->result = (yyvsp[(1) - (4)].ident);
1949  (yyval.assign)->body = (yyvsp[(3) - (4)].eqn);
1950  }
1951  break;
1952 
1953  case 39:
1954 
1955 /* Line 1455 of yacc.c */
1956 #line 299 "parse_netlist.y"
1957  {
1958  (yyval.eqn) = (yyvsp[(1) - (1)].con);
1959  }
1960  break;
1961 
1962  case 40:
1963 
1964 /* Line 1455 of yacc.c */
1965 #line 302 "parse_netlist.y"
1966  {
1967  (yyval.eqn) = (yyvsp[(1) - (1)].ref);
1968  }
1969  break;
1970 
1971  case 41:
1972 
1973 /* Line 1455 of yacc.c */
1974 #line 305 "parse_netlist.y"
1975  {
1976  (yyval.eqn) = (yyvsp[(1) - (1)].app);
1977  }
1978  break;
1979 
1980  case 42:
1981 
1982 /* Line 1455 of yacc.c */
1983 #line 308 "parse_netlist.y"
1984  {
1985  (yyval.eqn) = (yyvsp[(2) - (3)].eqn);
1986  }
1987  break;
1988 
1989  case 43:
1990 
1991 /* Line 1455 of yacc.c */
1992 #line 311 "parse_netlist.y"
1993  {
1994  (yyval.eqn) = (yyvsp[(2) - (3)].app);
1995  }
1996  break;
1997 
1998  case 44:
1999 
2000 /* Line 1455 of yacc.c */
2001 #line 314 "parse_netlist.y"
2002  {
2003  (yyval.eqn) = (yyvsp[(2) - (3)].app);
2004  }
2005  break;
2006 
2007  case 45:
2008 
2009 /* Line 1455 of yacc.c */
2010 #line 320 "parse_netlist.y"
2011  {
2012  (yyvsp[(1) - (2)].eqn)->appendNodes ((yyvsp[(2) - (2)].eqn));
2013  (yyval.eqn) = (yyvsp[(1) - (2)].eqn);
2014  }
2015  break;
2016 
2017  case 46:
2018 
2019 /* Line 1455 of yacc.c */
2020 #line 326 "parse_netlist.y"
2021  { (yyval.eqn) = NULL; }
2022  break;
2023 
2024  case 47:
2025 
2026 /* Line 1455 of yacc.c */
2027 #line 327 "parse_netlist.y"
2028  {
2029  (yyvsp[(2) - (3)].eqn)->appendNodes ((yyvsp[(3) - (3)].eqn));
2030  (yyval.eqn) = (yyvsp[(2) - (3)].eqn);
2031  }
2032  break;
2033 
2034  case 49:
2035 
2036 /* Line 1455 of yacc.c */
2037 #line 338 "parse_netlist.y"
2038  {
2039  (yyval.app) = new eqn::application ();
2040  (yyval.app)->n = strdup ("vector");
2041  (yyval.app)->nargs = (yyvsp[(1) - (1)].eqn)->count ();
2042  (yyval.app)->args = (yyvsp[(1) - (1)].eqn);
2043  }
2044  break;
2045 
2046  case 50:
2047 
2048 /* Line 1455 of yacc.c */
2049 #line 346 "parse_netlist.y"
2050  { (yyval.eqn) = NULL; }
2051  break;
2052 
2053  case 51:
2054 
2055 /* Line 1455 of yacc.c */
2056 #line 347 "parse_netlist.y"
2057  {
2059  c->chr = ';';
2060  c->appendNodes ((yyvsp[(2) - (3)].eqn));
2061  (yyvsp[(2) - (3)].eqn)->appendNodes ((yyvsp[(3) - (3)].eqn));
2062  (yyval.eqn) = c;
2063  }
2064  break;
2065 
2066  case 52:
2067 
2068 /* Line 1455 of yacc.c */
2069 #line 357 "parse_netlist.y"
2070  {
2072  c->chr = ';';
2073  c->appendNodes ((yyvsp[(3) - (4)].eqn));
2074  (yyvsp[(3) - (4)].eqn)->appendNodes ((yyvsp[(4) - (4)].eqn));
2075  (yyvsp[(1) - (4)].eqn)->appendNodes (c);
2076  (yyval.eqn) = (yyvsp[(1) - (4)].eqn);
2077  }
2078  break;
2079 
2080  case 53:
2081 
2082 /* Line 1455 of yacc.c */
2083 #line 368 "parse_netlist.y"
2084  {
2085  (yyval.app) = new eqn::application ();
2086  (yyval.app)->n = strdup ("matrix");
2087  (yyval.app)->nargs = (yyvsp[(1) - (1)].eqn)->count ();
2088  (yyval.app)->args = (yyvsp[(1) - (1)].eqn);
2089  }
2090  break;
2091 
2092  case 54:
2093 
2094 /* Line 1455 of yacc.c */
2095 #line 377 "parse_netlist.y"
2096  {
2097  (yyval.con) = new eqn::constant (eqn::TAG_DOUBLE);
2098  (yyval.con)->d = (yyvsp[(1) - (1)].d);
2099  }
2100  break;
2101 
2102  case 55:
2103 
2104 /* Line 1455 of yacc.c */
2105 #line 381 "parse_netlist.y"
2106  {
2107  (yyval.con) = new eqn::constant (eqn::TAG_COMPLEX);
2108  (yyval.con)->c = new nr_complex_t (0.0, (yyvsp[(1) - (1)].d));
2109  }
2110  break;
2111 
2112  case 56:
2113 
2114 /* Line 1455 of yacc.c */
2115 #line 385 "parse_netlist.y"
2116  {
2117  (yyval.con) = new eqn::constant (eqn::TAG_CHAR);
2118  (yyval.con)->chr = (yyvsp[(1) - (1)].chr);
2119  }
2120  break;
2121 
2122  case 57:
2123 
2124 /* Line 1455 of yacc.c */
2125 #line 389 "parse_netlist.y"
2126  {
2127  (yyval.con) = new eqn::constant (eqn::TAG_STRING);
2128  (yyval.con)->s = (yyvsp[(1) - (1)].str);
2129  }
2130  break;
2131 
2132  case 58:
2133 
2134 /* Line 1455 of yacc.c */
2135 #line 396 "parse_netlist.y"
2136  {
2137  (yyval.app) = new eqn::application ();
2138  (yyval.app)->n = strdup ("range");
2139  (yyval.app)->nargs = 2;
2140  (yyvsp[(1) - (3)].eqn)->append ((yyvsp[(3) - (3)].eqn));
2141  (yyval.app)->args = (yyvsp[(1) - (3)].eqn);
2142  }
2143  break;
2144 
2145  case 59:
2146 
2147 /* Line 1455 of yacc.c */
2148 #line 403 "parse_netlist.y"
2149  {
2150  (yyval.app) = new eqn::application ();
2151  (yyval.app)->n = strdup ("range");
2152  (yyval.app)->nargs = 2;
2154  c->chr = '?';
2155  c->append ((yyvsp[(2) - (2)].eqn));
2156  (yyval.app)->args = c;
2157  }
2158  break;
2159 
2160  case 60:
2161 
2162 /* Line 1455 of yacc.c */
2163 #line 412 "parse_netlist.y"
2164  {
2165  (yyval.app) = new eqn::application ();
2166  (yyval.app)->n = strdup ("range");
2167  (yyval.app)->nargs = 2;
2169  c->chr = '?';
2170  (yyvsp[(1) - (2)].eqn)->append (c);
2171  (yyval.app)->args = (yyvsp[(1) - (2)].eqn);
2172  }
2173  break;
2174 
2175  case 61:
2176 
2177 /* Line 1455 of yacc.c */
2178 #line 421 "parse_netlist.y"
2179  {
2180  (yyval.app) = new eqn::application ();
2181  (yyval.app)->n = strdup ("range");
2182  (yyval.app)->nargs = 2;
2185  c1->chr = '?';
2186  c2->chr = '?';
2187  c1->append (c2);
2188  (yyval.app)->args = c1;
2189  }
2190  break;
2191 
2192  case 62:
2193 
2194 /* Line 1455 of yacc.c */
2195 #line 435 "parse_netlist.y"
2196  {
2197  (yyval.ref) = new eqn::reference ();
2198  (yyval.ref)->n = (yyvsp[(1) - (1)].ident);
2199  }
2200  break;
2201 
2202  case 63:
2203 
2204 /* Line 1455 of yacc.c */
2205 #line 442 "parse_netlist.y"
2206  {
2207  (yyval.app) = new eqn::application ();
2208  (yyval.app)->n = (yyvsp[(1) - (4)].ident);
2209  (yyval.app)->nargs = (yyvsp[(3) - (4)].eqn)->count ();
2210  (yyval.app)->args = (yyvsp[(3) - (4)].eqn);
2211  }
2212  break;
2213 
2214  case 64:
2215 
2216 /* Line 1455 of yacc.c */
2217 #line 448 "parse_netlist.y"
2218  {
2219  (yyval.app) = new eqn::application ();
2220  (yyval.app)->n = strdup ("array");
2221  (yyval.app)->nargs = 1 + (yyvsp[(3) - (4)].eqn)->count ();
2222  (yyvsp[(1) - (4)].ref)->setNext ((yyvsp[(3) - (4)].eqn));
2223  (yyval.app)->args = (yyvsp[(1) - (4)].ref);
2224  }
2225  break;
2226 
2227  case 65:
2228 
2229 /* Line 1455 of yacc.c */
2230 #line 455 "parse_netlist.y"
2231  {
2232  (yyval.app) = new eqn::application ();
2233  (yyval.app)->n = strdup ("+");
2234  (yyval.app)->nargs = 2;
2235  (yyvsp[(1) - (3)].eqn)->append ((yyvsp[(3) - (3)].eqn));
2236  (yyval.app)->args = (yyvsp[(1) - (3)].eqn);
2237  }
2238  break;
2239 
2240  case 66:
2241 
2242 /* Line 1455 of yacc.c */
2243 #line 462 "parse_netlist.y"
2244  {
2245  (yyval.app) = new eqn::application ();
2246  (yyval.app)->n = strdup ("-");
2247  (yyval.app)->nargs = 2;
2248  (yyvsp[(1) - (3)].eqn)->append ((yyvsp[(3) - (3)].eqn));
2249  (yyval.app)->args = (yyvsp[(1) - (3)].eqn);
2250  }
2251  break;
2252 
2253  case 67:
2254 
2255 /* Line 1455 of yacc.c */
2256 #line 469 "parse_netlist.y"
2257  {
2258  (yyval.app) = new eqn::application ();
2259  (yyval.app)->n = strdup ("*");
2260  (yyval.app)->nargs = 2;
2261  (yyvsp[(1) - (3)].eqn)->append ((yyvsp[(3) - (3)].eqn));
2262  (yyval.app)->args = (yyvsp[(1) - (3)].eqn);
2263  }
2264  break;
2265 
2266  case 68:
2267 
2268 /* Line 1455 of yacc.c */
2269 #line 476 "parse_netlist.y"
2270  {
2271  (yyval.app) = new eqn::application ();
2272  (yyval.app)->n = strdup ("/");
2273  (yyval.app)->nargs = 2;
2274  (yyvsp[(1) - (3)].eqn)->append ((yyvsp[(3) - (3)].eqn));
2275  (yyval.app)->args = (yyvsp[(1) - (3)].eqn);
2276  }
2277  break;
2278 
2279  case 69:
2280 
2281 /* Line 1455 of yacc.c */
2282 #line 483 "parse_netlist.y"
2283  {
2284  (yyval.app) = new eqn::application ();
2285  (yyval.app)->n = strdup ("%");
2286  (yyval.app)->nargs = 2;
2287  (yyvsp[(1) - (3)].eqn)->append ((yyvsp[(3) - (3)].eqn));
2288  (yyval.app)->args = (yyvsp[(1) - (3)].eqn);
2289  }
2290  break;
2291 
2292  case 70:
2293 
2294 /* Line 1455 of yacc.c */
2295 #line 490 "parse_netlist.y"
2296  {
2297  (yyval.app) = new eqn::application ();
2298  (yyval.app)->n = strdup ("+");
2299  (yyval.app)->nargs = 1;
2300  (yyval.app)->args = (yyvsp[(2) - (2)].eqn);
2301  }
2302  break;
2303 
2304  case 71:
2305 
2306 /* Line 1455 of yacc.c */
2307 #line 496 "parse_netlist.y"
2308  {
2309  (yyval.app) = new eqn::application ();
2310  (yyval.app)->n = strdup ("-");
2311  (yyval.app)->nargs = 1;
2312  (yyval.app)->args = (yyvsp[(2) - (2)].eqn);
2313  }
2314  break;
2315 
2316  case 72:
2317 
2318 /* Line 1455 of yacc.c */
2319 #line 502 "parse_netlist.y"
2320  {
2321  (yyval.app) = new eqn::application ();
2322  (yyval.app)->n = strdup ("^");
2323  (yyval.app)->nargs = 2;
2324  (yyvsp[(1) - (3)].eqn)->append ((yyvsp[(3) - (3)].eqn));
2325  (yyval.app)->args = (yyvsp[(1) - (3)].eqn);
2326  }
2327  break;
2328 
2329  case 73:
2330 
2331 /* Line 1455 of yacc.c */
2332 #line 509 "parse_netlist.y"
2333  {
2334  (yyval.app) = new eqn::application ();
2335  (yyval.app)->n = strdup ("?:");
2336  (yyval.app)->nargs = 3;
2337  (yyvsp[(1) - (5)].eqn)->append ((yyvsp[(3) - (5)].eqn));
2338  (yyvsp[(1) - (5)].eqn)->append ((yyvsp[(5) - (5)].eqn));
2339  (yyval.app)->args = (yyvsp[(1) - (5)].eqn);
2340  }
2341  break;
2342 
2343  case 74:
2344 
2345 /* Line 1455 of yacc.c */
2346 #line 517 "parse_netlist.y"
2347  {
2348  (yyval.app) = new eqn::application ();
2349  (yyval.app)->n = strdup ("<");
2350  (yyval.app)->nargs = 2;
2351  (yyvsp[(1) - (3)].eqn)->append ((yyvsp[(3) - (3)].eqn));
2352  (yyval.app)->args = (yyvsp[(1) - (3)].eqn);
2353  }
2354  break;
2355 
2356  case 75:
2357 
2358 /* Line 1455 of yacc.c */
2359 #line 524 "parse_netlist.y"
2360  {
2361  (yyval.app) = new eqn::application ();
2362  (yyval.app)->n = strdup (">");
2363  (yyval.app)->nargs = 2;
2364  (yyvsp[(1) - (3)].eqn)->append ((yyvsp[(3) - (3)].eqn));
2365  (yyval.app)->args = (yyvsp[(1) - (3)].eqn);
2366  }
2367  break;
2368 
2369  case 76:
2370 
2371 /* Line 1455 of yacc.c */
2372 #line 531 "parse_netlist.y"
2373  {
2374  (yyval.app) = new eqn::application ();
2375  (yyval.app)->n = strdup (">=");
2376  (yyval.app)->nargs = 2;
2377  (yyvsp[(1) - (3)].eqn)->append ((yyvsp[(3) - (3)].eqn));
2378  (yyval.app)->args = (yyvsp[(1) - (3)].eqn);
2379  }
2380  break;
2381 
2382  case 77:
2383 
2384 /* Line 1455 of yacc.c */
2385 #line 538 "parse_netlist.y"
2386  {
2387  (yyval.app) = new eqn::application ();
2388  (yyval.app)->n = strdup ("<=");
2389  (yyval.app)->nargs = 2;
2390  (yyvsp[(1) - (3)].eqn)->append ((yyvsp[(3) - (3)].eqn));
2391  (yyval.app)->args = (yyvsp[(1) - (3)].eqn);
2392  }
2393  break;
2394 
2395  case 78:
2396 
2397 /* Line 1455 of yacc.c */
2398 #line 545 "parse_netlist.y"
2399  {
2400  (yyval.app) = new eqn::application ();
2401  (yyval.app)->n = strdup ("==");
2402  (yyval.app)->nargs = 2;
2403  (yyvsp[(1) - (3)].eqn)->append ((yyvsp[(3) - (3)].eqn));
2404  (yyval.app)->args = (yyvsp[(1) - (3)].eqn);
2405  }
2406  break;
2407 
2408  case 79:
2409 
2410 /* Line 1455 of yacc.c */
2411 #line 552 "parse_netlist.y"
2412  {
2413  (yyval.app) = new eqn::application ();
2414  (yyval.app)->n = strdup ("!=");
2415  (yyval.app)->nargs = 2;
2416  (yyvsp[(1) - (3)].eqn)->append ((yyvsp[(3) - (3)].eqn));
2417  (yyval.app)->args = (yyvsp[(1) - (3)].eqn);
2418  }
2419  break;
2420 
2421  case 80:
2422 
2423 /* Line 1455 of yacc.c */
2424 #line 559 "parse_netlist.y"
2425  {
2426  (yyval.app) = new eqn::application ();
2427  (yyval.app)->n = strdup ("!");
2428  (yyval.app)->nargs = 1;
2429  (yyval.app)->args = (yyvsp[(2) - (2)].eqn);
2430  }
2431  break;
2432 
2433  case 81:
2434 
2435 /* Line 1455 of yacc.c */
2436 #line 565 "parse_netlist.y"
2437  {
2438  (yyval.app) = new eqn::application ();
2439  (yyval.app)->n = strdup ("&&");
2440  (yyval.app)->nargs = 2;
2441  (yyvsp[(1) - (3)].eqn)->append ((yyvsp[(3) - (3)].eqn));
2442  (yyval.app)->args = (yyvsp[(1) - (3)].eqn);
2443  }
2444  break;
2445 
2446  case 82:
2447 
2448 /* Line 1455 of yacc.c */
2449 #line 572 "parse_netlist.y"
2450  {
2451  (yyval.app) = new eqn::application ();
2452  (yyval.app)->n = strdup ("||");
2453  (yyval.app)->nargs = 2;
2454  (yyvsp[(1) - (3)].eqn)->append ((yyvsp[(3) - (3)].eqn));
2455  (yyval.app)->args = (yyvsp[(1) - (3)].eqn);
2456  }
2457  break;
2458 
2459  case 83:
2460 
2461 /* Line 1455 of yacc.c */
2462 #line 581 "parse_netlist.y"
2463  { (yyval.eqn) = NULL; }
2464  break;
2465 
2466  case 84:
2467 
2468 /* Line 1455 of yacc.c */
2469 #line 582 "parse_netlist.y"
2470  {
2471  (yyval.eqn) = (yyvsp[(1) - (1)].eqn);
2472  }
2473  break;
2474 
2475  case 85:
2476 
2477 /* Line 1455 of yacc.c */
2478 #line 585 "parse_netlist.y"
2479  {
2480  (yyval.eqn) = (yyvsp[(1) - (1)].app);
2481  }
2482  break;
2483 
2484  case 86:
2485 
2486 /* Line 1455 of yacc.c */
2487 #line 588 "parse_netlist.y"
2488  {
2489  (yyvsp[(1) - (3)].eqn)->setNext ((yyvsp[(3) - (3)].eqn));
2490  (yyval.eqn) = (yyvsp[(1) - (3)].eqn);
2491  }
2492  break;
2493 
2494  case 87:
2495 
2496 /* Line 1455 of yacc.c */
2497 #line 592 "parse_netlist.y"
2498  {
2499  (yyvsp[(1) - (3)].app)->setNext ((yyvsp[(3) - (3)].eqn));
2500  (yyval.eqn) = (yyvsp[(1) - (3)].app);
2501  }
2502  break;
2503 
2504  case 88:
2505 
2506 /* Line 1455 of yacc.c */
2507 #line 599 "parse_netlist.y"
2508  { /* a full subcircuit definition found */
2509  (yyvsp[(1) - (3)].subcircuit)->sub = (yyvsp[(2) - (3)].definition);
2510  (yyval.subcircuit) = (yyvsp[(1) - (3)].subcircuit);
2511  (yyvsp[(2) - (3)].definition) = NULL;
2512  }
2513  break;
2514 
2515  case 89:
2516 
2517 /* Line 1455 of yacc.c */
2518 #line 607 "parse_netlist.y"
2519  {
2520  /* create subcircuit definition right here */
2521  (yyval.subcircuit) = (struct definition_t *) calloc (sizeof (struct definition_t), 1);
2522  (yyval.subcircuit)->type = strdup ("Def");
2523  (yyval.subcircuit)->instance = (yyvsp[(2) - (5)].ident);
2524  (yyval.subcircuit)->nodes = (yyvsp[(3) - (5)].node);
2525  (yyval.subcircuit)->pairs = (yyvsp[(4) - (5)].pair);
2526  (yyval.subcircuit)->action = PROP_ACTION;
2527  (yyval.subcircuit)->line = netlist_lineno;
2528  }
2529  break;
2530 
2531  case 90:
2532 
2533 /* Line 1455 of yacc.c */
2534 #line 619 "parse_netlist.y"
2535  { (yyval.definition) = NULL; }
2536  break;
2537 
2538  case 91:
2539 
2540 /* Line 1455 of yacc.c */
2541 #line 620 "parse_netlist.y"
2542  { /* chain definitions here */
2543  if ((yyvsp[(1) - (2)].definition)) {
2544  (yyvsp[(1) - (2)].definition)->next = (yyvsp[(2) - (2)].definition);
2545  (yyval.definition) = (yyvsp[(1) - (2)].definition);
2546  }
2547  else {
2548  (yyval.definition) = (yyvsp[(2) - (2)].definition);
2549  }
2550  }
2551  break;
2552 
2553  case 92:
2554 
2555 /* Line 1455 of yacc.c */
2556 #line 632 "parse_netlist.y"
2557  { /* nothing to do */ }
2558  break;
2559 
2560  case 93:
2561 
2562 /* Line 1455 of yacc.c */
2563 #line 636 "parse_netlist.y"
2564  { /* chain definitions here */
2565  (yyvsp[(1) - (1)].definition)->next = (yyval.definition);
2566  (yyval.definition) = (yyvsp[(1) - (1)].definition);
2567  }
2568  break;
2569 
2570  case 94:
2571 
2572 /* Line 1455 of yacc.c */
2573 #line 640 "parse_netlist.y"
2574  { /* chain definitions here */
2575  (yyvsp[(1) - (1)].definition)->next = (yyval.definition);
2576  (yyval.definition) = (yyvsp[(1) - (1)].definition);
2577  }
2578  break;
2579 
2580  case 95:
2581 
2582 /* Line 1455 of yacc.c */
2583 #line 644 "parse_netlist.y"
2584  { /* do nothing here, see subcircuit rule */ }
2585  break;
2586 
2587  case 96:
2588 
2589 /* Line 1455 of yacc.c */
2590 #line 645 "parse_netlist.y"
2591  {
2592  (yyval.definition) = NULL;
2593  }
2594  break;
2595 
2596 
2597 
2598 /* Line 1455 of yacc.c */
2599 #line 2600 "parse_netlist.cpp"
2600  default: break;
2601  }
2602  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2603 
2604  YYPOPSTACK (yylen);
2605  yylen = 0;
2606  YY_STACK_PRINT (yyss, yyssp);
2607 
2608  *++yyvsp = yyval;
2609 
2610  /* Now `shift' the result of the reduction. Determine what state
2611  that goes to, based on the state we popped back to and the rule
2612  number reduced by. */
2613 
2614  yyn = yyr1[yyn];
2615 
2616  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2617  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2618  yystate = yytable[yystate];
2619  else
2620  yystate = yydefgoto[yyn - YYNTOKENS];
2621 
2622  goto yynewstate;
2623 
2624 
2625 /*------------------------------------.
2626 | yyerrlab -- here on detecting error |
2627 `------------------------------------*/
2628 yyerrlab:
2629  /* If not already recovering from an error, report this error. */
2630  if (!yyerrstatus)
2631  {
2632  ++yynerrs;
2633 #if ! YYERROR_VERBOSE
2634  yyerror (YY_("syntax error"));
2635 #else
2636  {
2637  YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2638  if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2639  {
2640  YYSIZE_T yyalloc = 2 * yysize;
2641  if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2642  yyalloc = YYSTACK_ALLOC_MAXIMUM;
2643  if (yymsg != yymsgbuf)
2644  YYSTACK_FREE (yymsg);
2645  yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2646  if (yymsg)
2647  yymsg_alloc = yyalloc;
2648  else
2649  {
2650  yymsg = yymsgbuf;
2651  yymsg_alloc = sizeof yymsgbuf;
2652  }
2653  }
2654 
2655  if (0 < yysize && yysize <= yymsg_alloc)
2656  {
2657  (void) yysyntax_error (yymsg, yystate, yychar);
2658  yyerror (yymsg);
2659  }
2660  else
2661  {
2662  yyerror (YY_("syntax error"));
2663  if (yysize != 0)
2664  goto yyexhaustedlab;
2665  }
2666  }
2667 #endif
2668  }
2669 
2670 
2671 
2672  if (yyerrstatus == 3)
2673  {
2674  /* If just tried and failed to reuse lookahead token after an
2675  error, discard it. */
2676 
2677  if (yychar <= YYEOF)
2678  {
2679  /* Return failure if at end of input. */
2680  if (yychar == YYEOF)
2681  YYABORT;
2682  }
2683  else
2684  {
2685  yydestruct ("Error: discarding",
2686  yytoken, &yylval);
2687  yychar = YYEMPTY;
2688  }
2689  }
2690 
2691  /* Else will try to reuse lookahead token after shifting the error
2692  token. */
2693  goto yyerrlab1;
2694 
2695 
2696 /*---------------------------------------------------.
2697 | yyerrorlab -- error raised explicitly by YYERROR. |
2698 `---------------------------------------------------*/
2699 yyerrorlab:
2700 
2701  /* Pacify compilers like GCC when the user code never invokes
2702  YYERROR and the label yyerrorlab therefore never appears in user
2703  code. */
2704  if (/*CONSTCOND*/ 0)
2705  goto yyerrorlab;
2706 
2707  /* Do not reclaim the symbols of the rule which action triggered
2708  this YYERROR. */
2709  YYPOPSTACK (yylen);
2710  yylen = 0;
2711  YY_STACK_PRINT (yyss, yyssp);
2712  yystate = *yyssp;
2713  goto yyerrlab1;
2714 
2715 
2716 /*-------------------------------------------------------------.
2717 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2718 `-------------------------------------------------------------*/
2719 yyerrlab1:
2720  yyerrstatus = 3; /* Each real token shifted decrements this. */
2721 
2722  for (;;)
2723  {
2724  yyn = yypact[yystate];
2725  if (yyn != YYPACT_NINF)
2726  {
2727  yyn += YYTERROR;
2728  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2729  {
2730  yyn = yytable[yyn];
2731  if (0 < yyn)
2732  break;
2733  }
2734  }
2735 
2736  /* Pop the current state because it cannot handle the error token. */
2737  if (yyssp == yyss)
2738  YYABORT;
2739 
2740 
2741  yydestruct ("Error: popping",
2742  yystos[yystate], yyvsp);
2743  YYPOPSTACK (1);
2744  yystate = *yyssp;
2745  YY_STACK_PRINT (yyss, yyssp);
2746  }
2747 
2748  *++yyvsp = yylval;
2749 
2750 
2751  /* Shift the error token. */
2752  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2753 
2754  yystate = yyn;
2755  goto yynewstate;
2756 
2757 
2758 /*-------------------------------------.
2759 | yyacceptlab -- YYACCEPT comes here. |
2760 `-------------------------------------*/
2761 yyacceptlab:
2762  yyresult = 0;
2763  goto yyreturn;
2764 
2765 /*-----------------------------------.
2766 | yyabortlab -- YYABORT comes here. |
2767 `-----------------------------------*/
2768 yyabortlab:
2769  yyresult = 1;
2770  goto yyreturn;
2771 
2772 #if !defined(yyoverflow) || YYERROR_VERBOSE
2773 /*-------------------------------------------------.
2774 | yyexhaustedlab -- memory exhaustion comes here. |
2775 `-------------------------------------------------*/
2776 yyexhaustedlab:
2777  yyerror (YY_("memory exhausted"));
2778  yyresult = 2;
2779  /* Fall through. */
2780 #endif
2781 
2782 yyreturn:
2783  if (yychar != YYEMPTY)
2784  yydestruct ("Cleanup: discarding lookahead",
2785  yytoken, &yylval);
2786  /* Do not reclaim the symbols of the rule which action triggered
2787  this YYABORT or YYACCEPT. */
2788  YYPOPSTACK (yylen);
2789  YY_STACK_PRINT (yyss, yyssp);
2790  while (yyssp != yyss)
2791  {
2792  yydestruct ("Cleanup: popping",
2793  yystos[*yyssp], yyvsp);
2794  YYPOPSTACK (1);
2795  }
2796 #ifndef yyoverflow
2797  if (yyss != yyssa)
2798  YYSTACK_FREE (yyss);
2799 #endif
2800 #if YYERROR_VERBOSE
2801  if (yymsg != yymsgbuf)
2802  YYSTACK_FREE (yymsg);
2803 #endif
2804  /* Make sure YYID is used. */
2805  return YYID (yyresult);
2806 }
2807 
2808 
2809 
2810 /* Line 1675 of yacc.c */
2811 #line 651 "parse_netlist.y"
2812 
2813 
2814 int netlist_error (char * error) {
2815  logprint (LOG_ERROR, "line %d: %s\n", netlist_lineno, error);
2816  return 0;
2817 }
2818