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
495 extern int htmldebug;
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 htmlstype YYSTYPE
606 # define YYSTYPE_IS_DECLARED 1
612 #if defined __STDC__ || defined __cplusplus
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 htmloverflow || 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 htmloverflow \
788 && (! defined __cplusplus \
789 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
799 # define YYSTACK_GAP_MAXIMUM (sizeof (union htmlalloc) - 1)
803 # define YYSTACK_BYTES(N) \
804 ((N) * (sizeof (htmltype_int16) + sizeof (YYSTYPE)) \
805 + YYSTACK_GAP_MAXIMUM)
807 # define YYCOPY_NEEDED 1
814 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
817 YYSIZE_T htmlnewbytes; \
818 YYCOPY (&htmlptr->Stack_alloc, Stack, htmlsize); \
819 Stack = &htmlptr->Stack_alloc; \
820 htmlnewbytes = htmlstacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
821 htmlptr += htmlnewbytes / sizeof (*htmlptr); \
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 (htmli = 0; htmli < (Count); htmli++) \
840 (Dst)[htmli] = (Src)[htmli]; \
859 #define YYNSTATES 116
863 #define YYMAXUTOK 295
865 #define YYTRANSLATE(YYX) \
866 ((unsigned int) (YYX) <= YYMAXUTOK ? htmltranslate[YYX] : YYUNDEFTOK)
869 static const htmltype_uint8 htmltranslate[] =
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 htmltype_uint8 htmlprhs[] =
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 htmltype_int8 htmlrhs[] =
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 htmltype_uint16 htmlrline[] =
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 htmltname[] =
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 htmltype_uint16 htmltoknum[] =
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 htmltype_uint8 htmlr1[] =
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 htmltype_uint8 htmlr2[] =
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 htmltype_uint8 htmldefact[] =
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 htmltype_int8 htmldefgoto[] =
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 htmltype_int16 htmlpact[] =
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 htmltype_int16 htmlpgoto[] =
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 htmltype_int8 htmltable[] =
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 htmlpact_value_is_default(Yystate) \
1105 (!!((Yystate) == (-82)))
1107 #define htmltable_value_is_error(Yytable_value) \
1110 static const htmltype_int8 htmlcheck[] =
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 htmltype_uint8 htmlstos[] =
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 htmlerrok (htmlerrstatus = 0)
1161 #define htmlclearin (htmlchar = YYEMPTY)
1162 #define YYEMPTY (-2)
1165 #define YYACCEPT goto htmlacceptlab
1166 #define YYABORT goto htmlabortlab
1167 #define YYERROR goto htmlerrorlab
1177 #define YYFAIL goto htmlerrlab
1185 #define YYRECOVERING() (!!htmlerrstatus)
1187 #define YYBACKUP(Token, Value) \
1189 if (htmlchar == YYEMPTY) \
1191 htmlchar = (Token); \
1192 htmllval = (Value); \
1193 YYPOPSTACK (htmllen); \
1194 htmlstate = *htmlssp; \
1199 htmlerror (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 htmllex (YYLEX_PARAM)
1219 # define YYLEX htmllex ()
1227 # define YYFPRINTF fprintf
1230 # define YYDPRINTF(Args) \
1236 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1240 YYFPRINTF (stderr, "%s ", Title); \
1241 html_symbol_print (stderr, \
1243 YYFPRINTF (stderr, "\n"); \
1253 #if (defined __STDC__ || defined __C99__FUNC__ \
1254 || defined __cplusplus || defined _MSC_VER)
1259 html_symbol_value_print (htmloutput, htmltype, htmlvaluep)
1262 YYSTYPE const * const htmlvaluep;
1265 FILE *htmlo = htmloutput;
1271 YYPRINT (htmloutput, htmltoknum[htmltype], *htmlvaluep);
1287 #if (defined __STDC__ || defined __C99__FUNC__ \
1288 || defined __cplusplus || defined _MSC_VER)
1290 html_symbol_print (FILE *htmloutput,
int htmltype,
YYSTYPE const *
const htmlvaluep)
1293 html_symbol_print (htmloutput, htmltype, htmlvaluep)
1296 YYSTYPE const * const htmlvaluep;
1300 YYFPRINTF (htmloutput,
"token %s (", htmltname[htmltype]);
1302 YYFPRINTF (htmloutput,
"nterm %s (", htmltname[htmltype]);
1304 html_symbol_value_print (htmloutput, htmltype, htmlvaluep);
1305 YYFPRINTF (htmloutput,
")");
1313 #if (defined __STDC__ || defined __C99__FUNC__ \
1314 || defined __cplusplus || defined _MSC_VER)
1316 html_stack_print (htmltype_int16 *htmlbottom, htmltype_int16 *htmltop)
1319 html_stack_print (htmlbottom, htmltop)
1320 htmltype_int16 *htmlbottom;
1321 htmltype_int16 *htmltop;
1324 YYFPRINTF (stderr,
"Stack now");
1325 for (; htmlbottom <= htmltop; htmlbottom++)
1327 int htmlbot = *htmlbottom;
1328 YYFPRINTF (stderr,
" %d", htmlbot);
1330 YYFPRINTF (stderr,
"\n");
1333 # define YY_STACK_PRINT(Bottom, Top) \
1336 html_stack_print ((Bottom), (Top)); \
1344 #if (defined __STDC__ || defined __C99__FUNC__ \
1345 || defined __cplusplus || defined _MSC_VER)
1350 html_reduce_print (htmlvsp, htmlrule)
1355 int htmlnrhs = htmlr2[htmlrule];
1357 unsigned long int htmllno = htmlrline[htmlrule];
1358 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %lu):\n",
1359 htmlrule - 1, htmllno);
1361 for (htmli = 0; htmli < htmlnrhs; htmli++)
1363 YYFPRINTF (stderr,
" $%d = ", htmli + 1);
1364 html_symbol_print (stderr, htmlrhs[htmlprhs[htmlrule] + htmli],
1365 &(htmlvsp[(htmli + 1) - (htmlnrhs)])
1367 YYFPRINTF (stderr,
"\n");
1371 # define YY_REDUCE_PRINT(Rule) \
1374 html_reduce_print (htmlvsp, 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 htmlstrlen strlen
1412 #if (defined __STDC__ || defined __C99__FUNC__ \
1413 || defined __cplusplus || defined _MSC_VER)
1415 htmlstrlen (
const char *htmlstr)
1418 htmlstrlen (htmlstr)
1419 const
char *htmlstr;
1423 for (htmllen = 0; htmlstr[
htmllen]; htmllen++)
1431 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1432 # define htmlstpcpy stpcpy
1436 #if (defined __STDC__ || defined __C99__FUNC__ \
1437 || defined __cplusplus || defined _MSC_VER)
1439 htmlstpcpy (
char *htmldest,
const char *htmlsrc)
1442 htmlstpcpy (htmldest, htmlsrc)
1444 const
char *htmlsrc;
1447 char *htmld = htmldest;
1448 const char *htmls = htmlsrc;
1450 while ((*htmld++ = *htmls++) !=
'\0')
1458 # ifndef htmltnamerr
1467 htmltnamerr (
char *htmlres,
const char *htmlstr)
1469 if (*htmlstr ==
'"')
1472 char const *htmlp = htmlstr;
1479 goto do_not_strip_quotes;
1482 if (*++htmlp !=
'\\')
1483 goto do_not_strip_quotes;
1487 htmlres[
htmln] = *htmlp;
1493 htmlres[
htmln] =
'\0';
1496 do_not_strip_quotes: ;
1500 return htmlstrlen (htmlstr);
1502 return htmlstpcpy (htmlres, htmlstr) - htmlres;
1515 htmlsyntax_error (
YYSIZE_T *htmlmsg_alloc,
char **htmlmsg,
1520 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1522 const char *htmlformat =
YY_NULL;
1524 char const *htmlarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1558 int htmln = htmlpact[*
htmlssp];
1559 htmlarg[htmlcount++] = htmltname[
htmltoken];
1565 int htmlxbegin = htmln < 0 ? -htmln : 0;
1567 int htmlchecklim =
YYLAST - htmln + 1;
1571 for (htmlx = htmlxbegin; htmlx < htmlxend; ++htmlx)
1572 if (htmlcheck[htmlx + htmln] == htmlx && htmlx !=
YYTERROR
1575 if (htmlcount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1578 htmlsize = htmlsize0;
1581 htmlarg[htmlcount++] = htmltname[htmlx];
1583 YYSIZE_T htmlsize1 = htmlsize + htmltnamerr (
YY_NULL, htmltname[htmlx]);
1584 if (! (htmlsize <= htmlsize1
1587 htmlsize = htmlsize1;
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 htmlsize1 = htmlsize + htmlstrlen (htmlformat);
1612 htmlsize = htmlsize1;
1615 if (*htmlmsg_alloc < htmlsize)
1617 *htmlmsg_alloc = 2 * htmlsize;
1618 if (! (htmlsize <= *htmlmsg_alloc
1628 char *htmlp = *htmlmsg;
1630 while ((*htmlp = *htmlformat) !=
'\0')
1631 if (*htmlp ==
'%' && htmlformat[1] ==
's' && htmli < htmlcount)
1633 htmlp += htmltnamerr (htmlp, htmlarg[htmli++]);
1651 #if (defined __STDC__ || defined __C99__FUNC__ \
1652 || defined __cplusplus || defined _MSC_VER)
1658 const
char *htmlmsg;
1666 htmlmsg =
"Deleting";
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)
1758 char htmlmsgbuf[128];
1759 char *htmlmsg = htmlmsgbuf;
1760 YYSIZE_T htmlmsg_alloc =
sizeof htmlmsgbuf;
1763 #define YYPOPSTACK(N) (htmlvsp -= (N), htmlssp -= (N))
1773 YYDPRINTF ((stderr,
"Starting parse\n"));
1792 if (htmlss + htmlstacksize - 1 <= htmlssp)
1795 YYSIZE_T htmlsize = htmlssp - htmlss + 1;
1803 htmltype_int16 *htmlss1 =
htmlss;
1809 htmloverflow (
YY_(
"memory exhausted"),
1810 &htmlss1, htmlsize *
sizeof (*htmlssp),
1811 &htmlvs1, htmlsize *
sizeof (*htmlvsp),
1818 # ifndef YYSTACK_RELOCATE
1819 goto htmlexhaustedlab;
1823 goto htmlexhaustedlab;
1829 htmltype_int16 *htmlss1 =
htmlss;
1833 goto htmlexhaustedlab;
1836 # undef YYSTACK_RELOCATE
1837 if (htmlss1 != htmlssa)
1843 htmlssp = htmlss + htmlsize - 1;
1844 htmlvsp = htmlvs + htmlsize - 1;
1846 YYDPRINTF ((stderr,
"Stack size increased to %lu\n",
1847 (
unsigned long int) htmlstacksize));
1849 if (htmlss + htmlstacksize - 1 <= htmlssp)
1853 YYDPRINTF ((stderr,
"Entering state %d\n", htmlstate));
1878 YYDPRINTF ((stderr,
"Reading a token: "));
1884 htmlchar = htmltoken =
YYEOF;
1885 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1896 if (htmln < 0 ||
YYLAST < htmln || htmlcheck[htmln] != htmltoken)
1898 htmln = htmltable[
htmln];
1959 #line 447 "../../lib/common/htmlparse.y"
1960 { HTMLstate.lbl = mkLabel((htmlvsp[(2) - (3)].txt),
HTML_TEXT); }
1965 #line 448 "../../lib/common/htmlparse.y"
1966 { HTMLstate.lbl = mkLabel((htmlvsp[(2) - (3)].tbl),
HTML_TBL); }
1971 #line 449 "../../lib/common/htmlparse.y"
1977 #line 452 "../../lib/common/htmlparse.y"
1978 { (htmlval.
txt) = mkText(); }
1983 #line 459 "../../lib/common/htmlparse.y"
1984 { appendFItemList(HTMLstate.str);}
1989 #line 460 "../../lib/common/htmlparse.y"
1990 {appendFLineList((htmlvsp[(1) - (1)].i));}
1995 #line 471 "../../lib/common/htmlparse.y"
1996 { pushFont ((htmlvsp[(1) - (1)].font)); }
2001 #line 474 "../../lib/common/htmlparse.y"
2007 #line 477 "../../lib/common/htmlparse.y"
2008 {pushFont((htmlvsp[(1) - (1)].font));}
2013 #line 480 "../../lib/common/htmlparse.y"
2019 #line 483 "../../lib/common/htmlparse.y"
2020 {pushFont((htmlvsp[(1) - (1)].font));}
2025 #line 486 "../../lib/common/htmlparse.y"
2031 #line 489 "../../lib/common/htmlparse.y"
2032 {pushFont((htmlvsp[(1) - (1)].font));}
2037 #line 492 "../../lib/common/htmlparse.y"
2043 #line 495 "../../lib/common/htmlparse.y"
2044 {pushFont((htmlvsp[(1) - (1)].font));}
2049 #line 498 "../../lib/common/htmlparse.y"
2055 #line 501 "../../lib/common/htmlparse.y"
2056 {pushFont((htmlvsp[(1) - (1)].font));}
2061 #line 504 "../../lib/common/htmlparse.y"
2067 #line 507 "../../lib/common/htmlparse.y"
2068 {pushFont((htmlvsp[(1) - (1)].font));}
2073 #line 510 "../../lib/common/htmlparse.y"
2079 #line 513 "../../lib/common/htmlparse.y"
2080 {pushFont((htmlvsp[(1) - (1)].font));}
2085 #line 516 "../../lib/common/htmlparse.y"
2091 #line 519 "../../lib/common/htmlparse.y"
2092 { (htmlval.
i) = (htmlvsp[(1) - (2)].i); }
2097 #line 520 "../../lib/common/htmlparse.y"
2098 { (htmlval.
i) = (htmlvsp[(1) - (1)].i); }
2103 #line 527 "../../lib/common/htmlparse.y"
2105 if (nonSpace(
agxbuse(HTMLstate.str))) {
2106 htmlerror (
"Syntax error: non-space string used before <TABLE>");
2109 (htmlvsp[(2) - (2)].tbl)->u.p.prev = HTMLstate.tblstack;
2110 (htmlvsp[(2) - (2)].tbl)->u.p.rows =
dtopen(&rowDisc,
Dtqueue);
2111 HTMLstate.tblstack = (htmlvsp[(2) - (2)].tbl);
2112 (htmlvsp[(2) - (2)].tbl)->font = HTMLstate.fontstack->cfont;
2113 (htmlval.
tbl) = (htmlvsp[(2) - (2)].tbl);
2119 #line 538 "../../lib/common/htmlparse.y"
2121 if (nonSpace(
agxbuse(HTMLstate.str))) {
2122 htmlerror (
"Syntax error: non-space string used after </TABLE>");
2125 (htmlval.
tbl) = HTMLstate.tblstack;
2126 HTMLstate.tblstack = HTMLstate.tblstack->u.p.prev;
2132 #line 548 "../../lib/common/htmlparse.y"
2133 { (htmlval.
tbl) = (htmlvsp[(1) - (1)].tbl); }
2138 #line 549 "../../lib/common/htmlparse.y"
2139 { (htmlval.
tbl)=(htmlvsp[(2) - (3)].tbl); }
2144 #line 550 "../../lib/common/htmlparse.y"
2145 { (htmlval.
tbl)=(htmlvsp[(2) - (3)].tbl); }
2150 #line 551 "../../lib/common/htmlparse.y"
2151 { (htmlval.
tbl)=(htmlvsp[(2) - (3)].tbl); }
2156 #line 552 "../../lib/common/htmlparse.y"
2157 { (htmlval.
tbl)=(htmlvsp[(2) - (3)].tbl); }
2162 #line 553 "../../lib/common/htmlparse.y"
2163 { (htmlval.
tbl)=(htmlvsp[(2) - (3)].tbl); }
2168 #line 560 "../../lib/common/htmlparse.y"
2169 { (htmlval.
p) = (htmlvsp[(1) - (1)].p); }
2174 #line 561 "../../lib/common/htmlparse.y"
2175 { (htmlval.
p) = (htmlvsp[(2) - (2)].p); }
2180 #line 562 "../../lib/common/htmlparse.y"
2181 { (htmlvsp[(1) - (3)].p)->ruled = 1; (htmlval.
p) = (htmlvsp[(3) - (3)].p); }
2186 #line 565 "../../lib/common/htmlparse.y"
2192 #line 565 "../../lib/common/htmlparse.y"
2193 { (htmlval.
p) = lastRow(); }
2198 #line 568 "../../lib/common/htmlparse.y"
2199 { (htmlval.
cell) = (htmlvsp[(1) - (1)].
cell); }
2204 #line 569 "../../lib/common/htmlparse.y"
2205 { (htmlval.
cell) = (htmlvsp[(2) - (2)].
cell); }
2210 #line 570 "../../lib/common/htmlparse.y"
2211 { (htmlvsp[(1) - (3)].cell)->ruled |=
HTML_VRULE; (htmlval.
cell) = (htmlvsp[(3) - (3)].
cell); }
2216 #line 573 "../../lib/common/htmlparse.y"
2217 { setCell((htmlvsp[(1) - (2)].
cell),(htmlvsp[(2) - (2)].tbl),
HTML_TBL); }
2222 #line 573 "../../lib/common/htmlparse.y"
2223 { (htmlval.
cell) = (htmlvsp[(1) - (4)].
cell); }
2228 #line 574 "../../lib/common/htmlparse.y"
2229 { setCell((htmlvsp[(1) - (2)].
cell),(htmlvsp[(2) - (2)].txt),
HTML_TEXT); }
2234 #line 574 "../../lib/common/htmlparse.y"
2235 { (htmlval.
cell) = (htmlvsp[(1) - (4)].
cell); }
2240 #line 575 "../../lib/common/htmlparse.y"
2241 { setCell((htmlvsp[(1) - (2)].
cell),(htmlvsp[(2) - (2)].img),
HTML_IMAGE); }
2246 #line 575 "../../lib/common/htmlparse.y"
2247 { (htmlval.
cell) = (htmlvsp[(1) - (4)].
cell); }
2252 #line 576 "../../lib/common/htmlparse.y"
2258 #line 576 "../../lib/common/htmlparse.y"
2259 { (htmlval.
cell) = (htmlvsp[(1) - (3)].
cell); }
2264 #line 579 "../../lib/common/htmlparse.y"
2265 { (htmlval.
img) = (htmlvsp[(1) - (2)].img); }
2270 #line 580 "../../lib/common/htmlparse.y"
2271 { (htmlval.
img) = (htmlvsp[(1) - (1)].img); }
2276 #line 2277 "y.tab.c"
2302 htmln = htmlr1[
htmln];
2305 if (0 <= htmlstate && htmlstate <=
YYLAST && htmlcheck[htmlstate] == *htmlssp)
2308 htmlstate = htmldefgoto[htmln -
YYNTOKENS];
2325 #if ! YYERROR_VERBOSE
2328 # define YYSYNTAX_ERROR htmlsyntax_error (&htmlmsg_alloc, &htmlmsg, \
2331 char const *htmlmsgp =
YY_(
"syntax error");
2332 int htmlsyntax_error_status;
2333 htmlsyntax_error_status = YYSYNTAX_ERROR;
2334 if (htmlsyntax_error_status == 0)
2336 else if (htmlsyntax_error_status == 1)
2338 if (htmlmsg != htmlmsgbuf)
2343 htmlmsg = htmlmsgbuf;
2344 htmlmsg_alloc =
sizeof htmlmsgbuf;
2345 htmlsyntax_error_status = 2;
2349 htmlsyntax_error_status = YYSYNTAX_ERROR;
2354 if (htmlsyntax_error_status == 2)
2355 goto htmlexhaustedlab;
2357 # undef YYSYNTAX_ERROR
2363 if (htmlerrstatus == 3)
2368 if (htmlchar <=
YYEOF)
2371 if (htmlchar ==
YYEOF)
2377 htmltoken, &htmllval);
2419 if (0 <= htmln && htmln <=
YYLAST && htmlcheck[htmln] ==
YYTERROR)
2421 htmln = htmltable[
htmln];
2428 if (htmlssp == htmlss)
2433 htmlstos[htmlstate], htmlvsp);
2465 #if !defined htmloverflow || YYERROR_VERBOSE
2482 htmltoken, &htmllval);
2488 while (htmlssp != htmlss)
2491 htmlstos[*htmlssp], htmlvsp);
2494 #ifndef htmloverflow
2495 if (htmlss != htmlssa)
2499 if (htmlmsg != htmlmsgbuf)
2503 return YYID (htmlresult);
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 YYSTACK_RELOCATE(Stack_alloc, Stack)
CDT_API int dtclose(Dt_t *)
#define htmltable_value_is_error(Yytable_value)
void *(* Dtmake_f)(Dt_t *, void *, Dtdisc_t *)
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
int initHTMLlexer(char *src, agxbuf *xb, htmlenv_t *env)
CDT_API Dtlink_t * dtflatten(Dt_t *)
htmllabel_t * parseHTML(char *txt, int *warn, htmlenv_t *env)
#define htmlpact_value_is_default(Yystate)
void free_html_text(htmltxt_t *t)
CDT_API Dt_t * dtopen(Dtdisc_t *, Dtmethod_t *)
CDT_API Dtmethod_t * Dtqueue
unsigned char htmltype_uint8
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
void free_html_label(htmllabel_t *lp, int root)
#define YY_INITIAL_VALUE(Value)
void *(* Dtmemory_f)(Dt_t *, void *, size_t, Dtdisc_t *)
#define YY_REDUCE_PRINT(Rule)
htmltype_int16 htmlssa[YYINITDEPTH]
void agxbinit(agxbuf *xb, unsigned int hint, unsigned char *init)
struct htmltbl_t::@12::@14 p
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
CDT_API int dtsize(Dt_t *)
void free_html_data(htmldata_t *dp)
YYSTYPE htmlvsa[YYINITDEPTH]
#define YYSTACK_ALLOC_MAXIMUM
int(* Dtevent_f)(Dt_t *, int, void *, Dtdisc_t *)
void(* Dtfree_f)(Dt_t *, void *, Dtdisc_t *)
void htmlerror(const char *msg)
YY_IGNORE_MAYBE_UNINITIALIZED_END goto htmlnewstate
unsigned short int htmltype_uint16
htmltype_int16 htmlss_alloc
htmldestruct("Cleanup: discarding lookahead", htmltoken,&htmllval)
#define YY_STACK_PRINT(Bottom, Top)
void agxbfree(agxbuf *xb)