yosys-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ilang_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 rtlil_frontend_ilang_yyparse
64 #define yylex rtlil_frontend_ilang_yylex
65 #define yyerror rtlil_frontend_ilang_yyerror
66 #define yydebug rtlil_frontend_ilang_yydebug
67 #define yynerrs rtlil_frontend_ilang_yynerrs
68 
69 #define yylval rtlil_frontend_ilang_yylval
70 #define yychar rtlil_frontend_ilang_yychar
71 
72 /* Copy the first part of user declarations. */
73 #line 25 "frontends/ilang/ilang_parser.y" /* yacc.c:339 */
74 
75 #include <list>
76 #include "ilang_frontend.h"
78 namespace ILANG_FRONTEND {
79  std::istream *lexin;
86  std::vector<std::vector<RTLIL::SwitchRule*>*> switch_stack;
87  std::vector<RTLIL::CaseRule*> case_stack;
88  std::map<RTLIL::IdString, RTLIL::Const> attrbuf;
89 }
90 using namespace ILANG_FRONTEND;
93 
94 #line 95 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:339 */
95 
96 # ifndef YY_NULLPTR
97 # if defined __cplusplus && 201103L <= __cplusplus
98 # define YY_NULLPTR nullptr
99 # else
100 # define YY_NULLPTR 0
101 # endif
102 # endif
103 
104 /* Enabling verbose error messages. */
105 #ifdef YYERROR_VERBOSE
106 # undef YYERROR_VERBOSE
107 # define YYERROR_VERBOSE 1
108 #else
109 # define YYERROR_VERBOSE 0
110 #endif
111 
112 /* In a future release of Bison, this section will be replaced
113  by #include "ilang_parser.tab.h". */
114 #ifndef YY_RTLIL_FRONTEND_ILANG_YY_FRONTENDS_ILANG_ILANG_PARSER_TAB_H_INCLUDED
115 # define YY_RTLIL_FRONTEND_ILANG_YY_FRONTENDS_ILANG_ILANG_PARSER_TAB_H_INCLUDED
116 /* Debug traces. */
117 #ifndef YYDEBUG
118 # define YYDEBUG 1
119 #endif
120 #if YYDEBUG
122 #endif
123 
124 /* Token type. */
125 #ifndef YYTOKENTYPE
126 # define YYTOKENTYPE
128  {
129  TOK_ID = 258,
130  TOK_VALUE = 259,
131  TOK_STRING = 260,
132  TOK_INT = 261,
133  TOK_AUTOIDX = 262,
134  TOK_MODULE = 263,
135  TOK_WIRE = 264,
136  TOK_WIDTH = 265,
137  TOK_INPUT = 266,
138  TOK_OUTPUT = 267,
139  TOK_INOUT = 268,
140  TOK_CELL = 269,
141  TOK_CONNECT = 270,
142  TOK_SWITCH = 271,
143  TOK_CASE = 272,
144  TOK_ASSIGN = 273,
145  TOK_SYNC = 274,
146  TOK_LOW = 275,
147  TOK_HIGH = 276,
148  TOK_POSEDGE = 277,
149  TOK_NEGEDGE = 278,
150  TOK_EDGE = 279,
151  TOK_ALWAYS = 280,
152  TOK_INIT = 281,
153  TOK_UPDATE = 282,
154  TOK_PROCESS = 283,
155  TOK_END = 284,
156  TOK_INVALID = 285,
157  TOK_EOL = 286,
158  TOK_OFFSET = 287,
161  TOK_MEMORY = 290,
162  TOK_SIZE = 291,
163  TOK_SIGNED = 292,
164  TOK_UPTO = 293
165  };
166 #endif
167 
168 /* Value type. */
169 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
170 typedef union YYSTYPE YYSTYPE;
171 union YYSTYPE
172 {
173 #line 48 "frontends/ilang/ilang_parser.y" /* yacc.c:355 */
174 
175  char *string;
176  int integer;
179 
180 #line 181 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:355 */
181 };
182 # define YYSTYPE_IS_TRIVIAL 1
183 # define YYSTYPE_IS_DECLARED 1
184 #endif
185 
186 
188 
190 
191 #endif /* !YY_RTLIL_FRONTEND_ILANG_YY_FRONTENDS_ILANG_ILANG_PARSER_TAB_H_INCLUDED */
192 
193 /* Copy the second part of user declarations. */
194 
195 #line 196 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:358 */
196 
197 #ifdef short
198 # undef short
199 #endif
200 
201 #ifdef YYTYPE_UINT8
202 typedef YYTYPE_UINT8 yytype_uint8;
203 #else
204 typedef unsigned char yytype_uint8;
205 #endif
206 
207 #ifdef YYTYPE_INT8
208 typedef YYTYPE_INT8 yytype_int8;
209 #else
210 typedef signed char yytype_int8;
211 #endif
212 
213 #ifdef YYTYPE_UINT16
214 typedef YYTYPE_UINT16 yytype_uint16;
215 #else
216 typedef unsigned short int yytype_uint16;
217 #endif
218 
219 #ifdef YYTYPE_INT16
220 typedef YYTYPE_INT16 yytype_int16;
221 #else
222 typedef short int yytype_int16;
223 #endif
224 
225 #ifndef YYSIZE_T
226 # ifdef __SIZE_TYPE__
227 # define YYSIZE_T __SIZE_TYPE__
228 # elif defined size_t
229 # define YYSIZE_T size_t
230 # elif ! defined YYSIZE_T
231 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
232 # define YYSIZE_T size_t
233 # else
234 # define YYSIZE_T unsigned int
235 # endif
236 #endif
237 
238 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
239 
240 #ifndef YY_
241 # if defined YYENABLE_NLS && YYENABLE_NLS
242 # if ENABLE_NLS
243 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
244 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
245 # endif
246 # endif
247 # ifndef YY_
248 # define YY_(Msgid) Msgid
249 # endif
250 #endif
251 
252 #ifndef YY_ATTRIBUTE
253 # if (defined __GNUC__ \
254  && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
255  || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
256 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
257 # else
258 # define YY_ATTRIBUTE(Spec) /* empty */
259 # endif
260 #endif
261 
262 #ifndef YY_ATTRIBUTE_PURE
263 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
264 #endif
265 
266 #ifndef YY_ATTRIBUTE_UNUSED
267 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
268 #endif
269 
270 #if !defined _Noreturn \
271  && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
272 # if defined _MSC_VER && 1200 <= _MSC_VER
273 # define _Noreturn __declspec (noreturn)
274 # else
275 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
276 # endif
277 #endif
278 
279 /* Suppress unused-variable warnings by "using" E. */
280 #if ! defined lint || defined __GNUC__
281 # define YYUSE(E) ((void) (E))
282 #else
283 # define YYUSE(E) /* empty */
284 #endif
285 
286 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
287 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
288 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
289  _Pragma ("GCC diagnostic push") \
290  _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
291  _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
292 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
293  _Pragma ("GCC diagnostic pop")
294 #else
295 # define YY_INITIAL_VALUE(Value) Value
296 #endif
297 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
298 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
299 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
300 #endif
301 #ifndef YY_INITIAL_VALUE
302 # define YY_INITIAL_VALUE(Value) /* Nothing. */
303 #endif
304 
305 
306 #if ! defined yyoverflow || YYERROR_VERBOSE
307 
308 /* The parser invokes alloca or malloc; define the necessary symbols. */
309 
310 # ifdef YYSTACK_USE_ALLOCA
311 # if YYSTACK_USE_ALLOCA
312 # ifdef __GNUC__
313 # define YYSTACK_ALLOC __builtin_alloca
314 # elif defined __BUILTIN_VA_ARG_INCR
315 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
316 # elif defined _AIX
317 # define YYSTACK_ALLOC __alloca
318 # elif defined _MSC_VER
319 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
320 # define alloca _alloca
321 # else
322 # define YYSTACK_ALLOC alloca
323 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
324 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
325  /* Use EXIT_SUCCESS as a witness for stdlib.h. */
326 # ifndef EXIT_SUCCESS
327 # define EXIT_SUCCESS 0
328 # endif
329 # endif
330 # endif
331 # endif
332 # endif
333 
334 # ifdef YYSTACK_ALLOC
335  /* Pacify GCC's 'empty if-body' warning. */
336 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
337 # ifndef YYSTACK_ALLOC_MAXIMUM
338  /* The OS might guarantee only one guard page at the bottom of the stack,
339  and a page size can be as small as 4096 bytes. So we cannot safely
340  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
341  to allow for a few compiler-allocated temporary stack slots. */
342 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
343 # endif
344 # else
345 # define YYSTACK_ALLOC YYMALLOC
346 # define YYSTACK_FREE YYFREE
347 # ifndef YYSTACK_ALLOC_MAXIMUM
348 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
349 # endif
350 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
351  && ! ((defined YYMALLOC || defined malloc) \
352  && (defined YYFREE || defined free)))
353 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
354 # ifndef EXIT_SUCCESS
355 # define EXIT_SUCCESS 0
356 # endif
357 # endif
358 # ifndef YYMALLOC
359 # define YYMALLOC malloc
360 # if ! defined malloc && ! defined EXIT_SUCCESS
361 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
362 # endif
363 # endif
364 # ifndef YYFREE
365 # define YYFREE free
366 # if ! defined free && ! defined EXIT_SUCCESS
367 void free (void *); /* INFRINGES ON USER NAME SPACE */
368 # endif
369 # endif
370 # endif
371 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
372 
373 
374 #if (! defined yyoverflow \
375  && (! defined __cplusplus \
376  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
377 
378 /* A type that is properly aligned for any stack member. */
379 union yyalloc
380 {
383 };
384 
385 /* The size of the maximum gap between one aligned stack and the next. */
386 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
387 
388 /* The size of an array large to enough to hold all stacks, each with
389  N elements. */
390 # define YYSTACK_BYTES(N) \
391  ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
392  + YYSTACK_GAP_MAXIMUM)
393 
394 # define YYCOPY_NEEDED 1
395 
396 /* Relocate STACK from its old location to the new one. The
397  local variables YYSIZE and YYSTACKSIZE give the old and new number of
398  elements in the stack, and YYPTR gives the new location of the
399  stack. Advance YYPTR to a properly aligned location for the next
400  stack. */
401 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
402  do \
403  { \
404  YYSIZE_T yynewbytes; \
405  YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
406  Stack = &yyptr->Stack_alloc; \
407  yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
408  yyptr += yynewbytes / sizeof (*yyptr); \
409  } \
410  while (0)
411 
412 #endif
413 
414 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
415 /* Copy COUNT objects from SRC to DST. The source and destination do
416  not overlap. */
417 # ifndef YYCOPY
418 # if defined __GNUC__ && 1 < __GNUC__
419 # define YYCOPY(Dst, Src, Count) \
420  __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
421 # else
422 # define YYCOPY(Dst, Src, Count) \
423  do \
424  { \
425  YYSIZE_T yyi; \
426  for (yyi = 0; yyi < (Count); yyi++) \
427  (Dst)[yyi] = (Src)[yyi]; \
428  } \
429  while (0)
430 # endif
431 # endif
432 #endif /* !YYCOPY_NEEDED */
433 
434 /* YYFINAL -- State number of the termination state. */
435 #define YYFINAL 3
436 /* YYLAST -- Last index in YYTABLE. */
437 #define YYLAST 136
438 
439 /* YYNTOKENS -- Number of terminals. */
440 #define YYNTOKENS 45
441 /* YYNNTS -- Number of nonterminals. */
442 #define YYNNTS 42
443 /* YYNRULES -- Number of rules. */
444 #define YYNRULES 84
445 /* YYNSTATES -- Number of states. */
446 #define YYNSTATES 154
447 
448 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
449  by yylex, with out-of-bounds checking. */
450 #define YYUNDEFTOK 2
451 #define YYMAXUTOK 293
452 
453 #define YYTRANSLATE(YYX) \
454  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
455 
456 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
457  as returned by yylex, without out-of-bounds checking. */
458 static const yytype_uint8 yytranslate[] =
459 {
460  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
461  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
462  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
464  2, 2, 2, 2, 39, 2, 2, 2, 2, 2,
465  2, 2, 2, 2, 2, 2, 2, 2, 42, 2,
466  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
467  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
468  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
469  2, 40, 2, 41, 2, 2, 2, 2, 2, 2,
470  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
471  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
472  2, 2, 2, 43, 2, 44, 2, 2, 2, 2,
473  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
474  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
475  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
476  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
477  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
478  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
479  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
480  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
481  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
482  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
483  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
484  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
485  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
486  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
487  15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
488  25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
489  35, 36, 37, 38
490 };
491 
492 #if YYDEBUG
493  /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
494 static const yytype_uint16 yyrline[] =
495 {
496  0, 73, 73, 73, 81, 84, 84, 87, 88, 89,
497  89, 93, 102, 93, 109, 109, 113, 113, 113, 113,
498  113, 113, 116, 123, 128, 128, 140, 143, 146, 149,
499  154, 159, 163, 167, 167, 180, 183, 185, 189, 189,
500  200, 205, 211, 217, 221, 221, 237, 237, 246, 248,
501  251, 251, 259, 263, 267, 270, 274, 275, 275, 279,
502  286, 286, 293, 293, 299, 299, 304, 308, 309, 310,
503  311, 312, 315, 319, 323, 354, 357, 363, 367, 373,
504  379, 385, 390, 397, 402
505 };
506 #endif
507 
508 #if YYDEBUG || YYERROR_VERBOSE || 0
509 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
510  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
511 static const char *const yytname[] =
512 {
513  "$end", "error", "$undefined", "TOK_ID", "TOK_VALUE", "TOK_STRING",
514  "TOK_INT", "TOK_AUTOIDX", "TOK_MODULE", "TOK_WIRE", "TOK_WIDTH",
515  "TOK_INPUT", "TOK_OUTPUT", "TOK_INOUT", "TOK_CELL", "TOK_CONNECT",
516  "TOK_SWITCH", "TOK_CASE", "TOK_ASSIGN", "TOK_SYNC", "TOK_LOW",
517  "TOK_HIGH", "TOK_POSEDGE", "TOK_NEGEDGE", "TOK_EDGE", "TOK_ALWAYS",
518  "TOK_INIT", "TOK_UPDATE", "TOK_PROCESS", "TOK_END", "TOK_INVALID",
519  "TOK_EOL", "TOK_OFFSET", "TOK_PARAMETER", "TOK_ATTRIBUTE", "TOK_MEMORY",
520  "TOK_SIZE", "TOK_SIGNED", "TOK_UPTO", "','", "'['", "']'", "':'", "'{'",
521  "'}'", "$accept", "input", "$@1", "EOL", "optional_eol", "design",
522  "module", "$@2", "$@3", "module_body", "module_stmt", "attr_stmt",
523  "autoidx_stmt", "wire_stmt", "$@4", "wire_options", "memory_stmt", "$@5",
524  "memory_options", "cell_stmt", "$@6", "cell_body", "proc_stmt", "$@7",
525  "switch_stmt", "$@8", "attr_list", "switch_body", "$@9", "compare_list",
526  "case_body", "assign_stmt", "sync_list", "$@10", "$@11", "$@12",
527  "sync_type", "update_list", "constant", "sigspec", "sigspec_list",
528  "conn_stmt", YY_NULLPTR
529 };
530 #endif
531 
532 # ifdef YYPRINT
533 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
534  (internal) symbol number NUM (which must be that of a token). */
535 static const yytype_uint16 yytoknum[] =
536 {
537  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
538  265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
539  275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
540  285, 286, 287, 288, 289, 290, 291, 292, 293, 44,
541  91, 93, 58, 123, 125
542 };
543 # endif
544 
545 #define YYPACT_NINF -83
546 
547 #define yypact_value_is_default(Yystate) \
548  (!!((Yystate) == (-83)))
549 
550 #define YYTABLE_NINF -59
551 
552 #define yytable_value_is_error(Yytable_value) \
553  0
554 
555  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
556  STATE-NUM. */
557 static const yytype_int8 yypact[] =
558 {
559  -83, 21, -25, -83, -83, -83, 17, 28, 39, 62,
560  -83, -83, -83, -83, -83, 69, -83, 37, -83, -83,
561  -83, -83, -83, 59, -83, -83, 83, -83, 73, 14,
562  90, -83, -83, -83, -83, -83, -83, -83, -83, -83,
563  -83, 91, 8, -83, -83, 14, -83, -83, -83, 34,
564  -83, 94, 10, -83, -83, -83, 19, -83, 96, 103,
565  108, 109, 113, -83, -83, 45, -83, -83, -83, 42,
566  -83, 114, 115, -83, -83, -83, -83, -83, -83, -83,
567  -83, 116, 14, -7, 15, -83, -7, -83, -83, -83,
568  -3, 55, 14, -83, 14, -83, 9, -83, 121, -83,
569  4, -83, -83, -83, 58, -83, 14, -83, 69, 122,
570  -83, -83, -83, -83, -83, -83, -83, -83, -83, 14,
571  -83, -83, -83, 69, -83, -83, -83, -83, -83, -83,
572  -83, 6, -83, -83, -83, -83, -83, -83, 99, 99,
573  -83, 14, -83, 14, 99, 88, -83, 14, 14, 41,
574  -83, -83, -83, -83
575 };
576 
577  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
578  Performed when YYTABLE does not specify something else to do. Zero
579  means the default is an error. */
580 static const yytype_uint8 yydefact[] =
581 {
582  6, 0, 2, 1, 5, 10, 3, 0, 0, 0,
583  7, 8, 9, 6, 6, 0, 23, 0, 11, 74,
584  76, 75, 6, 4, 15, 22, 0, 24, 0, 0,
585  0, 12, 33, 14, 16, 17, 18, 19, 20, 21,
586  32, 0, 78, 83, 77, 0, 6, 6, 37, 0,
587  6, 0, 0, 6, 44, 13, 0, 6, 0, 0,
588  0, 0, 0, 27, 38, 0, 81, 82, 84, 48,
589  6, 0, 0, 25, 26, 29, 30, 31, 28, 43,
590  79, 0, 0, 58, 0, 66, 58, 34, 35, 36,
591  0, 0, 0, 56, 0, 49, 0, 57, 0, 6,
592  0, 80, 6, 6, 0, 6, 0, 39, 0, 0,
593  59, 46, 67, 68, 69, 70, 71, 6, 6, 0,
594  45, 6, 6, 0, 52, 62, 64, 6, 42, 40,
595  6, 0, 73, 73, 60, 41, 50, 6, 63, 65,
596  73, 55, 47, 0, 61, 6, 53, 0, 0, 48,
597  6, 54, 51, 72
598 };
599 
600  /* YYPGOTO[NTERM-NUM]. */
601 static const yytype_int16 yypgoto[] =
602 {
603  -83, -83, -83, -14, 128, -83, -83, -83, -83, -83,
604  -83, -21, -83, -83, -83, -83, -83, -83, -83, -83,
605  -83, -83, -83, -83, -83, -83, -83, -83, -83, -83,
606  -82, -83, -83, -83, -83, -83, -83, -71, -13, -42,
607  -83, -83
608 };
609 
610  /* YYDEFGOTO[NTERM-NUM]. */
611 static const yytype_int16 yydefgoto[] =
612 {
613  -1, 1, 5, 16, 17, 6, 10, 24, 47, 26,
614  33, 11, 12, 35, 40, 49, 36, 48, 56, 37,
615  79, 90, 38, 69, 83, 124, 84, 131, 141, 145,
616  85, 86, 96, 140, 132, 133, 119, 138, 44, 45,
617  52, 39
618 };
619 
620  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
621  positive, shift that token. If negative, reduce the rule whose
622  number is the opposite. If YYTABLE_NINF, syntax error. */
623 static const yytype_int16 yytable[] =
624 {
625  18, 93, 22, 53, 97, 34, 4, 108, 25, -48,
626  67, 82, 98, 42, 19, 20, 21, 42, 19, 20,
627  21, 3, 70, 136, 7, 8, 99, -48, 104, 71,
628  100, 94, 54, 55, 13, 137, 64, 57, 105, 68,
629  92, 109, 14, 73, 58, 59, 60, 61, 51, 9,
630  102, 9, 103, 43, 66, 72, 87, 43, -58, 82,
631  82, -58, 139, 95, 121, 15, 62, 152, 23, 144,
632  -58, -58, 63, 19, 20, 21, 41, 127, 112, 113,
633  114, 115, 116, 117, 118, 107, 80, 81, 110, 111,
634  -5, 120, 27, 46, 50, 122, 101, 28, 29, 146,
635  65, 147, 74, 125, 126, 150, 151, 128, 129, 75,
636  130, 30, 31, 134, 76, 77, 135, 9, 32, 78,
637  88, 89, 91, 142, 106, 123, 143, 148, 2, 0,
638  0, 149, 0, 0, 0, 0, 153
639 };
640 
641 static const yytype_int16 yycheck[] =
642 {
643  14, 83, 15, 45, 86, 26, 31, 3, 22, 16,
644  52, 18, 15, 3, 4, 5, 6, 3, 4, 5,
645  6, 0, 3, 17, 7, 8, 29, 34, 19, 10,
646  33, 16, 46, 47, 6, 29, 50, 3, 29, 53,
647  82, 37, 3, 57, 10, 11, 12, 13, 40, 34,
648  92, 34, 94, 43, 44, 36, 70, 43, 17, 18,
649  18, 19, 133, 84, 106, 3, 32, 149, 31, 140,
650  29, 29, 38, 4, 5, 6, 3, 119, 20, 21,
651  22, 23, 24, 25, 26, 99, 41, 42, 102, 103,
652  31, 105, 9, 3, 3, 108, 41, 14, 15, 141,
653  6, 143, 6, 117, 118, 147, 148, 121, 122, 6,
654  123, 28, 29, 127, 6, 6, 130, 34, 35, 6,
655  6, 6, 6, 137, 3, 3, 27, 39, 0, -1,
656  -1, 145, -1, -1, -1, -1, 150
657 };
658 
659  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
660  symbol of state STATE-NUM. */
661 static const yytype_uint8 yystos[] =
662 {
663  0, 46, 49, 0, 31, 47, 50, 7, 8, 34,
664  51, 56, 57, 6, 3, 3, 48, 49, 48, 4,
665  5, 6, 83, 31, 52, 48, 54, 9, 14, 15,
666  28, 29, 35, 55, 56, 58, 61, 64, 67, 86,
667  59, 3, 3, 43, 83, 84, 3, 53, 62, 60,
668  3, 40, 85, 84, 48, 48, 63, 3, 10, 11,
669  12, 13, 32, 38, 48, 6, 44, 84, 48, 68,
670  3, 10, 36, 48, 6, 6, 6, 6, 6, 65,
671  41, 42, 18, 69, 71, 75, 76, 48, 6, 6,
672  66, 6, 84, 75, 16, 56, 77, 75, 15, 29,
673  33, 41, 84, 84, 19, 29, 3, 48, 3, 37,
674  48, 48, 20, 21, 22, 23, 24, 25, 26, 81,
675  48, 84, 83, 3, 70, 48, 48, 84, 48, 48,
676  83, 72, 79, 80, 48, 48, 17, 29, 82, 82,
677  78, 73, 48, 27, 82, 74, 84, 84, 39, 48,
678  84, 84, 75, 48
679 };
680 
681  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
682 static const yytype_uint8 yyr1[] =
683 {
684  0, 45, 47, 46, 48, 49, 49, 50, 50, 50,
685  50, 52, 53, 51, 54, 54, 55, 55, 55, 55,
686  55, 55, 56, 57, 59, 58, 60, 60, 60, 60,
687  60, 60, 60, 62, 61, 63, 63, 63, 65, 64,
688  66, 66, 66, 66, 68, 67, 70, 69, 71, 71,
689  73, 72, 72, 74, 74, 74, 75, 75, 75, 76,
690  78, 77, 79, 77, 80, 77, 77, 81, 81, 81,
691  81, 81, 82, 82, 83, 83, 83, 84, 84, 84,
692  84, 84, 85, 85, 86
693 };
694 
695  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
696 static const yytype_uint8 yyr2[] =
697 {
698  0, 2, 0, 3, 2, 2, 0, 2, 2, 2,
699  0, 0, 0, 8, 2, 0, 1, 1, 1, 1,
700  1, 1, 4, 3, 0, 5, 3, 2, 3, 3,
701  3, 3, 0, 0, 5, 3, 3, 0, 0, 8,
702  5, 6, 5, 0, 0, 8, 0, 8, 0, 2,
703  0, 6, 0, 1, 3, 0, 2, 2, 0, 4,
704  0, 7, 0, 6, 0, 6, 0, 1, 1, 1,
705  1, 1, 5, 0, 1, 1, 1, 1, 1, 4,
706  6, 3, 2, 0, 4
707 };
708 
709 
710 #define yyerrok (yyerrstatus = 0)
711 #define yyclearin (yychar = YYEMPTY)
712 #define YYEMPTY (-2)
713 #define YYEOF 0
714 
715 #define YYACCEPT goto yyacceptlab
716 #define YYABORT goto yyabortlab
717 #define YYERROR goto yyerrorlab
718 
719 
720 #define YYRECOVERING() (!!yyerrstatus)
721 
722 #define YYBACKUP(Token, Value) \
723 do \
724  if (yychar == YYEMPTY) \
725  { \
726  yychar = (Token); \
727  yylval = (Value); \
728  YYPOPSTACK (yylen); \
729  yystate = *yyssp; \
730  goto yybackup; \
731  } \
732  else \
733  { \
734  yyerror (YY_("syntax error: cannot back up")); \
735  YYERROR; \
736  } \
737 while (0)
738 
739 /* Error token number */
740 #define YYTERROR 1
741 #define YYERRCODE 256
742 
743 
744 
745 /* Enable debugging if requested. */
746 #if YYDEBUG
747 
748 # ifndef YYFPRINTF
749 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
750 # define YYFPRINTF fprintf
751 # endif
752 
753 # define YYDPRINTF(Args) \
754 do { \
755  if (yydebug) \
756  YYFPRINTF Args; \
757 } while (0)
758 
759 /* This macro is provided for backward compatibility. */
760 #ifndef YY_LOCATION_PRINT
761 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
762 #endif
763 
764 
765 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
766 do { \
767  if (yydebug) \
768  { \
769  YYFPRINTF (stderr, "%s ", Title); \
770  yy_symbol_print (stderr, \
771  Type, Value); \
772  YYFPRINTF (stderr, "\n"); \
773  } \
774 } while (0)
775 
776 
777 /*----------------------------------------.
778 | Print this symbol's value on YYOUTPUT. |
779 `----------------------------------------*/
780 
781 static void
782 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
783 {
784  FILE *yyo = yyoutput;
785  YYUSE (yyo);
786  if (!yyvaluep)
787  return;
788 # ifdef YYPRINT
789  if (yytype < YYNTOKENS)
790  YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
791 # endif
792  YYUSE (yytype);
793 }
794 
795 
796 /*--------------------------------.
797 | Print this symbol on YYOUTPUT. |
798 `--------------------------------*/
799 
800 static void
801 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
802 {
803  YYFPRINTF (yyoutput, "%s %s (",
804  yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
805 
806  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
807  YYFPRINTF (yyoutput, ")");
808 }
809 
810 /*------------------------------------------------------------------.
811 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
812 | TOP (included). |
813 `------------------------------------------------------------------*/
814 
815 static void
817 {
818  YYFPRINTF (stderr, "Stack now");
819  for (; yybottom <= yytop; yybottom++)
820  {
821  int yybot = *yybottom;
822  YYFPRINTF (stderr, " %d", yybot);
823  }
824  YYFPRINTF (stderr, "\n");
825 }
826 
827 # define YY_STACK_PRINT(Bottom, Top) \
828 do { \
829  if (yydebug) \
830  yy_stack_print ((Bottom), (Top)); \
831 } while (0)
832 
833 
834 /*------------------------------------------------.
835 | Report that the YYRULE is going to be reduced. |
836 `------------------------------------------------*/
837 
838 static void
839 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
840 {
841  unsigned long int yylno = yyrline[yyrule];
842  int yynrhs = yyr2[yyrule];
843  int yyi;
844  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
845  yyrule - 1, yylno);
846  /* The symbols being reduced. */
847  for (yyi = 0; yyi < yynrhs; yyi++)
848  {
849  YYFPRINTF (stderr, " $%d = ", yyi + 1);
850  yy_symbol_print (stderr,
851  yystos[yyssp[yyi + 1 - yynrhs]],
852  &(yyvsp[(yyi + 1) - (yynrhs)])
853  );
854  YYFPRINTF (stderr, "\n");
855  }
856 }
857 
858 # define YY_REDUCE_PRINT(Rule) \
859 do { \
860  if (yydebug) \
861  yy_reduce_print (yyssp, yyvsp, Rule); \
862 } while (0)
863 
864 /* Nonzero means print parse trace. It is left uninitialized so that
865  multiple parsers can coexist. */
867 #else /* !YYDEBUG */
868 # define YYDPRINTF(Args)
869 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
870 # define YY_STACK_PRINT(Bottom, Top)
871 # define YY_REDUCE_PRINT(Rule)
872 #endif /* !YYDEBUG */
873 
874 
875 /* YYINITDEPTH -- initial size of the parser's stacks. */
876 #ifndef YYINITDEPTH
877 # define YYINITDEPTH 200
878 #endif
879 
880 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
881  if the built-in stack extension method is used).
882 
883  Do not make this value too large; the results are undefined if
884  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
885  evaluated with infinite-precision integer arithmetic. */
886 
887 #ifndef YYMAXDEPTH
888 # define YYMAXDEPTH 10000
889 #endif
890 
891 
892 #if YYERROR_VERBOSE
893 
894 # ifndef yystrlen
895 # if defined __GLIBC__ && defined _STRING_H
896 # define yystrlen strlen
897 # else
898 /* Return the length of YYSTR. */
899 static YYSIZE_T
900 yystrlen (const char *yystr)
901 {
902  YYSIZE_T yylen;
903  for (yylen = 0; yystr[yylen]; yylen++)
904  continue;
905  return yylen;
906 }
907 # endif
908 # endif
909 
910 # ifndef yystpcpy
911 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
912 # define yystpcpy stpcpy
913 # else
914 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
915  YYDEST. */
916 static char *
917 yystpcpy (char *yydest, const char *yysrc)
918 {
919  char *yyd = yydest;
920  const char *yys = yysrc;
921 
922  while ((*yyd++ = *yys++) != '\0')
923  continue;
924 
925  return yyd - 1;
926 }
927 # endif
928 # endif
929 
930 # ifndef yytnamerr
931 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
932  quotes and backslashes, so that it's suitable for yyerror. The
933  heuristic is that double-quoting is unnecessary unless the string
934  contains an apostrophe, a comma, or backslash (other than
935  backslash-backslash). YYSTR is taken from yytname. If YYRES is
936  null, do not copy; instead, return the length of what the result
937  would have been. */
938 static YYSIZE_T
939 yytnamerr (char *yyres, const char *yystr)
940 {
941  if (*yystr == '"')
942  {
943  YYSIZE_T yyn = 0;
944  char const *yyp = yystr;
945 
946  for (;;)
947  switch (*++yyp)
948  {
949  case '\'':
950  case ',':
951  goto do_not_strip_quotes;
952 
953  case '\\':
954  if (*++yyp != '\\')
955  goto do_not_strip_quotes;
956  /* Fall through. */
957  default:
958  if (yyres)
959  yyres[yyn] = *yyp;
960  yyn++;
961  break;
962 
963  case '"':
964  if (yyres)
965  yyres[yyn] = '\0';
966  return yyn;
967  }
968  do_not_strip_quotes: ;
969  }
970 
971  if (! yyres)
972  return yystrlen (yystr);
973 
974  return yystpcpy (yyres, yystr) - yyres;
975 }
976 # endif
977 
978 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
979  about the unexpected token YYTOKEN for the state stack whose top is
980  YYSSP.
981 
982  Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
983  not large enough to hold the message. In that case, also set
984  *YYMSG_ALLOC to the required number of bytes. Return 2 if the
985  required number of bytes is too large to store. */
986 static int
987 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
988  yytype_int16 *yyssp, int yytoken)
989 {
990  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
991  YYSIZE_T yysize = yysize0;
992  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
993  /* Internationalized format string. */
994  const char *yyformat = YY_NULLPTR;
995  /* Arguments of yyformat. */
996  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
997  /* Number of reported tokens (one for the "unexpected", one per
998  "expected"). */
999  int yycount = 0;
1000 
1001  /* There are many possibilities here to consider:
1002  - If this state is a consistent state with a default action, then
1003  the only way this function was invoked is if the default action
1004  is an error action. In that case, don't check for expected
1005  tokens because there are none.
1006  - The only way there can be no lookahead present (in yychar) is if
1007  this state is a consistent state with a default action. Thus,
1008  detecting the absence of a lookahead is sufficient to determine
1009  that there is no unexpected or expected token to report. In that
1010  case, just report a simple "syntax error".
1011  - Don't assume there isn't a lookahead just because this state is a
1012  consistent state with a default action. There might have been a
1013  previous inconsistent state, consistent state with a non-default
1014  action, or user semantic action that manipulated yychar.
1015  - Of course, the expected token list depends on states to have
1016  correct lookahead information, and it depends on the parser not
1017  to perform extra reductions after fetching a lookahead from the
1018  scanner and before detecting a syntax error. Thus, state merging
1019  (from LALR or IELR) and default reductions corrupt the expected
1020  token list. However, the list is correct for canonical LR with
1021  one exception: it will still contain any token that will not be
1022  accepted due to an error action in a later state.
1023  */
1024  if (yytoken != YYEMPTY)
1025  {
1026  int yyn = yypact[*yyssp];
1027  yyarg[yycount++] = yytname[yytoken];
1028  if (!yypact_value_is_default (yyn))
1029  {
1030  /* Start YYX at -YYN if negative to avoid negative indexes in
1031  YYCHECK. In other words, skip the first -YYN actions for
1032  this state because they are default actions. */
1033  int yyxbegin = yyn < 0 ? -yyn : 0;
1034  /* Stay within bounds of both yycheck and yytname. */
1035  int yychecklim = YYLAST - yyn + 1;
1036  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1037  int yyx;
1038 
1039  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1040  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1041  && !yytable_value_is_error (yytable[yyx + yyn]))
1042  {
1043  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1044  {
1045  yycount = 1;
1046  yysize = yysize0;
1047  break;
1048  }
1049  yyarg[yycount++] = yytname[yyx];
1050  {
1051  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1052  if (! (yysize <= yysize1
1053  && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1054  return 2;
1055  yysize = yysize1;
1056  }
1057  }
1058  }
1059  }
1060 
1061  switch (yycount)
1062  {
1063 # define YYCASE_(N, S) \
1064  case N: \
1065  yyformat = S; \
1066  break
1067  YYCASE_(0, YY_("syntax error"));
1068  YYCASE_(1, YY_("syntax error, unexpected %s"));
1069  YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1070  YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1071  YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1072  YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1073 # undef YYCASE_
1074  }
1075 
1076  {
1077  YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1078  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1079  return 2;
1080  yysize = yysize1;
1081  }
1082 
1083  if (*yymsg_alloc < yysize)
1084  {
1085  *yymsg_alloc = 2 * yysize;
1086  if (! (yysize <= *yymsg_alloc
1087  && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1088  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1089  return 1;
1090  }
1091 
1092  /* Avoid sprintf, as that infringes on the user's name space.
1093  Don't have undefined behavior even if the translation
1094  produced a string with the wrong number of "%s"s. */
1095  {
1096  char *yyp = *yymsg;
1097  int yyi = 0;
1098  while ((*yyp = *yyformat) != '\0')
1099  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1100  {
1101  yyp += yytnamerr (yyp, yyarg[yyi++]);
1102  yyformat += 2;
1103  }
1104  else
1105  {
1106  yyp++;
1107  yyformat++;
1108  }
1109  }
1110  return 0;
1111 }
1112 #endif /* YYERROR_VERBOSE */
1113 
1114 /*-----------------------------------------------.
1115 | Release the memory associated to this symbol. |
1116 `-----------------------------------------------*/
1117 
1118 static void
1119 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1120 {
1121  YYUSE (yyvaluep);
1122  if (!yymsg)
1123  yymsg = "Deleting";
1124  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1125 
1127  YYUSE (yytype);
1129 }
1130 
1131 
1132 
1133 
1134 /* The lookahead symbol. */
1136 
1137 /* The semantic value of the lookahead symbol. */
1139 /* Number of syntax errors so far. */
1141 
1142 
1143 /*----------.
1144 | yyparse. |
1145 `----------*/
1146 
1147 int
1148 yyparse (void)
1149 {
1150  int yystate;
1151  /* Number of tokens to shift before error messages enabled. */
1152  int yyerrstatus;
1153 
1154  /* The stacks and their tools:
1155  'yyss': related to states.
1156  'yyvs': related to semantic values.
1157 
1158  Refer to the stacks through separate pointers, to allow yyoverflow
1159  to reallocate them elsewhere. */
1160 
1161  /* The state stack. */
1162  yytype_int16 yyssa[YYINITDEPTH];
1163  yytype_int16 *yyss;
1164  yytype_int16 *yyssp;
1165 
1166  /* The semantic value stack. */
1167  YYSTYPE yyvsa[YYINITDEPTH];
1168  YYSTYPE *yyvs;
1169  YYSTYPE *yyvsp;
1170 
1171  YYSIZE_T yystacksize;
1172 
1173  int yyn;
1174  int yyresult;
1175  /* Lookahead token as an internal (translated) token number. */
1176  int yytoken = 0;
1177  /* The variables used to return semantic value and location from the
1178  action routines. */
1179  YYSTYPE yyval;
1180 
1181 #if YYERROR_VERBOSE
1182  /* Buffer for error messages, and its allocated size. */
1183  char yymsgbuf[128];
1184  char *yymsg = yymsgbuf;
1185  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1186 #endif
1187 
1188 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1189 
1190  /* The number of symbols on the RHS of the reduced rule.
1191  Keep to zero when no symbol should be popped. */
1192  int yylen = 0;
1193 
1194  yyssp = yyss = yyssa;
1195  yyvsp = yyvs = yyvsa;
1196  yystacksize = YYINITDEPTH;
1197 
1198  YYDPRINTF ((stderr, "Starting parse\n"));
1199 
1200  yystate = 0;
1201  yyerrstatus = 0;
1202  yynerrs = 0;
1203  yychar = YYEMPTY; /* Cause a token to be read. */
1204  goto yysetstate;
1205 
1206 /*------------------------------------------------------------.
1207 | yynewstate -- Push a new state, which is found in yystate. |
1208 `------------------------------------------------------------*/
1209  yynewstate:
1210  /* In all cases, when you get here, the value and location stacks
1211  have just been pushed. So pushing a state here evens the stacks. */
1212  yyssp++;
1213 
1214  yysetstate:
1215  *yyssp = yystate;
1216 
1217  if (yyss + yystacksize - 1 <= yyssp)
1218  {
1219  /* Get the current used size of the three stacks, in elements. */
1220  YYSIZE_T yysize = yyssp - yyss + 1;
1221 
1222 #ifdef yyoverflow
1223  {
1224  /* Give user a chance to reallocate the stack. Use copies of
1225  these so that the &'s don't force the real ones into
1226  memory. */
1227  YYSTYPE *yyvs1 = yyvs;
1228  yytype_int16 *yyss1 = yyss;
1229 
1230  /* Each stack pointer address is followed by the size of the
1231  data in use in that stack, in bytes. This used to be a
1232  conditional around just the two extra args, but that might
1233  be undefined if yyoverflow is a macro. */
1234  yyoverflow (YY_("memory exhausted"),
1235  &yyss1, yysize * sizeof (*yyssp),
1236  &yyvs1, yysize * sizeof (*yyvsp),
1237  &yystacksize);
1238 
1239  yyss = yyss1;
1240  yyvs = yyvs1;
1241  }
1242 #else /* no yyoverflow */
1243 # ifndef YYSTACK_RELOCATE
1244  goto yyexhaustedlab;
1245 # else
1246  /* Extend the stack our own way. */
1247  if (YYMAXDEPTH <= yystacksize)
1248  goto yyexhaustedlab;
1249  yystacksize *= 2;
1250  if (YYMAXDEPTH < yystacksize)
1251  yystacksize = YYMAXDEPTH;
1252 
1253  {
1254  yytype_int16 *yyss1 = yyss;
1255  union yyalloc *yyptr =
1256  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1257  if (! yyptr)
1258  goto yyexhaustedlab;
1259  YYSTACK_RELOCATE (yyss_alloc, yyss);
1260  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1261 # undef YYSTACK_RELOCATE
1262  if (yyss1 != yyssa)
1263  YYSTACK_FREE (yyss1);
1264  }
1265 # endif
1266 #endif /* no yyoverflow */
1267 
1268  yyssp = yyss + yysize - 1;
1269  yyvsp = yyvs + yysize - 1;
1270 
1271  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1272  (unsigned long int) yystacksize));
1273 
1274  if (yyss + yystacksize - 1 <= yyssp)
1275  YYABORT;
1276  }
1277 
1278  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1279 
1280  if (yystate == YYFINAL)
1281  YYACCEPT;
1282 
1283  goto yybackup;
1284 
1285 /*-----------.
1286 | yybackup. |
1287 `-----------*/
1288 yybackup:
1289 
1290  /* Do appropriate processing given the current state. Read a
1291  lookahead token if we need one and don't already have one. */
1292 
1293  /* First try to decide what to do without reference to lookahead token. */
1294  yyn = yypact[yystate];
1295  if (yypact_value_is_default (yyn))
1296  goto yydefault;
1297 
1298  /* Not known => get a lookahead token if don't already have one. */
1299 
1300  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1301  if (yychar == YYEMPTY)
1302  {
1303  YYDPRINTF ((stderr, "Reading a token: "));
1304  yychar = yylex ();
1305  }
1306 
1307  if (yychar <= YYEOF)
1308  {
1309  yychar = yytoken = YYEOF;
1310  YYDPRINTF ((stderr, "Now at end of input.\n"));
1311  }
1312  else
1313  {
1314  yytoken = YYTRANSLATE (yychar);
1315  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1316  }
1317 
1318  /* If the proper action on seeing token YYTOKEN is to reduce or to
1319  detect an error, take that action. */
1320  yyn += yytoken;
1321  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1322  goto yydefault;
1323  yyn = yytable[yyn];
1324  if (yyn <= 0)
1325  {
1326  if (yytable_value_is_error (yyn))
1327  goto yyerrlab;
1328  yyn = -yyn;
1329  goto yyreduce;
1330  }
1331 
1332  /* Count tokens shifted since error; after three, turn off error
1333  status. */
1334  if (yyerrstatus)
1335  yyerrstatus--;
1336 
1337  /* Shift the lookahead token. */
1338  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1339 
1340  /* Discard the shifted token. */
1341  yychar = YYEMPTY;
1342 
1343  yystate = yyn;
1345  *++yyvsp = yylval;
1347 
1348  goto yynewstate;
1349 
1350 
1351 /*-----------------------------------------------------------.
1352 | yydefault -- do the default action for the current state. |
1353 `-----------------------------------------------------------*/
1354 yydefault:
1355  yyn = yydefact[yystate];
1356  if (yyn == 0)
1357  goto yyerrlab;
1358  goto yyreduce;
1359 
1360 
1361 /*-----------------------------.
1362 | yyreduce -- Do a reduction. |
1363 `-----------------------------*/
1364 yyreduce:
1365  /* yyn is the number of a rule to reduce with. */
1366  yylen = yyr2[yyn];
1367 
1368  /* If YYLEN is nonzero, implement the default value of the action:
1369  '$$ = $1'.
1370 
1371  Otherwise, the following line sets YYVAL to garbage.
1372  This behavior is undocumented and Bison
1373  users should not rely upon it. Assigning to YYVAL
1374  unconditionally makes the parser a bit smaller, and it avoids a
1375  GCC warning that YYVAL may be used uninitialized. */
1376  yyval = yyvsp[1-yylen];
1377 
1378 
1379  YY_REDUCE_PRINT (yyn);
1380  switch (yyn)
1381  {
1382  case 2:
1383 #line 73 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1384  {
1385  attrbuf.clear();
1386  }
1387 #line 1388 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1388  break;
1389 
1390  case 3:
1391 #line 75 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1392  {
1393  if (attrbuf.size() != 0)
1394  rtlil_frontend_ilang_yyerror("dangling attribute");
1395  }
1396 #line 1397 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1397  break;
1398 
1399  case 11:
1400 #line 93 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1401  {
1402  if (current_design->has((yyvsp[-1].string)))
1403  rtlil_frontend_ilang_yyerror(stringf("ilang error: redefinition of module %s.", (yyvsp[-1].string)).c_str());
1405  current_module->name = (yyvsp[-1].string);
1406  current_module->attributes = attrbuf;
1408  attrbuf.clear();
1409  free((yyvsp[-1].string));
1410  }
1411 #line 1412 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1412  break;
1413 
1414  case 12:
1415 #line 102 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1416  {
1417  if (attrbuf.size() != 0)
1418  rtlil_frontend_ilang_yyerror("dangling attribute");
1420  }
1421 #line 1422 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1422  break;
1423 
1424  case 22:
1425 #line 116 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1426  {
1427  attrbuf[(yyvsp[-2].string)] = *(yyvsp[-1].data);
1428  delete (yyvsp[-1].data);
1429  free((yyvsp[-2].string));
1430  }
1431 #line 1432 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1432  break;
1433 
1434  case 23:
1435 #line 123 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1436  {
1437  autoidx = std::max(autoidx, (yyvsp[-1].integer));
1438  }
1439 #line 1440 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1440  break;
1441 
1442  case 24:
1443 #line 128 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1444  {
1445  current_wire = current_module->addWire("$__ilang_frontend_tmp__");
1446  current_wire->attributes = attrbuf;
1447  attrbuf.clear();
1448  }
1449 #line 1450 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1450  break;
1451 
1452  case 25:
1453 #line 132 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1454  {
1455  if (current_module->wires_.count((yyvsp[-1].string)) != 0)
1456  rtlil_frontend_ilang_yyerror(stringf("ilang error: redefinition of wire %s.", (yyvsp[-1].string)).c_str());
1457  current_module->rename(current_wire, (yyvsp[-1].string));
1458  free((yyvsp[-1].string));
1459  }
1460 #line 1461 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1461  break;
1462 
1463  case 26:
1464 #line 140 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1465  {
1466  current_wire->width = (yyvsp[0].integer);
1467  }
1468 #line 1469 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1469  break;
1470 
1471  case 27:
1472 #line 143 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1473  {
1474  current_wire->upto = true;
1475  }
1476 #line 1477 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1477  break;
1478 
1479  case 28:
1480 #line 146 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1481  {
1482  current_wire->start_offset = (yyvsp[0].integer);
1483  }
1484 #line 1485 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1485  break;
1486 
1487  case 29:
1488 #line 149 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1489  {
1490  current_wire->port_id = (yyvsp[0].integer);
1491  current_wire->port_input = true;
1492  current_wire->port_output = false;
1493  }
1494 #line 1495 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1495  break;
1496 
1497  case 30:
1498 #line 154 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1499  {
1500  current_wire->port_id = (yyvsp[0].integer);
1501  current_wire->port_input = false;
1502  current_wire->port_output = true;
1503  }
1504 #line 1505 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1505  break;
1506 
1507  case 31:
1508 #line 159 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1509  {
1510  current_wire->port_id = (yyvsp[0].integer);
1511  current_wire->port_input = true;
1512  current_wire->port_output = true;
1513  }
1514 #line 1515 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1515  break;
1516 
1517  case 33:
1518 #line 167 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1519  {
1521  current_memory->attributes = attrbuf;
1522  attrbuf.clear();
1523  }
1524 #line 1525 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1525  break;
1526 
1527  case 34:
1528 #line 171 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1529  {
1530  if (current_module->memories.count((yyvsp[-1].string)) != 0)
1531  rtlil_frontend_ilang_yyerror(stringf("ilang error: redefinition of memory %s.", (yyvsp[-1].string)).c_str());
1532  current_memory->name = (yyvsp[-1].string);
1533  current_module->memories[(yyvsp[-1].string)] = current_memory;
1534  free((yyvsp[-1].string));
1535  }
1536 #line 1537 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1537  break;
1538 
1539  case 35:
1540 #line 180 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1541  {
1542  current_memory->width = (yyvsp[0].integer);
1543  }
1544 #line 1545 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1545  break;
1546 
1547  case 36:
1548 #line 183 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1549  {
1550  current_memory->size = (yyvsp[0].integer);
1551  }
1552 #line 1553 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1553  break;
1554 
1555  case 38:
1556 #line 189 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1557  {
1558  if (current_module->cells_.count((yyvsp[-1].string)) != 0)
1559  rtlil_frontend_ilang_yyerror(stringf("ilang error: redefinition of cell %s.", (yyvsp[-1].string)).c_str());
1560  current_cell = current_module->addCell((yyvsp[-1].string), (yyvsp[-2].string));
1561  current_cell->attributes = attrbuf;
1562  attrbuf.clear();
1563  free((yyvsp[-2].string));
1564  free((yyvsp[-1].string));
1565  }
1566 #line 1567 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1567  break;
1568 
1569  case 40:
1570 #line 200 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1571  {
1572  current_cell->parameters[(yyvsp[-2].string)] = *(yyvsp[-1].data);
1573  free((yyvsp[-2].string));
1574  delete (yyvsp[-1].data);
1575  }
1576 #line 1577 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1577  break;
1578 
1579  case 41:
1580 #line 205 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1581  {
1582  current_cell->parameters[(yyvsp[-2].string)] = *(yyvsp[-1].data);
1583  current_cell->parameters[(yyvsp[-2].string)].flags |= RTLIL::CONST_FLAG_SIGNED;
1584  free((yyvsp[-2].string));
1585  delete (yyvsp[-1].data);
1586  }
1587 #line 1588 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1588  break;
1589 
1590  case 42:
1591 #line 211 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1592  {
1593  if (current_cell->hasPort((yyvsp[-2].string)))
1594  rtlil_frontend_ilang_yyerror(stringf("ilang error: redefinition of cell port %s.", (yyvsp[-2].string)).c_str());
1595  current_cell->setPort((yyvsp[-2].string), *(yyvsp[-1].sigspec));
1596  delete (yyvsp[-1].sigspec);
1597  free((yyvsp[-2].string));
1598  }
1599 #line 1600 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1600  break;
1601 
1602  case 44:
1603 #line 221 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1604  {
1605  if (current_module->processes.count((yyvsp[-1].string)) != 0)
1606  rtlil_frontend_ilang_yyerror(stringf("ilang error: redefinition of process %s.", (yyvsp[-1].string)).c_str());
1608  current_process->name = (yyvsp[-1].string);
1609  current_process->attributes = attrbuf;
1610  current_module->processes[(yyvsp[-1].string)] = current_process;
1611  switch_stack.clear();
1613  case_stack.clear();
1614  case_stack.push_back(&current_process->root_case);
1615  attrbuf.clear();
1616  free((yyvsp[-1].string));
1617  }
1618 #line 1619 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1619  break;
1620 
1621  case 46:
1622 #line 237 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1623  {
1625  rule->signal = *(yyvsp[-1].sigspec);
1626  rule->attributes = attrbuf;
1627  switch_stack.back()->push_back(rule);
1628  attrbuf.clear();
1629  delete (yyvsp[-1].sigspec);
1630  }
1631 #line 1632 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1632  break;
1633 
1634  case 50:
1635 #line 251 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1636  {
1637  RTLIL::CaseRule *rule = new RTLIL::CaseRule;
1638  switch_stack.back()->back()->cases.push_back(rule);
1639  switch_stack.push_back(&rule->switches);
1640  case_stack.push_back(rule);
1641  }
1642 #line 1643 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1643  break;
1644 
1645  case 51:
1646 #line 256 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1647  {
1648  switch_stack.pop_back();
1649  case_stack.pop_back();
1650  }
1651 #line 1652 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1652  break;
1653 
1654  case 53:
1655 #line 263 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1656  {
1657  case_stack.back()->compare.push_back(*(yyvsp[0].sigspec));
1658  delete (yyvsp[0].sigspec);
1659  }
1660 #line 1661 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1661  break;
1662 
1663  case 54:
1664 #line 267 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1665  {
1666  case_stack.back()->compare.push_back(*(yyvsp[0].sigspec));
1667  delete (yyvsp[0].sigspec);
1668  }
1669 #line 1670 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1670  break;
1671 
1672  case 59:
1673 #line 279 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1674  {
1675  case_stack.back()->actions.push_back(RTLIL::SigSig(*(yyvsp[-2].sigspec), *(yyvsp[-1].sigspec)));
1676  delete (yyvsp[-2].sigspec);
1677  delete (yyvsp[-1].sigspec);
1678  }
1679 #line 1680 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1680  break;
1681 
1682  case 60:
1683 #line 286 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1684  {
1685  RTLIL::SyncRule *rule = new RTLIL::SyncRule;
1686  rule->type = RTLIL::SyncType((yyvsp[-2].integer));
1687  rule->signal = *(yyvsp[-1].sigspec);
1688  current_process->syncs.push_back(rule);
1689  delete (yyvsp[-1].sigspec);
1690  }
1691 #line 1692 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1692  break;
1693 
1694  case 62:
1695 #line 293 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1696  {
1697  RTLIL::SyncRule *rule = new RTLIL::SyncRule;
1698  rule->type = RTLIL::SyncType::STa;
1699  rule->signal = RTLIL::SigSpec();
1700  current_process->syncs.push_back(rule);
1701  }
1702 #line 1703 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1703  break;
1704 
1705  case 64:
1706 #line 299 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1707  {
1708  RTLIL::SyncRule *rule = new RTLIL::SyncRule;
1709  rule->type = RTLIL::SyncType::STi;
1710  rule->signal = RTLIL::SigSpec();
1711  current_process->syncs.push_back(rule);
1712  }
1713 #line 1714 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1714  break;
1715 
1716  case 67:
1717 #line 308 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1718  { (yyval.integer) = RTLIL::ST0; }
1719 #line 1720 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1720  break;
1721 
1722  case 68:
1723 #line 309 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1724  { (yyval.integer) = RTLIL::ST1; }
1725 #line 1726 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1726  break;
1727 
1728  case 69:
1729 #line 310 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1730  { (yyval.integer) = RTLIL::STp; }
1731 #line 1732 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1732  break;
1733 
1734  case 70:
1735 #line 311 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1736  { (yyval.integer) = RTLIL::STn; }
1737 #line 1738 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1738  break;
1739 
1740  case 71:
1741 #line 312 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1742  { (yyval.integer) = RTLIL::STe; }
1743 #line 1744 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1744  break;
1745 
1746  case 72:
1747 #line 315 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1748  {
1749  current_process->syncs.back()->actions.push_back(RTLIL::SigSig(*(yyvsp[-2].sigspec), *(yyvsp[-1].sigspec)));
1750  delete (yyvsp[-2].sigspec);
1751  delete (yyvsp[-1].sigspec);
1752  }
1753 #line 1754 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1754  break;
1755 
1756  case 74:
1757 #line 323 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1758  {
1759  char *ep;
1760  int width = strtol((yyvsp[0].string), &ep, 10);
1761  std::list<RTLIL::State> bits;
1762  while (*(++ep) != 0) {
1763  RTLIL::State bit = RTLIL::Sx;
1764  switch (*ep) {
1765  case '0': bit = RTLIL::S0; break;
1766  case '1': bit = RTLIL::S1; break;
1767  case 'x': bit = RTLIL::Sx; break;
1768  case 'z': bit = RTLIL::Sz; break;
1769  case '-': bit = RTLIL::Sa; break;
1770  case 'm': bit = RTLIL::Sm; break;
1771  }
1772  bits.push_front(bit);
1773  }
1774  if (bits.size() == 0)
1775  bits.push_back(RTLIL::Sx);
1776  while ((int)bits.size() < width) {
1777  RTLIL::State bit = bits.back();
1778  if (bit == RTLIL::S1)
1779  bit = RTLIL::S0;
1780  bits.push_back(bit);
1781  }
1782  while ((int)bits.size() > width)
1783  bits.pop_back();
1784  (yyval.data) = new RTLIL::Const;
1785  for (auto it = bits.begin(); it != bits.end(); it++)
1786  (yyval.data)->bits.push_back(*it);
1787  free((yyvsp[0].string));
1788  }
1789 #line 1790 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1790  break;
1791 
1792  case 75:
1793 #line 354 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1794  {
1795  (yyval.data) = new RTLIL::Const((yyvsp[0].integer), 32);
1796  }
1797 #line 1798 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1798  break;
1799 
1800  case 76:
1801 #line 357 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1802  {
1803  (yyval.data) = new RTLIL::Const((yyvsp[0].string));
1804  free((yyvsp[0].string));
1805  }
1806 #line 1807 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1807  break;
1808 
1809  case 77:
1810 #line 363 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1811  {
1812  (yyval.sigspec) = new RTLIL::SigSpec(*(yyvsp[0].data));
1813  delete (yyvsp[0].data);
1814  }
1815 #line 1816 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1816  break;
1817 
1818  case 78:
1819 #line 367 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1820  {
1821  if (current_module->wires_.count((yyvsp[0].string)) == 0)
1822  rtlil_frontend_ilang_yyerror(stringf("ilang error: wire %s not found", (yyvsp[0].string)).c_str());
1823  (yyval.sigspec) = new RTLIL::SigSpec(current_module->wires_[(yyvsp[0].string)]);
1824  free((yyvsp[0].string));
1825  }
1826 #line 1827 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1827  break;
1828 
1829  case 79:
1830 #line 373 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1831  {
1832  if (current_module->wires_.count((yyvsp[-3].string)) == 0)
1833  rtlil_frontend_ilang_yyerror(stringf("ilang error: wire %s not found", (yyvsp[-3].string)).c_str());
1834  (yyval.sigspec) = new RTLIL::SigSpec(current_module->wires_[(yyvsp[-3].string)], (yyvsp[-1].integer));
1835  free((yyvsp[-3].string));
1836  }
1837 #line 1838 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1838  break;
1839 
1840  case 80:
1841 #line 379 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1842  {
1843  if (current_module->wires_.count((yyvsp[-5].string)) == 0)
1844  rtlil_frontend_ilang_yyerror(stringf("ilang error: wire %s not found", (yyvsp[-5].string)).c_str());
1845  (yyval.sigspec) = new RTLIL::SigSpec(current_module->wires_[(yyvsp[-5].string)], (yyvsp[-1].integer), (yyvsp[-3].integer) - (yyvsp[-1].integer) + 1);
1846  free((yyvsp[-5].string));
1847  }
1848 #line 1849 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1849  break;
1850 
1851  case 81:
1852 #line 385 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1853  {
1854  (yyval.sigspec) = (yyvsp[-1].sigspec);
1855  }
1856 #line 1857 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1857  break;
1858 
1859  case 82:
1860 #line 390 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1861  {
1862  (yyval.sigspec) = new RTLIL::SigSpec;
1863  (yyval.sigspec)->append(*(yyvsp[0].sigspec));
1864  (yyval.sigspec)->append(*(yyvsp[-1].sigspec));
1865  delete (yyvsp[-1].sigspec);
1866  delete (yyvsp[0].sigspec);
1867  }
1868 #line 1869 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1869  break;
1870 
1871  case 83:
1872 #line 397 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1873  {
1874  (yyval.sigspec) = new RTLIL::SigSpec;
1875  }
1876 #line 1877 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1877  break;
1878 
1879  case 84:
1880 #line 402 "frontends/ilang/ilang_parser.y" /* yacc.c:1646 */
1881  {
1882  if (attrbuf.size() != 0)
1883  rtlil_frontend_ilang_yyerror("dangling attribute");
1884  current_module->connect(*(yyvsp[-2].sigspec), *(yyvsp[-1].sigspec));
1885  delete (yyvsp[-2].sigspec);
1886  delete (yyvsp[-1].sigspec);
1887  }
1888 #line 1889 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1889  break;
1890 
1891 
1892 #line 1893 "frontends/ilang/ilang_parser.tab.c" /* yacc.c:1646 */
1893  default: break;
1894  }
1895  /* User semantic actions sometimes alter yychar, and that requires
1896  that yytoken be updated with the new translation. We take the
1897  approach of translating immediately before every use of yytoken.
1898  One alternative is translating here after every semantic action,
1899  but that translation would be missed if the semantic action invokes
1900  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1901  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1902  incorrect destructor might then be invoked immediately. In the
1903  case of YYERROR or YYBACKUP, subsequent parser actions might lead
1904  to an incorrect destructor call or verbose syntax error message
1905  before the lookahead is translated. */
1906  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1907 
1908  YYPOPSTACK (yylen);
1909  yylen = 0;
1910  YY_STACK_PRINT (yyss, yyssp);
1911 
1912  *++yyvsp = yyval;
1913 
1914  /* Now 'shift' the result of the reduction. Determine what state
1915  that goes to, based on the state we popped back to and the rule
1916  number reduced by. */
1917 
1918  yyn = yyr1[yyn];
1919 
1920  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1921  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1922  yystate = yytable[yystate];
1923  else
1924  yystate = yydefgoto[yyn - YYNTOKENS];
1925 
1926  goto yynewstate;
1927 
1928 
1929 /*--------------------------------------.
1930 | yyerrlab -- here on detecting error. |
1931 `--------------------------------------*/
1932 yyerrlab:
1933  /* Make sure we have latest lookahead translation. See comments at
1934  user semantic actions for why this is necessary. */
1935  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1936 
1937  /* If not already recovering from an error, report this error. */
1938  if (!yyerrstatus)
1939  {
1940  ++yynerrs;
1941 #if ! YYERROR_VERBOSE
1942  yyerror (YY_("syntax error"));
1943 #else
1944 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1945  yyssp, yytoken)
1946  {
1947  char const *yymsgp = YY_("syntax error");
1948  int yysyntax_error_status;
1949  yysyntax_error_status = YYSYNTAX_ERROR;
1950  if (yysyntax_error_status == 0)
1951  yymsgp = yymsg;
1952  else if (yysyntax_error_status == 1)
1953  {
1954  if (yymsg != yymsgbuf)
1955  YYSTACK_FREE (yymsg);
1956  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1957  if (!yymsg)
1958  {
1959  yymsg = yymsgbuf;
1960  yymsg_alloc = sizeof yymsgbuf;
1961  yysyntax_error_status = 2;
1962  }
1963  else
1964  {
1965  yysyntax_error_status = YYSYNTAX_ERROR;
1966  yymsgp = yymsg;
1967  }
1968  }
1969  yyerror (yymsgp);
1970  if (yysyntax_error_status == 2)
1971  goto yyexhaustedlab;
1972  }
1973 # undef YYSYNTAX_ERROR
1974 #endif
1975  }
1976 
1977 
1978 
1979  if (yyerrstatus == 3)
1980  {
1981  /* If just tried and failed to reuse lookahead token after an
1982  error, discard it. */
1983 
1984  if (yychar <= YYEOF)
1985  {
1986  /* Return failure if at end of input. */
1987  if (yychar == YYEOF)
1988  YYABORT;
1989  }
1990  else
1991  {
1992  yydestruct ("Error: discarding",
1993  yytoken, &yylval);
1994  yychar = YYEMPTY;
1995  }
1996  }
1997 
1998  /* Else will try to reuse lookahead token after shifting the error
1999  token. */
2000  goto yyerrlab1;
2001 
2002 
2003 /*---------------------------------------------------.
2004 | yyerrorlab -- error raised explicitly by YYERROR. |
2005 `---------------------------------------------------*/
2006 yyerrorlab:
2007 
2008  /* Pacify compilers like GCC when the user code never invokes
2009  YYERROR and the label yyerrorlab therefore never appears in user
2010  code. */
2011  if (/*CONSTCOND*/ 0)
2012  goto yyerrorlab;
2013 
2014  /* Do not reclaim the symbols of the rule whose action triggered
2015  this YYERROR. */
2016  YYPOPSTACK (yylen);
2017  yylen = 0;
2018  YY_STACK_PRINT (yyss, yyssp);
2019  yystate = *yyssp;
2020  goto yyerrlab1;
2021 
2022 
2023 /*-------------------------------------------------------------.
2024 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2025 `-------------------------------------------------------------*/
2026 yyerrlab1:
2027  yyerrstatus = 3; /* Each real token shifted decrements this. */
2028 
2029  for (;;)
2030  {
2031  yyn = yypact[yystate];
2032  if (!yypact_value_is_default (yyn))
2033  {
2034  yyn += YYTERROR;
2035  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2036  {
2037  yyn = yytable[yyn];
2038  if (0 < yyn)
2039  break;
2040  }
2041  }
2042 
2043  /* Pop the current state because it cannot handle the error token. */
2044  if (yyssp == yyss)
2045  YYABORT;
2046 
2047 
2048  yydestruct ("Error: popping",
2049  yystos[yystate], yyvsp);
2050  YYPOPSTACK (1);
2051  yystate = *yyssp;
2052  YY_STACK_PRINT (yyss, yyssp);
2053  }
2054 
2056  *++yyvsp = yylval;
2058 
2059 
2060  /* Shift the error token. */
2061  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2062 
2063  yystate = yyn;
2064  goto yynewstate;
2065 
2066 
2067 /*-------------------------------------.
2068 | yyacceptlab -- YYACCEPT comes here. |
2069 `-------------------------------------*/
2070 yyacceptlab:
2071  yyresult = 0;
2072  goto yyreturn;
2073 
2074 /*-----------------------------------.
2075 | yyabortlab -- YYABORT comes here. |
2076 `-----------------------------------*/
2077 yyabortlab:
2078  yyresult = 1;
2079  goto yyreturn;
2080 
2081 #if !defined yyoverflow || YYERROR_VERBOSE
2082 /*-------------------------------------------------.
2083 | yyexhaustedlab -- memory exhaustion comes here. |
2084 `-------------------------------------------------*/
2085 yyexhaustedlab:
2086  yyerror (YY_("memory exhausted"));
2087  yyresult = 2;
2088  /* Fall through. */
2089 #endif
2090 
2091 yyreturn:
2092  if (yychar != YYEMPTY)
2093  {
2094  /* Make sure we have latest lookahead translation. See comments at
2095  user semantic actions for why this is necessary. */
2096  yytoken = YYTRANSLATE (yychar);
2097  yydestruct ("Cleanup: discarding lookahead",
2098  yytoken, &yylval);
2099  }
2100  /* Do not reclaim the symbols of the rule whose action triggered
2101  this YYABORT or YYACCEPT. */
2102  YYPOPSTACK (yylen);
2103  YY_STACK_PRINT (yyss, yyssp);
2104  while (yyssp != yyss)
2105  {
2106  yydestruct ("Cleanup: popping",
2107  yystos[*yyssp], yyvsp);
2108  YYPOPSTACK (1);
2109  }
2110 #ifndef yyoverflow
2111  if (yyss != yyssa)
2112  YYSTACK_FREE (yyss);
2113 #endif
2114 #if YYERROR_VERBOSE
2115  if (yymsg != yymsgbuf)
2116  YYSTACK_FREE (yymsg);
2117 #endif
2118  return yyresult;
2119 }
static const yytype_int8 yypact[]
RTLIL::Process * current_process
static void append(const vec< T > &from, vec< T > &to)
Definition: Alg.h:79
static const yytype_uint8 yyr1[]
std::string stringf(const char *fmt,...)
Definition: yosys.cc:58
signed char yytype_int8
void rtlil_frontend_ilang_yyerror(char const *s)
void free(void *)
RTLIL::Cell * addCell(RTLIL::IdString name, RTLIL::IdString type)
Definition: rtlil.cc:1353
static const yytype_uint8 yydefact[]
#define yytable_value_is_error(Yytable_value)
void add(RTLIL::Module *module)
Definition: rtlil.cc:259
void * malloc(YYSIZE_T)
static const yytype_int16 yypgoto[]
#define YOSYS_NAMESPACE_PREFIX
Definition: yosys.h:101
#define YYSTACK_ALLOC
#define YOSYS_NAMESPACE_END
Definition: yosys.h:100
std::vector< std::vector< RTLIL::SwitchRule * > * > switch_stack
RTLIL::SyncType type
Definition: rtlil.h:1144
std::map< RTLIL::IdString, RTLIL::Wire * > wires_
Definition: rtlil.h:595
bool upto
Definition: rtlil.h:827
#define YYTERROR
#define yynerrs
#define YYNTOKENS
void setPort(RTLIL::IdString portname, RTLIL::SigSpec signal)
Definition: rtlil.cc:1789
#define yychar
bool port_input
Definition: rtlil.h:827
yytokentype
int width
Definition: rtlil.h:826
std::map< RTLIL::IdString, RTLIL::Memory * > memories
Definition: rtlil.h:601
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
#define YYFPRINTF
int port_id
Definition: rtlil.h:826
#define YYFINAL
#define YYEMPTY
std::map< RTLIL::IdString, RTLIL::Const > parameters
Definition: rtlil.h:856
#define YYDPRINTF(Args)
RTLIL::SigSpec signal
Definition: rtlil.h:1145
int size
Definition: rtlil.h:836
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
RTLIL::Memory * current_memory
unsigned short int yytype_uint16
int rtlil_frontend_ilang_yydebug
static void yy_stack_print(yytype_int16 *yybottom, yytype_int16 *yytop)
static const yytype_int16 yydefgoto[]
#define yyparse
bool port_output
Definition: rtlil.h:827
#define YYMAXDEPTH
static const char *const yytname[]
#define YY_NULLPTR
std::vector< RTLIL::CaseRule * > case_stack
#define YYUSE(E)
void connect(const RTLIL::SigSig &conn)
Definition: rtlil.cc:1278
#define YY_REDUCE_PRINT(Rule)
std::map< RTLIL::IdString, RTLIL::Const > attrbuf
RTLIL::SigSpec signal
Definition: rtlil.h:1132
#define yyerror
RTLIL_ATTRIBUTE_MEMBERS bool hasPort(RTLIL::IdString portname) const
Definition: rtlil.cc:1766
#define YYPOPSTACK(N)
#define YYSIZE_T
yytype_int16 yyss_alloc
RTLIL::IdString name
Definition: rtlil.h:835
void fixup_ports()
Definition: rtlil.cc:1312
RTLIL::Wire * addWire(RTLIL::IdString name, int width=1)
Definition: rtlil.cc:1331
RTLIL::IdString name
Definition: rtlil.h:599
#define YYSTACK_FREE
unsigned char yytype_uint8
YYSTYPE yyvs_alloc
short int yytype_int16
static void yy_symbol_value_print(FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep)
YYSTYPE rtlil_frontend_ilang_yylval
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
#define YYABORT
#define YYEOF
#define YY_STACK_PRINT(Bottom, Top)
#define YYINITDEPTH
std::istream * lexin
RTLIL::IdString name
Definition: rtlil.h:1154
std::map< RTLIL::IdString, RTLIL::Process * > processes
Definition: rtlil.h:602
RTLIL::Design * current_design
bool has(RTLIL::IdString id) const
Definition: rtlil.h:519
#define USING_YOSYS_NAMESPACE
Definition: yosys.h:102
#define YYTRANSLATE(YYX)
std::map< RTLIL::IdString, RTLIL::Cell * > cells_
Definition: rtlil.h:596
#define YOSYS_NAMESPACE_BEGIN
Definition: yosys.h:99
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
RTLIL::Cell * current_cell
YOSYS_NAMESPACE_PREFIX RTLIL::Const * data
static const yytype_uint8 yyr2[]
std::vector< RTLIL::SyncRule * > syncs
Definition: rtlil.h:1157
RTLIL::Wire * current_wire
RTLIL::Module * current_module
static const yytype_uint16 yyrline[]
#define yydebug
std::vector< RTLIL::State > bits
Definition: rtlil.h:438
#define YYLAST
SyncType
Definition: rtlil.h:38
static const yytype_int16 yytable[]
State
Definition: rtlil.h:29
int start_offset
Definition: rtlil.h:826
#define yypact_value_is_default(Yystate)
int width
Definition: rtlil.h:836
#define YYSTACK_ALLOC_MAXIMUM
#define yylex
std::vector< RTLIL::SwitchRule * > switches
Definition: rtlil.h:1121
std::pair< SigSpec, SigSpec > SigSig
Definition: rtlil.h:71
static const yytype_uint8 yytranslate[]
static void yy_reduce_print(yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
YOSYS_NAMESPACE_BEGIN int autoidx
Definition: yosys.cc:51
#define yylval
int rtlil_frontend_ilang_yyparse(void)
void rename(RTLIL::Wire *wire, RTLIL::IdString new_name)
Definition: rtlil.cc:1185
#define YYACCEPT
#define YYSTACK_BYTES(N)
static void yy_symbol_print(FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep)
static const yytype_int16 yycheck[]
RTLIL_ATTRIBUTE_MEMBERS RTLIL::CaseRule root_case
Definition: rtlil.h:1156
static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep)
#define YY_(Msgid)
static const yytype_uint8 yystos[]
YOSYS_NAMESPACE_PREFIX RTLIL::SigSpec * sigspec