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);
152 attrs_t *
const lp =
gv_alloc(
sizeof(attrs_t));
210 char*
str, attrs_t* list) {
213 assert (name || sort);
222 if (list !=
NULL && attrs_is_empty(list)) {
238 if (dir < 0) dir = -1;
239 else if (dir > 0) dir = 1;
256#line 257 "gmlparse.c"
260# define YY_CAST(Type, Val) static_cast<Type> (Val)
261# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
263# define YY_CAST(Type, Val) ((Type) (Val))
264# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
268# if defined __cplusplus
269# if 201103L <= __cplusplus
270# define YY_NULLPTR nullptr
275# define YY_NULLPTR ((void*)0)
280#ifdef YYERROR_VERBOSE
281# undef YYERROR_VERBOSE
282# define YYERROR_VERBOSE 1
284# define YYERROR_VERBOSE 0
289#ifndef YY_GML_GMLPARSE_H_INCLUDED
290# define YY_GML_GMLPARSE_H_INCLUDED
359#define LABELGRAPHICS 270
363#define OUTLINESTYLE 274
364#define OUTLINEWIDTH 275
381#if ! defined GMLSTYPE && ! defined GMLSTYPE_IS_DECLARED
384#line 197 "../../cmd/tools/gmlparse.y"
393#line 394 "gmlparse.c"
397# define GMLSTYPE_IS_TRIVIAL 1
398# define GMLSTYPE_IS_DECLARED 1
418#ifndef __PTRDIFF_MAX__
420# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
431#ifdef __INT_LEAST8_MAX__
433#elif defined YY_STDINT_H
439#ifdef __INT_LEAST16_MAX__
441#elif defined YY_STDINT_H
447#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
449#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
450 && UINT_LEAST8_MAX <= INT_MAX)
452#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
458#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
460#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
461 && UINT_LEAST16_MAX <= INT_MAX)
463#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
470# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
471# define YYPTRDIFF_T __PTRDIFF_TYPE__
472# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
473# elif defined PTRDIFF_MAX
477# define YYPTRDIFF_T ptrdiff_t
478# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
480# define YYPTRDIFF_T long
481# define YYPTRDIFF_MAXIMUM LONG_MAX
487# define YYSIZE_T __SIZE_TYPE__
489# define YYSIZE_T size_t
490# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
492# define YYSIZE_T size_t
494# define YYSIZE_T unsigned
498#define YYSIZE_MAXIMUM \
499 YY_CAST (YYPTRDIFF_T, \
500 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
501 ? YYPTRDIFF_MAXIMUM \
502 : YY_CAST (YYSIZE_T, -1)))
504#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
513# if defined YYENABLE_NLS && YYENABLE_NLS
516# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
520# define YY_(Msgid) Msgid
524#ifndef YY_ATTRIBUTE_PURE
525# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
526# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
528# define YY_ATTRIBUTE_PURE
532#ifndef YY_ATTRIBUTE_UNUSED
533# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
534# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
536# define YY_ATTRIBUTE_UNUSED
541#if ! defined lint || defined __GNUC__
542# define YYUSE(E) ((void) (E))
547#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
549# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
550 _Pragma ("GCC diagnostic push") \
551 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
552 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
553# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
554 _Pragma ("GCC diagnostic pop")
556# define YY_INITIAL_VALUE(Value) Value
558#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
559# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
560# define YY_IGNORE_MAYBE_UNINITIALIZED_END
562#ifndef YY_INITIAL_VALUE
563# define YY_INITIAL_VALUE(Value)
566#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
567# define YY_IGNORE_USELESS_CAST_BEGIN \
568 _Pragma ("GCC diagnostic push") \
569 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
570# define YY_IGNORE_USELESS_CAST_END \
571 _Pragma ("GCC diagnostic pop")
573#ifndef YY_IGNORE_USELESS_CAST_BEGIN
574# define YY_IGNORE_USELESS_CAST_BEGIN
575# define YY_IGNORE_USELESS_CAST_END
579#define YY_ASSERT(E) ((void) (0 && (E)))
581#if ! defined yyoverflow || YYERROR_VERBOSE
585# ifdef YYSTACK_USE_ALLOCA
586# if YYSTACK_USE_ALLOCA
588# define YYSTACK_ALLOC __builtin_alloca
589# elif defined __BUILTIN_VA_ARG_INCR
592# define YYSTACK_ALLOC __alloca
593# elif defined _MSC_VER
595# define alloca _alloca
597# define YYSTACK_ALLOC alloca
598# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
602# define EXIT_SUCCESS 0
611# define YYSTACK_FREE(Ptr) do { ; } while (0)
612# ifndef YYSTACK_ALLOC_MAXIMUM
617# define YYSTACK_ALLOC_MAXIMUM 4032
620# define YYSTACK_ALLOC YYMALLOC
621# define YYSTACK_FREE YYFREE
622# ifndef YYSTACK_ALLOC_MAXIMUM
623# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
625# if (defined __cplusplus && ! defined EXIT_SUCCESS \
626 && ! ((defined YYMALLOC || defined malloc) \
627 && (defined YYFREE || defined free)))
630# define EXIT_SUCCESS 0
634# define YYMALLOC malloc
635# if ! defined malloc && ! defined EXIT_SUCCESS
641# if ! defined free && ! defined EXIT_SUCCESS
649#if (! defined yyoverflow \
650 && (! defined __cplusplus \
651 || (defined GMLSTYPE_IS_TRIVIAL && GMLSTYPE_IS_TRIVIAL)))
661# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
665# define YYSTACK_BYTES(N) \
666 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
667 + YYSTACK_GAP_MAXIMUM)
669# define YYCOPY_NEEDED 1
676# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
679 YYPTRDIFF_T yynewbytes; \
680 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
681 Stack = &yyptr->Stack_alloc; \
682 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
683 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
689#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
693# if defined __GNUC__ && 1 < __GNUC__
694# define YYCOPY(Dst, Src, Count) \
695 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
697# define YYCOPY(Dst, Src, Count) \
701 for (yyi = 0; yyi < (Count); yyi++) \
702 (Dst)[yyi] = (Src)[yyi]; \
729#define YYTRANSLATE(YYX) \
730 (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
736 0, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2,
745 2, 35, 2, 36, 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, 2, 2, 2, 2,
761 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
762 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
763 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
764 25, 26, 27, 28, 29, 30, 31, 32, 33, 34
771 0, 220, 220, 221, 222, 225, 228, 231, 232, 235,
772 236, 239, 240, 241, 242, 249, 250, 253, 253, 256,
773 257, 260, 261, 264, 264, 267, 268, 271, 272, 273,
774 274, 277, 277, 280, 281, 284, 285, 288, 289, 290,
775 291, 292, 293, 294, 295, 296, 297, 298, 299, 300,
776 301, 302, 303, 304, 305, 306, 307, 308, 309, 310,
781#if GMLDEBUG || YYERROR_VERBOSE || 0
784static const char *
const yytname[] =
786 "$end",
"error",
"$undefined",
"GRAPH",
"NODE",
"EDGE",
"DIRECTED",
787 "SOURCE",
"TARGET",
"XVAL",
"YVAL",
"WVAL",
"HVAL",
"LABEL",
"GRAPHICS",
788 "LABELGRAPHICS",
"TYPE",
"FILL",
"OUTLINE",
"OUTLINESTYLE",
789 "OUTLINEWIDTH",
"WIDTH",
"STYLE",
"LINE",
"POINT",
"TEXT",
"FONTSIZE",
790 "FONTNAME",
"COLOR",
"INTEGER",
"REAL",
"STRING",
"ID",
"NAME",
"LIST",
791 "'['",
"']'",
"$accept",
"graph",
"hdr",
"body",
"optglist",
"glist",
792 "glistitem",
"node",
"$@1",
"nlist",
"nlistitem",
"edge",
"$@2",
"elist",
793 "elistitem",
"attrlist",
"$@3",
"optalist",
"alist",
"alistitem",
YY_NULLPTR
802 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
803 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
804 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
805 285, 286, 287, 288, 289, 91, 93
809#define YYPACT_NINF (-29)
811#define yypact_value_is_default(Yyn) \
812 ((Yyn) == YYPACT_NINF)
814#define YYTABLE_NINF (-35)
816#define yytable_value_is_error(Yyn) \
823 1, -29, -24, 0, 2, 3, 5, 11, 11, 6,
824 17, 18, 19, 22, -21, -28, 11, 11, 21, 24,
825 25, 28, 12, 54, 52, 193, -29, -29, -29, -29,
826 -29, -29, -29, -29, -29, -29, -29, -29, -29, -29,
827 -29, -29, -29, -29, -29, -29, -29, -29, -29, -29,
828 -29, -29, -29, -29, -29, -29, -29, 30, -29, 193,
829 58, -29, 51, -29, -29, 59, 60, 30, 78, 58,
830 -29, -29, -29, -29, -29, 80, 81, -29, -29, -29,
831 -29, -29, 168, 143, 90, 113, -29, -29, 91, 114,
832 115, 85, -29, -29, -29, -29, -29, -29, -29, -29,
841 0, 3, 0, 0, 0, 0, 0, 0, 0, 0,
842 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
843 0, 0, 0, 0, 0, 33, 36, 42, 41, 43,
844 44, 45, 46, 31, 47, 48, 49, 50, 51, 52,
845 53, 55, 54, 56, 57, 58, 59, 60, 62, 61,
846 63, 37, 38, 39, 40, 1, 5, 0, 35, 34,
847 8, 2, 0, 17, 23, 0, 0, 0, 0, 7,
848 10, 11, 12, 16, 32, 0, 0, 14, 15, 13,
849 6, 9, 0, 0, 0, 0, 20, 22, 0, 0,
850 0, 0, 26, 30, 21, 18, 19, 27, 28, 29,
857 -29, -29, 118, 105, -29, -29, 79, -29, -29, -29,
858 62, -29, -29, -29, 82, 23, -29, 138, -29, -25
864 -1, 23, 67, 61, 68, 69, 70, 71, 75, 85,
865 86, 72, 76, 91, 92, 34, 59, 24, 25, 26
873 58, -4, 1, 43, -34, 27, 28, 33, 41, 42,
874 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
875 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
876 29, 35, 30, 31, 22, 73, 32, 36, 44, 45,
877 46, 51, 52, 53, 73, 54, 33, 33, 37, 38,
878 39, 40, 47, 48, 55, 56, 49, 87, 93, 50,
879 87, 56, 63, 64, 65, 60, 93, 2, 3, 4,
880 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
881 15, 16, 17, 18, 19, 20, 21, 74, 77, 78,
882 66, 22, 88, 89, 2, 3, 4, 5, 6, 7,
883 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
884 18, 19, 20, 21, 80, 82, 83, 90, 22, 94,
885 97, 100, 2, 3, 4, 5, 6, 7, 8, 9,
886 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
887 20, 21, 57, 98, 99, 84, 22, 96, 81, 95,
888 88, 89, 2, 3, 4, 5, 6, 7, 8, 9,
889 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
890 20, 21, 79, 101, 0, 90, 22, 2, 3, 4,
891 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
892 15, 16, 17, 18, 19, 20, 21, 62, 0, 0,
893 84, 22, 2, 3, 4, 5, 6, 7, 8, 9,
894 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
895 20, 21, 0, 0, 0, 0, 22
900 25, 0, 1, 31, 3, 29, 30, 35, 29, 30,
901 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
902 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
903 30, 8, 30, 30, 33, 60, 31, 31, 15, 16,
904 17, 29, 30, 31, 69, 22, 35, 35, 31, 31,
905 31, 29, 31, 29, 0, 3, 31, 82, 83, 31,
906 85, 3, 4, 5, 6, 35, 91, 9, 10, 11,
907 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
908 22, 23, 24, 25, 26, 27, 28, 36, 29, 29,
909 32, 33, 7, 8, 9, 10, 11, 12, 13, 14,
910 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
911 25, 26, 27, 28, 36, 35, 35, 32, 33, 29,
912 29, 36, 9, 10, 11, 12, 13, 14, 15, 16,
913 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
914 27, 28, 24, 29, 29, 32, 33, 85, 69, 36,
915 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
916 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
917 27, 28, 67, 91, -1, 32, 33, 9, 10, 11,
918 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
919 22, 23, 24, 25, 26, 27, 28, 59, -1, -1,
920 32, 33, 9, 10, 11, 12, 13, 14, 15, 16,
921 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
922 27, 28, -1, -1, -1, -1, 33
929 0, 1, 9, 10, 11, 12, 13, 14, 15, 16,
930 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
931 27, 28, 33, 38, 54, 55, 56, 29, 30, 30,
932 30, 30, 31, 35, 52, 52, 31, 31, 31, 31,
933 29, 29, 30, 31, 52, 52, 52, 31, 29, 31,
934 31, 29, 30, 31, 52, 0, 3, 39, 56, 53,
935 35, 40, 54, 4, 5, 6, 32, 39, 41, 42,
936 43, 44, 48, 56, 36, 45, 49, 29, 29, 40,
937 36, 43, 35, 35, 32, 46, 47, 56, 7, 8,
938 32, 50, 51, 56, 29, 36, 47, 29, 29, 29,
945 0, 37, 38, 38, 38, 39, 40, 41, 41, 42,
946 42, 43, 43, 43, 43, 43, 43, 45, 44, 46,
947 46, 47, 47, 49, 48, 50, 50, 51, 51, 51,
948 51, 53, 52, 54, 54, 55, 55, 56, 56, 56,
949 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
950 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
957 0, 2, 3, 1, 0, 1, 3, 1, 0, 2,
958 1, 1, 1, 2, 2, 2, 1, 0, 5, 2,
959 1, 2, 1, 0, 5, 2, 1, 2, 2, 2,
960 1, 0, 4, 1, 0, 2, 1, 2, 2, 2,
961 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
962 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
967#define yyerrok (yyerrstatus = 0)
968#define yyclearin (yychar = YYEMPTY)
972#define YYACCEPT goto yyacceptlab
973#define YYABORT goto yyabortlab
974#define YYERROR goto yyerrorlab
977#define YYRECOVERING() (!!yyerrstatus)
979#define YYBACKUP(Token, Value) \
981 if (yychar == YYEMPTY) \
985 YYPOPSTACK (yylen); \
991 yyerror (YY_("syntax error: cannot back up")); \
1007# define YYFPRINTF fprintf
1010# define YYDPRINTF(Args) \
1017#ifndef YY_LOCATION_PRINT
1018# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1022# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1026 YYFPRINTF (stderr, "%s ", Title); \
1027 yy_symbol_print (stderr, \
1029 YYFPRINTF (stderr, "\n"); \
1039yy_symbol_value_print (FILE *yyo,
int yytype,
YYSTYPE const *
const yyvaluep)
1041 FILE *yyoutput = yyo;
1047 YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
1060yy_symbol_print (FILE *yyo,
int yytype,
YYSTYPE const *
const yyvaluep)
1062 YYFPRINTF (yyo,
"%s %s (",
1065 yy_symbol_value_print (yyo, yytype, yyvaluep);
1066 YYFPRINTF (yyo,
")");
1077 YYFPRINTF (stderr,
"Stack now");
1078 for (; yybottom <= yytop; yybottom++)
1080 int yybot = *yybottom;
1081 YYFPRINTF (stderr,
" %d", yybot);
1083 YYFPRINTF (stderr,
"\n");
1086# define YY_STACK_PRINT(Bottom, Top) \
1089 yy_stack_print ((Bottom), (Top)); \
1100 int yylno = yyrline[yyrule];
1101 int yynrhs =
yyr2[yyrule];
1103 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %d):\n",
1106 for (yyi = 0; yyi < yynrhs; yyi++)
1108 YYFPRINTF (stderr,
" $%d = ", yyi + 1);
1109 yy_symbol_print (stderr,
1110 yystos[+yyssp[yyi + 1 - yynrhs]],
1111 &yyvsp[(yyi + 1) - (yynrhs)]
1113 YYFPRINTF (stderr,
"\n");
1117# define YY_REDUCE_PRINT(Rule) \
1120 yy_reduce_print (yyssp, yyvsp, Rule); \
1127# define YYDPRINTF(Args)
1128# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1129# define YY_STACK_PRINT(Bottom, Top)
1130# define YY_REDUCE_PRINT(Rule)
1136# define YYINITDEPTH 200
1147# define YYMAXDEPTH 10000
1154# if defined __GLIBC__ && defined _STRING_H
1155# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
1159yystrlen (
const char *yystr)
1162 for (yylen = 0; yystr[yylen]; yylen++)
1170# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1171# define yystpcpy stpcpy
1176yystpcpy (
char *yydest,
const char *yysrc)
1179 const char *yys = yysrc;
1181 while ((*yyd++ = *yys++) !=
'\0')
1198yytnamerr (
char *yyres,
const char *yystr)
1203 char const *yyp = yystr;
1210 goto do_not_strip_quotes;
1214 goto do_not_strip_quotes;
1230 do_not_strip_quotes: ;
1234 return yystpcpy (yyres, yystr) - yyres;
1236 return yystrlen (yystr);
1249yysyntax_error (
YYPTRDIFF_T *yymsg_alloc,
char **yymsg,
1252 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1257 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1288 int yyn =
yypact[+*yyssp];
1291 yyarg[yycount++] =
yytname[yytoken];
1297 int yyxbegin = yyn < 0 ? -yyn : 0;
1299 int yychecklim =
YYLAST - yyn + 1;
1303 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1307 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1313 yyarg[yycount++] =
yytname[yyx];
1328# define YYCASE_(N, S) \
1333 YYCASE_(0,
YY_(
"syntax error"));
1334 YYCASE_(1,
YY_(
"syntax error, unexpected %s"));
1335 YYCASE_(2,
YY_(
"syntax error, unexpected %s, expecting %s"));
1336 YYCASE_(3,
YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1337 YYCASE_(4,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1338 YYCASE_(5,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1345 YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1;
1352 if (*yymsg_alloc < yysize)
1354 *yymsg_alloc = 2 * yysize;
1355 if (! (yysize <= *yymsg_alloc
1367 while ((*yyp = *yyformat) !=
'\0')
1368 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
1370 yyp += yytnamerr (yyp, yyarg[yyi++]);
1453 char *yymsg = yymsgbuf;
1457#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1463 yyssp = yyss = yyssa;
1464 yyvsp = yyvs = yyvsa;
1467 YYDPRINTF ((stderr,
"Starting parse\n"));
1489 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1495 if (yyss + yystacksize - 1 <= yyssp)
1496#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1497 goto yyexhaustedlab;
1503# if defined yyoverflow
1515 yyoverflow (
YY_(
"memory exhausted"),
1516 &yyss1, yysize *
YYSIZEOF (*yyssp),
1517 &yyvs1, yysize *
YYSIZEOF (*yyvsp),
1525 goto yyexhaustedlab;
1536 goto yyexhaustedlab;
1539# undef YYSTACK_RELOCATE
1545 yyssp = yyss + yysize - 1;
1546 yyvsp = yyvs + yysize - 1;
1549 YYDPRINTF ((stderr,
"Stack size increased to %ld\n",
1550 YY_CAST (
long, yystacksize)));
1553 if (yyss + yystacksize - 1 <= yyssp)
1581 YYDPRINTF ((stderr,
"Reading a token: "));
1588 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1652 yyval = yyvsp[1-yylen];
1659#line 220 "../../cmd/tools/gmlparse.y"
1661#line 1662 "gmlparse.c"
1665#line 221 "../../cmd/tools/gmlparse.y"
1667#line 1668 "gmlparse.c"
1671#line 225 "../../cmd/tools/gmlparse.y"
1673#line 1674 "gmlparse.c"
1677#line 239 "../../cmd/tools/gmlparse.y"
1678 { nodes_append(&
G->
nodelist, (yyvsp[0].np)); }
1679#line 1680 "gmlparse.c"
1683#line 240 "../../cmd/tools/gmlparse.y"
1684 { edges_append(&
G->
edgelist, (yyvsp[0].ep)); }
1685#line 1686 "gmlparse.c"
1689#line 242 "../../cmd/tools/gmlparse.y"
1692 yyerror(
"mixed directed and undirected graphs");
1697#line 1698 "gmlparse.c"
1701#line 249 "../../cmd/tools/gmlparse.y"
1703#line 1704 "gmlparse.c"
1707#line 250 "../../cmd/tools/gmlparse.y"
1708 { attrs_append(&
G->
attrlist, (yyvsp[0].ap)); }
1709#line 1710 "gmlparse.c"
1713#line 253 "../../cmd/tools/gmlparse.y"
1715#line 1716 "gmlparse.c"
1719#line 253 "../../cmd/tools/gmlparse.y"
1720 { (yyval.np) =
N;
N =
NULL; }
1721#line 1722 "gmlparse.c"
1725#line 260 "../../cmd/tools/gmlparse.y"
1726 {
N->
id = (yyvsp[0].str); }
1727#line 1728 "gmlparse.c"
1731#line 261 "../../cmd/tools/gmlparse.y"
1732 { attrs_append(&
N->
attrlist, (yyvsp[0].ap)); }
1733#line 1734 "gmlparse.c"
1737#line 264 "../../cmd/tools/gmlparse.y"
1739#line 1740 "gmlparse.c"
1743#line 264 "../../cmd/tools/gmlparse.y"
1744 { (yyval.ep) =
E;
E =
NULL; }
1745#line 1746 "gmlparse.c"
1749#line 271 "../../cmd/tools/gmlparse.y"
1750 {
E->
source = (yyvsp[0].str); }
1751#line 1752 "gmlparse.c"
1755#line 272 "../../cmd/tools/gmlparse.y"
1756 {
E->
target = (yyvsp[0].str); }
1757#line 1758 "gmlparse.c"
1761#line 273 "../../cmd/tools/gmlparse.y"
1763#line 1764 "gmlparse.c"
1767#line 274 "../../cmd/tools/gmlparse.y"
1768 { attrs_append(&
E->
attrlist, (yyvsp[0].ap)); }
1769#line 1770 "gmlparse.c"
1773#line 277 "../../cmd/tools/gmlparse.y"
1775#line 1776 "gmlparse.c"
1779#line 277 "../../cmd/tools/gmlparse.y"
1781#line 1782 "gmlparse.c"
1785#line 284 "../../cmd/tools/gmlparse.y"
1786 { attrs_append(
L, (yyvsp[0].ap)); }
1787#line 1788 "gmlparse.c"
1791#line 285 "../../cmd/tools/gmlparse.y"
1792 { attrs_append(
L, (yyvsp[0].ap)); }
1793#line 1794 "gmlparse.c"
1797#line 288 "../../cmd/tools/gmlparse.y"
1799#line 1800 "gmlparse.c"
1803#line 289 "../../cmd/tools/gmlparse.y"
1804 { (yyval.ap) =
mkAttr ((yyvsp[-1].
str), 0,
REAL, (yyvsp[0].str), 0); }
1805#line 1806 "gmlparse.c"
1809#line 290 "../../cmd/tools/gmlparse.y"
1810 { (yyval.ap) =
mkAttr ((yyvsp[-1].
str), 0,
STRING, (yyvsp[0].str), 0); }
1811#line 1812 "gmlparse.c"
1815#line 291 "../../cmd/tools/gmlparse.y"
1816 { (yyval.ap) =
mkAttr ((yyvsp[-1].
str), 0,
LIST, 0, (yyvsp[0].list)); }
1817#line 1818 "gmlparse.c"
1821#line 292 "../../cmd/tools/gmlparse.y"
1823#line 1824 "gmlparse.c"
1827#line 293 "../../cmd/tools/gmlparse.y"
1829#line 1830 "gmlparse.c"
1833#line 294 "../../cmd/tools/gmlparse.y"
1835#line 1836 "gmlparse.c"
1839#line 295 "../../cmd/tools/gmlparse.y"
1841#line 1842 "gmlparse.c"
1845#line 296 "../../cmd/tools/gmlparse.y"
1847#line 1848 "gmlparse.c"
1851#line 297 "../../cmd/tools/gmlparse.y"
1853#line 1854 "gmlparse.c"
1857#line 298 "../../cmd/tools/gmlparse.y"
1859#line 1860 "gmlparse.c"
1863#line 299 "../../cmd/tools/gmlparse.y"
1865#line 1866 "gmlparse.c"
1869#line 300 "../../cmd/tools/gmlparse.y"
1871#line 1872 "gmlparse.c"
1875#line 301 "../../cmd/tools/gmlparse.y"
1877#line 1878 "gmlparse.c"
1881#line 302 "../../cmd/tools/gmlparse.y"
1883#line 1884 "gmlparse.c"
1887#line 303 "../../cmd/tools/gmlparse.y"
1889#line 1890 "gmlparse.c"
1893#line 304 "../../cmd/tools/gmlparse.y"
1895#line 1896 "gmlparse.c"
1899#line 305 "../../cmd/tools/gmlparse.y"
1901#line 1902 "gmlparse.c"
1905#line 306 "../../cmd/tools/gmlparse.y"
1907#line 1908 "gmlparse.c"
1911#line 307 "../../cmd/tools/gmlparse.y"
1913#line 1914 "gmlparse.c"
1917#line 308 "../../cmd/tools/gmlparse.y"
1919#line 1920 "gmlparse.c"
1923#line 309 "../../cmd/tools/gmlparse.y"
1925#line 1926 "gmlparse.c"
1929#line 310 "../../cmd/tools/gmlparse.y"
1931#line 1932 "gmlparse.c"
1935#line 311 "../../cmd/tools/gmlparse.y"
1937#line 1938 "gmlparse.c"
1941#line 312 "../../cmd/tools/gmlparse.y"
1943#line 1944 "gmlparse.c"
1947#line 313 "../../cmd/tools/gmlparse.y"
1949#line 1950 "gmlparse.c"
1953#line 314 "../../cmd/tools/gmlparse.y"
1955#line 1956 "gmlparse.c"
1959#line 1960 "gmlparse.c"
1987 const int yyi =
yypgoto[yylhs] + *yyssp;
1988 yystate = (0 <= yyi && yyi <=
YYLAST &&
yycheck[yyi] == *yyssp
2008#if ! YYERROR_VERBOSE
2011# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2014 char const *yymsgp =
YY_(
"syntax error");
2015 int yysyntax_error_status;
2016 yysyntax_error_status = YYSYNTAX_ERROR;
2017 if (yysyntax_error_status == 0)
2019 else if (yysyntax_error_status == 1)
2021 if (yymsg != yymsgbuf)
2027 yymsg_alloc =
sizeof yymsgbuf;
2028 yysyntax_error_status = 2;
2032 yysyntax_error_status = YYSYNTAX_ERROR;
2037 if (yysyntax_error_status == 2)
2038 goto yyexhaustedlab;
2040# undef YYSYNTAX_ERROR
2046 if (yyerrstatus == 3)
2148#if !defined yyoverflow || YYERROR_VERBOSE
2175 while (yyssp != yyss)
2186 if (yymsg != yymsgbuf)
2191#line 317 "../../cmd/tools/gmlparse.y"
2223 for (
size_t i = 0; alist !=
NULL && i < attrs_size(alist); ++i) {
2224 gmlattr *
const ap = attrs_get(alist, i);
2253 for (
size_t i = 0; i < attrs_size(alist); ++i) {
2254 gmlattr *
const ap = attrs_get(alist, i);
2295 for (
size_t i = 0; i < attrs_size(alist); ++i) {
2296 gmlattr *
const ap = attrs_get(alist, i);
2345 for (
size_t i = 0; alist !=
NULL && i < attrs_size(alist); ++i) {
2346 gmlattr *
const ap = attrs_get(alist, i);
2355 snprintf(buf,
sizeof(buf),
"%.04f", d/72.0);
2360 snprintf(buf,
sizeof(buf),
"%.04f", d/72.0);
2404 for (
size_t i = 0; alist !=
NULL && i < attrs_size(alist); ++i) {
2405 gmlattr *
const ap = attrs_get(alist, i);
2413 fprintf (stderr,
"non-X/Y field in point attribute");
2424 for (
size_t i = 0; i < attrs_size(alist); ++i) {
2425 gmlattr *
const ap = attrs_get(alist, i);
2430 fprintf (stderr,
"non-point field in line attribute");
2441 for (
size_t i = 0; alist !=
NULL && i < attrs_size(alist); ++i) {
2442 gmlattr *
const ap = attrs_get(alist, i);
2475 for (
size_t i = 0; i < attrs_size(alist); ++i) {
2476 gmlattr *
const ap = attrs_get(alist, i);
2508 else if (
graph->directed >= 1)
2516 for (
size_t i = 0; i < nodes_size(&
graph->nodelist); ++i) {
2519 fprintf (stderr,
"node without an id attribute");
2526 for (
size_t i = 0; i < edges_size(&
graph->edgelist); ++i) {
2529 fprintf (stderr,
"edge without an source attribute");
2533 fprintf (stderr,
"node without an target attribute");
2541 for (
size_t i = 0; i < graphs_size(
graph->graphlist); ++i) {
2594 s =
"directed";
break;
2598 s =
"source";
break;
2600 s =
"target";
break;
2612 s =
"graphics";
break;
2614 s =
"labelGraphics";
break;
2620 s =
"outline";
break;
2622 s =
"outlineStyle";
break;
2624 s =
"outlineWidth";
break;
2636 s =
"fontSize";
break;
2638 s =
"fontName";
break;
2642 s =
"integer";
break;
2646 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)
ensures the given attribute is declared before setting it locally on an object
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 *