1758 char *yymsg = yymsgbuf;
1759 YYSIZE_T yymsg_alloc =
sizeof yymsgbuf;
1762 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1768 yyssp = yyss = yyssa;
1769 yyvsp = yyvs = yyvsa;
1772 YYDPRINTF ((stderr,
"Starting parse\n"));
1791 if (yyss + yystacksize - 1 <= yyssp)
1794 YYSIZE_T yysize = yyssp - yyss + 1;
1808 yyoverflow (
YY_(
"memory exhausted"),
1809 &yyss1, yysize *
sizeof (*yyssp),
1810 &yyvs1, yysize *
sizeof (*yyvsp),
1817 # ifndef YYSTACK_RELOCATE
1818 goto yyexhaustedlab;
1822 goto yyexhaustedlab;
1832 goto yyexhaustedlab;
1835 # undef YYSTACK_RELOCATE
1842 yyssp = yyss + yysize - 1;
1843 yyvsp = yyvs + yysize - 1;
1845 YYDPRINTF ((stderr,
"Stack size increased to %lu\n",
1846 (
unsigned long int) yystacksize));
1848 if (yyss + yystacksize - 1 <= yyssp)
1852 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1877 YYDPRINTF ((stderr,
"Reading a token: "));
1884 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1950 yyval = yyvsp[1-yylen];
1957 #line 141 "frontends/verilog/verilog_parser.y"
1961 #line 1962 "frontends/verilog/verilog_parser.tab.c"
1965 #line 143 "frontends/verilog/verilog_parser.y"
1971 default_attr_list.clear();
1973 #line 1974 "frontends/verilog/verilog_parser.tab.c"
1977 #line 158 "frontends/verilog/verilog_parser.y"
1982 for (
auto &it : default_attr_list)
1983 attr_list[it.first] = it.second->clone();
1985 #line 1986 "frontends/verilog/verilog_parser.tab.c"
1989 #line 164 "frontends/verilog/verilog_parser.y"
1991 std::map<std::string, AstNode*> *al =
new std::map<std::string, AstNode*>;
1992 al->swap(attr_list);
1995 #line 1996 "frontends/verilog/verilog_parser.tab.c"
1999 #line 175 "frontends/verilog/verilog_parser.y"
2001 for (
auto &it : default_attr_list)
2003 default_attr_list.clear();
2004 for (
auto &it : attr_list)
2008 #line 2009 "frontends/verilog/verilog_parser.tab.c"
2012 #line 182 "frontends/verilog/verilog_parser.y"
2017 #line 2018 "frontends/verilog/verilog_parser.tab.c"
2021 #line 195 "frontends/verilog/verilog_parser.y"
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);
2028 #line 2029 "frontends/verilog/verilog_parser.tab.c"
2032 #line 201 "frontends/verilog/verilog_parser.y"
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);
2039 #line 2040 "frontends/verilog/verilog_parser.tab.c"
2043 #line 209 "frontends/verilog/verilog_parser.y"
2045 (yyval.
string) = (yyvsp[0].
string);
2047 #line 2048 "frontends/verilog/verilog_parser.tab.c"
2051 #line 212 "frontends/verilog/verilog_parser.y"
2053 if ((yyvsp[0].
string)->substr(0, 1) ==
"\\")
2054 *(yyvsp[-2].
string) +=
"." + (yyvsp[0].string)->substr(1);
2056 *(yyvsp[-2].string) +=
"." + *(yyvsp[0].
string);
2057 delete (yyvsp[0].string);
2058 (yyval.
string) = (yyvsp[-2].
string);
2060 #line 2061 "frontends/verilog/verilog_parser.tab.c"
2064 #line 222 "frontends/verilog/verilog_parser.y"
2068 ast_stack.back()->children.push_back(mod);
2073 mod->
str = *(yyvsp[0].string);
2075 delete (yyvsp[0].string);
2077 #line 2078 "frontends/verilog/verilog_parser.tab.c"
2081 #line 233 "frontends/verilog/verilog_parser.y"
2090 #line 2091 "frontends/verilog/verilog_parser.tab.c"
2094 #line 243 "frontends/verilog/verilog_parser.y"
2096 #line 2097 "frontends/verilog/verilog_parser.tab.c"
2100 #line 243 "frontends/verilog/verilog_parser.y"
2102 #line 2103 "frontends/verilog/verilog_parser.tab.c"
2106 #line 251 "frontends/verilog/verilog_parser.y"
2112 #line 2113 "frontends/verilog/verilog_parser.tab.c"
2116 #line 267 "frontends/verilog/verilog_parser.y"
2121 if (
ast_stack.back()->children.back()->is_reg)
2128 #line 2129 "frontends/verilog/verilog_parser.tab.c"
2132 #line 281 "frontends/verilog/verilog_parser.y"
2136 node->
str = *(yyvsp[0].string);
2138 ast_stack.back()->children.push_back(node);
2140 if (
port_stubs.count(*(yyvsp[0].string)) != 0)
2144 delete (yyvsp[0].string);
2146 #line 2147 "frontends/verilog/verilog_parser.tab.c"
2150 #line 294 "frontends/verilog/verilog_parser.y"
2152 AstNode *node = (yyvsp[-2].ast);
2153 node->
str = *(yyvsp[0].string);
2155 if ((yyvsp[-1].ast) !=
NULL)
2156 node->
children.push_back((yyvsp[-1].ast));
2161 ast_stack.back()->children.push_back(node);
2163 delete (yyvsp[0].string);
2165 #line 2166 "frontends/verilog/verilog_parser.tab.c"
2169 #line 308 "frontends/verilog/verilog_parser.y"
2173 #line 2174 "frontends/verilog/verilog_parser.tab.c"
2177 #line 313 "frontends/verilog/verilog_parser.y"
2181 #line 2182 "frontends/verilog/verilog_parser.tab.c"
2185 #line 315 "frontends/verilog/verilog_parser.y"
2189 #line 2190 "frontends/verilog/verilog_parser.tab.c"
2193 #line 323 "frontends/verilog/verilog_parser.y"
2197 #line 2198 "frontends/verilog/verilog_parser.tab.c"
2201 #line 326 "frontends/verilog/verilog_parser.y"
2205 #line 2206 "frontends/verilog/verilog_parser.tab.c"
2209 #line 329 "frontends/verilog/verilog_parser.y"
2214 #line 2215 "frontends/verilog/verilog_parser.tab.c"
2218 #line 333 "frontends/verilog/verilog_parser.y"
2221 #line 2222 "frontends/verilog/verilog_parser.tab.c"
2225 #line 335 "frontends/verilog/verilog_parser.y"
2229 #line 2230 "frontends/verilog/verilog_parser.tab.c"
2233 #line 338 "frontends/verilog/verilog_parser.y"
2240 #line 2241 "frontends/verilog/verilog_parser.tab.c"
2244 #line 344 "frontends/verilog/verilog_parser.y"
2251 #line 2252 "frontends/verilog/verilog_parser.tab.c"
2255 #line 350 "frontends/verilog/verilog_parser.y"
2259 #line 2260 "frontends/verilog/verilog_parser.tab.c"
2263 #line 355 "frontends/verilog/verilog_parser.y"
2266 (yyval.ast)->children.push_back((yyvsp[-3].ast));
2267 (yyval.ast)->children.push_back((yyvsp[-1].ast));
2269 #line 2270 "frontends/verilog/verilog_parser.tab.c"
2273 #line 360 "frontends/verilog/verilog_parser.y"
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)));
2279 #line 2280 "frontends/verilog/verilog_parser.tab.c"
2283 #line 365 "frontends/verilog/verilog_parser.y"
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)));
2289 #line 2290 "frontends/verilog/verilog_parser.tab.c"
2293 #line 370 "frontends/verilog/verilog_parser.y"
2296 (yyval.ast)->children.push_back((yyvsp[-1].ast));
2298 #line 2299 "frontends/verilog/verilog_parser.tab.c"
2302 #line 376 "frontends/verilog/verilog_parser.y"
2306 #line 2307 "frontends/verilog/verilog_parser.tab.c"
2310 #line 379 "frontends/verilog/verilog_parser.y"
2312 (yyval.ast) = (yyvsp[-1].ast);
2313 (yyval.ast)->children.push_back((yyvsp[0].ast));
2315 #line 2316 "frontends/verilog/verilog_parser.tab.c"
2319 #line 385 "frontends/verilog/verilog_parser.y"
2321 (yyval.ast) = (yyvsp[0].ast);
2323 #line 2324 "frontends/verilog/verilog_parser.tab.c"
2327 #line 388 "frontends/verilog/verilog_parser.y"
2331 #line 2332 "frontends/verilog/verilog_parser.tab.c"
2335 #line 393 "frontends/verilog/verilog_parser.y"
2336 { (yyval.ast) = (yyvsp[0].ast); }
2337 #line 2338 "frontends/verilog/verilog_parser.tab.c"
2341 #line 394 "frontends/verilog/verilog_parser.y"
2342 { (yyval.ast) = (yyvsp[0].ast); }
2343 #line 2344 "frontends/verilog/verilog_parser.tab.c"
2347 #line 397 "frontends/verilog/verilog_parser.y"
2349 (yyval.ast) = (yyvsp[0].ast);
2351 #line 2352 "frontends/verilog/verilog_parser.tab.c"
2355 #line 400 "frontends/verilog/verilog_parser.y"
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;
2362 #line 2363 "frontends/verilog/verilog_parser.tab.c"
2366 #line 418 "frontends/verilog/verilog_parser.y"
2372 delete (yyvsp[-1].string);
2373 delete (yyvsp[0].string);
2375 #line 2376 "frontends/verilog/verilog_parser.tab.c"
2379 #line 425 "frontends/verilog/verilog_parser.y"
2383 #line 2384 "frontends/verilog/verilog_parser.tab.c"
2387 #line 428 "frontends/verilog/verilog_parser.y"
2393 delete (yyvsp[-3].string);
2394 delete (yyvsp[-1].string);
2395 delete (yyvsp[0].string);
2397 #line 2398 "frontends/verilog/verilog_parser.tab.c"
2401 #line 436 "frontends/verilog/verilog_parser.y"
2405 #line 2406 "frontends/verilog/verilog_parser.tab.c"
2409 #line 439 "frontends/verilog/verilog_parser.y"
2415 delete (yyvsp[-5].string);
2416 delete (yyvsp[-3].string);
2417 delete (yyvsp[-1].string);
2418 delete (yyvsp[0].string);
2420 #line 2421 "frontends/verilog/verilog_parser.tab.c"
2424 #line 448 "frontends/verilog/verilog_parser.y"
2428 #line 2429 "frontends/verilog/verilog_parser.tab.c"
2432 #line 451 "frontends/verilog/verilog_parser.y"
2440 delete (yyvsp[0].string);
2442 #line 2443 "frontends/verilog/verilog_parser.tab.c"
2446 #line 459 "frontends/verilog/verilog_parser.y"
2451 #line 2452 "frontends/verilog/verilog_parser.tab.c"
2455 #line 463 "frontends/verilog/verilog_parser.y"
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;
2472 delete (yyvsp[0].string);
2474 #line 2475 "frontends/verilog/verilog_parser.tab.c"
2478 #line 480 "frontends/verilog/verilog_parser.y"
2483 #line 2484 "frontends/verilog/verilog_parser.tab.c"
2487 #line 486 "frontends/verilog/verilog_parser.y"
2490 delete (yyvsp[-1].string);
2491 delete (yyvsp[0].string);
2493 #line 2494 "frontends/verilog/verilog_parser.tab.c"
2497 #line 491 "frontends/verilog/verilog_parser.y"
2500 delete (yyvsp[0].string);
2502 #line 2503 "frontends/verilog/verilog_parser.tab.c"
2506 #line 507 "frontends/verilog/verilog_parser.y"
2510 #line 2511 "frontends/verilog/verilog_parser.tab.c"
2514 #line 510 "frontends/verilog/verilog_parser.y"
2518 #line 2519 "frontends/verilog/verilog_parser.tab.c"
2522 #line 515 "frontends/verilog/verilog_parser.y"
2528 #line 2529 "frontends/verilog/verilog_parser.tab.c"
2532 #line 519 "frontends/verilog/verilog_parser.y"
2539 #line 2540 "frontends/verilog/verilog_parser.tab.c"
2543 #line 530 "frontends/verilog/verilog_parser.y"
2551 albuf = (yyvsp[-2].al);
2566 #line 2567 "frontends/verilog/verilog_parser.tab.c"
2570 #line 558 "frontends/verilog/verilog_parser.y"
2574 #line 2575 "frontends/verilog/verilog_parser.tab.c"
2578 #line 563 "frontends/verilog/verilog_parser.y"
2583 astbuf1->
children.back()->children.push_back(AstNode::mkconst_int(31,
true));
2584 astbuf1->
children.back()->children.push_back(AstNode::mkconst_int(0,
true));
2587 #line 2588 "frontends/verilog/verilog_parser.tab.c"
2591 #line 573 "frontends/verilog/verilog_parser.y"
2597 #line 2598 "frontends/verilog/verilog_parser.tab.c"
2601 #line 580 "frontends/verilog/verilog_parser.y"
2603 if ((yyvsp[0].ast) !=
NULL) {
2609 #line 2610 "frontends/verilog/verilog_parser.tab.c"
2613 #line 589 "frontends/verilog/verilog_parser.y"
2618 #line 2619 "frontends/verilog/verilog_parser.tab.c"
2622 #line 592 "frontends/verilog/verilog_parser.y"
2626 #line 2627 "frontends/verilog/verilog_parser.tab.c"
2630 #line 597 "frontends/verilog/verilog_parser.y"
2635 #line 2636 "frontends/verilog/verilog_parser.tab.c"
2639 #line 600 "frontends/verilog/verilog_parser.y"
2643 #line 2644 "frontends/verilog/verilog_parser.tab.c"
2647 #line 608 "frontends/verilog/verilog_parser.y"
2652 node->
str = *(yyvsp[-2].string);
2654 node->
children[0] = (yyvsp[0].ast);
2655 ast_stack.back()->children.push_back(node);
2656 delete (yyvsp[-2].string);
2658 #line 2659 "frontends/verilog/verilog_parser.tab.c"
2662 #line 626 "frontends/verilog/verilog_parser.y"
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);
2672 #line 2673 "frontends/verilog/verilog_parser.tab.c"
2676 #line 637 "frontends/verilog/verilog_parser.y"
2678 albuf = (yyvsp[-2].al);
2693 #line 2694 "frontends/verilog/verilog_parser.tab.c"
2697 #line 652 "frontends/verilog/verilog_parser.y"
2704 #line 2705 "frontends/verilog/verilog_parser.tab.c"
2708 #line 658 "frontends/verilog/verilog_parser.y"
2711 ast_stack.back()->children.back()->str = *(yyvsp[-1].string);
2714 ast_stack.back()->children.back()->children[0]->str = *(yyvsp[-1].string);
2715 delete (yyvsp[-1].string);
2717 #line 2718 "frontends/verilog/verilog_parser.tab.c"
2721 #line 666 "frontends/verilog/verilog_parser.y"
2724 ast_stack.back()->children.back()->str = *(yyvsp[-1].string);
2727 ast_stack.back()->children.back()->children[0]->str = *(yyvsp[-1].string);
2728 delete (yyvsp[-1].string);
2730 #line 2731 "frontends/verilog/verilog_parser.tab.c"
2734 #line 680 "frontends/verilog/verilog_parser.y"
2743 #line 2744 "frontends/verilog/verilog_parser.tab.c"
2747 #line 690 "frontends/verilog/verilog_parser.y"
2750 node->
str = *(yyvsp[-1].string);
2754 if ((yyvsp[0].ast) !=
NULL) {
2759 rng->
children.push_back(AstNode::mkconst_int(0,
true));
2760 rng->
children.push_back(AstNode::mkconst_int(0,
true));
2764 node->
children.push_back((yyvsp[0].ast));
2770 if (
port_stubs.count(*(yyvsp[-1].string)) != 0) {
2785 ast_stack.back()->children.push_back(node);
2786 delete (yyvsp[-1].string);
2788 #line 2789 "frontends/verilog/verilog_parser.tab.c"
2792 #line 738 "frontends/verilog/verilog_parser.y"
2796 #line 2797 "frontends/verilog/verilog_parser.tab.c"
2800 #line 743 "frontends/verilog/verilog_parser.y"
2806 delete (yyvsp[0].string);
2808 #line 2809 "frontends/verilog/verilog_parser.tab.c"
2812 #line 749 "frontends/verilog/verilog_parser.y"
2816 #line 2817 "frontends/verilog/verilog_parser.tab.c"
2820 #line 752 "frontends/verilog/verilog_parser.y"
2825 delete (yyvsp[0].string);
2827 #line 2828 "frontends/verilog/verilog_parser.tab.c"
2831 #line 757 "frontends/verilog/verilog_parser.y"
2835 #line 2836 "frontends/verilog/verilog_parser.tab.c"
2839 #line 762 "frontends/verilog/verilog_parser.y"
2841 (yyval.
string) = (yyvsp[0].
string);
2843 #line 2844 "frontends/verilog/verilog_parser.tab.c"
2847 #line 765 "frontends/verilog/verilog_parser.y"
2849 (yyval.
string) =
new std::string(
"or");
2851 #line 2852 "frontends/verilog/verilog_parser.tab.c"
2855 #line 774 "frontends/verilog/verilog_parser.y"
2860 delete (yyvsp[0].string);
2863 #line 2864 "frontends/verilog/verilog_parser.tab.c"
2867 #line 781 "frontends/verilog/verilog_parser.y"
2872 delete (yyvsp[-1].string);
2875 #line 2876 "frontends/verilog/verilog_parser.tab.c"
2879 #line 795 "frontends/verilog/verilog_parser.y"
2884 #line 2885 "frontends/verilog/verilog_parser.tab.c"
2888 #line 808 "frontends/verilog/verilog_parser.y"
2892 node->
children.push_back((yyvsp[0].ast));
2894 #line 2895 "frontends/verilog/verilog_parser.tab.c"
2898 #line 813 "frontends/verilog/verilog_parser.y"
2901 node->
str = *(yyvsp[-3].string);
2903 node->
children.push_back((yyvsp[-1].ast));
2904 delete (yyvsp[-3].string);
2906 #line 2907 "frontends/verilog/verilog_parser.tab.c"
2910 #line 824 "frontends/verilog/verilog_parser.y"
2915 #line 2916 "frontends/verilog/verilog_parser.tab.c"
2919 #line 830 "frontends/verilog/verilog_parser.y"
2923 node->
children.push_back((yyvsp[0].ast));
2925 #line 2926 "frontends/verilog/verilog_parser.tab.c"
2929 #line 835 "frontends/verilog/verilog_parser.y"
2932 node->
str = *(yyvsp[-3].string);
2934 node->
children.push_back((yyvsp[-1].ast));
2935 delete (yyvsp[-3].string);
2937 #line 2938 "frontends/verilog/verilog_parser.tab.c"
2941 #line 842 "frontends/verilog/verilog_parser.y"
2944 node->
str = *(yyvsp[-2].string);
2946 delete (yyvsp[-2].string);
2948 #line 2949 "frontends/verilog/verilog_parser.tab.c"
2952 #line 850 "frontends/verilog/verilog_parser.y"
2956 ast_stack.back()->children.push_back(node);
2959 #line 2960 "frontends/verilog/verilog_parser.tab.c"
2963 #line 855 "frontends/verilog/verilog_parser.y"
2966 ast_stack.back()->children.push_back(block);
2969 #line 2970 "frontends/verilog/verilog_parser.tab.c"
2973 #line 859 "frontends/verilog/verilog_parser.y"
2978 #line 2979 "frontends/verilog/verilog_parser.tab.c"
2982 #line 863 "frontends/verilog/verilog_parser.y"
2986 ast_stack.back()->children.push_back(node);
2989 ast_stack.back()->children.push_back(block);
2992 #line 2993 "frontends/verilog/verilog_parser.tab.c"
2996 #line 871 "frontends/verilog/verilog_parser.y"
3001 #line 3002 "frontends/verilog/verilog_parser.tab.c"
3005 #line 890 "frontends/verilog/verilog_parser.y"
3008 ast_stack.back()->children.push_back(node);
3009 node->
children.push_back((yyvsp[0].ast));
3011 #line 3012 "frontends/verilog/verilog_parser.tab.c"
3015 #line 895 "frontends/verilog/verilog_parser.y"
3018 ast_stack.back()->children.push_back(node);
3019 node->
children.push_back((yyvsp[0].ast));
3021 #line 3022 "frontends/verilog/verilog_parser.tab.c"
3025 #line 900 "frontends/verilog/verilog_parser.y"
3028 ast_stack.back()->children.push_back(node);
3029 node->
children.push_back((yyvsp[0].ast));
3031 #line 3032 "frontends/verilog/verilog_parser.tab.c"
3035 #line 907 "frontends/verilog/verilog_parser.y"
3037 (yyval.
string) = (yyvsp[0].
string);
3039 #line 3040 "frontends/verilog/verilog_parser.tab.c"
3043 #line 910 "frontends/verilog/verilog_parser.y"
3047 #line 3048 "frontends/verilog/verilog_parser.tab.c"
3051 #line 915 "frontends/verilog/verilog_parser.y"
3055 #line 3056 "frontends/verilog/verilog_parser.tab.c"
3059 #line 920 "frontends/verilog/verilog_parser.y"
3063 #line 3064 "frontends/verilog/verilog_parser.tab.c"
3067 #line 925 "frontends/verilog/verilog_parser.y"
3070 ast_stack.back()->children.push_back(node);
3072 #line 3073 "frontends/verilog/verilog_parser.tab.c"
3076 #line 929 "frontends/verilog/verilog_parser.y"
3079 ast_stack.back()->children.push_back(node);
3081 #line 3082 "frontends/verilog/verilog_parser.tab.c"
3085 #line 938 "frontends/verilog/verilog_parser.y"
3088 node->
str = *(yyvsp[-1].string);
3089 delete (yyvsp[-1].string);
3090 ast_stack.back()->children.push_back(node);
3094 #line 3095 "frontends/verilog/verilog_parser.tab.c"
3098 #line 945 "frontends/verilog/verilog_parser.y"
3102 #line 3103 "frontends/verilog/verilog_parser.tab.c"
3106 #line 948 "frontends/verilog/verilog_parser.y"
3109 ast_stack.back()->children.push_back(node);
3112 if ((yyvsp[0].
string) !=
NULL)
3113 node->
str = *(yyvsp[0].string);
3115 #line 3116 "frontends/verilog/verilog_parser.tab.c"
3119 #line 955 "frontends/verilog/verilog_parser.y"
3121 if ((yyvsp[-4].
string) !=
NULL && (yyvsp[0].string) !=
NULL && *(yyvsp[-4].
string) != *(yyvsp[0].string))
3123 if ((yyvsp[-4].
string) !=
NULL)
3124 delete (yyvsp[-4].string);
3125 if ((yyvsp[0].
string) !=
NULL)
3126 delete (yyvsp[0].
string);
3129 #line 3130 "frontends/verilog/verilog_parser.tab.c"
3133 #line 964 "frontends/verilog/verilog_parser.y"
3136 ast_stack.back()->children.push_back(node);
3140 #line 3141 "frontends/verilog/verilog_parser.tab.c"
3144 #line 969 "frontends/verilog/verilog_parser.y"
3146 ast_stack.back()->children.push_back((yyvsp[0].ast));
3148 #line 3149 "frontends/verilog/verilog_parser.tab.c"
3152 #line 971 "frontends/verilog/verilog_parser.y"
3155 ast_stack.back()->children.push_back(block);
3158 #line 3159 "frontends/verilog/verilog_parser.tab.c"
3162 #line 975 "frontends/verilog/verilog_parser.y"
3167 #line 3168 "frontends/verilog/verilog_parser.tab.c"
3171 #line 979 "frontends/verilog/verilog_parser.y"
3174 ast_stack.back()->children.push_back(node);
3178 ast_stack.back()->children.push_back((yyvsp[-1].ast));
3179 ast_stack.back()->children.push_back(block);
3182 #line 3183 "frontends/verilog/verilog_parser.tab.c"
3186 #line 988 "frontends/verilog/verilog_parser.y"
3191 #line 3192 "frontends/verilog/verilog_parser.tab.c"
3195 #line 992 "frontends/verilog/verilog_parser.y"
3198 ast_stack.back()->children.push_back(node);
3202 ast_stack.back()->children.push_back((yyvsp[-1].ast));
3203 ast_stack.back()->children.push_back(block);
3206 #line 3207 "frontends/verilog/verilog_parser.tab.c"
3210 #line 1001 "frontends/verilog/verilog_parser.y"
3215 #line 3216 "frontends/verilog/verilog_parser.tab.c"
3219 #line 1005 "frontends/verilog/verilog_parser.y"
3224 ast_stack.back()->children.push_back(node);
3231 #line 3232 "frontends/verilog/verilog_parser.tab.c"
3235 #line 1015 "frontends/verilog/verilog_parser.y"
3240 #line 3241 "frontends/verilog/verilog_parser.tab.c"
3244 #line 1019 "frontends/verilog/verilog_parser.y"
3247 ast_stack.back()->children.push_back(node);
3251 #line 3252 "frontends/verilog/verilog_parser.tab.c"
3255 #line 1024 "frontends/verilog/verilog_parser.y"
3260 #line 3261 "frontends/verilog/verilog_parser.tab.c"
3264 #line 1030 "frontends/verilog/verilog_parser.y"
3268 #line 3269 "frontends/verilog/verilog_parser.tab.c"
3272 #line 1033 "frontends/verilog/verilog_parser.y"
3276 #line 3277 "frontends/verilog/verilog_parser.tab.c"
3280 #line 1036 "frontends/verilog/verilog_parser.y"
3284 #line 3285 "frontends/verilog/verilog_parser.tab.c"
3288 #line 1041 "frontends/verilog/verilog_parser.y"
3290 if (
ast_stack.back()->attributes.count(
"\\full_case") == 0)
3291 ast_stack.back()->attributes[
"\\full_case"] = AstNode::mkconst_int(1,
false);
3293 #line 3294 "frontends/verilog/verilog_parser.tab.c"
3297 #line 1045 "frontends/verilog/verilog_parser.y"
3299 if (
ast_stack.back()->attributes.count(
"\\parallel_case") == 0)
3300 ast_stack.back()->attributes[
"\\parallel_case"] = AstNode::mkconst_int(1,
false);
3302 #line 3303 "frontends/verilog/verilog_parser.tab.c"
3306 #line 1060 "frontends/verilog/verilog_parser.y"
3311 ast_stack.back()->children.push_back(cond);
3314 #line 3315 "frontends/verilog/verilog_parser.tab.c"
3318 #line 1074 "frontends/verilog/verilog_parser.y"
3321 ast_stack.back()->children.push_back(node);
3324 #line 3325 "frontends/verilog/verilog_parser.tab.c"
3328 #line 1078 "frontends/verilog/verilog_parser.y"
3331 ast_stack.back()->children.push_back(block);
3335 #line 3336 "frontends/verilog/verilog_parser.tab.c"
3339 #line 1083 "frontends/verilog/verilog_parser.y"
3345 #line 3346 "frontends/verilog/verilog_parser.tab.c"
3349 #line 1094 "frontends/verilog/verilog_parser.y"
3352 ast_stack.back()->children.push_back(node);
3355 #line 3356 "frontends/verilog/verilog_parser.tab.c"
3359 #line 1098 "frontends/verilog/verilog_parser.y"
3363 #line 3364 "frontends/verilog/verilog_parser.tab.c"
3367 #line 1100 "frontends/verilog/verilog_parser.y"
3372 #line 3373 "frontends/verilog/verilog_parser.tab.c"
3376 #line 1110 "frontends/verilog/verilog_parser.y"
3380 #line 3381 "frontends/verilog/verilog_parser.tab.c"
3384 #line 1113 "frontends/verilog/verilog_parser.y"
3386 ast_stack.back()->children.push_back((yyvsp[0].ast));
3388 #line 3389 "frontends/verilog/verilog_parser.tab.c"
3392 #line 1116 "frontends/verilog/verilog_parser.y"
3394 ast_stack.back()->children.push_back((yyvsp[0].ast));
3396 #line 3397 "frontends/verilog/verilog_parser.tab.c"
3400 #line 1121 "frontends/verilog/verilog_parser.y"
3403 (yyval.ast)->str = *(yyvsp[-5].
string);
3404 delete (yyvsp[-5].string);
3406 #line 3407 "frontends/verilog/verilog_parser.tab.c"
3410 #line 1126 "frontends/verilog/verilog_parser.y"
3413 (yyval.ast)->str = *(yyvsp[-1].
string);
3414 delete (yyvsp[-1].string);
3416 #line 3417 "frontends/verilog/verilog_parser.tab.c"
3420 #line 1131 "frontends/verilog/verilog_parser.y"
3423 (yyval.ast)->str = *(yyvsp[-1].
string);
3424 delete (yyvsp[-1].string);
3426 #line 3427 "frontends/verilog/verilog_parser.tab.c"
3430 #line 1138 "frontends/verilog/verilog_parser.y"
3432 (yyval.ast) = (yyvsp[0].ast);
3434 #line 3435 "frontends/verilog/verilog_parser.tab.c"
3438 #line 1141 "frontends/verilog/verilog_parser.y"
3440 (yyval.ast) = (yyvsp[-1].ast);
3442 #line 3443 "frontends/verilog/verilog_parser.tab.c"
3446 #line 1146 "frontends/verilog/verilog_parser.y"
3449 (yyval.ast)->children.push_back((yyvsp[0].ast));
3451 #line 3452 "frontends/verilog/verilog_parser.tab.c"
3455 #line 1150 "frontends/verilog/verilog_parser.y"
3457 (yyval.ast) = (yyvsp[0].ast);
3458 (yyval.ast)->children.push_back((yyvsp[-2].ast));
3460 #line 3461 "frontends/verilog/verilog_parser.tab.c"
3464 #line 1168 "frontends/verilog/verilog_parser.y"
3466 ast_stack.back()->children.push_back((yyvsp[0].ast));
3468 #line 3469 "frontends/verilog/verilog_parser.tab.c"
3472 #line 1181 "frontends/verilog/verilog_parser.y"
3475 ast_stack.back()->children.push_back(node);
3478 #line 3479 "frontends/verilog/verilog_parser.tab.c"
3482 #line 1185 "frontends/verilog/verilog_parser.y"
3484 ast_stack.back()->children.push_back((yyvsp[0].ast));
3486 #line 3487 "frontends/verilog/verilog_parser.tab.c"
3490 #line 1187 "frontends/verilog/verilog_parser.y"
3494 #line 3495 "frontends/verilog/verilog_parser.tab.c"
3498 #line 1190 "frontends/verilog/verilog_parser.y"
3501 ast_stack.back()->children.push_back(node);
3503 ast_stack.back()->children.push_back((yyvsp[-1].ast));
3505 #line 3506 "frontends/verilog/verilog_parser.tab.c"
3509 #line 1195 "frontends/verilog/verilog_parser.y"
3513 #line 3514 "frontends/verilog/verilog_parser.tab.c"
3517 #line 1198 "frontends/verilog/verilog_parser.y"
3520 ast_stack.back()->children.push_back(node);
3523 #line 3524 "frontends/verilog/verilog_parser.tab.c"
3527 #line 1202 "frontends/verilog/verilog_parser.y"
3532 #line 3533 "frontends/verilog/verilog_parser.tab.c"
3536 #line 1206 "frontends/verilog/verilog_parser.y"
3539 node->
str = (yyvsp[0].string) ? *(yyvsp[0].
string) : std::string();
3540 ast_stack.back()->children.push_back(node);
3543 #line 3544 "frontends/verilog/verilog_parser.tab.c"
3547 #line 1211 "frontends/verilog/verilog_parser.y"
3549 if ((yyvsp[-4].
string) !=
NULL)
3550 delete (yyvsp[-4].string);
3551 if ((yyvsp[0].
string) !=
NULL)
3552 delete (yyvsp[0].
string);
3555 #line 3556 "frontends/verilog/verilog_parser.tab.c"
3559 #line 1220 "frontends/verilog/verilog_parser.y"
3562 ast_stack.back()->children.push_back(node);
3565 #line 3566 "frontends/verilog/verilog_parser.tab.c"
3569 #line 1224 "frontends/verilog/verilog_parser.y"
3573 #line 3574 "frontends/verilog/verilog_parser.tab.c"
3577 #line 1235 "frontends/verilog/verilog_parser.y"
3579 (yyval.ast) = (yyvsp[0].ast);
3581 #line 3582 "frontends/verilog/verilog_parser.tab.c"
3585 #line 1238 "frontends/verilog/verilog_parser.y"
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));
3593 #line 3594 "frontends/verilog/verilog_parser.tab.c"
3597 #line 1247 "frontends/verilog/verilog_parser.y"
3599 (yyval.ast) = (yyvsp[0].ast);
3601 #line 3602 "frontends/verilog/verilog_parser.tab.c"
3605 #line 1250 "frontends/verilog/verilog_parser.y"
3607 if ((yyvsp[0].
string)->substr(0, 1) !=
"'")
3609 AstNode *bits = (yyvsp[-2].ast);
3612 log_error(
"Value conversion failed: `%s'\n", (yyvsp[0].
string)->c_str());
3614 delete (yyvsp[0].string);
3616 #line 3617 "frontends/verilog/verilog_parser.tab.c"
3620 #line 1260 "frontends/verilog/verilog_parser.y"
3622 if ((yyvsp[0].
string)->substr(0, 1) !=
"'")
3625 bits->
str = *(yyvsp[-1].string);
3628 log_error(
"Value conversion failed: `%s'\n", (yyvsp[0].
string)->c_str());
3630 delete (yyvsp[-1].string);
3631 delete (yyvsp[0].string);
3633 #line 3634 "frontends/verilog/verilog_parser.tab.c"
3637 #line 1272 "frontends/verilog/verilog_parser.y"
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);
3645 #line 3646 "frontends/verilog/verilog_parser.tab.c"
3649 #line 1279 "frontends/verilog/verilog_parser.y"
3652 if ((yyval.ast) ==
NULL)
3653 log_error(
"Value conversion failed: `%s'\n", (yyvsp[0].
string)->c_str());
3654 delete (yyvsp[0].string);
3656 #line 3657 "frontends/verilog/verilog_parser.tab.c"
3660 #line 1285 "frontends/verilog/verilog_parser.y"
3663 char *p = strdup((yyvsp[0].
string)->c_str()), *q;
3664 for (
int i = 0, j = 0; !p[j]; j++)
3666 p[i++] = p[j], p[i] = 0;
3667 (yyval.ast)->realvalue = strtod(p, &q);
3669 delete (yyvsp[0].string);
3672 #line 3673 "frontends/verilog/verilog_parser.tab.c"
3676 #line 1296 "frontends/verilog/verilog_parser.y"
3678 (yyval.ast) = AstNode::mkconst_str(*(yyvsp[0].
string));
3679 delete (yyvsp[0].string);
3681 #line 3682 "frontends/verilog/verilog_parser.tab.c"
3685 #line 1300 "frontends/verilog/verilog_parser.y"
3688 node->
str = *(yyvsp[-1].string);
3689 delete (yyvsp[-1].string);
3693 #line 3694 "frontends/verilog/verilog_parser.tab.c"
3697 #line 1306 "frontends/verilog/verilog_parser.y"
3702 #line 3703 "frontends/verilog/verilog_parser.tab.c"
3706 #line 1310 "frontends/verilog/verilog_parser.y"
3711 #line 3712 "frontends/verilog/verilog_parser.tab.c"
3715 #line 1314 "frontends/verilog/verilog_parser.y"
3720 #line 3721 "frontends/verilog/verilog_parser.tab.c"
3724 #line 1318 "frontends/verilog/verilog_parser.y"
3726 (yyval.ast) = (yyvsp[-1].ast);
3728 #line 3729 "frontends/verilog/verilog_parser.tab.c"
3732 #line 1321 "frontends/verilog/verilog_parser.y"
3734 (yyval.ast) = (yyvsp[-1].ast);
3736 #line 3737 "frontends/verilog/verilog_parser.tab.c"
3740 #line 1324 "frontends/verilog/verilog_parser.y"
3744 #line 3745 "frontends/verilog/verilog_parser.tab.c"
3748 #line 1327 "frontends/verilog/verilog_parser.y"
3753 #line 3754 "frontends/verilog/verilog_parser.tab.c"
3757 #line 1331 "frontends/verilog/verilog_parser.y"
3762 #line 3763 "frontends/verilog/verilog_parser.tab.c"
3766 #line 1335 "frontends/verilog/verilog_parser.y"
3771 #line 3772 "frontends/verilog/verilog_parser.tab.c"
3775 #line 1339 "frontends/verilog/verilog_parser.y"
3780 #line 3781 "frontends/verilog/verilog_parser.tab.c"
3784 #line 1343 "frontends/verilog/verilog_parser.y"
3789 #line 3790 "frontends/verilog/verilog_parser.tab.c"
3793 #line 1347 "frontends/verilog/verilog_parser.y"
3798 #line 3799 "frontends/verilog/verilog_parser.tab.c"
3802 #line 1351 "frontends/verilog/verilog_parser.y"
3808 #line 3809 "frontends/verilog/verilog_parser.tab.c"
3812 #line 1356 "frontends/verilog/verilog_parser.y"
3817 #line 3818 "frontends/verilog/verilog_parser.tab.c"
3821 #line 1360 "frontends/verilog/verilog_parser.y"
3827 #line 3828 "frontends/verilog/verilog_parser.tab.c"
3831 #line 1365 "frontends/verilog/verilog_parser.y"
3836 #line 3837 "frontends/verilog/verilog_parser.tab.c"
3840 #line 1369 "frontends/verilog/verilog_parser.y"
3845 #line 3846 "frontends/verilog/verilog_parser.tab.c"
3849 #line 1373 "frontends/verilog/verilog_parser.y"
3854 #line 3855 "frontends/verilog/verilog_parser.tab.c"
3858 #line 1377 "frontends/verilog/verilog_parser.y"
3863 #line 3864 "frontends/verilog/verilog_parser.tab.c"
3867 #line 1381 "frontends/verilog/verilog_parser.y"
3872 #line 3873 "frontends/verilog/verilog_parser.tab.c"
3876 #line 1385 "frontends/verilog/verilog_parser.y"
3881 #line 3882 "frontends/verilog/verilog_parser.tab.c"
3885 #line 1389 "frontends/verilog/verilog_parser.y"
3887 (yyval.ast) =
new AstNode(
AST_LT, (yyvsp[-3].ast), (yyvsp[0].ast));
3890 #line 3891 "frontends/verilog/verilog_parser.tab.c"
3894 #line 1393 "frontends/verilog/verilog_parser.y"
3896 (yyval.ast) =
new AstNode(
AST_LE, (yyvsp[-3].ast), (yyvsp[0].ast));
3899 #line 3900 "frontends/verilog/verilog_parser.tab.c"
3903 #line 1397 "frontends/verilog/verilog_parser.y"
3905 (yyval.ast) =
new AstNode(
AST_EQ, (yyvsp[-3].ast), (yyvsp[0].ast));
3908 #line 3909 "frontends/verilog/verilog_parser.tab.c"
3912 #line 1401 "frontends/verilog/verilog_parser.y"
3914 (yyval.ast) =
new AstNode(
AST_NE, (yyvsp[-3].ast), (yyvsp[0].ast));
3917 #line 3918 "frontends/verilog/verilog_parser.tab.c"
3921 #line 1405 "frontends/verilog/verilog_parser.y"
3923 (yyval.ast) =
new AstNode(
AST_EQX, (yyvsp[-3].ast), (yyvsp[0].ast));
3926 #line 3927 "frontends/verilog/verilog_parser.tab.c"
3930 #line 1409 "frontends/verilog/verilog_parser.y"
3932 (yyval.ast) =
new AstNode(
AST_NEX, (yyvsp[-3].ast), (yyvsp[0].ast));
3935 #line 3936 "frontends/verilog/verilog_parser.tab.c"
3939 #line 1413 "frontends/verilog/verilog_parser.y"
3941 (yyval.ast) =
new AstNode(
AST_GE, (yyvsp[-3].ast), (yyvsp[0].ast));
3944 #line 3945 "frontends/verilog/verilog_parser.tab.c"
3948 #line 1417 "frontends/verilog/verilog_parser.y"
3950 (yyval.ast) =
new AstNode(
AST_GT, (yyvsp[-3].ast), (yyvsp[0].ast));
3953 #line 3954 "frontends/verilog/verilog_parser.tab.c"
3957 #line 1421 "frontends/verilog/verilog_parser.y"
3959 (yyval.ast) =
new AstNode(
AST_ADD, (yyvsp[-3].ast), (yyvsp[0].ast));
3962 #line 3963 "frontends/verilog/verilog_parser.tab.c"
3966 #line 1425 "frontends/verilog/verilog_parser.y"
3968 (yyval.ast) =
new AstNode(
AST_SUB, (yyvsp[-3].ast), (yyvsp[0].ast));
3971 #line 3972 "frontends/verilog/verilog_parser.tab.c"
3975 #line 1429 "frontends/verilog/verilog_parser.y"
3977 (yyval.ast) =
new AstNode(
AST_MUL, (yyvsp[-3].ast), (yyvsp[0].ast));
3980 #line 3981 "frontends/verilog/verilog_parser.tab.c"
3984 #line 1433 "frontends/verilog/verilog_parser.y"
3986 (yyval.ast) =
new AstNode(
AST_DIV, (yyvsp[-3].ast), (yyvsp[0].ast));
3989 #line 3990 "frontends/verilog/verilog_parser.tab.c"
3993 #line 1437 "frontends/verilog/verilog_parser.y"
3995 (yyval.ast) =
new AstNode(
AST_MOD, (yyvsp[-3].ast), (yyvsp[0].ast));
3998 #line 3999 "frontends/verilog/verilog_parser.tab.c"
4002 #line 1441 "frontends/verilog/verilog_parser.y"
4004 (yyval.ast) =
new AstNode(
AST_POW, (yyvsp[-3].ast), (yyvsp[0].ast));
4007 #line 4008 "frontends/verilog/verilog_parser.tab.c"
4011 #line 1445 "frontends/verilog/verilog_parser.y"
4016 #line 4017 "frontends/verilog/verilog_parser.tab.c"
4020 #line 1449 "frontends/verilog/verilog_parser.y"
4025 #line 4026 "frontends/verilog/verilog_parser.tab.c"
4029 #line 1453 "frontends/verilog/verilog_parser.y"
4034 #line 4035 "frontends/verilog/verilog_parser.tab.c"
4038 #line 1457 "frontends/verilog/verilog_parser.y"
4043 #line 4044 "frontends/verilog/verilog_parser.tab.c"
4047 #line 1461 "frontends/verilog/verilog_parser.y"
4052 #line 4053 "frontends/verilog/verilog_parser.tab.c"
4056 #line 1467 "frontends/verilog/verilog_parser.y"
4060 #line 4061 "frontends/verilog/verilog_parser.tab.c"
4064 #line 1470 "frontends/verilog/verilog_parser.y"
4066 (yyval.ast) = (yyvsp[0].ast);
4067 (yyval.ast)->children.push_back((yyvsp[-2].ast));
4069 #line 4070 "frontends/verilog/verilog_parser.tab.c"
4073 #line 4074 "frontends/verilog/verilog_parser.tab.c"
4102 if (0 <= yystate && yystate <=
YYLAST &&
yycheck[yystate] == *yyssp)
4122 #if ! YYERROR_VERBOSE
4125 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
4128 char const *yymsgp =
YY_(
"syntax error");
4129 int yysyntax_error_status;
4130 yysyntax_error_status = YYSYNTAX_ERROR;
4131 if (yysyntax_error_status == 0)
4133 else if (yysyntax_error_status == 1)
4135 if (yymsg != yymsgbuf)
4141 yymsg_alloc =
sizeof yymsgbuf;
4142 yysyntax_error_status = 2;
4146 yysyntax_error_status = YYSYNTAX_ERROR;
4151 if (yysyntax_error_status == 2)
4152 goto yyexhaustedlab;
4154 # undef YYSYNTAX_ERROR
4160 if (yyerrstatus == 3)
4262 #if !defined yyoverflow || YYERROR_VERBOSE
4285 while (yyssp != yyss)
4296 if (yymsg != yymsgbuf)
static YOSYS_NAMESPACE_END void append_attr(AstNode *ast, std::map< std::string, AstNode * > *al)
std::map< std::string, AstNode * > * albuf
struct AstNode * current_ast_mod
static std::string unescape_id(std::string str)
YOSYS_NAMESPACE_END void frontend_verilog_yyerror(char const *fmt,...)
std::vector< AstNode * > ast_stack
void log_error(const char *format,...)
struct AstNode * current_function_or_task
static const yytype_uint16 yyr1[]
static const yytype_int16 yypgoto[]
static const yytype_uint16 yystos[]
#define yypact_value_is_default(Yystate)
#define yytable_value_is_error(Yytable_value)
static const yytype_int16 yytable[]
#define YY_REDUCE_PRINT(Rule)
int GetSize(RTLIL::Wire *wire)
#define log_assert(_assert_expr_)
std::map< std::string, YOSYS_NAMESPACE_PREFIX AST::AstNode * > * al
static void free_attr(std::map< std::string, AstNode * > *al)
std::vector< char > case_type_stack
std::map< std::string, AstNode * > attr_list
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
static void append_attr_clone(AstNode *ast, std::map< std::string, AstNode * > *al)
std::map< std::string, int > port_stubs
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
static const yytype_int16 yycheck[]
std::vector< AstNode * > children
AST::AstNode * const2ast(std::string code, char case_type=0, bool warn_z=false)
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep)
int current_function_or_task_port_id
static const yytype_uint8 yyr2[]
std::map< std::string, AstNode * > default_attr_list
static const yytype_uint16 yydefact[]
#define YY_STACK_PRINT(Bottom, Top)
static const yytype_int16 yypact[]
static const yytype_int16 yydefgoto[]
bool do_not_require_port_stubs