51#define YYBISON_VERSION "3.5.1"
54#define YYSKELETON_NAME "yacc.c"
66#define YYSTYPE GMLSTYPE
68#define yyparse gmlparse
70#define yyerror gmlerror
71#define yydebug gmldebug
72#define yynerrs gmlnerrs
77#line 19 "../../cmd/tools/gmlparse.y"
103static
char *
sortToStr(
unsigned short sort);
107 attrs_free(&p->attrlist);
153 attrs_t *
const lp =
gv_alloc(
sizeof(attrs_t));
209 char*
str, attrs_t* list) {
212 assert (name || sort);
221 if (list !=
NULL && attrs_is_empty(list)) {
237 if (dir < 0) dir = -1;
238 else if (dir > 0) dir = 1;
255#line 256 "gmlparse.c"
259# define YY_CAST(Type, Val) static_cast<Type> (Val)
260# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
262# define YY_CAST(Type, Val) ((Type) (Val))
263# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
267# if defined __cplusplus
268# if 201103L <= __cplusplus
269# define YY_NULLPTR nullptr
274# define YY_NULLPTR ((void*)0)
279#ifdef YYERROR_VERBOSE
280# undef YYERROR_VERBOSE
281# define YYERROR_VERBOSE 1
283# define YYERROR_VERBOSE 0
288#ifndef YY_GML_GMLPARSE_H_INCLUDED
289# define YY_GML_GMLPARSE_H_INCLUDED
358#define LABELGRAPHICS 270
362#define OUTLINESTYLE 274
363#define OUTLINEWIDTH 275
380#if ! defined GMLSTYPE && ! defined GMLSTYPE_IS_DECLARED
383#line 196 "../../cmd/tools/gmlparse.y"
392#line 393 "gmlparse.c"
396# define GMLSTYPE_IS_TRIVIAL 1
397# define GMLSTYPE_IS_DECLARED 1
417#ifndef __PTRDIFF_MAX__
419# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
430#ifdef __INT_LEAST8_MAX__
432#elif defined YY_STDINT_H
438#ifdef __INT_LEAST16_MAX__
440#elif defined YY_STDINT_H
446#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
448#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
449 && UINT_LEAST8_MAX <= INT_MAX)
451#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
457#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
459#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
460 && UINT_LEAST16_MAX <= INT_MAX)
462#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
469# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
470# define YYPTRDIFF_T __PTRDIFF_TYPE__
471# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
472# elif defined PTRDIFF_MAX
476# define YYPTRDIFF_T ptrdiff_t
477# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
479# define YYPTRDIFF_T long
480# define YYPTRDIFF_MAXIMUM LONG_MAX
486# define YYSIZE_T __SIZE_TYPE__
488# define YYSIZE_T size_t
489# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
491# define YYSIZE_T size_t
493# define YYSIZE_T unsigned
497#define YYSIZE_MAXIMUM \
498 YY_CAST (YYPTRDIFF_T, \
499 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
500 ? YYPTRDIFF_MAXIMUM \
501 : YY_CAST (YYSIZE_T, -1)))
503#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
512# if defined YYENABLE_NLS && YYENABLE_NLS
515# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
519# define YY_(Msgid) Msgid
523#ifndef YY_ATTRIBUTE_PURE
524# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
525# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
527# define YY_ATTRIBUTE_PURE
531#ifndef YY_ATTRIBUTE_UNUSED
532# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
533# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
535# define YY_ATTRIBUTE_UNUSED
540#if ! defined lint || defined __GNUC__
541# define YYUSE(E) ((void) (E))
546#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
548# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
549 _Pragma ("GCC diagnostic push") \
550 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
551 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
552# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
553 _Pragma ("GCC diagnostic pop")
555# define YY_INITIAL_VALUE(Value) Value
557#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
558# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
559# define YY_IGNORE_MAYBE_UNINITIALIZED_END
561#ifndef YY_INITIAL_VALUE
562# define YY_INITIAL_VALUE(Value)
565#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
566# define YY_IGNORE_USELESS_CAST_BEGIN \
567 _Pragma ("GCC diagnostic push") \
568 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
569# define YY_IGNORE_USELESS_CAST_END \
570 _Pragma ("GCC diagnostic pop")
572#ifndef YY_IGNORE_USELESS_CAST_BEGIN
573# define YY_IGNORE_USELESS_CAST_BEGIN
574# define YY_IGNORE_USELESS_CAST_END
578#define YY_ASSERT(E) ((void) (0 && (E)))
580#if ! defined yyoverflow || YYERROR_VERBOSE
584# ifdef YYSTACK_USE_ALLOCA
585# if YYSTACK_USE_ALLOCA
587# define YYSTACK_ALLOC __builtin_alloca
588# elif defined __BUILTIN_VA_ARG_INCR
591# define YYSTACK_ALLOC __alloca
592# elif defined _MSC_VER
594# define alloca _alloca
596# define YYSTACK_ALLOC alloca
597# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
601# define EXIT_SUCCESS 0
610# define YYSTACK_FREE(Ptr) do { ; } while (0)
611# ifndef YYSTACK_ALLOC_MAXIMUM
616# define YYSTACK_ALLOC_MAXIMUM 4032
619# define YYSTACK_ALLOC YYMALLOC
620# define YYSTACK_FREE YYFREE
621# ifndef YYSTACK_ALLOC_MAXIMUM
622# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
624# if (defined __cplusplus && ! defined EXIT_SUCCESS \
625 && ! ((defined YYMALLOC || defined malloc) \
626 && (defined YYFREE || defined free)))
629# define EXIT_SUCCESS 0
633# define YYMALLOC malloc
634# if ! defined malloc && ! defined EXIT_SUCCESS
640# if ! defined free && ! defined EXIT_SUCCESS
648#if (! defined yyoverflow \
649 && (! defined __cplusplus \
650 || (defined GMLSTYPE_IS_TRIVIAL && GMLSTYPE_IS_TRIVIAL)))
660# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
664# define YYSTACK_BYTES(N) \
665 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
666 + YYSTACK_GAP_MAXIMUM)
668# define YYCOPY_NEEDED 1
675# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
678 YYPTRDIFF_T yynewbytes; \
679 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
680 Stack = &yyptr->Stack_alloc; \
681 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
682 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
688#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
692# if defined __GNUC__ && 1 < __GNUC__
693# define YYCOPY(Dst, Src, Count) \
694 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
696# define YYCOPY(Dst, Src, Count) \
700 for (yyi = 0; yyi < (Count); yyi++) \
701 (Dst)[yyi] = (Src)[yyi]; \
728#define YYTRANSLATE(YYX) \
729 (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
735 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
736 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
737 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
738 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
739 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
740 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
741 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
742 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
743 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
744 2, 35, 2, 36, 2, 2, 2, 2, 2, 2,
745 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
746 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
747 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
748 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
749 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
750 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
751 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
752 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
753 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
754 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
755 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
756 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
757 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
758 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
759 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
760 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
761 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
762 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
763 25, 26, 27, 28, 29, 30, 31, 32, 33, 34
770 0, 219, 219, 220, 221, 224, 227, 230, 231, 234,
771 235, 238, 239, 240, 241, 248, 249, 252, 252, 255,
772 256, 259, 260, 263, 263, 266, 267, 270, 271, 272,
773 273, 276, 276, 279, 280, 283, 284, 287, 288, 289,
774 290, 291, 292, 293, 294, 295, 296, 297, 298, 299,
775 300, 301, 302, 303, 304, 305, 306, 307, 308, 309,
780#if GMLDEBUG || YYERROR_VERBOSE || 0
783static const char *
const yytname[] =
785 "$end",
"error",
"$undefined",
"GRAPH",
"NODE",
"EDGE",
"DIRECTED",
786 "SOURCE",
"TARGET",
"XVAL",
"YVAL",
"WVAL",
"HVAL",
"LABEL",
"GRAPHICS",
787 "LABELGRAPHICS",
"TYPE",
"FILL",
"OUTLINE",
"OUTLINESTYLE",
788 "OUTLINEWIDTH",
"WIDTH",
"STYLE",
"LINE",
"POINT",
"TEXT",
"FONTSIZE",
789 "FONTNAME",
"COLOR",
"INTEGER",
"REAL",
"STRING",
"ID",
"NAME",
"LIST",
790 "'['",
"']'",
"$accept",
"graph",
"hdr",
"body",
"optglist",
"glist",
791 "glistitem",
"node",
"$@1",
"nlist",
"nlistitem",
"edge",
"$@2",
"elist",
792 "elistitem",
"attrlist",
"$@3",
"optalist",
"alist",
"alistitem",
YY_NULLPTR
801 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
802 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
803 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
804 285, 286, 287, 288, 289, 91, 93
808#define YYPACT_NINF (-29)
810#define yypact_value_is_default(Yyn) \
811 ((Yyn) == YYPACT_NINF)
813#define YYTABLE_NINF (-35)
815#define yytable_value_is_error(Yyn) \
822 1, -29, -24, 0, 2, 3, 5, 11, 11, 6,
823 17, 18, 19, 22, -21, -28, 11, 11, 21, 24,
824 25, 28, 12, 54, 52, 193, -29, -29, -29, -29,
825 -29, -29, -29, -29, -29, -29, -29, -29, -29, -29,
826 -29, -29, -29, -29, -29, -29, -29, -29, -29, -29,
827 -29, -29, -29, -29, -29, -29, -29, 30, -29, 193,
828 58, -29, 51, -29, -29, 59, 60, 30, 78, 58,
829 -29, -29, -29, -29, -29, 80, 81, -29, -29, -29,
830 -29, -29, 168, 143, 90, 113, -29, -29, 91, 114,
831 115, 85, -29, -29, -29, -29, -29, -29, -29, -29,
840 0, 3, 0, 0, 0, 0, 0, 0, 0, 0,
841 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
842 0, 0, 0, 0, 0, 33, 36, 42, 41, 43,
843 44, 45, 46, 31, 47, 48, 49, 50, 51, 52,
844 53, 55, 54, 56, 57, 58, 59, 60, 62, 61,
845 63, 37, 38, 39, 40, 1, 5, 0, 35, 34,
846 8, 2, 0, 17, 23, 0, 0, 0, 0, 7,
847 10, 11, 12, 16, 32, 0, 0, 14, 15, 13,
848 6, 9, 0, 0, 0, 0, 20, 22, 0, 0,
849 0, 0, 26, 30, 21, 18, 19, 27, 28, 29,
856 -29, -29, 118, 105, -29, -29, 79, -29, -29, -29,
857 62, -29, -29, -29, 82, 23, -29, 138, -29, -25
863 -1, 23, 67, 61, 68, 69, 70, 71, 75, 85,
864 86, 72, 76, 91, 92, 34, 59, 24, 25, 26
872 58, -4, 1, 43, -34, 27, 28, 33, 41, 42,
873 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
874 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
875 29, 35, 30, 31, 22, 73, 32, 36, 44, 45,
876 46, 51, 52, 53, 73, 54, 33, 33, 37, 38,
877 39, 40, 47, 48, 55, 56, 49, 87, 93, 50,
878 87, 56, 63, 64, 65, 60, 93, 2, 3, 4,
879 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
880 15, 16, 17, 18, 19, 20, 21, 74, 77, 78,
881 66, 22, 88, 89, 2, 3, 4, 5, 6, 7,
882 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
883 18, 19, 20, 21, 80, 82, 83, 90, 22, 94,
884 97, 100, 2, 3, 4, 5, 6, 7, 8, 9,
885 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
886 20, 21, 57, 98, 99, 84, 22, 96, 81, 95,
887 88, 89, 2, 3, 4, 5, 6, 7, 8, 9,
888 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
889 20, 21, 79, 101, 0, 90, 22, 2, 3, 4,
890 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
891 15, 16, 17, 18, 19, 20, 21, 62, 0, 0,
892 84, 22, 2, 3, 4, 5, 6, 7, 8, 9,
893 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
894 20, 21, 0, 0, 0, 0, 22
899 25, 0, 1, 31, 3, 29, 30, 35, 29, 30,
900 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
901 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
902 30, 8, 30, 30, 33, 60, 31, 31, 15, 16,
903 17, 29, 30, 31, 69, 22, 35, 35, 31, 31,
904 31, 29, 31, 29, 0, 3, 31, 82, 83, 31,
905 85, 3, 4, 5, 6, 35, 91, 9, 10, 11,
906 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
907 22, 23, 24, 25, 26, 27, 28, 36, 29, 29,
908 32, 33, 7, 8, 9, 10, 11, 12, 13, 14,
909 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
910 25, 26, 27, 28, 36, 35, 35, 32, 33, 29,
911 29, 36, 9, 10, 11, 12, 13, 14, 15, 16,
912 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
913 27, 28, 24, 29, 29, 32, 33, 85, 69, 36,
914 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
915 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
916 27, 28, 67, 91, -1, 32, 33, 9, 10, 11,
917 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
918 22, 23, 24, 25, 26, 27, 28, 59, -1, -1,
919 32, 33, 9, 10, 11, 12, 13, 14, 15, 16,
920 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
921 27, 28, -1, -1, -1, -1, 33
928 0, 1, 9, 10, 11, 12, 13, 14, 15, 16,
929 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
930 27, 28, 33, 38, 54, 55, 56, 29, 30, 30,
931 30, 30, 31, 35, 52, 52, 31, 31, 31, 31,
932 29, 29, 30, 31, 52, 52, 52, 31, 29, 31,
933 31, 29, 30, 31, 52, 0, 3, 39, 56, 53,
934 35, 40, 54, 4, 5, 6, 32, 39, 41, 42,
935 43, 44, 48, 56, 36, 45, 49, 29, 29, 40,
936 36, 43, 35, 35, 32, 46, 47, 56, 7, 8,
937 32, 50, 51, 56, 29, 36, 47, 29, 29, 29,
944 0, 37, 38, 38, 38, 39, 40, 41, 41, 42,
945 42, 43, 43, 43, 43, 43, 43, 45, 44, 46,
946 46, 47, 47, 49, 48, 50, 50, 51, 51, 51,
947 51, 53, 52, 54, 54, 55, 55, 56, 56, 56,
948 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
949 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
956 0, 2, 3, 1, 0, 1, 3, 1, 0, 2,
957 1, 1, 1, 2, 2, 2, 1, 0, 5, 2,
958 1, 2, 1, 0, 5, 2, 1, 2, 2, 2,
959 1, 0, 4, 1, 0, 2, 1, 2, 2, 2,
960 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
961 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
966#define yyerrok (yyerrstatus = 0)
967#define yyclearin (yychar = YYEMPTY)
971#define YYACCEPT goto yyacceptlab
972#define YYABORT goto yyabortlab
973#define YYERROR goto yyerrorlab
976#define YYRECOVERING() (!!yyerrstatus)
978#define YYBACKUP(Token, Value) \
980 if (yychar == YYEMPTY) \
984 YYPOPSTACK (yylen); \
990 yyerror (YY_("syntax error: cannot back up")); \
1006# define YYFPRINTF fprintf
1009# define YYDPRINTF(Args) \
1016#ifndef YY_LOCATION_PRINT
1017# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1021# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1025 YYFPRINTF (stderr, "%s ", Title); \
1026 yy_symbol_print (stderr, \
1028 YYFPRINTF (stderr, "\n"); \
1038yy_symbol_value_print (FILE *yyo,
int yytype,
YYSTYPE const *
const yyvaluep)
1040 FILE *yyoutput = yyo;
1046 YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
1059yy_symbol_print (FILE *yyo,
int yytype,
YYSTYPE const *
const yyvaluep)
1061 YYFPRINTF (yyo,
"%s %s (",
1064 yy_symbol_value_print (yyo, yytype, yyvaluep);
1065 YYFPRINTF (yyo,
")");
1076 YYFPRINTF (stderr,
"Stack now");
1077 for (; yybottom <= yytop; yybottom++)
1079 int yybot = *yybottom;
1080 YYFPRINTF (stderr,
" %d", yybot);
1082 YYFPRINTF (stderr,
"\n");
1085# define YY_STACK_PRINT(Bottom, Top) \
1088 yy_stack_print ((Bottom), (Top)); \
1099 int yylno = yyrline[yyrule];
1100 int yynrhs =
yyr2[yyrule];
1102 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %d):\n",
1105 for (yyi = 0; yyi < yynrhs; yyi++)
1107 YYFPRINTF (stderr,
" $%d = ", yyi + 1);
1108 yy_symbol_print (stderr,
1109 yystos[+yyssp[yyi + 1 - yynrhs]],
1110 &yyvsp[(yyi + 1) - (yynrhs)]
1112 YYFPRINTF (stderr,
"\n");
1116# define YY_REDUCE_PRINT(Rule) \
1119 yy_reduce_print (yyssp, yyvsp, Rule); \
1126# define YYDPRINTF(Args)
1127# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1128# define YY_STACK_PRINT(Bottom, Top)
1129# define YY_REDUCE_PRINT(Rule)
1135# define YYINITDEPTH 200
1146# define YYMAXDEPTH 10000
1153# if defined __GLIBC__ && defined _STRING_H
1154# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
1158yystrlen (
const char *yystr)
1161 for (yylen = 0; yystr[yylen]; yylen++)
1169# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1170# define yystpcpy stpcpy
1175yystpcpy (
char *yydest,
const char *yysrc)
1178 const char *yys = yysrc;
1180 while ((*yyd++ = *yys++) !=
'\0')
1197yytnamerr (
char *yyres,
const char *yystr)
1202 char const *yyp = yystr;
1209 goto do_not_strip_quotes;
1213 goto do_not_strip_quotes;
1229 do_not_strip_quotes: ;
1233 return yystpcpy (yyres, yystr) - yyres;
1235 return yystrlen (yystr);
1248yysyntax_error (
YYPTRDIFF_T *yymsg_alloc,
char **yymsg,
1251 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1256 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1287 int yyn =
yypact[+*yyssp];
1290 yyarg[yycount++] =
yytname[yytoken];
1296 int yyxbegin = yyn < 0 ? -yyn : 0;
1298 int yychecklim =
YYLAST - yyn + 1;
1302 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1306 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1312 yyarg[yycount++] =
yytname[yyx];
1327# define YYCASE_(N, S) \
1332 YYCASE_(0,
YY_(
"syntax error"));
1333 YYCASE_(1,
YY_(
"syntax error, unexpected %s"));
1334 YYCASE_(2,
YY_(
"syntax error, unexpected %s, expecting %s"));
1335 YYCASE_(3,
YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1336 YYCASE_(4,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1337 YYCASE_(5,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1344 YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1;
1351 if (*yymsg_alloc < yysize)
1353 *yymsg_alloc = 2 * yysize;
1354 if (! (yysize <= *yymsg_alloc
1366 while ((*yyp = *yyformat) !=
'\0')
1367 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
1369 yyp += yytnamerr (yyp, yyarg[yyi++]);
1452 char *yymsg = yymsgbuf;
1456#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1462 yyssp = yyss = yyssa;
1463 yyvsp = yyvs = yyvsa;
1466 YYDPRINTF ((stderr,
"Starting parse\n"));
1488 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1494 if (yyss + yystacksize - 1 <= yyssp)
1495#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1496 goto yyexhaustedlab;
1502# if defined yyoverflow
1514 yyoverflow (
YY_(
"memory exhausted"),
1515 &yyss1, yysize *
YYSIZEOF (*yyssp),
1516 &yyvs1, yysize *
YYSIZEOF (*yyvsp),
1524 goto yyexhaustedlab;
1535 goto yyexhaustedlab;
1538# undef YYSTACK_RELOCATE
1544 yyssp = yyss + yysize - 1;
1545 yyvsp = yyvs + yysize - 1;
1548 YYDPRINTF ((stderr,
"Stack size increased to %ld\n",
1549 YY_CAST (
long, yystacksize)));
1552 if (yyss + yystacksize - 1 <= yyssp)
1580 YYDPRINTF ((stderr,
"Reading a token: "));
1587 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1651 yyval = yyvsp[1-yylen];
1658#line 219 "../../cmd/tools/gmlparse.y"
1660#line 1661 "gmlparse.c"
1664#line 220 "../../cmd/tools/gmlparse.y"
1666#line 1667 "gmlparse.c"
1670#line 224 "../../cmd/tools/gmlparse.y"
1672#line 1673 "gmlparse.c"
1676#line 238 "../../cmd/tools/gmlparse.y"
1677 { nodes_append(&
G->
nodelist, (yyvsp[0].np)); }
1678#line 1679 "gmlparse.c"
1682#line 239 "../../cmd/tools/gmlparse.y"
1683 { edges_append(&
G->
edgelist, (yyvsp[0].ep)); }
1684#line 1685 "gmlparse.c"
1688#line 241 "../../cmd/tools/gmlparse.y"
1691 yyerror(
"mixed directed and undirected graphs");
1696#line 1697 "gmlparse.c"
1700#line 248 "../../cmd/tools/gmlparse.y"
1702#line 1703 "gmlparse.c"
1706#line 249 "../../cmd/tools/gmlparse.y"
1707 { attrs_append(&
G->
attrlist, (yyvsp[0].ap)); }
1708#line 1709 "gmlparse.c"
1712#line 252 "../../cmd/tools/gmlparse.y"
1714#line 1715 "gmlparse.c"
1718#line 252 "../../cmd/tools/gmlparse.y"
1719 { (yyval.np) =
N;
N =
NULL; }
1720#line 1721 "gmlparse.c"
1724#line 259 "../../cmd/tools/gmlparse.y"
1725 {
N->
id = (yyvsp[0].str); }
1726#line 1727 "gmlparse.c"
1730#line 260 "../../cmd/tools/gmlparse.y"
1731 { attrs_append(&
N->
attrlist, (yyvsp[0].ap)); }
1732#line 1733 "gmlparse.c"
1736#line 263 "../../cmd/tools/gmlparse.y"
1738#line 1739 "gmlparse.c"
1742#line 263 "../../cmd/tools/gmlparse.y"
1743 { (yyval.ep) =
E;
E =
NULL; }
1744#line 1745 "gmlparse.c"
1748#line 270 "../../cmd/tools/gmlparse.y"
1749 {
E->
source = (yyvsp[0].str); }
1750#line 1751 "gmlparse.c"
1754#line 271 "../../cmd/tools/gmlparse.y"
1755 {
E->
target = (yyvsp[0].str); }
1756#line 1757 "gmlparse.c"
1760#line 272 "../../cmd/tools/gmlparse.y"
1762#line 1763 "gmlparse.c"
1766#line 273 "../../cmd/tools/gmlparse.y"
1767 { attrs_append(&
E->
attrlist, (yyvsp[0].ap)); }
1768#line 1769 "gmlparse.c"
1772#line 276 "../../cmd/tools/gmlparse.y"
1774#line 1775 "gmlparse.c"
1778#line 276 "../../cmd/tools/gmlparse.y"
1780#line 1781 "gmlparse.c"
1784#line 283 "../../cmd/tools/gmlparse.y"
1785 { attrs_append(
L, (yyvsp[0].ap)); }
1786#line 1787 "gmlparse.c"
1790#line 284 "../../cmd/tools/gmlparse.y"
1791 { attrs_append(
L, (yyvsp[0].ap)); }
1792#line 1793 "gmlparse.c"
1796#line 287 "../../cmd/tools/gmlparse.y"
1798#line 1799 "gmlparse.c"
1802#line 288 "../../cmd/tools/gmlparse.y"
1803 { (yyval.ap) =
mkAttr ((yyvsp[-1].
str), 0,
REAL, (yyvsp[0].str), 0); }
1804#line 1805 "gmlparse.c"
1808#line 289 "../../cmd/tools/gmlparse.y"
1809 { (yyval.ap) =
mkAttr ((yyvsp[-1].
str), 0,
STRING, (yyvsp[0].str), 0); }
1810#line 1811 "gmlparse.c"
1814#line 290 "../../cmd/tools/gmlparse.y"
1815 { (yyval.ap) =
mkAttr ((yyvsp[-1].
str), 0,
LIST, 0, (yyvsp[0].list)); }
1816#line 1817 "gmlparse.c"
1820#line 291 "../../cmd/tools/gmlparse.y"
1822#line 1823 "gmlparse.c"
1826#line 292 "../../cmd/tools/gmlparse.y"
1828#line 1829 "gmlparse.c"
1832#line 293 "../../cmd/tools/gmlparse.y"
1834#line 1835 "gmlparse.c"
1838#line 294 "../../cmd/tools/gmlparse.y"
1840#line 1841 "gmlparse.c"
1844#line 295 "../../cmd/tools/gmlparse.y"
1846#line 1847 "gmlparse.c"
1850#line 296 "../../cmd/tools/gmlparse.y"
1852#line 1853 "gmlparse.c"
1856#line 297 "../../cmd/tools/gmlparse.y"
1858#line 1859 "gmlparse.c"
1862#line 298 "../../cmd/tools/gmlparse.y"
1864#line 1865 "gmlparse.c"
1868#line 299 "../../cmd/tools/gmlparse.y"
1870#line 1871 "gmlparse.c"
1874#line 300 "../../cmd/tools/gmlparse.y"
1876#line 1877 "gmlparse.c"
1880#line 301 "../../cmd/tools/gmlparse.y"
1882#line 1883 "gmlparse.c"
1886#line 302 "../../cmd/tools/gmlparse.y"
1888#line 1889 "gmlparse.c"
1892#line 303 "../../cmd/tools/gmlparse.y"
1894#line 1895 "gmlparse.c"
1898#line 304 "../../cmd/tools/gmlparse.y"
1900#line 1901 "gmlparse.c"
1904#line 305 "../../cmd/tools/gmlparse.y"
1906#line 1907 "gmlparse.c"
1910#line 306 "../../cmd/tools/gmlparse.y"
1912#line 1913 "gmlparse.c"
1916#line 307 "../../cmd/tools/gmlparse.y"
1918#line 1919 "gmlparse.c"
1922#line 308 "../../cmd/tools/gmlparse.y"
1924#line 1925 "gmlparse.c"
1928#line 309 "../../cmd/tools/gmlparse.y"
1930#line 1931 "gmlparse.c"
1934#line 310 "../../cmd/tools/gmlparse.y"
1936#line 1937 "gmlparse.c"
1940#line 311 "../../cmd/tools/gmlparse.y"
1942#line 1943 "gmlparse.c"
1946#line 312 "../../cmd/tools/gmlparse.y"
1948#line 1949 "gmlparse.c"
1952#line 313 "../../cmd/tools/gmlparse.y"
1954#line 1955 "gmlparse.c"
1958#line 1959 "gmlparse.c"
1986 const int yyi =
yypgoto[yylhs] + *yyssp;
1987 yystate = (0 <= yyi && yyi <=
YYLAST &&
yycheck[yyi] == *yyssp
2007#if ! YYERROR_VERBOSE
2010# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2013 char const *yymsgp =
YY_(
"syntax error");
2014 int yysyntax_error_status;
2015 yysyntax_error_status = YYSYNTAX_ERROR;
2016 if (yysyntax_error_status == 0)
2018 else if (yysyntax_error_status == 1)
2020 if (yymsg != yymsgbuf)
2026 yymsg_alloc =
sizeof yymsgbuf;
2027 yysyntax_error_status = 2;
2031 yysyntax_error_status = YYSYNTAX_ERROR;
2036 if (yysyntax_error_status == 2)
2037 goto yyexhaustedlab;
2039# undef YYSYNTAX_ERROR
2045 if (yyerrstatus == 3)
2147#if !defined yyoverflow || YYERROR_VERBOSE
2174 while (yyssp != yyss)
2185 if (yymsg != yymsgbuf)
2190#line 316 "../../cmd/tools/gmlparse.y"
2222 for (
size_t i = 0; alist !=
NULL && i < attrs_size(alist); ++i) {
2223 gmlattr *
const ap = attrs_get(alist, i);
2252 for (
size_t i = 0; i < attrs_size(alist); ++i) {
2253 gmlattr *
const ap = attrs_get(alist, i);
2294 for (
size_t i = 0; i < attrs_size(alist); ++i) {
2295 gmlattr *
const ap = attrs_get(alist, i);
2344 for (
size_t i = 0; alist !=
NULL && i < attrs_size(alist); ++i) {
2345 gmlattr *
const ap = attrs_get(alist, i);
2354 snprintf(buf,
sizeof(buf),
"%.04f", d/72.0);
2359 snprintf(buf,
sizeof(buf),
"%.04f", d/72.0);
2403 for (
size_t i = 0; alist !=
NULL && i < attrs_size(alist); ++i) {
2404 gmlattr *
const ap = attrs_get(alist, i);
2412 fprintf (stderr,
"non-X/Y field in point attribute");
2423 for (
size_t i = 0; i < attrs_size(alist); ++i) {
2424 gmlattr *
const ap = attrs_get(alist, i);
2429 fprintf (stderr,
"non-point field in line attribute");
2440 for (
size_t i = 0; alist !=
NULL && i < attrs_size(alist); ++i) {
2441 gmlattr *
const ap = attrs_get(alist, i);
2474 for (
size_t i = 0; i < attrs_size(alist); ++i) {
2475 gmlattr *
const ap = attrs_get(alist, i);
2507 else if (
graph->directed >= 1)
2515 for (
size_t i = 0; i < nodes_size(&
graph->nodelist); ++i) {
2518 fprintf (stderr,
"node without an id attribute");
2525 for (
size_t i = 0; i < edges_size(&
graph->edgelist); ++i) {
2528 fprintf (stderr,
"edge without an source attribute");
2532 fprintf (stderr,
"node without an target attribute");
2540 for (
size_t i = 0; i < graphs_size(
graph->graphlist); ++i) {
2593 s =
"directed";
break;
2597 s =
"source";
break;
2599 s =
"target";
break;
2611 s =
"graphics";
break;
2613 s =
"labelGraphics";
break;
2619 s =
"outline";
break;
2621 s =
"outlineStyle";
break;
2623 s =
"outlineWidth";
break;
2635 s =
"fontSize";
break;
2637 s =
"fontName";
break;
2641 s =
"integer";
break;
2645 s =
"string";
break;
static void agxbfree(agxbuf *xb)
free any malloced resources
static int agxbprint(agxbuf *xb, const char *fmt,...)
Printf-style output to an agxbuf.
static void agxbclear(agxbuf *xb)
resets pointer to data
static WUR char * agxbuse(agxbuf *xb)
static size_t agxblen(const agxbuf *xb)
return number of characters currently stored
static int agxbputc(agxbuf *xb, char c)
add character to buffer
Memory allocation wrappers that exit on failure.
static char * gv_strdup(const char *original)
static void * gv_alloc(size_t size)
static NORETURN void graphviz_exit(int status)
static const char *const yytname[]
static char * sortToStr(unsigned short sort)
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
static const yytype_int8 yytranslate[]
static void addEdgeGraphics(Agedge_t *ep, attrs_t *alist, agxbuf *xb, agxbuf *unk)
static void addAttrs(Agobj_t *obj, attrs_t *alist, agxbuf *xb, agxbuf *unk)
static void deparseAttr(gmlattr *ap, agxbuf *xb)
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
static const yytype_int8 yydefact[]
#define YY_IGNORE_USELESS_CAST_END
static void addEdgeLabelGraphics(Agedge_t *ep, attrs_t *alist, agxbuf *xb, agxbuf *unk)
void free_attr(gmlattr *p)
static void free_attrs(attrs_t *a)
static const yytype_int8 yycheck[]
static void addNodeLabelGraphics(Agnode_t *np, attrs_t *alist, agxbuf *unk)
#define YY_REDUCE_PRINT(Rule)
#define YY_CAST(Type, Val)
static const yytype_int16 yypact[]
static void cleanup(void)
static Agraph_t * mkGraph(gmlgraph *graph, Agraph_t *parent, char *name, agxbuf *xb, agxbuf *unk)
static void addNodeGraphics(Agnode_t *np, attrs_t *alist, agxbuf *xb, agxbuf *unk)
static gmlnode * mkNode(void)
static int setDir(char *d)
static void addEdgePoint(Agedge_t *ep, attrs_t *alist, agxbuf *xb)
static const yytype_int16 yypgoto[]
static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep)
void free_graph(gmlgraph *p)
static gmledge * mkEdge(void)
unsigned char yytype_uint8
static void pushAlist(void)
#define YY_STACK_PRINT(Bottom, Top)
#define YYSTACK_ALLOC_MAXIMUM
#define YY_IGNORE_USELESS_CAST_BEGIN
static const yytype_int8 yyr2[]
static void addEdgePos(Agedge_t *ep, attrs_t *alist, agxbuf *xb)
static const yytype_int8 yytable[]
void free_node(gmlnode *p)
#define yytable_value_is_error(Yyn)
void free_edge(gmledge *p)
static const yytype_int8 yystos[]
static const yytype_int8 yyr1[]
static void deparseList(attrs_t *alist, agxbuf *xb)
unsigned short yytype_uint16
static const yytype_int8 yydefgoto[]
static gmlattr * mkAttr(char *name, unsigned short sort, unsigned short kind, char *str, attrs_t *list)
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
#define yypact_value_is_default(Yyn)
Agraph_t * gml_to_gv(char *name, FILE *fp, int cnt, int *errors)
static attrs_t * popAlist(void)
static int cnt(Dict_t *d, Dtlink_t **set)
int agsafeset(void *obj, char *name, const char *value, const char *def)
set an attribute’s value and default, ensuring it is declared before setting it locally
Agedge_t * agedge(Agraph_t *g, Agnode_t *t, Agnode_t *h, char *name, int createflag)
Agdesc_t Agundirected
undirected
Agraph_t * agopen(char *name, Agdesc_t desc, Agdisc_t *disc)
creates a new graph with the given name and kind
Agdesc_t Agdirected
directed
Agnode_t * agnode(Agraph_t *g, char *name, int createflag)
#define AGTYPE(obj)
returns AGRAPH, AGNODE, or AGEDGE depending on the type of the object
Agraph_t * agsubg(Agraph_t *g, char *name, int cflag)
Agraph_t * graph(char *name)
textitem scanner parser str
#define DEFINE_LIST_WITH_DTOR(name, type, dtor)
#define __INT_LEAST8_TYPE__
#define __UINT_LEAST8_TYPE__
#define __UINT_LEAST16_TYPE__
#define __INT_LEAST16_TYPE__
a generic header of Agraph_s, Agnode_s and Agedge_s
void * lp
actually an attrs_t *
void * graphlist
actually a graphs_t *