My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
parse_vcd.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 vcd_parse
68 #define yylex vcd_lex
69 #define yyerror vcd_error
70 #define yylval vcd_lval
71 #define yychar vcd_char
72 #define yydebug vcd_debug
73 #define yynerrs vcd_nerrs
74 
75 
76 /* Copy the first part of user declarations. */
77 
78 /* Line 189 of yacc.c */
79 #line 3 "parse_vcd.y"
80 
81 /*
82  * parse_vcd.y - parser for a VCD data file
83  *
84  * Copyright (C) 2005 Raimund Jacob <raimi@lkcc.org>
85  * Copyright (C) 2006, 2008 Stefan Jahn <stefan@lkcc.org>
86  *
87  * This is free software; you can redistribute it and/or modify
88  * it under the terms of the GNU General Public License as published by
89  * the Free Software Foundation; either version 2, or (at your option)
90  * any later version.
91  *
92  * This software is distributed in the hope that it will be useful,
93  * but WITHOUT ANY WARRANTY; without even the implied warranty of
94  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
95  * GNU General Public License for more details.
96  *
97  * You should have received a copy of the GNU General Public License
98  * along with this package; see the file COPYING. If not, write to
99  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
100  * Boston, MA 02110-1301, USA.
101  *
102  * $Id: parse_vcd.y 1825 2011-03-11 20:42:14Z ela $
103  *
104  */
105 
106 #if HAVE_CONFIG_H
107 # include <config.h>
108 #endif
109 
110 #include <stdio.h>
111 #include <stdlib.h>
112 #include <string.h>
113 #include <ctype.h>
114 
115 #define YYERROR_VERBOSE 42
116 #define YYDEBUG 1
117 #define YYMAXDEPTH 10000000
118 
119 #include "check_vcd.h"
120 
121 
122 
123 /* Line 189 of yacc.c */
124 #line 125 "parse_vcd.cpp"
125 
126 /* Enabling traces. */
127 #ifndef YYDEBUG
128 # define YYDEBUG 0
129 #endif
130 
131 /* Enabling verbose error messages. */
132 #ifdef YYERROR_VERBOSE
133 # undef YYERROR_VERBOSE
134 # define YYERROR_VERBOSE 1
135 #else
136 # define YYERROR_VERBOSE 0
137 #endif
138 
139 /* Enabling the token table. */
140 #ifndef YYTOKEN_TABLE
141 # define YYTOKEN_TABLE 0
142 #endif
143 
144 
145 /* Tokens. */
146 #ifndef YYTOKENTYPE
147 # define YYTOKENTYPE
148  /* Put the tokens into the symbol table, so that GDB and other debuggers
149  know about them. */
150  enum yytokentype {
151  t_END = 258,
152  t_COMMENT = 259,
153  t_DATE = 260,
155  t_SCOPE = 262,
156  t_TIMESCALE = 263,
157  t_UPSCOPE = 264,
158  t_VAR = 265,
159  t_VERSION = 266,
160  t_DUMPALL = 267,
161  t_DUMPOFF = 268,
162  t_DUMPON = 269,
163  t_DUMPVARS = 270,
164  s_MODULE = 271,
165  s_TASK = 272,
166  s_FUNCTION = 273,
167  s_FORK = 274,
168  s_BEGIN = 275,
169  ONE = 276,
170  B = 277,
171  Z = 278,
172  ZERO = 279,
173  HASHMARK = 280,
174  X = 281,
175  R = 282,
176  TEN = 283,
177  HUNDRET = 284,
178  PICO = 285,
179  MICRO = 286,
180  NANO = 287,
181  FEMTO = 288,
182  SECOND = 289,
183  MILLI = 290,
184  EVENT = 291,
185  INTEGER = 292,
186  PARAMETER = 293,
187  REAL = 294,
188  REG = 295,
189  SUPPLY0 = 296,
190  SUPPLY1 = 297,
191  TIME = 298,
192  TRI = 299,
193  TRIAND = 300,
194  TRIOR = 301,
195  TRIREG = 302,
196  TRI0 = 303,
197  TRI1 = 304,
198  WAND = 305,
199  WIRE = 306,
200  WOR = 307,
201  Real = 308,
202  Binary = 309,
205  Identifier = 312,
207  Reference = 314,
209  };
210 #endif
211 /* Tokens. */
212 #define t_END 258
213 #define t_COMMENT 259
214 #define t_DATE 260
215 #define t_ENDDEFINITIONS 261
216 #define t_SCOPE 262
217 #define t_TIMESCALE 263
218 #define t_UPSCOPE 264
219 #define t_VAR 265
220 #define t_VERSION 266
221 #define t_DUMPALL 267
222 #define t_DUMPOFF 268
223 #define t_DUMPON 269
224 #define t_DUMPVARS 270
225 #define s_MODULE 271
226 #define s_TASK 272
227 #define s_FUNCTION 273
228 #define s_FORK 274
229 #define s_BEGIN 275
230 #define ONE 276
231 #define B 277
232 #define Z 278
233 #define ZERO 279
234 #define HASHMARK 280
235 #define X 281
236 #define R 282
237 #define TEN 283
238 #define HUNDRET 284
239 #define PICO 285
240 #define MICRO 286
241 #define NANO 287
242 #define FEMTO 288
243 #define SECOND 289
244 #define MILLI 290
245 #define EVENT 291
246 #define INTEGER 292
247 #define PARAMETER 293
248 #define REAL 294
249 #define REG 295
250 #define SUPPLY0 296
251 #define SUPPLY1 297
252 #define TIME 298
253 #define TRI 299
254 #define TRIAND 300
255 #define TRIOR 301
256 #define TRIREG 302
257 #define TRI0 303
258 #define TRI1 304
259 #define WAND 305
260 #define WIRE 306
261 #define WOR 307
262 #define Real 308
263 #define Binary 309
264 #define PositiveInteger 310
265 #define PositiveHugeInteger 311
266 #define Identifier 312
267 #define IdentifierCode 313
268 #define Reference 314
269 #define InvalidCharacter 315
270 
271 
272 
273 
274 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
275 typedef union YYSTYPE
276 {
277 
278 /* Line 214 of yacc.c */
279 #line 79 "parse_vcd.y"
280 
281  char * ident;
282  char * value;
283  int integer;
284  double real;
287  struct vcd_vardef * vardef;
288  struct vcd_change * change;
289  struct vcd_scope * scope;
291  struct vcd_range * range;
292 
293 
294 
295 /* Line 214 of yacc.c */
296 #line 297 "parse_vcd.cpp"
297 } YYSTYPE;
298 # define YYSTYPE_IS_TRIVIAL 1
299 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
300 # define YYSTYPE_IS_DECLARED 1
301 #endif
302 
303 
304 /* Copy the second part of user declarations. */
305 
306 
307 /* Line 264 of yacc.c */
308 #line 309 "parse_vcd.cpp"
309 
310 #ifdef short
311 # undef short
312 #endif
313 
314 #ifdef YYTYPE_UINT8
315 typedef YYTYPE_UINT8 yytype_uint8;
316 #else
317 typedef unsigned char yytype_uint8;
318 #endif
319 
320 #ifdef YYTYPE_INT8
321 typedef YYTYPE_INT8 yytype_int8;
322 #elif (defined __STDC__ || defined __C99__FUNC__ \
323  || defined __cplusplus || defined _MSC_VER)
324 typedef signed char yytype_int8;
325 #else
326 typedef short int yytype_int8;
327 #endif
328 
329 #ifdef YYTYPE_UINT16
330 typedef YYTYPE_UINT16 yytype_uint16;
331 #else
332 typedef unsigned short int yytype_uint16;
333 #endif
334 
335 #ifdef YYTYPE_INT16
336 typedef YYTYPE_INT16 yytype_int16;
337 #else
338 typedef short int yytype_int16;
339 #endif
340 
341 #ifndef YYSIZE_T
342 # ifdef __SIZE_TYPE__
343 # define YYSIZE_T __SIZE_TYPE__
344 # elif defined size_t
345 # define YYSIZE_T size_t
346 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
347  || defined __cplusplus || defined _MSC_VER)
348 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
349 # define YYSIZE_T size_t
350 # else
351 # define YYSIZE_T unsigned int
352 # endif
353 #endif
354 
355 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
356 
357 #ifndef YY_
358 # if YYENABLE_NLS
359 # if ENABLE_NLS
360 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
361 # define YY_(msgid) dgettext ("bison-runtime", msgid)
362 # endif
363 # endif
364 # ifndef YY_
365 # define YY_(msgid) msgid
366 # endif
367 #endif
368 
369 /* Suppress unused-variable warnings by "using" E. */
370 #if ! defined lint || defined __GNUC__
371 # define YYUSE(e) ((void) (e))
372 #else
373 # define YYUSE(e) /* empty */
374 #endif
375 
376 /* Identity function, used to suppress warnings about constant conditions. */
377 #ifndef lint
378 # define YYID(n) (n)
379 #else
380 #if (defined __STDC__ || defined __C99__FUNC__ \
381  || defined __cplusplus || defined _MSC_VER)
382 static int
383 YYID (int yyi)
384 #else
385 static int
386 YYID (yyi)
387  int yyi;
388 #endif
389 {
390  return yyi;
391 }
392 #endif
393 
394 #if ! defined yyoverflow || YYERROR_VERBOSE
395 
396 /* The parser invokes alloca or malloc; define the necessary symbols. */
397 
398 # ifdef YYSTACK_USE_ALLOCA
399 # if YYSTACK_USE_ALLOCA
400 # ifdef __GNUC__
401 # define YYSTACK_ALLOC __builtin_alloca
402 # elif defined __BUILTIN_VA_ARG_INCR
403 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
404 # elif defined _AIX
405 # define YYSTACK_ALLOC __alloca
406 # elif defined _MSC_VER
407 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
408 # define alloca _alloca
409 # else
410 # define YYSTACK_ALLOC alloca
411 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
412  || defined __cplusplus || defined _MSC_VER)
413 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
414 # ifndef _STDLIB_H
415 # define _STDLIB_H 1
416 # endif
417 # endif
418 # endif
419 # endif
420 # endif
421 
422 # ifdef YYSTACK_ALLOC
423  /* Pacify GCC's `empty if-body' warning. */
424 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
425 # ifndef YYSTACK_ALLOC_MAXIMUM
426  /* The OS might guarantee only one guard page at the bottom of the stack,
427  and a page size can be as small as 4096 bytes. So we cannot safely
428  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
429  to allow for a few compiler-allocated temporary stack slots. */
430 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
431 # endif
432 # else
433 # define YYSTACK_ALLOC YYMALLOC
434 # define YYSTACK_FREE YYFREE
435 # ifndef YYSTACK_ALLOC_MAXIMUM
436 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
437 # endif
438 # if (defined __cplusplus && ! defined _STDLIB_H \
439  && ! ((defined YYMALLOC || defined malloc) \
440  && (defined YYFREE || defined free)))
441 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
442 # ifndef _STDLIB_H
443 # define _STDLIB_H 1
444 # endif
445 # endif
446 # ifndef YYMALLOC
447 # define YYMALLOC malloc
448 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
449  || defined __cplusplus || defined _MSC_VER)
450 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
451 # endif
452 # endif
453 # ifndef YYFREE
454 # define YYFREE free
455 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
456  || defined __cplusplus || defined _MSC_VER)
457 void free (void *); /* INFRINGES ON USER NAME SPACE */
458 # endif
459 # endif
460 # endif
461 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
462 
463 
464 #if (! defined yyoverflow \
465  && (! defined __cplusplus \
466  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
467 
468 /* A type that is properly aligned for any stack member. */
469 union yyalloc
470 {
473 };
474 
475 /* The size of the maximum gap between one aligned stack and the next. */
476 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
477 
478 /* The size of an array large to enough to hold all stacks, each with
479  N elements. */
480 # define YYSTACK_BYTES(N) \
481  ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
482  + YYSTACK_GAP_MAXIMUM)
483 
484 /* Copy COUNT objects from FROM to TO. The source and destination do
485  not overlap. */
486 # ifndef YYCOPY
487 # if defined __GNUC__ && 1 < __GNUC__
488 # define YYCOPY(To, From, Count) \
489  __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
490 # else
491 # define YYCOPY(To, From, Count) \
492  do \
493  { \
494  YYSIZE_T yyi; \
495  for (yyi = 0; yyi < (Count); yyi++) \
496  (To)[yyi] = (From)[yyi]; \
497  } \
498  while (YYID (0))
499 # endif
500 # endif
501 
502 /* Relocate STACK from its old location to the new one. The
503  local variables YYSIZE and YYSTACKSIZE give the old and new number of
504  elements in the stack, and YYPTR gives the new location of the
505  stack. Advance YYPTR to a properly aligned location for the next
506  stack. */
507 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
508  do \
509  { \
510  YYSIZE_T yynewbytes; \
511  YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
512  Stack = &yyptr->Stack_alloc; \
513  yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
514  yyptr += yynewbytes / sizeof (*yyptr); \
515  } \
516  while (YYID (0))
517 
518 #endif
519 
520 /* YYFINAL -- State number of the termination state. */
521 #define YYFINAL 48
522 /* YYLAST -- Last index in YYTABLE. */
523 #define YYLAST 89
524 
525 /* YYNTOKENS -- Number of terminals. */
526 #define YYNTOKENS 68
527 /* YYNNTS -- Number of nonterminals. */
528 #define YYNNTS 22
529 /* YYNRULES -- Number of rules. */
530 #define YYNRULES 71
531 /* YYNRULES -- Number of states. */
532 #define YYNSTATES 111
533 
534 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
535 #define YYUNDEFTOK 2
536 #define YYMAXUTOK 315
537 
538 #define YYTRANSLATE(YYX) \
539  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
540 
541 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
542 static const yytype_uint8 yytranslate[] =
543 {
544  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
545  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
546  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
547  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
548  64, 65, 2, 2, 2, 2, 2, 2, 2, 2,
549  2, 2, 2, 2, 2, 2, 2, 2, 63, 2,
550  2, 2, 2, 2, 2, 2, 66, 2, 2, 2,
551  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
552  2, 2, 67, 2, 2, 2, 2, 2, 2, 2,
553  2, 61, 2, 62, 2, 2, 2, 2, 2, 2,
554  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
555  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
556  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
557  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
558  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
559  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
560  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
561  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
562  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
563  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
564  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
565  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
566  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
567  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
568  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
569  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
570  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
571  15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
572  25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
573  35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
574  45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
575  55, 56, 57, 58, 59, 60
576 };
577 
578 #if YYDEBUG
579 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
580  YYRHS. */
581 static const yytype_uint8 yyprhs[] =
582 {
583  0, 0, 3, 6, 7, 10, 13, 16, 19, 23,
584  27, 30, 33, 37, 40, 42, 44, 46, 48, 50,
585  53, 55, 57, 59, 61, 63, 65, 67, 69, 71,
586  77, 78, 82, 88, 92, 94, 96, 98, 100, 102,
587  104, 106, 108, 110, 112, 114, 116, 118, 120, 122,
588  124, 126, 128, 129, 132, 136, 140, 144, 148, 150,
589  153, 156, 157, 160, 162, 164, 167, 169, 171, 173,
590  175, 179
591 };
592 
593 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
594 static const yytype_int8 yyrhs[] =
595 {
596  69, 0, -1, 70, 81, -1, -1, 71, 70, -1,
597  4, 3, -1, 5, 3, -1, 6, 3, -1, 7,
598  72, 3, -1, 8, 74, 3, -1, 9, 3, -1,
599  11, 3, -1, 10, 77, 3, -1, 73, 57, -1,
600  16, -1, 17, -1, 18, -1, 20, -1, 19, -1,
601  75, 76, -1, 21, -1, 28, -1, 29, -1, 34,
602  -1, 35, -1, 31, -1, 32, -1, 30, -1, 33,
603  -1, 79, 80, 58, 59, 78, -1, -1, 61, 55,
604  62, -1, 61, 55, 63, 55, 62, -1, 64, 55,
605  65, -1, 36, -1, 37, -1, 38, -1, 39, -1,
606  40, -1, 41, -1, 42, -1, 43, -1, 44, -1,
607  45, -1, 46, -1, 47, -1, 48, -1, 49, -1,
608  50, -1, 51, -1, 52, -1, 55, -1, -1, 82,
609  81, -1, 12, 85, 3, -1, 13, 85, 3, -1,
610  14, 85, 3, -1, 15, 85, 3, -1, 83, -1,
611  84, 85, -1, 25, 56, -1, -1, 86, 85, -1,
612  87, -1, 89, -1, 88, 58, -1, 24, -1, 21,
613  -1, 26, -1, 23, -1, 66, 54, 58, -1, 67,
614  53, 58, -1
615 };
616 
617 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
618 static const yytype_uint16 yyrline[] =
619 {
620  0, 108, 108, 111, 112, 116, 117, 118, 119, 135,
621  136, 145, 146, 162, 170, 171, 172, 173, 174, 178,
622  185, 186, 187, 191, 192, 193, 194, 195, 196, 200,
623  210, 211, 216, 221, 229, 231, 233, 236, 238, 240,
624  242, 244, 246, 248, 250, 252, 254, 256, 258, 260,
625  262, 267, 270, 271, 275, 276, 277, 278, 281, 288,
626  296, 301, 302, 308, 309, 313, 321, 322, 323, 324,
627  328, 333
628 };
629 #endif
630 
631 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
632 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
633  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
634 static const char *const yytname[] =
635 {
636  "$end", "error", "$undefined", "t_END", "t_COMMENT", "t_DATE",
637  "t_ENDDEFINITIONS", "t_SCOPE", "t_TIMESCALE", "t_UPSCOPE", "t_VAR",
638  "t_VERSION", "t_DUMPALL", "t_DUMPOFF", "t_DUMPON", "t_DUMPVARS",
639  "s_MODULE", "s_TASK", "s_FUNCTION", "s_FORK", "s_BEGIN", "ONE", "B", "Z",
640  "ZERO", "HASHMARK", "X", "R", "TEN", "HUNDRET", "PICO", "MICRO", "NANO",
641  "FEMTO", "SECOND", "MILLI", "EVENT", "INTEGER", "PARAMETER", "REAL",
642  "REG", "SUPPLY0", "SUPPLY1", "TIME", "TRI", "TRIAND", "TRIOR", "TRIREG",
643  "TRI0", "TRI1", "WAND", "WIRE", "WOR", "Real", "Binary",
644  "PositiveInteger", "PositiveHugeInteger", "Identifier", "IdentifierCode",
645  "Reference", "InvalidCharacter", "'['", "']'", "':'", "'('", "')'",
646  "'B'", "'R'", "$accept", "ValueChangeDumpDefinitions", "DeclarationList",
647  "Declaration", "ScopeDeclaration", "ScopeType", "TimeScaleDeclaration",
648  "TimeScale", "TimeUnit", "VarDeclaration", "BitSelect", "VarType",
649  "Size", "SimulationCommandList", "SimulationCommand", "ValueChangeset",
650  "SimulationTime", "ValueChangeList", "ValueChange", "ScalarValueChange",
651  "Value", "VectorValueChange", 0
652 };
653 #endif
654 
655 # ifdef YYPRINT
656 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
657  token YYLEX-NUM. */
658 static const yytype_uint16 yytoknum[] =
659 {
660  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
661  265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
662  275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
663  285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
664  295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
665  305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
666  315, 91, 93, 58, 40, 41, 66, 82
667 };
668 # endif
669 
670 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
671 static const yytype_uint8 yyr1[] =
672 {
673  0, 68, 69, 70, 70, 71, 71, 71, 71, 71,
674  71, 71, 71, 72, 73, 73, 73, 73, 73, 74,
675  75, 75, 75, 76, 76, 76, 76, 76, 76, 77,
676  78, 78, 78, 78, 79, 79, 79, 79, 79, 79,
677  79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
678  79, 80, 81, 81, 82, 82, 82, 82, 82, 83,
679  84, 85, 85, 86, 86, 87, 88, 88, 88, 88,
680  89, 89
681 };
682 
683 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
684 static const yytype_uint8 yyr2[] =
685 {
686  0, 2, 2, 0, 2, 2, 2, 2, 3, 3,
687  2, 2, 3, 2, 1, 1, 1, 1, 1, 2,
688  1, 1, 1, 1, 1, 1, 1, 1, 1, 5,
689  0, 3, 5, 3, 1, 1, 1, 1, 1, 1,
690  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
691  1, 1, 0, 2, 3, 3, 3, 3, 1, 2,
692  2, 0, 2, 1, 1, 2, 1, 1, 1, 1,
693  3, 3
694 };
695 
696 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
697  STATE-NUM when YYTABLE doesn't specify something else to do. Zero
698  means the default is an error. */
699 static const yytype_uint8 yydefact[] =
700 {
701  3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
702  52, 3, 5, 6, 7, 14, 15, 16, 18, 17,
703  0, 0, 20, 21, 22, 0, 0, 10, 34, 35,
704  36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
705  46, 47, 48, 49, 50, 0, 0, 11, 1, 61,
706  61, 61, 61, 0, 2, 52, 58, 61, 4, 8,
707  13, 9, 27, 25, 26, 28, 23, 24, 19, 12,
708  51, 0, 67, 69, 66, 68, 0, 0, 0, 61,
709  63, 0, 64, 0, 0, 0, 60, 53, 59, 0,
710  0, 0, 54, 62, 65, 55, 56, 57, 30, 70,
711  71, 0, 0, 29, 0, 0, 31, 0, 33, 0,
712  32
713 };
714 
715 /* YYDEFGOTO[NTERM-NUM]. */
716 static const yytype_int8 yydefgoto[] =
717 {
718  -1, 9, 10, 11, 20, 21, 25, 26, 68, 45,
719  103, 46, 71, 54, 55, 56, 57, 78, 79, 80,
720  81, 82
721 };
722 
723 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
724  STATE-NUM. */
725 #define YYPACT_NINF -54
726 static const yytype_int8 yypact[] =
727 {
728  32, -2, 56, 57, 37, -17, 59, -22, 60, 64,
729  19, 32, -54, -54, -54, -54, -54, -54, -54, -54,
730  62, 9, -54, -54, -54, 65, 17, -54, -54, -54,
731  -54, -54, -54, -54, -54, -54, -54, -54, -54, -54,
732  -54, -54, -54, -54, -54, 66, 12, -54, -54, -21,
733  -21, -21, -21, 14, -54, 19, -54, -21, -54, -54,
734  -54, -54, -54, -54, -54, -54, -54, -54, -54, -54,
735  -54, 13, -54, -54, -54, -54, 18, 20, 71, -21,
736  -54, 21, -54, 72, 73, 74, -54, -54, -54, 22,
737  24, 25, -54, -54, -54, -54, -54, -54, -3, -54,
738  -54, 23, 29, -54, -53, 15, -54, 30, -54, 26,
739  -54
740 };
741 
742 /* YYPGOTO[NTERM-NUM]. */
743 static const yytype_int8 yypgoto[] =
744 {
745  -54, -54, 75, -54, -54, -54, -54, -54, -54, -54,
746  -54, -54, -54, 34, -54, -54, -54, -44, -54, -54,
747  -54, -54
748 };
749 
750 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
751  positive, shift that token. If negative, reduce the rule which
752  number is the opposite. If zero, do what YYDEFACT says.
753  If YYTABLE_NINF, syntax error. */
754 #define YYTABLE_NINF -1
755 static const yytype_uint8 yytable[] =
756 {
757  72, 12, 73, 74, 22, 75, 83, 84, 85, 106,
758  107, 23, 24, 88, 28, 29, 30, 31, 32, 33,
759  34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
760  44, 49, 50, 51, 52, 93, 1, 2, 3, 4,
761  5, 6, 7, 8, 53, 76, 77, 62, 63, 64,
762  65, 66, 67, 15, 16, 17, 18, 19, 101, 13,
763  14, 102, 27, 47, 48, 59, 60, 70, 61, 69,
764  86, 89, 90, 91, 92, 95, 96, 97, 104, 94,
765  108, 98, 99, 100, 105, 109, 58, 0, 110, 87
766 };
767 
768 static const yytype_int8 yycheck[] =
769 {
770  21, 3, 23, 24, 21, 26, 50, 51, 52, 62,
771  63, 28, 29, 57, 36, 37, 38, 39, 40, 41,
772  42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
773  52, 12, 13, 14, 15, 79, 4, 5, 6, 7,
774  8, 9, 10, 11, 25, 66, 67, 30, 31, 32,
775  33, 34, 35, 16, 17, 18, 19, 20, 61, 3,
776  3, 64, 3, 3, 0, 3, 57, 55, 3, 3,
777  56, 58, 54, 53, 3, 3, 3, 3, 55, 58,
778  65, 59, 58, 58, 55, 55, 11, -1, 62, 55
779 };
780 
781 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
782  symbol of state STATE-NUM. */
783 static const yytype_uint8 yystos[] =
784 {
785  0, 4, 5, 6, 7, 8, 9, 10, 11, 69,
786  70, 71, 3, 3, 3, 16, 17, 18, 19, 20,
787  72, 73, 21, 28, 29, 74, 75, 3, 36, 37,
788  38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
789  48, 49, 50, 51, 52, 77, 79, 3, 0, 12,
790  13, 14, 15, 25, 81, 82, 83, 84, 70, 3,
791  57, 3, 30, 31, 32, 33, 34, 35, 76, 3,
792  55, 80, 21, 23, 24, 26, 66, 67, 85, 86,
793  87, 88, 89, 85, 85, 85, 56, 81, 85, 58,
794  54, 53, 3, 85, 58, 3, 3, 3, 59, 58,
795  58, 61, 64, 78, 55, 55, 62, 63, 65, 55,
796  62
797 };
798 
799 #define yyerrok (yyerrstatus = 0)
800 #define yyclearin (yychar = YYEMPTY)
801 #define YYEMPTY (-2)
802 #define YYEOF 0
803 
804 #define YYACCEPT goto yyacceptlab
805 #define YYABORT goto yyabortlab
806 #define YYERROR goto yyerrorlab
807 
808 
809 /* Like YYERROR except do call yyerror. This remains here temporarily
810  to ease the transition to the new meaning of YYERROR, for GCC.
811  Once GCC version 2 has supplanted version 1, this can go. */
812 
813 #define YYFAIL goto yyerrlab
814 
815 #define YYRECOVERING() (!!yyerrstatus)
816 
817 #define YYBACKUP(Token, Value) \
818 do \
819  if (yychar == YYEMPTY && yylen == 1) \
820  { \
821  yychar = (Token); \
822  yylval = (Value); \
823  yytoken = YYTRANSLATE (yychar); \
824  YYPOPSTACK (1); \
825  goto yybackup; \
826  } \
827  else \
828  { \
829  yyerror (YY_("syntax error: cannot back up")); \
830  YYERROR; \
831  } \
832 while (YYID (0))
833 
834 
835 #define YYTERROR 1
836 #define YYERRCODE 256
837 
838 
839 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
840  If N is 0, then set CURRENT to the empty location which ends
841  the previous symbol: RHS[0] (always defined). */
842 
843 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
844 #ifndef YYLLOC_DEFAULT
845 # define YYLLOC_DEFAULT(Current, Rhs, N) \
846  do \
847  if (YYID (N)) \
848  { \
849  (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
850  (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
851  (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
852  (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
853  } \
854  else \
855  { \
856  (Current).first_line = (Current).last_line = \
857  YYRHSLOC (Rhs, 0).last_line; \
858  (Current).first_column = (Current).last_column = \
859  YYRHSLOC (Rhs, 0).last_column; \
860  } \
861  while (YYID (0))
862 #endif
863 
864 
865 /* YY_LOCATION_PRINT -- Print the location on the stream.
866  This macro was not mandated originally: define only if we know
867  we won't break user code: when these are the locations we know. */
868 
869 #ifndef YY_LOCATION_PRINT
870 # if YYLTYPE_IS_TRIVIAL
871 # define YY_LOCATION_PRINT(File, Loc) \
872  fprintf (File, "%d.%d-%d.%d", \
873  (Loc).first_line, (Loc).first_column, \
874  (Loc).last_line, (Loc).last_column)
875 # else
876 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
877 # endif
878 #endif
879 
880 
881 /* YYLEX -- calling `yylex' with the right arguments. */
882 
883 #ifdef YYLEX_PARAM
884 # define YYLEX yylex (YYLEX_PARAM)
885 #else
886 # define YYLEX yylex ()
887 #endif
888 
889 /* Enable debugging if requested. */
890 #if YYDEBUG
891 
892 # ifndef YYFPRINTF
893 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
894 # define YYFPRINTF fprintf
895 # endif
896 
897 # define YYDPRINTF(Args) \
898 do { \
899  if (yydebug) \
900  YYFPRINTF Args; \
901 } while (YYID (0))
902 
903 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
904 do { \
905  if (yydebug) \
906  { \
907  YYFPRINTF (stderr, "%s ", Title); \
908  yy_symbol_print (stderr, \
909  Type, Value); \
910  YYFPRINTF (stderr, "\n"); \
911  } \
912 } while (YYID (0))
913 
914 
915 /*--------------------------------.
916 | Print this symbol on YYOUTPUT. |
917 `--------------------------------*/
918 
919 /*ARGSUSED*/
920 #if (defined __STDC__ || defined __C99__FUNC__ \
921  || defined __cplusplus || defined _MSC_VER)
922 static void
923 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
924 #else
925 static void
926 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
927  FILE *yyoutput;
928  int yytype;
929  YYSTYPE const * const yyvaluep;
930 #endif
931 {
932  if (!yyvaluep)
933  return;
934 # ifdef YYPRINT
935  if (yytype < YYNTOKENS)
936  YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
937 # else
938  YYUSE (yyoutput);
939 # endif
940  switch (yytype)
941  {
942  default:
943  break;
944  }
945 }
946 
947 
948 /*--------------------------------.
949 | Print this symbol on YYOUTPUT. |
950 `--------------------------------*/
951 
952 #if (defined __STDC__ || defined __C99__FUNC__ \
953  || defined __cplusplus || defined _MSC_VER)
954 static void
955 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
956 #else
957 static void
958 yy_symbol_print (yyoutput, yytype, yyvaluep)
959  FILE *yyoutput;
960  int yytype;
961  YYSTYPE const * const yyvaluep;
962 #endif
963 {
964  if (yytype < YYNTOKENS)
965  YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
966  else
967  YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
968 
969  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
970  YYFPRINTF (yyoutput, ")");
971 }
972 
973 /*------------------------------------------------------------------.
974 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
975 | TOP (included). |
976 `------------------------------------------------------------------*/
977 
978 #if (defined __STDC__ || defined __C99__FUNC__ \
979  || defined __cplusplus || defined _MSC_VER)
980 static void
981 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
982 #else
983 static void
984 yy_stack_print (yybottom, yytop)
985  yytype_int16 *yybottom;
986  yytype_int16 *yytop;
987 #endif
988 {
989  YYFPRINTF (stderr, "Stack now");
990  for (; yybottom <= yytop; yybottom++)
991  {
992  int yybot = *yybottom;
993  YYFPRINTF (stderr, " %d", yybot);
994  }
995  YYFPRINTF (stderr, "\n");
996 }
997 
998 # define YY_STACK_PRINT(Bottom, Top) \
999 do { \
1000  if (yydebug) \
1001  yy_stack_print ((Bottom), (Top)); \
1002 } while (YYID (0))
1003 
1004 
1005 /*------------------------------------------------.
1006 | Report that the YYRULE is going to be reduced. |
1007 `------------------------------------------------*/
1008 
1009 #if (defined __STDC__ || defined __C99__FUNC__ \
1010  || defined __cplusplus || defined _MSC_VER)
1011 static void
1012 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1013 #else
1014 static void
1015 yy_reduce_print (yyvsp, yyrule)
1016  YYSTYPE *yyvsp;
1017  int yyrule;
1018 #endif
1020  int yynrhs = yyr2[yyrule];
1021  int yyi;
1022  unsigned long int yylno = yyrline[yyrule];
1023  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1024  yyrule - 1, yylno);
1025  /* The symbols being reduced. */
1026  for (yyi = 0; yyi < yynrhs; yyi++)
1027  {
1028  YYFPRINTF (stderr, " $%d = ", yyi + 1);
1029  yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1030  &(yyvsp[(yyi + 1) - (yynrhs)])
1031  );
1032  YYFPRINTF (stderr, "\n");
1033  }
1034 }
1035 
1036 # define YY_REDUCE_PRINT(Rule) \
1037 do { \
1038  if (yydebug) \
1039  yy_reduce_print (yyvsp, Rule); \
1040 } while (YYID (0))
1041 
1042 /* Nonzero means print parse trace. It is left uninitialized so that
1043  multiple parsers can coexist. */
1045 #else /* !YYDEBUG */
1046 # define YYDPRINTF(Args)
1047 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1048 # define YY_STACK_PRINT(Bottom, Top)
1049 # define YY_REDUCE_PRINT(Rule)
1050 #endif /* !YYDEBUG */
1051 
1052 
1053 /* YYINITDEPTH -- initial size of the parser's stacks. */
1054 #ifndef YYINITDEPTH
1055 # define YYINITDEPTH 200
1056 #endif
1057 
1058 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1059  if the built-in stack extension method is used).
1060 
1061  Do not make this value too large; the results are undefined if
1062  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1063  evaluated with infinite-precision integer arithmetic. */
1064 
1065 #ifndef YYMAXDEPTH
1066 # define YYMAXDEPTH 10000
1067 #endif
1068 
1069 
1070 
1071 #if YYERROR_VERBOSE
1072 
1073 # ifndef yystrlen
1074 # if defined __GLIBC__ && defined _STRING_H
1075 # define yystrlen strlen
1076 # else
1077 /* Return the length of YYSTR. */
1078 #if (defined __STDC__ || defined __C99__FUNC__ \
1079  || defined __cplusplus || defined _MSC_VER)
1080 static YYSIZE_T
1081 yystrlen (const char *yystr)
1082 #else
1083 static YYSIZE_T
1084 yystrlen (yystr)
1085  const char *yystr;
1086 #endif
1087 {
1088  YYSIZE_T yylen;
1089  for (yylen = 0; yystr[yylen]; yylen++)
1090  continue;
1091  return yylen;
1092 }
1093 # endif
1094 # endif
1095 
1096 # ifndef yystpcpy
1097 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1098 # define yystpcpy stpcpy
1099 # else
1100 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1101  YYDEST. */
1102 #if (defined __STDC__ || defined __C99__FUNC__ \
1103  || defined __cplusplus || defined _MSC_VER)
1104 static char *
1105 yystpcpy (char *yydest, const char *yysrc)
1106 #else
1107 static char *
1108 yystpcpy (yydest, yysrc)
1109  char *yydest;
1110  const char *yysrc;
1111 #endif
1112 {
1113  char *yyd = yydest;
1114  const char *yys = yysrc;
1115 
1116  while ((*yyd++ = *yys++) != '\0')
1117  continue;
1118 
1119  return yyd - 1;
1120 }
1121 # endif
1122 # endif
1123 
1124 # ifndef yytnamerr
1125 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1126  quotes and backslashes, so that it's suitable for yyerror. The
1127  heuristic is that double-quoting is unnecessary unless the string
1128  contains an apostrophe, a comma, or backslash (other than
1129  backslash-backslash). YYSTR is taken from yytname. If YYRES is
1130  null, do not copy; instead, return the length of what the result
1131  would have been. */
1132 static YYSIZE_T
1133 yytnamerr (char *yyres, const char *yystr)
1134 {
1135  if (*yystr == '"')
1136  {
1137  YYSIZE_T yyn = 0;
1138  char const *yyp = yystr;
1139 
1140  for (;;)
1141  switch (*++yyp)
1142  {
1143  case '\'':
1144  case ',':
1145  goto do_not_strip_quotes;
1146 
1147  case '\\':
1148  if (*++yyp != '\\')
1149  goto do_not_strip_quotes;
1150  /* Fall through. */
1151  default:
1152  if (yyres)
1153  yyres[yyn] = *yyp;
1154  yyn++;
1155  break;
1156 
1157  case '"':
1158  if (yyres)
1159  yyres[yyn] = '\0';
1160  return yyn;
1161  }
1162  do_not_strip_quotes: ;
1163  }
1164 
1165  if (! yyres)
1166  return yystrlen (yystr);
1167 
1168  return yystpcpy (yyres, yystr) - yyres;
1169 }
1170 # endif
1171 
1172 /* Copy into YYRESULT an error message about the unexpected token
1173  YYCHAR while in state YYSTATE. Return the number of bytes copied,
1174  including the terminating null byte. If YYRESULT is null, do not
1175  copy anything; just return the number of bytes that would be
1176  copied. As a special case, return 0 if an ordinary "syntax error"
1177  message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1178  size calculation. */
1179 static YYSIZE_T
1180 yysyntax_error (char *yyresult, int yystate, int yychar)
1181 {
1182  int yyn = yypact[yystate];
1183 
1184  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1185  return 0;
1186  else
1187  {
1188  int yytype = YYTRANSLATE (yychar);
1189  YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1190  YYSIZE_T yysize = yysize0;
1191  YYSIZE_T yysize1;
1192  int yysize_overflow = 0;
1193  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1194  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1195  int yyx;
1196 
1197 # if 0
1198  /* This is so xgettext sees the translatable formats that are
1199  constructed on the fly. */
1200  YY_("syntax error, unexpected %s");
1201  YY_("syntax error, unexpected %s, expecting %s");
1202  YY_("syntax error, unexpected %s, expecting %s or %s");
1203  YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1204  YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1205 # endif
1206  char *yyfmt;
1207  char const *yyf;
1208  static char const yyunexpected[] = "syntax error, unexpected %s";
1209  static char const yyexpecting[] = ", expecting %s";
1210  static char const yyor[] = " or %s";
1211  char yyformat[sizeof yyunexpected
1212  + sizeof yyexpecting - 1
1213  + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1214  * (sizeof yyor - 1))];
1215  char const *yyprefix = yyexpecting;
1216 
1217  /* Start YYX at -YYN if negative to avoid negative indexes in
1218  YYCHECK. */
1219  int yyxbegin = yyn < 0 ? -yyn : 0;
1220 
1221  /* Stay within bounds of both yycheck and yytname. */
1222  int yychecklim = YYLAST - yyn + 1;
1223  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1224  int yycount = 1;
1225 
1226  yyarg[0] = yytname[yytype];
1227  yyfmt = yystpcpy (yyformat, yyunexpected);
1228 
1229  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1230  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1231  {
1232  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1233  {
1234  yycount = 1;
1235  yysize = yysize0;
1236  yyformat[sizeof yyunexpected - 1] = '\0';
1237  break;
1238  }
1239  yyarg[yycount++] = yytname[yyx];
1240  yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1241  yysize_overflow |= (yysize1 < yysize);
1242  yysize = yysize1;
1243  yyfmt = yystpcpy (yyfmt, yyprefix);
1244  yyprefix = yyor;
1245  }
1246 
1247  yyf = YY_(yyformat);
1248  yysize1 = yysize + yystrlen (yyf);
1249  yysize_overflow |= (yysize1 < yysize);
1250  yysize = yysize1;
1251 
1252  if (yysize_overflow)
1253  return YYSIZE_MAXIMUM;
1254 
1255  if (yyresult)
1256  {
1257  /* Avoid sprintf, as that infringes on the user's name space.
1258  Don't have undefined behavior even if the translation
1259  produced a string with the wrong number of "%s"s. */
1260  char *yyp = yyresult;
1261  int yyi = 0;
1262  while ((*yyp = *yyf) != '\0')
1263  {
1264  if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1265  {
1266  yyp += yytnamerr (yyp, yyarg[yyi++]);
1267  yyf += 2;
1268  }
1269  else
1270  {
1271  yyp++;
1272  yyf++;
1273  }
1274  }
1275  }
1276  return yysize;
1277  }
1278 }
1279 #endif /* YYERROR_VERBOSE */
1280 
1281 
1282 /*-----------------------------------------------.
1283 | Release the memory associated to this symbol. |
1284 `-----------------------------------------------*/
1285 
1286 /*ARGSUSED*/
1287 #if (defined __STDC__ || defined __C99__FUNC__ \
1288  || defined __cplusplus || defined _MSC_VER)
1289 static void
1290 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1291 #else
1292 static void
1293 yydestruct (yymsg, yytype, yyvaluep)
1294  const char *yymsg;
1295  int yytype;
1296  YYSTYPE *yyvaluep;
1297 #endif
1298 {
1299  YYUSE (yyvaluep);
1300 
1301  if (!yymsg)
1302  yymsg = "Deleting";
1303  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1304 
1305  switch (yytype)
1306  {
1307 
1308  default:
1309  break;
1310  }
1311 }
1312 
1313 /* Prevent warnings from -Wmissing-prototypes. */
1314 #ifdef YYPARSE_PARAM
1315 #if defined __STDC__ || defined __cplusplus
1316 int yyparse (void *YYPARSE_PARAM);
1317 #else
1318 int yyparse ();
1319 #endif
1320 #else /* ! YYPARSE_PARAM */
1321 #if defined __STDC__ || defined __cplusplus
1322 int yyparse (void);
1323 #else
1324 int yyparse ();
1325 #endif
1326 #endif /* ! YYPARSE_PARAM */
1327 
1328 
1329 /* The lookahead symbol. */
1331 
1332 /* The semantic value of the lookahead symbol. */
1334 
1335 /* Number of syntax errors so far. */
1337 
1338 
1339 
1340 /*-------------------------.
1341 | yyparse or yypush_parse. |
1342 `-------------------------*/
1343 
1344 #ifdef YYPARSE_PARAM
1345 #if (defined __STDC__ || defined __C99__FUNC__ \
1346  || defined __cplusplus || defined _MSC_VER)
1347 int
1348 yyparse (void *YYPARSE_PARAM)
1349 #else
1350 int
1351 yyparse (YYPARSE_PARAM)
1352  void *YYPARSE_PARAM;
1353 #endif
1354 #else /* ! YYPARSE_PARAM */
1355 #if (defined __STDC__ || defined __C99__FUNC__ \
1356  || defined __cplusplus || defined _MSC_VER)
1357 int
1358 yyparse (void)
1359 #else
1360 int
1361 yyparse ()
1362 
1363 #endif
1364 #endif
1365 {
1366 
1367 
1368  int yystate;
1369  /* Number of tokens to shift before error messages enabled. */
1370  int yyerrstatus;
1371 
1372  /* The stacks and their tools:
1373  `yyss': related to states.
1374  `yyvs': related to semantic values.
1375 
1376  Refer to the stacks thru separate pointers, to allow yyoverflow
1377  to reallocate them elsewhere. */
1378 
1379  /* The state stack. */
1380  yytype_int16 yyssa[YYINITDEPTH];
1381  yytype_int16 *yyss;
1382  yytype_int16 *yyssp;
1383 
1384  /* The semantic value stack. */
1385  YYSTYPE yyvsa[YYINITDEPTH];
1386  YYSTYPE *yyvs;
1387  YYSTYPE *yyvsp;
1388 
1389  YYSIZE_T yystacksize;
1390 
1391  int yyn;
1392  int yyresult;
1393  /* Lookahead token as an internal (translated) token number. */
1394  int yytoken;
1395  /* The variables used to return semantic value and location from the
1396  action routines. */
1397  YYSTYPE yyval;
1398 
1399 #if YYERROR_VERBOSE
1400  /* Buffer for error messages, and its allocated size. */
1401  char yymsgbuf[128];
1402  char *yymsg = yymsgbuf;
1403  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1404 #endif
1405 
1406 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1407 
1408  /* The number of symbols on the RHS of the reduced rule.
1409  Keep to zero when no symbol should be popped. */
1410  int yylen = 0;
1411 
1412  yytoken = 0;
1413  yyss = yyssa;
1414  yyvs = yyvsa;
1415  yystacksize = YYINITDEPTH;
1416 
1417  YYDPRINTF ((stderr, "Starting parse\n"));
1418 
1419  yystate = 0;
1420  yyerrstatus = 0;
1421  yynerrs = 0;
1422  yychar = YYEMPTY; /* Cause a token to be read. */
1423 
1424  /* Initialize stack pointers.
1425  Waste one element of value and location stack
1426  so that they stay on the same level as the state stack.
1427  The wasted elements are never initialized. */
1428  yyssp = yyss;
1429  yyvsp = yyvs;
1430 
1431  goto yysetstate;
1432 
1433 /*------------------------------------------------------------.
1434 | yynewstate -- Push a new state, which is found in yystate. |
1435 `------------------------------------------------------------*/
1436  yynewstate:
1437  /* In all cases, when you get here, the value and location stacks
1438  have just been pushed. So pushing a state here evens the stacks. */
1439  yyssp++;
1440 
1441  yysetstate:
1442  *yyssp = yystate;
1443 
1444  if (yyss + yystacksize - 1 <= yyssp)
1445  {
1446  /* Get the current used size of the three stacks, in elements. */
1447  YYSIZE_T yysize = yyssp - yyss + 1;
1448 
1449 #ifdef yyoverflow
1450  {
1451  /* Give user a chance to reallocate the stack. Use copies of
1452  these so that the &'s don't force the real ones into
1453  memory. */
1454  YYSTYPE *yyvs1 = yyvs;
1455  yytype_int16 *yyss1 = yyss;
1456 
1457  /* Each stack pointer address is followed by the size of the
1458  data in use in that stack, in bytes. This used to be a
1459  conditional around just the two extra args, but that might
1460  be undefined if yyoverflow is a macro. */
1461  yyoverflow (YY_("memory exhausted"),
1462  &yyss1, yysize * sizeof (*yyssp),
1463  &yyvs1, yysize * sizeof (*yyvsp),
1464  &yystacksize);
1465 
1466  yyss = yyss1;
1467  yyvs = yyvs1;
1468  }
1469 #else /* no yyoverflow */
1470 # ifndef YYSTACK_RELOCATE
1471  goto yyexhaustedlab;
1472 # else
1473  /* Extend the stack our own way. */
1474  if (YYMAXDEPTH <= yystacksize)
1475  goto yyexhaustedlab;
1476  yystacksize *= 2;
1477  if (YYMAXDEPTH < yystacksize)
1478  yystacksize = YYMAXDEPTH;
1479 
1480  {
1481  yytype_int16 *yyss1 = yyss;
1482  union yyalloc *yyptr =
1483  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1484  if (! yyptr)
1485  goto yyexhaustedlab;
1486  YYSTACK_RELOCATE (yyss_alloc, yyss);
1487  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1488 # undef YYSTACK_RELOCATE
1489  if (yyss1 != yyssa)
1490  YYSTACK_FREE (yyss1);
1491  }
1492 # endif
1493 #endif /* no yyoverflow */
1494 
1495  yyssp = yyss + yysize - 1;
1496  yyvsp = yyvs + yysize - 1;
1497 
1498  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1499  (unsigned long int) yystacksize));
1500 
1501  if (yyss + yystacksize - 1 <= yyssp)
1502  YYABORT;
1503  }
1504 
1505  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1506 
1507  if (yystate == YYFINAL)
1508  YYACCEPT;
1509 
1510  goto yybackup;
1511 
1512 /*-----------.
1513 | yybackup. |
1514 `-----------*/
1515 yybackup:
1516 
1517  /* Do appropriate processing given the current state. Read a
1518  lookahead token if we need one and don't already have one. */
1519 
1520  /* First try to decide what to do without reference to lookahead token. */
1521  yyn = yypact[yystate];
1522  if (yyn == YYPACT_NINF)
1523  goto yydefault;
1524 
1525  /* Not known => get a lookahead token if don't already have one. */
1526 
1527  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1528  if (yychar == YYEMPTY)
1529  {
1530  YYDPRINTF ((stderr, "Reading a token: "));
1531  yychar = YYLEX;
1532  }
1533 
1534  if (yychar <= YYEOF)
1535  {
1536  yychar = yytoken = YYEOF;
1537  YYDPRINTF ((stderr, "Now at end of input.\n"));
1538  }
1539  else
1540  {
1541  yytoken = YYTRANSLATE (yychar);
1542  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1543  }
1544 
1545  /* If the proper action on seeing token YYTOKEN is to reduce or to
1546  detect an error, take that action. */
1547  yyn += yytoken;
1548  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1549  goto yydefault;
1550  yyn = yytable[yyn];
1551  if (yyn <= 0)
1552  {
1553  if (yyn == 0 || yyn == YYTABLE_NINF)
1554  goto yyerrlab;
1555  yyn = -yyn;
1556  goto yyreduce;
1557  }
1558 
1559  /* Count tokens shifted since error; after three, turn off error
1560  status. */
1561  if (yyerrstatus)
1562  yyerrstatus--;
1563 
1564  /* Shift the lookahead token. */
1565  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1566 
1567  /* Discard the shifted token. */
1568  yychar = YYEMPTY;
1569 
1570  yystate = yyn;
1571  *++yyvsp = yylval;
1572 
1573  goto yynewstate;
1574 
1575 
1576 /*-----------------------------------------------------------.
1577 | yydefault -- do the default action for the current state. |
1578 `-----------------------------------------------------------*/
1579 yydefault:
1580  yyn = yydefact[yystate];
1581  if (yyn == 0)
1582  goto yyerrlab;
1583  goto yyreduce;
1584 
1585 
1586 /*-----------------------------.
1587 | yyreduce -- Do a reduction. |
1588 `-----------------------------*/
1589 yyreduce:
1590  /* yyn is the number of a rule to reduce with. */
1591  yylen = yyr2[yyn];
1592 
1593  /* If YYLEN is nonzero, implement the default value of the action:
1594  `$$ = $1'.
1595 
1596  Otherwise, the following line sets YYVAL to garbage.
1597  This behavior is undocumented and Bison
1598  users should not rely upon it. Assigning to YYVAL
1599  unconditionally makes the parser a bit smaller, and it avoids a
1600  GCC warning that YYVAL may be used uninitialized. */
1601  yyval = yyvsp[1-yylen];
1602 
1603 
1604  YY_REDUCE_PRINT (yyn);
1605  switch (yyn)
1606  {
1607  case 8:
1608 
1609 /* Line 1455 of yacc.c */
1610 #line 119 "parse_vcd.y"
1611  {
1612  if (!vcd->scopes) {
1613  /* no scope defined yet */
1614  vcd->scopes = (struct vcd_scope *)
1615  calloc (1, sizeof (struct vcd_scope));
1616  vcd->scopes->ident = strdup (VCD_NOSCOPE);
1617  vcd->scopes->scopes = (yyvsp[(2) - (3)].scope);
1618  (yyvsp[(2) - (3)].scope)->parent = vcd->scopes;
1619  } else {
1620  /* concatenate scope definitions */
1621  (yyvsp[(2) - (3)].scope)->next = vcd->currentscope->scopes;
1622  vcd->currentscope->scopes = (yyvsp[(2) - (3)].scope);
1623  (yyvsp[(2) - (3)].scope)->parent = vcd->currentscope;
1624  }
1625  vcd->currentscope = (yyvsp[(2) - (3)].scope);
1626  }
1627  break;
1628 
1629  case 10:
1630 
1631 /* Line 1455 of yacc.c */
1632 #line 136 "parse_vcd.y"
1633  {
1634  if (vcd->currentscope->parent) {
1635  /* up one scope */
1637  } else {
1638  fprintf (stderr, "vcd notice, unnecessary $upscope in line %d\n",
1639  vcd_lineno);
1640  }
1641  }
1642  break;
1643 
1644  case 12:
1645 
1646 /* Line 1455 of yacc.c */
1647 #line 146 "parse_vcd.y"
1648  {
1649  if (!vcd->scopes) {
1650  /* no scope defined yet */
1651  vcd->scopes = (struct vcd_scope *)
1652  calloc (1, sizeof (struct vcd_scope));
1653  vcd->scopes->ident = strdup (VCD_NOSCOPE);
1654  vcd->currentscope = vcd->scopes;
1655  }
1656  /* concatenate variable definitions */
1657  (yyvsp[(2) - (3)].vardef)->scope = vcd->currentscope;
1658  (yyvsp[(2) - (3)].vardef)->next = vcd->currentscope->vardefs;
1659  vcd->currentscope->vardefs = (yyvsp[(2) - (3)].vardef);
1660  }
1661  break;
1662 
1663  case 13:
1664 
1665 /* Line 1455 of yacc.c */
1666 #line 162 "parse_vcd.y"
1667  {
1668  (yyval.scope) = (struct vcd_scope *) calloc (1, sizeof (struct vcd_scope));
1669  (yyval.scope)->type = (yyvsp[(1) - (2)].stype);
1670  (yyval.scope)->ident = (yyvsp[(2) - (2)].ident);
1671  }
1672  break;
1673 
1674  case 14:
1675 
1676 /* Line 1455 of yacc.c */
1677 #line 170 "parse_vcd.y"
1678  { (yyval.stype) = SCOPE_MODULE; }
1679  break;
1680 
1681  case 15:
1682 
1683 /* Line 1455 of yacc.c */
1684 #line 171 "parse_vcd.y"
1685  { (yyval.stype) = SCOPE_TASK; }
1686  break;
1687 
1688  case 16:
1689 
1690 /* Line 1455 of yacc.c */
1691 #line 172 "parse_vcd.y"
1692  { (yyval.stype) = SCOPE_FUNCTION; }
1693  break;
1694 
1695  case 17:
1696 
1697 /* Line 1455 of yacc.c */
1698 #line 173 "parse_vcd.y"
1699  { (yyval.stype) = SCOPE_BEGIN; }
1700  break;
1701 
1702  case 18:
1703 
1704 /* Line 1455 of yacc.c */
1705 #line 174 "parse_vcd.y"
1706  { (yyval.stype) = SCOPE_FORK; }
1707  break;
1708 
1709  case 19:
1710 
1711 /* Line 1455 of yacc.c */
1712 #line 178 "parse_vcd.y"
1713  {
1714  vcd->t = (yyvsp[(1) - (2)].integer);
1715  vcd->scale = (yyvsp[(2) - (2)].real);
1716  }
1717  break;
1718 
1719  case 20:
1720 
1721 /* Line 1455 of yacc.c */
1722 #line 185 "parse_vcd.y"
1723  { (yyval.integer) = 1; }
1724  break;
1725 
1726  case 21:
1727 
1728 /* Line 1455 of yacc.c */
1729 #line 186 "parse_vcd.y"
1730  { (yyval.integer) = 10; }
1731  break;
1732 
1733  case 22:
1734 
1735 /* Line 1455 of yacc.c */
1736 #line 187 "parse_vcd.y"
1737  { (yyval.integer) = 100; }
1738  break;
1739 
1740  case 23:
1741 
1742 /* Line 1455 of yacc.c */
1743 #line 191 "parse_vcd.y"
1744  { (yyval.real) = 1; }
1745  break;
1746 
1747  case 24:
1748 
1749 /* Line 1455 of yacc.c */
1750 #line 192 "parse_vcd.y"
1751  { (yyval.real) = 1e-3; }
1752  break;
1753 
1754  case 25:
1755 
1756 /* Line 1455 of yacc.c */
1757 #line 193 "parse_vcd.y"
1758  { (yyval.real) = 1e-6; }
1759  break;
1760 
1761  case 26:
1762 
1763 /* Line 1455 of yacc.c */
1764 #line 194 "parse_vcd.y"
1765  { (yyval.real) = 1e-9; }
1766  break;
1767 
1768  case 27:
1769 
1770 /* Line 1455 of yacc.c */
1771 #line 195 "parse_vcd.y"
1772  { (yyval.real) = 1e-12; }
1773  break;
1774 
1775  case 28:
1776 
1777 /* Line 1455 of yacc.c */
1778 #line 196 "parse_vcd.y"
1779  { (yyval.real) = 1e-15; }
1780  break;
1781 
1782  case 29:
1783 
1784 /* Line 1455 of yacc.c */
1785 #line 200 "parse_vcd.y"
1786  {
1787  (yyval.vardef) = (struct vcd_vardef *) calloc (1, sizeof (struct vcd_vardef));
1788  (yyval.vardef)->type = (yyvsp[(1) - (5)].vtype);
1789  (yyval.vardef)->size = (yyvsp[(2) - (5)].integer);
1790  (yyval.vardef)->code = (yyvsp[(3) - (5)].ident);
1791  (yyval.vardef)->ident = (yyvsp[(4) - (5)].ident);
1792  (yyval.vardef)->range = (yyvsp[(5) - (5)].range);
1793  }
1794  break;
1795 
1796  case 30:
1797 
1798 /* Line 1455 of yacc.c */
1799 #line 210 "parse_vcd.y"
1800  { (yyval.range) = NULL; }
1801  break;
1802 
1803  case 31:
1804 
1805 /* Line 1455 of yacc.c */
1806 #line 211 "parse_vcd.y"
1807  {
1808  (yyval.range) = (struct vcd_range *) calloc (1, sizeof (struct vcd_range));
1809  (yyval.range)->l = -1;
1810  (yyval.range)->h = (yyvsp[(2) - (3)].integer);
1811  }
1812  break;
1813 
1814  case 32:
1815 
1816 /* Line 1455 of yacc.c */
1817 #line 216 "parse_vcd.y"
1818  {
1819  (yyval.range) = (struct vcd_range *) calloc (1, sizeof (struct vcd_range));
1820  (yyval.range)->l = (yyvsp[(2) - (5)].integer);
1821  (yyval.range)->h = (yyvsp[(4) - (5)].integer);
1822  }
1823  break;
1824 
1825  case 33:
1826 
1827 /* Line 1455 of yacc.c */
1828 #line 221 "parse_vcd.y"
1829  {
1830  (yyval.range) = (struct vcd_range *) calloc (1, sizeof (struct vcd_range));
1831  (yyval.range)->l = (yyvsp[(2) - (3)].integer);
1832  (yyval.range)->h = -1;
1833  }
1834  break;
1835 
1836  case 34:
1837 
1838 /* Line 1455 of yacc.c */
1839 #line 229 "parse_vcd.y"
1840  { (yyval.vtype) = VAR_EVENT;
1841  /* a special type to synchronize different statement blocks */ }
1842  break;
1843 
1844  case 35:
1845 
1846 /* Line 1455 of yacc.c */
1847 #line 231 "parse_vcd.y"
1848  { (yyval.vtype) = VAR_INTEGER;
1849  /* signed 32-bit variable */ }
1850  break;
1851 
1852  case 36:
1853 
1854 /* Line 1455 of yacc.c */
1855 #line 233 "parse_vcd.y"
1856  { (yyval.vtype) = VAR_PARAMETER;
1857  /* a named constant - the default value of a parameter can be
1858  overwritten, when declaring an instance of the associated module */ }
1859  break;
1860 
1861  case 37:
1862 
1863 /* Line 1455 of yacc.c */
1864 #line 236 "parse_vcd.y"
1865  { (yyval.vtype) = VAR_REAL;
1866  /* double-precision floating point */ }
1867  break;
1868 
1869  case 38:
1870 
1871 /* Line 1455 of yacc.c */
1872 #line 238 "parse_vcd.y"
1873  { (yyval.vtype) = VAR_REG;
1874  /* unsigned variable of any bit size */ }
1875  break;
1876 
1877  case 39:
1878 
1879 /* Line 1455 of yacc.c */
1880 #line 240 "parse_vcd.y"
1881  { (yyval.vtype) = VAR_SUPPLY0;
1882  /* constant logic 0 (supply strength) */ }
1883  break;
1884 
1885  case 40:
1886 
1887 /* Line 1455 of yacc.c */
1888 #line 242 "parse_vcd.y"
1889  { (yyval.vtype) = VAR_SUPPLY1;
1890  /* constant logic 1 (supply strength) */ }
1891  break;
1892 
1893  case 41:
1894 
1895 /* Line 1455 of yacc.c */
1896 #line 244 "parse_vcd.y"
1897  { (yyval.vtype) = VAR_TIME;
1898  /* unsigned 64-bit variable */ }
1899  break;
1900 
1901  case 42:
1902 
1903 /* Line 1455 of yacc.c */
1904 #line 246 "parse_vcd.y"
1905  { (yyval.vtype) = VAR_TRI;
1906  /* simple interconnecting wire */ }
1907  break;
1908 
1909  case 43:
1910 
1911 /* Line 1455 of yacc.c */
1912 #line 248 "parse_vcd.y"
1913  { (yyval.vtype) = VAR_TRIAND;
1914  /* wired outputs AND together */ }
1915  break;
1916 
1917  case 44:
1918 
1919 /* Line 1455 of yacc.c */
1920 #line 250 "parse_vcd.y"
1921  { (yyval.vtype) = VAR_TRIOR;
1922  /* wired outputs OR together */ }
1923  break;
1924 
1925  case 45:
1926 
1927 /* Line 1455 of yacc.c */
1928 #line 252 "parse_vcd.y"
1929  { (yyval.vtype) = VAR_TRIREG;
1930  /* stores last value when tri-stated (capacitance strength) */ }
1931  break;
1932 
1933  case 46:
1934 
1935 /* Line 1455 of yacc.c */
1936 #line 254 "parse_vcd.y"
1937  { (yyval.vtype) = VAR_TRI0;
1938  /* pulls down when tri-stated */ }
1939  break;
1940 
1941  case 47:
1942 
1943 /* Line 1455 of yacc.c */
1944 #line 256 "parse_vcd.y"
1945  { (yyval.vtype) = VAR_TRI1;
1946  /* pulls up when tri-stated */ }
1947  break;
1948 
1949  case 48:
1950 
1951 /* Line 1455 of yacc.c */
1952 #line 258 "parse_vcd.y"
1953  { (yyval.vtype) = VAR_WAND;
1954  /* wired outputs AND together */ }
1955  break;
1956 
1957  case 49:
1958 
1959 /* Line 1455 of yacc.c */
1960 #line 260 "parse_vcd.y"
1961  { (yyval.vtype) = VAR_WIRE;
1962  /* simple interconnecting wire */ }
1963  break;
1964 
1965  case 50:
1966 
1967 /* Line 1455 of yacc.c */
1968 #line 262 "parse_vcd.y"
1969  { (yyval.vtype) = VAR_WOR;
1970  /* wired outputs OR together */ }
1971  break;
1972 
1973  case 57:
1974 
1975 /* Line 1455 of yacc.c */
1976 #line 278 "parse_vcd.y"
1977  {
1978  vcd->changesets->changes = (yyvsp[(2) - (3)].change);
1979  }
1980  break;
1981 
1982  case 58:
1983 
1984 /* Line 1455 of yacc.c */
1985 #line 281 "parse_vcd.y"
1986  {
1987  (yyvsp[(1) - (1)].changeset)->next = vcd->changesets;
1988  vcd->changesets = (yyvsp[(1) - (1)].changeset);
1989  }
1990  break;
1991 
1992  case 59:
1993 
1994 /* Line 1455 of yacc.c */
1995 #line 288 "parse_vcd.y"
1996  {
1997  (yyval.changeset) = (struct vcd_changeset *) calloc (1, sizeof (struct vcd_changeset));
1998  (yyval.changeset)->t = (yyvsp[(1) - (2)].real);
1999  (yyval.changeset)->changes = (yyvsp[(2) - (2)].change);
2000  }
2001  break;
2002 
2003  case 60:
2004 
2005 /* Line 1455 of yacc.c */
2006 #line 296 "parse_vcd.y"
2007  {
2008  (yyval.real) = (yyvsp[(2) - (2)].real);
2009  }
2010  break;
2011 
2012  case 61:
2013 
2014 /* Line 1455 of yacc.c */
2015 #line 301 "parse_vcd.y"
2016  { (yyval.change) = NULL; }
2017  break;
2018 
2019  case 62:
2020 
2021 /* Line 1455 of yacc.c */
2022 #line 302 "parse_vcd.y"
2023  {
2024  (yyvsp[(1) - (2)].change)->next = (yyvsp[(2) - (2)].change);
2025  }
2026  break;
2027 
2028  case 65:
2029 
2030 /* Line 1455 of yacc.c */
2031 #line 313 "parse_vcd.y"
2032  {
2033  (yyval.change) = (struct vcd_change *) calloc (1, sizeof (struct vcd_change));
2034  (yyval.change)->value = (yyvsp[(1) - (2)].value);
2035  (yyval.change)->code = (yyvsp[(2) - (2)].ident);
2036  }
2037  break;
2038 
2039  case 70:
2040 
2041 /* Line 1455 of yacc.c */
2042 #line 328 "parse_vcd.y"
2043  {
2044  (yyval.change) = (struct vcd_change *) calloc (1, sizeof (struct vcd_change));
2045  (yyval.change)->value = (yyvsp[(2) - (3)].value);
2046  (yyval.change)->code = (yyvsp[(3) - (3)].ident);
2047  }
2048  break;
2049 
2050  case 71:
2051 
2052 /* Line 1455 of yacc.c */
2053 #line 333 "parse_vcd.y"
2054  {
2055  (yyval.change) = (struct vcd_change *) calloc (1, sizeof (struct vcd_change));
2056  (yyval.change)->value = (yyvsp[(2) - (3)].value);
2057  (yyval.change)->code = (yyvsp[(3) - (3)].ident);
2058  (yyval.change)->isreal = 1;
2059  }
2060  break;
2061 
2062 
2063 
2064 /* Line 1455 of yacc.c */
2065 #line 2066 "parse_vcd.cpp"
2066  default: break;
2067  }
2068  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2069 
2070  YYPOPSTACK (yylen);
2071  yylen = 0;
2072  YY_STACK_PRINT (yyss, yyssp);
2073 
2074  *++yyvsp = yyval;
2075 
2076  /* Now `shift' the result of the reduction. Determine what state
2077  that goes to, based on the state we popped back to and the rule
2078  number reduced by. */
2079 
2080  yyn = yyr1[yyn];
2081 
2082  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2083  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2084  yystate = yytable[yystate];
2085  else
2086  yystate = yydefgoto[yyn - YYNTOKENS];
2087 
2088  goto yynewstate;
2089 
2090 
2091 /*------------------------------------.
2092 | yyerrlab -- here on detecting error |
2093 `------------------------------------*/
2094 yyerrlab:
2095  /* If not already recovering from an error, report this error. */
2096  if (!yyerrstatus)
2097  {
2098  ++yynerrs;
2099 #if ! YYERROR_VERBOSE
2100  yyerror (YY_("syntax error"));
2101 #else
2102  {
2103  YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2104  if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2105  {
2106  YYSIZE_T yyalloc = 2 * yysize;
2107  if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2108  yyalloc = YYSTACK_ALLOC_MAXIMUM;
2109  if (yymsg != yymsgbuf)
2110  YYSTACK_FREE (yymsg);
2111  yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2112  if (yymsg)
2113  yymsg_alloc = yyalloc;
2114  else
2115  {
2116  yymsg = yymsgbuf;
2117  yymsg_alloc = sizeof yymsgbuf;
2118  }
2119  }
2120 
2121  if (0 < yysize && yysize <= yymsg_alloc)
2122  {
2123  (void) yysyntax_error (yymsg, yystate, yychar);
2124  yyerror (yymsg);
2125  }
2126  else
2127  {
2128  yyerror (YY_("syntax error"));
2129  if (yysize != 0)
2130  goto yyexhaustedlab;
2131  }
2132  }
2133 #endif
2134  }
2135 
2136 
2137 
2138  if (yyerrstatus == 3)
2139  {
2140  /* If just tried and failed to reuse lookahead token after an
2141  error, discard it. */
2142 
2143  if (yychar <= YYEOF)
2144  {
2145  /* Return failure if at end of input. */
2146  if (yychar == YYEOF)
2147  YYABORT;
2148  }
2149  else
2150  {
2151  yydestruct ("Error: discarding",
2152  yytoken, &yylval);
2153  yychar = YYEMPTY;
2154  }
2155  }
2156 
2157  /* Else will try to reuse lookahead token after shifting the error
2158  token. */
2159  goto yyerrlab1;
2160 
2161 
2162 /*---------------------------------------------------.
2163 | yyerrorlab -- error raised explicitly by YYERROR. |
2164 `---------------------------------------------------*/
2165 yyerrorlab:
2166 
2167  /* Pacify compilers like GCC when the user code never invokes
2168  YYERROR and the label yyerrorlab therefore never appears in user
2169  code. */
2170  if (/*CONSTCOND*/ 0)
2171  goto yyerrorlab;
2172 
2173  /* Do not reclaim the symbols of the rule which action triggered
2174  this YYERROR. */
2175  YYPOPSTACK (yylen);
2176  yylen = 0;
2177  YY_STACK_PRINT (yyss, yyssp);
2178  yystate = *yyssp;
2179  goto yyerrlab1;
2180 
2181 
2182 /*-------------------------------------------------------------.
2183 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2184 `-------------------------------------------------------------*/
2185 yyerrlab1:
2186  yyerrstatus = 3; /* Each real token shifted decrements this. */
2187 
2188  for (;;)
2189  {
2190  yyn = yypact[yystate];
2191  if (yyn != YYPACT_NINF)
2192  {
2193  yyn += YYTERROR;
2194  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2195  {
2196  yyn = yytable[yyn];
2197  if (0 < yyn)
2198  break;
2199  }
2200  }
2201 
2202  /* Pop the current state because it cannot handle the error token. */
2203  if (yyssp == yyss)
2204  YYABORT;
2205 
2206 
2207  yydestruct ("Error: popping",
2208  yystos[yystate], yyvsp);
2209  YYPOPSTACK (1);
2210  yystate = *yyssp;
2211  YY_STACK_PRINT (yyss, yyssp);
2212  }
2213 
2214  *++yyvsp = yylval;
2215 
2216 
2217  /* Shift the error token. */
2218  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2219 
2220  yystate = yyn;
2221  goto yynewstate;
2222 
2223 
2224 /*-------------------------------------.
2225 | yyacceptlab -- YYACCEPT comes here. |
2226 `-------------------------------------*/
2227 yyacceptlab:
2228  yyresult = 0;
2229  goto yyreturn;
2230 
2231 /*-----------------------------------.
2232 | yyabortlab -- YYABORT comes here. |
2233 `-----------------------------------*/
2234 yyabortlab:
2235  yyresult = 1;
2236  goto yyreturn;
2237 
2238 #if !defined(yyoverflow) || YYERROR_VERBOSE
2239 /*-------------------------------------------------.
2240 | yyexhaustedlab -- memory exhaustion comes here. |
2241 `-------------------------------------------------*/
2242 yyexhaustedlab:
2243  yyerror (YY_("memory exhausted"));
2244  yyresult = 2;
2245  /* Fall through. */
2246 #endif
2247 
2248 yyreturn:
2249  if (yychar != YYEMPTY)
2250  yydestruct ("Cleanup: discarding lookahead",
2251  yytoken, &yylval);
2252  /* Do not reclaim the symbols of the rule which action triggered
2253  this YYABORT or YYACCEPT. */
2254  YYPOPSTACK (yylen);
2255  YY_STACK_PRINT (yyss, yyssp);
2256  while (yyssp != yyss)
2257  {
2258  yydestruct ("Cleanup: popping",
2259  yystos[*yyssp], yyvsp);
2260  YYPOPSTACK (1);
2261  }
2262 #ifndef yyoverflow
2263  if (yyss != yyssa)
2264  YYSTACK_FREE (yyss);
2265 #endif
2266 #if YYERROR_VERBOSE
2267  if (yymsg != yymsgbuf)
2268  YYSTACK_FREE (yymsg);
2269 #endif
2270  /* Make sure YYID is used. */
2271  return YYID (yyresult);
2272 }
2273 
2274 
2275 
2276 /* Line 1675 of yacc.c */
2277 #line 342 "parse_vcd.y"
2278 
2279 
2280 int vcd_error (char * error) {
2281  fprintf (stderr, "line %d: %s\n", vcd_lineno, error);
2282  return 0;
2283 }
2284