1
/* A Bison parser, made by GNU Bison 2.3. */
2
/* A Bison parser, made by GNU Bison 2.4.1. */
3
4
/* Skeleton implementation for Bison's Yacc-like parsers in C
5
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6
7
Free Software Foundation, Inc.
8
This program is free software; you can redistribute it and/or modify
9
This program is free software: you can redistribute it and/or modify
9
10
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation; either version 2, or (at your option)
11
the Free Software Foundation, either version 3 of the License, or
12
(at your option) any later version.
13
14
This program is distributed in the hope that it will be useful,
14
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
17
GNU General Public License for more details.
18
19
You should have received a copy of the GNU General Public License
19
along with this program; if not, write to the Free Software
20
Foundation, Inc., 51 Franklin Street, Fifth Floor,
21
Boston, MA 02110-1301, USA. */
20
along with this program. If not, see <http://www.gnu.org/licenses/>. */
23
22
/* As a special exception, you may create a larger work that contains
24
23
part or all of the Bison parser skeleton and distribute that work
726
745
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
727
746
static const yytype_uint16 yyrline[] =
729
0, 322, 322, 321, 325, 332, 335, 335, 338, 340,
730
342, 344, 348, 350, 352, 356, 357, 360, 361, 364,
731
367, 368, 371, 374, 378, 379, 383, 384, 387, 388,
732
391, 392, 393, 396, 397, 398, 399, 402, 404, 408,
733
418, 421, 422, 423, 427, 426, 433, 435, 432, 440,
734
442, 439, 448, 450, 449, 452, 455, 454, 460, 461,
735
461, 462, 462, 463, 466, 476, 477, 480, 481
748
0, 326, 326, 325, 329, 336, 339, 339, 342, 344,
749
346, 348, 352, 354, 356, 360, 361, 364, 365, 368,
750
371, 372, 375, 378, 382, 383, 387, 388, 391, 392,
751
395, 396, 397, 400, 401, 402, 403, 406, 408, 412,
752
422, 425, 426, 427, 431, 430, 437, 439, 436, 444,
753
446, 443, 452, 454, 453, 456, 459, 458, 464, 465,
754
465, 466, 466, 467, 470, 480, 481, 484, 485
744
763
"$end", "error", "$undefined", "T_graph", "T_digraph", "T_strict",
745
764
"T_node", "T_edge", "T_edgeop", "T_symbol", "T_qsymbol", "T_subgraph",
746
765
"'{'", "'}'", "','", "'['", "']'", "'='", "';'", "':'", "'+'", "$accept",
747
"file", "@1", "optgraphname", "graph_type", "attr_class",
766
"file", "$@1", "optgraphname", "graph_type", "attr_class",
748
767
"inside_attr_list", "optcomma", "attr_list", "rec_attr_list",
749
768
"opt_attr_list", "attr_set", "iattr_set", "stmt_list", "stmt_list1",
750
769
"stmt", "stmt1", "attr_stmt", "node_id", "node_name", "node_port",
751
"node_stmt", "@2", "edge_stmt", "@3", "@4", "@5", "@6", "edgeRHS", "@7",
752
"@8", "subg_stmt", "@9", "@10", "subg_hdr", "symbol", "qsymbol", 0
770
"node_stmt", "$@2", "edge_stmt", "$@3", "$@4", "$@5", "$@6", "edgeRHS",
771
"$@7", "$@8", "subg_stmt", "$@9", "$@10", "subg_hdr", "symbol",
1066
1086
#if (defined __STDC__ || defined __C99__FUNC__ \
1067
1087
|| defined __cplusplus || defined _MSC_VER)
1069
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
1089
yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1072
yy_stack_print (bottom, top)
1073
yytype_int16 *bottom;
1092
yy_stack_print (yybottom, yytop)
1093
yytype_int16 *yybottom;
1094
yytype_int16 *yytop;
1077
1097
YYFPRINTF (stderr, "Stack now");
1078
for (; bottom <= top; ++bottom)
1079
YYFPRINTF (stderr, " %d", *bottom);
1098
for (; yybottom <= yytop; yybottom++)
1100
int yybot = *yybottom;
1101
YYFPRINTF (stderr, " %d", yybot);
1080
1103
YYFPRINTF (stderr, "\n");
1477
/* Number of tokens to shift before error messages enabled. */
1480
/* The stacks and their tools:
1481
`yyss': related to states.
1482
`yyvs': related to semantic values.
1484
Refer to the stacks thru separate pointers, to allow yyoverflow
1485
to reallocate them elsewhere. */
1487
/* The state stack. */
1488
yytype_int16 yyssa[YYINITDEPTH];
1490
yytype_int16 *yyssp;
1492
/* The semantic value stack. */
1493
YYSTYPE yyvsa[YYINITDEPTH];
1497
YYSIZE_T yystacksize;
1458
/* Number of tokens to shift before error messages enabled. */
1460
/* Look-ahead token as an internal (translated) token number. */
1501
/* Lookahead token as an internal (translated) token number. */
1503
/* The variables used to return semantic value and location from the
1462
1507
#if YYERROR_VERBOSE
1463
1508
/* Buffer for error messages, and its allocated size. */
1464
1509
char yymsgbuf[128];
1466
1511
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1469
/* Three stacks and their tools:
1470
`yyss': related to states,
1471
`yyvs': related to semantic values,
1472
`yyls': related to locations.
1474
Refer to the stacks thru separate pointers, to allow yyoverflow
1475
to reallocate them elsewhere. */
1477
/* The state stack. */
1478
yytype_int16 yyssa[YYINITDEPTH];
1479
yytype_int16 *yyss = yyssa;
1480
yytype_int16 *yyssp;
1482
/* The semantic value stack. */
1483
YYSTYPE yyvsa[YYINITDEPTH];
1484
YYSTYPE *yyvs = yyvsa;
1489
1514
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1491
YYSIZE_T yystacksize = YYINITDEPTH;
1493
/* The variables used to return semantic value and location from the
1498
1516
/* The number of symbols on the RHS of the reduced rule.
1499
1517
Keep to zero when no symbol should be popped. */
1523
yystacksize = YYINITDEPTH;
1502
1525
YYDPRINTF ((stderr, "Starting parse\n"));
1505
1528
yyerrstatus = 0;
1507
yychar = YYEMPTY; /* Cause a token to be read. */
1530
yychar = YYEMPTY; /* Cause a token to be read. */
1509
1532
/* Initialize stack pointers.
1510
1533
Waste one element of value and location stack
1511
1534
so that they stay on the same level as the state stack.
1512
1535
The wasted elements are never initialized. */
1719
#line 332 "../../lib/graph/parser.y"
1743
/* Line 1455 of yacc.c */
1744
#line 336 "../../lib/graph/parser.y"
1720
1745
{AG.parsed_g = NULL;}
1724
#line 335 "../../lib/graph/parser.y"
1750
/* Line 1455 of yacc.c */
1751
#line 339 "../../lib/graph/parser.y"
1725
1752
{(yyval.str)=(yyvsp[(1) - (1)].str);}
1729
#line 335 "../../lib/graph/parser.y"
1757
/* Line 1455 of yacc.c */
1758
#line 339 "../../lib/graph/parser.y"
1730
1759
{(yyval.str)=0;}
1734
#line 339 "../../lib/graph/parser.y"
1764
/* Line 1455 of yacc.c */
1765
#line 343 "../../lib/graph/parser.y"
1735
1766
{Agraph_type = AGRAPH; AG.edge_op = "--";}
1739
#line 341 "../../lib/graph/parser.y"
1771
/* Line 1455 of yacc.c */
1772
#line 345 "../../lib/graph/parser.y"
1740
1773
{Agraph_type = AGRAPHSTRICT; AG.edge_op = "--";}
1744
#line 343 "../../lib/graph/parser.y"
1778
/* Line 1455 of yacc.c */
1779
#line 347 "../../lib/graph/parser.y"
1745
1780
{Agraph_type = AGDIGRAPH; AG.edge_op = "->";}
1749
#line 345 "../../lib/graph/parser.y"
1785
/* Line 1455 of yacc.c */
1786
#line 349 "../../lib/graph/parser.y"
1750
1787
{Agraph_type = AGDIGRAPHSTRICT; AG.edge_op = "->";}
1754
#line 349 "../../lib/graph/parser.y"
1792
/* Line 1455 of yacc.c */
1793
#line 353 "../../lib/graph/parser.y"
1755
1794
{Current_class = TAG_GRAPH;}
1759
#line 351 "../../lib/graph/parser.y"
1799
/* Line 1455 of yacc.c */
1800
#line 355 "../../lib/graph/parser.y"
1760
1801
{Current_class = TAG_NODE; N = G->proto->n;}
1764
#line 353 "../../lib/graph/parser.y"
1806
/* Line 1455 of yacc.c */
1807
#line 357 "../../lib/graph/parser.y"
1765
1808
{Current_class = TAG_EDGE; E = G->proto->e;}
1769
#line 375 "../../lib/graph/parser.y"
1813
/* Line 1455 of yacc.c */
1814
#line 379 "../../lib/graph/parser.y"
1770
1815
{attr_set((yyvsp[(1) - (3)].str),(yyvsp[(3) - (3)].str)); agstrfree((yyvsp[(1) - (3)].str)); agstrfree((yyvsp[(3) - (3)].str));}
1774
#line 380 "../../lib/graph/parser.y"
1820
/* Line 1455 of yacc.c */
1821
#line 384 "../../lib/graph/parser.y"
1775
1822
{attr_set((yyvsp[(1) - (1)].str),"true"); agstrfree((yyvsp[(1) - (1)].str)); }
1779
#line 393 "../../lib/graph/parser.y"
1827
/* Line 1455 of yacc.c */
1828
#line 397 "../../lib/graph/parser.y"
1780
1829
{agerror("syntax error, statement skipped");}
1784
#line 399 "../../lib/graph/parser.y"
1834
/* Line 1455 of yacc.c */
1835
#line 403 "../../lib/graph/parser.y"
1789
#line 403 "../../lib/graph/parser.y"
1841
/* Line 1455 of yacc.c */
1842
#line 407 "../../lib/graph/parser.y"
1790
1843
{Current_class = TAG_GRAPH; /* reset */}
1794
#line 405 "../../lib/graph/parser.y"
1848
/* Line 1455 of yacc.c */
1849
#line 409 "../../lib/graph/parser.y"
1795
1850
{Current_class = TAG_GRAPH;}
1799
#line 409 "../../lib/graph/parser.y"
1855
/* Line 1455 of yacc.c */
1856
#line 413 "../../lib/graph/parser.y"
1802
1859
rv.obj = (yyvsp[(1) - (2)].n);
1810
#line 418 "../../lib/graph/parser.y"
1868
/* Line 1455 of yacc.c */
1869
#line 422 "../../lib/graph/parser.y"
1811
1870
{(yyval.n) = bind_node((yyvsp[(1) - (1)].str)); agstrfree((yyvsp[(1) - (1)].str));}
1815
#line 422 "../../lib/graph/parser.y"
1875
/* Line 1455 of yacc.c */
1876
#line 426 "../../lib/graph/parser.y"
1816
1877
{ Port=(yyvsp[(2) - (2)].str);}
1820
#line 423 "../../lib/graph/parser.y"
1882
/* Line 1455 of yacc.c */
1883
#line 427 "../../lib/graph/parser.y"
1821
1884
{Port=concat3((yyvsp[(2) - (4)].str),":",(yyvsp[(4) - (4)].str));agstrfree((yyvsp[(2) - (4)].str)); agstrfree((yyvsp[(4) - (4)].str));}
1825
#line 427 "../../lib/graph/parser.y"
1889
/* Line 1455 of yacc.c */
1890
#line 431 "../../lib/graph/parser.y"
1826
1891
{Current_class = TAG_NODE; N = (Agnode_t*)((yyvsp[(1) - (1)].obj).obj);}
1830
#line 429 "../../lib/graph/parser.y"
1896
/* Line 1455 of yacc.c */
1897
#line 433 "../../lib/graph/parser.y"
1831
1898
{agstrfree((yyvsp[(1) - (3)].obj).port);Current_class = TAG_GRAPH; /* reset */}
1835
#line 433 "../../lib/graph/parser.y"
1903
/* Line 1455 of yacc.c */
1904
#line 437 "../../lib/graph/parser.y"
1836
1905
{begin_edgestmt((yyvsp[(1) - (1)].obj));}
1840
#line 435 "../../lib/graph/parser.y"
1910
/* Line 1455 of yacc.c */
1911
#line 439 "../../lib/graph/parser.y"
1841
1912
{ E = SP->subg->proto->e;
1842
1913
Current_class = TAG_EDGE; }
1846
#line 438 "../../lib/graph/parser.y"
1918
/* Line 1455 of yacc.c */
1919
#line 442 "../../lib/graph/parser.y"
1847
1920
{end_edgestmt();}
1851
#line 440 "../../lib/graph/parser.y"
1925
/* Line 1455 of yacc.c */
1926
#line 444 "../../lib/graph/parser.y"
1852
1927
{begin_edgestmt((yyvsp[(1) - (1)].obj));}
1856
#line 442 "../../lib/graph/parser.y"
1932
/* Line 1455 of yacc.c */
1933
#line 446 "../../lib/graph/parser.y"
1857
1934
{ E = SP->subg->proto->e;
1858
1935
Current_class = TAG_EDGE; }
1862
#line 445 "../../lib/graph/parser.y"
1940
/* Line 1455 of yacc.c */
1941
#line 449 "../../lib/graph/parser.y"
1863
1942
{end_edgestmt();}
1867
#line 448 "../../lib/graph/parser.y"
1947
/* Line 1455 of yacc.c */
1948
#line 452 "../../lib/graph/parser.y"
1868
1949
{mid_edgestmt((yyvsp[(2) - (2)].obj));}
1872
#line 450 "../../lib/graph/parser.y"
1954
/* Line 1455 of yacc.c */
1955
#line 454 "../../lib/graph/parser.y"
1873
1956
{mid_edgestmt((yyvsp[(2) - (2)].obj));}
1877
#line 453 "../../lib/graph/parser.y"
1961
/* Line 1455 of yacc.c */
1962
#line 457 "../../lib/graph/parser.y"
1878
1963
{mid_edgestmt((yyvsp[(2) - (2)].obj));}
1882
#line 455 "../../lib/graph/parser.y"
1968
/* Line 1455 of yacc.c */
1969
#line 459 "../../lib/graph/parser.y"
1883
1970
{mid_edgestmt((yyvsp[(2) - (2)].obj));}
1887
#line 460 "../../lib/graph/parser.y"
1975
/* Line 1455 of yacc.c */
1976
#line 464 "../../lib/graph/parser.y"
1888
1977
{(yyval.obj) = pop_gobj();}
1892
#line 461 "../../lib/graph/parser.y"
1982
/* Line 1455 of yacc.c */
1983
#line 465 "../../lib/graph/parser.y"
1893
1984
{ anonsubg(); }
1897
#line 461 "../../lib/graph/parser.y"
1989
/* Line 1455 of yacc.c */
1990
#line 465 "../../lib/graph/parser.y"
1898
1991
{(yyval.obj) = pop_gobj();}
1902
#line 462 "../../lib/graph/parser.y"
1996
/* Line 1455 of yacc.c */
1997
#line 466 "../../lib/graph/parser.y"
1903
1998
{ anonsubg(); }
1907
#line 462 "../../lib/graph/parser.y"
2003
/* Line 1455 of yacc.c */
2004
#line 466 "../../lib/graph/parser.y"
1908
2005
{(yyval.obj) = pop_gobj();}
1912
#line 463 "../../lib/graph/parser.y"
2010
/* Line 1455 of yacc.c */
2011
#line 467 "../../lib/graph/parser.y"
1913
2012
{subgraph_warn(); (yyval.obj) = pop_gobj();}
1917
#line 467 "../../lib/graph/parser.y"
2017
/* Line 1455 of yacc.c */
2018
#line 471 "../../lib/graph/parser.y"
1918
2019
{ Agraph_t *subg;
1919
2020
if ((subg = agfindsubg(AG.parsed_g,(yyvsp[(2) - (2)].str)))) aginsert(G,subg);
1920
2021
else subg = agsubg(G,(yyvsp[(2) - (2)].str));
1928
#line 476 "../../lib/graph/parser.y"
2030
/* Line 1455 of yacc.c */
2031
#line 480 "../../lib/graph/parser.y"
1929
2032
{(yyval.str) = (yyvsp[(1) - (1)].str); }
1933
#line 477 "../../lib/graph/parser.y"
2037
/* Line 1455 of yacc.c */
2038
#line 481 "../../lib/graph/parser.y"
1934
2039
{(yyval.str) = (yyvsp[(1) - (1)].str); }
1938
#line 480 "../../lib/graph/parser.y"
2044
/* Line 1455 of yacc.c */
2045
#line 484 "../../lib/graph/parser.y"
1939
2046
{(yyval.str) = (yyvsp[(1) - (1)].str); }
1943
#line 481 "../../lib/graph/parser.y"
2051
/* Line 1455 of yacc.c */
2052
#line 485 "../../lib/graph/parser.y"
1944
2053
{(yyval.str) = concat((yyvsp[(1) - (3)].str),(yyvsp[(3) - (3)].str)); agstrfree((yyvsp[(1) - (3)].str)); agstrfree((yyvsp[(3) - (3)].str));}
1948
/* Line 1267 of yacc.c. */
1949
#line 1950 "y.tab.c"
2058
/* Line 1455 of yacc.c */
2059
#line 2060 "y.tab.c"
1950
2060
default: break;
1952
2062
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);