~ubuntu-branches/ubuntu/precise/graphviz/precise-security

« back to all changes in this revision

Viewing changes to lib/graph/y.tab.c

  • Committer: Bazaar Package Importer
  • Author(s): David Claughton
  • Date: 2010-03-24 22:45:18 UTC
  • mfrom: (1.2.7 upstream) (6.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100324224518-do441tthbqjaqjzd
Tags: 2.26.3-4
Add patch to fix segfault in circo. Backported from upstream snapshot
release.  Thanks to Francis Russell for his work on this.
(Closes: #575255)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* A Bison parser, made by GNU Bison 2.3.  */
 
1
 
 
2
/* A Bison parser, made by GNU Bison 2.4.1.  */
2
3
 
3
4
/* Skeleton implementation for Bison's Yacc-like parsers in C
4
 
 
5
 
   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
 
5
   
 
6
      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6
7
   Free Software Foundation, Inc.
7
 
 
8
 
   This program is free software; you can redistribute it and/or modify
 
8
   
 
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
 
   any later version.
12
 
 
 
11
   the Free Software Foundation, either version 3 of the License, or
 
12
   (at your option) any later version.
 
13
   
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.
17
 
 
 
18
   
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/>.  */
22
21
 
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
29
28
   special exception, which will cause the skeleton and the resulting
30
29
   Bison output files to be licensed under the GNU General Public
31
30
   License without this special exception.
32
 
 
 
31
   
33
32
   This special exception was added by the Free Software Foundation in
34
33
   version 2.2 of Bison.  */
35
34
 
47
46
#define YYBISON 1
48
47
 
49
48
/* Bison version.  */
50
 
#define YYBISON_VERSION "2.3"
 
49
#define YYBISON_VERSION "2.4.1"
51
50
 
52
51
/* Skeleton name.  */
53
52
#define YYSKELETON_NAME "yacc.c"
55
54
/* Pure parsers.  */
56
55
#define YYPURE 0
57
56
 
 
57
/* Push parsers.  */
 
58
#define YYPUSH 0
 
59
 
 
60
/* Pull parsers.  */
 
61
#define YYPULL 1
 
62
 
58
63
/* Using locations.  */
59
64
#define YYLSP_NEEDED 0
60
65
 
61
66
 
62
67
 
63
 
/* Tokens.  */
64
 
#ifndef YYTOKENTYPE
65
 
# define YYTOKENTYPE
66
 
   /* Put the tokens into the symbol table, so that GDB and other debuggers
67
 
      know about them.  */
68
 
   enum yytokentype {
69
 
     T_graph = 258,
70
 
     T_digraph = 259,
71
 
     T_strict = 260,
72
 
     T_node = 261,
73
 
     T_edge = 262,
74
 
     T_edgeop = 263,
75
 
     T_symbol = 264,
76
 
     T_qsymbol = 265,
77
 
     T_subgraph = 266
78
 
   };
79
 
#endif
80
 
/* Tokens.  */
81
 
#define T_graph 258
82
 
#define T_digraph 259
83
 
#define T_strict 260
84
 
#define T_node 261
85
 
#define T_edge 262
86
 
#define T_edgeop 263
87
 
#define T_symbol 264
88
 
#define T_qsymbol 265
89
 
#define T_subgraph 266
90
 
 
91
 
 
92
 
 
93
 
 
94
68
/* Copy the first part of user declarations.  */
 
69
 
 
70
/* Line 189 of yacc.c  */
95
71
#line 17 "../../lib/graph/parser.y"
96
72
 
97
73
 
110
86
static Agnode_t         *N;
111
87
static Agedge_t         *E;
112
88
static objstack_t       *SP;
113
 
static Agraph_t         *Gstack[32];
 
89
#define GSTACK_SIZE 64
 
90
static Agraph_t         *Gstack[GSTACK_SIZE];
114
91
static int                      GSP;
115
92
 
116
93
static void subgraph_warn (void)
123
100
 
124
101
static void push_subg(Agraph_t *g)
125
102
{
 
103
        if (GSP >= GSTACK_SIZE) {
 
104
                agerr (AGERR, "Gstack overflow in graph parser\n"); exit(1);
 
105
        }
126
106
        G = Gstack[GSP++] = g;
127
107
}
128
108
 
380
360
 
381
361
 
382
362
 
 
363
/* Line 189 of yacc.c  */
 
364
#line 365 "y.tab.c"
 
365
 
383
366
/* Enabling traces.  */
384
367
#ifndef YYDEBUG
385
368
# define YYDEBUG 0
398
381
# define YYTOKEN_TABLE 0
399
382
#endif
400
383
 
 
384
 
 
385
/* Tokens.  */
 
386
#ifndef YYTOKENTYPE
 
387
# define YYTOKENTYPE
 
388
   /* Put the tokens into the symbol table, so that GDB and other debuggers
 
389
      know about them.  */
 
390
   enum yytokentype {
 
391
     T_graph = 258,
 
392
     T_digraph = 259,
 
393
     T_strict = 260,
 
394
     T_node = 261,
 
395
     T_edge = 262,
 
396
     T_edgeop = 263,
 
397
     T_symbol = 264,
 
398
     T_qsymbol = 265,
 
399
     T_subgraph = 266
 
400
   };
 
401
#endif
 
402
/* Tokens.  */
 
403
#define T_graph 258
 
404
#define T_digraph 259
 
405
#define T_strict 260
 
406
#define T_node 261
 
407
#define T_edge 262
 
408
#define T_edgeop 263
 
409
#define T_symbol 264
 
410
#define T_qsymbol 265
 
411
#define T_subgraph 266
 
412
 
 
413
 
 
414
 
 
415
 
401
416
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
402
417
typedef union YYSTYPE
403
 
#line 304 "../../lib/graph/parser.y"
404
418
{
 
419
 
 
420
/* Line 214 of yacc.c  */
 
421
#line 308 "../../lib/graph/parser.y"
 
422
 
405
423
                        int                                     i;
406
424
                        char                            *str;
407
425
                        struct objport_t        obj;
408
426
                        struct Agnode_t         *n;
409
 
}
410
 
/* Line 187 of yacc.c.  */
411
 
#line 412 "y.tab.c"
412
 
        YYSTYPE;
 
427
 
 
428
 
 
429
 
 
430
/* Line 214 of yacc.c  */
 
431
#line 432 "y.tab.c"
 
432
} YYSTYPE;
 
433
# define YYSTYPE_IS_TRIVIAL 1
413
434
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
414
435
# define YYSTYPE_IS_DECLARED 1
415
 
# define YYSTYPE_IS_TRIVIAL 1
416
436
#endif
417
437
 
418
438
 
419
 
 
420
439
/* Copy the second part of user declarations.  */
421
440
 
422
441
 
423
 
/* Line 216 of yacc.c.  */
424
 
#line 425 "y.tab.c"
 
442
/* Line 264 of yacc.c  */
 
443
#line 444 "y.tab.c"
425
444
 
426
445
#ifdef short
427
446
# undef short
496
515
#if (defined __STDC__ || defined __C99__FUNC__ \
497
516
     || defined __cplusplus || defined _MSC_VER)
498
517
static int
499
 
YYID (int i)
 
518
YYID (int yyi)
500
519
#else
501
520
static int
502
 
YYID (i)
503
 
    int i;
 
521
YYID (yyi)
 
522
    int yyi;
504
523
#endif
505
524
{
506
 
  return i;
 
525
  return yyi;
507
526
}
508
527
#endif
509
528
 
584
603
/* A type that is properly aligned for any stack member.  */
585
604
union yyalloc
586
605
{
587
 
  yytype_int16 yyss;
588
 
  YYSTYPE yyvs;
589
 
  };
 
606
  yytype_int16 yyss_alloc;
 
607
  YYSTYPE yyvs_alloc;
 
608
};
590
609
 
591
610
/* The size of the maximum gap between one aligned stack and the next.  */
592
611
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
620
639
   elements in the stack, and YYPTR gives the new location of the
621
640
   stack.  Advance YYPTR to a properly aligned location for the next
622
641
   stack.  */
623
 
# define YYSTACK_RELOCATE(Stack)                                        \
 
642
# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
624
643
    do                                                                  \
625
644
      {                                                                 \
626
645
        YYSIZE_T yynewbytes;                                            \
627
 
        YYCOPY (&yyptr->Stack, Stack, yysize);                          \
628
 
        Stack = &yyptr->Stack;                                          \
 
646
        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
 
647
        Stack = &yyptr->Stack_alloc;                                    \
629
648
        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
630
649
        yyptr += yynewbytes / sizeof (*yyptr);                          \
631
650
      }                                                                 \
726
745
/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
727
746
static const yytype_uint16 yyrline[] =
728
747
{
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
736
755
};
737
756
#endif
738
757
 
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",
 
772
  "qsymbol", 0
753
773
};
754
774
#endif
755
775
 
1066
1086
#if (defined __STDC__ || defined __C99__FUNC__ \
1067
1087
     || defined __cplusplus || defined _MSC_VER)
1068
1088
static void
1069
 
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
 
1089
yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1070
1090
#else
1071
1091
static void
1072
 
yy_stack_print (bottom, top)
1073
 
    yytype_int16 *bottom;
1074
 
    yytype_int16 *top;
 
1092
yy_stack_print (yybottom, yytop)
 
1093
    yytype_int16 *yybottom;
 
1094
    yytype_int16 *yytop;
1075
1095
#endif
1076
1096
{
1077
1097
  YYFPRINTF (stderr, "Stack now");
1078
 
  for (; bottom <= top; ++bottom)
1079
 
    YYFPRINTF (stderr, " %d", *bottom);
 
1098
  for (; yybottom <= yytop; yybottom++)
 
1099
    {
 
1100
      int yybot = *yybottom;
 
1101
      YYFPRINTF (stderr, " %d", yybot);
 
1102
    }
1080
1103
  YYFPRINTF (stderr, "\n");
1081
1104
}
1082
1105
 
1110
1133
  /* The symbols being reduced.  */
1111
1134
  for (yyi = 0; yyi < yynrhs; yyi++)
1112
1135
    {
1113
 
      fprintf (stderr, "   $%d = ", yyi + 1);
 
1136
      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
1114
1137
      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1115
1138
                       &(yyvsp[(yyi + 1) - (yynrhs)])
1116
1139
                                       );
1117
 
      fprintf (stderr, "\n");
 
1140
      YYFPRINTF (stderr, "\n");
1118
1141
    }
1119
1142
}
1120
1143
 
1394
1417
        break;
1395
1418
    }
1396
1419
}
1397
 
 
1398
1420
 
1399
1421
/* Prevent warnings from -Wmissing-prototypes.  */
1400
 
 
1401
1422
#ifdef YYPARSE_PARAM
1402
1423
#if defined __STDC__ || defined __cplusplus
1403
1424
int yyparse (void *YYPARSE_PARAM);
1413
1434
#endif /* ! YYPARSE_PARAM */
1414
1435
 
1415
1436
 
1416
 
 
1417
 
/* The look-ahead symbol.  */
 
1437
/* The lookahead symbol.  */
1418
1438
int yychar;
1419
1439
 
1420
 
/* The semantic value of the look-ahead symbol.  */
 
1440
/* The semantic value of the lookahead symbol.  */
1421
1441
YYSTYPE yylval;
1422
1442
 
1423
1443
/* Number of syntax errors so far.  */
1425
1445
 
1426
1446
 
1427
1447
 
1428
 
/*----------.
1429
 
| yyparse.  |
1430
 
`----------*/
 
1448
/*-------------------------.
 
1449
| yyparse or yypush_parse.  |
 
1450
`-------------------------*/
1431
1451
 
1432
1452
#ifdef YYPARSE_PARAM
1433
1453
#if (defined __STDC__ || defined __C99__FUNC__ \
1451
1471
#endif
1452
1472
#endif
1453
1473
{
1454
 
  
1455
 
  int yystate;
 
1474
 
 
1475
 
 
1476
    int yystate;
 
1477
    /* Number of tokens to shift before error messages enabled.  */
 
1478
    int yyerrstatus;
 
1479
 
 
1480
    /* The stacks and their tools:
 
1481
       `yyss': related to states.
 
1482
       `yyvs': related to semantic values.
 
1483
 
 
1484
       Refer to the stacks thru separate pointers, to allow yyoverflow
 
1485
       to reallocate them elsewhere.  */
 
1486
 
 
1487
    /* The state stack.  */
 
1488
    yytype_int16 yyssa[YYINITDEPTH];
 
1489
    yytype_int16 *yyss;
 
1490
    yytype_int16 *yyssp;
 
1491
 
 
1492
    /* The semantic value stack.  */
 
1493
    YYSTYPE yyvsa[YYINITDEPTH];
 
1494
    YYSTYPE *yyvs;
 
1495
    YYSTYPE *yyvsp;
 
1496
 
 
1497
    YYSIZE_T yystacksize;
 
1498
 
1456
1499
  int yyn;
1457
1500
  int yyresult;
1458
 
  /* Number of tokens to shift before error messages enabled.  */
1459
 
  int yyerrstatus;
1460
 
  /* Look-ahead token as an internal (translated) token number.  */
1461
 
  int yytoken = 0;
 
1501
  /* Lookahead token as an internal (translated) token number.  */
 
1502
  int yytoken;
 
1503
  /* The variables used to return semantic value and location from the
 
1504
     action routines.  */
 
1505
  YYSTYPE yyval;
 
1506
 
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;
1467
1512
#endif
1468
1513
 
1469
 
  /* Three stacks and their tools:
1470
 
     `yyss': related to states,
1471
 
     `yyvs': related to semantic values,
1472
 
     `yyls': related to locations.
1473
 
 
1474
 
     Refer to the stacks thru separate pointers, to allow yyoverflow
1475
 
     to reallocate them elsewhere.  */
1476
 
 
1477
 
  /* The state stack.  */
1478
 
  yytype_int16 yyssa[YYINITDEPTH];
1479
 
  yytype_int16 *yyss = yyssa;
1480
 
  yytype_int16 *yyssp;
1481
 
 
1482
 
  /* The semantic value stack.  */
1483
 
  YYSTYPE yyvsa[YYINITDEPTH];
1484
 
  YYSTYPE *yyvs = yyvsa;
1485
 
  YYSTYPE *yyvsp;
1486
 
 
1487
 
 
1488
 
 
1489
1514
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1490
1515
 
1491
 
  YYSIZE_T yystacksize = YYINITDEPTH;
1492
 
 
1493
 
  /* The variables used to return semantic value and location from the
1494
 
     action routines.  */
1495
 
  YYSTYPE yyval;
1496
 
 
1497
 
 
1498
1516
  /* The number of symbols on the RHS of the reduced rule.
1499
1517
     Keep to zero when no symbol should be popped.  */
1500
1518
  int yylen = 0;
1501
1519
 
 
1520
  yytoken = 0;
 
1521
  yyss = yyssa;
 
1522
  yyvs = yyvsa;
 
1523
  yystacksize = YYINITDEPTH;
 
1524
 
1502
1525
  YYDPRINTF ((stderr, "Starting parse\n"));
1503
1526
 
1504
1527
  yystate = 0;
1505
1528
  yyerrstatus = 0;
1506
1529
  yynerrs = 0;
1507
 
  yychar = YYEMPTY;             /* Cause a token to be read.  */
 
1530
  yychar = YYEMPTY; /* Cause a token to be read.  */
1508
1531
 
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.  */
1513
 
 
1514
1536
  yyssp = yyss;
1515
1537
  yyvsp = yyvs;
1516
1538
 
1540
1562
        YYSTYPE *yyvs1 = yyvs;
1541
1563
        yytype_int16 *yyss1 = yyss;
1542
1564
 
1543
 
 
1544
1565
        /* Each stack pointer address is followed by the size of the
1545
1566
           data in use in that stack, in bytes.  This used to be a
1546
1567
           conditional around just the two extra args, but that might
1548
1569
        yyoverflow (YY_("memory exhausted"),
1549
1570
                    &yyss1, yysize * sizeof (*yyssp),
1550
1571
                    &yyvs1, yysize * sizeof (*yyvsp),
1551
 
 
1552
1572
                    &yystacksize);
1553
1573
 
1554
1574
        yyss = yyss1;
1571
1591
          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1572
1592
        if (! yyptr)
1573
1593
          goto yyexhaustedlab;
1574
 
        YYSTACK_RELOCATE (yyss);
1575
 
        YYSTACK_RELOCATE (yyvs);
1576
 
 
 
1594
        YYSTACK_RELOCATE (yyss_alloc, yyss);
 
1595
        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1577
1596
#  undef YYSTACK_RELOCATE
1578
1597
        if (yyss1 != yyssa)
1579
1598
          YYSTACK_FREE (yyss1);
1584
1603
      yyssp = yyss + yysize - 1;
1585
1604
      yyvsp = yyvs + yysize - 1;
1586
1605
 
1587
 
 
1588
1606
      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1589
1607
                  (unsigned long int) yystacksize));
1590
1608
 
1594
1612
 
1595
1613
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1596
1614
 
 
1615
  if (yystate == YYFINAL)
 
1616
    YYACCEPT;
 
1617
 
1597
1618
  goto yybackup;
1598
1619
 
1599
1620
/*-----------.
1602
1623
yybackup:
1603
1624
 
1604
1625
  /* Do appropriate processing given the current state.  Read a
1605
 
     look-ahead token if we need one and don't already have one.  */
 
1626
     lookahead token if we need one and don't already have one.  */
1606
1627
 
1607
 
  /* First try to decide what to do without reference to look-ahead token.  */
 
1628
  /* First try to decide what to do without reference to lookahead token.  */
1608
1629
  yyn = yypact[yystate];
1609
1630
  if (yyn == YYPACT_NINF)
1610
1631
    goto yydefault;
1611
1632
 
1612
 
  /* Not known => get a look-ahead token if don't already have one.  */
 
1633
  /* Not known => get a lookahead token if don't already have one.  */
1613
1634
 
1614
 
  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
 
1635
  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1615
1636
  if (yychar == YYEMPTY)
1616
1637
    {
1617
1638
      YYDPRINTF ((stderr, "Reading a token: "));
1643
1664
      goto yyreduce;
1644
1665
    }
1645
1666
 
1646
 
  if (yyn == YYFINAL)
1647
 
    YYACCEPT;
1648
 
 
1649
1667
  /* Count tokens shifted since error; after three, turn off error
1650
1668
     status.  */
1651
1669
  if (yyerrstatus)
1652
1670
    yyerrstatus--;
1653
1671
 
1654
 
  /* Shift the look-ahead token.  */
 
1672
  /* Shift the lookahead token.  */
1655
1673
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1656
1674
 
1657
 
  /* Discard the shifted token unless it is eof.  */
1658
 
  if (yychar != YYEOF)
1659
 
    yychar = YYEMPTY;
 
1675
  /* Discard the shifted token.  */
 
1676
  yychar = YYEMPTY;
1660
1677
 
1661
1678
  yystate = yyn;
1662
1679
  *++yyvsp = yylval;
1696
1713
  switch (yyn)
1697
1714
    {
1698
1715
        case 2:
1699
 
#line 322 "../../lib/graph/parser.y"
 
1716
 
 
1717
/* Line 1455 of yacc.c  */
 
1718
#line 326 "../../lib/graph/parser.y"
1700
1719
    {begin_graph((yyvsp[(2) - (2)].str)); agstrfree((yyvsp[(2) - (2)].str));}
1701
1720
    break;
1702
1721
 
1703
1722
  case 3:
1704
 
#line 324 "../../lib/graph/parser.y"
 
1723
 
 
1724
/* Line 1455 of yacc.c  */
 
1725
#line 328 "../../lib/graph/parser.y"
1705
1726
    {AG.accepting_state = TRUE; end_graph();}
1706
1727
    break;
1707
1728
 
1708
1729
  case 4:
1709
 
#line 326 "../../lib/graph/parser.y"
 
1730
 
 
1731
/* Line 1455 of yacc.c  */
 
1732
#line 330 "../../lib/graph/parser.y"
1710
1733
    {
1711
1734
                                        if (AG.parsed_g)
1712
1735
                                                agclose(AG.parsed_g);
1716
1739
    break;
1717
1740
 
1718
1741
  case 5:
1719
 
#line 332 "../../lib/graph/parser.y"
 
1742
 
 
1743
/* Line 1455 of yacc.c  */
 
1744
#line 336 "../../lib/graph/parser.y"
1720
1745
    {AG.parsed_g = NULL;}
1721
1746
    break;
1722
1747
 
1723
1748
  case 6:
1724
 
#line 335 "../../lib/graph/parser.y"
 
1749
 
 
1750
/* Line 1455 of yacc.c  */
 
1751
#line 339 "../../lib/graph/parser.y"
1725
1752
    {(yyval.str)=(yyvsp[(1) - (1)].str);}
1726
1753
    break;
1727
1754
 
1728
1755
  case 7:
1729
 
#line 335 "../../lib/graph/parser.y"
 
1756
 
 
1757
/* Line 1455 of yacc.c  */
 
1758
#line 339 "../../lib/graph/parser.y"
1730
1759
    {(yyval.str)=0;}
1731
1760
    break;
1732
1761
 
1733
1762
  case 8:
1734
 
#line 339 "../../lib/graph/parser.y"
 
1763
 
 
1764
/* Line 1455 of yacc.c  */
 
1765
#line 343 "../../lib/graph/parser.y"
1735
1766
    {Agraph_type = AGRAPH; AG.edge_op = "--";}
1736
1767
    break;
1737
1768
 
1738
1769
  case 9:
1739
 
#line 341 "../../lib/graph/parser.y"
 
1770
 
 
1771
/* Line 1455 of yacc.c  */
 
1772
#line 345 "../../lib/graph/parser.y"
1740
1773
    {Agraph_type = AGRAPHSTRICT; AG.edge_op = "--";}
1741
1774
    break;
1742
1775
 
1743
1776
  case 10:
1744
 
#line 343 "../../lib/graph/parser.y"
 
1777
 
 
1778
/* Line 1455 of yacc.c  */
 
1779
#line 347 "../../lib/graph/parser.y"
1745
1780
    {Agraph_type = AGDIGRAPH; AG.edge_op = "->";}
1746
1781
    break;
1747
1782
 
1748
1783
  case 11:
1749
 
#line 345 "../../lib/graph/parser.y"
 
1784
 
 
1785
/* Line 1455 of yacc.c  */
 
1786
#line 349 "../../lib/graph/parser.y"
1750
1787
    {Agraph_type = AGDIGRAPHSTRICT; AG.edge_op = "->";}
1751
1788
    break;
1752
1789
 
1753
1790
  case 12:
1754
 
#line 349 "../../lib/graph/parser.y"
 
1791
 
 
1792
/* Line 1455 of yacc.c  */
 
1793
#line 353 "../../lib/graph/parser.y"
1755
1794
    {Current_class = TAG_GRAPH;}
1756
1795
    break;
1757
1796
 
1758
1797
  case 13:
1759
 
#line 351 "../../lib/graph/parser.y"
 
1798
 
 
1799
/* Line 1455 of yacc.c  */
 
1800
#line 355 "../../lib/graph/parser.y"
1760
1801
    {Current_class = TAG_NODE; N = G->proto->n;}
1761
1802
    break;
1762
1803
 
1763
1804
  case 14:
1764
 
#line 353 "../../lib/graph/parser.y"
 
1805
 
 
1806
/* Line 1455 of yacc.c  */
 
1807
#line 357 "../../lib/graph/parser.y"
1765
1808
    {Current_class = TAG_EDGE; E = G->proto->e;}
1766
1809
    break;
1767
1810
 
1768
1811
  case 23:
1769
 
#line 375 "../../lib/graph/parser.y"
 
1812
 
 
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));}
1771
1816
    break;
1772
1817
 
1773
1818
  case 25:
1774
 
#line 380 "../../lib/graph/parser.y"
 
1819
 
 
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)); }
1776
1823
    break;
1777
1824
 
1778
1825
  case 32:
1779
 
#line 393 "../../lib/graph/parser.y"
 
1826
 
 
1827
/* Line 1455 of yacc.c  */
 
1828
#line 397 "../../lib/graph/parser.y"
1780
1829
    {agerror("syntax error, statement skipped");}
1781
1830
    break;
1782
1831
 
1783
1832
  case 36:
1784
 
#line 399 "../../lib/graph/parser.y"
 
1833
 
 
1834
/* Line 1455 of yacc.c  */
 
1835
#line 403 "../../lib/graph/parser.y"
1785
1836
    {}
1786
1837
    break;
1787
1838
 
1788
1839
  case 37:
1789
 
#line 403 "../../lib/graph/parser.y"
 
1840
 
 
1841
/* Line 1455 of yacc.c  */
 
1842
#line 407 "../../lib/graph/parser.y"
1790
1843
    {Current_class = TAG_GRAPH; /* reset */}
1791
1844
    break;
1792
1845
 
1793
1846
  case 38:
1794
 
#line 405 "../../lib/graph/parser.y"
 
1847
 
 
1848
/* Line 1455 of yacc.c  */
 
1849
#line 409 "../../lib/graph/parser.y"
1795
1850
    {Current_class = TAG_GRAPH;}
1796
1851
    break;
1797
1852
 
1798
1853
  case 39:
1799
 
#line 409 "../../lib/graph/parser.y"
 
1854
 
 
1855
/* Line 1455 of yacc.c  */
 
1856
#line 413 "../../lib/graph/parser.y"
1800
1857
    {
1801
1858
                                        objport_t               rv;
1802
1859
                                        rv.obj = (yyvsp[(1) - (2)].n);
1807
1864
    break;
1808
1865
 
1809
1866
  case 40:
1810
 
#line 418 "../../lib/graph/parser.y"
 
1867
 
 
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));}
1812
1871
    break;
1813
1872
 
1814
1873
  case 42:
1815
 
#line 422 "../../lib/graph/parser.y"
 
1874
 
 
1875
/* Line 1455 of yacc.c  */
 
1876
#line 426 "../../lib/graph/parser.y"
1816
1877
    { Port=(yyvsp[(2) - (2)].str);}
1817
1878
    break;
1818
1879
 
1819
1880
  case 43:
1820
 
#line 423 "../../lib/graph/parser.y"
 
1881
 
 
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));}
1822
1885
    break;
1823
1886
 
1824
1887
  case 44:
1825
 
#line 427 "../../lib/graph/parser.y"
 
1888
 
 
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);}
1827
1892
    break;
1828
1893
 
1829
1894
  case 45:
1830
 
#line 429 "../../lib/graph/parser.y"
 
1895
 
 
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 */}
1832
1899
    break;
1833
1900
 
1834
1901
  case 46:
1835
 
#line 433 "../../lib/graph/parser.y"
 
1902
 
 
1903
/* Line 1455 of yacc.c  */
 
1904
#line 437 "../../lib/graph/parser.y"
1836
1905
    {begin_edgestmt((yyvsp[(1) - (1)].obj));}
1837
1906
    break;
1838
1907
 
1839
1908
  case 47:
1840
 
#line 435 "../../lib/graph/parser.y"
 
1909
 
 
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; }
1843
1914
    break;
1844
1915
 
1845
1916
  case 48:
1846
 
#line 438 "../../lib/graph/parser.y"
 
1917
 
 
1918
/* Line 1455 of yacc.c  */
 
1919
#line 442 "../../lib/graph/parser.y"
1847
1920
    {end_edgestmt();}
1848
1921
    break;
1849
1922
 
1850
1923
  case 49:
1851
 
#line 440 "../../lib/graph/parser.y"
 
1924
 
 
1925
/* Line 1455 of yacc.c  */
 
1926
#line 444 "../../lib/graph/parser.y"
1852
1927
    {begin_edgestmt((yyvsp[(1) - (1)].obj));}
1853
1928
    break;
1854
1929
 
1855
1930
  case 50:
1856
 
#line 442 "../../lib/graph/parser.y"
 
1931
 
 
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; }
1859
1936
    break;
1860
1937
 
1861
1938
  case 51:
1862
 
#line 445 "../../lib/graph/parser.y"
 
1939
 
 
1940
/* Line 1455 of yacc.c  */
 
1941
#line 449 "../../lib/graph/parser.y"
1863
1942
    {end_edgestmt();}
1864
1943
    break;
1865
1944
 
1866
1945
  case 52:
1867
 
#line 448 "../../lib/graph/parser.y"
 
1946
 
 
1947
/* Line 1455 of yacc.c  */
 
1948
#line 452 "../../lib/graph/parser.y"
1868
1949
    {mid_edgestmt((yyvsp[(2) - (2)].obj));}
1869
1950
    break;
1870
1951
 
1871
1952
  case 53:
1872
 
#line 450 "../../lib/graph/parser.y"
 
1953
 
 
1954
/* Line 1455 of yacc.c  */
 
1955
#line 454 "../../lib/graph/parser.y"
1873
1956
    {mid_edgestmt((yyvsp[(2) - (2)].obj));}
1874
1957
    break;
1875
1958
 
1876
1959
  case 55:
1877
 
#line 453 "../../lib/graph/parser.y"
 
1960
 
 
1961
/* Line 1455 of yacc.c  */
 
1962
#line 457 "../../lib/graph/parser.y"
1878
1963
    {mid_edgestmt((yyvsp[(2) - (2)].obj));}
1879
1964
    break;
1880
1965
 
1881
1966
  case 56:
1882
 
#line 455 "../../lib/graph/parser.y"
 
1967
 
 
1968
/* Line 1455 of yacc.c  */
 
1969
#line 459 "../../lib/graph/parser.y"
1883
1970
    {mid_edgestmt((yyvsp[(2) - (2)].obj));}
1884
1971
    break;
1885
1972
 
1886
1973
  case 58:
1887
 
#line 460 "../../lib/graph/parser.y"
 
1974
 
 
1975
/* Line 1455 of yacc.c  */
 
1976
#line 464 "../../lib/graph/parser.y"
1888
1977
    {(yyval.obj) = pop_gobj();}
1889
1978
    break;
1890
1979
 
1891
1980
  case 59:
1892
 
#line 461 "../../lib/graph/parser.y"
 
1981
 
 
1982
/* Line 1455 of yacc.c  */
 
1983
#line 465 "../../lib/graph/parser.y"
1893
1984
    { anonsubg(); }
1894
1985
    break;
1895
1986
 
1896
1987
  case 60:
1897
 
#line 461 "../../lib/graph/parser.y"
 
1988
 
 
1989
/* Line 1455 of yacc.c  */
 
1990
#line 465 "../../lib/graph/parser.y"
1898
1991
    {(yyval.obj) = pop_gobj();}
1899
1992
    break;
1900
1993
 
1901
1994
  case 61:
1902
 
#line 462 "../../lib/graph/parser.y"
 
1995
 
 
1996
/* Line 1455 of yacc.c  */
 
1997
#line 466 "../../lib/graph/parser.y"
1903
1998
    { anonsubg(); }
1904
1999
    break;
1905
2000
 
1906
2001
  case 62:
1907
 
#line 462 "../../lib/graph/parser.y"
 
2002
 
 
2003
/* Line 1455 of yacc.c  */
 
2004
#line 466 "../../lib/graph/parser.y"
1908
2005
    {(yyval.obj) = pop_gobj();}
1909
2006
    break;
1910
2007
 
1911
2008
  case 63:
1912
 
#line 463 "../../lib/graph/parser.y"
 
2009
 
 
2010
/* Line 1455 of yacc.c  */
 
2011
#line 467 "../../lib/graph/parser.y"
1913
2012
    {subgraph_warn(); (yyval.obj) = pop_gobj();}
1914
2013
    break;
1915
2014
 
1916
2015
  case 64:
1917
 
#line 467 "../../lib/graph/parser.y"
 
2016
 
 
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)); 
1925
2026
    break;
1926
2027
 
1927
2028
  case 65:
1928
 
#line 476 "../../lib/graph/parser.y"
 
2029
 
 
2030
/* Line 1455 of yacc.c  */
 
2031
#line 480 "../../lib/graph/parser.y"
1929
2032
    {(yyval.str) = (yyvsp[(1) - (1)].str); }
1930
2033
    break;
1931
2034
 
1932
2035
  case 66:
1933
 
#line 477 "../../lib/graph/parser.y"
 
2036
 
 
2037
/* Line 1455 of yacc.c  */
 
2038
#line 481 "../../lib/graph/parser.y"
1934
2039
    {(yyval.str) = (yyvsp[(1) - (1)].str); }
1935
2040
    break;
1936
2041
 
1937
2042
  case 67:
1938
 
#line 480 "../../lib/graph/parser.y"
 
2043
 
 
2044
/* Line 1455 of yacc.c  */
 
2045
#line 484 "../../lib/graph/parser.y"
1939
2046
    {(yyval.str) = (yyvsp[(1) - (1)].str); }
1940
2047
    break;
1941
2048
 
1942
2049
  case 68:
1943
 
#line 481 "../../lib/graph/parser.y"
 
2050
 
 
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));}
1945
2054
    break;
1946
2055
 
1947
2056
 
1948
 
/* Line 1267 of yacc.c.  */
1949
 
#line 1950 "y.tab.c"
 
2057
 
 
2058
/* Line 1455 of yacc.c  */
 
2059
#line 2060 "y.tab.c"
1950
2060
      default: break;
1951
2061
    }
1952
2062
  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1957
2067
 
1958
2068
  *++yyvsp = yyval;
1959
2069
 
1960
 
 
1961
2070
  /* Now `shift' the result of the reduction.  Determine what state
1962
2071
     that goes to, based on the state we popped back to and the rule
1963
2072
     number reduced by.  */
2022
2131
 
2023
2132
  if (yyerrstatus == 3)
2024
2133
    {
2025
 
      /* If just tried and failed to reuse look-ahead token after an
 
2134
      /* If just tried and failed to reuse lookahead token after an
2026
2135
         error, discard it.  */
2027
2136
 
2028
2137
      if (yychar <= YYEOF)
2039
2148
        }
2040
2149
    }
2041
2150
 
2042
 
  /* Else will try to reuse look-ahead token after shifting the error
 
2151
  /* Else will try to reuse lookahead token after shifting the error
2043
2152
     token.  */
2044
2153
  goto yyerrlab1;
2045
2154
 
2096
2205
      YY_STACK_PRINT (yyss, yyssp);
2097
2206
    }
2098
2207
 
2099
 
  if (yyn == YYFINAL)
2100
 
    YYACCEPT;
2101
 
 
2102
2208
  *++yyvsp = yylval;
2103
2209
 
2104
2210
 
2123
2229
  yyresult = 1;
2124
2230
  goto yyreturn;
2125
2231
 
2126
 
#ifndef yyoverflow
 
2232
#if !defined(yyoverflow) || YYERROR_VERBOSE
2127
2233
/*-------------------------------------------------.
2128
2234
| yyexhaustedlab -- memory exhaustion comes here.  |
2129
2235
`-------------------------------------------------*/
2134
2240
#endif
2135
2241
 
2136
2242
yyreturn:
2137
 
  if (yychar != YYEOF && yychar != YYEMPTY)
 
2243
  if (yychar != YYEMPTY)
2138
2244
     yydestruct ("Cleanup: discarding lookahead",
2139
2245
                 yytoken, &yylval);
2140
2246
  /* Do not reclaim the symbols of the rule which action triggered
2160
2266
}
2161
2267
 
2162
2268
 
2163
 
#line 483 "../../lib/graph/parser.y"
 
2269
 
 
2270
/* Line 1675 of yacc.c  */
 
2271
#line 487 "../../lib/graph/parser.y"
2164
2272
 
2165
2273
#ifdef UNUSED
2166
2274
/* grammar allowing port variants */