yosys-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
verilog_parser.tab.cc
Go to the documentation of this file.
1 /* A Bison parser, made by GNU Bison 3.0.2. */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
6 
7  This program is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 
20 /* As a special exception, you may create a larger work that contains
21  part or all of the Bison parser skeleton and distribute that work
22  under terms of your choice, so long as that work isn't itself a
23  parser generator using the skeleton or a modified version thereof
24  as a parser skeleton. Alternatively, if you modify or redistribute
25  the parser skeleton itself, you may (at your option) remove this
26  special exception, which will cause the skeleton and the resulting
27  Bison output files to be licensed under the GNU General Public
28  License without this special exception.
29 
30  This special exception was added by the Free Software Foundation in
31  version 2.2 of Bison. */
32 
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34  simplifying the original so-called "semantic" parser. */
35 
36 /* All symbols defined below should begin with yy or YY, to avoid
37  infringing on user name space. This should be done even for local
38  variables, as they might otherwise be expanded by user macros.
39  There are some unavoidable exceptions within include files to
40  define necessary library symbols; they are noted "INFRINGES ON
41  USER NAME SPACE" below. */
42 
43 /* Identify Bison output. */
44 #define YYBISON 1
45 
46 /* Bison version. */
47 #define YYBISON_VERSION "3.0.2"
48 
49 /* Skeleton name. */
50 #define YYSKELETON_NAME "yacc.c"
51 
52 /* Pure parsers. */
53 #define YYPURE 0
54 
55 /* Push parsers. */
56 #define YYPUSH 0
57 
58 /* Pull parsers. */
59 #define YYPULL 1
60 
61 
62 /* Substitute the variable and function names. */
63 #define yyparse frontend_verilog_yyparse
64 #define yylex frontend_verilog_yylex
65 #define yyerror frontend_verilog_yyerror
66 #define yydebug frontend_verilog_yydebug
67 #define yynerrs frontend_verilog_yynerrs
68 
69 #define yylval frontend_verilog_yylval
70 #define yychar frontend_verilog_yychar
71 
72 /* Copy the first part of user declarations. */
73 #line 36 "frontends/verilog/verilog_parser.y" /* yacc.c:339 */
74 
75 #include <list>
76 #include <string.h>
77 #include "verilog_frontend.h"
78 #include "kernel/log.h"
79 
81 using namespace AST;
82 using namespace VERILOG_FRONTEND;
83 
85 namespace VERILOG_FRONTEND {
87  std::map<std::string, int> port_stubs;
88  std::map<std::string, AstNode*> attr_list, default_attr_list;
89  std::map<std::string, AstNode*> *albuf;
90  std::vector<AstNode*> ast_stack;
95  std::vector<char> case_type_stack;
98  bool sv_mode;
99  std::istream *lexin;
100 }
102 
103 static void append_attr(AstNode *ast, std::map<std::string, AstNode*> *al)
104 {
105  for (auto &it : *al) {
106  if (ast->attributes.count(it.first) > 0)
107  delete ast->attributes[it.first];
108  ast->attributes[it.first] = it.second;
109  }
110  delete al;
111 }
112 
113 static void append_attr_clone(AstNode *ast, std::map<std::string, AstNode*> *al)
114 {
115  for (auto &it : *al) {
116  if (ast->attributes.count(it.first) > 0)
117  delete ast->attributes[it.first];
118  ast->attributes[it.first] = it.second->clone();
119  }
120 }
121 
122 static void free_attr(std::map<std::string, AstNode*> *al)
123 {
124  for (auto &it : *al)
125  delete it.second;
126  delete al;
127 }
128 
129 
130 #line 131 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:339 */
131 
132 # ifndef YY_NULLPTR
133 # if defined __cplusplus && 201103L <= __cplusplus
134 # define YY_NULLPTR nullptr
135 # else
136 # define YY_NULLPTR 0
137 # endif
138 # endif
139 
140 /* Enabling verbose error messages. */
141 #ifdef YYERROR_VERBOSE
142 # undef YYERROR_VERBOSE
143 # define YYERROR_VERBOSE 1
144 #else
145 # define YYERROR_VERBOSE 0
146 #endif
147 
148 /* In a future release of Bison, this section will be replaced
149  by #include "verilog_parser.tab.h". */
150 #ifndef YY_FRONTEND_VERILOG_YY_FRONTENDS_VERILOG_VERILOG_PARSER_TAB_H_INCLUDED
151 # define YY_FRONTEND_VERILOG_YY_FRONTENDS_VERILOG_VERILOG_PARSER_TAB_H_INCLUDED
152 /* Debug traces. */
153 #ifndef YYDEBUG
154 # define YYDEBUG 1
155 #endif
156 #if YYDEBUG
157 extern int frontend_verilog_yydebug;
158 #endif
159 
160 /* Token type. */
161 #ifndef YYTOKENTYPE
162 # define YYTOKENTYPE
164  {
165  TOK_STRING = 258,
166  TOK_ID = 259,
167  TOK_CONST = 260,
168  TOK_REALVAL = 261,
170  ATTR_BEGIN = 263,
171  ATTR_END = 264,
173  DEFATTR_END = 266,
174  TOK_MODULE = 267,
179  TOK_INPUT = 272,
180  TOK_OUTPUT = 273,
181  TOK_INOUT = 274,
182  TOK_WIRE = 275,
183  TOK_REG = 276,
184  TOK_INTEGER = 277,
185  TOK_SIGNED = 278,
186  TOK_ASSIGN = 279,
187  TOK_ALWAYS = 280,
188  TOK_INITIAL = 281,
189  TOK_BEGIN = 282,
190  TOK_END = 283,
191  TOK_IF = 284,
192  TOK_ELSE = 285,
193  TOK_FOR = 286,
194  TOK_WHILE = 287,
195  TOK_REPEAT = 288,
197  TOK_POSEDGE = 290,
198  TOK_NEGEDGE = 291,
199  TOK_OR = 292,
200  TOK_CASE = 293,
201  TOK_CASEX = 294,
202  TOK_CASEZ = 295,
203  TOK_ENDCASE = 296,
204  TOK_DEFAULT = 297,
207  TOK_TASK = 300,
208  TOK_ENDTASK = 301,
211  TOK_GENVAR = 304,
212  TOK_REAL = 305,
215  TOK_SUPPLY0 = 308,
216  TOK_SUPPLY1 = 309,
221  TOK_ASSERT = 314,
223  OP_LOR = 316,
224  OP_LAND = 317,
225  OP_NOR = 318,
226  OP_XNOR = 319,
227  OP_NAND = 320,
228  OP_EQ = 321,
229  OP_NE = 322,
230  OP_EQX = 323,
231  OP_NEX = 324,
232  OP_LE = 325,
233  OP_GE = 326,
234  OP_SHL = 327,
235  OP_SHR = 328,
236  OP_SSHL = 329,
237  OP_SSHR = 330,
238  OP_POW = 331,
239  UNARY_OPS = 332
240  };
241 #endif
242 
243 /* Value type. */
244 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
245 typedef union YYSTYPE YYSTYPE;
246 union YYSTYPE
247 {
248 #line 95 "frontends/verilog/verilog_parser.y" /* yacc.c:355 */
249 
250  std::string *string;
251  struct YOSYS_NAMESPACE_PREFIX AST::AstNode *ast;
252  std::map<std::string, YOSYS_NAMESPACE_PREFIX AST::AstNode*> *al;
253  bool boolean;
254 
255 #line 256 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:355 */
256 };
257 # define YYSTYPE_IS_TRIVIAL 1
258 # define YYSTYPE_IS_DECLARED 1
259 #endif
260 
261 
263 
264 int frontend_verilog_yyparse (void);
265 
266 #endif /* !YY_FRONTEND_VERILOG_YY_FRONTENDS_VERILOG_VERILOG_PARSER_TAB_H_INCLUDED */
267 
268 /* Copy the second part of user declarations. */
269 
270 #line 271 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:358 */
271 
272 #ifdef short
273 # undef short
274 #endif
275 
276 #ifdef YYTYPE_UINT8
277 typedef YYTYPE_UINT8 yytype_uint8;
278 #else
279 typedef unsigned char yytype_uint8;
280 #endif
281 
282 #ifdef YYTYPE_INT8
283 typedef YYTYPE_INT8 yytype_int8;
284 #else
285 typedef signed char yytype_int8;
286 #endif
287 
288 #ifdef YYTYPE_UINT16
289 typedef YYTYPE_UINT16 yytype_uint16;
290 #else
291 typedef unsigned short int yytype_uint16;
292 #endif
293 
294 #ifdef YYTYPE_INT16
295 typedef YYTYPE_INT16 yytype_int16;
296 #else
297 typedef short int yytype_int16;
298 #endif
299 
300 #ifndef YYSIZE_T
301 # ifdef __SIZE_TYPE__
302 # define YYSIZE_T __SIZE_TYPE__
303 # elif defined size_t
304 # define YYSIZE_T size_t
305 # elif ! defined YYSIZE_T
306 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
307 # define YYSIZE_T size_t
308 # else
309 # define YYSIZE_T unsigned int
310 # endif
311 #endif
312 
313 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
314 
315 #ifndef YY_
316 # if defined YYENABLE_NLS && YYENABLE_NLS
317 # if ENABLE_NLS
318 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
319 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
320 # endif
321 # endif
322 # ifndef YY_
323 # define YY_(Msgid) Msgid
324 # endif
325 #endif
326 
327 #ifndef YY_ATTRIBUTE
328 # if (defined __GNUC__ \
329  && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
330  || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
331 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
332 # else
333 # define YY_ATTRIBUTE(Spec) /* empty */
334 # endif
335 #endif
336 
337 #ifndef YY_ATTRIBUTE_PURE
338 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
339 #endif
340 
341 #ifndef YY_ATTRIBUTE_UNUSED
342 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
343 #endif
344 
345 #if !defined _Noreturn \
346  && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
347 # if defined _MSC_VER && 1200 <= _MSC_VER
348 # define _Noreturn __declspec (noreturn)
349 # else
350 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
351 # endif
352 #endif
353 
354 /* Suppress unused-variable warnings by "using" E. */
355 #if ! defined lint || defined __GNUC__
356 # define YYUSE(E) ((void) (E))
357 #else
358 # define YYUSE(E) /* empty */
359 #endif
360 
361 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
362 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
363 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
364  _Pragma ("GCC diagnostic push") \
365  _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
366  _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
367 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
368  _Pragma ("GCC diagnostic pop")
369 #else
370 # define YY_INITIAL_VALUE(Value) Value
371 #endif
372 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
373 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
374 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
375 #endif
376 #ifndef YY_INITIAL_VALUE
377 # define YY_INITIAL_VALUE(Value) /* Nothing. */
378 #endif
379 
380 
381 #if ! defined yyoverflow || YYERROR_VERBOSE
382 
383 /* The parser invokes alloca or malloc; define the necessary symbols. */
384 
385 # ifdef YYSTACK_USE_ALLOCA
386 # if YYSTACK_USE_ALLOCA
387 # ifdef __GNUC__
388 # define YYSTACK_ALLOC __builtin_alloca
389 # elif defined __BUILTIN_VA_ARG_INCR
390 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
391 # elif defined _AIX
392 # define YYSTACK_ALLOC __alloca
393 # elif defined _MSC_VER
394 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
395 # define alloca _alloca
396 # else
397 # define YYSTACK_ALLOC alloca
398 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
399 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
400  /* Use EXIT_SUCCESS as a witness for stdlib.h. */
401 # ifndef EXIT_SUCCESS
402 # define EXIT_SUCCESS 0
403 # endif
404 # endif
405 # endif
406 # endif
407 # endif
408 
409 # ifdef YYSTACK_ALLOC
410  /* Pacify GCC's 'empty if-body' warning. */
411 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
412 # ifndef YYSTACK_ALLOC_MAXIMUM
413  /* The OS might guarantee only one guard page at the bottom of the stack,
414  and a page size can be as small as 4096 bytes. So we cannot safely
415  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
416  to allow for a few compiler-allocated temporary stack slots. */
417 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
418 # endif
419 # else
420 # define YYSTACK_ALLOC YYMALLOC
421 # define YYSTACK_FREE YYFREE
422 # ifndef YYSTACK_ALLOC_MAXIMUM
423 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
424 # endif
425 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
426  && ! ((defined YYMALLOC || defined malloc) \
427  && (defined YYFREE || defined free)))
428 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
429 # ifndef EXIT_SUCCESS
430 # define EXIT_SUCCESS 0
431 # endif
432 # endif
433 # ifndef YYMALLOC
434 # define YYMALLOC malloc
435 # if ! defined malloc && ! defined EXIT_SUCCESS
436 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
437 # endif
438 # endif
439 # ifndef YYFREE
440 # define YYFREE free
441 # if ! defined free && ! defined EXIT_SUCCESS
442 void free (void *); /* INFRINGES ON USER NAME SPACE */
443 # endif
444 # endif
445 # endif
446 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
447 
448 
449 #if (! defined yyoverflow \
450  && (! defined __cplusplus \
451  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
452 
453 /* A type that is properly aligned for any stack member. */
454 union yyalloc
455 {
456  yytype_int16 yyss_alloc;
457  YYSTYPE yyvs_alloc;
458 };
459 
460 /* The size of the maximum gap between one aligned stack and the next. */
461 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
462 
463 /* The size of an array large to enough to hold all stacks, each with
464  N elements. */
465 # define YYSTACK_BYTES(N) \
466  ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
467  + YYSTACK_GAP_MAXIMUM)
468 
469 # define YYCOPY_NEEDED 1
470 
471 /* Relocate STACK from its old location to the new one. The
472  local variables YYSIZE and YYSTACKSIZE give the old and new number of
473  elements in the stack, and YYPTR gives the new location of the
474  stack. Advance YYPTR to a properly aligned location for the next
475  stack. */
476 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
477  do \
478  { \
479  YYSIZE_T yynewbytes; \
480  YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
481  Stack = &yyptr->Stack_alloc; \
482  yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
483  yyptr += yynewbytes / sizeof (*yyptr); \
484  } \
485  while (0)
486 
487 #endif
488 
489 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
490 /* Copy COUNT objects from SRC to DST. The source and destination do
491  not overlap. */
492 # ifndef YYCOPY
493 # if defined __GNUC__ && 1 < __GNUC__
494 # define YYCOPY(Dst, Src, Count) \
495  __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
496 # else
497 # define YYCOPY(Dst, Src, Count) \
498  do \
499  { \
500  YYSIZE_T yyi; \
501  for (yyi = 0; yyi < (Count); yyi++) \
502  (Dst)[yyi] = (Src)[yyi]; \
503  } \
504  while (0)
505 # endif
506 # endif
507 #endif /* !YYCOPY_NEEDED */
508 
509 /* YYFINAL -- State number of the termination state. */
510 #define YYFINAL 3
511 /* YYLAST -- Last index in YYTABLE. */
512 #define YYLAST 1179
513 
514 /* YYNTOKENS -- Number of terminals. */
515 #define YYNTOKENS 104
516 /* YYNNTS -- Number of nonterminals. */
517 #define YYNNTS 156
518 /* YYNRULES -- Number of rules. */
519 #define YYNRULES 338
520 /* YYNSTATES -- Number of states. */
521 #define YYNSTATES 650
522 
523 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
524  by yylex, with out-of-bounds checking. */
525 #define YYUNDEFTOK 2
526 #define YYMAXUTOK 332
527 
528 #define YYTRANSLATE(YYX) \
529  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
530 
531 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
532  as returned by yylex, without out-of-bounds checking. */
533 static const yytype_uint8 yytranslate[] =
534 {
535  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
536  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
537  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
538  2, 2, 2, 103, 2, 92, 2, 85, 67, 2,
539  93, 94, 83, 81, 88, 82, 90, 84, 2, 2,
540  2, 2, 2, 2, 2, 2, 2, 2, 96, 91,
541  73, 89, 76, 101, 98, 2, 2, 2, 2, 2,
542  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
543  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
544  2, 95, 2, 97, 65, 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, 99, 63, 100, 102, 2, 2, 2,
548  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
549  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
550  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
551  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
552  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
553  2, 2, 2, 2, 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, 1, 2, 3, 4,
561  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
562  15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
563  25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
564  35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
565  45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
566  55, 56, 57, 58, 59, 60, 61, 62, 64, 66,
567  68, 69, 70, 71, 72, 74, 75, 77, 78, 79,
568  80, 86, 87
569 };
570 
571 #if YYDEBUG
572  /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
573 static const yytype_uint16 yyrline[] =
574 {
575  0, 141, 141, 141, 152, 153, 154, 154, 158, 158,
576  171, 171, 175, 182, 175, 188, 188, 191, 192, 195,
577  201, 209, 212, 222, 222, 243, 243, 243, 243, 246,
578  247, 247, 251, 251, 255, 258, 258, 258, 261, 261,
579  264, 264, 267, 277, 281, 281, 294, 294, 308, 313,
580  313, 320, 320, 323, 326, 329, 333, 335, 338, 344,
581  350, 355, 360, 365, 370, 376, 379, 385, 388, 393,
582  394, 397, 400, 408, 410, 410, 414, 414, 414, 414,
583  414, 414, 414, 415, 415, 415, 415, 418, 418, 428,
584  428, 439, 439, 451, 451, 463, 463, 486, 491, 497,
585  497, 501, 502, 503, 503, 507, 510, 515, 515, 515,
586  519, 515, 527, 527, 530, 530, 551, 554, 554, 558,
587  560, 563, 570, 573, 577, 580, 589, 589, 597, 597,
588  605, 605, 608, 620, 623, 623, 626, 637, 652, 637,
589  658, 666, 676, 676, 679, 680, 690, 732, 735, 735,
590  738, 743, 743, 752, 752, 762, 765, 770, 771, 774,
591  774, 781, 781, 790, 791, 794, 795, 795, 801, 801,
592  803, 804, 805, 808, 813, 821, 822, 823, 824, 824,
593  830, 835, 842, 850, 855, 850, 863, 863, 877, 878,
594  879, 880, 881, 881, 885, 886, 887, 890, 895, 900,
595  907, 910, 915, 920, 925, 929, 936, 936, 936, 937,
596  938, 938, 948, 948, 964, 969, 971, 964, 979, 979,
597  992, 992, 1005, 1005, 1019, 1019, 1030, 1033, 1036, 1041,
598  1045, 1048, 1052, 1053, 1056, 1056, 1060, 1060, 1066, 1070,
599  1070, 1074, 1078, 1074, 1090, 1090, 1094, 1098, 1094, 1106,
600  1107, 1110, 1113, 1116, 1121, 1126, 1131, 1138, 1141, 1146,
601  1150, 1156, 1156, 1160, 1160, 1164, 1165, 1168, 1173, 1173,
602  1177, 1177, 1181, 1185, 1181, 1190, 1190, 1198, 1198, 1206,
603  1206, 1220, 1220, 1229, 1229, 1232, 1232, 1235, 1238, 1247,
604  1250, 1260, 1272, 1279, 1285, 1296, 1300, 1300, 1310, 1314,
605  1318, 1321, 1324, 1327, 1331, 1335, 1339, 1343, 1347, 1351,
606  1356, 1360, 1365, 1369, 1373, 1377, 1381, 1385, 1389, 1393,
607  1397, 1401, 1405, 1409, 1413, 1417, 1421, 1425, 1429, 1433,
608  1437, 1441, 1445, 1449, 1453, 1457, 1461, 1467, 1470
609 };
610 #endif
611 
612 #if YYDEBUG || YYERROR_VERBOSE || 0
613 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
614  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
615 static const char *const yytname[] =
616 {
617  "$end", "error", "$undefined", "TOK_STRING", "TOK_ID", "TOK_CONST",
618  "TOK_REALVAL", "TOK_PRIMITIVE", "ATTR_BEGIN", "ATTR_END",
619  "DEFATTR_BEGIN", "DEFATTR_END", "TOK_MODULE", "TOK_ENDMODULE",
620  "TOK_PARAMETER", "TOK_LOCALPARAM", "TOK_DEFPARAM", "TOK_INPUT",
621  "TOK_OUTPUT", "TOK_INOUT", "TOK_WIRE", "TOK_REG", "TOK_INTEGER",
622  "TOK_SIGNED", "TOK_ASSIGN", "TOK_ALWAYS", "TOK_INITIAL", "TOK_BEGIN",
623  "TOK_END", "TOK_IF", "TOK_ELSE", "TOK_FOR", "TOK_WHILE", "TOK_REPEAT",
624  "TOK_DPI_FUNCTION", "TOK_POSEDGE", "TOK_NEGEDGE", "TOK_OR", "TOK_CASE",
625  "TOK_CASEX", "TOK_CASEZ", "TOK_ENDCASE", "TOK_DEFAULT", "TOK_FUNCTION",
626  "TOK_ENDFUNCTION", "TOK_TASK", "TOK_ENDTASK", "TOK_GENERATE",
627  "TOK_ENDGENERATE", "TOK_GENVAR", "TOK_REAL", "TOK_SYNOPSYS_FULL_CASE",
628  "TOK_SYNOPSYS_PARALLEL_CASE", "TOK_SUPPLY0", "TOK_SUPPLY1",
629  "TOK_TO_SIGNED", "TOK_TO_UNSIGNED", "TOK_POS_INDEXED", "TOK_NEG_INDEXED",
630  "TOK_ASSERT", "TOK_PROPERTY", "OP_LOR", "OP_LAND", "'|'", "OP_NOR",
631  "'^'", "OP_XNOR", "'&'", "OP_NAND", "OP_EQ", "OP_NE", "OP_EQX", "OP_NEX",
632  "'<'", "OP_LE", "OP_GE", "'>'", "OP_SHL", "OP_SHR", "OP_SSHL", "OP_SSHR",
633  "'+'", "'-'", "'*'", "'/'", "'%'", "OP_POW", "UNARY_OPS", "','", "'='",
634  "'.'", "';'", "'#'", "'('", "')'", "'['", "':'", "']'", "'@'", "'{'",
635  "'}'", "'?'", "'~'", "'!'", "$accept", "input", "$@1", "design", "attr",
636  "$@2", "attr_opt", "defattr", "$@3", "$@4", "opt_attr_list", "attr_list",
637  "attr_assign", "hierarchical_id", "module", "$@5", "module_para_opt",
638  "$@6", "$@7", "module_para_list", "single_module_para", "$@8",
639  "module_args_opt", "module_args", "optional_comma",
640  "module_arg_opt_assignment", "module_arg", "$@9", "$@10", "wire_type",
641  "$@11", "wire_type_token_list", "wire_type_token", "non_opt_range",
642  "non_opt_multirange", "range", "range_or_multirange",
643  "range_or_signed_int", "module_body", "module_body_stmt",
644  "task_func_decl", "$@12", "$@13", "$@14", "$@15", "$@16",
645  "dpi_function_arg", "opt_dpi_function_args", "dpi_function_args",
646  "opt_signed", "task_func_args_opt", "$@17", "$@18", "task_func_args",
647  "task_func_port", "$@19", "task_func_body", "param_signed",
648  "param_integer", "param_real", "param_range", "param_decl", "$@20",
649  "localparam_decl", "$@21", "param_decl_list", "single_param_decl",
650  "defparam_decl", "defparam_decl_list", "single_defparam_decl",
651  "wire_decl", "$@22", "$@23", "wire_name_list",
652  "wire_name_and_opt_assign", "wire_name", "assign_stmt",
653  "assign_expr_list", "assign_expr", "cell_stmt", "$@24", "$@25",
654  "tok_prim_wrapper", "cell_list", "single_cell", "$@26", "$@27",
655  "prim_list", "single_prim", "$@28", "cell_parameter_list_opt",
656  "cell_parameter_list", "cell_parameter", "cell_port_list", "$@29",
657  "cell_port", "always_stmt", "$@30", "$@31", "$@32", "always_cond",
658  "always_events", "always_event", "opt_label", "assert",
659  "assert_property", "simple_behavioral_stmt", "behavioral_stmt", "$@33",
660  "$@34", "$@35", "$@36", "$@37", "$@38", "$@39", "$@40", "$@41",
661  "case_type", "opt_synopsys_attr", "behavioral_stmt_opt",
662  "behavioral_stmt_list", "optional_else", "$@42", "case_body",
663  "case_item", "$@43", "$@44", "gen_case_body", "gen_case_item", "$@45",
664  "$@46", "case_select", "case_expr_list", "rvalue", "lvalue",
665  "lvalue_concat_list", "opt_arg_list", "arg_list", "arg_list2",
666  "single_arg", "module_gen_body", "gen_stmt_or_module_body_stmt",
667  "gen_stmt", "$@47", "$@48", "$@49", "$@50", "$@51", "gen_stmt_block",
668  "$@52", "gen_stmt_or_null", "opt_gen_else", "expr", "basic_expr", "$@53",
669  "concat_list", YY_NULLPTR
670 };
671 #endif
672 
673 # ifdef YYPRINT
674 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
675  (internal) symbol number NUM (which must be that of a token). */
676 static const yytype_uint16 yytoknum[] =
677 {
678  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
679  265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
680  275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
681  285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
682  295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
683  305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
684  315, 316, 317, 124, 318, 94, 319, 38, 320, 321,
685  322, 323, 324, 60, 325, 326, 62, 327, 328, 329,
686  330, 43, 45, 42, 47, 37, 331, 332, 44, 61,
687  46, 59, 35, 40, 41, 91, 58, 93, 64, 123,
688  125, 63, 126, 33
689 };
690 # endif
691 
692 #define YYPACT_NINF -521
693 
694 #define yypact_value_is_default(Yystate) \
695  (!!((Yystate) == (-521)))
696 
697 #define YYTABLE_NINF -252
698 
699 #define yytable_value_is_error(Yytable_value) \
700  0
701 
702  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
703  STATE-NUM. */
704 static const yytype_int16 yypact[] =
705 {
706  -521, 44, 28, -521, -521, -521, 19, -521, 28, 28,
707  28, 42, 62, 71, 54, 98, 161, -521, -521, -521,
708  -521, -521, 40, -521, 117, -521, 14, -521, 18, -521,
709  42, 173, 42, 864, 182, 103, -521, 193, 197, -521,
710  864, -521, -521, 204, 119, 207, -521, -521, -521, 213,
711  -521, -521, -521, -521, -521, -521, -521, -521, -521, -521,
712  -521, 864, 864, -521, -521, 167, -521, -521, 962, -521,
713  129, 139, 144, 224, 145, 3, -521, 159, 174, -521,
714  -521, 165, 168, 864, 864, 864, 864, 864, 864, 864,
715  864, 180, -47, 176, 864, 864, -521, 864, -521, 183,
716  183, -521, -521, -521, -521, -521, -521, -521, -521, -521,
717  -521, -521, -521, -521, -521, -521, -521, -521, -521, -521,
718  -521, -521, -521, -521, -521, -521, -521, -521, 11, 186,
719  275, 192, -521, 280, 864, 864, 864, -521, 119, -521,
720  281, -521, 864, 864, -521, -521, -521, -521, -521, -521,
721  -521, -521, 284, 864, 864, -521, -521, -521, 124, 194,
722  -521, -521, 864, 864, 864, 864, 864, 864, 864, 864,
723  864, 864, 864, 864, 864, 864, 864, 864, 864, 864,
724  864, 864, 864, 864, 864, 864, 864, 41, -521, 196,
725  -521, -521, 203, -521, -521, 297, -521, -31, -521, 144,
726  300, 208, 209, 210, 217, 183, -521, 222, -521, -521,
727  12, 223, 225, -521, 228, -521, 226, 233, 864, 995,
728  1019, 1041, 1061, 1061, 1079, 1093, 1093, 1093, 1093, 460,
729  460, 460, 460, 371, 371, 371, 371, 163, 163, 242,
730  242, 242, -521, 234, 240, -521, -521, 246, -521, 250,
731  251, 183, 221, 22, 248, 489, -521, 275, -521, 249,
732  -521, -521, -521, -521, -521, 183, -521, -521, 183, 0,
733  -521, -521, 253, 864, 282, -521, 120, -521, -521, 252,
734  -521, -521, -42, -521, -521, 247, 42, 260, -521, -521,
735  -521, 864, 864, 326, 257, 41, 864, -521, -521, 356,
736  -521, -521, -521, -521, -521, -521, -521, -521, 221, -521,
737  -521, -521, -521, -521, -521, 183, 864, 267, 271, 272,
738  -521, -521, -521, -521, 306, 406, -521, -521, -521, -521,
739  -521, -521, -521, -521, -521, -521, -521, 276, -521, -521,
740  -521, 144, 160, -521, -521, 278, 864, 273, 286, 267,
741  283, 285, 288, 292, 382, 385, 183, 301, -521, -521,
742  864, 864, -521, 81, -521, 864, 296, -521, -521, -521,
743  373, -521, -521, -521, -521, -521, 326, 326, 42, -32,
744  -521, -15, -521, 304, 392, -521, 864, -521, 574, 309,
745  -521, -521, -521, -521, -521, -521, 864, 308, -521, 281,
746  -521, 303, -521, 864, -521, 864, -521, 864, 864, 312,
747  313, -521, 864, 314, -521, -521, -521, -521, -521, 183,
748  250, 373, 373, 141, 183, -521, 864, -521, 864, -521,
749  -521, 311, -2, -521, -521, -521, -521, 864, 316, 318,
750  64, 407, 320, -521, -521, 321, -521, -521, 323, -2,
751  324, 325, -521, -521, 281, 328, 864, 329, -521, 419,
752  -521, 374, 374, 864, -521, -521, -521, 944, -521, 335,
753  333, 337, 407, 96, -521, -521, 183, -521, 97, -521,
754  340, -521, -521, 170, -521, 343, -521, -521, 348, -521,
755  350, -521, 260, -521, -521, -521, 183, 183, -521, 267,
756  -521, 864, 346, 782, 105, -521, 347, -521, 634, 64,
757  -521, 349, 407, -521, 675, -521, 267, -521, 64, 864,
758  64, 64, 281, 353, 864, -521, 351, 419, 419, -521,
759  416, 971, -521, -521, 444, 364, 362, -521, 407, -521,
760  -521, -521, 864, 864, 369, 123, -521, -521, -521, 372,
761  675, -521, -521, 463, 370, 380, -521, 428, -521, 440,
762  -521, -521, -521, -521, -521, -521, 37, -521, 135, -521,
763  136, 383, -521, -521, 386, 378, -521, 782, -521, -521,
764  -521, -521, 716, 716, -521, 675, 387, 675, 389, -521,
765  675, -521, -521, 823, -521, -521, 394, -521, -521, 435,
766  419, -521, -521, -521, -521, -521, -2, 864, -521, -521,
767  -521, 393, -521, -521, 289, -521, -46, -521, 21, -521,
768  64, -2, -521, -521, 823, -521, 395, 396, -521, -521,
769  398, 383, 864, -521, -521, 399, -521, -521, -521, -521,
770  -521, -521, -521, 114, -521, 64, -521, -521, -521, -521
771 };
772 
773  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
774  Performed when YYTABLE does not specify something else to do. Zero
775  means the default is an error. */
776 static const yytype_uint16 yydefact[] =
777 {
778  2, 0, 8, 1, 12, 3, 0, 11, 8, 8,
779  8, 16, 0, 0, 106, 0, 9, 5, 4, 6,
780  21, 13, 15, 17, 19, 23, 0, 105, 68, 93,
781  16, 0, 0, 0, 0, 28, 87, 0, 0, 72,
782  0, 67, 71, 0, 108, 0, 14, 18, 295, 293,
783  294, 8, 8, 8, 8, 8, 8, 8, 8, 8,
784  8, 0, 0, 8, 8, 68, 289, 20, 287, 22,
785  0, 36, 100, 0, 0, 0, 95, 109, 0, 10,
786  292, 0, 0, 0, 0, 0, 0, 0, 0, 0,
787  0, 0, 337, 0, 0, 0, 291, 0, 296, 67,
788  256, 255, 8, 8, 8, 8, 8, 8, 8, 8,
789  8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
790  8, 8, 8, 8, 8, 8, 8, 25, 8, 0,
791  104, 0, 89, 0, 0, 0, 0, 64, 108, 107,
792  8, 118, 0, 0, 310, 311, 312, 313, 308, 309,
793  332, 333, 300, 0, 0, 301, 303, 336, 0, 0,
794  65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
795  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
796  0, 0, 0, 0, 0, 0, 0, 31, 44, 0,
797  35, 49, 41, 38, 75, 98, 103, 0, 88, 100,
798  0, 0, 0, 0, 0, 68, 49, 41, 112, 116,
799  8, 0, 0, 290, 337, 338, 0, 64, 264, 335,
800  334, 305, 306, 307, 304, 320, 321, 322, 323, 318,
801  319, 324, 325, 314, 315, 316, 317, 326, 327, 328,
802  329, 330, 331, 0, 0, 32, 26, 29, 34, 43,
803  0, 68, 0, 8, 0, 8, 97, 102, 99, 0,
804  91, 62, 63, 61, 118, 70, 69, 146, 68, 8,
805  110, 94, 0, 0, 49, 206, 8, 208, 207, 0,
806  117, 257, 0, 298, 299, 0, 0, 41, 263, 265,
807  267, 0, 0, 120, 0, 31, 0, 45, 48, 0,
808  53, 54, 55, 56, 57, 58, 60, 59, 50, 51,
809  39, 37, 24, 126, 128, 68, 0, 201, 0, 0,
810  226, 227, 228, 269, 0, 49, 85, 73, 76, 77,
811  78, 79, 80, 81, 82, 83, 86, 0, 74, 101,
812  90, 100, 8, 114, 113, 0, 0, 0, 259, 201,
813  0, 0, 0, 0, 0, 0, 68, 0, 210, 209,
814  0, 0, 302, 68, 254, 40, 0, 288, 132, 119,
815  122, 27, 30, 42, 46, 52, 120, 120, 0, 0,
816  134, 0, 148, 0, 0, 279, 0, 272, 8, 0,
817  151, 155, 183, 186, 156, 153, 0, 0, 96, 0,
818  111, 0, 258, 0, 212, 0, 214, 0, 0, 0,
819  0, 137, 0, 262, 205, 204, 266, 297, 121, 68,
820  43, 122, 122, 0, 68, 133, 0, 147, 0, 200,
821  269, 0, 0, 84, 271, 268, 270, 0, 169, 193,
822  8, 166, 0, 92, 115, 0, 260, 235, 0, 0,
823  0, 0, 140, 141, 0, 0, 264, 0, 125, 0,
824  47, 124, 124, 0, 135, 149, 150, 8, 275, 0,
825  0, 0, 0, 0, 184, 187, 159, 165, 0, 163,
826  0, 277, 202, 8, 222, 0, 218, 220, 138, 142,
827  144, 224, 41, 211, 33, 123, 68, 68, 136, 201,
828  281, 0, 0, 170, 0, 157, 0, 192, 0, 8,
829  161, 0, 166, 154, 175, 245, 201, 234, 8, 0,
830  8, 8, 0, 0, 0, 231, 0, 0, 0, 280,
831  286, 8, 273, 203, 0, 0, 171, 173, 0, 152,
832  190, 191, 0, 0, 0, 0, 194, 199, 185, 0,
833  175, 164, 178, 0, 0, 176, 180, 246, 213, 238,
834  215, 219, 221, 143, 139, 145, 240, 261, 0, 130,
835  0, 281, 276, 282, 0, 0, 168, 170, 158, 197,
836  198, 189, 0, 0, 188, 175, 0, 175, 0, 167,
837  175, 278, 244, 0, 236, 223, 0, 229, 230, 241,
838  0, 127, 129, 284, 283, 285, 0, 0, 172, 195,
839  196, 0, 160, 179, 0, 177, 250, 247, 0, 252,
840  8, 0, 225, 239, 0, 131, 0, 0, 162, 182,
841  0, 281, 0, 249, 237, 0, 242, 281, 174, 181,
842  248, 253, 216, 8, 274, 8, 233, 232, 243, 217
843 };
844 
845  /* YYPGOTO[NTERM-NUM]. */
846 static const yytype_int16 yypgoto[] =
847 {
848  -521, -521, -521, 111, 27, -521, -521, -1, -521, -521,
849  453, -521, 456, -11, -521, -521, -521, -521, -521, 200,
850  -521, -521, -521, -521, -194, 77, 255, -521, -521, -152,
851  -521, -521, 198, -51, 295, -18, -521, -521, -521, 256,
852  -232, -521, -521, -521, -521, -521, 244, -182, -521, -521,
853  379, -521, -521, -521, 243, -521, 258, -125, -166, 57,
854  -230, -521, -521, -521, -521, -7, -432, -521, -521, 99,
855  -231, -521, -521, -521, 2, -356, -521, -521, 100, -521,
856  -521, -521, -521, -521, -466, -521, -521, -521, 13, -521,
857  -521, -45, -521, -520, -521, -521, -521, -521, -521, -521,
858  -521, -521, -311, -338, -521, -521, -429, -318, -521, -521,
859  -521, -521, -521, -521, -521, -521, -521, 259, -521, -521,
860  -521, -521, -521, -521, -521, -521, -521, -521, -521, -521,
861  -521, -93, -521, -159, -521, 131, -521, 79, -521, 185,
862  121, 16, 298, -521, -521, -521, -521, -521, -475, -521,
863  -79, -521, -28, 483, -521, 403
864 };
865 
866  /* YYDEFGOTO[NTERM-NUM]. */
867 static const yytype_int16 yydefgoto[] =
868 {
869  -1, 1, 2, 5, 274, 7, 16, 275, 11, 31,
870  21, 22, 23, 65, 9, 35, 71, 187, 294, 246,
871  247, 293, 129, 192, 254, 297, 193, 249, 420, 356,
872  252, 308, 309, 41, 100, 101, 267, 43, 255, 434,
873  10, 72, 199, 341, 44, 138, 196, 131, 197, 28,
874  78, 140, 345, 207, 208, 399, 210, 370, 419, 496,
875  459, 329, 376, 330, 377, 568, 248, 331, 379, 380,
876  277, 454, 523, 488, 489, 209, 333, 381, 382, 334,
877  438, 441, 395, 504, 477, 511, 549, 478, 479, 480,
878  472, 535, 536, 554, 587, 555, 335, 439, 509, 440,
879  474, 545, 546, 385, 278, 336, 279, 280, 413, 447,
880  449, 596, 645, 520, 521, 518, 525, 337, 566, 648,
881  483, 595, 620, 599, 623, 624, 643, 557, 592, 593,
882  631, 617, 618, 66, 282, 347, 457, 287, 288, 289,
883  388, 435, 436, 432, 574, 500, 515, 430, 604, 531,
884  605, 572, 556, 68, 159, 93
885 };
886 
887  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
888  positive, shift that token. If negative, reduce the rule whose
889  number is the opposite. If YYTABLE_NINF, syntax error. */
890 static const yytype_int16 yytable[] =
891 {
892  24, 8, 20, 469, 205, 67, 505, 8, 8, 8,
893  42, 404, 75, 270, 99, 188, 20, 259, 36, 24,
894  485, 24, 4, 328, 332, 530, 188, 494, -7, 6,
895  586, 12, 360, 91, 92, 6, 6, 6, 4, 251,
896  39, 153, -251, 444, 3, 244, 20, 361, 160, 161,
897  -251, 281, 154, 13, 268, 245, 424, 257, 271, 425,
898  134, 135, 14, 258, 15, 611, 25, 613, 20, 158,
899  615, 272, 578, 426, 4, 26, 427, 27, 81, 82,
900  83, 84, 85, 86, 87, 88, 89, 90, 597, 598,
901  94, 95, 98, 366, -40, 569, 569, 273, 490, 136,
902  137, 189, 29, 37, 506, 190, 201, 202, 203, 632,
903  38, 273, 189, 40, 211, 212, -40, 633, 20, 17,
904  18, 19, 475, 272, 4, 214, 216, 364, 32, 162,
905  163, 164, 165, 166, 167, 168, 169, 170, 171, 172,
906  173, 174, 175, 176, 177, 178, 179, 180, 181, 182,
907  183, 184, 185, 186, 99, 191, 328, 332, 243, 397,
908  582, 529, 644, 273, 20, 517, 490, 206, 625, 30,
909  4, 34, 96, 272, 20, -8, 97, 626, 558, 507,
910  4, 134, 135, 281, 46, 512, 69, 266, 513, 508,
911  290, 548, 635, 538, -68, 70, 539, 73, 516, 276,
912  559, 74, 561, 562, 398, 646, 33, 34, 76, -68,
913  34, 583, 77, 273, 161, 97, 79, 584, 80, 272,
914  136, 217, 127, 600, 600, 99, 601, 602, 132, 272,
915  463, 34, 128, 299, 133, 328, 332, 130, 300, 301,
916  302, 303, 304, 305, 306, 348, 122, 123, 124, 125,
917  343, 421, 422, 139, 326, 461, 462, 34, 142, 273,
918  -8, 143, 97, 367, 368, 141, 527, 528, 373, 273,
919  307, 609, 610, 281, 152, 363, 155, 194, 40, 195,
920  191, 281, 325, 198, 200, 205, 250, 218, 383, 213,
921  281, 253, 48, 20, 49, 50, 206, 378, 526, 328,
922  332, 256, 634, 358, 260, 261, 262, 263, 264, 349,
923  269, 350, 99, 351, 352, 353, 153, 283, 401, 284,
924  320, 321, 322, 286, 281, 647, 285, 649, 125, 292,
925  291, 276, 414, 415, 295, 354, 355, 290, 411, 296,
926  340, 298, 311, 359, 51, 52, 346, 362, 365, 369,
927  281, 371, 53, 54, 55, 56, 57, 58, 431, 281,
928  374, 281, 281, 384, 386, 387, 389, 423, 442, 396,
929  59, 60, 400, 402, 403, 348, 405, 448, 406, 450,
930  451, 407, 61, 629, 455, 408, 409, 326, 62, 410,
931  417, 63, 64, 428, 412, 418, 429, 445, 383, 443,
932  466, 458, 437, 452, 453, 468, 378, 456, 471, 470,
933  390, 476, 482, 391, 481, 325, 473, 484, 486, 487,
934  493, 363, 491, 244, 495, 510, 501, 502, 290, 276,
935  503, 392, 393, 514, 519, 498, 522, 533, 363, 524,
936  13, 540, 550, 394, 564, 567, 571, 281, 575, 14,
937  577, 15, 120, 121, 122, 123, 124, 125, 576, 354,
938  355, 281, 281, 581, 589, 585, 326, 588, 590, 591,
939  594, 607, 276, 532, 603, 537, 622, 606, 458, 458,
940  547, 612, 614, 45, 281, 621, 281, 628, 47, 637,
941  638, 560, 639, 642, 325, 372, 565, 460, 276, 4,
942  265, 339, 312, 313, 314, 315, 375, 276, 310, 276,
943  276, 327, 344, 316, 579, 580, 317, 204, 318, 497,
944  319, 570, 342, 464, 563, 551, 465, 320, 321, 322,
945  326, 636, 608, 357, 446, 492, 323, 116, 117, 118,
946  119, 120, 121, 122, 123, 124, 125, 573, 324, 537,
947  416, 467, 640, 338, 547, 547, 215, 0, 325, 0,
948  0, 0, 0, 0, 0, 619, 144, 145, 146, 147,
949  148, 149, 150, 151, 0, 0, 0, 156, 157, 627,
950  0, 0, 0, 0, 4, 0, 630, 0, 313, 314,
951  315, 0, 0, 0, 0, 363, 619, 0, 316, 0,
952  0, 317, 0, 318, 641, 319, 0, 0, 0, 276,
953  363, 0, 320, 321, 322, 0, 0, 0, 0, 0,
954  0, 323, 433, 0, 0, 0, 0, 0, 0, 0,
955  0, 0, 276, 324, 276, 0, 0, 48, 20, 49,
956  50, 0, 0, 541, 0, 219, 220, 221, 222, 223,
957  224, 225, 226, 227, 228, 229, 230, 231, 232, 233,
958  234, 235, 236, 237, 238, 239, 240, 241, 242, 542,
959  543, 0, 0, 0, 0, 0, 0, 0, 48, 20,
960  49, 50, 0, 0, 0, 0, 0, 0, 0, 51,
961  52, 0, 0, 0, 0, 0, 0, 53, 54, 55,
962  56, 57, 58, 0, 0, 0, 0, 0, 0, 0,
963  0, 0, 0, 0, 0, 59, 60, 544, 0, 48,
964  20, 49, 50, 0, 0, 0, 0, 61, 0, 0,
965  51, 52, 0, 62, 0, 0, 63, 64, 53, 54,
966  55, 56, 57, 58, 0, 0, 0, 0, 0, 0,
967  0, 542, 543, 0, 0, 0, 59, 60, 0, 0,
968  0, 0, 0, 552, 0, 553, 0, 0, 61, 0,
969  0, 51, 52, 0, 62, 0, 0, 63, 64, 53,
970  54, 55, 56, 57, 58, 48, 20, 49, 50, 0,
971  0, 0, 0, 0, 0, 0, 0, 59, 60, 0,
972  0, 0, 0, 0, 0, 0, 0, 0, 0, 61,
973  0, 0, 0, 0, 0, 62, 0, 0, 63, 64,
974  0, 0, 0, 0, 0, 0, 48, 20, 49, 50,
975  0, 0, 0, 0, 0, 0, 0, 51, 52, 0,
976  0, 0, 0, 0, 0, 53, 54, 55, 56, 57,
977  58, 0, 0, 0, 0, 0, 0, 0, 0, 0,
978  0, 0, 0, 59, 60, 616, 0, 48, 20, 49,
979  50, 0, 534, 0, 0, 61, 0, 0, 51, 52,
980  0, 62, 0, 0, 63, 64, 53, 54, 55, 56,
981  57, 58, 0, 0, 0, 0, 0, 0, 0, 0,
982  0, 0, 0, 0, 59, 60, 0, 0, 0, 0,
983  0, 0, 0, 0, 0, 0, 61, 0, 0, 51,
984  52, 0, 62, 0, 0, 63, 64, 53, 54, 55,
985  56, 57, 58, 0, 0, 0, 0, 0, 0, 0,
986  0, 0, 0, 0, 0, 59, 60, 0, 0, 0,
987  0, 0, 0, 0, 4, 0, 0, 61, 313, 314,
988  315, 0, 0, 62, 0, 0, 63, 64, 316, 0,
989  0, 317, 499, 318, 0, 319, 0, 0, 0, 0,
990  0, 4, 320, 321, 322, 313, 314, 315, 0, 0,
991  0, 323, 0, 0, 0, 316, 0, 0, 317, 0,
992  318, 0, 319, 324, 0, 0, 0, 0, 0, 320,
993  321, 322, 0, 0, 0, 0, 0, 0, 323, 0,
994  0, 0, 0, 102, 103, 104, 0, 105, 106, 107,
995  324, 108, 109, 110, 111, 112, 113, 114, 115, 116,
996  117, 118, 119, 120, 121, 122, 123, 124, 125, 0,
997  0, 0, 0, 0, 0, 0, 0, 103, 104, 0,
998  105, 106, 107, 126, 108, 109, 110, 111, 112, 113,
999  114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
1000  124, 125, 104, 0, 105, 106, 107, 0, 108, 109,
1001  110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
1002  120, 121, 122, 123, 124, 125, 105, 106, 107, 0,
1003  108, 109, 110, 111, 112, 113, 114, 115, 116, 117,
1004  118, 119, 120, 121, 122, 123, 124, 125, 107, 0,
1005  108, 109, 110, 111, 112, 113, 114, 115, 116, 117,
1006  118, 119, 120, 121, 122, 123, 124, 125, 108, 109,
1007  110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
1008  120, 121, 122, 123, 124, 125, 112, 113, 114, 115,
1009  116, 117, 118, 119, 120, 121, 122, 123, 124, 125
1010 };
1011 
1012 static const yytype_int16 yycheck[] =
1013 {
1014  11, 2, 4, 432, 4, 33, 472, 8, 9, 10,
1015  28, 349, 40, 207, 65, 4, 4, 199, 4, 30,
1016  449, 32, 10, 255, 255, 500, 4, 459, 0, 2,
1017  550, 12, 74, 61, 62, 8, 9, 10, 10, 191,
1018  22, 88, 88, 399, 0, 4, 4, 89, 99, 100,
1019  96, 210, 99, 34, 206, 14, 88, 88, 46, 91,
1020  57, 58, 43, 94, 45, 585, 4, 587, 4, 97,
1021  590, 59, 538, 88, 10, 4, 91, 23, 51, 52,
1022  53, 54, 55, 56, 57, 58, 59, 60, 51, 52,
1023  63, 64, 65, 287, 94, 527, 528, 99, 454, 96,
1024  97, 90, 4, 89, 8, 94, 134, 135, 136, 88,
1025  96, 99, 90, 95, 142, 143, 94, 96, 4, 8,
1026  9, 10, 440, 59, 10, 153, 154, 286, 88, 102,
1027  103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
1028  113, 114, 115, 116, 117, 118, 119, 120, 121, 122,
1029  123, 124, 125, 126, 205, 128, 388, 388, 186, 341,
1030  37, 499, 637, 99, 4, 483, 522, 140, 600, 8,
1031  10, 90, 5, 59, 4, 8, 95, 606, 516, 83,
1032  10, 57, 58, 342, 11, 88, 4, 205, 91, 93,
1033  218, 509, 621, 88, 74, 92, 91, 4, 28, 210,
1034  518, 4, 520, 521, 44, 91, 89, 90, 4, 89,
1035  90, 88, 93, 99, 265, 95, 9, 94, 5, 59,
1036  96, 97, 93, 88, 88, 276, 91, 91, 4, 59,
1037  89, 90, 93, 251, 89, 467, 467, 93, 17, 18,
1038  19, 20, 21, 22, 23, 273, 83, 84, 85, 86,
1039  268, 376, 377, 94, 255, 421, 422, 90, 93, 99,
1040  93, 93, 95, 291, 292, 91, 496, 497, 296, 99,
1041  49, 582, 583, 432, 94, 286, 100, 91, 95, 4,
1042  253, 440, 255, 91, 4, 4, 90, 93, 316, 5,
1043  449, 88, 3, 4, 5, 6, 269, 315, 492, 531,
1044  531, 4, 620, 276, 4, 97, 97, 97, 91, 27,
1045  88, 29, 363, 31, 32, 33, 88, 94, 346, 94,
1046  38, 39, 40, 90, 483, 643, 100, 645, 86, 89,
1047  96, 342, 360, 361, 88, 53, 54, 365, 356, 89,
1048  91, 90, 94, 91, 55, 56, 93, 100, 88, 23,
1049  509, 94, 63, 64, 65, 66, 67, 68, 386, 518,
1050  4, 520, 521, 96, 93, 93, 60, 378, 396, 93,
1051  81, 82, 94, 100, 88, 403, 93, 405, 93, 407,
1052  408, 93, 93, 94, 412, 93, 4, 388, 99, 4,
1053  94, 102, 103, 89, 93, 22, 4, 94, 426, 91,
1054  428, 419, 93, 91, 91, 94, 424, 93, 92, 437,
1055  4, 4, 91, 7, 94, 388, 98, 94, 94, 94,
1056  91, 432, 94, 4, 50, 476, 91, 94, 456, 440,
1057  93, 25, 26, 93, 91, 463, 88, 91, 449, 89,
1058  34, 94, 93, 37, 91, 94, 30, 606, 4, 43,
1059  88, 45, 81, 82, 83, 84, 85, 86, 94, 53,
1060  54, 620, 621, 94, 94, 93, 467, 4, 88, 41,
1061  30, 93, 483, 501, 91, 503, 41, 91, 496, 497,
1062  508, 94, 93, 30, 643, 91, 645, 94, 32, 94,
1063  94, 519, 94, 94, 467, 295, 524, 420, 509, 10,
1064  205, 257, 13, 14, 15, 16, 308, 518, 253, 520,
1065  521, 255, 269, 24, 542, 543, 27, 138, 29, 462,
1066  31, 528, 264, 424, 522, 512, 426, 38, 39, 40,
1067  531, 624, 577, 274, 403, 456, 47, 77, 78, 79,
1068  80, 81, 82, 83, 84, 85, 86, 531, 59, 577,
1069  365, 430, 631, 255, 582, 583, 153, -1, 531, -1,
1070  -1, -1, -1, -1, -1, 593, 83, 84, 85, 86,
1071  87, 88, 89, 90, -1, -1, -1, 94, 95, 607,
1072  -1, -1, -1, -1, 10, -1, 614, -1, 14, 15,
1073  16, -1, -1, -1, -1, 606, 624, -1, 24, -1,
1074  -1, 27, -1, 29, 632, 31, -1, -1, -1, 620,
1075  621, -1, 38, 39, 40, -1, -1, -1, -1, -1,
1076  -1, 47, 48, -1, -1, -1, -1, -1, -1, -1,
1077  -1, -1, 643, 59, 645, -1, -1, 3, 4, 5,
1078  6, -1, -1, 9, -1, 162, 163, 164, 165, 166,
1079  167, 168, 169, 170, 171, 172, 173, 174, 175, 176,
1080  177, 178, 179, 180, 181, 182, 183, 184, 185, 35,
1081  36, -1, -1, -1, -1, -1, -1, -1, 3, 4,
1082  5, 6, -1, -1, -1, -1, -1, -1, -1, 55,
1083  56, -1, -1, -1, -1, -1, -1, 63, 64, 65,
1084  66, 67, 68, -1, -1, -1, -1, -1, -1, -1,
1085  -1, -1, -1, -1, -1, 81, 82, 83, -1, 3,
1086  4, 5, 6, -1, -1, -1, -1, 93, -1, -1,
1087  55, 56, -1, 99, -1, -1, 102, 103, 63, 64,
1088  65, 66, 67, 68, -1, -1, -1, -1, -1, -1,
1089  -1, 35, 36, -1, -1, -1, 81, 82, -1, -1,
1090  -1, -1, -1, 88, -1, 90, -1, -1, 93, -1,
1091  -1, 55, 56, -1, 99, -1, -1, 102, 103, 63,
1092  64, 65, 66, 67, 68, 3, 4, 5, 6, -1,
1093  -1, -1, -1, -1, -1, -1, -1, 81, 82, -1,
1094  -1, -1, -1, -1, -1, -1, -1, -1, -1, 93,
1095  -1, -1, -1, -1, -1, 99, -1, -1, 102, 103,
1096  -1, -1, -1, -1, -1, -1, 3, 4, 5, 6,
1097  -1, -1, -1, -1, -1, -1, -1, 55, 56, -1,
1098  -1, -1, -1, -1, -1, 63, 64, 65, 66, 67,
1099  68, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1100  -1, -1, -1, 81, 82, 42, -1, 3, 4, 5,
1101  6, -1, 90, -1, -1, 93, -1, -1, 55, 56,
1102  -1, 99, -1, -1, 102, 103, 63, 64, 65, 66,
1103  67, 68, -1, -1, -1, -1, -1, -1, -1, -1,
1104  -1, -1, -1, -1, 81, 82, -1, -1, -1, -1,
1105  -1, -1, -1, -1, -1, -1, 93, -1, -1, 55,
1106  56, -1, 99, -1, -1, 102, 103, 63, 64, 65,
1107  66, 67, 68, -1, -1, -1, -1, -1, -1, -1,
1108  -1, -1, -1, -1, -1, 81, 82, -1, -1, -1,
1109  -1, -1, -1, -1, 10, -1, -1, 93, 14, 15,
1110  16, -1, -1, 99, -1, -1, 102, 103, 24, -1,
1111  -1, 27, 28, 29, -1, 31, -1, -1, -1, -1,
1112  -1, 10, 38, 39, 40, 14, 15, 16, -1, -1,
1113  -1, 47, -1, -1, -1, 24, -1, -1, 27, -1,
1114  29, -1, 31, 59, -1, -1, -1, -1, -1, 38,
1115  39, 40, -1, -1, -1, -1, -1, -1, 47, -1,
1116  -1, -1, -1, 61, 62, 63, -1, 65, 66, 67,
1117  59, 69, 70, 71, 72, 73, 74, 75, 76, 77,
1118  78, 79, 80, 81, 82, 83, 84, 85, 86, -1,
1119  -1, -1, -1, -1, -1, -1, -1, 62, 63, -1,
1120  65, 66, 67, 101, 69, 70, 71, 72, 73, 74,
1121  75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1122  85, 86, 63, -1, 65, 66, 67, -1, 69, 70,
1123  71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
1124  81, 82, 83, 84, 85, 86, 65, 66, 67, -1,
1125  69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
1126  79, 80, 81, 82, 83, 84, 85, 86, 67, -1,
1127  69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
1128  79, 80, 81, 82, 83, 84, 85, 86, 69, 70,
1129  71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
1130  81, 82, 83, 84, 85, 86, 73, 74, 75, 76,
1131  77, 78, 79, 80, 81, 82, 83, 84, 85, 86
1132 };
1133 
1134  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1135  symbol of state STATE-NUM. */
1136 static const yytype_uint16 yystos[] =
1137 {
1138  0, 105, 106, 0, 10, 107, 108, 109, 111, 118,
1139  144, 112, 12, 34, 43, 45, 110, 107, 107, 107,
1140  4, 114, 115, 116, 117, 4, 4, 23, 153, 4,
1141  8, 113, 88, 89, 90, 119, 4, 89, 96, 22,
1142  95, 137, 139, 141, 148, 114, 11, 116, 3, 5,
1143  6, 55, 56, 63, 64, 65, 66, 67, 68, 81,
1144  82, 93, 99, 102, 103, 117, 237, 256, 257, 4,
1145  92, 120, 145, 4, 4, 256, 4, 93, 154, 9,
1146  5, 108, 108, 108, 108, 108, 108, 108, 108, 108,
1147  108, 256, 256, 259, 108, 108, 5, 95, 108, 137,
1148  138, 139, 61, 62, 63, 65, 66, 67, 69, 70,
1149  71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
1150  81, 82, 83, 84, 85, 86, 101, 93, 93, 126,
1151  93, 151, 4, 89, 57, 58, 96, 97, 149, 94,
1152  155, 91, 93, 93, 257, 257, 257, 257, 257, 257,
1153  257, 257, 94, 88, 99, 100, 257, 257, 256, 258,
1154  137, 137, 108, 108, 108, 108, 108, 108, 108, 108,
1155  108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
1156  108, 108, 108, 108, 108, 108, 108, 121, 4, 90,
1157  94, 108, 127, 130, 91, 4, 150, 152, 91, 146,
1158  4, 256, 256, 256, 154, 4, 108, 157, 158, 179,
1159  160, 256, 256, 5, 256, 259, 256, 97, 93, 257,
1160  257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
1161  257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
1162  257, 257, 257, 256, 4, 14, 123, 124, 170, 131,
1163  90, 133, 134, 88, 128, 142, 4, 88, 94, 151,
1164  4, 97, 97, 97, 91, 138, 139, 140, 133, 88,
1165  128, 46, 59, 99, 108, 111, 117, 174, 208, 210,
1166  211, 237, 238, 94, 94, 100, 90, 241, 242, 243,
1167  256, 96, 89, 125, 122, 88, 89, 129, 90, 139,
1168  17, 18, 19, 20, 21, 22, 23, 49, 135, 136,
1169  130, 94, 13, 14, 15, 16, 24, 27, 29, 31,
1170  38, 39, 40, 47, 59, 108, 111, 143, 144, 165,
1171  167, 171, 174, 180, 183, 200, 209, 221, 246, 150,
1172  91, 147, 160, 139, 158, 156, 93, 239, 256, 27,
1173  29, 31, 32, 33, 53, 54, 133, 221, 108, 91,
1174  74, 89, 100, 117, 237, 88, 128, 256, 256, 23,
1175  161, 94, 123, 256, 4, 136, 166, 168, 139, 172,
1176  173, 181, 182, 256, 96, 207, 93, 93, 244, 60,
1177  4, 7, 25, 26, 37, 186, 93, 151, 44, 159,
1178  94, 256, 100, 88, 207, 93, 93, 93, 93, 4,
1179  4, 139, 93, 212, 256, 256, 243, 94, 22, 162,
1180  132, 161, 161, 117, 88, 91, 88, 91, 89, 4,
1181  251, 256, 247, 48, 143, 245, 246, 93, 184, 201,
1182  203, 185, 256, 91, 179, 94, 239, 213, 256, 214,
1183  256, 256, 91, 91, 175, 256, 93, 240, 139, 164,
1184  129, 162, 162, 89, 173, 182, 256, 244, 94, 210,
1185  256, 92, 194, 98, 204, 211, 4, 188, 191, 192,
1186  193, 94, 91, 224, 94, 210, 94, 94, 177, 178,
1187  179, 94, 241, 91, 170, 50, 163, 163, 256, 28,
1188  249, 91, 94, 93, 187, 188, 8, 83, 93, 202,
1189  137, 189, 88, 91, 93, 250, 28, 211, 219, 91,
1190  217, 218, 88, 176, 89, 220, 128, 164, 164, 207,
1191  252, 253, 256, 91, 90, 195, 196, 256, 88, 91,
1192  94, 9, 35, 36, 83, 205, 206, 256, 211, 190,
1193  93, 192, 88, 90, 197, 199, 256, 231, 207, 211,
1194  256, 211, 211, 178, 91, 256, 222, 94, 169, 170,
1195  169, 30, 255, 245, 248, 4, 94, 88, 188, 256,
1196  256, 94, 37, 88, 94, 93, 197, 198, 4, 94,
1197  88, 41, 232, 233, 30, 225, 215, 51, 52, 227,
1198  88, 91, 91, 91, 252, 254, 91, 93, 195, 206,
1199  206, 197, 94, 197, 93, 197, 42, 235, 236, 256,
1200  226, 91, 41, 228, 229, 170, 210, 256, 94, 94,
1201  256, 234, 88, 96, 211, 210, 235, 94, 94, 94,
1202  254, 256, 94, 230, 252, 216, 91, 211, 223, 211
1203 };
1204 
1205  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1206 static const yytype_uint16 yyr1[] =
1207 {
1208  0, 104, 106, 105, 107, 107, 107, 107, 109, 108,
1209  110, 110, 112, 113, 111, 114, 114, 115, 115, 116,
1210  116, 117, 117, 119, 118, 121, 122, 120, 120, 123,
1211  123, 123, 125, 124, 124, 126, 126, 126, 127, 127,
1212  128, 128, 129, 129, 131, 130, 132, 130, 130, 134,
1213  133, 135, 135, 136, 136, 136, 136, 136, 136, 136,
1214  136, 137, 137, 137, 137, 138, 138, 139, 139, 140,
1215  140, 141, 141, 142, 142, 142, 143, 143, 143, 143,
1216  143, 143, 143, 143, 143, 143, 143, 145, 144, 146,
1217  144, 147, 144, 148, 144, 149, 144, 150, 150, 151,
1218  151, 152, 152, 152, 152, 153, 153, 154, 154, 155,
1219  156, 154, 157, 157, 159, 158, 158, 160, 160, 161,
1220  161, 162, 162, 163, 163, 164, 166, 165, 168, 167,
1221  169, 169, 170, 171, 172, 172, 173, 175, 176, 174,
1222  174, 174, 177, 177, 178, 178, 179, 180, 181, 181,
1223  182, 184, 183, 185, 183, 186, 186, 187, 187, 189,
1224  188, 190, 188, 191, 191, 192, 193, 192, 194, 194,
1225  195, 195, 195, 196, 196, 197, 197, 197, 198, 197,
1226  199, 199, 199, 201, 202, 200, 203, 200, 204, 204,
1227  204, 204, 204, 204, 205, 205, 205, 206, 206, 206,
1228  207, 207, 208, 209, 210, 210, 211, 211, 211, 211,
1229  212, 211, 213, 211, 214, 215, 216, 211, 217, 211,
1230  218, 211, 219, 211, 220, 211, 221, 221, 221, 222,
1231  222, 222, 223, 223, 224, 224, 226, 225, 225, 227,
1232  227, 229, 230, 228, 231, 231, 233, 234, 232, 235,
1233  235, 236, 236, 236, 237, 237, 237, 238, 238, 239,
1234  239, 240, 240, 241, 241, 242, 242, 243, 244, 244,
1235  245, 245, 247, 248, 246, 249, 246, 250, 246, 251,
1236  246, 253, 252, 254, 254, 255, 255, 256, 256, 257,
1237  257, 257, 257, 257, 257, 257, 258, 257, 257, 257,
1238  257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
1239  257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
1240  257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
1241  257, 257, 257, 257, 257, 257, 257, 259, 259
1242 };
1243 
1244  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
1245 static const yytype_uint8 yyr2[] =
1246 {
1247  0, 2, 0, 2, 2, 2, 2, 0, 0, 2,
1248  4, 0, 0, 0, 5, 1, 0, 1, 3, 1,
1249  3, 1, 3, 0, 9, 0, 0, 6, 0, 1,
1250  3, 0, 0, 6, 1, 2, 0, 4, 1, 3,
1251  1, 0, 2, 0, 0, 3, 0, 6, 3, 0,
1252  2, 1, 2, 1, 1, 1, 1, 1, 1, 1,
1253  1, 5, 5, 5, 3, 2, 2, 1, 0, 1,
1254  1, 1, 1, 2, 2, 0, 1, 1, 1, 1,
1255  1, 1, 1, 1, 3, 1, 1, 0, 7, 0,
1256  9, 0, 11, 0, 8, 0, 10, 2, 1, 3,
1257  0, 3, 2, 1, 0, 1, 0, 2, 0, 0,
1258  0, 6, 1, 3, 0, 5, 1, 2, 0, 1,
1259  0, 1, 0, 1, 0, 1, 0, 8, 0, 8,
1260  1, 3, 3, 3, 1, 3, 4, 0, 0, 7,
1261  4, 4, 1, 3, 1, 3, 2, 3, 1, 3,
1262  3, 0, 6, 0, 5, 1, 1, 1, 3, 0,
1263  5, 0, 6, 1, 3, 1, 0, 4, 4, 0,
1264  0, 1, 3, 1, 5, 0, 1, 3, 0, 3,
1265  1, 5, 4, 0, 0, 6, 0, 4, 4, 4,
1266  3, 3, 2, 0, 1, 3, 3, 2, 2, 1,
1267  2, 0, 5, 6, 3, 3, 1, 1, 1, 2,
1268  0, 5, 0, 7, 0, 0, 0, 13, 0, 7,
1269  0, 7, 0, 8, 0, 9, 1, 1, 1, 2,
1270  2, 0, 1, 1, 2, 0, 0, 3, 0, 2,
1271  0, 0, 0, 4, 2, 0, 0, 0, 4, 2,
1272  1, 1, 1, 3, 6, 2, 2, 1, 3, 1,
1273  3, 4, 0, 1, 0, 1, 3, 1, 2, 0,
1274  1, 1, 0, 0, 11, 0, 7, 0, 7, 0,
1275  6, 0, 2, 1, 1, 2, 0, 1, 6, 1,
1276  4, 2, 2, 1, 1, 1, 0, 7, 5, 5,
1277  3, 3, 6, 3, 4, 4, 4, 4, 3, 3,
1278  3, 3, 3, 3, 4, 4, 4, 4, 4, 4,
1279  4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
1280  4, 4, 3, 3, 4, 4, 3, 1, 3
1281 };
1282 
1283 
1284 #define yyerrok (yyerrstatus = 0)
1285 #define yyclearin (yychar = YYEMPTY)
1286 #define YYEMPTY (-2)
1287 #define YYEOF 0
1288 
1289 #define YYACCEPT goto yyacceptlab
1290 #define YYABORT goto yyabortlab
1291 #define YYERROR goto yyerrorlab
1292 
1293 
1294 #define YYRECOVERING() (!!yyerrstatus)
1295 
1296 #define YYBACKUP(Token, Value) \
1297 do \
1298  if (yychar == YYEMPTY) \
1299  { \
1300  yychar = (Token); \
1301  yylval = (Value); \
1302  YYPOPSTACK (yylen); \
1303  yystate = *yyssp; \
1304  goto yybackup; \
1305  } \
1306  else \
1307  { \
1308  yyerror (YY_("syntax error: cannot back up")); \
1309  YYERROR; \
1310  } \
1311 while (0)
1312 
1313 /* Error token number */
1314 #define YYTERROR 1
1315 #define YYERRCODE 256
1316 
1317 
1318 
1319 /* Enable debugging if requested. */
1320 #if YYDEBUG
1321 
1322 # ifndef YYFPRINTF
1323 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1324 # define YYFPRINTF fprintf
1325 # endif
1326 
1327 # define YYDPRINTF(Args) \
1328 do { \
1329  if (yydebug) \
1330  YYFPRINTF Args; \
1331 } while (0)
1332 
1333 /* This macro is provided for backward compatibility. */
1334 #ifndef YY_LOCATION_PRINT
1335 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1336 #endif
1337 
1338 
1339 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1340 do { \
1341  if (yydebug) \
1342  { \
1343  YYFPRINTF (stderr, "%s ", Title); \
1344  yy_symbol_print (stderr, \
1345  Type, Value); \
1346  YYFPRINTF (stderr, "\n"); \
1347  } \
1348 } while (0)
1349 
1350 
1351 /*----------------------------------------.
1352 | Print this symbol's value on YYOUTPUT. |
1353 `----------------------------------------*/
1354 
1355 static void
1356 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1357 {
1358  FILE *yyo = yyoutput;
1359  YYUSE (yyo);
1360  if (!yyvaluep)
1361  return;
1362 # ifdef YYPRINT
1363  if (yytype < YYNTOKENS)
1364  YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1365 # endif
1366  YYUSE (yytype);
1367 }
1368 
1369 
1370 /*--------------------------------.
1371 | Print this symbol on YYOUTPUT. |
1372 `--------------------------------*/
1373 
1374 static void
1375 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1376 {
1377  YYFPRINTF (yyoutput, "%s %s (",
1378  yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
1379 
1380  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1381  YYFPRINTF (yyoutput, ")");
1382 }
1383 
1384 /*------------------------------------------------------------------.
1385 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1386 | TOP (included). |
1387 `------------------------------------------------------------------*/
1388 
1389 static void
1391 {
1392  YYFPRINTF (stderr, "Stack now");
1393  for (; yybottom <= yytop; yybottom++)
1394  {
1395  int yybot = *yybottom;
1396  YYFPRINTF (stderr, " %d", yybot);
1397  }
1398  YYFPRINTF (stderr, "\n");
1399 }
1400 
1401 # define YY_STACK_PRINT(Bottom, Top) \
1402 do { \
1403  if (yydebug) \
1404  yy_stack_print ((Bottom), (Top)); \
1405 } while (0)
1406 
1407 
1408 /*------------------------------------------------.
1409 | Report that the YYRULE is going to be reduced. |
1410 `------------------------------------------------*/
1411 
1412 static void
1413 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
1414 {
1415  unsigned long int yylno = yyrline[yyrule];
1416  int yynrhs = yyr2[yyrule];
1417  int yyi;
1418  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1419  yyrule - 1, yylno);
1420  /* The symbols being reduced. */
1421  for (yyi = 0; yyi < yynrhs; yyi++)
1422  {
1423  YYFPRINTF (stderr, " $%d = ", yyi + 1);
1424  yy_symbol_print (stderr,
1425  yystos[yyssp[yyi + 1 - yynrhs]],
1426  &(yyvsp[(yyi + 1) - (yynrhs)])
1427  );
1428  YYFPRINTF (stderr, "\n");
1429  }
1430 }
1431 
1432 # define YY_REDUCE_PRINT(Rule) \
1433 do { \
1434  if (yydebug) \
1435  yy_reduce_print (yyssp, yyvsp, Rule); \
1436 } while (0)
1437 
1438 /* Nonzero means print parse trace. It is left uninitialized so that
1439  multiple parsers can coexist. */
1441 #else /* !YYDEBUG */
1442 # define YYDPRINTF(Args)
1443 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1444 # define YY_STACK_PRINT(Bottom, Top)
1445 # define YY_REDUCE_PRINT(Rule)
1446 #endif /* !YYDEBUG */
1447 
1448 
1449 /* YYINITDEPTH -- initial size of the parser's stacks. */
1450 #ifndef YYINITDEPTH
1451 # define YYINITDEPTH 200
1452 #endif
1453 
1454 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1455  if the built-in stack extension method is used).
1456 
1457  Do not make this value too large; the results are undefined if
1458  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1459  evaluated with infinite-precision integer arithmetic. */
1460 
1461 #ifndef YYMAXDEPTH
1462 # define YYMAXDEPTH 10000
1463 #endif
1464 
1465 
1466 #if YYERROR_VERBOSE
1467 
1468 # ifndef yystrlen
1469 # if defined __GLIBC__ && defined _STRING_H
1470 # define yystrlen strlen
1471 # else
1472 /* Return the length of YYSTR. */
1473 static YYSIZE_T
1474 yystrlen (const char *yystr)
1475 {
1476  YYSIZE_T yylen;
1477  for (yylen = 0; yystr[yylen]; yylen++)
1478  continue;
1479  return yylen;
1480 }
1481 # endif
1482 # endif
1483 
1484 # ifndef yystpcpy
1485 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1486 # define yystpcpy stpcpy
1487 # else
1488 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1489  YYDEST. */
1490 static char *
1491 yystpcpy (char *yydest, const char *yysrc)
1492 {
1493  char *yyd = yydest;
1494  const char *yys = yysrc;
1495 
1496  while ((*yyd++ = *yys++) != '\0')
1497  continue;
1498 
1499  return yyd - 1;
1500 }
1501 # endif
1502 # endif
1503 
1504 # ifndef yytnamerr
1505 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1506  quotes and backslashes, so that it's suitable for yyerror. The
1507  heuristic is that double-quoting is unnecessary unless the string
1508  contains an apostrophe, a comma, or backslash (other than
1509  backslash-backslash). YYSTR is taken from yytname. If YYRES is
1510  null, do not copy; instead, return the length of what the result
1511  would have been. */
1512 static YYSIZE_T
1513 yytnamerr (char *yyres, const char *yystr)
1514 {
1515  if (*yystr == '"')
1516  {
1517  YYSIZE_T yyn = 0;
1518  char const *yyp = yystr;
1519 
1520  for (;;)
1521  switch (*++yyp)
1522  {
1523  case '\'':
1524  case ',':
1525  goto do_not_strip_quotes;
1526 
1527  case '\\':
1528  if (*++yyp != '\\')
1529  goto do_not_strip_quotes;
1530  /* Fall through. */
1531  default:
1532  if (yyres)
1533  yyres[yyn] = *yyp;
1534  yyn++;
1535  break;
1536 
1537  case '"':
1538  if (yyres)
1539  yyres[yyn] = '\0';
1540  return yyn;
1541  }
1542  do_not_strip_quotes: ;
1543  }
1544 
1545  if (! yyres)
1546  return yystrlen (yystr);
1547 
1548  return yystpcpy (yyres, yystr) - yyres;
1549 }
1550 # endif
1551 
1552 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1553  about the unexpected token YYTOKEN for the state stack whose top is
1554  YYSSP.
1555 
1556  Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1557  not large enough to hold the message. In that case, also set
1558  *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1559  required number of bytes is too large to store. */
1560 static int
1561 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1562  yytype_int16 *yyssp, int yytoken)
1563 {
1564  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1565  YYSIZE_T yysize = yysize0;
1566  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1567  /* Internationalized format string. */
1568  const char *yyformat = YY_NULLPTR;
1569  /* Arguments of yyformat. */
1570  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1571  /* Number of reported tokens (one for the "unexpected", one per
1572  "expected"). */
1573  int yycount = 0;
1574 
1575  /* There are many possibilities here to consider:
1576  - If this state is a consistent state with a default action, then
1577  the only way this function was invoked is if the default action
1578  is an error action. In that case, don't check for expected
1579  tokens because there are none.
1580  - The only way there can be no lookahead present (in yychar) is if
1581  this state is a consistent state with a default action. Thus,
1582  detecting the absence of a lookahead is sufficient to determine
1583  that there is no unexpected or expected token to report. In that
1584  case, just report a simple "syntax error".
1585  - Don't assume there isn't a lookahead just because this state is a
1586  consistent state with a default action. There might have been a
1587  previous inconsistent state, consistent state with a non-default
1588  action, or user semantic action that manipulated yychar.
1589  - Of course, the expected token list depends on states to have
1590  correct lookahead information, and it depends on the parser not
1591  to perform extra reductions after fetching a lookahead from the
1592  scanner and before detecting a syntax error. Thus, state merging
1593  (from LALR or IELR) and default reductions corrupt the expected
1594  token list. However, the list is correct for canonical LR with
1595  one exception: it will still contain any token that will not be
1596  accepted due to an error action in a later state.
1597  */
1598  if (yytoken != YYEMPTY)
1599  {
1600  int yyn = yypact[*yyssp];
1601  yyarg[yycount++] = yytname[yytoken];
1602  if (!yypact_value_is_default (yyn))
1603  {
1604  /* Start YYX at -YYN if negative to avoid negative indexes in
1605  YYCHECK. In other words, skip the first -YYN actions for
1606  this state because they are default actions. */
1607  int yyxbegin = yyn < 0 ? -yyn : 0;
1608  /* Stay within bounds of both yycheck and yytname. */
1609  int yychecklim = YYLAST - yyn + 1;
1610  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1611  int yyx;
1612 
1613  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1614  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1615  && !yytable_value_is_error (yytable[yyx + yyn]))
1616  {
1617  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1618  {
1619  yycount = 1;
1620  yysize = yysize0;
1621  break;
1622  }
1623  yyarg[yycount++] = yytname[yyx];
1624  {
1625  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1626  if (! (yysize <= yysize1
1627  && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1628  return 2;
1629  yysize = yysize1;
1630  }
1631  }
1632  }
1633  }
1634 
1635  switch (yycount)
1636  {
1637 # define YYCASE_(N, S) \
1638  case N: \
1639  yyformat = S; \
1640  break
1641  YYCASE_(0, YY_("syntax error"));
1642  YYCASE_(1, YY_("syntax error, unexpected %s"));
1643  YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1644  YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1645  YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1646  YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1647 # undef YYCASE_
1648  }
1649 
1650  {
1651  YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1652  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1653  return 2;
1654  yysize = yysize1;
1655  }
1656 
1657  if (*yymsg_alloc < yysize)
1658  {
1659  *yymsg_alloc = 2 * yysize;
1660  if (! (yysize <= *yymsg_alloc
1661  && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1662  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1663  return 1;
1664  }
1665 
1666  /* Avoid sprintf, as that infringes on the user's name space.
1667  Don't have undefined behavior even if the translation
1668  produced a string with the wrong number of "%s"s. */
1669  {
1670  char *yyp = *yymsg;
1671  int yyi = 0;
1672  while ((*yyp = *yyformat) != '\0')
1673  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1674  {
1675  yyp += yytnamerr (yyp, yyarg[yyi++]);
1676  yyformat += 2;
1677  }
1678  else
1679  {
1680  yyp++;
1681  yyformat++;
1682  }
1683  }
1684  return 0;
1685 }
1686 #endif /* YYERROR_VERBOSE */
1687 
1688 /*-----------------------------------------------.
1689 | Release the memory associated to this symbol. |
1690 `-----------------------------------------------*/
1691 
1692 static void
1693 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1694 {
1695  YYUSE (yyvaluep);
1696  if (!yymsg)
1697  yymsg = "Deleting";
1698  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1699 
1701  YYUSE (yytype);
1703 }
1704 
1705 
1706 
1707 
1708 /* The lookahead symbol. */
1710 
1711 /* The semantic value of the lookahead symbol. */
1713 /* Number of syntax errors so far. */
1715 
1716 
1717 /*----------.
1718 | yyparse. |
1719 `----------*/
1720 
1721 int
1722 yyparse (void)
1723 {
1724  int yystate;
1725  /* Number of tokens to shift before error messages enabled. */
1726  int yyerrstatus;
1727 
1728  /* The stacks and their tools:
1729  'yyss': related to states.
1730  'yyvs': related to semantic values.
1731 
1732  Refer to the stacks through separate pointers, to allow yyoverflow
1733  to reallocate them elsewhere. */
1734 
1735  /* The state stack. */
1736  yytype_int16 yyssa[YYINITDEPTH];
1737  yytype_int16 *yyss;
1738  yytype_int16 *yyssp;
1739 
1740  /* The semantic value stack. */
1741  YYSTYPE yyvsa[YYINITDEPTH];
1742  YYSTYPE *yyvs;
1743  YYSTYPE *yyvsp;
1744 
1745  YYSIZE_T yystacksize;
1746 
1747  int yyn;
1748  int yyresult;
1749  /* Lookahead token as an internal (translated) token number. */
1750  int yytoken = 0;
1751  /* The variables used to return semantic value and location from the
1752  action routines. */
1753  YYSTYPE yyval;
1754 
1755 #if YYERROR_VERBOSE
1756  /* Buffer for error messages, and its allocated size. */
1757  char yymsgbuf[128];
1758  char *yymsg = yymsgbuf;
1759  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1760 #endif
1761 
1762 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1763 
1764  /* The number of symbols on the RHS of the reduced rule.
1765  Keep to zero when no symbol should be popped. */
1766  int yylen = 0;
1767 
1768  yyssp = yyss = yyssa;
1769  yyvsp = yyvs = yyvsa;
1770  yystacksize = YYINITDEPTH;
1771 
1772  YYDPRINTF ((stderr, "Starting parse\n"));
1773 
1774  yystate = 0;
1775  yyerrstatus = 0;
1776  yynerrs = 0;
1777  yychar = YYEMPTY; /* Cause a token to be read. */
1778  goto yysetstate;
1779 
1780 /*------------------------------------------------------------.
1781 | yynewstate -- Push a new state, which is found in yystate. |
1782 `------------------------------------------------------------*/
1783  yynewstate:
1784  /* In all cases, when you get here, the value and location stacks
1785  have just been pushed. So pushing a state here evens the stacks. */
1786  yyssp++;
1787 
1788  yysetstate:
1789  *yyssp = yystate;
1790 
1791  if (yyss + yystacksize - 1 <= yyssp)
1792  {
1793  /* Get the current used size of the three stacks, in elements. */
1794  YYSIZE_T yysize = yyssp - yyss + 1;
1795 
1796 #ifdef yyoverflow
1797  {
1798  /* Give user a chance to reallocate the stack. Use copies of
1799  these so that the &'s don't force the real ones into
1800  memory. */
1801  YYSTYPE *yyvs1 = yyvs;
1802  yytype_int16 *yyss1 = yyss;
1803 
1804  /* Each stack pointer address is followed by the size of the
1805  data in use in that stack, in bytes. This used to be a
1806  conditional around just the two extra args, but that might
1807  be undefined if yyoverflow is a macro. */
1808  yyoverflow (YY_("memory exhausted"),
1809  &yyss1, yysize * sizeof (*yyssp),
1810  &yyvs1, yysize * sizeof (*yyvsp),
1811  &yystacksize);
1812 
1813  yyss = yyss1;
1814  yyvs = yyvs1;
1815  }
1816 #else /* no yyoverflow */
1817 # ifndef YYSTACK_RELOCATE
1818  goto yyexhaustedlab;
1819 # else
1820  /* Extend the stack our own way. */
1821  if (YYMAXDEPTH <= yystacksize)
1822  goto yyexhaustedlab;
1823  yystacksize *= 2;
1824  if (YYMAXDEPTH < yystacksize)
1825  yystacksize = YYMAXDEPTH;
1826 
1827  {
1828  yytype_int16 *yyss1 = yyss;
1829  union yyalloc *yyptr =
1830  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1831  if (! yyptr)
1832  goto yyexhaustedlab;
1833  YYSTACK_RELOCATE (yyss_alloc, yyss);
1834  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1835 # undef YYSTACK_RELOCATE
1836  if (yyss1 != yyssa)
1837  YYSTACK_FREE (yyss1);
1838  }
1839 # endif
1840 #endif /* no yyoverflow */
1841 
1842  yyssp = yyss + yysize - 1;
1843  yyvsp = yyvs + yysize - 1;
1844 
1845  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1846  (unsigned long int) yystacksize));
1847 
1848  if (yyss + yystacksize - 1 <= yyssp)
1849  YYABORT;
1850  }
1851 
1852  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1853 
1854  if (yystate == YYFINAL)
1855  YYACCEPT;
1856 
1857  goto yybackup;
1858 
1859 /*-----------.
1860 | yybackup. |
1861 `-----------*/
1862 yybackup:
1863 
1864  /* Do appropriate processing given the current state. Read a
1865  lookahead token if we need one and don't already have one. */
1866 
1867  /* First try to decide what to do without reference to lookahead token. */
1868  yyn = yypact[yystate];
1869  if (yypact_value_is_default (yyn))
1870  goto yydefault;
1871 
1872  /* Not known => get a lookahead token if don't already have one. */
1873 
1874  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1875  if (yychar == YYEMPTY)
1876  {
1877  YYDPRINTF ((stderr, "Reading a token: "));
1878  yychar = yylex ();
1879  }
1880 
1881  if (yychar <= YYEOF)
1882  {
1883  yychar = yytoken = YYEOF;
1884  YYDPRINTF ((stderr, "Now at end of input.\n"));
1885  }
1886  else
1887  {
1888  yytoken = YYTRANSLATE (yychar);
1889  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1890  }
1891 
1892  /* If the proper action on seeing token YYTOKEN is to reduce or to
1893  detect an error, take that action. */
1894  yyn += yytoken;
1895  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1896  goto yydefault;
1897  yyn = yytable[yyn];
1898  if (yyn <= 0)
1899  {
1900  if (yytable_value_is_error (yyn))
1901  goto yyerrlab;
1902  yyn = -yyn;
1903  goto yyreduce;
1904  }
1905 
1906  /* Count tokens shifted since error; after three, turn off error
1907  status. */
1908  if (yyerrstatus)
1909  yyerrstatus--;
1910 
1911  /* Shift the lookahead token. */
1912  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1913 
1914  /* Discard the shifted token. */
1915  yychar = YYEMPTY;
1916 
1917  yystate = yyn;
1919  *++yyvsp = yylval;
1921 
1922  goto yynewstate;
1923 
1924 
1925 /*-----------------------------------------------------------.
1926 | yydefault -- do the default action for the current state. |
1927 `-----------------------------------------------------------*/
1928 yydefault:
1929  yyn = yydefact[yystate];
1930  if (yyn == 0)
1931  goto yyerrlab;
1932  goto yyreduce;
1933 
1934 
1935 /*-----------------------------.
1936 | yyreduce -- Do a reduction. |
1937 `-----------------------------*/
1938 yyreduce:
1939  /* yyn is the number of a rule to reduce with. */
1940  yylen = yyr2[yyn];
1941 
1942  /* If YYLEN is nonzero, implement the default value of the action:
1943  '$$ = $1'.
1944 
1945  Otherwise, the following line sets YYVAL to garbage.
1946  This behavior is undocumented and Bison
1947  users should not rely upon it. Assigning to YYVAL
1948  unconditionally makes the parser a bit smaller, and it avoids a
1949  GCC warning that YYVAL may be used uninitialized. */
1950  yyval = yyvsp[1-yylen];
1951 
1952 
1953  YY_REDUCE_PRINT (yyn);
1954  switch (yyn)
1955  {
1956  case 2:
1957 #line 141 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
1958  {
1959  ast_stack.push_back(current_ast);
1960 }
1961 #line 1962 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
1962  break;
1963 
1964  case 3:
1965 #line 143 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
1966  {
1967  ast_stack.pop_back();
1968  log_assert(GetSize(ast_stack) == 0);
1969  for (auto &it : default_attr_list)
1970  delete it.second;
1971  default_attr_list.clear();
1972 }
1973 #line 1974 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
1974  break;
1975 
1976  case 8:
1977 #line 158 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
1978  {
1979  for (auto &it : attr_list)
1980  delete it.second;
1981  attr_list.clear();
1982  for (auto &it : default_attr_list)
1983  attr_list[it.first] = it.second->clone();
1984  }
1985 #line 1986 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
1986  break;
1987 
1988  case 9:
1989 #line 164 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
1990  {
1991  std::map<std::string, AstNode*> *al = new std::map<std::string, AstNode*>;
1992  al->swap(attr_list);
1993  (yyval.al) = al;
1994  }
1995 #line 1996 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
1996  break;
1997 
1998  case 12:
1999 #line 175 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2000  {
2001  for (auto &it : default_attr_list)
2002  delete it.second;
2003  default_attr_list.clear();
2004  for (auto &it : attr_list)
2005  delete it.second;
2006  attr_list.clear();
2007  }
2008 #line 2009 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2009  break;
2010 
2011  case 13:
2012 #line 182 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2013  {
2015  attr_list.clear();
2016  }
2017 #line 2018 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2018  break;
2019 
2020  case 19:
2021 #line 195 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2022  {
2023  if (attr_list.count(*(yyvsp[0].string)) != 0)
2024  delete attr_list[*(yyvsp[0].string)];
2025  attr_list[*(yyvsp[0].string)] = AstNode::mkconst_int(1, false);
2026  delete (yyvsp[0].string);
2027  }
2028 #line 2029 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2029  break;
2030 
2031  case 20:
2032 #line 201 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2033  {
2034  if (attr_list.count(*(yyvsp[-2].string)) != 0)
2035  delete attr_list[*(yyvsp[-2].string)];
2036  attr_list[*(yyvsp[-2].string)] = (yyvsp[0].ast);
2037  delete (yyvsp[-2].string);
2038  }
2039 #line 2040 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2040  break;
2041 
2042  case 21:
2043 #line 209 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2044  {
2045  (yyval.string) = (yyvsp[0].string);
2046  }
2047 #line 2048 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2048  break;
2049 
2050  case 22:
2051 #line 212 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2052  {
2053  if ((yyvsp[0].string)->substr(0, 1) == "\\")
2054  *(yyvsp[-2].string) += "." + (yyvsp[0].string)->substr(1);
2055  else
2056  *(yyvsp[-2].string) += "." + *(yyvsp[0].string);
2057  delete (yyvsp[0].string);
2058  (yyval.string) = (yyvsp[-2].string);
2059  }
2060 #line 2061 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2061  break;
2062 
2063  case 23:
2064 #line 222 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2065  {
2066  do_not_require_port_stubs = false;
2067  AstNode *mod = new AstNode(AST_MODULE);
2068  ast_stack.back()->children.push_back(mod);
2069  ast_stack.push_back(mod);
2070  current_ast_mod = mod;
2071  port_stubs.clear();
2072  port_counter = 0;
2073  mod->str = *(yyvsp[0].string);
2074  append_attr(mod, (yyvsp[-2].al));
2075  delete (yyvsp[0].string);
2076  }
2077 #line 2078 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2078  break;
2079 
2080  case 24:
2081 #line 233 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2082  {
2083  if (port_stubs.size() != 0)
2084  frontend_verilog_yyerror("Missing details for module port `%s'.",
2085  port_stubs.begin()->first.c_str());
2086  ast_stack.pop_back();
2087  log_assert(ast_stack.size() == 1);
2089  }
2090 #line 2091 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2091  break;
2092 
2093  case 25:
2094 #line 243 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2095  { astbuf1 = nullptr; }
2096 #line 2097 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2097  break;
2098 
2099  case 26:
2100 #line 243 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2101  { if (astbuf1) delete astbuf1; }
2102 #line 2103 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2103  break;
2104 
2105  case 32:
2106 #line 251 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2107  {
2108  if (astbuf1) delete astbuf1;
2109  astbuf1 = new AstNode(AST_PARAMETER);
2110  astbuf1->children.push_back(AstNode::mkconst_int(0, true));
2111  }
2112 #line 2113 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2113  break;
2114 
2115  case 42:
2116 #line 267 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2117  {
2118  if (ast_stack.back()->children.size() > 0 && ast_stack.back()->children.back()->type == AST_WIRE) {
2119  AstNode *wire = new AstNode(AST_IDENTIFIER);
2120  wire->str = ast_stack.back()->children.back()->str;
2121  if (ast_stack.back()->children.back()->is_reg)
2122  ast_stack.back()->children.push_back(new AstNode(AST_INITIAL, new AstNode(AST_BLOCK, new AstNode(AST_ASSIGN_LE, wire, (yyvsp[0].ast)))));
2123  else
2124  ast_stack.back()->children.push_back(new AstNode(AST_ASSIGN, wire, (yyvsp[0].ast)));
2125  } else
2126  frontend_verilog_yyerror("Syntax error.");
2127  }
2128 #line 2129 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2129  break;
2130 
2131  case 44:
2132 #line 281 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2133  {
2134  if (ast_stack.back()->children.size() > 0 && ast_stack.back()->children.back()->type == AST_WIRE) {
2135  AstNode *node = ast_stack.back()->children.back()->clone();
2136  node->str = *(yyvsp[0].string);
2137  node->port_id = ++port_counter;
2138  ast_stack.back()->children.push_back(node);
2139  } else {
2140  if (port_stubs.count(*(yyvsp[0].string)) != 0)
2141  frontend_verilog_yyerror("Duplicate module port `%s'.", (yyvsp[0].string)->c_str());
2142  port_stubs[*(yyvsp[0].string)] = ++port_counter;
2143  }
2144  delete (yyvsp[0].string);
2145  }
2146 #line 2147 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2147  break;
2148 
2149  case 46:
2150 #line 294 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2151  {
2152  AstNode *node = (yyvsp[-2].ast);
2153  node->str = *(yyvsp[0].string);
2154  node->port_id = ++port_counter;
2155  if ((yyvsp[-1].ast) != NULL)
2156  node->children.push_back((yyvsp[-1].ast));
2157  if (!node->is_input && !node->is_output)
2158  frontend_verilog_yyerror("Module port `%s' is neither input nor output.", (yyvsp[0].string)->c_str());
2159  if (node->is_reg && node->is_input && !node->is_output)
2160  frontend_verilog_yyerror("Input port `%s' is declared as register.", (yyvsp[0].string)->c_str());
2161  ast_stack.back()->children.push_back(node);
2162  append_attr(node, (yyvsp[-3].al));
2163  delete (yyvsp[0].string);
2164  }
2165 #line 2166 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2166  break;
2167 
2168  case 48:
2169 #line 308 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2170  {
2172  }
2173 #line 2174 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2174  break;
2175 
2176  case 49:
2177 #line 313 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2178  {
2179  astbuf3 = new AstNode(AST_WIRE);
2180  }
2181 #line 2182 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2182  break;
2183 
2184  case 50:
2185 #line 315 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2186  {
2187  (yyval.ast) = astbuf3;
2188  }
2189 #line 2190 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2190  break;
2191 
2192  case 53:
2193 #line 323 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2194  {
2195  astbuf3->is_input = true;
2196  }
2197 #line 2198 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2198  break;
2199 
2200  case 54:
2201 #line 326 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2202  {
2203  astbuf3->is_output = true;
2204  }
2205 #line 2206 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2206  break;
2207 
2208  case 55:
2209 #line 329 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2210  {
2211  astbuf3->is_input = true;
2212  astbuf3->is_output = true;
2213  }
2214 #line 2215 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2215  break;
2216 
2217  case 56:
2218 #line 333 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2219  {
2220  }
2221 #line 2222 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2222  break;
2223 
2224  case 57:
2225 #line 335 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2226  {
2227  astbuf3->is_reg = true;
2228  }
2229 #line 2230 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2230  break;
2231 
2232  case 58:
2233 #line 338 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2234  {
2235  astbuf3->is_reg = true;
2236  astbuf3->range_left = 31;
2237  astbuf3->range_right = 0;
2238  astbuf3->is_signed = true;
2239  }
2240 #line 2241 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2241  break;
2242 
2243  case 59:
2244 #line 344 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2245  {
2246  astbuf3->type = AST_GENVAR;
2247  astbuf3->is_reg = true;
2248  astbuf3->range_left = 31;
2249  astbuf3->range_right = 0;
2250  }
2251 #line 2252 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2252  break;
2253 
2254  case 60:
2255 #line 350 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2256  {
2257  astbuf3->is_signed = true;
2258  }
2259 #line 2260 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2260  break;
2261 
2262  case 61:
2263 #line 355 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2264  {
2265  (yyval.ast) = new AstNode(AST_RANGE);
2266  (yyval.ast)->children.push_back((yyvsp[-3].ast));
2267  (yyval.ast)->children.push_back((yyvsp[-1].ast));
2268  }
2269 #line 2270 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2270  break;
2271 
2272  case 62:
2273 #line 360 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2274  {
2275  (yyval.ast) = new AstNode(AST_RANGE);
2276  (yyval.ast)->children.push_back(new AstNode(AST_SUB, new AstNode(AST_ADD, (yyvsp[-3].ast)->clone(), (yyvsp[-1].ast)), AstNode::mkconst_int(1, true)));
2277  (yyval.ast)->children.push_back(new AstNode(AST_ADD, (yyvsp[-3].ast), AstNode::mkconst_int(0, true)));
2278  }
2279 #line 2280 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2280  break;
2281 
2282  case 63:
2283 #line 365 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2284  {
2285  (yyval.ast) = new AstNode(AST_RANGE);
2286  (yyval.ast)->children.push_back(new AstNode(AST_ADD, (yyvsp[-3].ast), AstNode::mkconst_int(0, true)));
2287  (yyval.ast)->children.push_back(new AstNode(AST_SUB, new AstNode(AST_ADD, (yyvsp[-3].ast)->clone(), AstNode::mkconst_int(1, true)), (yyvsp[-1].ast)));
2288  }
2289 #line 2290 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2290  break;
2291 
2292  case 64:
2293 #line 370 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2294  {
2295  (yyval.ast) = new AstNode(AST_RANGE);
2296  (yyval.ast)->children.push_back((yyvsp[-1].ast));
2297  }
2298 #line 2299 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2299  break;
2300 
2301  case 65:
2302 #line 376 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2303  {
2304  (yyval.ast) = new AstNode(AST_MULTIRANGE, (yyvsp[-1].ast), (yyvsp[0].ast));
2305  }
2306 #line 2307 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2307  break;
2308 
2309  case 66:
2310 #line 379 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2311  {
2312  (yyval.ast) = (yyvsp[-1].ast);
2313  (yyval.ast)->children.push_back((yyvsp[0].ast));
2314  }
2315 #line 2316 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2316  break;
2317 
2318  case 67:
2319 #line 385 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2320  {
2321  (yyval.ast) = (yyvsp[0].ast);
2322  }
2323 #line 2324 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2324  break;
2325 
2326  case 68:
2327 #line 388 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2328  {
2329  (yyval.ast) = NULL;
2330  }
2331 #line 2332 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2332  break;
2333 
2334  case 69:
2335 #line 393 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2336  { (yyval.ast) = (yyvsp[0].ast); }
2337 #line 2338 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2338  break;
2339 
2340  case 70:
2341 #line 394 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2342  { (yyval.ast) = (yyvsp[0].ast); }
2343 #line 2344 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2344  break;
2345 
2346  case 71:
2347 #line 397 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2348  {
2349  (yyval.ast) = (yyvsp[0].ast);
2350  }
2351 #line 2352 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2352  break;
2353 
2354  case 72:
2355 #line 400 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2356  {
2357  (yyval.ast) = new AstNode(AST_RANGE);
2358  (yyval.ast)->children.push_back(AstNode::mkconst_int(31, true));
2359  (yyval.ast)->children.push_back(AstNode::mkconst_int(0, true));
2360  (yyval.ast)->is_signed = true;
2361  }
2362 #line 2363 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2363  break;
2364 
2365  case 87:
2366 #line 418 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2367  {
2368  current_function_or_task = new AstNode(AST_DPI_FUNCTION, AstNode::mkconst_str(*(yyvsp[-1].string)), AstNode::mkconst_str(*(yyvsp[0].string)));
2369  current_function_or_task->str = *(yyvsp[0].string);
2370  append_attr(current_function_or_task, (yyvsp[-3].al));
2371  ast_stack.back()->children.push_back(current_function_or_task);
2372  delete (yyvsp[-1].string);
2373  delete (yyvsp[0].string);
2374  }
2375 #line 2376 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2376  break;
2377 
2378  case 88:
2379 #line 425 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2380  {
2382  }
2383 #line 2384 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2384  break;
2385 
2386  case 89:
2387 #line 428 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2388  {
2389  current_function_or_task = new AstNode(AST_DPI_FUNCTION, AstNode::mkconst_str(*(yyvsp[-1].string)), AstNode::mkconst_str(*(yyvsp[-3].string)));
2390  current_function_or_task->str = *(yyvsp[0].string);
2391  append_attr(current_function_or_task, (yyvsp[-5].al));
2392  ast_stack.back()->children.push_back(current_function_or_task);
2393  delete (yyvsp[-3].string);
2394  delete (yyvsp[-1].string);
2395  delete (yyvsp[0].string);
2396  }
2397 #line 2398 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2398  break;
2399 
2400  case 90:
2401 #line 436 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2402  {
2404  }
2405 #line 2406 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2406  break;
2407 
2408  case 91:
2409 #line 439 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2410  {
2411  current_function_or_task = new AstNode(AST_DPI_FUNCTION, AstNode::mkconst_str(*(yyvsp[-1].string)), AstNode::mkconst_str(*(yyvsp[-5].string) + ":" + RTLIL::unescape_id(*(yyvsp[-3].string))));
2412  current_function_or_task->str = *(yyvsp[0].string);
2413  append_attr(current_function_or_task, (yyvsp[-7].al));
2414  ast_stack.back()->children.push_back(current_function_or_task);
2415  delete (yyvsp[-5].string);
2416  delete (yyvsp[-3].string);
2417  delete (yyvsp[-1].string);
2418  delete (yyvsp[0].string);
2419  }
2420 #line 2421 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2421  break;
2422 
2423  case 92:
2424 #line 448 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2425  {
2427  }
2428 #line 2429 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2429  break;
2430 
2431  case 93:
2432 #line 451 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2433  {
2435  current_function_or_task->str = *(yyvsp[0].string);
2436  append_attr(current_function_or_task, (yyvsp[-2].al));
2437  ast_stack.back()->children.push_back(current_function_or_task);
2440  delete (yyvsp[0].string);
2441  }
2442 #line 2443 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2443  break;
2444 
2445  case 94:
2446 #line 459 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2447  {
2449  ast_stack.pop_back();
2450  }
2451 #line 2452 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2452  break;
2453 
2454  case 95:
2455 #line 463 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2456  {
2458  current_function_or_task->str = *(yyvsp[0].string);
2459  append_attr(current_function_or_task, (yyvsp[-4].al));
2460  ast_stack.back()->children.push_back(current_function_or_task);
2462  AstNode *outreg = new AstNode(AST_WIRE);
2463  outreg->str = *(yyvsp[0].string);
2464  outreg->is_signed = (yyvsp[-2].boolean);
2465  if ((yyvsp[-1].ast) != NULL) {
2466  outreg->children.push_back((yyvsp[-1].ast));
2467  outreg->is_signed = (yyvsp[-2].boolean) || (yyvsp[-1].ast)->is_signed;
2468  (yyvsp[-1].ast)->is_signed = false;
2469  }
2470  current_function_or_task->children.push_back(outreg);
2472  delete (yyvsp[0].string);
2473  }
2474 #line 2475 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2475  break;
2476 
2477  case 96:
2478 #line 480 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2479  {
2481  ast_stack.pop_back();
2482  }
2483 #line 2484 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2484  break;
2485 
2486  case 97:
2487 #line 486 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2488  {
2489  current_function_or_task->children.push_back(AstNode::mkconst_str(*(yyvsp[-1].string)));
2490  delete (yyvsp[-1].string);
2491  delete (yyvsp[0].string);
2492  }
2493 #line 2494 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2494  break;
2495 
2496  case 98:
2497 #line 491 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2498  {
2499  current_function_or_task->children.push_back(AstNode::mkconst_str(*(yyvsp[0].string)));
2500  delete (yyvsp[0].string);
2501  }
2502 #line 2503 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2503  break;
2504 
2505  case 105:
2506 #line 507 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2507  {
2508  (yyval.boolean) = true;
2509  }
2510 #line 2511 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2511  break;
2512 
2513  case 106:
2514 #line 510 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2515  {
2516  (yyval.boolean) = false;
2517  }
2518 #line 2519 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2519  break;
2520 
2521  case 109:
2522 #line 515 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2523  {
2524  albuf = nullptr;
2525  astbuf1 = nullptr;
2526  astbuf2 = nullptr;
2527  }
2528 #line 2529 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2529  break;
2530 
2531  case 110:
2532 #line 519 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2533  {
2534  delete astbuf1;
2535  if (astbuf2 != NULL)
2536  delete astbuf2;
2537  free_attr(albuf);
2538  }
2539 #line 2540 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2540  break;
2541 
2542  case 114:
2543 #line 530 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2544  {
2545  if (albuf) {
2546  delete astbuf1;
2547  if (astbuf2 != NULL)
2548  delete astbuf2;
2549  free_attr(albuf);
2550  }
2551  albuf = (yyvsp[-2].al);
2552  astbuf1 = (yyvsp[-1].ast);
2553  astbuf2 = (yyvsp[0].ast);
2554  if (astbuf1->range_left >= 0 && astbuf1->range_right >= 0) {
2555  if (astbuf2) {
2556  frontend_verilog_yyerror("Syntax error.");
2557  } else {
2558  astbuf2 = new AstNode(AST_RANGE);
2561  }
2562  }
2563  if (astbuf2 && astbuf2->children.size() != 2)
2564  frontend_verilog_yyerror("Syntax error.");
2565  }
2566 #line 2567 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2567  break;
2568 
2569  case 119:
2570 #line 558 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2571  {
2572  astbuf1->is_signed = true;
2573  }
2574 #line 2575 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2575  break;
2576 
2577  case 121:
2578 #line 563 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2579  {
2580  if (astbuf1->children.size() != 1)
2581  frontend_verilog_yyerror("Syntax error.");
2582  astbuf1->children.push_back(new AstNode(AST_RANGE));
2583  astbuf1->children.back()->children.push_back(AstNode::mkconst_int(31, true));
2584  astbuf1->children.back()->children.push_back(AstNode::mkconst_int(0, true));
2585  astbuf1->is_signed = true;
2586  }
2587 #line 2588 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2588  break;
2589 
2590  case 123:
2591 #line 573 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2592  {
2593  if (astbuf1->children.size() != 1)
2594  frontend_verilog_yyerror("Syntax error.");
2595  astbuf1->children.push_back(new AstNode(AST_REALVALUE));
2596  }
2597 #line 2598 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2598  break;
2599 
2600  case 125:
2601 #line 580 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2602  {
2603  if ((yyvsp[0].ast) != NULL) {
2604  if (astbuf1->children.size() != 1)
2605  frontend_verilog_yyerror("Syntax error.");
2606  astbuf1->children.push_back((yyvsp[0].ast));
2607  }
2608  }
2609 #line 2610 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2610  break;
2611 
2612  case 126:
2613 #line 589 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2614  {
2615  astbuf1 = new AstNode(AST_PARAMETER);
2616  astbuf1->children.push_back(AstNode::mkconst_int(0, true));
2617  }
2618 #line 2619 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2619  break;
2620 
2621  case 127:
2622 #line 592 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2623  {
2624  delete astbuf1;
2625  }
2626 #line 2627 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2627  break;
2628 
2629  case 128:
2630 #line 597 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2631  {
2633  astbuf1->children.push_back(AstNode::mkconst_int(0, true));
2634  }
2635 #line 2636 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2636  break;
2637 
2638  case 129:
2639 #line 600 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2640  {
2641  delete astbuf1;
2642  }
2643 #line 2644 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2644  break;
2645 
2646  case 132:
2647 #line 608 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2648  {
2649  if (astbuf1 == nullptr)
2650  frontend_verilog_yyerror("syntax error");
2651  AstNode *node = astbuf1->clone();
2652  node->str = *(yyvsp[-2].string);
2653  delete node->children[0];
2654  node->children[0] = (yyvsp[0].ast);
2655  ast_stack.back()->children.push_back(node);
2656  delete (yyvsp[-2].string);
2657  }
2658 #line 2659 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2659  break;
2660 
2661  case 136:
2662 #line 626 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2663  {
2664  AstNode *node = new AstNode(AST_DEFPARAM);
2665  node->str = *(yyvsp[-2].string);
2666  node->children.push_back((yyvsp[0].ast));
2667  if ((yyvsp[-3].ast) != NULL)
2668  node->children.push_back((yyvsp[-3].ast));
2669  ast_stack.back()->children.push_back(node);
2670  delete (yyvsp[-2].string);
2671  }
2672 #line 2673 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2673  break;
2674 
2675  case 137:
2676 #line 637 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2677  {
2678  albuf = (yyvsp[-2].al);
2679  astbuf1 = (yyvsp[-1].ast);
2680  astbuf2 = (yyvsp[0].ast);
2681  if (astbuf1->range_left >= 0 && astbuf1->range_right >= 0) {
2682  if (astbuf2) {
2683  frontend_verilog_yyerror("Syntax error.");
2684  } else {
2685  astbuf2 = new AstNode(AST_RANGE);
2688  }
2689  }
2690  if (astbuf2 && astbuf2->children.size() != 2)
2691  frontend_verilog_yyerror("Syntax error.");
2692  }
2693 #line 2694 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2694  break;
2695 
2696  case 138:
2697 #line 652 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2698  {
2699  delete astbuf1;
2700  if (astbuf2 != NULL)
2701  delete astbuf2;
2702  free_attr(albuf);
2703  }
2704 #line 2705 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2705  break;
2706 
2707  case 140:
2708 #line 658 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2709  {
2710  ast_stack.back()->children.push_back(new AstNode(AST_WIRE));
2711  ast_stack.back()->children.back()->str = *(yyvsp[-1].string);
2712  append_attr(ast_stack.back()->children.back(), (yyvsp[-3].al));
2713  ast_stack.back()->children.push_back(new AstNode(AST_ASSIGN, new AstNode(AST_IDENTIFIER), AstNode::mkconst_int(0, false, 1)));
2714  ast_stack.back()->children.back()->children[0]->str = *(yyvsp[-1].string);
2715  delete (yyvsp[-1].string);
2716  }
2717 #line 2718 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2718  break;
2719 
2720  case 141:
2721 #line 666 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2722  {
2723  ast_stack.back()->children.push_back(new AstNode(AST_WIRE));
2724  ast_stack.back()->children.back()->str = *(yyvsp[-1].string);
2725  append_attr(ast_stack.back()->children.back(), (yyvsp[-3].al));
2726  ast_stack.back()->children.push_back(new AstNode(AST_ASSIGN, new AstNode(AST_IDENTIFIER), AstNode::mkconst_int(1, false, 1)));
2727  ast_stack.back()->children.back()->children[0]->str = *(yyvsp[-1].string);
2728  delete (yyvsp[-1].string);
2729  }
2730 #line 2731 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2731  break;
2732 
2733  case 145:
2734 #line 680 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2735  {
2736  AstNode *wire = new AstNode(AST_IDENTIFIER);
2737  wire->str = ast_stack.back()->children.back()->str;
2738  if (astbuf1->is_reg)
2739  ast_stack.back()->children.push_back(new AstNode(AST_INITIAL, new AstNode(AST_BLOCK, new AstNode(AST_ASSIGN_LE, wire, (yyvsp[0].ast)))));
2740  else
2741  ast_stack.back()->children.push_back(new AstNode(AST_ASSIGN, wire, (yyvsp[0].ast)));
2742  }
2743 #line 2744 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2744  break;
2745 
2746  case 146:
2747 #line 690 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2748  {
2749  AstNode *node = astbuf1->clone();
2750  node->str = *(yyvsp[-1].string);
2751  append_attr_clone(node, albuf);
2752  if (astbuf2 != NULL)
2753  node->children.push_back(astbuf2->clone());
2754  if ((yyvsp[0].ast) != NULL) {
2755  if (node->is_input || node->is_output)
2756  frontend_verilog_yyerror("Syntax error.");
2757  if (!astbuf2) {
2758  AstNode *rng = new AstNode(AST_RANGE);
2759  rng->children.push_back(AstNode::mkconst_int(0, true));
2760  rng->children.push_back(AstNode::mkconst_int(0, true));
2761  node->children.push_back(rng);
2762  }
2763  node->type = AST_MEMORY;
2764  node->children.push_back((yyvsp[0].ast));
2765  }
2766  if (current_function_or_task == NULL) {
2767  if (do_not_require_port_stubs && (node->is_input || node->is_output) && port_stubs.count(*(yyvsp[-1].string)) == 0) {
2768  port_stubs[*(yyvsp[-1].string)] = ++port_counter;
2769  }
2770  if (port_stubs.count(*(yyvsp[-1].string)) != 0) {
2771  if (!node->is_input && !node->is_output)
2772  frontend_verilog_yyerror("Module port `%s' is neither input nor output.", (yyvsp[-1].string)->c_str());
2773  if (node->is_reg && node->is_input && !node->is_output)
2774  frontend_verilog_yyerror("Input port `%s' is declared as register.", (yyvsp[-1].string)->c_str());
2775  node->port_id = port_stubs[*(yyvsp[-1].string)];
2776  port_stubs.erase(*(yyvsp[-1].string));
2777  } else {
2778  if (node->is_input || node->is_output)
2779  frontend_verilog_yyerror("Module port `%s' is not declared in module header.", (yyvsp[-1].string)->c_str());
2780  }
2781  } else {
2782  if (node->is_input || node->is_output)
2784  }
2785  ast_stack.back()->children.push_back(node);
2786  delete (yyvsp[-1].string);
2787  }
2788 #line 2789 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2789  break;
2790 
2791  case 150:
2792 #line 738 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2793  {
2794  ast_stack.back()->children.push_back(new AstNode(AST_ASSIGN, (yyvsp[-2].ast), (yyvsp[0].ast)));
2795  }
2796 #line 2797 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2797  break;
2798 
2799  case 151:
2800 #line 743 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2801  {
2802  astbuf1 = new AstNode(AST_CELL);
2803  append_attr(astbuf1, (yyvsp[-1].al));
2804  astbuf1->children.push_back(new AstNode(AST_CELLTYPE));
2805  astbuf1->children[0]->str = *(yyvsp[0].string);
2806  delete (yyvsp[0].string);
2807  }
2808 #line 2809 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2809  break;
2810 
2811  case 152:
2812 #line 749 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2813  {
2814  delete astbuf1;
2815  }
2816 #line 2817 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2817  break;
2818 
2819  case 153:
2820 #line 752 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2821  {
2822  astbuf1 = new AstNode(AST_PRIMITIVE);
2823  astbuf1->str = *(yyvsp[0].string);
2824  append_attr(astbuf1, (yyvsp[-1].al));
2825  delete (yyvsp[0].string);
2826  }
2827 #line 2828 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2828  break;
2829 
2830  case 154:
2831 #line 757 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2832  {
2833  delete astbuf1;
2834  }
2835 #line 2836 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2836  break;
2837 
2838  case 155:
2839 #line 762 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2840  {
2841  (yyval.string) = (yyvsp[0].string);
2842  }
2843 #line 2844 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2844  break;
2845 
2846  case 156:
2847 #line 765 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2848  {
2849  (yyval.string) = new std::string("or");
2850  }
2851 #line 2852 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2852  break;
2853 
2854  case 159:
2855 #line 774 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2856  {
2857  astbuf2 = astbuf1->clone();
2858  if (astbuf2->type != AST_PRIMITIVE)
2859  astbuf2->str = *(yyvsp[0].string);
2860  delete (yyvsp[0].string);
2861  ast_stack.back()->children.push_back(astbuf2);
2862  }
2863 #line 2864 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2864  break;
2865 
2866  case 161:
2867 #line 781 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2868  {
2869  astbuf2 = astbuf1->clone();
2870  if (astbuf2->type != AST_PRIMITIVE)
2871  astbuf2->str = *(yyvsp[-1].string);
2872  delete (yyvsp[-1].string);
2873  ast_stack.back()->children.push_back(new AstNode(AST_CELLARRAY, (yyvsp[0].ast), astbuf2));
2874  }
2875 #line 2876 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2876  break;
2877 
2878  case 166:
2879 #line 795 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2880  {
2881  astbuf2 = astbuf1->clone();
2882  ast_stack.back()->children.push_back(astbuf2);
2883  }
2884 #line 2885 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2885  break;
2886 
2887  case 173:
2888 #line 808 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2889  {
2890  AstNode *node = new AstNode(AST_PARASET);
2891  astbuf1->children.push_back(node);
2892  node->children.push_back((yyvsp[0].ast));
2893  }
2894 #line 2895 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2895  break;
2896 
2897  case 174:
2898 #line 813 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2899  {
2900  AstNode *node = new AstNode(AST_PARASET);
2901  node->str = *(yyvsp[-3].string);
2902  astbuf1->children.push_back(node);
2903  node->children.push_back((yyvsp[-1].ast));
2904  delete (yyvsp[-3].string);
2905  }
2906 #line 2907 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2907  break;
2908 
2909  case 178:
2910 #line 824 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2911  {
2912  AstNode *node = new AstNode(AST_ARGUMENT);
2913  astbuf2->children.push_back(node);
2914  }
2915 #line 2916 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2916  break;
2917 
2918  case 180:
2919 #line 830 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2920  {
2921  AstNode *node = new AstNode(AST_ARGUMENT);
2922  astbuf2->children.push_back(node);
2923  node->children.push_back((yyvsp[0].ast));
2924  }
2925 #line 2926 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2926  break;
2927 
2928  case 181:
2929 #line 835 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2930  {
2931  AstNode *node = new AstNode(AST_ARGUMENT);
2932  node->str = *(yyvsp[-3].string);
2933  astbuf2->children.push_back(node);
2934  node->children.push_back((yyvsp[-1].ast));
2935  delete (yyvsp[-3].string);
2936  }
2937 #line 2938 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2938  break;
2939 
2940  case 182:
2941 #line 842 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2942  {
2943  AstNode *node = new AstNode(AST_ARGUMENT);
2944  node->str = *(yyvsp[-2].string);
2945  astbuf2->children.push_back(node);
2946  delete (yyvsp[-2].string);
2947  }
2948 #line 2949 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2949  break;
2950 
2951  case 183:
2952 #line 850 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2953  {
2954  AstNode *node = new AstNode(AST_ALWAYS);
2955  append_attr(node, (yyvsp[-1].al));
2956  ast_stack.back()->children.push_back(node);
2957  ast_stack.push_back(node);
2958  }
2959 #line 2960 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2960  break;
2961 
2962  case 184:
2963 #line 855 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2964  {
2965  AstNode *block = new AstNode(AST_BLOCK);
2966  ast_stack.back()->children.push_back(block);
2967  ast_stack.push_back(block);
2968  }
2969 #line 2970 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2970  break;
2971 
2972  case 185:
2973 #line 859 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2974  {
2975  ast_stack.pop_back();
2976  ast_stack.pop_back();
2977  }
2978 #line 2979 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2979  break;
2980 
2981  case 186:
2982 #line 863 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2983  {
2984  AstNode *node = new AstNode(AST_INITIAL);
2985  append_attr(node, (yyvsp[-1].al));
2986  ast_stack.back()->children.push_back(node);
2987  ast_stack.push_back(node);
2988  AstNode *block = new AstNode(AST_BLOCK);
2989  ast_stack.back()->children.push_back(block);
2990  ast_stack.push_back(block);
2991  }
2992 #line 2993 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2993  break;
2994 
2995  case 187:
2996 #line 871 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2997  {
2998  ast_stack.pop_back();
2999  ast_stack.pop_back();
3000  }
3001 #line 3002 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3002  break;
3003 
3004  case 197:
3005 #line 890 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3006  {
3007  AstNode *node = new AstNode(AST_POSEDGE);
3008  ast_stack.back()->children.push_back(node);
3009  node->children.push_back((yyvsp[0].ast));
3010  }
3011 #line 3012 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3012  break;
3013 
3014  case 198:
3015 #line 895 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3016  {
3017  AstNode *node = new AstNode(AST_NEGEDGE);
3018  ast_stack.back()->children.push_back(node);
3019  node->children.push_back((yyvsp[0].ast));
3020  }
3021 #line 3022 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3022  break;
3023 
3024  case 199:
3025 #line 900 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3026  {
3027  AstNode *node = new AstNode(AST_EDGE);
3028  ast_stack.back()->children.push_back(node);
3029  node->children.push_back((yyvsp[0].ast));
3030  }
3031 #line 3032 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3032  break;
3033 
3034  case 200:
3035 #line 907 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3036  {
3037  (yyval.string) = (yyvsp[0].string);
3038  }
3039 #line 3040 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3040  break;
3041 
3042  case 201:
3043 #line 910 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3044  {
3045  (yyval.string) = NULL;
3046  }
3047 #line 3048 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3048  break;
3049 
3050  case 202:
3051 #line 915 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3052  {
3053  ast_stack.back()->children.push_back(new AstNode(AST_ASSERT, (yyvsp[-2].ast)));
3054  }
3055 #line 3056 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3056  break;
3057 
3058  case 203:
3059 #line 920 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3060  {
3061  ast_stack.back()->children.push_back(new AstNode(AST_ASSERT, (yyvsp[-2].ast)));
3062  }
3063 #line 3064 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3064  break;
3065 
3066  case 204:
3067 #line 925 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3068  {
3069  AstNode *node = new AstNode(AST_ASSIGN_EQ, (yyvsp[-2].ast), (yyvsp[0].ast));
3070  ast_stack.back()->children.push_back(node);
3071  }
3072 #line 3073 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3073  break;
3074 
3075  case 205:
3076 #line 929 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3077  {
3078  AstNode *node = new AstNode(AST_ASSIGN_LE, (yyvsp[-2].ast), (yyvsp[0].ast));
3079  ast_stack.back()->children.push_back(node);
3080  }
3081 #line 3082 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3082  break;
3083 
3084  case 210:
3085 #line 938 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3086  {
3087  AstNode *node = new AstNode(AST_TCALL);
3088  node->str = *(yyvsp[-1].string);
3089  delete (yyvsp[-1].string);
3090  ast_stack.back()->children.push_back(node);
3091  ast_stack.push_back(node);
3092  append_attr(node, (yyvsp[0].al));
3093  }
3094 #line 3095 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3095  break;
3096 
3097  case 211:
3098 #line 945 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3099  {
3100  ast_stack.pop_back();
3101  }
3102 #line 3103 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3103  break;
3104 
3105  case 212:
3106 #line 948 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3107  {
3108  AstNode *node = new AstNode(AST_BLOCK);
3109  ast_stack.back()->children.push_back(node);
3110  ast_stack.push_back(node);
3111  append_attr(node, (yyvsp[-2].al));
3112  if ((yyvsp[0].string) != NULL)
3113  node->str = *(yyvsp[0].string);
3114  }
3115 #line 3116 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3116  break;
3117 
3118  case 213:
3119 #line 955 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3120  {
3121  if ((yyvsp[-4].string) != NULL && (yyvsp[0].string) != NULL && *(yyvsp[-4].string) != *(yyvsp[0].string))
3122  frontend_verilog_yyerror("Syntax error.");
3123  if ((yyvsp[-4].string) != NULL)
3124  delete (yyvsp[-4].string);
3125  if ((yyvsp[0].string) != NULL)
3126  delete (yyvsp[0].string);
3127  ast_stack.pop_back();
3128  }
3129 #line 3130 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3130  break;
3131 
3132  case 214:
3133 #line 964 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3134  {
3135  AstNode *node = new AstNode(AST_FOR);
3136  ast_stack.back()->children.push_back(node);
3137  ast_stack.push_back(node);
3138  append_attr(node, (yyvsp[-2].al));
3139  }
3140 #line 3141 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3141  break;
3142 
3143  case 215:
3144 #line 969 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3145  {
3146  ast_stack.back()->children.push_back((yyvsp[0].ast));
3147  }
3148 #line 3149 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3149  break;
3150 
3151  case 216:
3152 #line 971 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3153  {
3154  AstNode *block = new AstNode(AST_BLOCK);
3155  ast_stack.back()->children.push_back(block);
3156  ast_stack.push_back(block);
3157  }
3158 #line 3159 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3159  break;
3160 
3161  case 217:
3162 #line 975 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3163  {
3164  ast_stack.pop_back();
3165  ast_stack.pop_back();
3166  }
3167 #line 3168 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3168  break;
3169 
3170  case 218:
3171 #line 979 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3172  {
3173  AstNode *node = new AstNode(AST_WHILE);
3174  ast_stack.back()->children.push_back(node);
3175  ast_stack.push_back(node);
3176  append_attr(node, (yyvsp[-4].al));
3177  AstNode *block = new AstNode(AST_BLOCK);
3178  ast_stack.back()->children.push_back((yyvsp[-1].ast));
3179  ast_stack.back()->children.push_back(block);
3180  ast_stack.push_back(block);
3181  }
3182 #line 3183 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3183  break;
3184 
3185  case 219:
3186 #line 988 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3187  {
3188  ast_stack.pop_back();
3189  ast_stack.pop_back();
3190  }
3191 #line 3192 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3192  break;
3193 
3194  case 220:
3195 #line 992 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3196  {
3197  AstNode *node = new AstNode(AST_REPEAT);
3198  ast_stack.back()->children.push_back(node);
3199  ast_stack.push_back(node);
3200  append_attr(node, (yyvsp[-4].al));
3201  AstNode *block = new AstNode(AST_BLOCK);
3202  ast_stack.back()->children.push_back((yyvsp[-1].ast));
3203  ast_stack.back()->children.push_back(block);
3204  ast_stack.push_back(block);
3205  }
3206 #line 3207 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3207  break;
3208 
3209  case 221:
3210 #line 1001 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3211  {
3212  ast_stack.pop_back();
3213  ast_stack.pop_back();
3214  }
3215 #line 3216 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3216  break;
3217 
3218  case 222:
3219 #line 1005 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3220  {
3221  AstNode *node = new AstNode(AST_CASE);
3222  AstNode *block = new AstNode(AST_BLOCK);
3223  AstNode *cond = new AstNode(AST_COND, AstNode::mkconst_int(1, false, 1), block);
3224  ast_stack.back()->children.push_back(node);
3225  node->children.push_back(new AstNode(AST_REDUCE_BOOL, (yyvsp[-1].ast)));
3226  node->children.push_back(cond);
3227  ast_stack.push_back(node);
3228  ast_stack.push_back(block);
3229  append_attr(node, (yyvsp[-4].al));
3230  }
3231 #line 3232 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3232  break;
3233 
3234  case 223:
3235 #line 1015 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3236  {
3237  ast_stack.pop_back();
3238  ast_stack.pop_back();
3239  }
3240 #line 3241 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3241  break;
3242 
3243  case 224:
3244 #line 1019 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3245  {
3246  AstNode *node = new AstNode(AST_CASE, (yyvsp[-1].ast));
3247  ast_stack.back()->children.push_back(node);
3248  ast_stack.push_back(node);
3249  append_attr(node, (yyvsp[-4].al));
3250  }
3251 #line 3252 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3252  break;
3253 
3254  case 225:
3255 #line 1024 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3256  {
3257  case_type_stack.pop_back();
3258  ast_stack.pop_back();
3259  }
3260 #line 3261 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3261  break;
3262 
3263  case 226:
3264 #line 1030 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3265  {
3266  case_type_stack.push_back(0);
3267  }
3268 #line 3269 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3269  break;
3270 
3271  case 227:
3272 #line 1033 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3273  {
3274  case_type_stack.push_back('x');
3275  }
3276 #line 3277 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3277  break;
3278 
3279  case 228:
3280 #line 1036 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3281  {
3282  case_type_stack.push_back('z');
3283  }
3284 #line 3285 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3285  break;
3286 
3287  case 229:
3288 #line 1041 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3289  {
3290  if (ast_stack.back()->attributes.count("\\full_case") == 0)
3291  ast_stack.back()->attributes["\\full_case"] = AstNode::mkconst_int(1, false);
3292  }
3293 #line 3294 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3294  break;
3295 
3296  case 230:
3297 #line 1045 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3298  {
3299  if (ast_stack.back()->attributes.count("\\parallel_case") == 0)
3300  ast_stack.back()->attributes["\\parallel_case"] = AstNode::mkconst_int(1, false);
3301  }
3302 #line 3303 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3303  break;
3304 
3305  case 236:
3306 #line 1060 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3307  {
3308  AstNode *block = new AstNode(AST_BLOCK);
3309  AstNode *cond = new AstNode(AST_COND, new AstNode(AST_DEFAULT), block);
3310  ast_stack.pop_back();
3311  ast_stack.back()->children.push_back(cond);
3312  ast_stack.push_back(block);
3313  }
3314 #line 3315 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3315  break;
3316 
3317  case 241:
3318 #line 1074 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3319  {
3320  AstNode *node = new AstNode(AST_COND);
3321  ast_stack.back()->children.push_back(node);
3322  ast_stack.push_back(node);
3323  }
3324 #line 3325 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3325  break;
3326 
3327  case 242:
3328 #line 1078 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3329  {
3330  AstNode *block = new AstNode(AST_BLOCK);
3331  ast_stack.back()->children.push_back(block);
3332  ast_stack.push_back(block);
3333  case_type_stack.push_back(0);
3334  }
3335 #line 3336 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3336  break;
3337 
3338  case 243:
3339 #line 1083 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3340  {
3341  case_type_stack.pop_back();
3342  ast_stack.pop_back();
3343  ast_stack.pop_back();
3344  }
3345 #line 3346 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3346  break;
3347 
3348  case 246:
3349 #line 1094 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3350  {
3351  AstNode *node = new AstNode(AST_COND);
3352  ast_stack.back()->children.push_back(node);
3353  ast_stack.push_back(node);
3354  }
3355 #line 3356 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3356  break;
3357 
3358  case 247:
3359 #line 1098 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3360  {
3361  case_type_stack.push_back(0);
3362  }
3363 #line 3364 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3364  break;
3365 
3366  case 248:
3367 #line 1100 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3368  {
3369  case_type_stack.pop_back();
3370  ast_stack.pop_back();
3371  }
3372 #line 3373 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3373  break;
3374 
3375  case 251:
3376 #line 1110 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3377  {
3378  ast_stack.back()->children.push_back(new AstNode(AST_DEFAULT));
3379  }
3380 #line 3381 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3381  break;
3382 
3383  case 252:
3384 #line 1113 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3385  {
3386  ast_stack.back()->children.push_back((yyvsp[0].ast));
3387  }
3388 #line 3389 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3389  break;
3390 
3391  case 253:
3392 #line 1116 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3393  {
3394  ast_stack.back()->children.push_back((yyvsp[0].ast));
3395  }
3396 #line 3397 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3397  break;
3398 
3399  case 254:
3400 #line 1121 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3401  {
3402  (yyval.ast) = new AstNode(AST_PREFIX, (yyvsp[-3].ast), (yyvsp[0].ast));
3403  (yyval.ast)->str = *(yyvsp[-5].string);
3404  delete (yyvsp[-5].string);
3405  }
3406 #line 3407 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3407  break;
3408 
3409  case 255:
3410 #line 1126 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3411  {
3412  (yyval.ast) = new AstNode(AST_IDENTIFIER, (yyvsp[0].ast));
3413  (yyval.ast)->str = *(yyvsp[-1].string);
3414  delete (yyvsp[-1].string);
3415  }
3416 #line 3417 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3417  break;
3418 
3419  case 256:
3420 #line 1131 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3421  {
3422  (yyval.ast) = new AstNode(AST_IDENTIFIER, (yyvsp[0].ast));
3423  (yyval.ast)->str = *(yyvsp[-1].string);
3424  delete (yyvsp[-1].string);
3425  }
3426 #line 3427 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3427  break;
3428 
3429  case 257:
3430 #line 1138 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3431  {
3432  (yyval.ast) = (yyvsp[0].ast);
3433  }
3434 #line 3435 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3435  break;
3436 
3437  case 258:
3438 #line 1141 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3439  {
3440  (yyval.ast) = (yyvsp[-1].ast);
3441  }
3442 #line 3443 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3443  break;
3444 
3445  case 259:
3446 #line 1146 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3447  {
3448  (yyval.ast) = new AstNode(AST_CONCAT);
3449  (yyval.ast)->children.push_back((yyvsp[0].ast));
3450  }
3451 #line 3452 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3452  break;
3453 
3454  case 260:
3455 #line 1150 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3456  {
3457  (yyval.ast) = (yyvsp[0].ast);
3458  (yyval.ast)->children.push_back((yyvsp[-2].ast));
3459  }
3460 #line 3461 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3461  break;
3462 
3463  case 267:
3464 #line 1168 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3465  {
3466  ast_stack.back()->children.push_back((yyvsp[0].ast));
3467  }
3468 #line 3469 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3469  break;
3470 
3471  case 272:
3472 #line 1181 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3473  {
3474  AstNode *node = new AstNode(AST_GENFOR);
3475  ast_stack.back()->children.push_back(node);
3476  ast_stack.push_back(node);
3477  }
3478 #line 3479 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3479  break;
3480 
3481  case 273:
3482 #line 1185 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3483  {
3484  ast_stack.back()->children.push_back((yyvsp[0].ast));
3485  }
3486 #line 3487 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3487  break;
3488 
3489  case 274:
3490 #line 1187 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3491  {
3492  ast_stack.pop_back();
3493  }
3494 #line 3495 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3495  break;
3496 
3497  case 275:
3498 #line 1190 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3499  {
3500  AstNode *node = new AstNode(AST_GENIF);
3501  ast_stack.back()->children.push_back(node);
3502  ast_stack.push_back(node);
3503  ast_stack.back()->children.push_back((yyvsp[-1].ast));
3504  }
3505 #line 3506 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3506  break;
3507 
3508  case 276:
3509 #line 1195 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3510  {
3511  ast_stack.pop_back();
3512  }
3513 #line 3514 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3514  break;
3515 
3516  case 277:
3517 #line 1198 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3518  {
3519  AstNode *node = new AstNode(AST_GENCASE, (yyvsp[-1].ast));
3520  ast_stack.back()->children.push_back(node);
3521  ast_stack.push_back(node);
3522  }
3523 #line 3524 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3524  break;
3525 
3526  case 278:
3527 #line 1202 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3528  {
3529  case_type_stack.pop_back();
3530  ast_stack.pop_back();
3531  }
3532 #line 3533 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3533  break;
3534 
3535  case 279:
3536 #line 1206 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3537  {
3538  AstNode *node = new AstNode(AST_GENBLOCK);
3539  node->str = (yyvsp[0].string) ? *(yyvsp[0].string) : std::string();
3540  ast_stack.back()->children.push_back(node);
3541  ast_stack.push_back(node);
3542  }
3543 #line 3544 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3544  break;
3545 
3546  case 280:
3547 #line 1211 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3548  {
3549  if ((yyvsp[-4].string) != NULL)
3550  delete (yyvsp[-4].string);
3551  if ((yyvsp[0].string) != NULL)
3552  delete (yyvsp[0].string);
3553  ast_stack.pop_back();
3554  }
3555 #line 3556 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3556  break;
3557 
3558  case 281:
3559 #line 1220 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3560  {
3561  AstNode *node = new AstNode(AST_GENBLOCK);
3562  ast_stack.back()->children.push_back(node);
3563  ast_stack.push_back(node);
3564  }
3565 #line 3566 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3566  break;
3567 
3568  case 282:
3569 #line 1224 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3570  {
3571  ast_stack.pop_back();
3572  }
3573 #line 3574 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3574  break;
3575 
3576  case 287:
3577 #line 1235 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3578  {
3579  (yyval.ast) = (yyvsp[0].ast);
3580  }
3581 #line 3582 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3582  break;
3583 
3584  case 288:
3585 #line 1238 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3586  {
3587  (yyval.ast) = new AstNode(AST_TERNARY);
3588  (yyval.ast)->children.push_back((yyvsp[-5].ast));
3589  (yyval.ast)->children.push_back((yyvsp[-2].ast));
3590  (yyval.ast)->children.push_back((yyvsp[0].ast));
3591  append_attr((yyval.ast), (yyvsp[-3].al));
3592  }
3593 #line 3594 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3594  break;
3595 
3596  case 289:
3597 #line 1247 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3598  {
3599  (yyval.ast) = (yyvsp[0].ast);
3600  }
3601 #line 3602 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3602  break;
3603 
3604  case 290:
3605 #line 1250 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3606  {
3607  if ((yyvsp[0].string)->substr(0, 1) != "'")
3608  frontend_verilog_yyerror("Syntax error.");
3609  AstNode *bits = (yyvsp[-2].ast);
3610  AstNode *val = const2ast(*(yyvsp[0].string), case_type_stack.size() == 0 ? 0 : case_type_stack.back());
3611  if (val == NULL)
3612  log_error("Value conversion failed: `%s'\n", (yyvsp[0].string)->c_str());
3613  (yyval.ast) = new AstNode(AST_TO_BITS, bits, val);
3614  delete (yyvsp[0].string);
3615  }
3616 #line 3617 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3617  break;
3618 
3619  case 291:
3620 #line 1260 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3621  {
3622  if ((yyvsp[0].string)->substr(0, 1) != "'")
3623  frontend_verilog_yyerror("Syntax error.");
3624  AstNode *bits = new AstNode(AST_IDENTIFIER);
3625  bits->str = *(yyvsp[-1].string);
3626  AstNode *val = const2ast(*(yyvsp[0].string), case_type_stack.size() == 0 ? 0 : case_type_stack.back());
3627  if (val == NULL)
3628  log_error("Value conversion failed: `%s'\n", (yyvsp[0].string)->c_str());
3629  (yyval.ast) = new AstNode(AST_TO_BITS, bits, val);
3630  delete (yyvsp[-1].string);
3631  delete (yyvsp[0].string);
3632  }
3633 #line 3634 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3634  break;
3635 
3636  case 292:
3637 #line 1272 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3638  {
3639  (yyval.ast) = const2ast(*(yyvsp[-1].string) + *(yyvsp[0].string), case_type_stack.size() == 0 ? 0 : case_type_stack.back());
3640  if ((yyval.ast) == NULL || (*(yyvsp[0].string))[0] != '\'')
3641  log_error("Value conversion failed: `%s%s'\n", (yyvsp[-1].string)->c_str(), (yyvsp[0].string)->c_str());
3642  delete (yyvsp[-1].string);
3643  delete (yyvsp[0].string);
3644  }
3645 #line 3646 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3646  break;
3647 
3648  case 293:
3649 #line 1279 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3650  {
3651  (yyval.ast) = const2ast(*(yyvsp[0].string), case_type_stack.size() == 0 ? 0 : case_type_stack.back());
3652  if ((yyval.ast) == NULL)
3653  log_error("Value conversion failed: `%s'\n", (yyvsp[0].string)->c_str());
3654  delete (yyvsp[0].string);
3655  }
3656 #line 3657 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3657  break;
3658 
3659  case 294:
3660 #line 1285 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3661  {
3662  (yyval.ast) = new AstNode(AST_REALVALUE);
3663  char *p = strdup((yyvsp[0].string)->c_str()), *q;
3664  for (int i = 0, j = 0; !p[j]; j++)
3665  if (p[j] != '_')
3666  p[i++] = p[j], p[i] = 0;
3667  (yyval.ast)->realvalue = strtod(p, &q);
3668  log_assert(*q == 0);
3669  delete (yyvsp[0].string);
3670  free(p);
3671  }
3672 #line 3673 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3673  break;
3674 
3675  case 295:
3676 #line 1296 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3677  {
3678  (yyval.ast) = AstNode::mkconst_str(*(yyvsp[0].string));
3679  delete (yyvsp[0].string);
3680  }
3681 #line 3682 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3682  break;
3683 
3684  case 296:
3685 #line 1300 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3686  {
3687  AstNode *node = new AstNode(AST_FCALL);
3688  node->str = *(yyvsp[-1].string);
3689  delete (yyvsp[-1].string);
3690  ast_stack.push_back(node);
3691  append_attr(node, (yyvsp[0].al));
3692  }
3693 #line 3694 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3694  break;
3695 
3696  case 297:
3697 #line 1306 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3698  {
3699  (yyval.ast) = ast_stack.back();
3700  ast_stack.pop_back();
3701  }
3702 #line 3703 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3703  break;
3704 
3705  case 298:
3706 #line 1310 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3707  {
3708  (yyval.ast) = new AstNode(AST_TO_SIGNED, (yyvsp[-1].ast));
3709  append_attr((yyval.ast), (yyvsp[-3].al));
3710  }
3711 #line 3712 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3712  break;
3713 
3714  case 299:
3715 #line 1314 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3716  {
3717  (yyval.ast) = new AstNode(AST_TO_UNSIGNED, (yyvsp[-1].ast));
3718  append_attr((yyval.ast), (yyvsp[-3].al));
3719  }
3720 #line 3721 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3721  break;
3722 
3723  case 300:
3724 #line 1318 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3725  {
3726  (yyval.ast) = (yyvsp[-1].ast);
3727  }
3728 #line 3729 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3729  break;
3730 
3731  case 301:
3732 #line 1321 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3733  {
3734  (yyval.ast) = (yyvsp[-1].ast);
3735  }
3736 #line 3737 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3737  break;
3738 
3739  case 302:
3740 #line 1324 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3741  {
3742  (yyval.ast) = new AstNode(AST_REPLICATE, (yyvsp[-4].ast), (yyvsp[-2].ast));
3743  }
3744 #line 3745 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3745  break;
3746 
3747  case 303:
3748 #line 1327 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3749  {
3750  (yyval.ast) = new AstNode(AST_BIT_NOT, (yyvsp[0].ast));
3751  append_attr((yyval.ast), (yyvsp[-1].al));
3752  }
3753 #line 3754 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3754  break;
3755 
3756  case 304:
3757 #line 1331 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3758  {
3759  (yyval.ast) = new AstNode(AST_BIT_AND, (yyvsp[-3].ast), (yyvsp[0].ast));
3760  append_attr((yyval.ast), (yyvsp[-1].al));
3761  }
3762 #line 3763 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3763  break;
3764 
3765  case 305:
3766 #line 1335 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3767  {
3768  (yyval.ast) = new AstNode(AST_BIT_OR, (yyvsp[-3].ast), (yyvsp[0].ast));
3769  append_attr((yyval.ast), (yyvsp[-1].al));
3770  }
3771 #line 3772 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3772  break;
3773 
3774  case 306:
3775 #line 1339 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3776  {
3777  (yyval.ast) = new AstNode(AST_BIT_XOR, (yyvsp[-3].ast), (yyvsp[0].ast));
3778  append_attr((yyval.ast), (yyvsp[-1].al));
3779  }
3780 #line 3781 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3781  break;
3782 
3783  case 307:
3784 #line 1343 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3785  {
3786  (yyval.ast) = new AstNode(AST_BIT_XNOR, (yyvsp[-3].ast), (yyvsp[0].ast));
3787  append_attr((yyval.ast), (yyvsp[-1].al));
3788  }
3789 #line 3790 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3790  break;
3791 
3792  case 308:
3793 #line 1347 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3794  {
3795  (yyval.ast) = new AstNode(AST_REDUCE_AND, (yyvsp[0].ast));
3796  append_attr((yyval.ast), (yyvsp[-1].al));
3797  }
3798 #line 3799 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3799  break;
3800 
3801  case 309:
3802 #line 1351 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3803  {
3804  (yyval.ast) = new AstNode(AST_REDUCE_AND, (yyvsp[0].ast));
3805  append_attr((yyval.ast), (yyvsp[-1].al));
3806  (yyval.ast) = new AstNode(AST_LOGIC_NOT, (yyval.ast));
3807  }
3808 #line 3809 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3809  break;
3810 
3811  case 310:
3812 #line 1356 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3813  {
3814  (yyval.ast) = new AstNode(AST_REDUCE_OR, (yyvsp[0].ast));
3815  append_attr((yyval.ast), (yyvsp[-1].al));
3816  }
3817 #line 3818 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3818  break;
3819 
3820  case 311:
3821 #line 1360 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3822  {
3823  (yyval.ast) = new AstNode(AST_REDUCE_OR, (yyvsp[0].ast));
3824  append_attr((yyval.ast), (yyvsp[-1].al));
3825  (yyval.ast) = new AstNode(AST_LOGIC_NOT, (yyval.ast));
3826  }
3827 #line 3828 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3828  break;
3829 
3830  case 312:
3831 #line 1365 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3832  {
3833  (yyval.ast) = new AstNode(AST_REDUCE_XOR, (yyvsp[0].ast));
3834  append_attr((yyval.ast), (yyvsp[-1].al));
3835  }
3836 #line 3837 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3837  break;
3838 
3839  case 313:
3840 #line 1369 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3841  {
3842  (yyval.ast) = new AstNode(AST_REDUCE_XNOR, (yyvsp[0].ast));
3843  append_attr((yyval.ast), (yyvsp[-1].al));
3844  }
3845 #line 3846 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3846  break;
3847 
3848  case 314:
3849 #line 1373 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3850  {
3851  (yyval.ast) = new AstNode(AST_SHIFT_LEFT, (yyvsp[-3].ast), (yyvsp[0].ast));
3852  append_attr((yyval.ast), (yyvsp[-1].al));
3853  }
3854 #line 3855 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3855  break;
3856 
3857  case 315:
3858 #line 1377 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3859  {
3860  (yyval.ast) = new AstNode(AST_SHIFT_RIGHT, (yyvsp[-3].ast), (yyvsp[0].ast));
3861  append_attr((yyval.ast), (yyvsp[-1].al));
3862  }
3863 #line 3864 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3864  break;
3865 
3866  case 316:
3867 #line 1381 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3868  {
3869  (yyval.ast) = new AstNode(AST_SHIFT_SLEFT, (yyvsp[-3].ast), (yyvsp[0].ast));
3870  append_attr((yyval.ast), (yyvsp[-1].al));
3871  }
3872 #line 3873 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3873  break;
3874 
3875  case 317:
3876 #line 1385 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3877  {
3878  (yyval.ast) = new AstNode(AST_SHIFT_SRIGHT, (yyvsp[-3].ast), (yyvsp[0].ast));
3879  append_attr((yyval.ast), (yyvsp[-1].al));
3880  }
3881 #line 3882 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3882  break;
3883 
3884  case 318:
3885 #line 1389 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3886  {
3887  (yyval.ast) = new AstNode(AST_LT, (yyvsp[-3].ast), (yyvsp[0].ast));
3888  append_attr((yyval.ast), (yyvsp[-1].al));
3889  }
3890 #line 3891 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3891  break;
3892 
3893  case 319:
3894 #line 1393 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3895  {
3896  (yyval.ast) = new AstNode(AST_LE, (yyvsp[-3].ast), (yyvsp[0].ast));
3897  append_attr((yyval.ast), (yyvsp[-1].al));
3898  }
3899 #line 3900 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3900  break;
3901 
3902  case 320:
3903 #line 1397 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3904  {
3905  (yyval.ast) = new AstNode(AST_EQ, (yyvsp[-3].ast), (yyvsp[0].ast));
3906  append_attr((yyval.ast), (yyvsp[-1].al));
3907  }
3908 #line 3909 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3909  break;
3910 
3911  case 321:
3912 #line 1401 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3913  {
3914  (yyval.ast) = new AstNode(AST_NE, (yyvsp[-3].ast), (yyvsp[0].ast));
3915  append_attr((yyval.ast), (yyvsp[-1].al));
3916  }
3917 #line 3918 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3918  break;
3919 
3920  case 322:
3921 #line 1405 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3922  {
3923  (yyval.ast) = new AstNode(AST_EQX, (yyvsp[-3].ast), (yyvsp[0].ast));
3924  append_attr((yyval.ast), (yyvsp[-1].al));
3925  }
3926 #line 3927 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3927  break;
3928 
3929  case 323:
3930 #line 1409 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3931  {
3932  (yyval.ast) = new AstNode(AST_NEX, (yyvsp[-3].ast), (yyvsp[0].ast));
3933  append_attr((yyval.ast), (yyvsp[-1].al));
3934  }
3935 #line 3936 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3936  break;
3937 
3938  case 324:
3939 #line 1413 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3940  {
3941  (yyval.ast) = new AstNode(AST_GE, (yyvsp[-3].ast), (yyvsp[0].ast));
3942  append_attr((yyval.ast), (yyvsp[-1].al));
3943  }
3944 #line 3945 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3945  break;
3946 
3947  case 325:
3948 #line 1417 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3949  {
3950  (yyval.ast) = new AstNode(AST_GT, (yyvsp[-3].ast), (yyvsp[0].ast));
3951  append_attr((yyval.ast), (yyvsp[-1].al));
3952  }
3953 #line 3954 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3954  break;
3955 
3956  case 326:
3957 #line 1421 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3958  {
3959  (yyval.ast) = new AstNode(AST_ADD, (yyvsp[-3].ast), (yyvsp[0].ast));
3960  append_attr((yyval.ast), (yyvsp[-1].al));
3961  }
3962 #line 3963 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3963  break;
3964 
3965  case 327:
3966 #line 1425 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3967  {
3968  (yyval.ast) = new AstNode(AST_SUB, (yyvsp[-3].ast), (yyvsp[0].ast));
3969  append_attr((yyval.ast), (yyvsp[-1].al));
3970  }
3971 #line 3972 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3972  break;
3973 
3974  case 328:
3975 #line 1429 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3976  {
3977  (yyval.ast) = new AstNode(AST_MUL, (yyvsp[-3].ast), (yyvsp[0].ast));
3978  append_attr((yyval.ast), (yyvsp[-1].al));
3979  }
3980 #line 3981 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3981  break;
3982 
3983  case 329:
3984 #line 1433 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3985  {
3986  (yyval.ast) = new AstNode(AST_DIV, (yyvsp[-3].ast), (yyvsp[0].ast));
3987  append_attr((yyval.ast), (yyvsp[-1].al));
3988  }
3989 #line 3990 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3990  break;
3991 
3992  case 330:
3993 #line 1437 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3994  {
3995  (yyval.ast) = new AstNode(AST_MOD, (yyvsp[-3].ast), (yyvsp[0].ast));
3996  append_attr((yyval.ast), (yyvsp[-1].al));
3997  }
3998 #line 3999 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3999  break;
4000 
4001  case 331:
4002 #line 1441 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
4003  {
4004  (yyval.ast) = new AstNode(AST_POW, (yyvsp[-3].ast), (yyvsp[0].ast));
4005  append_attr((yyval.ast), (yyvsp[-1].al));
4006  }
4007 #line 4008 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
4008  break;
4009 
4010  case 332:
4011 #line 1445 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
4012  {
4013  (yyval.ast) = new AstNode(AST_POS, (yyvsp[0].ast));
4014  append_attr((yyval.ast), (yyvsp[-1].al));
4015  }
4016 #line 4017 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
4017  break;
4018 
4019  case 333:
4020 #line 1449 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
4021  {
4022  (yyval.ast) = new AstNode(AST_NEG, (yyvsp[0].ast));
4023  append_attr((yyval.ast), (yyvsp[-1].al));
4024  }
4025 #line 4026 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
4026  break;
4027 
4028  case 334:
4029 #line 1453 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
4030  {
4031  (yyval.ast) = new AstNode(AST_LOGIC_AND, (yyvsp[-3].ast), (yyvsp[0].ast));
4032  append_attr((yyval.ast), (yyvsp[-1].al));
4033  }
4034 #line 4035 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
4035  break;
4036 
4037  case 335:
4038 #line 1457 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
4039  {
4040  (yyval.ast) = new AstNode(AST_LOGIC_OR, (yyvsp[-3].ast), (yyvsp[0].ast));
4041  append_attr((yyval.ast), (yyvsp[-1].al));
4042  }
4043 #line 4044 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
4044  break;
4045 
4046  case 336:
4047 #line 1461 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
4048  {
4049  (yyval.ast) = new AstNode(AST_LOGIC_NOT, (yyvsp[0].ast));
4050  append_attr((yyval.ast), (yyvsp[-1].al));
4051  }
4052 #line 4053 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
4053  break;
4054 
4055  case 337:
4056 #line 1467 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
4057  {
4058  (yyval.ast) = new AstNode(AST_CONCAT, (yyvsp[0].ast));
4059  }
4060 #line 4061 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
4061  break;
4062 
4063  case 338:
4064 #line 1470 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
4065  {
4066  (yyval.ast) = (yyvsp[0].ast);
4067  (yyval.ast)->children.push_back((yyvsp[-2].ast));
4068  }
4069 #line 4070 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
4070  break;
4071 
4072 
4073 #line 4074 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
4074  default: break;
4075  }
4076  /* User semantic actions sometimes alter yychar, and that requires
4077  that yytoken be updated with the new translation. We take the
4078  approach of translating immediately before every use of yytoken.
4079  One alternative is translating here after every semantic action,
4080  but that translation would be missed if the semantic action invokes
4081  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
4082  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
4083  incorrect destructor might then be invoked immediately. In the
4084  case of YYERROR or YYBACKUP, subsequent parser actions might lead
4085  to an incorrect destructor call or verbose syntax error message
4086  before the lookahead is translated. */
4087  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
4088 
4089  YYPOPSTACK (yylen);
4090  yylen = 0;
4091  YY_STACK_PRINT (yyss, yyssp);
4092 
4093  *++yyvsp = yyval;
4094 
4095  /* Now 'shift' the result of the reduction. Determine what state
4096  that goes to, based on the state we popped back to and the rule
4097  number reduced by. */
4098 
4099  yyn = yyr1[yyn];
4100 
4101  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4102  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4103  yystate = yytable[yystate];
4104  else
4105  yystate = yydefgoto[yyn - YYNTOKENS];
4106 
4107  goto yynewstate;
4108 
4109 
4110 /*--------------------------------------.
4111 | yyerrlab -- here on detecting error. |
4112 `--------------------------------------*/
4113 yyerrlab:
4114  /* Make sure we have latest lookahead translation. See comments at
4115  user semantic actions for why this is necessary. */
4116  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
4117 
4118  /* If not already recovering from an error, report this error. */
4119  if (!yyerrstatus)
4120  {
4121  ++yynerrs;
4122 #if ! YYERROR_VERBOSE
4123  yyerror (YY_("syntax error"));
4124 #else
4125 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
4126  yyssp, yytoken)
4127  {
4128  char const *yymsgp = YY_("syntax error");
4129  int yysyntax_error_status;
4130  yysyntax_error_status = YYSYNTAX_ERROR;
4131  if (yysyntax_error_status == 0)
4132  yymsgp = yymsg;
4133  else if (yysyntax_error_status == 1)
4134  {
4135  if (yymsg != yymsgbuf)
4136  YYSTACK_FREE (yymsg);
4137  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
4138  if (!yymsg)
4139  {
4140  yymsg = yymsgbuf;
4141  yymsg_alloc = sizeof yymsgbuf;
4142  yysyntax_error_status = 2;
4143  }
4144  else
4145  {
4146  yysyntax_error_status = YYSYNTAX_ERROR;
4147  yymsgp = yymsg;
4148  }
4149  }
4150  yyerror (yymsgp);
4151  if (yysyntax_error_status == 2)
4152  goto yyexhaustedlab;
4153  }
4154 # undef YYSYNTAX_ERROR
4155 #endif
4156  }
4157 
4158 
4159 
4160  if (yyerrstatus == 3)
4161  {
4162  /* If just tried and failed to reuse lookahead token after an
4163  error, discard it. */
4164 
4165  if (yychar <= YYEOF)
4166  {
4167  /* Return failure if at end of input. */
4168  if (yychar == YYEOF)
4169  YYABORT;
4170  }
4171  else
4172  {
4173  yydestruct ("Error: discarding",
4174  yytoken, &yylval);
4175  yychar = YYEMPTY;
4176  }
4177  }
4178 
4179  /* Else will try to reuse lookahead token after shifting the error
4180  token. */
4181  goto yyerrlab1;
4182 
4183 
4184 /*---------------------------------------------------.
4185 | yyerrorlab -- error raised explicitly by YYERROR. |
4186 `---------------------------------------------------*/
4187 yyerrorlab:
4188 
4189  /* Pacify compilers like GCC when the user code never invokes
4190  YYERROR and the label yyerrorlab therefore never appears in user
4191  code. */
4192  if (/*CONSTCOND*/ 0)
4193  goto yyerrorlab;
4194 
4195  /* Do not reclaim the symbols of the rule whose action triggered
4196  this YYERROR. */
4197  YYPOPSTACK (yylen);
4198  yylen = 0;
4199  YY_STACK_PRINT (yyss, yyssp);
4200  yystate = *yyssp;
4201  goto yyerrlab1;
4202 
4203 
4204 /*-------------------------------------------------------------.
4205 | yyerrlab1 -- common code for both syntax error and YYERROR. |
4206 `-------------------------------------------------------------*/
4207 yyerrlab1:
4208  yyerrstatus = 3; /* Each real token shifted decrements this. */
4209 
4210  for (;;)
4211  {
4212  yyn = yypact[yystate];
4213  if (!yypact_value_is_default (yyn))
4214  {
4215  yyn += YYTERROR;
4216  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4217  {
4218  yyn = yytable[yyn];
4219  if (0 < yyn)
4220  break;
4221  }
4222  }
4223 
4224  /* Pop the current state because it cannot handle the error token. */
4225  if (yyssp == yyss)
4226  YYABORT;
4227 
4228 
4229  yydestruct ("Error: popping",
4230  yystos[yystate], yyvsp);
4231  YYPOPSTACK (1);
4232  yystate = *yyssp;
4233  YY_STACK_PRINT (yyss, yyssp);
4234  }
4235 
4237  *++yyvsp = yylval;
4239 
4240 
4241  /* Shift the error token. */
4242  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4243 
4244  yystate = yyn;
4245  goto yynewstate;
4246 
4247 
4248 /*-------------------------------------.
4249 | yyacceptlab -- YYACCEPT comes here. |
4250 `-------------------------------------*/
4251 yyacceptlab:
4252  yyresult = 0;
4253  goto yyreturn;
4254 
4255 /*-----------------------------------.
4256 | yyabortlab -- YYABORT comes here. |
4257 `-----------------------------------*/
4258 yyabortlab:
4259  yyresult = 1;
4260  goto yyreturn;
4261 
4262 #if !defined yyoverflow || YYERROR_VERBOSE
4263 /*-------------------------------------------------.
4264 | yyexhaustedlab -- memory exhaustion comes here. |
4265 `-------------------------------------------------*/
4266 yyexhaustedlab:
4267  yyerror (YY_("memory exhausted"));
4268  yyresult = 2;
4269  /* Fall through. */
4270 #endif
4271 
4272 yyreturn:
4273  if (yychar != YYEMPTY)
4274  {
4275  /* Make sure we have latest lookahead translation. See comments at
4276  user semantic actions for why this is necessary. */
4277  yytoken = YYTRANSLATE (yychar);
4278  yydestruct ("Cleanup: discarding lookahead",
4279  yytoken, &yylval);
4280  }
4281  /* Do not reclaim the symbols of the rule whose action triggered
4282  this YYABORT or YYACCEPT. */
4283  YYPOPSTACK (yylen);
4284  YY_STACK_PRINT (yyss, yyssp);
4285  while (yyssp != yyss)
4286  {
4287  yydestruct ("Cleanup: popping",
4288  yystos[*yyssp], yyvsp);
4289  YYPOPSTACK (1);
4290  }
4291 #ifndef yyoverflow
4292  if (yyss != yyssa)
4293  YYSTACK_FREE (yyss);
4294 #endif
4295 #if YYERROR_VERBOSE
4296  if (yymsg != yymsgbuf)
4297  YYSTACK_FREE (yymsg);
4298 #endif
4299  return yyresult;
4300 }
#define YY_NULLPTR
static YOSYS_NAMESPACE_END void append_attr(AstNode *ast, std::map< std::string, AstNode * > *al)
YYSTYPE frontend_verilog_yylval
static AstNode * mkconst_int(uint32_t v, bool is_signed, int width=32)
Definition: ast.cc:672
signed char yytype_int8
std::map< std::string, AstNode * > * albuf
#define yychar
#define YYTRANSLATE(YYX)
struct AstNode * current_ast_mod
#define YOSYS_NAMESPACE_PREFIX
Definition: yosys.h:101
static const char *const yytname[]
static AstNode * mkconst_str(const std::vector< RTLIL::State > &v)
Definition: ast.cc:706
#define YOSYS_NAMESPACE_END
Definition: yosys.h:100
static std::string unescape_id(std::string str)
Definition: rtlil.h:257
#define YYFINAL
YOSYS_NAMESPACE_END void frontend_verilog_yyerror(char const *fmt,...)
#define YYABORT
yytokentype
std::vector< AstNode * > ast_stack
std::map< RTLIL::IdString, AstNode * > attributes
Definition: ast.h:152
void log_error(const char *format,...)
Definition: log.cc:204
struct AstNode * current_function_or_task
unsigned short int yytype_uint16
AstNode * current_ast
Definition: ast.cc:57
#define YYSTACK_ALLOC_MAXIMUM
static const yytype_uint16 yyr1[]
#define YYEMPTY
static const yytype_uint8 yytranslate[]
static void yy_reduce_print(yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
#define YYSTACK_FREE
#define YYNTOKENS
static const yytype_int16 yypgoto[]
struct AstNode * astbuf3
static const yytype_uint16 yystos[]
#define YYUSE(E)
#define yypact_value_is_default(Yystate)
#define yytable_value_is_error(Yytable_value)
struct AstNode * astbuf2
int range_right
Definition: ast.h:159
static const yytype_int16 yytable[]
#define YY_REDUCE_PRINT(Rule)
yytype_int16 yyss_alloc
bool is_reg
Definition: ast.h:158
int GetSize(RTLIL::Wire *wire)
Definition: yosys.cc:334
#define YYINITDEPTH
#define log_assert(_assert_expr_)
Definition: log.h:85
#define yylex
std::map< std::string, YOSYS_NAMESPACE_PREFIX AST::AstNode * > * al
unsigned char yytype_uint8
YYSTYPE yyvs_alloc
#define YYACCEPT
short int yytype_int16
static void free_attr(std::map< std::string, AstNode * > *al)
std::vector< char > case_type_stack
std::map< std::string, AstNode * > attr_list
#define YYDPRINTF(Args)
#define yyerror
#define YYSTACK_BYTES(N)
static void yy_symbol_print(FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep)
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
static void append_attr_clone(AstNode *ast, std::map< std::string, AstNode * > *al)
AstNodeType type
Definition: ast.h:146
void * malloc(YYSIZE_T)
std::istream * lexin
#define YY_(Msgid)
int range_left
Definition: ast.h:159
#define YYLAST
std::map< std::string, int > port_stubs
#define USING_YOSYS_NAMESPACE
Definition: yosys.h:102
#define YYFPRINTF
#define YYMAXDEPTH
AstNode * clone()
Definition: ast.cc:208
#define NULL
#define YOSYS_NAMESPACE_BEGIN
Definition: yosys.h:99
static const yytype_uint16 yyrline[]
void free(void *)
#define yynerrs
#define yydebug
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
static void yy_symbol_value_print(FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep)
#define yyparse
static const yytype_int16 yycheck[]
#define YYSIZE_T
int frontend_verilog_yyparse(void)
bool is_signed
Definition: ast.h:158
std::string str
Definition: ast.h:156
std::vector< AstNode * > children
Definition: ast.h:149
AST::AstNode * const2ast(std::string code, char case_type=0, bool warn_z=false)
Definition: const2ast.cc:135
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
struct AstNode * astbuf1
int frontend_verilog_yydebug
static void yy_stack_print(yytype_int16 *yybottom, yytype_int16 *yytop)
static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep)
std::string * string
static const yytype_uint8 yyr2[]
std::map< std::string, AstNode * > default_attr_list
bool is_output
Definition: ast.h:158
#define yylval
static const yytype_uint16 yydefact[]
#define YYEOF
#define YYSTACK_ALLOC
int port_id
Definition: ast.h:159
#define YY_STACK_PRINT(Bottom, Top)
#define YYPOPSTACK(N)
static const yytype_int16 yypact[]
static const yytype_int16 yydefgoto[]
bool is_input
Definition: ast.h:158
#define YYTERROR