47 #define YYBISON_VERSION "2.7"
50 #define YYSKELETON_NAME "yacc.c"
66 #line 14 "../../lib/common/htmlparse.y"
147 offsetof(
pitem,link),
158 offsetof(
pitem,link),
193 for (i = 0; i < p->
lp.
nitems; i++) {
194 if (ti->
str) free (ti->
str);
205 offsetof(
fitem,link),
218 offsetof(
fspan,link),
231 appendFItemList (
agxbuf *ag)
236 fi->
ti.
font = HTMLstate.fontstack->cfont;
243 appendFLineList (
int v)
248 Dt_t *ilist = HTMLstate.fitemList;
282 Dt_t * ispan = HTMLstate.fspanList;
286 if (
dtsize (HTMLstate.fitemList))
306 static pitem* lastRow (
void)
316 static pitem* addRow (
void)
331 static void setCell (
htmlcell_t* cp,
void* obj,
int kind)
376 for (s = HTMLstate.fontstack; (next = s->
pfont); s = next) {
387 static void cleanup (
void)
394 HTMLstate.lbl =
NULL;
418 static int nonSpace (
char* s)
423 if (c !=
' ')
return 1;
435 textfont_t* curfont = HTMLstate.fontstack->cfont;
441 if ((f.
size < 0.0) && (curfont->
size >= 0.0))
450 ft->
pfont = HTMLstate.fontstack;
451 HTMLstate.fontstack = ft;
459 sfont_t* curfont = HTMLstate.fontstack;
463 HTMLstate.fontstack = prevfont;
471 # if defined __cplusplus && 201103L <= __cplusplus
472 # define YY_NULL nullptr
479 #ifdef YYERROR_VERBOSE
480 # undef YYERROR_VERBOSE
481 # define YYERROR_VERBOSE 1
483 # define YYERROR_VERBOSE 0
488 #ifndef YY_YY_Y_TAB_H_INCLUDED
489 # define YY_YY_Y_TAB_H_INCLUDED
546 #define T_end_img 259
548 #define T_end_row 261
550 #define T_end_html 263
551 #define T_end_table 264
552 #define T_end_cell 265
553 #define T_end_font 266
556 #define T_n_italic 269
558 #define T_n_underline 271
559 #define T_n_overline 272
578 #define T_underline 291
579 #define T_overline 292
586 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
590 #line 415 "../../lib/common/htmlparse.y"
604 # define YYSTYPE_IS_TRIVIAL 1
605 # define yystype YYSTYPE
606 # define YYSTYPE_IS_DECLARED 1
612 #if defined __STDC__ || defined __cplusplus
613 int yyparse (
void *YYPARSE_PARAM);
618 #if defined __STDC__ || defined __cplusplus
644 #elif (defined __STDC__ || defined __C99__FUNC__ \
645 || defined __cplusplus || defined _MSC_VER)
664 # ifdef __SIZE_TYPE__
665 # define YYSIZE_T __SIZE_TYPE__
666 # elif defined size_t
667 # define YYSIZE_T size_t
668 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
669 || defined __cplusplus || defined _MSC_VER)
671 # define YYSIZE_T size_t
673 # define YYSIZE_T unsigned int
677 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
680 # if defined YYENABLE_NLS && YYENABLE_NLS
682 # include <libintl.h>
683 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
687 # define YY_(Msgid) Msgid
692 #if ! defined lint || defined __GNUC__
693 # define YYUSE(E) ((void) (E))
702 #if (defined __STDC__ || defined __C99__FUNC__ \
703 || defined __cplusplus || defined _MSC_VER)
716 #if ! defined yyoverflow || YYERROR_VERBOSE
720 # ifdef YYSTACK_USE_ALLOCA
721 # if YYSTACK_USE_ALLOCA
723 # define YYSTACK_ALLOC __builtin_alloca
724 # elif defined __BUILTIN_VA_ARG_INCR
727 # define YYSTACK_ALLOC __alloca
728 # elif defined _MSC_VER
730 # define alloca _alloca
732 # define YYSTACK_ALLOC alloca
733 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
734 || defined __cplusplus || defined _MSC_VER)
737 # ifndef EXIT_SUCCESS
738 # define EXIT_SUCCESS 0
745 # ifdef YYSTACK_ALLOC
747 # define YYSTACK_FREE(Ptr) do { ; } while (YYID (0))
748 # ifndef YYSTACK_ALLOC_MAXIMUM
753 # define YYSTACK_ALLOC_MAXIMUM 4032
756 # define YYSTACK_ALLOC YYMALLOC
757 # define YYSTACK_FREE YYFREE
758 # ifndef YYSTACK_ALLOC_MAXIMUM
759 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
761 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
762 && ! ((defined YYMALLOC || defined malloc) \
763 && (defined YYFREE || defined free)))
765 # ifndef EXIT_SUCCESS
766 # define EXIT_SUCCESS 0
770 # define YYMALLOC malloc
771 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
772 || defined __cplusplus || defined _MSC_VER)
778 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
779 || defined __cplusplus || defined _MSC_VER)
787 #if (! defined yyoverflow \
788 && (! defined __cplusplus \
789 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
799 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
803 # define YYSTACK_BYTES(N) \
804 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
805 + YYSTACK_GAP_MAXIMUM)
807 # define YYCOPY_NEEDED 1
814 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
817 YYSIZE_T yynewbytes; \
818 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
819 Stack = &yyptr->Stack_alloc; \
820 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
821 yyptr += yynewbytes / sizeof (*yyptr); \
827 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
831 # if defined __GNUC__ && 1 < __GNUC__
832 # define YYCOPY(Dst, Src, Count) \
833 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
835 # define YYCOPY(Dst, Src, Count) \
839 for (yyi = 0; yyi < (Count); yyi++) \
840 (Dst)[yyi] = (Src)[yyi]; \
859 #define YYNSTATES 116
863 #define YYMAXUTOK 295
865 #define YYTRANSLATE(YYX) \
866 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
869 static const yytype_uint8 yytranslate[] =
871 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
872 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
873 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
874 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
875 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
876 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
877 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
878 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
879 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
880 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
881 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
882 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
883 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
884 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
885 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
886 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
887 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
888 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
889 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
890 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
891 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
892 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
893 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
894 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
895 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
896 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
897 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
898 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
899 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
900 35, 36, 37, 38, 39, 40
906 static const yytype_uint8 yyprhs[] =
908 0, 0, 3, 7, 11, 13, 15, 18, 20, 22,
909 24, 28, 32, 36, 40, 44, 48, 52, 56, 58,
910 60, 62, 64, 66, 68, 70, 72, 74, 76, 78,
911 80, 82, 84, 86, 88, 91, 93, 95, 98, 99,
912 106, 108, 112, 116, 120, 124, 128, 130, 131, 133,
913 136, 140, 141, 146, 148, 151, 155, 156, 161, 162,
914 167, 168, 173, 174, 178, 181, 183, 186, 188, 191
918 static const yytype_int8 yyrhs[] =
920 42, 0, -1, 7, 43, 8, -1, 7, 66, 8,
921 -1, 1, -1, 44, -1, 44, 45, -1, 45, -1,
922 63, -1, 62, -1, 46, 44, 47, -1, 48, 44,
923 49, -1, 54, 44, 55, -1, 56, 44, 57, -1,
924 50, 44, 51, -1, 58, 44, 59, -1, 60, 44,
925 61, -1, 52, 44, 53, -1, 33, -1, 11, -1,
926 34, -1, 14, -1, 35, -1, 15, -1, 40, -1,
927 20, -1, 36, -1, 16, -1, 37, -1, 17, -1,
928 38, -1, 18, -1, 39, -1, 19, -1, 28, 3,
929 -1, 27, -1, 12, -1, 63, 12, -1, -1, 67,
930 31, 65, 68, 9, 67, -1, 64, -1, 46, 64,
931 47, -1, 48, 64, 49, -1, 54, 64, 55, -1,
932 56, 64, 57, -1, 50, 64, 51, -1, 63, -1,
933 -1, 69, -1, 68, 69, -1, 68, 78, 69, -1,
934 -1, 5, 70, 71, 6, -1, 72, -1, 71, 72,
935 -1, 71, 79, 72, -1, -1, 32, 66, 73, 10,
936 -1, -1, 32, 43, 74, 10, -1, -1, 32, 77,
937 75, 10, -1, -1, 32, 76, 10, -1, 30, 4,
938 -1, 29, -1, 22, 23, -1, 21, -1, 25, 26,
943 static const yytype_uint16 yyrline[] =
945 0, 447, 447, 448, 449, 452, 455, 456, 459, 460,
946 461, 462, 463, 464, 465, 466, 467, 468, 471, 474,
947 477, 480, 483, 486, 489, 492, 495, 498, 501, 504,
948 507, 510, 513, 516, 519, 520, 523, 524, 527, 527,
949 548, 549, 550, 551, 552, 553, 556, 557, 560, 561,
950 562, 565, 565, 568, 569, 570, 573, 573, 574, 574,
951 575, 575, 576, 576, 579, 580, 583, 584, 587, 588
955 #if YYDEBUG || YYERROR_VERBOSE || 0
958 static const char *
const yytname[] =
960 "$end",
"error",
"$undefined",
"T_end_br",
"T_end_img",
"T_row",
961 "T_end_row",
"T_html",
"T_end_html",
"T_end_table",
"T_end_cell",
962 "T_end_font",
"T_string",
"T_error",
"T_n_italic",
"T_n_bold",
963 "T_n_underline",
"T_n_overline",
"T_n_sup",
"T_n_sub",
"T_n_s",
"T_HR",
964 "T_hr",
"T_end_hr",
"T_VR",
"T_vr",
"T_end_vr",
"T_BR",
"T_br",
"T_IMG",
965 "T_img",
"T_table",
"T_cell",
"T_font",
"T_italic",
"T_bold",
966 "T_underline",
"T_overline",
"T_sup",
"T_sub",
"T_s",
"$accept",
"html",
967 "fonttext",
"text",
"textitem",
"font",
"n_font",
"italic",
"n_italic",
968 "bold",
"n_bold",
"strike",
"n_strike",
"underline",
"n_underline",
969 "overline",
"n_overline",
"sup",
"n_sup",
"sub",
"n_sub",
"br",
"string",
970 "table",
"@1",
"fonttable",
"opt_space",
"rows",
"row",
"$@2",
"cells",
971 "cell",
"$@3",
"$@4",
"$@5",
"$@6",
"image",
"HR",
"VR",
YY_NULL
978 static const yytype_uint16 yytoknum[] =
980 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
981 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
982 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
983 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
989 static const yytype_uint8 yyr1[] =
991 0, 41, 42, 42, 42, 43, 44, 44, 45, 45,
992 45, 45, 45, 45, 45, 45, 45, 45, 46, 47,
993 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
994 58, 59, 60, 61, 62, 62, 63, 63, 65, 64,
995 66, 66, 66, 66, 66, 66, 67, 67, 68, 68,
996 68, 70, 69, 71, 71, 71, 73, 72, 74, 72,
997 75, 72, 76, 72, 77, 77, 78, 78, 79, 79
1001 static const yytype_uint8 yyr2[] =
1003 0, 2, 3, 3, 1, 1, 2, 1, 1, 1,
1004 3, 3, 3, 3, 3, 3, 3, 3, 1, 1,
1005 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1006 1, 1, 1, 1, 2, 1, 1, 2, 0, 6,
1007 1, 3, 3, 3, 3, 3, 1, 0, 1, 2,
1008 3, 0, 4, 1, 2, 3, 0, 4, 0, 4,
1009 0, 4, 0, 3, 2, 1, 2, 1, 2, 1
1015 static const yytype_uint8 yydefact[] =
1017 0, 4, 47, 0, 36, 35, 0, 18, 20, 22,
1018 26, 28, 30, 32, 24, 0, 5, 7, 47, 47,
1019 47, 0, 47, 47, 0, 0, 9, 8, 40, 0,
1020 0, 1, 34, 2, 6, 0, 0, 0, 0, 0,
1021 8, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1022 0, 0, 0, 0, 37, 3, 38, 19, 10, 41,
1023 21, 11, 42, 23, 14, 45, 25, 17, 27, 12,
1024 43, 29, 13, 44, 31, 15, 33, 16, 0, 51,
1025 0, 48, 0, 47, 67, 0, 49, 0, 47, 0,
1026 53, 46, 39, 66, 50, 65, 0, 58, 56, 0,
1027 60, 52, 69, 0, 54, 0, 64, 0, 0, 63,
1028 0, 68, 55, 59, 57, 61
1032 static const yytype_int8 yydefgoto[] =
1034 -1, 3, 15, 16, 17, 35, 58, 36, 61, 37,
1035 64, 21, 67, 38, 69, 39, 72, 24, 75, 25,
1036 77, 26, 40, 28, 78, 29, 30, 80, 81, 82,
1037 89, 90, 108, 107, 110, 99, 100, 87, 105
1042 #define YYPACT_NINF -82
1043 static const yytype_int16 yypact[] =
1045 8, -82, 209, 10, -82, -82, 11, -82, -82, -82,
1046 -82, -82, -82, -82, -82, 5, 209, -82, 209, 209,
1047 209, 209, 209, 209, 209, 209, -82, -5, -82, 14,
1048 -20, -82, -82, -82, -82, 209, 209, 209, 209, 209,
1049 13, 37, 12, 66, 16, 80, 19, 109, 123, 20,
1050 152, 15, 166, 195, -82, -82, -82, -82, -82, -82,
1051 -82, -82, -82, -82, -82, -82, -82, -82, -82, -82,
1052 -82, -82, -82, -82, -82, -82, -82, -82, 23, -82,
1053 119, -82, 7, 46, -82, 38, -82, 23, 17, 35,
1054 -82, 13, -82, -82, -82, -82, 58, -82, -82, 53,
1055 -82, -82, -82, 40, -82, 7, -82, 59, 69, -82,
1056 72, -82, -82, -82, -82, -82
1060 static const yytype_int16 yypgoto[] =
1062 -82, -82, -4, 232, -10, -1, 26, 0, 39, 1,
1063 50, -82, -82, 2, 36, 3, 47, -82, -82, -82,
1064 -82, -82, -2, 148, -82, 9, 27, -82, -68, -82,
1065 -82, -81, -82, -82, -82, -82, -82, -82, -82
1071 #define YYTABLE_NINF -63
1072 static const yytype_int8 yytable[] =
1074 27, 18, 19, 20, 22, 23, 34, 54, 104, 1,
1075 31, 56, 86, 33, 32, 2, 27, 27, 27, 94,
1076 27, 27, 55, 57, 112, 54, -46, -62, 79, 4,
1077 60, 34, 71, 34, 63, 34, 68, 34, 34, 88,
1078 34, 101, 34, 34, 5, 6, 95, 96, 57, 4,
1079 7, 8, 9, 10, 11, 12, 13, 14, 4, 102,
1080 103, 93, 106, 109, 5, 6, 111, 88, 59, 113,
1081 7, 8, 9, 10, 11, 12, 13, 14, 4, 114,
1082 60, 91, 115, 62, 97, 70, 27, 18, 19, 20,
1083 22, 23, 4, 5, 6, 63, 65, 98, 73, 7,
1084 8, 9, 10, 11, 12, 13, 14, 5, 6, 0,
1085 92, 0, 0, 7, 8, 9, 10, 11, 12, 13,
1086 14, 4, 0, 0, 79, 0, 0, 0, 83, 66,
1087 0, 0, 0, 0, 0, 4, 5, 6, 0, 68,
1088 84, 85, 7, 8, 9, 10, 11, 12, 13, 14,
1089 5, 6, 0, 0, 0, 0, 7, 8, 9, 10,
1090 11, 12, 13, 14, 4, 0, 42, 44, 46, 71,
1091 49, 51, 0, 0, 0, 0, 0, 0, 4, 5,
1092 6, 0, 0, 0, 74, 7, 8, 9, 10, 11,
1093 12, 13, 14, 5, 6, 0, 0, 0, 0, 7,
1094 8, 9, 10, 11, 12, 13, 14, 4, 0, 0,
1095 0, 0, 0, 0, 76, 0, 0, 0, 0, 0,
1096 0, 4, 5, 6, 0, 0, 0, 0, 7, 8,
1097 9, 10, 11, 12, 13, 14, 5, 6, 0, 0,
1098 0, 0, 7, 8, 9, 10, 11, 12, 13, 14,
1099 41, 43, 45, 47, 48, 50, 52, 53, 0, 0,
1100 0, 0, 0, 0, 0, 0, 0, 41, 43, 45,
1104 #define yypact_value_is_default(Yystate) \
1105 (!!((Yystate) == (-82)))
1107 #define yytable_value_is_error(Yytable_value) \
1110 static const yytype_int8 yycheck[] =
1112 2, 2, 2, 2, 2, 2, 16, 12, 89, 1,
1113 0, 31, 80, 8, 3, 7, 18, 19, 20, 87,
1114 22, 23, 8, 11, 105, 12, 31, 10, 5, 12,
1115 14, 41, 17, 43, 15, 45, 16, 47, 48, 32,
1116 50, 6, 52, 53, 27, 28, 29, 30, 11, 12,
1117 33, 34, 35, 36, 37, 38, 39, 40, 12, 24,
1118 25, 23, 4, 10, 27, 28, 26, 32, 42, 10,
1119 33, 34, 35, 36, 37, 38, 39, 40, 12, 10,
1120 14, 83, 10, 44, 88, 49, 88, 88, 88, 88,
1121 88, 88, 12, 27, 28, 15, 46, 88, 51, 33,
1122 34, 35, 36, 37, 38, 39, 40, 27, 28, -1,
1123 83, -1, -1, 33, 34, 35, 36, 37, 38, 39,
1124 40, 12, -1, -1, 5, -1, -1, -1, 9, 20,
1125 -1, -1, -1, -1, -1, 12, 27, 28, -1, 16,
1126 21, 22, 33, 34, 35, 36, 37, 38, 39, 40,
1127 27, 28, -1, -1, -1, -1, 33, 34, 35, 36,
1128 37, 38, 39, 40, 12, -1, 18, 19, 20, 17,
1129 22, 23, -1, -1, -1, -1, -1, -1, 12, 27,
1130 28, -1, -1, -1, 18, 33, 34, 35, 36, 37,
1131 38, 39, 40, 27, 28, -1, -1, -1, -1, 33,
1132 34, 35, 36, 37, 38, 39, 40, 12, -1, -1,
1133 -1, -1, -1, -1, 19, -1, -1, -1, -1, -1,
1134 -1, 12, 27, 28, -1, -1, -1, -1, 33, 34,
1135 35, 36, 37, 38, 39, 40, 27, 28, -1, -1,
1136 -1, -1, 33, 34, 35, 36, 37, 38, 39, 40,
1137 18, 19, 20, 21, 22, 23, 24, 25, -1, -1,
1138 -1, -1, -1, -1, -1, -1, -1, 35, 36, 37,
1144 static const yytype_uint8 yystos[] =
1146 0, 1, 7, 42, 12, 27, 28, 33, 34, 35,
1147 36, 37, 38, 39, 40, 43, 44, 45, 46, 48,
1148 50, 52, 54, 56, 58, 60, 62, 63, 64, 66,
1149 67, 0, 3, 8, 45, 46, 48, 50, 54, 56,
1150 63, 44, 64, 44, 64, 44, 64, 44, 44, 64,
1151 44, 64, 44, 44, 12, 8, 31, 11, 47, 47,
1152 14, 49, 49, 15, 51, 51, 20, 53, 16, 55,
1153 55, 17, 57, 57, 18, 59, 19, 61, 65, 5,
1154 68, 69, 70, 9, 21, 22, 69, 78, 32, 71,
1155 72, 63, 67, 23, 69, 29, 30, 43, 66, 76,
1156 77, 6, 24, 25, 72, 79, 4, 74, 73, 10,
1157 75, 26, 72, 10, 10, 10
1160 #define yyerrok (yyerrstatus = 0)
1161 #define yyclearin (yychar = YYEMPTY)
1162 #define YYEMPTY (-2)
1165 #define YYACCEPT goto yyacceptlab
1166 #define YYABORT goto yyabortlab
1167 #define YYERROR goto yyerrorlab
1177 #define YYFAIL goto yyerrlab
1185 #define YYRECOVERING() (!!yyerrstatus)
1187 #define YYBACKUP(Token, Value) \
1189 if (yychar == YYEMPTY) \
1193 YYPOPSTACK (yylen); \
1199 yyerror (YY_("syntax error: cannot back up")); \
1206 #define YYERRCODE 256
1210 #ifndef YY_LOCATION_PRINT
1211 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1217 # define YYLEX yylex (YYLEX_PARAM)
1219 # define YYLEX yylex ()
1227 # define YYFPRINTF fprintf
1230 # define YYDPRINTF(Args) \
1236 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1240 YYFPRINTF (stderr, "%s ", Title); \
1241 yy_symbol_print (stderr, \
1243 YYFPRINTF (stderr, "\n"); \
1253 #if (defined __STDC__ || defined __C99__FUNC__ \
1254 || defined __cplusplus || defined _MSC_VER)
1259 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
1262 YYSTYPE const * const yyvaluep;
1265 FILE *yyo = yyoutput;
1271 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1287 #if (defined __STDC__ || defined __C99__FUNC__ \
1288 || defined __cplusplus || defined _MSC_VER)
1290 yy_symbol_print (FILE *yyoutput,
int yytype,
YYSTYPE const *
const yyvaluep)
1293 yy_symbol_print (yyoutput, yytype, yyvaluep)
1296 YYSTYPE const * const yyvaluep;
1300 YYFPRINTF (yyoutput,
"token %s (", yytname[yytype]);
1302 YYFPRINTF (yyoutput,
"nterm %s (", yytname[yytype]);
1304 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1305 YYFPRINTF (yyoutput,
")");
1313 #if (defined __STDC__ || defined __C99__FUNC__ \
1314 || defined __cplusplus || defined _MSC_VER)
1316 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1319 yy_stack_print (yybottom, yytop)
1320 yytype_int16 *yybottom;
1321 yytype_int16 *yytop;
1324 YYFPRINTF (stderr,
"Stack now");
1325 for (; yybottom <= yytop; yybottom++)
1327 int yybot = *yybottom;
1328 YYFPRINTF (stderr,
" %d", yybot);
1330 YYFPRINTF (stderr,
"\n");
1333 # define YY_STACK_PRINT(Bottom, Top) \
1336 yy_stack_print ((Bottom), (Top)); \
1344 #if (defined __STDC__ || defined __C99__FUNC__ \
1345 || defined __cplusplus || defined _MSC_VER)
1350 yy_reduce_print (yyvsp, yyrule)
1355 int yynrhs = yyr2[yyrule];
1357 unsigned long int yylno = yyrline[yyrule];
1358 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %lu):\n",
1361 for (yyi = 0; yyi < yynrhs; yyi++)
1363 YYFPRINTF (stderr,
" $%d = ", yyi + 1);
1364 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1365 &(yyvsp[(yyi + 1) - (yynrhs)])
1367 YYFPRINTF (stderr,
"\n");
1371 # define YY_REDUCE_PRINT(Rule) \
1374 yy_reduce_print (yyvsp, Rule); \
1381 # define YYDPRINTF(Args)
1382 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1383 # define YY_STACK_PRINT(Bottom, Top)
1384 # define YY_REDUCE_PRINT(Rule)
1390 # define YYINITDEPTH 200
1401 # define YYMAXDEPTH 10000
1408 # if defined __GLIBC__ && defined _STRING_H
1409 # define yystrlen strlen
1412 #if (defined __STDC__ || defined __C99__FUNC__ \
1413 || defined __cplusplus || defined _MSC_VER)
1415 yystrlen (
const char *yystr)
1423 for (yylen = 0; yystr[
yylen]; yylen++)
1431 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1432 # define yystpcpy stpcpy
1436 #if (defined __STDC__ || defined __C99__FUNC__ \
1437 || defined __cplusplus || defined _MSC_VER)
1439 yystpcpy (
char *yydest,
const char *yysrc)
1442 yystpcpy (yydest, yysrc)
1448 const char *yys = yysrc;
1450 while ((*yyd++ = *yys++) !=
'\0')
1467 yytnamerr (
char *yyres,
const char *yystr)
1472 char const *yyp = yystr;
1479 goto do_not_strip_quotes;
1483 goto do_not_strip_quotes;
1496 do_not_strip_quotes: ;
1500 return yystrlen (yystr);
1502 return yystpcpy (yyres, yystr) - yyres;
1515 yysyntax_error (
YYSIZE_T *yymsg_alloc,
char **yymsg,
1520 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1522 const char *yyformat =
YY_NULL;
1524 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1558 int yyn = yypact[*
yyssp];
1559 yyarg[yycount++] = yytname[
yytoken];
1565 int yyxbegin = yyn < 0 ? -yyn : 0;
1567 int yychecklim =
YYLAST - yyn + 1;
1571 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1572 if (yycheck[yyx + yyn] == yyx && yyx !=
YYTERROR
1575 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1581 yyarg[yycount++] = yytname[yyx];
1584 if (! (yysize <= yysize1
1595 # define YYCASE_(N, S) \
1599 YYCASE_(0,
YY_(
"syntax error"));
1600 YYCASE_(1,
YY_(
"syntax error, unexpected %s"));
1601 YYCASE_(2,
YY_(
"syntax error, unexpected %s, expecting %s"));
1602 YYCASE_(3,
YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1603 YYCASE_(4,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1604 YYCASE_(5,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1609 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1615 if (*yymsg_alloc < yysize)
1617 *yymsg_alloc = 2 * yysize;
1618 if (! (yysize <= *yymsg_alloc
1630 while ((*yyp = *yyformat) !=
'\0')
1631 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
1633 yyp += yytnamerr (yyp, yyarg[yyi++]);
1651 #if (defined __STDC__ || defined __C99__FUNC__ \
1652 || defined __cplusplus || defined _MSC_VER)
1684 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1685 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1686 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
1688 #ifndef YY_INITIAL_VALUE
1689 # define YY_INITIAL_VALUE(Value)
1703 #ifdef YYPARSE_PARAM
1704 #if (defined __STDC__ || defined __C99__FUNC__ \
1705 || defined __cplusplus || defined _MSC_VER)
1711 void *YYPARSE_PARAM;
1714 #if (defined __STDC__ || defined __C99__FUNC__ \
1715 || defined __cplusplus || defined _MSC_VER)
1759 char *yymsg = yymsgbuf;
1760 YYSIZE_T yymsg_alloc =
sizeof yymsgbuf;
1763 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1769 yyssp = yyss =
yyssa;
1770 yyvsp = yyvs =
yyvsa;
1773 YYDPRINTF ((stderr,
"Starting parse\n"));
1792 if (yyss + yystacksize - 1 <= yyssp)
1795 YYSIZE_T yysize = yyssp - yyss + 1;
1803 yytype_int16 *yyss1 =
yyss;
1809 yyoverflow (
YY_(
"memory exhausted"),
1810 &yyss1, yysize *
sizeof (*yyssp),
1811 &yyvs1, yysize *
sizeof (*yyvsp),
1818 # ifndef YYSTACK_RELOCATE
1819 goto yyexhaustedlab;
1823 goto yyexhaustedlab;
1829 yytype_int16 *yyss1 =
yyss;
1833 goto yyexhaustedlab;
1836 # undef YYSTACK_RELOCATE
1843 yyssp = yyss + yysize - 1;
1844 yyvsp = yyvs + yysize - 1;
1846 YYDPRINTF ((stderr,
"Stack size increased to %lu\n",
1847 (
unsigned long int) yystacksize));
1849 if (yyss + yystacksize - 1 <= yyssp)
1853 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1878 YYDPRINTF ((stderr,
"Reading a token: "));
1884 yychar = yytoken =
YYEOF;
1885 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1896 if (yyn < 0 ||
YYLAST < yyn || yycheck[yyn] != yytoken)
1951 yyval = yyvsp[1-
yylen];
1959 #line 447 "../../lib/common/htmlparse.y"
1960 { HTMLstate.lbl = mkLabel((yyvsp[(2) - (3)].txt),
HTML_TEXT); }
1965 #line 448 "../../lib/common/htmlparse.y"
1966 { HTMLstate.lbl = mkLabel((yyvsp[(2) - (3)].tbl),
HTML_TBL); }
1971 #line 449 "../../lib/common/htmlparse.y"
1977 #line 452 "../../lib/common/htmlparse.y"
1978 { (yyval.
txt) = mkText(); }
1983 #line 459 "../../lib/common/htmlparse.y"
1984 { appendFItemList(HTMLstate.str);}
1989 #line 460 "../../lib/common/htmlparse.y"
1990 {appendFLineList((yyvsp[(1) - (1)].i));}
1995 #line 471 "../../lib/common/htmlparse.y"
1996 { pushFont ((yyvsp[(1) - (1)].font)); }
2001 #line 474 "../../lib/common/htmlparse.y"
2007 #line 477 "../../lib/common/htmlparse.y"
2008 {pushFont((yyvsp[(1) - (1)].font));}
2013 #line 480 "../../lib/common/htmlparse.y"
2019 #line 483 "../../lib/common/htmlparse.y"
2020 {pushFont((yyvsp[(1) - (1)].font));}
2025 #line 486 "../../lib/common/htmlparse.y"
2031 #line 489 "../../lib/common/htmlparse.y"
2032 {pushFont((yyvsp[(1) - (1)].font));}
2037 #line 492 "../../lib/common/htmlparse.y"
2043 #line 495 "../../lib/common/htmlparse.y"
2044 {pushFont((yyvsp[(1) - (1)].font));}
2049 #line 498 "../../lib/common/htmlparse.y"
2055 #line 501 "../../lib/common/htmlparse.y"
2056 {pushFont((yyvsp[(1) - (1)].font));}
2061 #line 504 "../../lib/common/htmlparse.y"
2067 #line 507 "../../lib/common/htmlparse.y"
2068 {pushFont((yyvsp[(1) - (1)].font));}
2073 #line 510 "../../lib/common/htmlparse.y"
2079 #line 513 "../../lib/common/htmlparse.y"
2080 {pushFont((yyvsp[(1) - (1)].font));}
2085 #line 516 "../../lib/common/htmlparse.y"
2091 #line 519 "../../lib/common/htmlparse.y"
2092 { (yyval.
i) = (yyvsp[(1) - (2)].i); }
2097 #line 520 "../../lib/common/htmlparse.y"
2098 { (yyval.
i) = (yyvsp[(1) - (1)].i); }
2103 #line 527 "../../lib/common/htmlparse.y"
2105 if (nonSpace(
agxbuse(HTMLstate.str))) {
2106 yyerror (
"Syntax error: non-space string used before <TABLE>");
2109 (yyvsp[(2) - (2)].tbl)->u.p.prev = HTMLstate.tblstack;
2110 (yyvsp[(2) - (2)].tbl)->u.p.rows =
dtopen(&rowDisc,
Dtqueue);
2111 HTMLstate.tblstack = (yyvsp[(2) - (2)].tbl);
2112 (yyvsp[(2) - (2)].tbl)->font = HTMLstate.fontstack->cfont;
2113 (yyval.
tbl) = (yyvsp[(2) - (2)].tbl);
2119 #line 538 "../../lib/common/htmlparse.y"
2121 if (nonSpace(
agxbuse(HTMLstate.str))) {
2122 yyerror (
"Syntax error: non-space string used after </TABLE>");
2125 (yyval.
tbl) = HTMLstate.tblstack;
2126 HTMLstate.tblstack = HTMLstate.tblstack->u.p.prev;
2132 #line 548 "../../lib/common/htmlparse.y"
2133 { (yyval.
tbl) = (yyvsp[(1) - (1)].tbl); }
2138 #line 549 "../../lib/common/htmlparse.y"
2139 { (yyval.
tbl)=(yyvsp[(2) - (3)].tbl); }
2144 #line 550 "../../lib/common/htmlparse.y"
2145 { (yyval.
tbl)=(yyvsp[(2) - (3)].tbl); }
2150 #line 551 "../../lib/common/htmlparse.y"
2151 { (yyval.
tbl)=(yyvsp[(2) - (3)].tbl); }
2156 #line 552 "../../lib/common/htmlparse.y"
2157 { (yyval.
tbl)=(yyvsp[(2) - (3)].tbl); }
2162 #line 553 "../../lib/common/htmlparse.y"
2163 { (yyval.
tbl)=(yyvsp[(2) - (3)].tbl); }
2168 #line 560 "../../lib/common/htmlparse.y"
2169 { (yyval.
p) = (yyvsp[(1) - (1)].p); }
2174 #line 561 "../../lib/common/htmlparse.y"
2175 { (yyval.
p) = (yyvsp[(2) - (2)].p); }
2180 #line 562 "../../lib/common/htmlparse.y"
2181 { (yyvsp[(1) - (3)].p)->ruled = 1; (yyval.
p) = (yyvsp[(3) - (3)].p); }
2186 #line 565 "../../lib/common/htmlparse.y"
2192 #line 565 "../../lib/common/htmlparse.y"
2193 { (yyval.
p) = lastRow(); }
2198 #line 568 "../../lib/common/htmlparse.y"
2199 { (yyval.
cell) = (yyvsp[(1) - (1)].
cell); }
2204 #line 569 "../../lib/common/htmlparse.y"
2205 { (yyval.
cell) = (yyvsp[(2) - (2)].
cell); }
2210 #line 570 "../../lib/common/htmlparse.y"
2211 { (yyvsp[(1) - (3)].cell)->ruled |=
HTML_VRULE; (yyval.
cell) = (yyvsp[(3) - (3)].
cell); }
2216 #line 573 "../../lib/common/htmlparse.y"
2217 { setCell((yyvsp[(1) - (2)].
cell),(yyvsp[(2) - (2)].tbl),
HTML_TBL); }
2222 #line 573 "../../lib/common/htmlparse.y"
2223 { (yyval.
cell) = (yyvsp[(1) - (4)].
cell); }
2228 #line 574 "../../lib/common/htmlparse.y"
2229 { setCell((yyvsp[(1) - (2)].
cell),(yyvsp[(2) - (2)].txt),
HTML_TEXT); }
2234 #line 574 "../../lib/common/htmlparse.y"
2235 { (yyval.
cell) = (yyvsp[(1) - (4)].
cell); }
2240 #line 575 "../../lib/common/htmlparse.y"
2241 { setCell((yyvsp[(1) - (2)].
cell),(yyvsp[(2) - (2)].img),
HTML_IMAGE); }
2246 #line 575 "../../lib/common/htmlparse.y"
2247 { (yyval.
cell) = (yyvsp[(1) - (4)].
cell); }
2252 #line 576 "../../lib/common/htmlparse.y"
2258 #line 576 "../../lib/common/htmlparse.y"
2259 { (yyval.
cell) = (yyvsp[(1) - (3)].
cell); }
2264 #line 579 "../../lib/common/htmlparse.y"
2265 { (yyval.
img) = (yyvsp[(1) - (2)].img); }
2270 #line 580 "../../lib/common/htmlparse.y"
2271 { (yyval.
img) = (yyvsp[(1) - (1)].img); }
2276 #line 2277 "y.tab.c"
2305 if (0 <= yystate && yystate <=
YYLAST && yycheck[yystate] == *yyssp)
2325 #if ! YYERROR_VERBOSE
2328 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2331 char const *yymsgp =
YY_(
"syntax error");
2332 int yysyntax_error_status;
2333 yysyntax_error_status = YYSYNTAX_ERROR;
2334 if (yysyntax_error_status == 0)
2336 else if (yysyntax_error_status == 1)
2338 if (yymsg != yymsgbuf)
2344 yymsg_alloc =
sizeof yymsgbuf;
2345 yysyntax_error_status = 2;
2349 yysyntax_error_status = YYSYNTAX_ERROR;
2354 if (yysyntax_error_status == 2)
2355 goto yyexhaustedlab;
2357 # undef YYSYNTAX_ERROR
2363 if (yyerrstatus == 3)
2368 if (yychar <=
YYEOF)
2371 if (yychar ==
YYEOF)
2433 yystos[yystate], yyvsp);
2465 #if !defined yyoverflow || YYERROR_VERBOSE
2488 while (yyssp != yyss)
2491 yystos[*yyssp], yyvsp);
2499 if (yymsg != yymsgbuf)
2503 return YYID (yyresult);
2508 #line 592 "../../lib/common/htmlparse.y"
2525 HTMLstate.fontstack = &dfltf;
2526 HTMLstate.tblstack = 0;
2528 HTMLstate.gvc =
GD_gvc(env->
g);
2533 HTMLstate.str = &
str;
2545 dtclose (HTMLstate.fitemList);
2546 dtclose (HTMLstate.fspanList);
2548 HTMLstate.fitemList =
NULL;
2549 HTMLstate.fspanList =
NULL;
2550 HTMLstate.fontstack =
NULL;
int(* Dtcompar_f)(Dt_t *, void *, void *, Dtdisc_t *)
unsigned int(* Dthash_f)(Dt_t *, void *, Dtdisc_t *)
#define yytable_value_is_error(Yytable_value)
CDT_API int dtclose(Dt_t *)
void *(* Dtmake_f)(Dt_t *, void *, Dtdisc_t *)
#define YYSTACK_ALLOC_MAXIMUM
int initHTMLlexer(char *src, agxbuf *xb, htmlenv_t *env)
CDT_API Dtlink_t * dtflatten(Dt_t *)
yydestruct("Cleanup: discarding lookahead", yytoken,&yylval)
htmllabel_t * parseHTML(char *txt, int *warn, htmlenv_t *env)
void free_html_text(htmltxt_t *t)
CDT_API Dt_t * dtopen(Dtdisc_t *, Dtmethod_t *)
CDT_API Dtmethod_t * Dtqueue
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
void free_html_label(htmllabel_t *lp, int root)
yytype_int16 yyssa[YYINITDEPTH]
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
unsigned short int yytype_uint16
#define YY_INITIAL_VALUE(Value)
void *(* Dtmemory_f)(Dt_t *, void *, size_t, Dtdisc_t *)
#define YY_REDUCE_PRINT(Rule)
void agxbinit(agxbuf *xb, unsigned int hint, unsigned char *init)
struct htmltbl_t::@12::@14 p
CDT_API int dtsize(Dt_t *)
void free_html_data(htmldata_t *dp)
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
int(* Dtevent_f)(Dt_t *, int, void *, Dtdisc_t *)
void(* Dtfree_f)(Dt_t *, void *, Dtdisc_t *)
YY_IGNORE_MAYBE_UNINITIALIZED_END goto yynewstate
#define yypact_value_is_default(Yystate)
unsigned char yytype_uint8
#define YY_STACK_PRINT(Bottom, Top)
void agxbfree(agxbuf *xb)
YYSTYPE yyvsa[YYINITDEPTH]