Graphviz  2.35.20130930.0449
y.tab.c
Go to the documentation of this file.
1 /* A Bison parser, made by GNU Bison 2.6.1. */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2012 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 "2.6.1"
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 
63 
64 /* Copy the first part of user declarations. */
65 /* Line 336 of yacc.c */
66 #line 14 "../../lib/graph/parser.y"
67 
68 
69 #include "libgraph.h"
70 
71 #ifdef DMALLOC
72 #include "dmalloc.h"
73 #endif
74 
75 static char *Port;
76 static char In_decl,In_edge_stmt;
77 static int Current_class,Agraph_type;
78 static Agsym_t *headsubsym;
79 static Agsym_t *tailsubsym;
80 static Agraph_t *G;
81 static Agnode_t *N;
82 static Agedge_t *E;
83 static objstack_t *SP;
84 #define GSTACK_SIZE 64
85 static Agraph_t *Gstack[GSTACK_SIZE];
86 static int GSP;
87 
88 static void subgraph_warn (void)
89 {
90  agerr (AGWARN, "The use of \"subgraph %s\", line %d, without a body is deprecated.\n",
91  G->name, aglinenumber());
92  agerr (AGPREV, "This may cause unexpected behavior or crash the program.\n");
93  agerr (AGPREV, "Please use a single definition of the subgraph within the context of its parent graph \"%s\"\n", Gstack[GSP-2]->name);
94 }
95 
96 static int push_subg(Agraph_t *g)
97 {
98  if (GSP >= GSTACK_SIZE) {
99  agerr (AGERR, "Gstack overflow in graph parser\n"); return(1);
100  }
101  G = Gstack[GSP++] = g;
102  return 0;
103 }
104 
105 static Agraph_t *pop_subg(void)
106 {
107  Agraph_t *g;
108  if (GSP == 0) {
109  agerr (AGERR, "Gstack underflow in graph parser\n"); return(NULL);
110  }
111  g = Gstack[--GSP]; /* graph being popped off */
112  if (GSP > 0) G = Gstack[GSP - 1]; /* current graph */
113  else G = 0;
114  return g;
115 }
116 
117 static objport_t pop_gobj(void)
118 {
119  objport_t rv;
120  rv.obj = pop_subg();
121  rv.port = NULL;
122  return rv;
123 }
124 
125 static void anonname(char* buf)
126 {
127  static int anon_id = 0;
128 
129  sprintf(buf,"_anonymous_%d",anon_id++);
130 }
131 
132 static int begin_graph(char *name)
133 {
134  Agraph_t *g;
135  char buf[SMALLBUF];
136 
137  if (!name) {
138  anonname(buf);
139  name = buf;
140  }
141  g = AG.parsed_g = agopen(name,Agraph_type);
142  Current_class = TAG_GRAPH;
143  headsubsym = tailsubsym = NULL;
144  if (push_subg(g)) return 1;
145  In_decl = TRUE;
146  return 0;
147 }
148 
149 static Agraph_t* end_graph(void)
150 {
151  return (pop_subg());
152 }
153 
154 static Agnode_t *bind_node(char *name)
155 {
156  Agnode_t *n = agnode(G,name);
157  In_decl = FALSE;
158  return n;
159 }
160 
161 static int anonsubg(void)
162 {
163  char buf[SMALLBUF];
164  Agraph_t *subg;
165 
166  In_decl = FALSE;
167  anonname(buf);
168  subg = agsubg(G,buf);
169  if (push_subg(subg)) return 1;
170  else return 0;
171 }
172 
173 #if 0 /* NOT USED */
174 static int isanonsubg(Agraph_t *g)
175 {
176  return (strncmp("_anonymous_",g->name,11) == 0);
177 }
178 #endif
179 
180 static void begin_edgestmt(objport_t objp)
181 {
182  struct objstack_t *new_sp;
183 
184  new_sp = NEW(objstack_t);
185  new_sp->link = SP;
186  SP = new_sp;
187  SP->list = SP->last = NEW(objlist_t);
188  SP->list->data = objp;
189  SP->list->link = NULL;
190  SP->in_edge_stmt = In_edge_stmt;
191  SP->subg = G;
192  agpushproto(G);
193  In_edge_stmt = TRUE;
194 }
195 
196 static void mid_edgestmt(objport_t objp)
197 {
198  SP->last->link = NEW(objlist_t);
199  SP->last = SP->last->link;
200  SP->last->data = objp;
201  SP->last->link = NULL;
202 }
203 
204 static int end_edgestmt(void)
205 {
206  objstack_t *old_SP;
207  objlist_t *tailptr,*headptr,*freeptr;
208  Agraph_t *t_graph,*h_graph;
209  Agnode_t *t_node,*h_node,*t_first,*h_first;
210  Agedge_t *e;
211  char *tport,*hport;
212 
213  for (tailptr = SP->list; tailptr->link; tailptr = tailptr->link) {
214  headptr = tailptr->link;
215  tport = tailptr->data.port;
216  hport = headptr->data.port;
217  if (TAG_OF(tailptr->data.obj) == TAG_NODE) {
218  t_graph = NULL;
219  t_first = (Agnode_t*)(tailptr->data.obj);
220  }
221  else {
222  t_graph = (Agraph_t*)(tailptr->data.obj);
223  t_first = agfstnode(t_graph);
224  }
225  if (TAG_OF(headptr->data.obj) == TAG_NODE) {
226  h_graph = NULL;
227  h_first = (Agnode_t*)(headptr->data.obj);
228  }
229  else {
230  h_graph = (Agraph_t*)(headptr->data.obj);
231  h_first = agfstnode(h_graph);
232  }
233 
234  for (t_node = t_first; t_node; t_node = t_graph ?
235  agnxtnode(t_graph,t_node) : NULL) {
236  for (h_node = h_first; h_node; h_node = h_graph ?
237  agnxtnode(h_graph,h_node) : NULL ) {
238  e = agedge(G,t_node,h_node);
239  if (e) {
240  char *tp = tport;
241  char *hp = hport;
242  if ((e->tail != e->head) && (e->head == t_node)) {
243  /* could happen with an undirected edge */
244  char *temp;
245  temp = tp; tp = hp; hp = temp;
246  }
247  if (tp && tp[0]) {
248  agxset(e,TAILX,tp);
249  agstrfree(tp);
250  }
251  if (hp && hp[0]) {
252  agxset(e,HEADX,hp);
253  agstrfree(hp);
254  }
255  }
256  }
257  }
258  }
259  tailptr = SP->list;
260  while (tailptr) {
261  freeptr = tailptr;
262  tailptr = tailptr->link;
263  if (TAG_OF(freeptr->data.obj) == TAG_NODE)
264  free(freeptr);
265  }
266  if (G != SP->subg) return 1;
267  agpopproto(G);
268  In_edge_stmt = SP->in_edge_stmt;
269  old_SP = SP;
270  SP = SP->link;
271  In_decl = FALSE;
272  free(old_SP);
273  Current_class = TAG_GRAPH;
274  return 0;
275 }
276 
277 #if 0 /* NOT USED */
278 static Agraph_t *parent_of(Agraph_t *g)
279 {
280  Agraph_t *rv;
282  return rv;
283 }
284 #endif
285 
286 static void attr_set(char *name, char *value)
287 {
288  Agsym_t *ap = NULL;
289  char *defval = "";
290 
291  if (In_decl && (G->root == G)) defval = value;
292  switch (Current_class) {
293  case TAG_NODE:
294  ap = agfindattr(G->proto->n,name);
295  if (ap == NULL)
296  ap = agnodeattr(AG.parsed_g,name,defval);
297  else if (ap->fixed && In_decl)
298  return;
299  agxset(N,ap->index,value);
300  break;
301  case TAG_EDGE:
302  ap = agfindattr(G->proto->e,name);
303  if (ap == NULL)
304  ap = agedgeattr(AG.parsed_g,name,defval);
305  else if (ap->fixed && In_decl && (G->root == G))
306  return;
307  agxset(E,ap->index,value);
308  break;
309  case 0: /* default */
310  case TAG_GRAPH:
311  ap = agfindattr(G,name);
312  if (ap == NULL)
313  ap = agraphattr(AG.parsed_g,name,defval);
314  else if (ap->fixed && In_decl)
315  return;
316  agxset(G,ap->index,value);
317  break;
318  }
319 }
320 
321 /* concat:
322  */
323 static char*
324 concat (char* s1, char* s2)
325 {
326  char* s;
327  char buf[BUFSIZ];
328  char* sym;
329  int len = strlen(s1) + strlen(s2) + 1;
330 
331  if (len <= BUFSIZ) sym = buf;
332  else sym = (char*)malloc(len);
333  strcpy(sym,s1);
334  strcat(sym,s2);
335  s = agstrdup (sym);
336  if (sym != buf) free (sym);
337  return s;
338 }
339 
340 /* concat3:
341  */
342 static char*
343 concat3 (char* s1, char* s2, char*s3)
344 {
345  char* s;
346  char buf[BUFSIZ];
347  char* sym;
348  int len = strlen(s1) + strlen(s2) + strlen(s3) + 1;
349 
350  if (len <= BUFSIZ) sym = buf;
351  else sym = (char*)malloc(len);
352  strcpy(sym,s1);
353  strcat(sym,s2);
354  strcat(sym,s3);
355  s = agstrdup (sym);
356  if (sym != buf) free (sym);
357  return s;
358 }
359 
360 
361 /* Line 336 of yacc.c */
362 #line 363 "y.tab.c"
363 
364 # ifndef YY_NULL
365 # if defined __cplusplus && 201103L <= __cplusplus
366 # define YY_NULL nullptr
367 # else
368 # define YY_NULL 0
369 # endif
370 # endif
371 
372 /* Enabling verbose error messages. */
373 #ifdef YYERROR_VERBOSE
374 # undef YYERROR_VERBOSE
375 # define YYERROR_VERBOSE 1
376 #else
377 # define YYERROR_VERBOSE 0
378 #endif
379 
380 /* In a future release of Bison, this section will be replaced
381  by #include "y.tab.h". */
382 #ifndef YY_Y_TAB_H
383 # define YY_Y_TAB_H
384 /* Enabling traces. */
385 #ifndef YYDEBUG
386 # define YYDEBUG 0
387 #endif
388 #if YYDEBUG
389 extern int yydebug;
390 #endif
391 
392 /* Tokens. */
393 #ifndef YYTOKENTYPE
394 # define YYTOKENTYPE
395  /* Put the tokens into the symbol table, so that GDB and other debuggers
396  know about them. */
397  enum yytokentype {
398  T_graph = 258,
399  T_digraph = 259,
400  T_strict = 260,
401  T_node = 261,
402  T_edge = 262,
403  T_edgeop = 263,
404  T_symbol = 264,
405  T_qsymbol = 265,
407  };
408 #endif
409 /* Tokens. */
410 #define T_graph 258
411 #define T_digraph 259
412 #define T_strict 260
413 #define T_node 261
414 #define T_edge 262
415 #define T_edgeop 263
416 #define T_symbol 264
417 #define T_qsymbol 265
418 #define T_subgraph 266
419 
420 
421 
422 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
423 typedef union YYSTYPE
424 {
425 /* Line 350 of yacc.c */
426 #line 309 "../../lib/graph/parser.y"
427 
428  int i;
429  char *str;
430  struct objport_t obj;
431  struct Agnode_t *n;
432 
433 
434 /* Line 350 of yacc.c */
435 #line 436 "y.tab.c"
436 } YYSTYPE;
437 # define YYSTYPE_IS_TRIVIAL 1
438 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
439 # define YYSTYPE_IS_DECLARED 1
440 #endif
441 
442 extern YYSTYPE yylval;
443 
444 #ifdef YYPARSE_PARAM
445 #if defined __STDC__ || defined __cplusplus
446 int yyparse (void *YYPARSE_PARAM);
447 #else
448 int yyparse ();
449 #endif
450 #else /* ! YYPARSE_PARAM */
451 #if defined __STDC__ || defined __cplusplus
452 int yyparse (void);
453 #else
454 int yyparse ();
455 #endif
456 #endif /* ! YYPARSE_PARAM */
457 
458 #endif /* !YY_Y_TAB_H */
459 
460 /* Copy the second part of user declarations. */
461 
462 /* Line 353 of yacc.c */
463 #line 464 "y.tab.c"
464 
465 #ifdef short
466 # undef short
467 #endif
468 
469 #ifdef YYTYPE_UINT8
470 typedef YYTYPE_UINT8 yytype_uint8;
471 #else
472 typedef unsigned char yytype_uint8;
473 #endif
474 
475 #ifdef YYTYPE_INT8
476 typedef YYTYPE_INT8 yytype_int8;
477 #elif (defined __STDC__ || defined __C99__FUNC__ \
478  || defined __cplusplus || defined _MSC_VER)
479 typedef signed char yytype_int8;
480 #else
481 typedef short int yytype_int8;
482 #endif
483 
484 #ifdef YYTYPE_UINT16
485 typedef YYTYPE_UINT16 yytype_uint16;
486 #else
487 typedef unsigned short int yytype_uint16;
488 #endif
489 
490 #ifdef YYTYPE_INT16
491 typedef YYTYPE_INT16 yytype_int16;
492 #else
493 typedef short int yytype_int16;
494 #endif
495 
496 #ifndef YYSIZE_T
497 # ifdef __SIZE_TYPE__
498 # define YYSIZE_T __SIZE_TYPE__
499 # elif defined size_t
500 # define YYSIZE_T size_t
501 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
502  || defined __cplusplus || defined _MSC_VER)
503 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
504 # define YYSIZE_T size_t
505 # else
506 # define YYSIZE_T unsigned int
507 # endif
508 #endif
509 
510 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
511 
512 #ifndef YY_
513 # if defined YYENABLE_NLS && YYENABLE_NLS
514 # if ENABLE_NLS
515 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
516 # define YY_(msgid) dgettext ("bison-runtime", msgid)
517 # endif
518 # endif
519 # ifndef YY_
520 # define YY_(msgid) msgid
521 # endif
522 #endif
523 
524 /* Suppress unused-variable warnings by "using" E. */
525 #if ! defined lint || defined __GNUC__
526 # define YYUSE(e) ((void) (e))
527 #else
528 # define YYUSE(e) /* empty */
529 #endif
530 
531 /* Identity function, used to suppress warnings about constant conditions. */
532 #ifndef lint
533 # define YYID(n) (n)
534 #else
535 #if (defined __STDC__ || defined __C99__FUNC__ \
536  || defined __cplusplus || defined _MSC_VER)
537 static int
538 YYID (int yyi)
539 #else
540 static int
541 YYID (yyi)
542  int yyi;
543 #endif
544 {
545  return yyi;
546 }
547 #endif
548 
549 #if ! defined yyoverflow || YYERROR_VERBOSE
550 
551 /* The parser invokes alloca or malloc; define the necessary symbols. */
552 
553 # ifdef YYSTACK_USE_ALLOCA
554 # if YYSTACK_USE_ALLOCA
555 # ifdef __GNUC__
556 # define YYSTACK_ALLOC __builtin_alloca
557 # elif defined __BUILTIN_VA_ARG_INCR
558 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
559 # elif defined _AIX
560 # define YYSTACK_ALLOC __alloca
561 # elif defined _MSC_VER
562 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
563 # define alloca _alloca
564 # else
565 # define YYSTACK_ALLOC alloca
566 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
567  || defined __cplusplus || defined _MSC_VER)
568 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
569  /* Use EXIT_SUCCESS as a witness for stdlib.h. */
570 # ifndef EXIT_SUCCESS
571 # define EXIT_SUCCESS 0
572 # endif
573 # endif
574 # endif
575 # endif
576 # endif
577 
578 # ifdef YYSTACK_ALLOC
579  /* Pacify GCC's `empty if-body' warning. */
580 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
581 # ifndef YYSTACK_ALLOC_MAXIMUM
582  /* The OS might guarantee only one guard page at the bottom of the stack,
583  and a page size can be as small as 4096 bytes. So we cannot safely
584  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
585  to allow for a few compiler-allocated temporary stack slots. */
586 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
587 # endif
588 # else
589 # define YYSTACK_ALLOC YYMALLOC
590 # define YYSTACK_FREE YYFREE
591 # ifndef YYSTACK_ALLOC_MAXIMUM
592 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
593 # endif
594 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
595  && ! ((defined YYMALLOC || defined malloc) \
596  && (defined YYFREE || defined free)))
597 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
598 # ifndef EXIT_SUCCESS
599 # define EXIT_SUCCESS 0
600 # endif
601 # endif
602 # ifndef YYMALLOC
603 # define YYMALLOC malloc
604 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
605  || defined __cplusplus || defined _MSC_VER)
606 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
607 # endif
608 # endif
609 # ifndef YYFREE
610 # define YYFREE free
611 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
612  || defined __cplusplus || defined _MSC_VER)
613 void free (void *); /* INFRINGES ON USER NAME SPACE */
614 # endif
615 # endif
616 # endif
617 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
618 
619 
620 #if (! defined yyoverflow \
621  && (! defined __cplusplus \
622  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
623 
624 /* A type that is properly aligned for any stack member. */
625 union yyalloc
626 {
627  yytype_int16 yyss_alloc;
629 };
630 
631 /* The size of the maximum gap between one aligned stack and the next. */
632 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
633 
634 /* The size of an array large to enough to hold all stacks, each with
635  N elements. */
636 # define YYSTACK_BYTES(N) \
637  ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
638  + YYSTACK_GAP_MAXIMUM)
639 
640 # define YYCOPY_NEEDED 1
641 
642 /* Relocate STACK from its old location to the new one. The
643  local variables YYSIZE and YYSTACKSIZE give the old and new number of
644  elements in the stack, and YYPTR gives the new location of the
645  stack. Advance YYPTR to a properly aligned location for the next
646  stack. */
647 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
648  do \
649  { \
650  YYSIZE_T yynewbytes; \
651  YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
652  Stack = &yyptr->Stack_alloc; \
653  yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
654  yyptr += yynewbytes / sizeof (*yyptr); \
655  } \
656  while (YYID (0))
657 
658 #endif
659 
660 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
661 /* Copy COUNT objects from SRC to DST. The source and destination do
662  not overlap. */
663 # ifndef YYCOPY
664 # if defined __GNUC__ && 1 < __GNUC__
665 # define YYCOPY(Dst, Src, Count) \
666  __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
667 # else
668 # define YYCOPY(Dst, Src, Count) \
669  do \
670  { \
671  YYSIZE_T yyi; \
672  for (yyi = 0; yyi < (Count); yyi++) \
673  (Dst)[yyi] = (Src)[yyi]; \
674  } \
675  while (YYID (0))
676 # endif
677 # endif
678 #endif /* !YYCOPY_NEEDED */
679 
680 /* YYFINAL -- State number of the termination state. */
681 #define YYFINAL 9
682 /* YYLAST -- Last index in YYTABLE. */
683 #define YYLAST 80
684 
685 /* YYNTOKENS -- Number of terminals. */
686 #define YYNTOKENS 21
687 /* YYNNTS -- Number of nonterminals. */
688 #define YYNNTS 37
689 /* YYNRULES -- Number of rules. */
690 #define YYNRULES 68
691 /* YYNRULES -- Number of states. */
692 #define YYNSTATES 90
693 
694 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
695 #define YYUNDEFTOK 2
696 #define YYMAXUTOK 266
697 
698 #define YYTRANSLATE(YYX) \
699  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
700 
701 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
702 static const yytype_uint8 yytranslate[] =
703 {
704  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
705  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
706  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
707  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
708  2, 2, 2, 20, 14, 2, 2, 2, 2, 2,
709  2, 2, 2, 2, 2, 2, 2, 2, 19, 18,
710  2, 17, 2, 2, 2, 2, 2, 2, 2, 2,
711  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
712  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
713  2, 15, 2, 16, 2, 2, 2, 2, 2, 2,
714  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
715  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
716  2, 2, 2, 12, 2, 13, 2, 2, 2, 2,
717  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
718  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
719  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
720  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
721  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
722  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
723  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
724  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
725  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
726  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
727  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
728  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
729  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
730  5, 6, 7, 8, 9, 10, 11
731 };
732 
733 #if YYDEBUG
734 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
735  YYRHS. */
736 static const yytype_uint8 yyprhs[] =
737 {
738  0, 0, 3, 4, 11, 13, 14, 16, 17, 19,
739  22, 24, 27, 29, 31, 33, 37, 38, 39, 41,
740  45, 48, 49, 51, 55, 57, 59, 61, 62, 64,
741  67, 69, 72, 74, 76, 78, 80, 82, 85, 87,
742  90, 92, 93, 96, 101, 102, 106, 107, 108, 114,
743  115, 116, 122, 125, 126, 131, 134, 135, 140, 145,
744  146, 152, 153, 158, 160, 163, 165, 167, 169
745 };
746 
747 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
748 static const yytype_int8 yyrhs[] =
749 {
750  22, 0, -1, -1, 25, 24, 23, 12, 34, 13,
751  -1, 1, -1, -1, 56, -1, -1, 3, -1, 5,
752  3, -1, 4, -1, 5, 4, -1, 3, -1, 6,
753  -1, 7, -1, 33, 28, 27, -1, -1, -1, 14,
754  -1, 15, 27, 16, -1, 30, 29, -1, -1, 30,
755  -1, 56, 17, 56, -1, 32, -1, 56, -1, 35,
756  -1, -1, 36, -1, 35, 36, -1, 37, -1, 37,
757  18, -1, 1, -1, 42, -1, 44, -1, 38, -1,
758  52, -1, 26, 29, -1, 32, -1, 40, 41, -1,
759  56, -1, -1, 19, 56, -1, 19, 56, 19, 56,
760  -1, -1, 39, 43, 31, -1, -1, -1, 39, 45,
761  49, 46, 31, -1, -1, -1, 52, 47, 49, 48,
762  31, -1, 8, 39, -1, -1, 8, 39, 50, 49,
763  -1, 8, 52, -1, -1, 8, 52, 51, 49, -1,
764  55, 12, 34, 13, -1, -1, 11, 12, 53, 34,
765  13, -1, -1, 12, 54, 34, 13, -1, 55, -1,
766  11, 56, -1, 9, -1, 57, -1, 10, -1, 57,
767  20, 10, -1
768 };
769 
770 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
771 static const yytype_uint16 yyrline[] =
772 {
773  0, 327, 327, 326, 330, 336, 339, 339, 342, 344,
774  346, 348, 352, 354, 356, 360, 361, 364, 365, 368,
775  371, 372, 375, 378, 382, 383, 387, 388, 391, 392,
776  395, 396, 397, 400, 401, 402, 403, 406, 408, 412,
777  422, 425, 426, 427, 431, 430, 437, 439, 436, 444,
778  446, 443, 452, 454, 453, 456, 459, 458, 464, 465,
779  465, 466, 466, 467, 470, 480, 481, 484, 485
780 };
781 #endif
782 
783 #if YYDEBUG || YYERROR_VERBOSE || 0
784 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
785  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
786 static const char *const yytname[] =
787 {
788  "$end", "error", "$undefined", "T_graph", "T_digraph", "T_strict",
789  "T_node", "T_edge", "T_edgeop", "T_symbol", "T_qsymbol", "T_subgraph",
790  "'{'", "'}'", "','", "'['", "']'", "'='", "';'", "':'", "'+'", "$accept",
791  "file", "$@1", "optgraphname", "graph_type", "attr_class",
792  "inside_attr_list", "optcomma", "attr_list", "rec_attr_list",
793  "opt_attr_list", "attr_set", "iattr_set", "stmt_list", "stmt_list1",
794  "stmt", "stmt1", "attr_stmt", "node_id", "node_name", "node_port",
795  "node_stmt", "$@2", "edge_stmt", "$@3", "$@4", "$@5", "$@6", "edgeRHS",
796  "$@7", "$@8", "subg_stmt", "$@9", "$@10", "subg_hdr", "symbol",
797  "qsymbol", YY_NULL
798 };
799 #endif
800 
801 # ifdef YYPRINT
802 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
803  token YYLEX-NUM. */
804 static const yytype_uint16 yytoknum[] =
805 {
806  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
807  265, 266, 123, 125, 44, 91, 93, 61, 59, 58,
808  43
809 };
810 # endif
811 
812 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
813 static const yytype_uint8 yyr1[] =
814 {
815  0, 21, 23, 22, 22, 22, 24, 24, 25, 25,
816  25, 25, 26, 26, 26, 27, 27, 28, 28, 29,
817  30, 30, 31, 32, 33, 33, 34, 34, 35, 35,
818  36, 36, 36, 37, 37, 37, 37, 38, 38, 39,
819  40, 41, 41, 41, 43, 42, 45, 46, 44, 47,
820  48, 44, 49, 50, 49, 49, 51, 49, 52, 53,
821  52, 54, 52, 52, 55, 56, 56, 57, 57
822 };
823 
824 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
825 static const yytype_uint8 yyr2[] =
826 {
827  0, 2, 0, 6, 1, 0, 1, 0, 1, 2,
828  1, 2, 1, 1, 1, 3, 0, 0, 1, 3,
829  2, 0, 1, 3, 1, 1, 1, 0, 1, 2,
830  1, 2, 1, 1, 1, 1, 1, 2, 1, 2,
831  1, 0, 2, 4, 0, 3, 0, 0, 5, 0,
832  0, 5, 2, 0, 4, 2, 0, 4, 4, 0,
833  5, 0, 4, 1, 2, 1, 1, 1, 3
834 };
835 
836 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
837  Performed when YYTABLE doesn't specify something else to do. Zero
838  means the default is an error. */
839 static const yytype_uint8 yydefact[] =
840 {
841  0, 4, 8, 10, 0, 0, 7, 9, 11, 1,
842  65, 67, 2, 6, 66, 0, 0, 0, 68, 32,
843  12, 13, 14, 0, 61, 0, 38, 0, 0, 28,
844  30, 35, 44, 41, 33, 34, 36, 63, 40, 59,
845  64, 0, 16, 37, 3, 29, 31, 21, 0, 0,
846  39, 0, 0, 0, 0, 0, 0, 24, 17, 25,
847  22, 45, 0, 47, 42, 50, 0, 23, 0, 62,
848  19, 18, 16, 20, 52, 55, 40, 21, 0, 21,
849  58, 60, 15, 0, 0, 48, 43, 51, 54, 57
850 };
851 
852 /* YYDEFGOTO[NTERM-NUM]. */
853 static const yytype_int8 yydefgoto[] =
854 {
855  -1, 5, 15, 12, 6, 25, 56, 72, 43, 60,
856  61, 26, 58, 27, 28, 29, 30, 31, 32, 33,
857  50, 34, 47, 35, 48, 77, 51, 79, 63, 83,
858  84, 36, 54, 41, 37, 38, 14
859 };
860 
861 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
862  STATE-NUM. */
863 #define YYPACT_NINF -68
864 static const yytype_int8 yypact[] =
865 {
866  4, -68, -68, -68, 27, 6, 44, -68, -68, -68,
867  -68, -68, -68, -68, -9, 8, 25, 12, -68, -68,
868  -68, -68, -68, 29, -68, 22, -68, 31, 39, -68,
869  37, -68, 49, 40, -68, -68, 50, 48, 45, -68,
870  -68, 12, 44, -68, -68, -68, -68, -68, 53, 44,
871  -68, 53, 12, 44, 12, 51, 47, -68, 54, 45,
872  22, -68, 17, -68, 46, -68, 56, -68, 57, -68,
873  -68, -68, 44, -68, 59, 63, -68, -68, 44, -68,
874  -68, -68, -68, 53, 53, -68, -68, -68, -68, -68
875 };
876 
877 /* YYPGOTO[NTERM-NUM]. */
878 static const yytype_int8 yypgoto[] =
879 {
880  -68, -68, -68, -68, -68, -68, 1, -68, 14, -68,
881  -67, -40, -68, -38, -68, 52, -68, -68, 13, -68,
882  -68, -68, -68, -68, -68, -68, -68, -68, -50, -68,
883  -68, 15, -68, -68, -68, -6, -68
884 };
885 
886 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
887  positive, shift that token. If negative, reduce the rule which
888  number is the opposite. If YYTABLE_NINF, syntax error. */
889 #define YYTABLE_NINF -57
890 static const yytype_int8 yytable[] =
891 {
892  13, 65, 57, 55, -5, 1, 9, 2, 3, 4,
893  85, 16, 87, 19, 66, 20, 68, 40, 21, 22,
894  17, 10, 11, 23, 24, -27, 10, 11, 23, 24,
895  7, 8, 57, 88, 89, 18, 59, 42, 10, 11,
896  19, 39, 20, 64, 44, 21, 22, 67, 10, 11,
897  23, 24, -26, 10, 11, 46, 76, -46, -49, 49,
898  52, 62, 53, 70, 69, 78, 59, -53, 71, 80,
899  81, -56, 86, 82, 73, 74, 0, 75, 0, 0,
900  45
901 };
902 
903 #define yypact_value_is_default(yystate) \
904  ((yystate) == (-68))
905 
906 #define yytable_value_is_error(yytable_value) \
907  YYID (0)
908 
909 static const yytype_int8 yycheck[] =
910 {
911  6, 51, 42, 41, 0, 1, 0, 3, 4, 5,
912  77, 20, 79, 1, 52, 3, 54, 23, 6, 7,
913  12, 9, 10, 11, 12, 13, 9, 10, 11, 12,
914  3, 4, 72, 83, 84, 10, 42, 15, 9, 10,
915  1, 12, 3, 49, 13, 6, 7, 53, 9, 10,
916  11, 12, 13, 9, 10, 18, 62, 8, 8, 19,
917  12, 8, 17, 16, 13, 19, 72, 8, 14, 13,
918  13, 8, 78, 72, 60, 62, -1, 62, -1, -1,
919  28
920 };
921 
922 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
923  symbol of state STATE-NUM. */
924 static const yytype_uint8 yystos[] =
925 {
926  0, 1, 3, 4, 5, 22, 25, 3, 4, 0,
927  9, 10, 24, 56, 57, 23, 20, 12, 10, 1,
928  3, 6, 7, 11, 12, 26, 32, 34, 35, 36,
929  37, 38, 39, 40, 42, 44, 52, 55, 56, 12,
930  56, 54, 15, 29, 13, 36, 18, 43, 45, 19,
931  41, 47, 12, 17, 53, 34, 27, 32, 33, 56,
932  30, 31, 8, 49, 56, 49, 34, 56, 34, 13,
933  16, 14, 28, 29, 39, 52, 56, 46, 19, 48,
934  13, 13, 27, 50, 51, 31, 56, 31, 49, 49
935 };
936 
937 #define yyerrok (yyerrstatus = 0)
938 #define yyclearin (yychar = YYEMPTY)
939 #define YYEMPTY (-2)
940 #define YYEOF 0
941 
942 #define YYACCEPT goto yyacceptlab
943 #define YYABORT goto yyabortlab
944 #define YYERROR goto yyerrorlab
945 
946 
947 /* Like YYERROR except do call yyerror. This remains here temporarily
948  to ease the transition to the new meaning of YYERROR, for GCC.
949  Once GCC version 2 has supplanted version 1, this can go. However,
950  YYFAIL appears to be in use. Nevertheless, it is formally deprecated
951  in Bison 2.4.2's NEWS entry, where a plan to phase it out is
952  discussed. */
953 
954 #define YYFAIL goto yyerrlab
955 #if defined YYFAIL
956  /* This is here to suppress warnings from the GCC cpp's
957  -Wunused-macros. Normally we don't worry about that warning, but
958  some users do, and we want to make it easy for users to remove
959  YYFAIL uses, which will produce warnings from Bison 2.5. */
960 #endif
961 
962 #define YYRECOVERING() (!!yyerrstatus)
963 
964 #define YYBACKUP(Token, Value) \
965 do \
966  if (yychar == YYEMPTY) \
967  { \
968  yychar = (Token); \
969  yylval = (Value); \
970  YYPOPSTACK (yylen); \
971  yystate = *yyssp; \
972  goto yybackup; \
973  } \
974  else \
975  { \
976  yyerror (YY_("syntax error: cannot back up")); \
977  YYERROR; \
978  } \
979 while (YYID (0))
980 
981 
982 #define YYTERROR 1
983 #define YYERRCODE 256
984 
985 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
986  If N is 0, then set CURRENT to the empty location which ends
987  the previous symbol: RHS[0] (always defined). */
988 
989 #ifndef YYLLOC_DEFAULT
990 # define YYLLOC_DEFAULT(Current, Rhs, N) \
991  do \
992  if (YYID (N)) \
993  { \
994  (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
995  (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
996  (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
997  (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
998  } \
999  else \
1000  { \
1001  (Current).first_line = (Current).last_line = \
1002  YYRHSLOC (Rhs, 0).last_line; \
1003  (Current).first_column = (Current).last_column = \
1004  YYRHSLOC (Rhs, 0).last_column; \
1005  } \
1006  while (YYID (0))
1007 #endif
1008 
1009 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1010 
1011 
1012 
1013 /* This macro is provided for backward compatibility. */
1014 
1015 #ifndef YY_LOCATION_PRINT
1016 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1017 #endif
1018 
1019 
1020 /* YYLEX -- calling `yylex' with the right arguments. */
1021 
1022 #ifdef YYLEX_PARAM
1023 # define YYLEX yylex (YYLEX_PARAM)
1024 #else
1025 # define YYLEX yylex ()
1026 #endif
1027 
1028 /* Enable debugging if requested. */
1029 #if YYDEBUG
1030 
1031 # ifndef YYFPRINTF
1032 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1033 # define YYFPRINTF fprintf
1034 # endif
1035 
1036 # define YYDPRINTF(Args) \
1037 do { \
1038  if (yydebug) \
1039  YYFPRINTF Args; \
1040 } while (YYID (0))
1041 
1042 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1043 do { \
1044  if (yydebug) \
1045  { \
1046  YYFPRINTF (stderr, "%s ", Title); \
1047  yy_symbol_print (stderr, \
1048  Type, Value); \
1049  YYFPRINTF (stderr, "\n"); \
1050  } \
1051 } while (YYID (0))
1052 
1053 
1054 /*--------------------------------.
1055 | Print this symbol on YYOUTPUT. |
1056 `--------------------------------*/
1057 
1058 /*ARGSUSED*/
1059 #if (defined __STDC__ || defined __C99__FUNC__ \
1060  || defined __cplusplus || defined _MSC_VER)
1061 static void
1062 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1063 #else
1064 static void
1065 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
1066  FILE *yyoutput;
1067  int yytype;
1068  YYSTYPE const * const yyvaluep;
1069 #endif
1070 {
1071  FILE *yyo = yyoutput;
1072  YYUSE (yyo);
1073  if (!yyvaluep)
1074  return;
1075 # ifdef YYPRINT
1076  if (yytype < YYNTOKENS)
1077  YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1078 # else
1079  YYUSE (yyoutput);
1080 # endif
1081  switch (yytype)
1082  {
1083  default:
1084  break;
1085  }
1086 }
1087 
1088 
1089 /*--------------------------------.
1090 | Print this symbol on YYOUTPUT. |
1091 `--------------------------------*/
1092 
1093 #if (defined __STDC__ || defined __C99__FUNC__ \
1094  || defined __cplusplus || defined _MSC_VER)
1095 static void
1096 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1097 #else
1098 static void
1099 yy_symbol_print (yyoutput, yytype, yyvaluep)
1100  FILE *yyoutput;
1101  int yytype;
1102  YYSTYPE const * const yyvaluep;
1103 #endif
1104 {
1105  if (yytype < YYNTOKENS)
1106  YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1107  else
1108  YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1109 
1110  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1111  YYFPRINTF (yyoutput, ")");
1112 }
1113 
1114 /*------------------------------------------------------------------.
1115 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1116 | TOP (included). |
1117 `------------------------------------------------------------------*/
1118 
1119 #if (defined __STDC__ || defined __C99__FUNC__ \
1120  || defined __cplusplus || defined _MSC_VER)
1121 static void
1122 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1123 #else
1124 static void
1125 yy_stack_print (yybottom, yytop)
1126  yytype_int16 *yybottom;
1127  yytype_int16 *yytop;
1128 #endif
1129 {
1130  YYFPRINTF (stderr, "Stack now");
1131  for (; yybottom <= yytop; yybottom++)
1132  {
1133  int yybot = *yybottom;
1134  YYFPRINTF (stderr, " %d", yybot);
1135  }
1136  YYFPRINTF (stderr, "\n");
1137 }
1138 
1139 # define YY_STACK_PRINT(Bottom, Top) \
1140 do { \
1141  if (yydebug) \
1142  yy_stack_print ((Bottom), (Top)); \
1143 } while (YYID (0))
1144 
1145 
1146 /*------------------------------------------------.
1147 | Report that the YYRULE is going to be reduced. |
1148 `------------------------------------------------*/
1149 
1150 #if (defined __STDC__ || defined __C99__FUNC__ \
1151  || defined __cplusplus || defined _MSC_VER)
1152 static void
1153 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1154 #else
1155 static void
1156 yy_reduce_print (yyvsp, yyrule)
1157  YYSTYPE *yyvsp;
1158  int yyrule;
1159 #endif
1160 {
1161  int yynrhs = yyr2[yyrule];
1162  int yyi;
1163  unsigned long int yylno = yyrline[yyrule];
1164  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1165  yyrule - 1, yylno);
1166  /* The symbols being reduced. */
1167  for (yyi = 0; yyi < yynrhs; yyi++)
1168  {
1169  YYFPRINTF (stderr, " $%d = ", yyi + 1);
1170  yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1171  &(yyvsp[(yyi + 1) - (yynrhs)])
1172  );
1173  YYFPRINTF (stderr, "\n");
1174  }
1175 }
1176 
1177 # define YY_REDUCE_PRINT(Rule) \
1178 do { \
1179  if (yydebug) \
1180  yy_reduce_print (yyvsp, Rule); \
1181 } while (YYID (0))
1182 
1183 /* Nonzero means print parse trace. It is left uninitialized so that
1184  multiple parsers can coexist. */
1185 int yydebug;
1186 #else /* !YYDEBUG */
1187 # define YYDPRINTF(Args)
1188 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1189 # define YY_STACK_PRINT(Bottom, Top)
1190 # define YY_REDUCE_PRINT(Rule)
1191 #endif /* !YYDEBUG */
1192 
1193 
1194 /* YYINITDEPTH -- initial size of the parser's stacks. */
1195 #ifndef YYINITDEPTH
1196 # define YYINITDEPTH 200
1197 #endif
1198 
1199 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1200  if the built-in stack extension method is used).
1201 
1202  Do not make this value too large; the results are undefined if
1203  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1204  evaluated with infinite-precision integer arithmetic. */
1205 
1206 #ifndef YYMAXDEPTH
1207 # define YYMAXDEPTH 10000
1208 #endif
1209 
1210 
1211 #if YYERROR_VERBOSE
1212 
1213 # ifndef yystrlen
1214 # if defined __GLIBC__ && defined _STRING_H
1215 # define yystrlen strlen
1216 # else
1217 /* Return the length of YYSTR. */
1218 #if (defined __STDC__ || defined __C99__FUNC__ \
1219  || defined __cplusplus || defined _MSC_VER)
1220 static YYSIZE_T
1221 yystrlen (const char *yystr)
1222 #else
1223 static YYSIZE_T
1224 yystrlen (yystr)
1225  const char *yystr;
1226 #endif
1227 {
1228  YYSIZE_T yylen;
1229  for (yylen = 0; yystr[yylen]; yylen++)
1230  continue;
1231  return yylen;
1232 }
1233 # endif
1234 # endif
1235 
1236 # ifndef yystpcpy
1237 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1238 # define yystpcpy stpcpy
1239 # else
1240 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1241  YYDEST. */
1242 #if (defined __STDC__ || defined __C99__FUNC__ \
1243  || defined __cplusplus || defined _MSC_VER)
1244 static char *
1245 yystpcpy (char *yydest, const char *yysrc)
1246 #else
1247 static char *
1248 yystpcpy (yydest, yysrc)
1249  char *yydest;
1250  const char *yysrc;
1251 #endif
1252 {
1253  char *yyd = yydest;
1254  const char *yys = yysrc;
1255 
1256  while ((*yyd++ = *yys++) != '\0')
1257  continue;
1258 
1259  return yyd - 1;
1260 }
1261 # endif
1262 # endif
1263 
1264 # ifndef yytnamerr
1265 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1266  quotes and backslashes, so that it's suitable for yyerror. The
1267  heuristic is that double-quoting is unnecessary unless the string
1268  contains an apostrophe, a comma, or backslash (other than
1269  backslash-backslash). YYSTR is taken from yytname. If YYRES is
1270  null, do not copy; instead, return the length of what the result
1271  would have been. */
1272 static YYSIZE_T
1273 yytnamerr (char *yyres, const char *yystr)
1274 {
1275  if (*yystr == '"')
1276  {
1277  YYSIZE_T yyn = 0;
1278  char const *yyp = yystr;
1279 
1280  for (;;)
1281  switch (*++yyp)
1282  {
1283  case '\'':
1284  case ',':
1285  goto do_not_strip_quotes;
1286 
1287  case '\\':
1288  if (*++yyp != '\\')
1289  goto do_not_strip_quotes;
1290  /* Fall through. */
1291  default:
1292  if (yyres)
1293  yyres[yyn] = *yyp;
1294  yyn++;
1295  break;
1296 
1297  case '"':
1298  if (yyres)
1299  yyres[yyn] = '\0';
1300  return yyn;
1301  }
1302  do_not_strip_quotes: ;
1303  }
1304 
1305  if (! yyres)
1306  return yystrlen (yystr);
1307 
1308  return yystpcpy (yyres, yystr) - yyres;
1309 }
1310 # endif
1311 
1312 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1313  about the unexpected token YYTOKEN for the state stack whose top is
1314  YYSSP.
1315 
1316  Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1317  not large enough to hold the message. In that case, also set
1318  *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1319  required number of bytes is too large to store. */
1320 static int
1321 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1322  yytype_int16 *yyssp, int yytoken)
1323 {
1324  YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
1325  YYSIZE_T yysize = yysize0;
1326  YYSIZE_T yysize1;
1327  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1328  /* Internationalized format string. */
1329  const char *yyformat = YY_NULL;
1330  /* Arguments of yyformat. */
1331  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1332  /* Number of reported tokens (one for the "unexpected", one per
1333  "expected"). */
1334  int yycount = 0;
1335 
1336  /* There are many possibilities here to consider:
1337  - Assume YYFAIL is not used. It's too flawed to consider. See
1338  <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1339  for details. YYERROR is fine as it does not invoke this
1340  function.
1341  - If this state is a consistent state with a default action, then
1342  the only way this function was invoked is if the default action
1343  is an error action. In that case, don't check for expected
1344  tokens because there are none.
1345  - The only way there can be no lookahead present (in yychar) is if
1346  this state is a consistent state with a default action. Thus,
1347  detecting the absence of a lookahead is sufficient to determine
1348  that there is no unexpected or expected token to report. In that
1349  case, just report a simple "syntax error".
1350  - Don't assume there isn't a lookahead just because this state is a
1351  consistent state with a default action. There might have been a
1352  previous inconsistent state, consistent state with a non-default
1353  action, or user semantic action that manipulated yychar.
1354  - Of course, the expected token list depends on states to have
1355  correct lookahead information, and it depends on the parser not
1356  to perform extra reductions after fetching a lookahead from the
1357  scanner and before detecting a syntax error. Thus, state merging
1358  (from LALR or IELR) and default reductions corrupt the expected
1359  token list. However, the list is correct for canonical LR with
1360  one exception: it will still contain any token that will not be
1361  accepted due to an error action in a later state.
1362  */
1363  if (yytoken != YYEMPTY)
1364  {
1365  int yyn = yypact[*yyssp];
1366  yyarg[yycount++] = yytname[yytoken];
1367  if (!yypact_value_is_default (yyn))
1368  {
1369  /* Start YYX at -YYN if negative to avoid negative indexes in
1370  YYCHECK. In other words, skip the first -YYN actions for
1371  this state because they are default actions. */
1372  int yyxbegin = yyn < 0 ? -yyn : 0;
1373  /* Stay within bounds of both yycheck and yytname. */
1374  int yychecklim = YYLAST - yyn + 1;
1375  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1376  int yyx;
1377 
1378  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1379  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1380  && !yytable_value_is_error (yytable[yyx + yyn]))
1381  {
1382  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1383  {
1384  yycount = 1;
1385  yysize = yysize0;
1386  break;
1387  }
1388  yyarg[yycount++] = yytname[yyx];
1389  yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1390  if (! (yysize <= yysize1
1391  && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1392  return 2;
1393  yysize = yysize1;
1394  }
1395  }
1396  }
1397 
1398  switch (yycount)
1399  {
1400 # define YYCASE_(N, S) \
1401  case N: \
1402  yyformat = S; \
1403  break
1404  YYCASE_(0, YY_("syntax error"));
1405  YYCASE_(1, YY_("syntax error, unexpected %s"));
1406  YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1407  YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1408  YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1409  YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1410 # undef YYCASE_
1411  }
1412 
1413  yysize1 = yysize + yystrlen (yyformat);
1414  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1415  return 2;
1416  yysize = yysize1;
1417 
1418  if (*yymsg_alloc < yysize)
1419  {
1420  *yymsg_alloc = 2 * yysize;
1421  if (! (yysize <= *yymsg_alloc
1422  && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1423  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1424  return 1;
1425  }
1426 
1427  /* Avoid sprintf, as that infringes on the user's name space.
1428  Don't have undefined behavior even if the translation
1429  produced a string with the wrong number of "%s"s. */
1430  {
1431  char *yyp = *yymsg;
1432  int yyi = 0;
1433  while ((*yyp = *yyformat) != '\0')
1434  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1435  {
1436  yyp += yytnamerr (yyp, yyarg[yyi++]);
1437  yyformat += 2;
1438  }
1439  else
1440  {
1441  yyp++;
1442  yyformat++;
1443  }
1444  }
1445  return 0;
1446 }
1447 #endif /* YYERROR_VERBOSE */
1448 
1449 /*-----------------------------------------------.
1450 | Release the memory associated to this symbol. |
1451 `-----------------------------------------------*/
1452 
1453 /*ARGSUSED*/
1454 #if (defined __STDC__ || defined __C99__FUNC__ \
1455  || defined __cplusplus || defined _MSC_VER)
1456 static void
1457 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1458 #else
1459 static void
1460 yydestruct (yymsg, yytype, yyvaluep)
1461  const char *yymsg;
1462  int yytype;
1463  YYSTYPE *yyvaluep;
1464 #endif
1465 {
1466  YYUSE (yyvaluep);
1467 
1468  if (!yymsg)
1469  yymsg = "Deleting";
1470  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1471 
1472  switch (yytype)
1473  {
1474 
1475  default:
1476  break;
1477  }
1478 }
1479 
1480 
1481 
1482 
1483 /* The lookahead symbol. */
1485 
1486 /* The semantic value of the lookahead symbol. */
1488 
1489 /* Number of syntax errors so far. */
1491 
1492 
1493 /*----------.
1494 | yyparse. |
1495 `----------*/
1496 
1497 #ifdef YYPARSE_PARAM
1498 #if (defined __STDC__ || defined __C99__FUNC__ \
1499  || defined __cplusplus || defined _MSC_VER)
1500 int
1501 yyparse (void *YYPARSE_PARAM)
1502 #else
1503 int
1504 yyparse (YYPARSE_PARAM)
1505  void *YYPARSE_PARAM;
1506 #endif
1507 #else /* ! YYPARSE_PARAM */
1508 #if (defined __STDC__ || defined __C99__FUNC__ \
1509  || defined __cplusplus || defined _MSC_VER)
1510 int
1511 yyparse (void)
1512 #else
1513 int
1514 yyparse ()
1515 
1516 #endif
1517 #endif
1518 {
1519  int yystate;
1520  /* Number of tokens to shift before error messages enabled. */
1521  int yyerrstatus;
1522 
1523  /* The stacks and their tools:
1524  `yyss': related to states.
1525  `yyvs': related to semantic values.
1526 
1527  Refer to the stacks through separate pointers, to allow yyoverflow
1528  to reallocate them elsewhere. */
1529 
1530  /* The state stack. */
1531  yytype_int16 yyssa[YYINITDEPTH];
1532  yytype_int16 *yyss;
1533  yytype_int16 *yyssp;
1534 
1535  /* The semantic value stack. */
1536  YYSTYPE yyvsa[YYINITDEPTH];
1537  YYSTYPE *yyvs;
1538  YYSTYPE *yyvsp;
1539 
1540  YYSIZE_T yystacksize;
1541 
1542  int yyn;
1543  int yyresult;
1544  /* Lookahead token as an internal (translated) token number. */
1545  int yytoken;
1546  /* The variables used to return semantic value and location from the
1547  action routines. */
1548  YYSTYPE yyval;
1549 
1550 #if YYERROR_VERBOSE
1551  /* Buffer for error messages, and its allocated size. */
1552  char yymsgbuf[128];
1553  char *yymsg = yymsgbuf;
1554  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1555 #endif
1556 
1557 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1558 
1559  /* The number of symbols on the RHS of the reduced rule.
1560  Keep to zero when no symbol should be popped. */
1561  int yylen = 0;
1562 
1563  yytoken = 0;
1564  yyss = yyssa;
1565  yyvs = yyvsa;
1566  yystacksize = YYINITDEPTH;
1567 
1568  YYDPRINTF ((stderr, "Starting parse\n"));
1569 
1570  yystate = 0;
1571  yyerrstatus = 0;
1572  yynerrs = 0;
1573  yychar = YYEMPTY; /* Cause a token to be read. */
1574 
1575  /* Initialize stack pointers.
1576  Waste one element of value and location stack
1577  so that they stay on the same level as the state stack.
1578  The wasted elements are never initialized. */
1579  yyssp = yyss;
1580  yyvsp = yyvs;
1581  goto yysetstate;
1582 
1583 /*------------------------------------------------------------.
1584 | yynewstate -- Push a new state, which is found in yystate. |
1585 `------------------------------------------------------------*/
1586  yynewstate:
1587  /* In all cases, when you get here, the value and location stacks
1588  have just been pushed. So pushing a state here evens the stacks. */
1589  yyssp++;
1590 
1591  yysetstate:
1592  *yyssp = yystate;
1593 
1594  if (yyss + yystacksize - 1 <= yyssp)
1595  {
1596  /* Get the current used size of the three stacks, in elements. */
1597  YYSIZE_T yysize = yyssp - yyss + 1;
1598 
1599 #ifdef yyoverflow
1600  {
1601  /* Give user a chance to reallocate the stack. Use copies of
1602  these so that the &'s don't force the real ones into
1603  memory. */
1604  YYSTYPE *yyvs1 = yyvs;
1605  yytype_int16 *yyss1 = yyss;
1606 
1607  /* Each stack pointer address is followed by the size of the
1608  data in use in that stack, in bytes. This used to be a
1609  conditional around just the two extra args, but that might
1610  be undefined if yyoverflow is a macro. */
1611  yyoverflow (YY_("memory exhausted"),
1612  &yyss1, yysize * sizeof (*yyssp),
1613  &yyvs1, yysize * sizeof (*yyvsp),
1614  &yystacksize);
1615 
1616  yyss = yyss1;
1617  yyvs = yyvs1;
1618  }
1619 #else /* no yyoverflow */
1620 # ifndef YYSTACK_RELOCATE
1621  goto yyexhaustedlab;
1622 # else
1623  /* Extend the stack our own way. */
1624  if (YYMAXDEPTH <= yystacksize)
1625  goto yyexhaustedlab;
1626  yystacksize *= 2;
1627  if (YYMAXDEPTH < yystacksize)
1628  yystacksize = YYMAXDEPTH;
1629 
1630  {
1631  yytype_int16 *yyss1 = yyss;
1632  union yyalloc *yyptr =
1633  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1634  if (! yyptr)
1635  goto yyexhaustedlab;
1636  YYSTACK_RELOCATE (yyss_alloc, yyss);
1637  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1638 # undef YYSTACK_RELOCATE
1639  if (yyss1 != yyssa)
1640  YYSTACK_FREE (yyss1);
1641  }
1642 # endif
1643 #endif /* no yyoverflow */
1644 
1645  yyssp = yyss + yysize - 1;
1646  yyvsp = yyvs + yysize - 1;
1647 
1648  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1649  (unsigned long int) yystacksize));
1650 
1651  if (yyss + yystacksize - 1 <= yyssp)
1652  YYABORT;
1653  }
1654 
1655  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1656 
1657  if (yystate == YYFINAL)
1658  YYACCEPT;
1659 
1660  goto yybackup;
1661 
1662 /*-----------.
1663 | yybackup. |
1664 `-----------*/
1665 yybackup:
1666 
1667  /* Do appropriate processing given the current state. Read a
1668  lookahead token if we need one and don't already have one. */
1669 
1670  /* First try to decide what to do without reference to lookahead token. */
1671  yyn = yypact[yystate];
1672  if (yypact_value_is_default (yyn))
1673  goto yydefault;
1674 
1675  /* Not known => get a lookahead token if don't already have one. */
1676 
1677  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1678  if (yychar == YYEMPTY)
1679  {
1680  YYDPRINTF ((stderr, "Reading a token: "));
1681  yychar = YYLEX;
1682  }
1683 
1684  if (yychar <= YYEOF)
1685  {
1686  yychar = yytoken = YYEOF;
1687  YYDPRINTF ((stderr, "Now at end of input.\n"));
1688  }
1689  else
1690  {
1691  yytoken = YYTRANSLATE (yychar);
1692  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1693  }
1694 
1695  /* If the proper action on seeing token YYTOKEN is to reduce or to
1696  detect an error, take that action. */
1697  yyn += yytoken;
1698  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1699  goto yydefault;
1700  yyn = yytable[yyn];
1701  if (yyn <= 0)
1702  {
1703  if (yytable_value_is_error (yyn))
1704  goto yyerrlab;
1705  yyn = -yyn;
1706  goto yyreduce;
1707  }
1708 
1709  /* Count tokens shifted since error; after three, turn off error
1710  status. */
1711  if (yyerrstatus)
1712  yyerrstatus--;
1713 
1714  /* Shift the lookahead token. */
1715  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1716 
1717  /* Discard the shifted token. */
1718  yychar = YYEMPTY;
1719 
1720  yystate = yyn;
1721  *++yyvsp = yylval;
1722 
1723  goto yynewstate;
1724 
1725 
1726 /*-----------------------------------------------------------.
1727 | yydefault -- do the default action for the current state. |
1728 `-----------------------------------------------------------*/
1729 yydefault:
1730  yyn = yydefact[yystate];
1731  if (yyn == 0)
1732  goto yyerrlab;
1733  goto yyreduce;
1734 
1735 
1736 /*-----------------------------.
1737 | yyreduce -- Do a reduction. |
1738 `-----------------------------*/
1739 yyreduce:
1740  /* yyn is the number of a rule to reduce with. */
1741  yylen = yyr2[yyn];
1742 
1743  /* If YYLEN is nonzero, implement the default value of the action:
1744  `$$ = $1'.
1745 
1746  Otherwise, the following line sets YYVAL to garbage.
1747  This behavior is undocumented and Bison
1748  users should not rely upon it. Assigning to YYVAL
1749  unconditionally makes the parser a bit smaller, and it avoids a
1750  GCC warning that YYVAL may be used uninitialized. */
1751  yyval = yyvsp[1-yylen];
1752 
1753 
1754  YY_REDUCE_PRINT (yyn);
1755  switch (yyn)
1756  {
1757  case 2:
1758 /* Line 1787 of yacc.c */
1759 #line 327 "../../lib/graph/parser.y"
1760  {if (begin_graph((yyvsp[(2) - (2)].str))) YYABORT; agstrfree((yyvsp[(2) - (2)].str));}
1761  break;
1762 
1763  case 3:
1764 /* Line 1787 of yacc.c */
1765 #line 329 "../../lib/graph/parser.y"
1766  {AG.accepting_state = TRUE; if (!end_graph()) YYABORT;}
1767  break;
1768 
1769  case 4:
1770 /* Line 1787 of yacc.c */
1771 #line 331 "../../lib/graph/parser.y"
1772  {
1773  if (AG.parsed_g)
1774  agclose(AG.parsed_g);
1775  AG.parsed_g = NULL;
1776  }
1777  break;
1778 
1779  case 5:
1780 /* Line 1787 of yacc.c */
1781 #line 336 "../../lib/graph/parser.y"
1782  {AG.parsed_g = NULL;}
1783  break;
1784 
1785  case 6:
1786 /* Line 1787 of yacc.c */
1787 #line 339 "../../lib/graph/parser.y"
1788  {(yyval.str)=(yyvsp[(1) - (1)].str);}
1789  break;
1790 
1791  case 7:
1792 /* Line 1787 of yacc.c */
1793 #line 339 "../../lib/graph/parser.y"
1794  {(yyval.str)=0;}
1795  break;
1796 
1797  case 8:
1798 /* Line 1787 of yacc.c */
1799 #line 343 "../../lib/graph/parser.y"
1800  {Agraph_type = AGRAPH; AG.edge_op = "--";}
1801  break;
1802 
1803  case 9:
1804 /* Line 1787 of yacc.c */
1805 #line 345 "../../lib/graph/parser.y"
1806  {Agraph_type = AGRAPHSTRICT; AG.edge_op = "--";}
1807  break;
1808 
1809  case 10:
1810 /* Line 1787 of yacc.c */
1811 #line 347 "../../lib/graph/parser.y"
1812  {Agraph_type = AGDIGRAPH; AG.edge_op = "->";}
1813  break;
1814 
1815  case 11:
1816 /* Line 1787 of yacc.c */
1817 #line 349 "../../lib/graph/parser.y"
1818  {Agraph_type = AGDIGRAPHSTRICT; AG.edge_op = "->";}
1819  break;
1820 
1821  case 12:
1822 /* Line 1787 of yacc.c */
1823 #line 353 "../../lib/graph/parser.y"
1824  {Current_class = TAG_GRAPH;}
1825  break;
1826 
1827  case 13:
1828 /* Line 1787 of yacc.c */
1829 #line 355 "../../lib/graph/parser.y"
1830  {Current_class = TAG_NODE; N = G->proto->n;}
1831  break;
1832 
1833  case 14:
1834 /* Line 1787 of yacc.c */
1835 #line 357 "../../lib/graph/parser.y"
1836  {Current_class = TAG_EDGE; E = G->proto->e;}
1837  break;
1838 
1839  case 23:
1840 /* Line 1787 of yacc.c */
1841 #line 379 "../../lib/graph/parser.y"
1842  {attr_set((yyvsp[(1) - (3)].str),(yyvsp[(3) - (3)].str)); agstrfree((yyvsp[(1) - (3)].str)); agstrfree((yyvsp[(3) - (3)].str));}
1843  break;
1844 
1845  case 25:
1846 /* Line 1787 of yacc.c */
1847 #line 384 "../../lib/graph/parser.y"
1848  {attr_set((yyvsp[(1) - (1)].str),"true"); agstrfree((yyvsp[(1) - (1)].str)); }
1849  break;
1850 
1851  case 32:
1852 /* Line 1787 of yacc.c */
1853 #line 397 "../../lib/graph/parser.y"
1854  {agerror("syntax error, statement skipped");}
1855  break;
1856 
1857  case 36:
1858 /* Line 1787 of yacc.c */
1859 #line 403 "../../lib/graph/parser.y"
1860  {}
1861  break;
1862 
1863  case 37:
1864 /* Line 1787 of yacc.c */
1865 #line 407 "../../lib/graph/parser.y"
1866  {Current_class = TAG_GRAPH; /* reset */}
1867  break;
1868 
1869  case 38:
1870 /* Line 1787 of yacc.c */
1871 #line 409 "../../lib/graph/parser.y"
1872  {Current_class = TAG_GRAPH;}
1873  break;
1874 
1875  case 39:
1876 /* Line 1787 of yacc.c */
1877 #line 413 "../../lib/graph/parser.y"
1878  {
1879  objport_t rv;
1880  rv.obj = (yyvsp[(1) - (2)].n);
1881  rv.port = Port;
1882  Port = NULL;
1883  (yyval.obj) = rv;
1884  }
1885  break;
1886 
1887  case 40:
1888 /* Line 1787 of yacc.c */
1889 #line 422 "../../lib/graph/parser.y"
1890  {(yyval.n) = bind_node((yyvsp[(1) - (1)].str)); agstrfree((yyvsp[(1) - (1)].str));}
1891  break;
1892 
1893  case 42:
1894 /* Line 1787 of yacc.c */
1895 #line 426 "../../lib/graph/parser.y"
1896  { Port=(yyvsp[(2) - (2)].str);}
1897  break;
1898 
1899  case 43:
1900 /* Line 1787 of yacc.c */
1901 #line 427 "../../lib/graph/parser.y"
1902  {Port=concat3((yyvsp[(2) - (4)].str),":",(yyvsp[(4) - (4)].str));agstrfree((yyvsp[(2) - (4)].str)); agstrfree((yyvsp[(4) - (4)].str));}
1903  break;
1904 
1905  case 44:
1906 /* Line 1787 of yacc.c */
1907 #line 431 "../../lib/graph/parser.y"
1908  {Current_class = TAG_NODE; N = (Agnode_t*)((yyvsp[(1) - (1)].obj).obj);}
1909  break;
1910 
1911  case 45:
1912 /* Line 1787 of yacc.c */
1913 #line 433 "../../lib/graph/parser.y"
1914  {agstrfree((yyvsp[(1) - (3)].obj).port);Current_class = TAG_GRAPH; /* reset */}
1915  break;
1916 
1917  case 46:
1918 /* Line 1787 of yacc.c */
1919 #line 437 "../../lib/graph/parser.y"
1920  {begin_edgestmt((yyvsp[(1) - (1)].obj));}
1921  break;
1922 
1923  case 47:
1924 /* Line 1787 of yacc.c */
1925 #line 439 "../../lib/graph/parser.y"
1926  { E = SP->subg->proto->e;
1927  Current_class = TAG_EDGE; }
1928  break;
1929 
1930  case 48:
1931 /* Line 1787 of yacc.c */
1932 #line 442 "../../lib/graph/parser.y"
1933  {if(end_edgestmt()) YYABORT;}
1934  break;
1935 
1936  case 49:
1937 /* Line 1787 of yacc.c */
1938 #line 444 "../../lib/graph/parser.y"
1939  {begin_edgestmt((yyvsp[(1) - (1)].obj));}
1940  break;
1941 
1942  case 50:
1943 /* Line 1787 of yacc.c */
1944 #line 446 "../../lib/graph/parser.y"
1945  { E = SP->subg->proto->e;
1946  Current_class = TAG_EDGE; }
1947  break;
1948 
1949  case 51:
1950 /* Line 1787 of yacc.c */
1951 #line 449 "../../lib/graph/parser.y"
1952  {if(end_edgestmt()) YYABORT;}
1953  break;
1954 
1955  case 52:
1956 /* Line 1787 of yacc.c */
1957 #line 452 "../../lib/graph/parser.y"
1958  {mid_edgestmt((yyvsp[(2) - (2)].obj));}
1959  break;
1960 
1961  case 53:
1962 /* Line 1787 of yacc.c */
1963 #line 454 "../../lib/graph/parser.y"
1964  {mid_edgestmt((yyvsp[(2) - (2)].obj));}
1965  break;
1966 
1967  case 55:
1968 /* Line 1787 of yacc.c */
1969 #line 457 "../../lib/graph/parser.y"
1970  {mid_edgestmt((yyvsp[(2) - (2)].obj));}
1971  break;
1972 
1973  case 56:
1974 /* Line 1787 of yacc.c */
1975 #line 459 "../../lib/graph/parser.y"
1976  {mid_edgestmt((yyvsp[(2) - (2)].obj));}
1977  break;
1978 
1979  case 58:
1980 /* Line 1787 of yacc.c */
1981 #line 464 "../../lib/graph/parser.y"
1982  {(yyval.obj) = pop_gobj(); if (!(yyval.obj).obj) YYABORT;}
1983  break;
1984 
1985  case 59:
1986 /* Line 1787 of yacc.c */
1987 #line 465 "../../lib/graph/parser.y"
1988  { if(anonsubg()) YYABORT; }
1989  break;
1990 
1991  case 60:
1992 /* Line 1787 of yacc.c */
1993 #line 465 "../../lib/graph/parser.y"
1994  {(yyval.obj) = pop_gobj(); if (!(yyval.obj).obj) YYABORT;}
1995  break;
1996 
1997  case 61:
1998 /* Line 1787 of yacc.c */
1999 #line 466 "../../lib/graph/parser.y"
2000  { if(anonsubg()) YYABORT; }
2001  break;
2002 
2003  case 62:
2004 /* Line 1787 of yacc.c */
2005 #line 466 "../../lib/graph/parser.y"
2006  {(yyval.obj) = pop_gobj(); if (!(yyval.obj).obj) YYABORT;}
2007  break;
2008 
2009  case 63:
2010 /* Line 1787 of yacc.c */
2011 #line 467 "../../lib/graph/parser.y"
2012  {subgraph_warn(); (yyval.obj) = pop_gobj(); if (!(yyval.obj).obj) YYABORT;}
2013  break;
2014 
2015  case 64:
2016 /* Line 1787 of yacc.c */
2017 #line 471 "../../lib/graph/parser.y"
2018  { Agraph_t *subg;
2019  if ((subg = agfindsubg(AG.parsed_g,(yyvsp[(2) - (2)].str)))) aginsert(G,subg);
2020  else subg = agsubg(G,(yyvsp[(2) - (2)].str));
2021  push_subg(subg);
2022  In_decl = FALSE;
2023  agstrfree((yyvsp[(2) - (2)].str));
2024  }
2025  break;
2026 
2027  case 65:
2028 /* Line 1787 of yacc.c */
2029 #line 480 "../../lib/graph/parser.y"
2030  {(yyval.str) = (yyvsp[(1) - (1)].str); }
2031  break;
2032 
2033  case 66:
2034 /* Line 1787 of yacc.c */
2035 #line 481 "../../lib/graph/parser.y"
2036  {(yyval.str) = (yyvsp[(1) - (1)].str); }
2037  break;
2038 
2039  case 67:
2040 /* Line 1787 of yacc.c */
2041 #line 484 "../../lib/graph/parser.y"
2042  {(yyval.str) = (yyvsp[(1) - (1)].str); }
2043  break;
2044 
2045  case 68:
2046 /* Line 1787 of yacc.c */
2047 #line 485 "../../lib/graph/parser.y"
2048  {(yyval.str) = concat((yyvsp[(1) - (3)].str),(yyvsp[(3) - (3)].str)); agstrfree((yyvsp[(1) - (3)].str)); agstrfree((yyvsp[(3) - (3)].str));}
2049  break;
2050 
2051 
2052 /* Line 1787 of yacc.c */
2053 #line 2054 "y.tab.c"
2054  default: break;
2055  }
2056  /* User semantic actions sometimes alter yychar, and that requires
2057  that yytoken be updated with the new translation. We take the
2058  approach of translating immediately before every use of yytoken.
2059  One alternative is translating here after every semantic action,
2060  but that translation would be missed if the semantic action invokes
2061  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2062  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2063  incorrect destructor might then be invoked immediately. In the
2064  case of YYERROR or YYBACKUP, subsequent parser actions might lead
2065  to an incorrect destructor call or verbose syntax error message
2066  before the lookahead is translated. */
2067  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2068 
2069  YYPOPSTACK (yylen);
2070  yylen = 0;
2071  YY_STACK_PRINT (yyss, yyssp);
2072 
2073  *++yyvsp = yyval;
2074 
2075  /* Now `shift' the result of the reduction. Determine what state
2076  that goes to, based on the state we popped back to and the rule
2077  number reduced by. */
2078 
2079  yyn = yyr1[yyn];
2080 
2081  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2082  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2083  yystate = yytable[yystate];
2084  else
2085  yystate = yydefgoto[yyn - YYNTOKENS];
2086 
2087  goto yynewstate;
2088 
2089 
2090 /*------------------------------------.
2091 | yyerrlab -- here on detecting error |
2092 `------------------------------------*/
2093 yyerrlab:
2094  /* Make sure we have latest lookahead translation. See comments at
2095  user semantic actions for why this is necessary. */
2096  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2097 
2098  /* If not already recovering from an error, report this error. */
2099  if (!yyerrstatus)
2100  {
2101  ++yynerrs;
2102 #if ! YYERROR_VERBOSE
2103  yyerror (YY_("syntax error"));
2104 #else
2105 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2106  yyssp, yytoken)
2107  {
2108  char const *yymsgp = YY_("syntax error");
2109  int yysyntax_error_status;
2110  yysyntax_error_status = YYSYNTAX_ERROR;
2111  if (yysyntax_error_status == 0)
2112  yymsgp = yymsg;
2113  else if (yysyntax_error_status == 1)
2114  {
2115  if (yymsg != yymsgbuf)
2116  YYSTACK_FREE (yymsg);
2117  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2118  if (!yymsg)
2119  {
2120  yymsg = yymsgbuf;
2121  yymsg_alloc = sizeof yymsgbuf;
2122  yysyntax_error_status = 2;
2123  }
2124  else
2125  {
2126  yysyntax_error_status = YYSYNTAX_ERROR;
2127  yymsgp = yymsg;
2128  }
2129  }
2130  yyerror (yymsgp);
2131  if (yysyntax_error_status == 2)
2132  goto yyexhaustedlab;
2133  }
2134 # undef YYSYNTAX_ERROR
2135 #endif
2136  }
2137 
2138 
2139 
2140  if (yyerrstatus == 3)
2141  {
2142  /* If just tried and failed to reuse lookahead token after an
2143  error, discard it. */
2144 
2145  if (yychar <= YYEOF)
2146  {
2147  /* Return failure if at end of input. */
2148  if (yychar == YYEOF)
2149  YYABORT;
2150  }
2151  else
2152  {
2153  yydestruct ("Error: discarding",
2154  yytoken, &yylval);
2155  yychar = YYEMPTY;
2156  }
2157  }
2158 
2159  /* Else will try to reuse lookahead token after shifting the error
2160  token. */
2161  goto yyerrlab1;
2162 
2163 
2164 /*---------------------------------------------------.
2165 | yyerrorlab -- error raised explicitly by YYERROR. |
2166 `---------------------------------------------------*/
2167 yyerrorlab:
2168 
2169  /* Pacify compilers like GCC when the user code never invokes
2170  YYERROR and the label yyerrorlab therefore never appears in user
2171  code. */
2172  if (/*CONSTCOND*/ 0)
2173  goto yyerrorlab;
2174 
2175  /* Do not reclaim the symbols of the rule which action triggered
2176  this YYERROR. */
2177  YYPOPSTACK (yylen);
2178  yylen = 0;
2179  YY_STACK_PRINT (yyss, yyssp);
2180  yystate = *yyssp;
2181  goto yyerrlab1;
2182 
2183 
2184 /*-------------------------------------------------------------.
2185 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2186 `-------------------------------------------------------------*/
2187 yyerrlab1:
2188  yyerrstatus = 3; /* Each real token shifted decrements this. */
2189 
2190  for (;;)
2191  {
2192  yyn = yypact[yystate];
2193  if (!yypact_value_is_default (yyn))
2194  {
2195  yyn += YYTERROR;
2196  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2197  {
2198  yyn = yytable[yyn];
2199  if (0 < yyn)
2200  break;
2201  }
2202  }
2203 
2204  /* Pop the current state because it cannot handle the error token. */
2205  if (yyssp == yyss)
2206  YYABORT;
2207 
2208 
2209  yydestruct ("Error: popping",
2210  yystos[yystate], yyvsp);
2211  YYPOPSTACK (1);
2212  yystate = *yyssp;
2213  YY_STACK_PRINT (yyss, yyssp);
2214  }
2215 
2216  *++yyvsp = yylval;
2217 
2218 
2219  /* Shift the error token. */
2220  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2221 
2222  yystate = yyn;
2223  goto yynewstate;
2224 
2225 
2226 /*-------------------------------------.
2227 | yyacceptlab -- YYACCEPT comes here. |
2228 `-------------------------------------*/
2229 yyacceptlab:
2230  yyresult = 0;
2231  goto yyreturn;
2232 
2233 /*-----------------------------------.
2234 | yyabortlab -- YYABORT comes here. |
2235 `-----------------------------------*/
2236 yyabortlab:
2237  yyresult = 1;
2238  goto yyreturn;
2239 
2240 #if !defined yyoverflow || YYERROR_VERBOSE
2241 /*-------------------------------------------------.
2242 | yyexhaustedlab -- memory exhaustion comes here. |
2243 `-------------------------------------------------*/
2244 yyexhaustedlab:
2245  yyerror (YY_("memory exhausted"));
2246  yyresult = 2;
2247  /* Fall through. */
2248 #endif
2249 
2250 yyreturn:
2251  if (yychar != YYEMPTY)
2252  {
2253  /* Make sure we have latest lookahead translation. See comments at
2254  user semantic actions for why this is necessary. */
2255  yytoken = YYTRANSLATE (yychar);
2256  yydestruct ("Cleanup: discarding lookahead",
2257  yytoken, &yylval);
2258  }
2259  /* Do not reclaim the symbols of the rule which action triggered
2260  this YYABORT or YYACCEPT. */
2261  YYPOPSTACK (yylen);
2262  YY_STACK_PRINT (yyss, yyssp);
2263  while (yyssp != yyss)
2264  {
2265  yydestruct ("Cleanup: popping",
2266  yystos[*yyssp], yyvsp);
2267  YYPOPSTACK (1);
2268  }
2269 #ifndef yyoverflow
2270  if (yyss != yyssa)
2271  YYSTACK_FREE (yyss);
2272 #endif
2273 #if YYERROR_VERBOSE
2274  if (yymsg != yymsgbuf)
2275  YYSTACK_FREE (yymsg);
2276 #endif
2277  /* Make sure YYID is used. */
2278  return YYID (yyresult);
2279 }
2280 
2281 
2282 /* Line 2048 of yacc.c */
2283 #line 487 "../../lib/graph/parser.y"
2284 
2285 #ifdef UNUSED
2286 /* grammar allowing port variants */
2287 /* at present, these are not used, so we remove them from the grammar */
2288 /* NOTE: If used, these should be rewritten to take into account the */
2289 /* move away from using ':' in the string and that symbols come from */
2290 /* agstrdup and need to be freed. */
2291 node_port : /* empty */
2292  | port_location
2293  | port_angle /* undocumented */
2294  | port_angle port_location /* undocumented */
2295  | port_location port_angle /* undocumented */
2296  ;
2297 
2298 port_location : ':' symbol {strcat(Port,":"); strcat(Port,$2);}
2299  | ':' '(' symbol {Symbol = strdup($3);} ',' symbol ')'
2300  { char buf[SMALLBUF];
2301  sprintf(buf,":(%s,%s)",Symbol,$6);
2302  strcat(Port,buf); free(Symbol);
2303  }
2304  ;
2305 
2306 port_angle : '@' symbol
2307  { char buf[SMALLBUF];
2308  sprintf(buf,"@%s",$2);
2309  strcat(Port,buf);
2310  }
2311  ;
2312 
2313 #endif
2314