Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
htmlparse.c
Go to the documentation of this file.
1/* A Bison parser, made by GNU Bison 3.5.1. */
2
3/* Bison implementation for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
6 Inc.
7
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20
21/* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
30
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
33
34/* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
36
37/* All symbols defined below should begin with yy or YY, to avoid
38 infringing on user name space. This should be done even for local
39 variables, as they might otherwise be expanded by user macros.
40 There are some unavoidable exceptions within include files to
41 define necessary library symbols; they are noted "INFRINGES ON
42 USER NAME SPACE" below. */
43
44/* Undocumented macros, especially those whose name start with YY_,
45 are private implementation details. Do not rely on them. */
46
47/* Identify Bison output. */
48#define YYBISON 1
49
50/* Bison version. */
51#define YYBISON_VERSION "3.5.1"
52
53/* Skeleton name. */
54#define YYSKELETON_NAME "yacc.c"
55
56/* Pure parsers. */
57#define YYPURE 2
58
59/* Push parsers. */
60#define YYPUSH 0
61
62/* Pull parsers. */
63#define YYPULL 1
64
65/* Substitute the type names. */
66#define YYSTYPE HTMLSTYPE
67/* Substitute the variable and function names. */
68#define yyparse htmlparse
69#define yylex htmllex
70#define yyerror htmlerror
71#define yydebug htmldebug
72#define yynerrs htmlnerrs
73
74/* First part of user prologue. */
75#line 90 "../../lib/common/htmlparse.y"
76
77
78#include <common/render.h>
79#include <common/htmltable.h>
80#include <common/htmllex.h>
81#include <stdbool.h>
82#include <util/alloc.h>
83
85static void cleanCell(htmlcell_t *cp);
86
88static void cleanTbl(htmltbl_t *tp) {
89 rows_t *rows = &tp->u.p.rows;
90 for (size_t r = 0; r < rows_size(rows); ++r) {
91 row_t *rp = rows_get(rows, r);
92 for (size_t c = 0; c < cells_size(&rp->rp); ++c) {
93 cleanCell(cells_get(&rp->rp, c));
94 }
95 }
96 rows_free(rows);
97 free_html_data(&tp->data);
98 free(tp);
99}
100
102static void
104{
105 if (cp->child.kind == HTML_TBL) cleanTbl (cp->child.u.tbl);
106 else if (cp->child.kind == HTML_TEXT) free_html_text (cp->child.u.txt);
107 free_html_data (&cp->data);
108 free (cp);
109}
110
112static void
113appendFItemList (htmlparserstate_t *html_state, agxbuf *ag);
114
115static void
116appendFLineList (htmlparserstate_t *html_state, int v);
117
118static htmltxt_t*
119mkText(htmlparserstate_t *html_state);
120
121static row_t *lastRow(htmlparserstate_t *html_state);
122
124static void addRow(htmlparserstate_t *html_state);
125
127static void setCell(htmlparserstate_t *html_state, htmlcell_t *cp, void *obj, label_type_t kind);
128
130static htmllabel_t *mkLabel(void *obj, label_type_t kind) {
131 htmllabel_t* lp = gv_alloc(sizeof(htmllabel_t));
132
133 lp->kind = kind;
134 if (kind == HTML_TEXT)
135 lp->u.txt = obj;
136 else
137 lp->u.tbl = obj;
138 return lp;
139}
140
141/* Called on error. Frees resources allocated during parsing.
142 * This includes a label, plus a walk down the stack of
143 * tables. Note that `cleanTbl` frees the contained cells.
144 */
145static void cleanup (htmlparserstate_t *html_state);
146
148static bool nonSpace(const char *s) {
149 char c;
150
151 while ((c = *s++)) {
152 if (c != ' ') return true;
153 }
154 return false;
155}
156
158static void
159pushFont (htmlparserstate_t *html_state, textfont_t *fp);
160
161static void
162popFont (htmlparserstate_t *html_state);
163
164
165#line 166 "htmlparse.c"
166
167# ifndef YY_CAST
168# ifdef __cplusplus
169# define YY_CAST(Type, Val) static_cast<Type> (Val)
170# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
171# else
172# define YY_CAST(Type, Val) ((Type) (Val))
173# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
174# endif
175# endif
176# ifndef YY_NULLPTR
177# if defined __cplusplus
178# if 201103L <= __cplusplus
179# define YY_NULLPTR nullptr
180# else
181# define YY_NULLPTR 0
182# endif
183# else
184# define YY_NULLPTR ((void*)0)
185# endif
186# endif
187
188/* Enabling verbose error messages. */
189#ifdef YYERROR_VERBOSE
190# undef YYERROR_VERBOSE
191# define YYERROR_VERBOSE 1
192#else
193# define YYERROR_VERBOSE 0
194#endif
195
196/* Use api.header.include to #include this header
197 instead of duplicating it here. */
198#ifndef YY_HTML_HTMLPARSE_H_INCLUDED
199# define YY_HTML_HTMLPARSE_H_INCLUDED
200/* Debug traces. */
201#ifndef HTMLDEBUG
202# if defined YYDEBUG
203#if YYDEBUG
204# define HTMLDEBUG 1
205# else
206# define HTMLDEBUG 0
207# endif
208# else /* ! defined YYDEBUG */
209# define HTMLDEBUG 0
210# endif /* ! defined YYDEBUG */
211#endif /* ! defined HTMLDEBUG */
212#if HTMLDEBUG
213extern int htmldebug;
214#endif
215/* "%code requires" blocks. */
216#line 26 "../../lib/common/htmlparse.y"
217
218#include <cgraph/list.h>
219#include <common/htmllex.h>
220#include <common/htmltable.h>
221#include <common/textspan.h>
222#include <gvc/gvcext.h>
223#include <util/agxbuf.h>
224#include <util/strview.h>
225
226#line 227 "htmlparse.c"
227
228/* Token type. */
229#ifndef HTMLTOKENTYPE
230# define HTMLTOKENTYPE
232 {
233 T_end_br = 258,
235 T_row = 260,
237 T_html = 262,
242 T_string = 267,
243 T_error = 268,
245 T_n_bold = 270,
248 T_n_sup = 273,
249 T_n_sub = 274,
250 T_n_s = 275,
251 T_HR = 276,
252 T_hr = 277,
253 T_end_hr = 278,
254 T_VR = 279,
255 T_vr = 280,
256 T_end_vr = 281,
257 T_BR = 282,
258 T_br = 283,
259 T_IMG = 284,
260 T_img = 285,
261 T_table = 286,
262 T_cell = 287,
263 T_font = 288,
264 T_italic = 289,
265 T_bold = 290,
268 T_sup = 293,
269 T_sub = 294,
270 T_s = 295
271 };
272#endif
273/* Tokens. */
274#define T_end_br 258
275#define T_end_img 259
276#define T_row 260
277#define T_end_row 261
278#define T_html 262
279#define T_end_html 263
280#define T_end_table 264
281#define T_end_cell 265
282#define T_end_font 266
283#define T_string 267
284#define T_error 268
285#define T_n_italic 269
286#define T_n_bold 270
287#define T_n_underline 271
288#define T_n_overline 272
289#define T_n_sup 273
290#define T_n_sub 274
291#define T_n_s 275
292#define T_HR 276
293#define T_hr 277
294#define T_end_hr 278
295#define T_VR 279
296#define T_vr 280
297#define T_end_vr 281
298#define T_BR 282
299#define T_br 283
300#define T_IMG 284
301#define T_img 285
302#define T_table 286
303#define T_cell 287
304#define T_font 288
305#define T_italic 289
306#define T_bold 290
307#define T_underline 291
308#define T_overline 292
309#define T_sup 293
310#define T_sub 294
311#define T_s 295
312
313/* Value type. */
314#if ! defined HTMLSTYPE && ! defined HTMLSTYPE_IS_DECLARED
316{
317#line 180 "../../lib/common/htmlparse.y"
318
319 int i;
326
327#line 328 "htmlparse.c"
328
329};
330typedef union HTMLSTYPE HTMLSTYPE;
331# define HTMLSTYPE_IS_TRIVIAL 1
332# define HTMLSTYPE_IS_DECLARED 1
333#endif
334
335
336
338/* "%code provides" blocks. */
339#line 36 "../../lib/common/htmlparse.y"
340
341
342DEFINE_LIST(sfont, textfont_t *)
343
344static inline void free_ti(textspan_t item) {
345 free(item.str);
346}
347
349
350static inline void free_hi(htextspan_t item) {
351 for (size_t i = 0; i < item.nitems; i++) {
352 free(item.items[i].str);
353 }
354 free(item.items);
355}
356
358
360 htmllabel_t* lbl; /* Generated label */
361 htmltbl_t* tblstack; /* Stack of tables maintained during parsing */
362 textspans_t fitemList;
363 htextspans_t fspanList;
364 agxbuf* str; /* Buffer for text */
365 sfont_t fontstack;
367};
368
369typedef struct {
370#ifdef HAVE_EXPAT
371 struct XML_ParserStruct *parser;
372#endif
373 char* ptr; // input source
374 int tok; // token type
375 agxbuf* xb; // buffer to gather T_string data
376 agxbuf lb; // buffer for translating lexical data
377 int warn; // set if warning given
378 int error; // set if error given
379 char inCell; // set if in TD to allow T_string
380 char mode; // for handling artificial <HTML>..</HTML>
381 strview_t currtok; // for error reporting
382 strview_t prevtok; // for error reporting
383 GVC_t *gvc; // current GraphViz context
384 HTMLSTYPE *htmllval; // generated by htmlparse.y
386
387
392
393#line 394 "htmlparse.c"
394
395#endif /* !YY_HTML_HTMLPARSE_H_INCLUDED */
396
397
398
399#ifdef short
400# undef short
401#endif
402
403/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
404 <limits.h> and (if available) <stdint.h> are included
405 so that the code can choose integer types of a good width. */
406
407#ifndef __PTRDIFF_MAX__
408# include <limits.h> /* INFRINGES ON USER NAME SPACE */
409# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
410# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
411# define YY_STDINT_H
412# endif
413#endif
414
415/* Narrow types that promote to a signed type and that can represent a
416 signed or unsigned integer of at least N bits. In tables they can
417 save space and decrease cache pressure. Promoting to a signed type
418 helps avoid bugs in integer arithmetic. */
419
420#ifdef __INT_LEAST8_MAX__
422#elif defined YY_STDINT_H
423typedef int_least8_t yytype_int8;
424#else
425typedef signed char yytype_int8;
426#endif
427
428#ifdef __INT_LEAST16_MAX__
430#elif defined YY_STDINT_H
431typedef int_least16_t yytype_int16;
432#else
433typedef short yytype_int16;
434#endif
435
436#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
438#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
439 && UINT_LEAST8_MAX <= INT_MAX)
440typedef uint_least8_t yytype_uint8;
441#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
442typedef unsigned char yytype_uint8;
443#else
444typedef short yytype_uint8;
445#endif
446
447#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
449#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
450 && UINT_LEAST16_MAX <= INT_MAX)
451typedef uint_least16_t yytype_uint16;
452#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
453typedef unsigned short yytype_uint16;
454#else
455typedef int yytype_uint16;
456#endif
457
458#ifndef YYPTRDIFF_T
459# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
460# define YYPTRDIFF_T __PTRDIFF_TYPE__
461# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
462# elif defined PTRDIFF_MAX
463# ifndef ptrdiff_t
464# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
465# endif
466# define YYPTRDIFF_T ptrdiff_t
467# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
468# else
469# define YYPTRDIFF_T long
470# define YYPTRDIFF_MAXIMUM LONG_MAX
471# endif
472#endif
473
474#ifndef YYSIZE_T
475# ifdef __SIZE_TYPE__
476# define YYSIZE_T __SIZE_TYPE__
477# elif defined size_t
478# define YYSIZE_T size_t
479# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
480# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
481# define YYSIZE_T size_t
482# else
483# define YYSIZE_T unsigned
484# endif
485#endif
486
487#define YYSIZE_MAXIMUM \
488 YY_CAST (YYPTRDIFF_T, \
489 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
490 ? YYPTRDIFF_MAXIMUM \
491 : YY_CAST (YYSIZE_T, -1)))
492
493#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
494
495/* Stored state numbers (used for stacks). */
497
498/* State numbers in computations. */
499typedef int yy_state_fast_t;
500
501#ifndef YY_
502# if defined YYENABLE_NLS && YYENABLE_NLS
503# if ENABLE_NLS
504# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
505# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
506# endif
507# endif
508# ifndef YY_
509# define YY_(Msgid) Msgid
510# endif
511#endif
512
513#ifndef YY_ATTRIBUTE_PURE
514# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
515# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
516# else
517# define YY_ATTRIBUTE_PURE
518# endif
519#endif
520
521#ifndef YY_ATTRIBUTE_UNUSED
522# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
523# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
524# else
525# define YY_ATTRIBUTE_UNUSED
526# endif
527#endif
528
529/* Suppress unused-variable warnings by "using" E. */
530#if ! defined lint || defined __GNUC__
531# define YYUSE(E) ((void) (E))
532#else
533# define YYUSE(E) /* empty */
534#endif
535
536#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
537/* Suppress an incorrect diagnostic about yylval being uninitialized. */
538# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
539 _Pragma ("GCC diagnostic push") \
540 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
541 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
542# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
543 _Pragma ("GCC diagnostic pop")
544#else
545# define YY_INITIAL_VALUE(Value) Value
546#endif
547#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
548# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
549# define YY_IGNORE_MAYBE_UNINITIALIZED_END
550#endif
551#ifndef YY_INITIAL_VALUE
552# define YY_INITIAL_VALUE(Value) /* Nothing. */
553#endif
554
555#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
556# define YY_IGNORE_USELESS_CAST_BEGIN \
557 _Pragma ("GCC diagnostic push") \
558 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
559# define YY_IGNORE_USELESS_CAST_END \
560 _Pragma ("GCC diagnostic pop")
561#endif
562#ifndef YY_IGNORE_USELESS_CAST_BEGIN
563# define YY_IGNORE_USELESS_CAST_BEGIN
564# define YY_IGNORE_USELESS_CAST_END
565#endif
566
567
568#define YY_ASSERT(E) ((void) (0 && (E)))
569
570#if ! defined yyoverflow || YYERROR_VERBOSE
571
572/* The parser invokes alloca or malloc; define the necessary symbols. */
573
574# ifdef YYSTACK_USE_ALLOCA
575# if YYSTACK_USE_ALLOCA
576# ifdef __GNUC__
577# define YYSTACK_ALLOC __builtin_alloca
578# elif defined __BUILTIN_VA_ARG_INCR
579# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
580# elif defined _AIX
581# define YYSTACK_ALLOC __alloca
582# elif defined _MSC_VER
583# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
584# define alloca _alloca
585# else
586# define YYSTACK_ALLOC alloca
587# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
588# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
589 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
590# ifndef EXIT_SUCCESS
591# define EXIT_SUCCESS 0
592# endif
593# endif
594# endif
595# endif
596# endif
597
598# ifdef YYSTACK_ALLOC
599 /* Pacify GCC's 'empty if-body' warning. */
600# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
601# ifndef YYSTACK_ALLOC_MAXIMUM
602 /* The OS might guarantee only one guard page at the bottom of the stack,
603 and a page size can be as small as 4096 bytes. So we cannot safely
604 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
605 to allow for a few compiler-allocated temporary stack slots. */
606# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
607# endif
608# else
609# define YYSTACK_ALLOC YYMALLOC
610# define YYSTACK_FREE YYFREE
611# ifndef YYSTACK_ALLOC_MAXIMUM
612# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
613# endif
614# if (defined __cplusplus && ! defined EXIT_SUCCESS \
615 && ! ((defined YYMALLOC || defined malloc) \
616 && (defined YYFREE || defined free)))
617# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
618# ifndef EXIT_SUCCESS
619# define EXIT_SUCCESS 0
620# endif
621# endif
622# ifndef YYMALLOC
623# define YYMALLOC malloc
624# if ! defined malloc && ! defined EXIT_SUCCESS
625void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
626# endif
627# endif
628# ifndef YYFREE
629# define YYFREE free
630# if ! defined free && ! defined EXIT_SUCCESS
631void free (void *); /* INFRINGES ON USER NAME SPACE */
632# endif
633# endif
634# endif
635#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
636
637
638#if (! defined yyoverflow \
639 && (! defined __cplusplus \
640 || (defined HTMLSTYPE_IS_TRIVIAL && HTMLSTYPE_IS_TRIVIAL)))
641
642/* A type that is properly aligned for any stack member. */
643union yyalloc
644{
645 yy_state_t yyss_alloc;
646 YYSTYPE yyvs_alloc;
647};
648
649/* The size of the maximum gap between one aligned stack and the next. */
650# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
651
652/* The size of an array large to enough to hold all stacks, each with
653 N elements. */
654# define YYSTACK_BYTES(N) \
655 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
656 + YYSTACK_GAP_MAXIMUM)
657
658# define YYCOPY_NEEDED 1
659
660/* Relocate STACK from its old location to the new one. The
661 local variables YYSIZE and YYSTACKSIZE give the old and new number of
662 elements in the stack, and YYPTR gives the new location of the
663 stack. Advance YYPTR to a properly aligned location for the next
664 stack. */
665# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
666 do \
667 { \
668 YYPTRDIFF_T yynewbytes; \
669 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
670 Stack = &yyptr->Stack_alloc; \
671 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
672 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
673 } \
674 while (0)
675
676#endif
677
678#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
679/* Copy COUNT objects from SRC to DST. The source and destination do
680 not overlap. */
681# ifndef YYCOPY
682# if defined __GNUC__ && 1 < __GNUC__
683# define YYCOPY(Dst, Src, Count) \
684 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
685# else
686# define YYCOPY(Dst, Src, Count) \
687 do \
688 { \
689 YYPTRDIFF_T yyi; \
690 for (yyi = 0; yyi < (Count); yyi++) \
691 (Dst)[yyi] = (Src)[yyi]; \
692 } \
693 while (0)
694# endif
695# endif
696#endif /* !YYCOPY_NEEDED */
697
698/* YYFINAL -- State number of the termination state. */
699#define YYFINAL 31
700/* YYLAST -- Last index in YYTABLE. */
701#define YYLAST 271
702
703/* YYNTOKENS -- Number of terminals. */
704#define YYNTOKENS 41
705/* YYNNTS -- Number of nonterminals. */
706#define YYNNTS 39
707/* YYNRULES -- Number of rules. */
708#define YYNRULES 69
709/* YYNSTATES -- Number of states. */
710#define YYNSTATES 116
711
712#define YYUNDEFTOK 2
713#define YYMAXUTOK 295
714
715
716/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
717 as returned by yylex, with out-of-bounds checking. */
718#define YYTRANSLATE(YYX) \
719 (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
720
721/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
722 as returned by yylex. */
723static const yytype_int8 yytranslate[] =
724{
725 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
726 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
727 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
728 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
729 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
730 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
731 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
732 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
733 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
734 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
735 2, 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, 2, 2, 2, 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, 1, 2, 3, 4,
751 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
752 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
753 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
754 35, 36, 37, 38, 39, 40
755};
756
757#if HTMLDEBUG
758 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
759static const yytype_int16 yyrline[] =
760{
761 0, 212, 212, 213, 214, 217, 220, 221, 224, 225,
762 226, 227, 228, 229, 230, 231, 232, 233, 236, 239,
763 242, 245, 248, 251, 254, 257, 260, 263, 266, 269,
764 272, 275, 278, 281, 284, 285, 288, 289, 292, 292,
765 313, 314, 315, 316, 317, 318, 321, 322, 325, 326,
766 327, 330, 330, 333, 334, 335, 338, 338, 339, 339,
767 340, 340, 341, 341, 344, 345, 348, 349, 352, 353
768};
769#endif
770
771#if HTMLDEBUG || YYERROR_VERBOSE || 0
772/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
773 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
774static const char *const yytname[] =
775{
776 "$end", "error", "$undefined", "T_end_br", "T_end_img", "T_row",
777 "T_end_row", "T_html", "T_end_html", "T_end_table", "T_end_cell",
778 "T_end_font", "T_string", "T_error", "T_n_italic", "T_n_bold",
779 "T_n_underline", "T_n_overline", "T_n_sup", "T_n_sub", "T_n_s", "T_HR",
780 "T_hr", "T_end_hr", "T_VR", "T_vr", "T_end_vr", "T_BR", "T_br", "T_IMG",
781 "T_img", "T_table", "T_cell", "T_font", "T_italic", "T_bold",
782 "T_underline", "T_overline", "T_sup", "T_sub", "T_s", "$accept", "html",
783 "fonttext", "text", "textitem", "font", "n_font", "italic", "n_italic",
784 "bold", "n_bold", "strike", "n_strike", "underline", "n_underline",
785 "overline", "n_overline", "sup", "n_sup", "sub", "n_sub", "br", "string",
786 "table", "@1", "fonttable", "opt_space", "rows", "row", "$@2", "cells",
787 "cell", "$@3", "$@4", "$@5", "$@6", "image", "HR", "VR", YY_NULLPTR
788};
789#endif
790
791# ifdef YYPRINT
792/* YYTOKNUM[NUM] -- (External) token number corresponding to the
793 (internal) symbol number NUM (which must be that of a token). */
794static const yytype_int16 yytoknum[] =
795{
796 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
797 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
798 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
799 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
800 295
801};
802# endif
803
804#define YYPACT_NINF (-82)
805
806#define yypact_value_is_default(Yyn) \
807 ((Yyn) == YYPACT_NINF)
808
809#define YYTABLE_NINF (-63)
810
811#define yytable_value_is_error(Yyn) \
812 0
813
814 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
815 STATE-NUM. */
816static const yytype_int16 yypact[] =
817{
818 8, -82, 209, 10, -82, -82, 11, -82, -82, -82,
819 -82, -82, -82, -82, -82, 5, 209, -82, 209, 209,
820 209, 209, 209, 209, 209, 209, -82, -5, -82, 14,
821 -20, -82, -82, -82, -82, 209, 209, 209, 209, 209,
822 13, 37, 12, 66, 16, 80, 19, 109, 123, 20,
823 152, 15, 166, 195, -82, -82, -82, -82, -82, -82,
824 -82, -82, -82, -82, -82, -82, -82, -82, -82, -82,
825 -82, -82, -82, -82, -82, -82, -82, -82, 23, -82,
826 119, -82, 7, 46, -82, 38, -82, 23, 17, 35,
827 -82, 13, -82, -82, -82, -82, 58, -82, -82, 53,
828 -82, -82, -82, 40, -82, 7, -82, 59, 69, -82,
829 72, -82, -82, -82, -82, -82
830};
831
832 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
833 Performed when YYTABLE does not specify something else to do. Zero
834 means the default is an error. */
835static const yytype_int8 yydefact[] =
836{
837 0, 4, 47, 0, 36, 35, 0, 18, 20, 22,
838 26, 28, 30, 32, 24, 0, 5, 7, 47, 47,
839 47, 0, 47, 47, 0, 0, 9, 8, 40, 0,
840 0, 1, 34, 2, 6, 0, 0, 0, 0, 0,
841 8, 0, 0, 0, 0, 0, 0, 0, 0, 0,
842 0, 0, 0, 0, 37, 3, 38, 19, 10, 41,
843 21, 11, 42, 23, 14, 45, 25, 17, 27, 12,
844 43, 29, 13, 44, 31, 15, 33, 16, 0, 51,
845 0, 48, 0, 47, 67, 0, 49, 0, 47, 0,
846 53, 46, 39, 66, 50, 65, 0, 58, 56, 0,
847 60, 52, 69, 0, 54, 0, 64, 0, 0, 63,
848 0, 68, 55, 59, 57, 61
849};
850
851 /* YYPGOTO[NTERM-NUM]. */
852static const yytype_int16 yypgoto[] =
853{
854 -82, -82, -4, 232, -10, -1, 26, 0, 39, 1,
855 50, -82, -82, 2, 36, 3, 47, -82, -82, -82,
856 -82, -82, -2, 148, -82, 9, 27, -82, -68, -82,
857 -82, -81, -82, -82, -82, -82, -82, -82, -82
858};
859
860 /* YYDEFGOTO[NTERM-NUM]. */
861static const yytype_int8 yydefgoto[] =
862{
863 -1, 3, 15, 16, 17, 35, 58, 36, 61, 37,
864 64, 21, 67, 38, 69, 39, 72, 24, 75, 25,
865 77, 26, 40, 28, 78, 29, 30, 80, 81, 82,
866 89, 90, 108, 107, 110, 99, 100, 87, 105
867};
868
869 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
870 positive, shift that token. If negative, reduce the rule whose
871 number is the opposite. If YYTABLE_NINF, syntax error. */
872static const yytype_int8 yytable[] =
873{
874 27, 18, 19, 20, 22, 23, 34, 54, 104, 1,
875 31, 56, 86, 33, 32, 2, 27, 27, 27, 94,
876 27, 27, 55, 57, 112, 54, -46, -62, 79, 4,
877 60, 34, 71, 34, 63, 34, 68, 34, 34, 88,
878 34, 101, 34, 34, 5, 6, 95, 96, 57, 4,
879 7, 8, 9, 10, 11, 12, 13, 14, 4, 102,
880 103, 93, 106, 109, 5, 6, 111, 88, 59, 113,
881 7, 8, 9, 10, 11, 12, 13, 14, 4, 114,
882 60, 91, 115, 62, 97, 70, 27, 18, 19, 20,
883 22, 23, 4, 5, 6, 63, 65, 98, 73, 7,
884 8, 9, 10, 11, 12, 13, 14, 5, 6, 0,
885 92, 0, 0, 7, 8, 9, 10, 11, 12, 13,
886 14, 4, 0, 0, 79, 0, 0, 0, 83, 66,
887 0, 0, 0, 0, 0, 4, 5, 6, 0, 68,
888 84, 85, 7, 8, 9, 10, 11, 12, 13, 14,
889 5, 6, 0, 0, 0, 0, 7, 8, 9, 10,
890 11, 12, 13, 14, 4, 0, 42, 44, 46, 71,
891 49, 51, 0, 0, 0, 0, 0, 0, 4, 5,
892 6, 0, 0, 0, 74, 7, 8, 9, 10, 11,
893 12, 13, 14, 5, 6, 0, 0, 0, 0, 7,
894 8, 9, 10, 11, 12, 13, 14, 4, 0, 0,
895 0, 0, 0, 0, 76, 0, 0, 0, 0, 0,
896 0, 4, 5, 6, 0, 0, 0, 0, 7, 8,
897 9, 10, 11, 12, 13, 14, 5, 6, 0, 0,
898 0, 0, 7, 8, 9, 10, 11, 12, 13, 14,
899 41, 43, 45, 47, 48, 50, 52, 53, 0, 0,
900 0, 0, 0, 0, 0, 0, 0, 41, 43, 45,
901 48, 50
902};
903
904static const yytype_int8 yycheck[] =
905{
906 2, 2, 2, 2, 2, 2, 16, 12, 89, 1,
907 0, 31, 80, 8, 3, 7, 18, 19, 20, 87,
908 22, 23, 8, 11, 105, 12, 31, 10, 5, 12,
909 14, 41, 17, 43, 15, 45, 16, 47, 48, 32,
910 50, 6, 52, 53, 27, 28, 29, 30, 11, 12,
911 33, 34, 35, 36, 37, 38, 39, 40, 12, 24,
912 25, 23, 4, 10, 27, 28, 26, 32, 42, 10,
913 33, 34, 35, 36, 37, 38, 39, 40, 12, 10,
914 14, 83, 10, 44, 88, 49, 88, 88, 88, 88,
915 88, 88, 12, 27, 28, 15, 46, 88, 51, 33,
916 34, 35, 36, 37, 38, 39, 40, 27, 28, -1,
917 83, -1, -1, 33, 34, 35, 36, 37, 38, 39,
918 40, 12, -1, -1, 5, -1, -1, -1, 9, 20,
919 -1, -1, -1, -1, -1, 12, 27, 28, -1, 16,
920 21, 22, 33, 34, 35, 36, 37, 38, 39, 40,
921 27, 28, -1, -1, -1, -1, 33, 34, 35, 36,
922 37, 38, 39, 40, 12, -1, 18, 19, 20, 17,
923 22, 23, -1, -1, -1, -1, -1, -1, 12, 27,
924 28, -1, -1, -1, 18, 33, 34, 35, 36, 37,
925 38, 39, 40, 27, 28, -1, -1, -1, -1, 33,
926 34, 35, 36, 37, 38, 39, 40, 12, -1, -1,
927 -1, -1, -1, -1, 19, -1, -1, -1, -1, -1,
928 -1, 12, 27, 28, -1, -1, -1, -1, 33, 34,
929 35, 36, 37, 38, 39, 40, 27, 28, -1, -1,
930 -1, -1, 33, 34, 35, 36, 37, 38, 39, 40,
931 18, 19, 20, 21, 22, 23, 24, 25, -1, -1,
932 -1, -1, -1, -1, -1, -1, -1, 35, 36, 37,
933 38, 39
934};
935
936 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
937 symbol of state STATE-NUM. */
938static const yytype_int8 yystos[] =
939{
940 0, 1, 7, 42, 12, 27, 28, 33, 34, 35,
941 36, 37, 38, 39, 40, 43, 44, 45, 46, 48,
942 50, 52, 54, 56, 58, 60, 62, 63, 64, 66,
943 67, 0, 3, 8, 45, 46, 48, 50, 54, 56,
944 63, 44, 64, 44, 64, 44, 64, 44, 44, 64,
945 44, 64, 44, 44, 12, 8, 31, 11, 47, 47,
946 14, 49, 49, 15, 51, 51, 20, 53, 16, 55,
947 55, 17, 57, 57, 18, 59, 19, 61, 65, 5,
948 68, 69, 70, 9, 21, 22, 69, 78, 32, 71,
949 72, 63, 67, 23, 69, 29, 30, 43, 66, 76,
950 77, 6, 24, 25, 72, 79, 4, 74, 73, 10,
951 75, 26, 72, 10, 10, 10
952};
953
954 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
955static const yytype_int8 yyr1[] =
956{
957 0, 41, 42, 42, 42, 43, 44, 44, 45, 45,
958 45, 45, 45, 45, 45, 45, 45, 45, 46, 47,
959 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
960 58, 59, 60, 61, 62, 62, 63, 63, 65, 64,
961 66, 66, 66, 66, 66, 66, 67, 67, 68, 68,
962 68, 70, 69, 71, 71, 71, 73, 72, 74, 72,
963 75, 72, 76, 72, 77, 77, 78, 78, 79, 79
964};
965
966 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
967static const yytype_int8 yyr2[] =
968{
969 0, 2, 3, 3, 1, 1, 2, 1, 1, 1,
970 3, 3, 3, 3, 3, 3, 3, 3, 1, 1,
971 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
972 1, 1, 1, 1, 2, 1, 1, 2, 0, 6,
973 1, 3, 3, 3, 3, 3, 1, 0, 1, 2,
974 3, 0, 4, 1, 2, 3, 0, 4, 0, 4,
975 0, 4, 0, 3, 2, 1, 2, 1, 2, 1
976};
977
978
979#define yyerrok (yyerrstatus = 0)
980#define yyclearin (yychar = YYEMPTY)
981#define YYEMPTY (-2)
982#define YYEOF 0
983
984#define YYACCEPT goto yyacceptlab
985#define YYABORT goto yyabortlab
986#define YYERROR goto yyerrorlab
987
988
989#define YYRECOVERING() (!!yyerrstatus)
990
991#define YYBACKUP(Token, Value) \
992 do \
993 if (yychar == YYEMPTY) \
994 { \
995 yychar = (Token); \
996 yylval = (Value); \
997 YYPOPSTACK (yylen); \
998 yystate = *yyssp; \
999 goto yybackup; \
1000 } \
1001 else \
1002 { \
1003 yyerror (scanner, YY_("syntax error: cannot back up")); \
1004 YYERROR; \
1005 } \
1006 while (0)
1007
1008/* Error token number */
1009#define YYTERROR 1
1010#define YYERRCODE 256
1011
1012
1013
1014/* Enable debugging if requested. */
1015#if HTMLDEBUG
1016
1017# ifndef YYFPRINTF
1018# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1019# define YYFPRINTF fprintf
1020# endif
1021
1022# define YYDPRINTF(Args) \
1023do { \
1024 if (yydebug) \
1025 YYFPRINTF Args; \
1026} while (0)
1027
1028/* This macro is provided for backward compatibility. */
1029#ifndef YY_LOCATION_PRINT
1030# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1031#endif
1032
1033
1034# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1035do { \
1036 if (yydebug) \
1037 { \
1038 YYFPRINTF (stderr, "%s ", Title); \
1039 yy_symbol_print (stderr, \
1040 Type, Value, scanner); \
1041 YYFPRINTF (stderr, "\n"); \
1042 } \
1043} while (0)
1044
1045
1046/*-----------------------------------.
1047| Print this symbol's value on YYO. |
1048`-----------------------------------*/
1049
1050static void
1051yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, htmlscan_t *scanner)
1052{
1053 FILE *yyoutput = yyo;
1054 YYUSE (yyoutput);
1055 YYUSE (scanner);
1056 if (!yyvaluep)
1057 return;
1058# ifdef YYPRINT
1059 if (yytype < YYNTOKENS)
1060 YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
1061# endif
1063 YYUSE (yytype);
1065}
1066
1067
1068/*---------------------------.
1069| Print this symbol on YYO. |
1070`---------------------------*/
1071
1072static void
1073yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, htmlscan_t *scanner)
1074{
1075 YYFPRINTF (yyo, "%s %s (",
1076 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
1077
1078 yy_symbol_value_print (yyo, yytype, yyvaluep, scanner);
1079 YYFPRINTF (yyo, ")");
1080}
1081
1082/*------------------------------------------------------------------.
1083| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1084| TOP (included). |
1085`------------------------------------------------------------------*/
1086
1087static void
1088yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
1089{
1090 YYFPRINTF (stderr, "Stack now");
1091 for (; yybottom <= yytop; yybottom++)
1092 {
1093 int yybot = *yybottom;
1094 YYFPRINTF (stderr, " %d", yybot);
1095 }
1096 YYFPRINTF (stderr, "\n");
1097}
1098
1099# define YY_STACK_PRINT(Bottom, Top) \
1100do { \
1101 if (yydebug) \
1102 yy_stack_print ((Bottom), (Top)); \
1103} while (0)
1104
1105
1106/*------------------------------------------------.
1107| Report that the YYRULE is going to be reduced. |
1108`------------------------------------------------*/
1109
1110static void
1111yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule, htmlscan_t *scanner)
1112{
1113 int yylno = yyrline[yyrule];
1114 int yynrhs = yyr2[yyrule];
1115 int yyi;
1116 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1117 yyrule - 1, yylno);
1118 /* The symbols being reduced. */
1119 for (yyi = 0; yyi < yynrhs; yyi++)
1120 {
1121 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1122 yy_symbol_print (stderr,
1123 yystos[+yyssp[yyi + 1 - yynrhs]],
1124 &yyvsp[(yyi + 1) - (yynrhs)]
1125 , scanner);
1126 YYFPRINTF (stderr, "\n");
1127 }
1128}
1129
1130# define YY_REDUCE_PRINT(Rule) \
1131do { \
1132 if (yydebug) \
1133 yy_reduce_print (yyssp, yyvsp, Rule, scanner); \
1134} while (0)
1135
1136/* Nonzero means print parse trace. It is left uninitialized so that
1137 multiple parsers can coexist. */
1138int yydebug;
1139#else /* !HTMLDEBUG */
1140# define YYDPRINTF(Args)
1141# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1142# define YY_STACK_PRINT(Bottom, Top)
1143# define YY_REDUCE_PRINT(Rule)
1144#endif /* !HTMLDEBUG */
1145
1146
1147/* YYINITDEPTH -- initial size of the parser's stacks. */
1148#ifndef YYINITDEPTH
1149# define YYINITDEPTH 200
1150#endif
1151
1152/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1153 if the built-in stack extension method is used).
1154
1155 Do not make this value too large; the results are undefined if
1156 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1157 evaluated with infinite-precision integer arithmetic. */
1158
1159#ifndef YYMAXDEPTH
1160# define YYMAXDEPTH 10000
1161#endif
1162
1163
1164#if YYERROR_VERBOSE
1165
1166# ifndef yystrlen
1167# if defined __GLIBC__ && defined _STRING_H
1168# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
1169# else
1170/* Return the length of YYSTR. */
1171static YYPTRDIFF_T
1172yystrlen (const char *yystr)
1173{
1174 YYPTRDIFF_T yylen;
1175 for (yylen = 0; yystr[yylen]; yylen++)
1176 continue;
1177 return yylen;
1178}
1179# endif
1180# endif
1181
1182# ifndef yystpcpy
1183# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1184# define yystpcpy stpcpy
1185# else
1186/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1187 YYDEST. */
1188static char *
1189yystpcpy (char *yydest, const char *yysrc)
1190{
1191 char *yyd = yydest;
1192 const char *yys = yysrc;
1193
1194 while ((*yyd++ = *yys++) != '\0')
1195 continue;
1196
1197 return yyd - 1;
1198}
1199# endif
1200# endif
1201
1202# ifndef yytnamerr
1203/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1204 quotes and backslashes, so that it's suitable for yyerror. The
1205 heuristic is that double-quoting is unnecessary unless the string
1206 contains an apostrophe, a comma, or backslash (other than
1207 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1208 null, do not copy; instead, return the length of what the result
1209 would have been. */
1210static YYPTRDIFF_T
1211yytnamerr (char *yyres, const char *yystr)
1212{
1213 if (*yystr == '"')
1214 {
1215 YYPTRDIFF_T yyn = 0;
1216 char const *yyp = yystr;
1217
1218 for (;;)
1219 switch (*++yyp)
1220 {
1221 case '\'':
1222 case ',':
1223 goto do_not_strip_quotes;
1224
1225 case '\\':
1226 if (*++yyp != '\\')
1227 goto do_not_strip_quotes;
1228 else
1229 goto append;
1230
1231 append:
1232 default:
1233 if (yyres)
1234 yyres[yyn] = *yyp;
1235 yyn++;
1236 break;
1237
1238 case '"':
1239 if (yyres)
1240 yyres[yyn] = '\0';
1241 return yyn;
1242 }
1243 do_not_strip_quotes: ;
1244 }
1245
1246 if (yyres)
1247 return yystpcpy (yyres, yystr) - yyres;
1248 else
1249 return yystrlen (yystr);
1250}
1251# endif
1252
1253/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1254 about the unexpected token YYTOKEN for the state stack whose top is
1255 YYSSP.
1256
1257 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1258 not large enough to hold the message. In that case, also set
1259 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1260 required number of bytes is too large to store. */
1261static int
1262yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
1263 yy_state_t *yyssp, int yytoken)
1264{
1265 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1266 /* Internationalized format string. */
1267 const char *yyformat = YY_NULLPTR;
1268 /* Arguments of yyformat: reported tokens (one for the "unexpected",
1269 one per "expected"). */
1270 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1271 /* Actual size of YYARG. */
1272 int yycount = 0;
1273 /* Cumulated lengths of YYARG. */
1274 YYPTRDIFF_T yysize = 0;
1275
1276 /* There are many possibilities here to consider:
1277 - If this state is a consistent state with a default action, then
1278 the only way this function was invoked is if the default action
1279 is an error action. In that case, don't check for expected
1280 tokens because there are none.
1281 - The only way there can be no lookahead present (in yychar) is if
1282 this state is a consistent state with a default action. Thus,
1283 detecting the absence of a lookahead is sufficient to determine
1284 that there is no unexpected or expected token to report. In that
1285 case, just report a simple "syntax error".
1286 - Don't assume there isn't a lookahead just because this state is a
1287 consistent state with a default action. There might have been a
1288 previous inconsistent state, consistent state with a non-default
1289 action, or user semantic action that manipulated yychar.
1290 - Of course, the expected token list depends on states to have
1291 correct lookahead information, and it depends on the parser not
1292 to perform extra reductions after fetching a lookahead from the
1293 scanner and before detecting a syntax error. Thus, state merging
1294 (from LALR or IELR) and default reductions corrupt the expected
1295 token list. However, the list is correct for canonical LR with
1296 one exception: it will still contain any token that will not be
1297 accepted due to an error action in a later state.
1298 */
1299 if (yytoken != YYEMPTY)
1300 {
1301 int yyn = yypact[+*yyssp];
1302 YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1303 yysize = yysize0;
1304 yyarg[yycount++] = yytname[yytoken];
1305 if (!yypact_value_is_default (yyn))
1306 {
1307 /* Start YYX at -YYN if negative to avoid negative indexes in
1308 YYCHECK. In other words, skip the first -YYN actions for
1309 this state because they are default actions. */
1310 int yyxbegin = yyn < 0 ? -yyn : 0;
1311 /* Stay within bounds of both yycheck and yytname. */
1312 int yychecklim = YYLAST - yyn + 1;
1313 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1314 int yyx;
1315
1316 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1317 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1318 && !yytable_value_is_error (yytable[yyx + yyn]))
1319 {
1320 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1321 {
1322 yycount = 1;
1323 yysize = yysize0;
1324 break;
1325 }
1326 yyarg[yycount++] = yytname[yyx];
1327 {
1328 YYPTRDIFF_T yysize1
1329 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1330 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1331 yysize = yysize1;
1332 else
1333 return 2;
1334 }
1335 }
1336 }
1337 }
1338
1339 switch (yycount)
1340 {
1341# define YYCASE_(N, S) \
1342 case N: \
1343 yyformat = S; \
1344 break
1345 default: /* Avoid compiler warnings. */
1346 YYCASE_(0, YY_("syntax error"));
1347 YYCASE_(1, YY_("syntax error, unexpected %s"));
1348 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1349 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1350 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1351 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1352# undef YYCASE_
1353 }
1354
1355 {
1356 /* Don't count the "%s"s in the final size, but reserve room for
1357 the terminator. */
1358 YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1;
1359 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1360 yysize = yysize1;
1361 else
1362 return 2;
1363 }
1364
1365 if (*yymsg_alloc < yysize)
1366 {
1367 *yymsg_alloc = 2 * yysize;
1368 if (! (yysize <= *yymsg_alloc
1369 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1370 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1371 return 1;
1372 }
1373
1374 /* Avoid sprintf, as that infringes on the user's name space.
1375 Don't have undefined behavior even if the translation
1376 produced a string with the wrong number of "%s"s. */
1377 {
1378 char *yyp = *yymsg;
1379 int yyi = 0;
1380 while ((*yyp = *yyformat) != '\0')
1381 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1382 {
1383 yyp += yytnamerr (yyp, yyarg[yyi++]);
1384 yyformat += 2;
1385 }
1386 else
1387 {
1388 ++yyp;
1389 ++yyformat;
1390 }
1391 }
1392 return 0;
1393}
1394#endif /* YYERROR_VERBOSE */
1395
1396/*-----------------------------------------------.
1397| Release the memory associated to this symbol. |
1398`-----------------------------------------------*/
1399
1400static void
1401yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, htmlscan_t *scanner)
1402{
1403 YYUSE (yyvaluep);
1404 YYUSE (scanner);
1405 if (!yymsg)
1406 yymsg = "Deleting";
1407 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1408
1410 YYUSE (yytype);
1412}
1413
1414
1415
1416
1417/*----------.
1418| yyparse. |
1419`----------*/
1420
1421int
1423{
1424/* The lookahead symbol. */
1425int yychar;
1426
1427
1428/* The semantic value of the lookahead symbol. */
1429/* Default value used for initialization, for pacifying older GCCs
1430 or non-GCC compilers. */
1431YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1432YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1433
1434 /* Number of syntax errors so far. */
1435 int yynerrs;
1436
1437 yy_state_fast_t yystate;
1438 /* Number of tokens to shift before error messages enabled. */
1439 int yyerrstatus;
1440
1441 /* The stacks and their tools:
1442 'yyss': related to states.
1443 'yyvs': related to semantic values.
1444
1445 Refer to the stacks through separate pointers, to allow yyoverflow
1446 to reallocate them elsewhere. */
1447
1448 /* The state stack. */
1449 yy_state_t yyssa[YYINITDEPTH];
1450 yy_state_t *yyss;
1451 yy_state_t *yyssp;
1452
1453 /* The semantic value stack. */
1454 YYSTYPE yyvsa[YYINITDEPTH];
1455 YYSTYPE *yyvs;
1456 YYSTYPE *yyvsp;
1457
1458 YYPTRDIFF_T yystacksize;
1459
1460 int yyn;
1461 int yyresult;
1462 /* Lookahead token as an internal (translated) token number. */
1463 int yytoken = 0;
1464 /* The variables used to return semantic value and location from the
1465 action routines. */
1466 YYSTYPE yyval;
1467
1468#if YYERROR_VERBOSE
1469 /* Buffer for error messages, and its allocated size. */
1470 char yymsgbuf[128];
1471 char *yymsg = yymsgbuf;
1472 YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
1473#endif
1474
1475#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1476
1477 /* The number of symbols on the RHS of the reduced rule.
1478 Keep to zero when no symbol should be popped. */
1479 int yylen = 0;
1480
1481 yyssp = yyss = yyssa;
1482 yyvsp = yyvs = yyvsa;
1483 yystacksize = YYINITDEPTH;
1484
1485 YYDPRINTF ((stderr, "Starting parse\n"));
1486
1487 yystate = 0;
1488 yyerrstatus = 0;
1489 yynerrs = 0;
1490 yychar = YYEMPTY; /* Cause a token to be read. */
1491 goto yysetstate;
1492
1493
1494/*------------------------------------------------------------.
1495| yynewstate -- push a new state, which is found in yystate. |
1496`------------------------------------------------------------*/
1497yynewstate:
1498 /* In all cases, when you get here, the value and location stacks
1499 have just been pushed. So pushing a state here evens the stacks. */
1500 yyssp++;
1501
1502
1503/*--------------------------------------------------------------------.
1504| yysetstate -- set current state (the top of the stack) to yystate. |
1505`--------------------------------------------------------------------*/
1506yysetstate:
1507 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1508 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1510 *yyssp = YY_CAST (yy_state_t, yystate);
1512
1513 if (yyss + yystacksize - 1 <= yyssp)
1514#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1515 goto yyexhaustedlab;
1516#else
1517 {
1518 /* Get the current used size of the three stacks, in elements. */
1519 YYPTRDIFF_T yysize = yyssp - yyss + 1;
1520
1521# if defined yyoverflow
1522 {
1523 /* Give user a chance to reallocate the stack. Use copies of
1524 these so that the &'s don't force the real ones into
1525 memory. */
1526 yy_state_t *yyss1 = yyss;
1527 YYSTYPE *yyvs1 = yyvs;
1528
1529 /* Each stack pointer address is followed by the size of the
1530 data in use in that stack, in bytes. This used to be a
1531 conditional around just the two extra args, but that might
1532 be undefined if yyoverflow is a macro. */
1533 yyoverflow (YY_("memory exhausted"),
1534 &yyss1, yysize * YYSIZEOF (*yyssp),
1535 &yyvs1, yysize * YYSIZEOF (*yyvsp),
1536 &yystacksize);
1537 yyss = yyss1;
1538 yyvs = yyvs1;
1539 }
1540# else /* defined YYSTACK_RELOCATE */
1541 /* Extend the stack our own way. */
1542 if (YYMAXDEPTH <= yystacksize)
1543 goto yyexhaustedlab;
1544 yystacksize *= 2;
1545 if (YYMAXDEPTH < yystacksize)
1546 yystacksize = YYMAXDEPTH;
1547
1548 {
1549 yy_state_t *yyss1 = yyss;
1550 union yyalloc *yyptr =
1551 YY_CAST (union yyalloc *,
1552 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1553 if (! yyptr)
1554 goto yyexhaustedlab;
1555 YYSTACK_RELOCATE (yyss_alloc, yyss);
1556 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1557# undef YYSTACK_RELOCATE
1558 if (yyss1 != yyssa)
1559 YYSTACK_FREE (yyss1);
1560 }
1561# endif
1562
1563 yyssp = yyss + yysize - 1;
1564 yyvsp = yyvs + yysize - 1;
1565
1567 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1568 YY_CAST (long, yystacksize)));
1570
1571 if (yyss + yystacksize - 1 <= yyssp)
1572 YYABORT;
1573 }
1574#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1575
1576 if (yystate == YYFINAL)
1577 YYACCEPT;
1578
1579 goto yybackup;
1580
1581
1582/*-----------.
1583| yybackup. |
1584`-----------*/
1585yybackup:
1586 /* Do appropriate processing given the current state. Read a
1587 lookahead token if we need one and don't already have one. */
1588
1589 /* First try to decide what to do without reference to lookahead token. */
1590 yyn = yypact[yystate];
1591 if (yypact_value_is_default (yyn))
1592 goto yydefault;
1593
1594 /* Not known => get a lookahead token if don't already have one. */
1595
1596 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1597 if (yychar == YYEMPTY)
1598 {
1599 YYDPRINTF ((stderr, "Reading a token: "));
1600 yychar = yylex (&yylval, scanner);
1601 }
1602
1603 if (yychar <= YYEOF)
1604 {
1605 yychar = yytoken = YYEOF;
1606 YYDPRINTF ((stderr, "Now at end of input.\n"));
1607 }
1608 else
1609 {
1610 yytoken = YYTRANSLATE (yychar);
1611 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1612 }
1613
1614 /* If the proper action on seeing token YYTOKEN is to reduce or to
1615 detect an error, take that action. */
1616 yyn += yytoken;
1617 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1618 goto yydefault;
1619 yyn = yytable[yyn];
1620 if (yyn <= 0)
1621 {
1622 if (yytable_value_is_error (yyn))
1623 goto yyerrlab;
1624 yyn = -yyn;
1625 goto yyreduce;
1626 }
1627
1628 /* Count tokens shifted since error; after three, turn off error
1629 status. */
1630 if (yyerrstatus)
1631 yyerrstatus--;
1632
1633 /* Shift the lookahead token. */
1634 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1635 yystate = yyn;
1637 *++yyvsp = yylval;
1639
1640 /* Discard the shifted token. */
1641 yychar = YYEMPTY;
1642 goto yynewstate;
1643
1644
1645/*-----------------------------------------------------------.
1646| yydefault -- do the default action for the current state. |
1647`-----------------------------------------------------------*/
1648yydefault:
1649 yyn = yydefact[yystate];
1650 if (yyn == 0)
1651 goto yyerrlab;
1652 goto yyreduce;
1653
1654
1655/*-----------------------------.
1656| yyreduce -- do a reduction. |
1657`-----------------------------*/
1658yyreduce:
1659 /* yyn is the number of a rule to reduce with. */
1660 yylen = yyr2[yyn];
1661
1662 /* If YYLEN is nonzero, implement the default value of the action:
1663 '$$ = $1'.
1664
1665 Otherwise, the following line sets YYVAL to garbage.
1666 This behavior is undocumented and Bison
1667 users should not rely upon it. Assigning to YYVAL
1668 unconditionally makes the parser a bit smaller, and it avoids a
1669 GCC warning that YYVAL may be used uninitialized. */
1670 yyval = yyvsp[1-yylen];
1671
1672
1673 YY_REDUCE_PRINT (yyn);
1674 switch (yyn)
1675 {
1676 case 2:
1677#line 212 "../../lib/common/htmlparse.y"
1678 { scanner->parser.lbl = mkLabel((yyvsp[-1].txt),HTML_TEXT); }
1679#line 1680 "htmlparse.c"
1680 break;
1681
1682 case 3:
1683#line 213 "../../lib/common/htmlparse.y"
1684 { scanner->parser.lbl = mkLabel((yyvsp[-1].tbl),HTML_TBL); }
1685#line 1686 "htmlparse.c"
1686 break;
1687
1688 case 4:
1689#line 214 "../../lib/common/htmlparse.y"
1690 { cleanup(&scanner->parser); YYABORT; }
1691#line 1692 "htmlparse.c"
1692 break;
1693
1694 case 5:
1695#line 217 "../../lib/common/htmlparse.y"
1696 { (yyval.txt) = mkText(&scanner->parser); }
1697#line 1698 "htmlparse.c"
1698 break;
1699
1700 case 8:
1701#line 224 "../../lib/common/htmlparse.y"
1702 { appendFItemList(&scanner->parser,scanner->parser.str);}
1703#line 1704 "htmlparse.c"
1704 break;
1705
1706 case 9:
1707#line 225 "../../lib/common/htmlparse.y"
1708 {appendFLineList(&scanner->parser,(yyvsp[0].i));}
1709#line 1710 "htmlparse.c"
1710 break;
1711
1712 case 18:
1713#line 236 "../../lib/common/htmlparse.y"
1714 { pushFont (&scanner->parser,(yyvsp[0].font)); }
1715#line 1716 "htmlparse.c"
1716 break;
1717
1718 case 19:
1719#line 239 "../../lib/common/htmlparse.y"
1720 { popFont (&scanner->parser); }
1721#line 1722 "htmlparse.c"
1722 break;
1723
1724 case 20:
1725#line 242 "../../lib/common/htmlparse.y"
1726 {pushFont(&scanner->parser,(yyvsp[0].font));}
1727#line 1728 "htmlparse.c"
1728 break;
1729
1730 case 21:
1731#line 245 "../../lib/common/htmlparse.y"
1732 {popFont(&scanner->parser);}
1733#line 1734 "htmlparse.c"
1734 break;
1735
1736 case 22:
1737#line 248 "../../lib/common/htmlparse.y"
1738 {pushFont(&scanner->parser,(yyvsp[0].font));}
1739#line 1740 "htmlparse.c"
1740 break;
1741
1742 case 23:
1743#line 251 "../../lib/common/htmlparse.y"
1744 {popFont(&scanner->parser);}
1745#line 1746 "htmlparse.c"
1746 break;
1747
1748 case 24:
1749#line 254 "../../lib/common/htmlparse.y"
1750 {pushFont(&scanner->parser,(yyvsp[0].font));}
1751#line 1752 "htmlparse.c"
1752 break;
1753
1754 case 25:
1755#line 257 "../../lib/common/htmlparse.y"
1756 {popFont(&scanner->parser);}
1757#line 1758 "htmlparse.c"
1758 break;
1759
1760 case 26:
1761#line 260 "../../lib/common/htmlparse.y"
1762 {pushFont(&scanner->parser,(yyvsp[0].font));}
1763#line 1764 "htmlparse.c"
1764 break;
1765
1766 case 27:
1767#line 263 "../../lib/common/htmlparse.y"
1768 {popFont(&scanner->parser);}
1769#line 1770 "htmlparse.c"
1770 break;
1771
1772 case 28:
1773#line 266 "../../lib/common/htmlparse.y"
1774 {pushFont(&scanner->parser,(yyvsp[0].font));}
1775#line 1776 "htmlparse.c"
1776 break;
1777
1778 case 29:
1779#line 269 "../../lib/common/htmlparse.y"
1780 {popFont(&scanner->parser);}
1781#line 1782 "htmlparse.c"
1782 break;
1783
1784 case 30:
1785#line 272 "../../lib/common/htmlparse.y"
1786 {pushFont(&scanner->parser,(yyvsp[0].font));}
1787#line 1788 "htmlparse.c"
1788 break;
1789
1790 case 31:
1791#line 275 "../../lib/common/htmlparse.y"
1792 {popFont(&scanner->parser);}
1793#line 1794 "htmlparse.c"
1794 break;
1795
1796 case 32:
1797#line 278 "../../lib/common/htmlparse.y"
1798 {pushFont(&scanner->parser,(yyvsp[0].font));}
1799#line 1800 "htmlparse.c"
1800 break;
1801
1802 case 33:
1803#line 281 "../../lib/common/htmlparse.y"
1804 {popFont(&scanner->parser);}
1805#line 1806 "htmlparse.c"
1806 break;
1807
1808 case 34:
1809#line 284 "../../lib/common/htmlparse.y"
1810 { (yyval.i) = (yyvsp[-1].i); }
1811#line 1812 "htmlparse.c"
1812 break;
1813
1814 case 35:
1815#line 285 "../../lib/common/htmlparse.y"
1816 { (yyval.i) = (yyvsp[0].i); }
1817#line 1818 "htmlparse.c"
1818 break;
1819
1820 case 38:
1821#line 292 "../../lib/common/htmlparse.y"
1822 {
1823 if (nonSpace(agxbuse(scanner->parser.str))) {
1824 htmlerror (scanner,"Syntax error: non-space string used before <TABLE>");
1825 cleanup(&scanner->parser); YYABORT;
1826 }
1827 (yyvsp[0].tbl)->u.p.prev = scanner->parser.tblstack;
1828 (yyvsp[0].tbl)->u.p.rows = (rows_t){0};
1829 scanner->parser.tblstack = (yyvsp[0].tbl);
1830 (yyvsp[0].tbl)->font = *sfont_back(&scanner->parser.fontstack);
1831 (yyval.tbl) = (yyvsp[0].tbl);
1832 }
1833#line 1834 "htmlparse.c"
1834 break;
1835
1836 case 39:
1837#line 303 "../../lib/common/htmlparse.y"
1838 {
1839 if (nonSpace(agxbuse(scanner->parser.str))) {
1840 htmlerror (scanner,"Syntax error: non-space string used after </TABLE>");
1841 cleanup(&scanner->parser); YYABORT;
1842 }
1843 (yyval.tbl) = scanner->parser.tblstack;
1844 scanner->parser.tblstack = scanner->parser.tblstack->u.p.prev;
1845 }
1846#line 1847 "htmlparse.c"
1847 break;
1848
1849 case 40:
1850#line 313 "../../lib/common/htmlparse.y"
1851 { (yyval.tbl) = (yyvsp[0].tbl); }
1852#line 1853 "htmlparse.c"
1853 break;
1854
1855 case 41:
1856#line 314 "../../lib/common/htmlparse.y"
1857 { (yyval.tbl)=(yyvsp[-1].tbl); }
1858#line 1859 "htmlparse.c"
1859 break;
1860
1861 case 42:
1862#line 315 "../../lib/common/htmlparse.y"
1863 { (yyval.tbl)=(yyvsp[-1].tbl); }
1864#line 1865 "htmlparse.c"
1865 break;
1866
1867 case 43:
1868#line 316 "../../lib/common/htmlparse.y"
1869 { (yyval.tbl)=(yyvsp[-1].tbl); }
1870#line 1871 "htmlparse.c"
1871 break;
1872
1873 case 44:
1874#line 317 "../../lib/common/htmlparse.y"
1875 { (yyval.tbl)=(yyvsp[-1].tbl); }
1876#line 1877 "htmlparse.c"
1877 break;
1878
1879 case 45:
1880#line 318 "../../lib/common/htmlparse.y"
1881 { (yyval.tbl)=(yyvsp[-1].tbl); }
1882#line 1883 "htmlparse.c"
1883 break;
1884
1885 case 48:
1886#line 325 "../../lib/common/htmlparse.y"
1887 { (yyval.p) = (yyvsp[0].p); }
1888#line 1889 "htmlparse.c"
1889 break;
1890
1891 case 49:
1892#line 326 "../../lib/common/htmlparse.y"
1893 { (yyval.p) = (yyvsp[0].p); }
1894#line 1895 "htmlparse.c"
1895 break;
1896
1897 case 50:
1898#line 327 "../../lib/common/htmlparse.y"
1899 { (yyvsp[-2].p)->ruled = true; (yyval.p) = (yyvsp[0].p); }
1900#line 1901 "htmlparse.c"
1901 break;
1902
1903 case 51:
1904#line 330 "../../lib/common/htmlparse.y"
1905 { addRow (&scanner->parser); }
1906#line 1907 "htmlparse.c"
1907 break;
1908
1909 case 52:
1910#line 330 "../../lib/common/htmlparse.y"
1911 { (yyval.p) = lastRow(&scanner->parser); }
1912#line 1913 "htmlparse.c"
1913 break;
1914
1915 case 53:
1916#line 333 "../../lib/common/htmlparse.y"
1917 { (yyval.cell) = (yyvsp[0].cell); }
1918#line 1919 "htmlparse.c"
1919 break;
1920
1921 case 54:
1922#line 334 "../../lib/common/htmlparse.y"
1923 { (yyval.cell) = (yyvsp[0].cell); }
1924#line 1925 "htmlparse.c"
1925 break;
1926
1927 case 55:
1928#line 335 "../../lib/common/htmlparse.y"
1929 { (yyvsp[-2].cell)->vruled = true; (yyval.cell) = (yyvsp[0].cell); }
1930#line 1931 "htmlparse.c"
1931 break;
1932
1933 case 56:
1934#line 338 "../../lib/common/htmlparse.y"
1935 { setCell(&scanner->parser,(yyvsp[-1].cell),(yyvsp[0].tbl),HTML_TBL); }
1936#line 1937 "htmlparse.c"
1937 break;
1938
1939 case 57:
1940#line 338 "../../lib/common/htmlparse.y"
1941 { (yyval.cell) = (yyvsp[-3].cell); }
1942#line 1943 "htmlparse.c"
1943 break;
1944
1945 case 58:
1946#line 339 "../../lib/common/htmlparse.y"
1947 { setCell(&scanner->parser,(yyvsp[-1].cell),(yyvsp[0].txt),HTML_TEXT); }
1948#line 1949 "htmlparse.c"
1949 break;
1950
1951 case 59:
1952#line 339 "../../lib/common/htmlparse.y"
1953 { (yyval.cell) = (yyvsp[-3].cell); }
1954#line 1955 "htmlparse.c"
1955 break;
1956
1957 case 60:
1958#line 340 "../../lib/common/htmlparse.y"
1959 { setCell(&scanner->parser,(yyvsp[-1].cell),(yyvsp[0].img),HTML_IMAGE); }
1960#line 1961 "htmlparse.c"
1961 break;
1962
1963 case 61:
1964#line 340 "../../lib/common/htmlparse.y"
1965 { (yyval.cell) = (yyvsp[-3].cell); }
1966#line 1967 "htmlparse.c"
1967 break;
1968
1969 case 62:
1970#line 341 "../../lib/common/htmlparse.y"
1971 { setCell(&scanner->parser,(yyvsp[0].cell),mkText(&scanner->parser),HTML_TEXT); }
1972#line 1973 "htmlparse.c"
1973 break;
1974
1975 case 63:
1976#line 341 "../../lib/common/htmlparse.y"
1977 { (yyval.cell) = (yyvsp[-2].cell); }
1978#line 1979 "htmlparse.c"
1979 break;
1980
1981 case 64:
1982#line 344 "../../lib/common/htmlparse.y"
1983 { (yyval.img) = (yyvsp[-1].img); }
1984#line 1985 "htmlparse.c"
1985 break;
1986
1987 case 65:
1988#line 345 "../../lib/common/htmlparse.y"
1989 { (yyval.img) = (yyvsp[0].img); }
1990#line 1991 "htmlparse.c"
1991 break;
1992
1993
1994#line 1995 "htmlparse.c"
1995
1996 default: break;
1997 }
1998 /* User semantic actions sometimes alter yychar, and that requires
1999 that yytoken be updated with the new translation. We take the
2000 approach of translating immediately before every use of yytoken.
2001 One alternative is translating here after every semantic action,
2002 but that translation would be missed if the semantic action invokes
2003 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2004 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2005 incorrect destructor might then be invoked immediately. In the
2006 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2007 to an incorrect destructor call or verbose syntax error message
2008 before the lookahead is translated. */
2009 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2010
2011 YYPOPSTACK (yylen);
2012 yylen = 0;
2013 YY_STACK_PRINT (yyss, yyssp);
2014
2015 *++yyvsp = yyval;
2016
2017 /* Now 'shift' the result of the reduction. Determine what state
2018 that goes to, based on the state we popped back to and the rule
2019 number reduced by. */
2020 {
2021 const int yylhs = yyr1[yyn] - YYNTOKENS;
2022 const int yyi = yypgoto[yylhs] + *yyssp;
2023 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
2024 ? yytable[yyi]
2025 : yydefgoto[yylhs]);
2026 }
2027
2028 goto yynewstate;
2029
2030
2031/*--------------------------------------.
2032| yyerrlab -- here on detecting error. |
2033`--------------------------------------*/
2034yyerrlab:
2035 /* Make sure we have latest lookahead translation. See comments at
2036 user semantic actions for why this is necessary. */
2037 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2038
2039 /* If not already recovering from an error, report this error. */
2040 if (!yyerrstatus)
2041 {
2042 ++yynerrs;
2043#if ! YYERROR_VERBOSE
2044 yyerror (scanner, YY_("syntax error"));
2045#else
2046# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2047 yyssp, yytoken)
2048 {
2049 char const *yymsgp = YY_("syntax error");
2050 int yysyntax_error_status;
2051 yysyntax_error_status = YYSYNTAX_ERROR;
2052 if (yysyntax_error_status == 0)
2053 yymsgp = yymsg;
2054 else if (yysyntax_error_status == 1)
2055 {
2056 if (yymsg != yymsgbuf)
2057 YYSTACK_FREE (yymsg);
2058 yymsg = YY_CAST (char *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
2059 if (!yymsg)
2060 {
2061 yymsg = yymsgbuf;
2062 yymsg_alloc = sizeof yymsgbuf;
2063 yysyntax_error_status = 2;
2064 }
2065 else
2066 {
2067 yysyntax_error_status = YYSYNTAX_ERROR;
2068 yymsgp = yymsg;
2069 }
2070 }
2071 yyerror (scanner, yymsgp);
2072 if (yysyntax_error_status == 2)
2073 goto yyexhaustedlab;
2074 }
2075# undef YYSYNTAX_ERROR
2076#endif
2077 }
2078
2079
2080
2081 if (yyerrstatus == 3)
2082 {
2083 /* If just tried and failed to reuse lookahead token after an
2084 error, discard it. */
2085
2086 if (yychar <= YYEOF)
2087 {
2088 /* Return failure if at end of input. */
2089 if (yychar == YYEOF)
2090 YYABORT;
2091 }
2092 else
2093 {
2094 yydestruct ("Error: discarding",
2095 yytoken, &yylval, scanner);
2096 yychar = YYEMPTY;
2097 }
2098 }
2099
2100 /* Else will try to reuse lookahead token after shifting the error
2101 token. */
2102 goto yyerrlab1;
2103
2104
2105/*---------------------------------------------------.
2106| yyerrorlab -- error raised explicitly by YYERROR. |
2107`---------------------------------------------------*/
2108yyerrorlab:
2109 /* Pacify compilers when the user code never invokes YYERROR and the
2110 label yyerrorlab therefore never appears in user code. */
2111 if (0)
2112 YYERROR;
2113
2114 /* Do not reclaim the symbols of the rule whose action triggered
2115 this YYERROR. */
2116 YYPOPSTACK (yylen);
2117 yylen = 0;
2118 YY_STACK_PRINT (yyss, yyssp);
2119 yystate = *yyssp;
2120 goto yyerrlab1;
2121
2122
2123/*-------------------------------------------------------------.
2124| yyerrlab1 -- common code for both syntax error and YYERROR. |
2125`-------------------------------------------------------------*/
2126yyerrlab1:
2127 yyerrstatus = 3; /* Each real token shifted decrements this. */
2128
2129 for (;;)
2130 {
2131 yyn = yypact[yystate];
2132 if (!yypact_value_is_default (yyn))
2133 {
2134 yyn += YYTERROR;
2135 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2136 {
2137 yyn = yytable[yyn];
2138 if (0 < yyn)
2139 break;
2140 }
2141 }
2142
2143 /* Pop the current state because it cannot handle the error token. */
2144 if (yyssp == yyss)
2145 YYABORT;
2146
2147
2148 yydestruct ("Error: popping",
2149 yystos[yystate], yyvsp, scanner);
2150 YYPOPSTACK (1);
2151 yystate = *yyssp;
2152 YY_STACK_PRINT (yyss, yyssp);
2153 }
2154
2156 *++yyvsp = yylval;
2158
2159
2160 /* Shift the error token. */
2161 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2162
2163 yystate = yyn;
2164 goto yynewstate;
2165
2166
2167/*-------------------------------------.
2168| yyacceptlab -- YYACCEPT comes here. |
2169`-------------------------------------*/
2170yyacceptlab:
2171 yyresult = 0;
2172 goto yyreturn;
2173
2174
2175/*-----------------------------------.
2176| yyabortlab -- YYABORT comes here. |
2177`-----------------------------------*/
2178yyabortlab:
2179 yyresult = 1;
2180 goto yyreturn;
2181
2182
2183#if !defined yyoverflow || YYERROR_VERBOSE
2184/*-------------------------------------------------.
2185| yyexhaustedlab -- memory exhaustion comes here. |
2186`-------------------------------------------------*/
2187yyexhaustedlab:
2188 yyerror (scanner, YY_("memory exhausted"));
2189 yyresult = 2;
2190 /* Fall through. */
2191#endif
2192
2193
2194/*-----------------------------------------------------.
2195| yyreturn -- parsing is finished, return the result. |
2196`-----------------------------------------------------*/
2197yyreturn:
2198 if (yychar != YYEMPTY)
2199 {
2200 /* Make sure we have latest lookahead translation. See comments at
2201 user semantic actions for why this is necessary. */
2202 yytoken = YYTRANSLATE (yychar);
2203 yydestruct ("Cleanup: discarding lookahead",
2204 yytoken, &yylval, scanner);
2205 }
2206 /* Do not reclaim the symbols of the rule whose action triggered
2207 this YYABORT or YYACCEPT. */
2208 YYPOPSTACK (yylen);
2209 YY_STACK_PRINT (yyss, yyssp);
2210 while (yyssp != yyss)
2211 {
2212 yydestruct ("Cleanup: popping",
2213 yystos[+*yyssp], yyvsp, scanner);
2214 YYPOPSTACK (1);
2215 }
2216#ifndef yyoverflow
2217 if (yyss != yyssa)
2218 YYSTACK_FREE (yyss);
2219#endif
2220#if YYERROR_VERBOSE
2221 if (yymsg != yymsgbuf)
2222 YYSTACK_FREE (yymsg);
2223#endif
2224 return yyresult;
2225}
2226#line 357 "../../lib/common/htmlparse.y"
2227
2228
2229static void
2231{
2232 const textspan_t ti = {.str = agxbdisown(ag),
2233 .font = *sfont_back(&html_state->fontstack)};
2234 textspans_append(&html_state->fitemList, ti);
2235}
2236
2237static void
2239{
2240 htextspan_t lp = {0};
2241 textspans_t *ilist = &html_state->fitemList;
2242
2243 size_t cnt = textspans_size(ilist);
2244 lp.just = v;
2245 if (cnt) {
2246 lp.nitems = cnt;
2247 lp.items = gv_calloc(cnt, sizeof(textspan_t));
2248
2249 for (size_t i = 0; i < textspans_size(ilist); ++i) {
2250 // move this text span into the new list
2251 textspan_t *ti = textspans_at(ilist, i);
2252 lp.items[i] = *ti;
2253 *ti = (textspan_t){0};
2254 }
2255 }
2256 else {
2257 lp.items = gv_alloc(sizeof(textspan_t));
2258 lp.nitems = 1;
2259 lp.items[0].str = gv_strdup("");
2260 lp.items[0].font = *sfont_back(&html_state->fontstack);
2261 }
2262
2263 textspans_clear(ilist);
2264
2265 htextspans_append(&html_state->fspanList, lp);
2266}
2267
2268static htmltxt_t*
2270{
2271 htextspans_t *ispan = &html_state->fspanList;
2272 htmltxt_t *hft = gv_alloc(sizeof(htmltxt_t));
2273
2274 if (!textspans_is_empty(&html_state->fitemList))
2275 appendFLineList (html_state, UNSET_ALIGN);
2276
2277 size_t cnt = htextspans_size(ispan);
2278 hft->nspans = cnt;
2279
2280 hft->spans = gv_calloc(cnt, sizeof(htextspan_t));
2281 for (size_t i = 0; i < htextspans_size(ispan); ++i) {
2282 // move this HTML text span into the new list
2283 htextspan_t *hi = htextspans_at(ispan, i);
2284 hft->spans[i] = *hi;
2285 *hi = (htextspan_t){0};
2286 }
2287
2288 htextspans_clear(ispan);
2289
2290 return hft;
2291}
2292
2293static row_t *lastRow(htmlparserstate_t *html_state) {
2294 htmltbl_t* tbl = html_state->tblstack;
2295 row_t *sp = *rows_back(&tbl->u.p.rows);
2296 return sp;
2297}
2298
2299static void addRow(htmlparserstate_t *html_state) {
2300 htmltbl_t* tbl = html_state->tblstack;
2301 row_t *sp = gv_alloc(sizeof(row_t));
2302 if (tbl->hrule)
2303 sp->ruled = true;
2304 rows_append(&tbl->u.p.rows, sp);
2305}
2306
2307static void setCell(htmlparserstate_t *html_state, htmlcell_t *cp, void *obj, label_type_t kind) {
2308 htmltbl_t* tbl = html_state->tblstack;
2309 row_t *rp = *rows_back(&tbl->u.p.rows);
2310 cells_t *row = &rp->rp;
2311 cells_append(row, cp);
2312 cp->child.kind = kind;
2313 if (tbl->vrule) {
2314 cp->vruled = true;
2315 cp->hruled = false;
2316 }
2317
2318 if(kind == HTML_TEXT)
2319 cp->child.u.txt = obj;
2320 else if (kind == HTML_IMAGE)
2321 cp->child.u.img = obj;
2322 else
2323 cp->child.u.tbl = obj;
2324}
2325
2326static void cleanup (htmlparserstate_t *html_state)
2327{
2328 htmltbl_t* tp = html_state->tblstack;
2329 htmltbl_t* next;
2330
2331 if (html_state->lbl) {
2332 free_html_label (html_state->lbl,1);
2333 html_state->lbl = NULL;
2334 }
2335 while (tp) {
2336 next = tp->u.p.prev;
2337 cleanTbl (tp);
2338 tp = next;
2339 }
2340
2341 textspans_clear(&html_state->fitemList);
2342 htextspans_clear(&html_state->fspanList);
2343
2344 sfont_free(&html_state->fontstack);
2345}
2346
2347static void
2349{
2350 textfont_t* curfont = *sfont_back(&html_state->fontstack);
2351 textfont_t f = *fp;
2352
2353 if (curfont) {
2354 if (!f.color && curfont->color)
2355 f.color = curfont->color;
2356 if ((f.size < 0.0) && (curfont->size >= 0.0))
2357 f.size = curfont->size;
2358 if (!f.name && curfont->name)
2359 f.name = curfont->name;
2360 if (curfont->flags)
2361 f.flags |= curfont->flags;
2362 }
2363
2364 textfont_t *const ft = dtinsert(html_state->gvc->textfont_dt, &f);
2365 sfont_push_back(&html_state->fontstack, ft);
2366}
2367
2368static void
2370{
2371 (void)sfont_pop_back(&html_state->fontstack);
2372}
2373
2374/* Return parsed label or NULL if failure.
2375 * Set warn to 0 on success; 1 for warning message; 2 if no expat; 3 for error
2376 * message.
2377 */
2379parseHTML (char* txt, int* warn, htmlenv_t *env)
2380{
2381 agxbuf str = {0};
2382 htmllabel_t* l = NULL;
2383 htmlscan_t scanner = {0};
2384
2385 sfont_push_back(&scanner.parser.fontstack, NULL);
2386 scanner.parser.gvc = GD_gvc(env->g);
2387 scanner.parser.str = &str;
2388
2389 if (initHTMLlexer (&scanner, txt, &str, env)) {/* failed: no libexpat - give up */
2390 *warn = 2;
2391 }
2392 else {
2394 *warn = clearHTMLlexer (&scanner);
2395 l = scanner.parser.lbl;
2396 }
2397
2398 textspans_free(&scanner.parser.fitemList);
2399 htextspans_free(&scanner.parser.fspanList);
2400
2401 sfont_free(&scanner.parser.fontstack);
2402
2403 agxbfree (&str);
2404
2405 return l;
2406}
static void agxbfree(agxbuf *xb)
free any malloced resources
Definition agxbuf.h:78
static WUR char * agxbuse(agxbuf *xb)
Definition agxbuf.h:307
static char * agxbdisown(agxbuf *xb)
Definition agxbuf.h:327
Memory allocation wrappers that exit on failure.
static char * gv_strdup(const char *original)
Definition alloc.h:101
static void * gv_calloc(size_t nmemb, size_t size)
Definition alloc.h:26
static void * gv_alloc(size_t size)
Definition alloc.h:47
#define dtinsert(d, o)
Definition cdt.h:185
static const char *const yytname[]
Definition exparse.c:741
#define YYSTYPE
Definition gmlparse.c:66
short yytype_int16
Definition gmlparse.c:444
#define yychar
Definition gmlparse.c:74
static void cleanup(void)
Definition gmlparse.c:128
#define yylval
Definition gmlparse.c:73
int yy_state_fast_t
Definition gmlparse.c:510
signed char yytype_int8
Definition gmlparse.c:436
yytype_int8 yy_state_t
Definition gmlparse.c:507
node NULL
Definition grammar.y:163
static int cnt(Dict_t *d, Dtlink_t **set)
Definition graph.c:210
#define GD_gvc(g)
Definition types.h:355
int clearHTMLlexer(htmlscan_t *scanner)
Definition htmllex.c:778
int initHTMLlexer(htmlscan_t *scanner, char *src, agxbuf *xb, htmlenv_t *env)
Definition htmllex.c:745
void htmlerror(htmlscan_t *scanner, const char *msg)
Definition htmllex.c:58
#define T_n_sup
Definition htmlparse.c:289
#define T_end_row
Definition htmlparse.c:277
int htmlparse(htmlscan_t *scanner)
#define T_end_table
Definition htmlparse.c:280
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition htmlparse.c:548
#define YYMAXDEPTH
Definition htmlparse.c:1160
static void appendFItemList(htmlparserstate_t *html_state, agxbuf *ag)
Append a new text span to the list.
Definition htmlparse.c:2230
#define YYSTACK_FREE
Definition htmlparse.c:610
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
Definition htmlparse.c:1141
#define T_br
Definition htmlparse.c:299
static const yytype_int8 yytranslate[]
Definition htmlparse.c:723
#define YY_ASSERT(E)
Definition htmlparse.c:568
#define YY_(Msgid)
Definition htmlparse.c:509
#define T_vr
Definition htmlparse.c:296
#define T_error
Definition htmlparse.c:284
#define T_n_s
Definition htmlparse.c:291
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition htmlparse.c:549
htmltokentype
Definition htmlparse.c:232
static const yytype_int8 yydefact[]
Definition htmlparse.c:835
#define YYNSTATES
Definition htmlparse.c:710
#define YYSTYPE
Definition htmlparse.c:66
#define T_end_cell
Definition htmlparse.c:281
static void popFont(htmlparserstate_t *html_state)
Definition htmlparse.c:2369
#define YY_IGNORE_USELESS_CAST_END
Definition htmlparse.c:564
#define T_n_sub
Definition htmlparse.c:290
short yytype_int16
Definition htmlparse.c:433
static void addRow(htmlparserstate_t *html_state)
Add new cell row to current table.
Definition htmlparse.c:2299
#define YYUSE(E)
Definition htmlparse.c:531
#define YYEOF
Definition htmlparse.c:982
#define YYABORT
Definition htmlparse.c:985
#define T_n_bold
Definition htmlparse.c:286
#define YYSTACK_BYTES(N)
Definition htmlparse.c:654
#define T_html
Definition htmlparse.c:278
static const yytype_int8 yycheck[]
Definition htmlparse.c:904
static void cleanTbl(htmltbl_t *tp)
Clean up table if error in parsing.
Definition htmlparse.c:88
static void appendFLineList(htmlparserstate_t *html_state, int v)
Definition htmlparse.c:2238
static void free_ti(textspan_t item)
Definition htmlparse.c:344
#define T_BR
Definition htmlparse.c:298
htmllabel_t * parseHTML(char *txt, int *warn, htmlenv_t *env)
Definition htmlparse.c:2379
#define YY_REDUCE_PRINT(Rule)
Definition htmlparse.c:1143
#define YY_CAST(Type, Val)
Definition htmlparse.c:172
static const yytype_int16 yypact[]
Definition htmlparse.c:816
#define T_underline
Definition htmlparse.c:307
#define yylex
Definition htmlparse.c:69
#define T_sup
Definition htmlparse.c:309
#define YY_NULLPTR
Definition htmlparse.c:184
static row_t * lastRow(htmlparserstate_t *html_state)
Definition htmlparse.c:2293
#define T_row
Definition htmlparse.c:276
#define YYFINAL
Definition htmlparse.c:699
#define T_table
Definition htmlparse.c:302
#define T_end_vr
Definition htmlparse.c:297
#define T_end_html
Definition htmlparse.c:279
static const yytype_int16 yypgoto[]
Definition htmlparse.c:852
#define YY_INITIAL_VALUE(Value)
Definition htmlparse.c:545
#define yyparse
Definition htmlparse.c:68
static void cleanCell(htmlcell_t *cp)
Clean up cell if error in parsing.
Definition htmlparse.c:103
#define YYNTOKENS
Definition htmlparse.c:704
#define T_IMG
Definition htmlparse.c:300
unsigned char yytype_uint8
Definition htmlparse.c:442
#define YY_STACK_PRINT(Bottom, Top)
Definition htmlparse.c:1142
#define T_VR
Definition htmlparse.c:295
#define YYSIZE_T
Definition htmlparse.c:483
#define YYSTACK_ALLOC_MAXIMUM
Definition htmlparse.c:612
#define yydebug
Definition htmlparse.c:71
#define YY_IGNORE_USELESS_CAST_BEGIN
Definition htmlparse.c:563
static const yytype_int8 yyr2[]
Definition htmlparse.c:967
void * malloc(YYSIZE_T)
static const yytype_int8 yytable[]
Definition htmlparse.c:872
static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep, htmlscan_t *scanner)
Definition htmlparse.c:1401
#define T_bold
Definition htmlparse.c:306
#define YYPTRDIFF_T
Definition htmlparse.c:469
static htmltxt_t * mkText(htmlparserstate_t *html_state)
Definition htmlparse.c:2269
#define yynerrs
Definition htmlparse.c:72
#define T_end_img
Definition htmlparse.c:275
static void free_hi(htextspan_t item)
Definition htmlparse.c:350
#define T_sub
Definition htmlparse.c:310
#define YYACCEPT
Definition htmlparse.c:984
#define yytable_value_is_error(Yyn)
Definition htmlparse.c:811
#define T_s
Definition htmlparse.c:311
#define YYTRANSLATE(YYX)
Definition htmlparse.c:718
static void setCell(htmlparserstate_t *html_state, htmlcell_t *cp, void *obj, label_type_t kind)
Set cell body and type and attach to row.
Definition htmlparse.c:2307
static const yytype_int8 yystos[]
Definition htmlparse.c:938
#define T_n_italic
Definition htmlparse.c:285
static const yytype_int8 yyr1[]
Definition htmlparse.c:955
static htmllabel_t * mkLabel(void *obj, label_type_t kind)
Create label, given body and type.
Definition htmlparse.c:130
#define T_end_font
Definition htmlparse.c:282
#define T_overline
Definition htmlparse.c:308
#define T_hr
Definition htmlparse.c:293
#define YYTERROR
Definition htmlparse.c:1009
#define YYPOPSTACK(N)
int yy_state_fast_t
Definition htmlparse.c:499
#define T_font
Definition htmlparse.c:304
#define T_italic
Definition htmlparse.c:305
unsigned short yytype_uint16
Definition htmlparse.c:453
static const yytype_int8 yydefgoto[]
Definition htmlparse.c:861
static bool nonSpace(const char *s)
Return 1 if s contains a non-space character.
Definition htmlparse.c:148
#define T_end_br
Definition htmlparse.c:274
#define T_n_underline
Definition htmlparse.c:287
#define YYEMPTY
Definition htmlparse.c:981
#define YYLAST
Definition htmlparse.c:701
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition htmlparse.c:665
#define yypact_value_is_default(Yyn)
Definition htmlparse.c:806
#define T_cell
Definition htmlparse.c:303
#define YYINITDEPTH
Definition htmlparse.c:1149
signed char yytype_int8
Definition htmlparse.c:425
static void pushFont(htmlparserstate_t *html_state, textfont_t *fp)
Fonts are allocated in the lexer.
Definition htmlparse.c:2348
void free(void *)
#define YYERROR
Definition htmlparse.c:986
#define YYSIZEOF(X)
Definition htmlparse.c:493
#define YYSTACK_ALLOC
Definition htmlparse.c:609
#define T_end_hr
Definition htmlparse.c:294
yytype_int8 yy_state_t
Definition htmlparse.c:496
#define YYDPRINTF(Args)
Definition htmlparse.c:1140
#define T_string
Definition htmlparse.c:283
#define T_img
Definition htmlparse.c:301
#define T_HR
Definition htmlparse.c:292
#define yyerror
Definition htmlparse.c:70
#define T_n_overline
Definition htmlparse.c:288
textitem scanner parser str
Definition htmlparse.y:224
$2 font
Definition htmlparse.y:300
$2 u p rows
Definition htmlparse.y:298
rows row
Definition htmlparse.y:326
cell HTML_TBL
Definition htmlparse.y:338
cleanup & scanner
Definition htmlparse.y:295
void free_html_text(htmltxt_t *t)
Definition htmltable.c:803
void free_html_label(htmllabel_t *lp, int root)
Definition htmltable.c:864
void free_html_data(htmldata_t *dp)
Definition htmltable.c:792
#define UNSET_ALIGN
Definition htmltable.h:44
label_type_t
Definition htmltable.h:101
@ HTML_TEXT
Definition htmltable.h:101
@ HTML_IMAGE
Definition htmltable.h:101
#define DEFINE_LIST_WITH_DTOR(name, type, dtor)
Definition list.h:34
#define DEFINE_LIST(name, type)
Definition list.h:26
#define __INT_LEAST8_TYPE__
#define __UINT_LEAST8_TYPE__
Definition moc_predefs.h:10
#define __UINT_LEAST16_TYPE__
#define __INT_LEAST16_TYPE__
Definition gvcint.h:80
Dt_t * textfont_dt
Definition gvcint.h:107
result of partitioning available space, part of maze
Definition grid.h:33
size_t nitems
Definition htmltable.h:54
textspan_t * items
Definition htmltable.h:53
htmllabel_t child
Definition htmltable.h:163
bool vruled
vertically ruled?
Definition htmltable.h:165
bool hruled
horizontally ruled?
Definition htmltable.h:166
htmldata_t data
Definition htmltable.h:158
graph_t * g
Definition htmltable.h:173
htmltxt_t * txt
Definition htmltable.h:151
union htmllabel_t::@76 u
htmltbl_t * tbl
Definition htmltable.h:150
htmlimg_t * img
Definition htmltable.h:152
label_type_t kind
Definition htmltable.h:154
agxbuf * xb
Definition htmlparse.c:375
HTMLSTYPE * htmllval
Definition htmlparse.c:384
strview_t prevtok
Definition htmlparse.c:382
strview_t currtok
Definition htmlparse.c:381
htmltbl_t * tblstack
Definition htmlparse.c:361
textspans_t fitemList
Definition htmlparse.c:362
htextspans_t fspanList
Definition htmlparse.c:363
htmllabel_t * lbl
Definition htmlparse.c:360
htmlparserstate_t parser
Definition htmlparse.c:390
htmllexstate_t lexer
Definition htmlparse.c:389
union htmltbl_t::@73 u
bool vrule
vertical rule
Definition htmltable.h:145
struct htmltbl_t::@73::@75 p
bool hrule
horizontal rule
Definition htmltable.h:144
htmltbl_t * prev
Definition htmltable.h:134
htmldata_t data
Definition htmltable.h:127
rows_t rows
cells
Definition htmltable.h:135
size_t nspans
Definition htmltable.h:62
htextspan_t * spans
Definition htmltable.h:61
Definition utils.c:747
cells_t rp
Definition htmltable.h:114
bool ruled
Definition htmltable.h:115
a non-owning string reference
Definition strview.h:20
char * color
Definition textspan.h:55
char * name
Definition textspan.h:54
unsigned int flags
Definition textspan.h:58
double size
Definition textspan.h:57
char * str
Definition textspan.h:65
textfont_t * font
Definition textspan.h:66
Non-owning string references.
textspan_t, textfont_t, PostscriptAlias
htmltbl_t * tbl
Definition htmlparse.c:322
row_t * p
Definition htmlparse.c:325
htmlcell_t * cell
Definition htmlparse.c:321
htmltxt_t * txt
Definition htmlparse.c:320
textfont_t * font
Definition htmlparse.c:323
htmlimg_t * img
Definition htmlparse.c:324
Definition grammar.c:93