Graphviz 16.1.1~dev.20261107.0706
Loading...
Searching...
No Matches
htmlparse.c
Go to the documentation of this file.
1/* A Bison parser, made by GNU Bison 3.8.2. */
2
3/* Bison implementation for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 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 <https://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/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38 especially those whose name start with YY_ or yy_. They are
39 private implementation details that can be changed or removed. */
40
41/* All symbols defined below should begin with yy or YY, to avoid
42 infringing on user name space. This should be done even for local
43 variables, as they might otherwise be expanded by user macros.
44 There are some unavoidable exceptions within include files to
45 define necessary library symbols; they are noted "INFRINGES ON
46 USER NAME SPACE" below. */
47
48/* Identify Bison output, and Bison version. */
49#define YYBISON 30802
50
51/* Bison version string. */
52#define YYBISON_VERSION "3.8.2"
53
54/* Skeleton name. */
55#define YYSKELETON_NAME "yacc.c"
56
57/* Pure parsers. */
58#define YYPURE 2
59
60/* Push parsers. */
61#define YYPUSH 0
62
63/* Pull parsers. */
64#define YYPULL 1
65
66/* Substitute the type names. */
67#define YYSTYPE HTMLSTYPE
68/* Substitute the variable and function names. */
69#define yyparse htmlparse
70#define yylex htmllex
71#define yyerror htmlerror
72#define yydebug htmldebug
73#define yynerrs htmlnerrs
74
75/* First part of user prologue. */
76#line 84 "../../lib/common/htmlparse.y"
77
78
79#include <common/render.h>
80#include <common/htmltable.h>
81#include <common/htmllex.h>
82#include <stdbool.h>
83#include <util/alloc.h>
84
86static void cleanCell(htmlcell_t *cp);
87
89static void cleanTbl(htmltbl_t *tp) {
90 rows_t *rows = &tp->rows;
91 for (size_t r = 0; r < LIST_SIZE(rows); ++r) {
92 row_t *rp = LIST_GET(rows, r);
93 for (size_t c = 0; c < LIST_SIZE(&rp->rp); ++c) {
94 cleanCell(LIST_GET(&rp->rp, c));
95 }
96 }
98 free_html_data(&tp->data);
99 free(tp);
100}
101
103static void
105{
106 if (cp->child.kind == HTML_TBL) cleanTbl (cp->child.u.tbl);
107 else if (cp->child.kind == HTML_TEXT) free_html_text (cp->child.u.txt);
108 free_html_data (&cp->data);
109 free (cp);
110}
111
113static void
114appendFItemList (htmlparserstate_t *html_state, agxbuf *ag);
115
116static void
117appendFLineList (htmlparserstate_t *html_state, int v);
118
119static htmltxt_t*
120mkText(htmlparserstate_t *html_state);
121
122static row_t *lastRow(htmlparserstate_t *html_state);
123
125static void addRow(htmlparserstate_t *html_state);
126
128static void setCell(htmlparserstate_t *html_state, htmlcell_t *cp, void *obj, label_type_t kind);
129
131static htmllabel_t *mkLabel(void *obj, label_type_t kind) {
132 htmllabel_t* lp = gv_alloc(sizeof(htmllabel_t));
133
134 lp->kind = kind;
135 if (kind == HTML_TEXT)
136 lp->u.txt = obj;
137 else
138 lp->u.tbl = obj;
139 return lp;
140}
141
142/* Called on error. Frees resources allocated during parsing.
143 * This includes a label, plus a walk down the stack of
144 * tables. Note that `cleanTbl` frees the contained cells.
145 */
146static void cleanup (htmlparserstate_t *html_state);
147
149static bool nonSpace(const char *s) {
150 char c;
151
152 while ((c = *s++)) {
153 if (c != ' ') return true;
154 }
155 return false;
156}
157
159static void
160pushFont (htmlparserstate_t *html_state, textfont_t *fp);
161
162static void
163popFont (htmlparserstate_t *html_state);
164
165
166#line 167 "htmlparse.c"
167
168# ifndef YY_CAST
169# ifdef __cplusplus
170# define YY_CAST(Type, Val) static_cast<Type> (Val)
171# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
172# else
173# define YY_CAST(Type, Val) ((Type) (Val))
174# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
175# endif
176# endif
177# ifndef YY_NULLPTR
178# if defined __cplusplus
179# if 201103L <= __cplusplus
180# define YY_NULLPTR nullptr
181# else
182# define YY_NULLPTR 0
183# endif
184# else
185# define YY_NULLPTR ((void*)0)
186# endif
187# endif
188
189#include "htmlparse.h"
190/* Symbol kind. */
192{
194 YYSYMBOL_YYEOF = 0, /* "end of file" */
195 YYSYMBOL_YYerror = 1, /* error */
196 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
197 YYSYMBOL_T_end_br = 3, /* T_end_br */
198 YYSYMBOL_T_end_img = 4, /* T_end_img */
199 YYSYMBOL_T_row = 5, /* T_row */
200 YYSYMBOL_T_end_row = 6, /* T_end_row */
201 YYSYMBOL_T_html = 7, /* T_html */
202 YYSYMBOL_T_end_html = 8, /* T_end_html */
203 YYSYMBOL_T_end_table = 9, /* T_end_table */
204 YYSYMBOL_T_end_cell = 10, /* T_end_cell */
205 YYSYMBOL_T_end_font = 11, /* T_end_font */
206 YYSYMBOL_T_string = 12, /* T_string */
207 YYSYMBOL_T_error = 13, /* T_error */
208 YYSYMBOL_T_n_italic = 14, /* T_n_italic */
209 YYSYMBOL_T_n_bold = 15, /* T_n_bold */
210 YYSYMBOL_T_n_underline = 16, /* T_n_underline */
211 YYSYMBOL_T_n_overline = 17, /* T_n_overline */
212 YYSYMBOL_T_n_sup = 18, /* T_n_sup */
213 YYSYMBOL_T_n_sub = 19, /* T_n_sub */
214 YYSYMBOL_T_n_s = 20, /* T_n_s */
215 YYSYMBOL_T_HR = 21, /* T_HR */
216 YYSYMBOL_T_hr = 22, /* T_hr */
217 YYSYMBOL_T_end_hr = 23, /* T_end_hr */
218 YYSYMBOL_T_VR = 24, /* T_VR */
219 YYSYMBOL_T_vr = 25, /* T_vr */
220 YYSYMBOL_T_end_vr = 26, /* T_end_vr */
221 YYSYMBOL_T_BR = 27, /* T_BR */
222 YYSYMBOL_T_br = 28, /* T_br */
223 YYSYMBOL_T_IMG = 29, /* T_IMG */
224 YYSYMBOL_T_img = 30, /* T_img */
225 YYSYMBOL_T_table = 31, /* T_table */
226 YYSYMBOL_T_cell = 32, /* T_cell */
227 YYSYMBOL_T_font = 33, /* T_font */
228 YYSYMBOL_T_italic = 34, /* T_italic */
229 YYSYMBOL_T_bold = 35, /* T_bold */
230 YYSYMBOL_T_underline = 36, /* T_underline */
231 YYSYMBOL_T_overline = 37, /* T_overline */
232 YYSYMBOL_T_sup = 38, /* T_sup */
233 YYSYMBOL_T_sub = 39, /* T_sub */
234 YYSYMBOL_T_s = 40, /* T_s */
235 YYSYMBOL_YYACCEPT = 41, /* $accept */
236 YYSYMBOL_html = 42, /* html */
237 YYSYMBOL_fonttext = 43, /* fonttext */
238 YYSYMBOL_text = 44, /* text */
239 YYSYMBOL_textitem = 45, /* textitem */
240 YYSYMBOL_font = 46, /* font */
241 YYSYMBOL_n_font = 47, /* n_font */
242 YYSYMBOL_italic = 48, /* italic */
243 YYSYMBOL_n_italic = 49, /* n_italic */
244 YYSYMBOL_bold = 50, /* bold */
245 YYSYMBOL_n_bold = 51, /* n_bold */
246 YYSYMBOL_strike = 52, /* strike */
247 YYSYMBOL_n_strike = 53, /* n_strike */
248 YYSYMBOL_underline = 54, /* underline */
249 YYSYMBOL_n_underline = 55, /* n_underline */
250 YYSYMBOL_overline = 56, /* overline */
251 YYSYMBOL_n_overline = 57, /* n_overline */
252 YYSYMBOL_sup = 58, /* sup */
253 YYSYMBOL_n_sup = 59, /* n_sup */
254 YYSYMBOL_sub = 60, /* sub */
255 YYSYMBOL_n_sub = 61, /* n_sub */
256 YYSYMBOL_br = 62, /* br */
257 YYSYMBOL_string = 63, /* string */
258 YYSYMBOL_table = 64, /* table */
259 YYSYMBOL_65_1 = 65, /* @1 */
260 YYSYMBOL_fonttable = 66, /* fonttable */
261 YYSYMBOL_opt_space = 67, /* opt_space */
262 YYSYMBOL_rows = 68, /* rows */
263 YYSYMBOL_row = 69, /* row */
264 YYSYMBOL_70_2 = 70, /* $@2 */
265 YYSYMBOL_cells = 71, /* cells */
266 YYSYMBOL_cell = 72, /* cell */
267 YYSYMBOL_73_3 = 73, /* $@3 */
268 YYSYMBOL_74_4 = 74, /* $@4 */
269 YYSYMBOL_75_5 = 75, /* $@5 */
270 YYSYMBOL_76_6 = 76, /* $@6 */
271 YYSYMBOL_image = 77, /* image */
272 YYSYMBOL_78_7 = 78, /* $@7 */
273 YYSYMBOL_79_8 = 79, /* $@8 */
274 YYSYMBOL_HR = 80, /* HR */
275 YYSYMBOL_VR = 81 /* VR */
278
279
280
281
282#ifdef short
283# undef short
284#endif
285
286/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
287 <limits.h> and (if available) <stdint.h> are included
288 so that the code can choose integer types of a good width. */
289
290#ifndef __PTRDIFF_MAX__
291# include <limits.h> /* INFRINGES ON USER NAME SPACE */
292# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
293# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
294# define YY_STDINT_H
295# endif
296#endif
297
298/* Narrow types that promote to a signed type and that can represent a
299 signed or unsigned integer of at least N bits. In tables they can
300 save space and decrease cache pressure. Promoting to a signed type
301 helps avoid bugs in integer arithmetic. */
302
303#ifdef __INT_LEAST8_MAX__
304typedef __INT_LEAST8_TYPE__ yytype_int8;
305#elif defined YY_STDINT_H
306typedef int_least8_t yytype_int8;
307#else
308typedef signed char yytype_int8;
309#endif
310
311#ifdef __INT_LEAST16_MAX__
312typedef __INT_LEAST16_TYPE__ yytype_int16;
313#elif defined YY_STDINT_H
314typedef int_least16_t yytype_int16;
315#else
316typedef short yytype_int16;
317#endif
318
319/* Work around bug in HP-UX 11.23, which defines these macros
320 incorrectly for preprocessor constants. This workaround can likely
321 be removed in 2023, as HPE has promised support for HP-UX 11.23
322 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
323 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
324#ifdef __hpux
325# undef UINT_LEAST8_MAX
326# undef UINT_LEAST16_MAX
327# define UINT_LEAST8_MAX 255
328# define UINT_LEAST16_MAX 65535
329#endif
330
331#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
332typedef __UINT_LEAST8_TYPE__ yytype_uint8;
333#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
334 && UINT_LEAST8_MAX <= INT_MAX)
335typedef uint_least8_t yytype_uint8;
336#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
337typedef unsigned char yytype_uint8;
338#else
339typedef short yytype_uint8;
340#endif
341
342#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
343typedef __UINT_LEAST16_TYPE__ yytype_uint16;
344#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
345 && UINT_LEAST16_MAX <= INT_MAX)
346typedef uint_least16_t yytype_uint16;
347#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
348typedef unsigned short yytype_uint16;
349#else
350typedef int yytype_uint16;
351#endif
352
353#ifndef YYPTRDIFF_T
354# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
355# define YYPTRDIFF_T __PTRDIFF_TYPE__
356# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
357# elif defined PTRDIFF_MAX
358# ifndef ptrdiff_t
359# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
360# endif
361# define YYPTRDIFF_T ptrdiff_t
362# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
363# else
364# define YYPTRDIFF_T long
365# define YYPTRDIFF_MAXIMUM LONG_MAX
366# endif
367#endif
368
369#ifndef YYSIZE_T
370# ifdef __SIZE_TYPE__
371# define YYSIZE_T __SIZE_TYPE__
372# elif defined size_t
373# define YYSIZE_T size_t
374# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
375# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
376# define YYSIZE_T size_t
377# else
378# define YYSIZE_T unsigned
379# endif
380#endif
381
382#define YYSIZE_MAXIMUM \
383 YY_CAST (YYPTRDIFF_T, \
384 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
385 ? YYPTRDIFF_MAXIMUM \
386 : YY_CAST (YYSIZE_T, -1)))
387
388#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
389
390
391/* Stored state numbers (used for stacks). */
393
394/* State numbers in computations. */
395typedef int yy_state_fast_t;
396
397#ifndef YY_
398# if defined YYENABLE_NLS && YYENABLE_NLS
399# if ENABLE_NLS
400# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
401# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
402# endif
403# endif
404# ifndef YY_
405# define YY_(Msgid) Msgid
406# endif
407#endif
408
409
410#ifndef YY_ATTRIBUTE_PURE
411# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
412# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
413# else
414# define YY_ATTRIBUTE_PURE
415# endif
416#endif
417
418#ifndef YY_ATTRIBUTE_UNUSED
419# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
420# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
421# else
422# define YY_ATTRIBUTE_UNUSED
423# endif
424#endif
425
426/* Suppress unused-variable warnings by "using" E. */
427#if ! defined lint || defined __GNUC__
428# define YY_USE(E) ((void) (E))
429#else
430# define YY_USE(E) /* empty */
431#endif
432
433/* Suppress an incorrect diagnostic about yylval being uninitialized. */
434#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
435# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
436# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
437 _Pragma ("GCC diagnostic push") \
438 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
439# else
440# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
441 _Pragma ("GCC diagnostic push") \
442 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
443 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
444# endif
445# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
446 _Pragma ("GCC diagnostic pop")
447#else
448# define YY_INITIAL_VALUE(Value) Value
449#endif
450#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
451# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
452# define YY_IGNORE_MAYBE_UNINITIALIZED_END
453#endif
454#ifndef YY_INITIAL_VALUE
455# define YY_INITIAL_VALUE(Value) /* Nothing. */
456#endif
457
458#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
459# define YY_IGNORE_USELESS_CAST_BEGIN \
460 _Pragma ("GCC diagnostic push") \
461 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
462# define YY_IGNORE_USELESS_CAST_END \
463 _Pragma ("GCC diagnostic pop")
464#endif
465#ifndef YY_IGNORE_USELESS_CAST_BEGIN
466# define YY_IGNORE_USELESS_CAST_BEGIN
467# define YY_IGNORE_USELESS_CAST_END
468#endif
469
470
471#define YY_ASSERT(E) ((void) (0 && (E)))
472
473#if !defined yyoverflow
474
475/* The parser invokes alloca or malloc; define the necessary symbols. */
476
477# ifdef YYSTACK_USE_ALLOCA
478# if YYSTACK_USE_ALLOCA
479# ifdef __GNUC__
480# define YYSTACK_ALLOC __builtin_alloca
481# elif defined __BUILTIN_VA_ARG_INCR
482# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
483# elif defined _AIX
484# define YYSTACK_ALLOC __alloca
485# elif defined _MSC_VER
486# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
487# define alloca _alloca
488# else
489# define YYSTACK_ALLOC alloca
490# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
491# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
492 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
493# ifndef EXIT_SUCCESS
494# define EXIT_SUCCESS 0
495# endif
496# endif
497# endif
498# endif
499# endif
500
501# ifdef YYSTACK_ALLOC
502 /* Pacify GCC's 'empty if-body' warning. */
503# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
504# ifndef YYSTACK_ALLOC_MAXIMUM
505 /* The OS might guarantee only one guard page at the bottom of the stack,
506 and a page size can be as small as 4096 bytes. So we cannot safely
507 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
508 to allow for a few compiler-allocated temporary stack slots. */
509# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
510# endif
511# else
512# define YYSTACK_ALLOC YYMALLOC
513# define YYSTACK_FREE YYFREE
514# ifndef YYSTACK_ALLOC_MAXIMUM
515# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
516# endif
517# if (defined __cplusplus && ! defined EXIT_SUCCESS \
518 && ! ((defined YYMALLOC || defined malloc) \
519 && (defined YYFREE || defined free)))
520# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
521# ifndef EXIT_SUCCESS
522# define EXIT_SUCCESS 0
523# endif
524# endif
525# ifndef YYMALLOC
526# define YYMALLOC malloc
527# if ! defined malloc && ! defined EXIT_SUCCESS
528void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
529# endif
530# endif
531# ifndef YYFREE
532# define YYFREE free
533# if ! defined free && ! defined EXIT_SUCCESS
534void free (void *); /* INFRINGES ON USER NAME SPACE */
535# endif
536# endif
537# endif
538#endif /* !defined yyoverflow */
539
540#if (! defined yyoverflow \
541 && (! defined __cplusplus \
542 || (defined HTMLSTYPE_IS_TRIVIAL && HTMLSTYPE_IS_TRIVIAL)))
543
544/* A type that is properly aligned for any stack member. */
545union yyalloc
546{
547 yy_state_t yyss_alloc;
548 YYSTYPE yyvs_alloc;
549};
550
551/* The size of the maximum gap between one aligned stack and the next. */
552# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
553
554/* The size of an array large to enough to hold all stacks, each with
555 N elements. */
556# define YYSTACK_BYTES(N) \
557 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
558 + YYSTACK_GAP_MAXIMUM)
559
560# define YYCOPY_NEEDED 1
561
562/* Relocate STACK from its old location to the new one. The
563 local variables YYSIZE and YYSTACKSIZE give the old and new number of
564 elements in the stack, and YYPTR gives the new location of the
565 stack. Advance YYPTR to a properly aligned location for the next
566 stack. */
567# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
568 do \
569 { \
570 YYPTRDIFF_T yynewbytes; \
571 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
572 Stack = &yyptr->Stack_alloc; \
573 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
574 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
575 } \
576 while (0)
577
578#endif
579
580#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
581/* Copy COUNT objects from SRC to DST. The source and destination do
582 not overlap. */
583# ifndef YYCOPY
584# if defined __GNUC__ && 1 < __GNUC__
585# define YYCOPY(Dst, Src, Count) \
586 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
587# else
588# define YYCOPY(Dst, Src, Count) \
589 do \
590 { \
591 YYPTRDIFF_T yyi; \
592 for (yyi = 0; yyi < (Count); yyi++) \
593 (Dst)[yyi] = (Src)[yyi]; \
594 } \
595 while (0)
596# endif
597# endif
598#endif /* !YYCOPY_NEEDED */
599
600/* YYFINAL -- State number of the termination state. */
601#define YYFINAL 31
602/* YYLAST -- Last index in YYTABLE. */
603#define YYLAST 285
604
605/* YYNTOKENS -- Number of terminals. */
606#define YYNTOKENS 41
607/* YYNNTS -- Number of nonterminals. */
608#define YYNNTS 41
609/* YYNRULES -- Number of rules. */
610#define YYNRULES 71
611/* YYNSTATES -- Number of states. */
612#define YYNSTATES 121
613
614/* YYMAXUTOK -- Last valid token kind. */
615#define YYMAXUTOK 295
616
617
618/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
619 as returned by yylex, with out-of-bounds checking. */
620#define YYTRANSLATE(YYX) \
621 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
622 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
623 : YYSYMBOL_YYUNDEF)
624
625/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
626 as returned by yylex. */
627static const yytype_int8 yytranslate[] =
628{
629 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
630 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
631 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
632 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
633 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
634 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
635 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
636 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
637 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
638 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
639 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
640 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
641 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
642 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
643 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
644 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
645 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
646 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
647 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
648 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
649 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
650 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
651 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
652 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
653 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
654 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
655 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
656 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
657 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
658 35, 36, 37, 38, 39, 40
659};
660
661#if HTMLDEBUG
662/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
663static const yytype_int16 yyrline[] =
664{
665 0, 206, 206, 207, 208, 211, 214, 215, 218, 219,
666 220, 221, 222, 223, 224, 225, 226, 227, 230, 233,
667 236, 239, 242, 245, 248, 251, 254, 257, 260, 263,
668 266, 269, 272, 275, 278, 279, 282, 283, 286, 286,
669 307, 308, 309, 310, 311, 312, 315, 316, 319, 320,
670 321, 324, 324, 327, 328, 329, 332, 332, 333, 333,
671 334, 334, 335, 335, 338, 338, 347, 347, 358, 359,
672 362, 363
673};
674#endif
675
677#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
678
679#if HTMLDEBUG || 0
680/* The user-facing name of the symbol whose (internal) number is
681 YYSYMBOL. No bounds checking. */
682static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
683
684/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
685 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
686static const char *const yytname[] =
687{
688 "\"end of file\"", "error", "\"invalid token\"", "T_end_br",
689 "T_end_img", "T_row", "T_end_row", "T_html", "T_end_html", "T_end_table",
690 "T_end_cell", "T_end_font", "T_string", "T_error", "T_n_italic",
691 "T_n_bold", "T_n_underline", "T_n_overline", "T_n_sup", "T_n_sub",
692 "T_n_s", "T_HR", "T_hr", "T_end_hr", "T_VR", "T_vr", "T_end_vr", "T_BR",
693 "T_br", "T_IMG", "T_img", "T_table", "T_cell", "T_font", "T_italic",
694 "T_bold", "T_underline", "T_overline", "T_sup", "T_sub", "T_s",
695 "$accept", "html", "fonttext", "text", "textitem", "font", "n_font",
696 "italic", "n_italic", "bold", "n_bold", "strike", "n_strike",
697 "underline", "n_underline", "overline", "n_overline", "sup", "n_sup",
698 "sub", "n_sub", "br", "string", "table", "@1", "fonttable", "opt_space",
699 "rows", "row", "$@2", "cells", "cell", "$@3", "$@4", "$@5", "$@6",
700 "image", "$@7", "$@8", "HR", "VR", YY_NULLPTR
701};
702
703static const char *
705{
706 return yytname[yysymbol];
707}
708#endif
709
710#define YYPACT_NINF (-82)
711
712#define yypact_value_is_default(Yyn) \
713 ((Yyn) == YYPACT_NINF)
714
715#define YYTABLE_NINF (-67)
716
717#define yytable_value_is_error(Yyn) \
718 0
719
720/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
721 STATE-NUM. */
722static const yytype_int16 yypact[] =
723{
724 27, -82, 223, 10, -82, -82, 9, -82, -82, -82,
725 -82, -82, -82, -82, -82, 5, 223, -82, 223, 223,
726 223, 223, 223, 223, 223, 223, -82, -5, -82, 22,
727 8, -82, -82, -82, -82, 223, 223, 223, 223, 223,
728 20, 65, 25, 34, 44, 94, 26, 123, 137, 43,
729 166, 46, 180, 209, -82, -82, -82, -82, -82, -82,
730 -82, -82, -82, -82, -82, -82, -82, -82, -82, -82,
731 -82, -82, -82, -82, -82, -82, -82, -82, 55, -82,
732 74, -82, 32, 53, -82, 52, -82, 55, 17, 88,
733 -82, 20, -82, -82, -82, -82, -82, -20, 56, -82,
734 -82, -82, 54, -82, 32, 68, 72, 67, 78, -82,
735 75, -82, -82, -82, -82, 80, 53, -82, 53, -82,
736 -82
737};
738
739/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
740 Performed when YYTABLE does not specify something else to do. Zero
741 means the default is an error. */
742static const yytype_int8 yydefact[] =
743{
744 0, 4, 47, 0, 36, 35, 0, 18, 20, 22,
745 26, 28, 30, 32, 24, 0, 5, 7, 47, 47,
746 47, 0, 47, 47, 0, 0, 9, 8, 40, 0,
747 0, 1, 34, 2, 6, 0, 0, 0, 0, 0,
748 8, 0, 0, 0, 0, 0, 0, 0, 0, 0,
749 0, 0, 0, 0, 37, 3, 38, 19, 10, 41,
750 21, 11, 42, 23, 14, 45, 25, 17, 27, 12,
751 43, 29, 13, 44, 31, 15, 33, 16, 0, 51,
752 0, 48, 0, 47, 69, 0, 49, 0, 47, 0,
753 53, 46, 39, 68, 50, 58, 56, 64, 0, 60,
754 52, 71, 0, 54, 0, 0, 0, 0, 0, 63,
755 0, 70, 55, 59, 57, 0, 47, 61, 47, 67,
756 65
757};
758
759/* YYPGOTO[NTERM-NUM]. */
760static const yytype_int16 yypgoto[] =
761{
762 -82, -82, 23, 246, -10, -1, 66, 0, 71, 1,
763 64, -82, -82, 2, 69, 3, 73, -82, -82, -82,
764 -82, -82, -2, 118, -82, 29, -69, -82, -65, -82,
765 -82, -81, -82, -82, -82, -82, -82, -82, -82, -82,
766 -82
767};
768
769/* YYDEFGOTO[NTERM-NUM]. */
770static const yytype_int8 yydefgoto[] =
771{
772 0, 3, 15, 16, 17, 35, 58, 36, 61, 37,
773 64, 21, 67, 38, 69, 39, 72, 24, 75, 25,
774 77, 26, 40, 28, 78, 29, 30, 80, 81, 82,
775 89, 90, 106, 105, 110, 98, 99, 107, 108, 87,
776 104
777};
778
779/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
780 positive, shift that token. If negative, reduce the rule whose
781 number is the opposite. If YYTABLE_NINF, syntax error. */
782static const yytype_int8 yytable[] =
783{
784 27, 18, 19, 20, 22, 23, 34, 54, 103, -66,
785 31, 56, 32, 33, 92, 86, 27, 27, 27, 97,
786 27, 27, 94, 112, -46, -46, -46, -62, 1, 4,
787 55, 34, 54, 34, 2, 34, 57, 34, 34, 56,
788 34, 63, 34, 34, 5, 6, 4, 119, 60, 120,
789 7, 8, 9, 10, 11, 12, 13, 14, 60, 68,
790 79, 5, 6, 71, 88, 4, 109, 7, 8, 9,
791 10, 11, 12, 13, 14, 93, 57, 4, 113, 79,
792 111, 91, 114, 83, 118, 117, 27, 18, 19, 20,
793 22, 23, 5, 6, 100, 84, 85, 115, 7, 8,
794 9, 10, 11, 12, 13, 14, 4, 116, 59, 63,
795 65, 95, 101, 102, 91, 62, 91, 96, 70, 0,
796 88, 5, 6, 0, 73, 0, 0, 7, 8, 9,
797 10, 11, 12, 13, 14, 4, 42, 44, 46, 0,
798 49, 51, 0, 66, 0, 0, 0, 0, 0, 4,
799 5, 6, 0, 68, 0, 0, 7, 8, 9, 10,
800 11, 12, 13, 14, 5, 6, 0, 0, 0, 0,
801 7, 8, 9, 10, 11, 12, 13, 14, 4, 0,
802 0, 0, 0, 71, 0, 0, 0, 0, 0, 0,
803 0, 0, 4, 5, 6, 0, 0, 0, 74, 7,
804 8, 9, 10, 11, 12, 13, 14, 5, 6, 0,
805 0, 0, 0, 7, 8, 9, 10, 11, 12, 13,
806 14, 4, 0, 0, 0, 0, 0, 0, 76, 0,
807 0, 0, 0, 0, 0, 4, 5, 6, 0, 0,
808 0, 0, 7, 8, 9, 10, 11, 12, 13, 14,
809 5, 6, 0, 0, 0, 0, 7, 8, 9, 10,
810 11, 12, 13, 14, 41, 43, 45, 47, 48, 50,
811 52, 53, 0, 0, 0, 0, 0, 0, 0, 0,
812 0, 41, 43, 45, 48, 50
813};
814
815static const yytype_int8 yycheck[] =
816{
817 2, 2, 2, 2, 2, 2, 16, 12, 89, 29,
818 0, 31, 3, 8, 83, 80, 18, 19, 20, 88,
819 22, 23, 87, 104, 29, 30, 31, 10, 1, 12,
820 8, 41, 12, 43, 7, 45, 11, 47, 48, 31,
821 50, 15, 52, 53, 27, 28, 12, 116, 14, 118,
822 33, 34, 35, 36, 37, 38, 39, 40, 14, 16,
823 5, 27, 28, 17, 32, 12, 10, 33, 34, 35,
824 36, 37, 38, 39, 40, 23, 11, 12, 10, 5,
825 26, 83, 10, 9, 4, 10, 88, 88, 88, 88,
826 88, 88, 27, 28, 6, 21, 22, 30, 33, 34,
827 35, 36, 37, 38, 39, 40, 12, 29, 42, 15,
828 46, 88, 24, 25, 116, 44, 118, 88, 49, -1,
829 32, 27, 28, -1, 51, -1, -1, 33, 34, 35,
830 36, 37, 38, 39, 40, 12, 18, 19, 20, -1,
831 22, 23, -1, 20, -1, -1, -1, -1, -1, 12,
832 27, 28, -1, 16, -1, -1, 33, 34, 35, 36,
833 37, 38, 39, 40, 27, 28, -1, -1, -1, -1,
834 33, 34, 35, 36, 37, 38, 39, 40, 12, -1,
835 -1, -1, -1, 17, -1, -1, -1, -1, -1, -1,
836 -1, -1, 12, 27, 28, -1, -1, -1, 18, 33,
837 34, 35, 36, 37, 38, 39, 40, 27, 28, -1,
838 -1, -1, -1, 33, 34, 35, 36, 37, 38, 39,
839 40, 12, -1, -1, -1, -1, -1, -1, 19, -1,
840 -1, -1, -1, -1, -1, 12, 27, 28, -1, -1,
841 -1, -1, 33, 34, 35, 36, 37, 38, 39, 40,
842 27, 28, -1, -1, -1, -1, 33, 34, 35, 36,
843 37, 38, 39, 40, 18, 19, 20, 21, 22, 23,
844 24, 25, -1, -1, -1, -1, -1, -1, -1, -1,
845 -1, 35, 36, 37, 38, 39
846};
847
848/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
849 state STATE-NUM. */
850static const yytype_int8 yystos[] =
851{
852 0, 1, 7, 42, 12, 27, 28, 33, 34, 35,
853 36, 37, 38, 39, 40, 43, 44, 45, 46, 48,
854 50, 52, 54, 56, 58, 60, 62, 63, 64, 66,
855 67, 0, 3, 8, 45, 46, 48, 50, 54, 56,
856 63, 44, 64, 44, 64, 44, 64, 44, 44, 64,
857 44, 64, 44, 44, 12, 8, 31, 11, 47, 47,
858 14, 49, 49, 15, 51, 51, 20, 53, 16, 55,
859 55, 17, 57, 57, 18, 59, 19, 61, 65, 5,
860 68, 69, 70, 9, 21, 22, 69, 80, 32, 71,
861 72, 63, 67, 23, 69, 43, 66, 67, 76, 77,
862 6, 24, 25, 72, 81, 74, 73, 78, 79, 10,
863 75, 26, 72, 10, 10, 30, 29, 10, 4, 67,
864 67
865};
866
867/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
868static const yytype_int8 yyr1[] =
869{
870 0, 41, 42, 42, 42, 43, 44, 44, 45, 45,
871 45, 45, 45, 45, 45, 45, 45, 45, 46, 47,
872 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
873 58, 59, 60, 61, 62, 62, 63, 63, 65, 64,
874 66, 66, 66, 66, 66, 66, 67, 67, 68, 68,
875 68, 70, 69, 71, 71, 71, 73, 72, 74, 72,
876 75, 72, 76, 72, 78, 77, 79, 77, 80, 80,
877 81, 81
878};
879
880/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
881static const yytype_int8 yyr2[] =
882{
883 0, 2, 3, 3, 1, 1, 2, 1, 1, 1,
884 3, 3, 3, 3, 3, 3, 3, 3, 1, 1,
885 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
886 1, 1, 1, 1, 2, 1, 1, 2, 0, 6,
887 1, 3, 3, 3, 3, 3, 1, 0, 1, 2,
888 3, 0, 4, 1, 2, 3, 0, 4, 0, 4,
889 0, 4, 0, 3, 0, 5, 0, 4, 2, 1,
890 2, 1
891};
892
893
894enum { YYENOMEM = -2 };
895
896#define yyerrok (yyerrstatus = 0)
897#define yyclearin (yychar = HTMLEMPTY)
898
899#define YYACCEPT goto yyacceptlab
900#define YYABORT goto yyabortlab
901#define YYERROR goto yyerrorlab
902#define YYNOMEM goto yyexhaustedlab
903
904
905#define YYRECOVERING() (!!yyerrstatus)
906
907#define YYBACKUP(Token, Value) \
908 do \
909 if (yychar == HTMLEMPTY) \
910 { \
911 yychar = (Token); \
912 yylval = (Value); \
913 YYPOPSTACK (yylen); \
914 yystate = *yyssp; \
915 goto yybackup; \
916 } \
917 else \
918 { \
919 yyerror (scanner, YY_("syntax error: cannot back up")); \
920 YYERROR; \
921 } \
922 while (0)
923
924/* Backward compatibility with an undocumented macro.
925 Use HTMLerror or HTMLUNDEF. */
926#define YYERRCODE HTMLUNDEF
927
928
929/* Enable debugging if requested. */
930#if HTMLDEBUG
931
932# ifndef YYFPRINTF
933# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
934# define YYFPRINTF fprintf
935# endif
936
937# define YYDPRINTF(Args) \
938do { \
939 if (yydebug) \
940 YYFPRINTF Args; \
941} while (0)
942
943
944
945
946# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
947do { \
948 if (yydebug) \
949 { \
950 YYFPRINTF (stderr, "%s ", Title); \
951 yy_symbol_print (stderr, \
952 Kind, Value, scanner); \
953 YYFPRINTF (stderr, "\n"); \
954 } \
955} while (0)
956
957
958/*-----------------------------------.
959| Print this symbol's value on YYO. |
960`-----------------------------------*/
961
962static void
963yy_symbol_value_print (FILE *yyo,
964 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, htmlscan_t *scanner)
965{
966 FILE *yyoutput = yyo;
967 YY_USE (yyoutput);
968 YY_USE (scanner);
969 if (!yyvaluep)
970 return;
972 YY_USE (yykind);
974}
975
976
977/*---------------------------.
978| Print this symbol on YYO. |
979`---------------------------*/
980
981static void
982yy_symbol_print (FILE *yyo,
983 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, htmlscan_t *scanner)
984{
985 YYFPRINTF (yyo, "%s %s (",
986 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
987
988 yy_symbol_value_print (yyo, yykind, yyvaluep, scanner);
989 YYFPRINTF (yyo, ")");
990}
991
992/*------------------------------------------------------------------.
993| yy_stack_print -- Print the state stack from its BOTTOM up to its |
994| TOP (included). |
995`------------------------------------------------------------------*/
996
997static void
998yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
999{
1000 YYFPRINTF (stderr, "Stack now");
1001 for (; yybottom <= yytop; yybottom++)
1002 {
1003 int yybot = *yybottom;
1004 YYFPRINTF (stderr, " %d", yybot);
1005 }
1006 YYFPRINTF (stderr, "\n");
1007}
1008
1009# define YY_STACK_PRINT(Bottom, Top) \
1010do { \
1011 if (yydebug) \
1012 yy_stack_print ((Bottom), (Top)); \
1013} while (0)
1014
1015
1016/*------------------------------------------------.
1017| Report that the YYRULE is going to be reduced. |
1018`------------------------------------------------*/
1019
1020static void
1021yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
1022 int yyrule, htmlscan_t *scanner)
1023{
1024 int yylno = yyrline[yyrule];
1025 int yynrhs = yyr2[yyrule];
1026 int yyi;
1027 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1028 yyrule - 1, yylno);
1029 /* The symbols being reduced. */
1030 for (yyi = 0; yyi < yynrhs; yyi++)
1031 {
1032 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1033 yy_symbol_print (stderr,
1034 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1035 &yyvsp[(yyi + 1) - (yynrhs)], scanner);
1036 YYFPRINTF (stderr, "\n");
1037 }
1038}
1039
1040# define YY_REDUCE_PRINT(Rule) \
1041do { \
1042 if (yydebug) \
1043 yy_reduce_print (yyssp, yyvsp, Rule, scanner); \
1044} while (0)
1045
1046/* Nonzero means print parse trace. It is left uninitialized so that
1047 multiple parsers can coexist. */
1048int yydebug;
1049#else /* !HTMLDEBUG */
1050# define YYDPRINTF(Args) ((void) 0)
1051# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1052# define YY_STACK_PRINT(Bottom, Top)
1053# define YY_REDUCE_PRINT(Rule)
1054#endif /* !HTMLDEBUG */
1055
1056
1057/* YYINITDEPTH -- initial size of the parser's stacks. */
1058#ifndef YYINITDEPTH
1059# define YYINITDEPTH 200
1060#endif
1061
1062/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1063 if the built-in stack extension method is used).
1064
1065 Do not make this value too large; the results are undefined if
1066 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1067 evaluated with infinite-precision integer arithmetic. */
1068
1069#ifndef YYMAXDEPTH
1070# define YYMAXDEPTH 10000
1071#endif
1072
1073
1074
1075
1076
1077
1078/*-----------------------------------------------.
1079| Release the memory associated to this symbol. |
1080`-----------------------------------------------*/
1081
1082static void
1083yydestruct (const char *yymsg,
1084 yysymbol_kind_t yykind, YYSTYPE *yyvaluep, htmlscan_t *scanner)
1085{
1086 YY_USE (yyvaluep);
1087 YY_USE (scanner);
1088 if (!yymsg)
1089 yymsg = "Deleting";
1090 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1091
1093 YY_USE (yykind);
1095}
1096
1097
1098
1099
1100
1101
1102/*----------.
1103| yyparse. |
1104`----------*/
1105
1106int
1108{
1109/* Lookahead token kind. */
1110int yychar;
1111
1112
1113/* The semantic value of the lookahead symbol. */
1114/* Default value used for initialization, for pacifying older GCCs
1115 or non-GCC compilers. */
1116YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1117YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1118
1119 /* Number of syntax errors so far. */
1120 int yynerrs = 0;
1121
1122 yy_state_fast_t yystate = 0;
1123 /* Number of tokens to shift before error messages enabled. */
1124 int yyerrstatus = 0;
1125
1126 /* Refer to the stacks through separate pointers, to allow yyoverflow
1127 to reallocate them elsewhere. */
1128
1129 /* Their size. */
1130 YYPTRDIFF_T yystacksize = YYINITDEPTH;
1131
1132 /* The state stack: array, bottom, top. */
1133 yy_state_t yyssa[YYINITDEPTH];
1134 yy_state_t *yyss = yyssa;
1135 yy_state_t *yyssp = yyss;
1136
1137 /* The semantic value stack: array, bottom, top. */
1138 YYSTYPE yyvsa[YYINITDEPTH];
1139 YYSTYPE *yyvs = yyvsa;
1140 YYSTYPE *yyvsp = yyvs;
1141
1142 int yyn;
1143 /* The return value of yyparse. */
1144 int yyresult;
1145 /* Lookahead symbol kind. */
1147 /* The variables used to return semantic value and location from the
1148 action routines. */
1149 YYSTYPE yyval;
1150
1151
1152
1153#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1154
1155 /* The number of symbols on the RHS of the reduced rule.
1156 Keep to zero when no symbol should be popped. */
1157 int yylen = 0;
1158
1159 YYDPRINTF ((stderr, "Starting parse\n"));
1160
1161 yychar = HTMLEMPTY; /* Cause a token to be read. */
1162
1163 goto yysetstate;
1164
1165
1166/*------------------------------------------------------------.
1167| yynewstate -- push a new state, which is found in yystate. |
1168`------------------------------------------------------------*/
1169yynewstate:
1170 /* In all cases, when you get here, the value and location stacks
1171 have just been pushed. So pushing a state here evens the stacks. */
1172 yyssp++;
1173
1174
1175/*--------------------------------------------------------------------.
1176| yysetstate -- set current state (the top of the stack) to yystate. |
1177`--------------------------------------------------------------------*/
1178yysetstate:
1179 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1180 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1182 *yyssp = YY_CAST (yy_state_t, yystate);
1184 YY_STACK_PRINT (yyss, yyssp);
1185
1186 if (yyss + yystacksize - 1 <= yyssp)
1187#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1188 YYNOMEM;
1189#else
1190 {
1191 /* Get the current used size of the three stacks, in elements. */
1192 YYPTRDIFF_T yysize = yyssp - yyss + 1;
1193
1194# if defined yyoverflow
1195 {
1196 /* Give user a chance to reallocate the stack. Use copies of
1197 these so that the &'s don't force the real ones into
1198 memory. */
1199 yy_state_t *yyss1 = yyss;
1200 YYSTYPE *yyvs1 = yyvs;
1201
1202 /* Each stack pointer address is followed by the size of the
1203 data in use in that stack, in bytes. This used to be a
1204 conditional around just the two extra args, but that might
1205 be undefined if yyoverflow is a macro. */
1206 yyoverflow (YY_("memory exhausted"),
1207 &yyss1, yysize * YYSIZEOF (*yyssp),
1208 &yyvs1, yysize * YYSIZEOF (*yyvsp),
1209 &yystacksize);
1210 yyss = yyss1;
1211 yyvs = yyvs1;
1212 }
1213# else /* defined YYSTACK_RELOCATE */
1214 /* Extend the stack our own way. */
1215 if (YYMAXDEPTH <= yystacksize)
1216 YYNOMEM;
1217 yystacksize *= 2;
1218 if (YYMAXDEPTH < yystacksize)
1219 yystacksize = YYMAXDEPTH;
1220
1221 {
1222 yy_state_t *yyss1 = yyss;
1223 union yyalloc *yyptr =
1224 YY_CAST (union yyalloc *,
1225 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1226 if (! yyptr)
1227 YYNOMEM;
1228 YYSTACK_RELOCATE (yyss_alloc, yyss);
1229 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1230# undef YYSTACK_RELOCATE
1231 if (yyss1 != yyssa)
1232 YYSTACK_FREE (yyss1);
1233 }
1234# endif
1235
1236 yyssp = yyss + yysize - 1;
1237 yyvsp = yyvs + yysize - 1;
1238
1240 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1241 YY_CAST (long, yystacksize)));
1243
1244 if (yyss + yystacksize - 1 <= yyssp)
1245 YYABORT;
1246 }
1247#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1248
1249
1250 if (yystate == YYFINAL)
1251 YYACCEPT;
1252
1253 goto yybackup;
1254
1255
1256/*-----------.
1257| yybackup. |
1258`-----------*/
1259yybackup:
1260 /* Do appropriate processing given the current state. Read a
1261 lookahead token if we need one and don't already have one. */
1262
1263 /* First try to decide what to do without reference to lookahead token. */
1264 yyn = yypact[yystate];
1265 if (yypact_value_is_default (yyn))
1266 goto yydefault;
1267
1268 /* Not known => get a lookahead token if don't already have one. */
1269
1270 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1271 if (yychar == HTMLEMPTY)
1272 {
1273 YYDPRINTF ((stderr, "Reading a token\n"));
1274 yychar = yylex (&yylval, scanner);
1275 }
1276
1277 if (yychar <= HTMLEOF)
1278 {
1279 yychar = HTMLEOF;
1280 yytoken = YYSYMBOL_YYEOF;
1281 YYDPRINTF ((stderr, "Now at end of input.\n"));
1282 }
1283 else if (yychar == HTMLerror)
1284 {
1285 /* The scanner already issued an error message, process directly
1286 to error recovery. But do not keep the error token as
1287 lookahead, it is too special and may lead us to an endless
1288 loop in error recovery. */
1289 yychar = HTMLUNDEF;
1290 yytoken = YYSYMBOL_YYerror;
1291 goto yyerrlab1;
1292 }
1293 else
1294 {
1295 yytoken = YYTRANSLATE (yychar);
1296 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1297 }
1298
1299 /* If the proper action on seeing token YYTOKEN is to reduce or to
1300 detect an error, take that action. */
1301 yyn += yytoken;
1302 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1303 goto yydefault;
1304 yyn = yytable[yyn];
1305 if (yyn <= 0)
1306 {
1307 if (yytable_value_is_error (yyn))
1308 goto yyerrlab;
1309 yyn = -yyn;
1310 goto yyreduce;
1311 }
1312
1313 /* Count tokens shifted since error; after three, turn off error
1314 status. */
1315 if (yyerrstatus)
1316 yyerrstatus--;
1317
1318 /* Shift the lookahead token. */
1319 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1320 yystate = yyn;
1322 *++yyvsp = yylval;
1324
1325 /* Discard the shifted token. */
1326 yychar = HTMLEMPTY;
1327 goto yynewstate;
1328
1329
1330/*-----------------------------------------------------------.
1331| yydefault -- do the default action for the current state. |
1332`-----------------------------------------------------------*/
1333yydefault:
1334 yyn = yydefact[yystate];
1335 if (yyn == 0)
1336 goto yyerrlab;
1337 goto yyreduce;
1338
1339
1340/*-----------------------------.
1341| yyreduce -- do a reduction. |
1342`-----------------------------*/
1343yyreduce:
1344 /* yyn is the number of a rule to reduce with. */
1345 yylen = yyr2[yyn];
1346
1347 /* If YYLEN is nonzero, implement the default value of the action:
1348 '$$ = $1'.
1349
1350 Otherwise, the following line sets YYVAL to garbage.
1351 This behavior is undocumented and Bison
1352 users should not rely upon it. Assigning to YYVAL
1353 unconditionally makes the parser a bit smaller, and it avoids a
1354 GCC warning that YYVAL may be used uninitialized. */
1355 yyval = yyvsp[1-yylen];
1356
1357
1358 YY_REDUCE_PRINT (yyn);
1359 switch (yyn)
1360 {
1361 case 2: /* html: T_html fonttext T_end_html */
1362#line 206 "../../lib/common/htmlparse.y"
1363 { scanner->parser.lbl = mkLabel((yyvsp[-1].txt),HTML_TEXT); }
1364#line 1365 "htmlparse.c"
1365 break;
1366
1367 case 3: /* html: T_html fonttable T_end_html */
1368#line 207 "../../lib/common/htmlparse.y"
1369 { scanner->parser.lbl = mkLabel((yyvsp[-1].tbl),HTML_TBL); }
1370#line 1371 "htmlparse.c"
1371 break;
1372
1373 case 4: /* html: error */
1374#line 208 "../../lib/common/htmlparse.y"
1375 { cleanup(&scanner->parser); YYABORT; }
1376#line 1377 "htmlparse.c"
1377 break;
1378
1379 case 5: /* fonttext: text */
1380#line 211 "../../lib/common/htmlparse.y"
1381 { (yyval.txt) = mkText(&scanner->parser); }
1382#line 1383 "htmlparse.c"
1383 break;
1384
1385 case 8: /* textitem: string */
1386#line 218 "../../lib/common/htmlparse.y"
1387 { appendFItemList(&scanner->parser,scanner->parser.str);}
1388#line 1389 "htmlparse.c"
1389 break;
1390
1391 case 9: /* textitem: br */
1392#line 219 "../../lib/common/htmlparse.y"
1393 {appendFLineList(&scanner->parser,(yyvsp[0].i));}
1394#line 1395 "htmlparse.c"
1395 break;
1396
1397 case 18: /* font: T_font */
1398#line 230 "../../lib/common/htmlparse.y"
1399 { pushFont (&scanner->parser,(yyvsp[0].font)); }
1400#line 1401 "htmlparse.c"
1401 break;
1402
1403 case 19: /* n_font: T_end_font */
1404#line 233 "../../lib/common/htmlparse.y"
1405 { popFont (&scanner->parser); }
1406#line 1407 "htmlparse.c"
1407 break;
1408
1409 case 20: /* italic: T_italic */
1410#line 236 "../../lib/common/htmlparse.y"
1411 {pushFont(&scanner->parser,(yyvsp[0].font));}
1412#line 1413 "htmlparse.c"
1413 break;
1414
1415 case 21: /* n_italic: T_n_italic */
1416#line 239 "../../lib/common/htmlparse.y"
1417 {popFont(&scanner->parser);}
1418#line 1419 "htmlparse.c"
1419 break;
1420
1421 case 22: /* bold: T_bold */
1422#line 242 "../../lib/common/htmlparse.y"
1423 {pushFont(&scanner->parser,(yyvsp[0].font));}
1424#line 1425 "htmlparse.c"
1425 break;
1426
1427 case 23: /* n_bold: T_n_bold */
1428#line 245 "../../lib/common/htmlparse.y"
1429 {popFont(&scanner->parser);}
1430#line 1431 "htmlparse.c"
1431 break;
1432
1433 case 24: /* strike: T_s */
1434#line 248 "../../lib/common/htmlparse.y"
1435 {pushFont(&scanner->parser,(yyvsp[0].font));}
1436#line 1437 "htmlparse.c"
1437 break;
1438
1439 case 25: /* n_strike: T_n_s */
1440#line 251 "../../lib/common/htmlparse.y"
1441 {popFont(&scanner->parser);}
1442#line 1443 "htmlparse.c"
1443 break;
1444
1445 case 26: /* underline: T_underline */
1446#line 254 "../../lib/common/htmlparse.y"
1447 {pushFont(&scanner->parser,(yyvsp[0].font));}
1448#line 1449 "htmlparse.c"
1449 break;
1450
1451 case 27: /* n_underline: T_n_underline */
1452#line 257 "../../lib/common/htmlparse.y"
1453 {popFont(&scanner->parser);}
1454#line 1455 "htmlparse.c"
1455 break;
1456
1457 case 28: /* overline: T_overline */
1458#line 260 "../../lib/common/htmlparse.y"
1459 {pushFont(&scanner->parser,(yyvsp[0].font));}
1460#line 1461 "htmlparse.c"
1461 break;
1462
1463 case 29: /* n_overline: T_n_overline */
1464#line 263 "../../lib/common/htmlparse.y"
1465 {popFont(&scanner->parser);}
1466#line 1467 "htmlparse.c"
1467 break;
1468
1469 case 30: /* sup: T_sup */
1470#line 266 "../../lib/common/htmlparse.y"
1471 {pushFont(&scanner->parser,(yyvsp[0].font));}
1472#line 1473 "htmlparse.c"
1473 break;
1474
1475 case 31: /* n_sup: T_n_sup */
1476#line 269 "../../lib/common/htmlparse.y"
1477 {popFont(&scanner->parser);}
1478#line 1479 "htmlparse.c"
1479 break;
1480
1481 case 32: /* sub: T_sub */
1482#line 272 "../../lib/common/htmlparse.y"
1483 {pushFont(&scanner->parser,(yyvsp[0].font));}
1484#line 1485 "htmlparse.c"
1485 break;
1486
1487 case 33: /* n_sub: T_n_sub */
1488#line 275 "../../lib/common/htmlparse.y"
1489 {popFont(&scanner->parser);}
1490#line 1491 "htmlparse.c"
1491 break;
1492
1493 case 34: /* br: T_br T_end_br */
1494#line 278 "../../lib/common/htmlparse.y"
1495 { (yyval.i) = (yyvsp[-1].i); }
1496#line 1497 "htmlparse.c"
1497 break;
1498
1499 case 35: /* br: T_BR */
1500#line 279 "../../lib/common/htmlparse.y"
1501 { (yyval.i) = (yyvsp[0].i); }
1502#line 1503 "htmlparse.c"
1503 break;
1504
1505 case 38: /* @1: %empty */
1506#line 286 "../../lib/common/htmlparse.y"
1507 {
1508 if (nonSpace(agxbuse(scanner->parser.str))) {
1509 htmlerror (scanner,"Syntax error: non-space string used before <TABLE>");
1510 cleanup(&scanner->parser); YYABORT;
1511 }
1512 (yyvsp[0].tbl)->prev = scanner->parser.tblstack;
1513 (yyvsp[0].tbl)->rows = (rows_t){.dtor = free_ritem};
1514 scanner->parser.tblstack = (yyvsp[0].tbl);
1515 (yyvsp[0].tbl)->font = *LIST_BACK(&scanner->parser.fontstack);
1516 (yyval.tbl) = (yyvsp[0].tbl);
1517 }
1518#line 1519 "htmlparse.c"
1519 break;
1520
1521 case 39: /* table: opt_space T_table @1 rows T_end_table opt_space */
1522#line 297 "../../lib/common/htmlparse.y"
1523 {
1524 if (nonSpace(agxbuse(scanner->parser.str))) {
1525 htmlerror (scanner,"Syntax error: non-space string used after </TABLE>");
1526 cleanup(&scanner->parser); YYABORT;
1527 }
1528 (yyval.tbl) = scanner->parser.tblstack;
1529 scanner->parser.tblstack = scanner->parser.tblstack->prev;
1530 }
1531#line 1532 "htmlparse.c"
1532 break;
1533
1534 case 40: /* fonttable: table */
1535#line 307 "../../lib/common/htmlparse.y"
1536 { (yyval.tbl) = (yyvsp[0].tbl); }
1537#line 1538 "htmlparse.c"
1538 break;
1539
1540 case 41: /* fonttable: font table n_font */
1541#line 308 "../../lib/common/htmlparse.y"
1542 { (yyval.tbl)=(yyvsp[-1].tbl); }
1543#line 1544 "htmlparse.c"
1544 break;
1545
1546 case 42: /* fonttable: italic table n_italic */
1547#line 309 "../../lib/common/htmlparse.y"
1548 { (yyval.tbl)=(yyvsp[-1].tbl); }
1549#line 1550 "htmlparse.c"
1550 break;
1551
1552 case 43: /* fonttable: underline table n_underline */
1553#line 310 "../../lib/common/htmlparse.y"
1554 { (yyval.tbl)=(yyvsp[-1].tbl); }
1555#line 1556 "htmlparse.c"
1556 break;
1557
1558 case 44: /* fonttable: overline table n_overline */
1559#line 311 "../../lib/common/htmlparse.y"
1560 { (yyval.tbl)=(yyvsp[-1].tbl); }
1561#line 1562 "htmlparse.c"
1562 break;
1563
1564 case 45: /* fonttable: bold table n_bold */
1565#line 312 "../../lib/common/htmlparse.y"
1566 { (yyval.tbl)=(yyvsp[-1].tbl); }
1567#line 1568 "htmlparse.c"
1568 break;
1569
1570 case 48: /* rows: row */
1571#line 319 "../../lib/common/htmlparse.y"
1572 { (yyval.p) = (yyvsp[0].p); }
1573#line 1574 "htmlparse.c"
1574 break;
1575
1576 case 49: /* rows: rows row */
1577#line 320 "../../lib/common/htmlparse.y"
1578 { (yyval.p) = (yyvsp[0].p); }
1579#line 1580 "htmlparse.c"
1580 break;
1581
1582 case 50: /* rows: rows HR row */
1583#line 321 "../../lib/common/htmlparse.y"
1584 { (yyvsp[-2].p)->ruled = true; (yyval.p) = (yyvsp[0].p); }
1585#line 1586 "htmlparse.c"
1586 break;
1587
1588 case 51: /* $@2: %empty */
1589#line 324 "../../lib/common/htmlparse.y"
1590 { addRow (&scanner->parser); }
1591#line 1592 "htmlparse.c"
1592 break;
1593
1594 case 52: /* row: T_row $@2 cells T_end_row */
1595#line 324 "../../lib/common/htmlparse.y"
1596 { (yyval.p) = lastRow(&scanner->parser); }
1597#line 1598 "htmlparse.c"
1598 break;
1599
1600 case 53: /* cells: cell */
1601#line 327 "../../lib/common/htmlparse.y"
1602 { (yyval.cell) = (yyvsp[0].cell); }
1603#line 1604 "htmlparse.c"
1604 break;
1605
1606 case 54: /* cells: cells cell */
1607#line 328 "../../lib/common/htmlparse.y"
1608 { (yyval.cell) = (yyvsp[0].cell); }
1609#line 1610 "htmlparse.c"
1610 break;
1611
1612 case 55: /* cells: cells VR cell */
1613#line 329 "../../lib/common/htmlparse.y"
1614 { (yyvsp[-2].cell)->vruled = true; (yyval.cell) = (yyvsp[0].cell); }
1615#line 1616 "htmlparse.c"
1616 break;
1617
1618 case 56: /* $@3: %empty */
1619#line 332 "../../lib/common/htmlparse.y"
1620 { setCell(&scanner->parser,(yyvsp[-1].cell),(yyvsp[0].tbl),HTML_TBL); }
1621#line 1622 "htmlparse.c"
1622 break;
1623
1624 case 57: /* cell: T_cell fonttable $@3 T_end_cell */
1625#line 332 "../../lib/common/htmlparse.y"
1626 { (yyval.cell) = (yyvsp[-3].cell); }
1627#line 1628 "htmlparse.c"
1628 break;
1629
1630 case 58: /* $@4: %empty */
1631#line 333 "../../lib/common/htmlparse.y"
1632 { setCell(&scanner->parser,(yyvsp[-1].cell),(yyvsp[0].txt),HTML_TEXT); }
1633#line 1634 "htmlparse.c"
1634 break;
1635
1636 case 59: /* cell: T_cell fonttext $@4 T_end_cell */
1637#line 333 "../../lib/common/htmlparse.y"
1638 { (yyval.cell) = (yyvsp[-3].cell); }
1639#line 1640 "htmlparse.c"
1640 break;
1641
1642 case 60: /* $@5: %empty */
1643#line 334 "../../lib/common/htmlparse.y"
1644 { setCell(&scanner->parser,(yyvsp[-1].cell),(yyvsp[0].img),HTML_IMAGE); }
1645#line 1646 "htmlparse.c"
1646 break;
1647
1648 case 61: /* cell: T_cell image $@5 T_end_cell */
1649#line 334 "../../lib/common/htmlparse.y"
1650 { (yyval.cell) = (yyvsp[-3].cell); }
1651#line 1652 "htmlparse.c"
1652 break;
1653
1654 case 62: /* $@6: %empty */
1655#line 335 "../../lib/common/htmlparse.y"
1656 { setCell(&scanner->parser,(yyvsp[0].cell),mkText(&scanner->parser),HTML_TEXT); }
1657#line 1658 "htmlparse.c"
1658 break;
1659
1660 case 63: /* cell: T_cell $@6 T_end_cell */
1661#line 335 "../../lib/common/htmlparse.y"
1662 { (yyval.cell) = (yyvsp[-2].cell); }
1663#line 1664 "htmlparse.c"
1664 break;
1665
1666 case 64: /* $@7: %empty */
1667#line 338 "../../lib/common/htmlparse.y"
1668 {
1669 if (nonSpace(agxbuse(scanner->parser.str))) {
1670 htmlerror(scanner, "Syntax error: non-space string used before <IMG>");
1671 }
1672 }
1673#line 1674 "htmlparse.c"
1674 break;
1675
1676 case 65: /* image: opt_space $@7 T_img T_end_img opt_space */
1677#line 342 "../../lib/common/htmlparse.y"
1678 {
1679 if (nonSpace(agxbuse(scanner->parser.str))) {
1680 htmlerror(scanner, "Syntax error: non-space string used after <IMG>");
1681 }
1682 (yyval.img) = (yyvsp[-2].img);
1683}
1684#line 1685 "htmlparse.c"
1685 break;
1686
1687 case 66: /* $@8: %empty */
1688#line 347 "../../lib/common/htmlparse.y"
1689 {
1690 if (nonSpace(agxbuse(scanner->parser.str))) {
1691 htmlerror(scanner, "Syntax error: non-space string used before <IMG>");
1692 }
1693 }
1694#line 1695 "htmlparse.c"
1695 break;
1696
1697 case 67: /* image: opt_space $@8 T_IMG opt_space */
1698#line 351 "../../lib/common/htmlparse.y"
1699 {
1700 if (nonSpace(agxbuse(scanner->parser.str))) {
1701 htmlerror(scanner, "Syntax error: non-space string used after <IMG>");
1702 }
1703 (yyval.img) = (yyvsp[-1].img);
1704}
1705#line 1706 "htmlparse.c"
1706 break;
1707
1708
1709#line 1710 "htmlparse.c"
1710
1711 default: break;
1712 }
1713 /* User semantic actions sometimes alter yychar, and that requires
1714 that yytoken be updated with the new translation. We take the
1715 approach of translating immediately before every use of yytoken.
1716 One alternative is translating here after every semantic action,
1717 but that translation would be missed if the semantic action invokes
1718 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1719 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1720 incorrect destructor might then be invoked immediately. In the
1721 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1722 to an incorrect destructor call or verbose syntax error message
1723 before the lookahead is translated. */
1724 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1725
1726 YYPOPSTACK (yylen);
1727 yylen = 0;
1728
1729 *++yyvsp = yyval;
1730
1731 /* Now 'shift' the result of the reduction. Determine what state
1732 that goes to, based on the state we popped back to and the rule
1733 number reduced by. */
1734 {
1735 const int yylhs = yyr1[yyn] - YYNTOKENS;
1736 const int yyi = yypgoto[yylhs] + *yyssp;
1737 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1738 ? yytable[yyi]
1739 : yydefgoto[yylhs]);
1740 }
1741
1742 goto yynewstate;
1743
1744
1745/*--------------------------------------.
1746| yyerrlab -- here on detecting error. |
1747`--------------------------------------*/
1748yyerrlab:
1749 /* Make sure we have latest lookahead translation. See comments at
1750 user semantic actions for why this is necessary. */
1752 /* If not already recovering from an error, report this error. */
1753 if (!yyerrstatus)
1754 {
1755 ++yynerrs;
1756 yyerror (scanner, YY_("syntax error"));
1757 }
1758
1759 if (yyerrstatus == 3)
1760 {
1761 /* If just tried and failed to reuse lookahead token after an
1762 error, discard it. */
1763
1764 if (yychar <= HTMLEOF)
1765 {
1766 /* Return failure if at end of input. */
1767 if (yychar == HTMLEOF)
1768 YYABORT;
1769 }
1770 else
1771 {
1772 yydestruct ("Error: discarding",
1773 yytoken, &yylval, scanner);
1774 yychar = HTMLEMPTY;
1775 }
1776 }
1777
1778 /* Else will try to reuse lookahead token after shifting the error
1779 token. */
1780 goto yyerrlab1;
1781
1782
1783/*---------------------------------------------------.
1784| yyerrorlab -- error raised explicitly by YYERROR. |
1785`---------------------------------------------------*/
1786yyerrorlab:
1787 /* Pacify compilers when the user code never invokes YYERROR and the
1788 label yyerrorlab therefore never appears in user code. */
1789 if (0)
1790 YYERROR;
1791 ++yynerrs;
1792
1793 /* Do not reclaim the symbols of the rule whose action triggered
1794 this YYERROR. */
1795 YYPOPSTACK (yylen);
1796 yylen = 0;
1797 YY_STACK_PRINT (yyss, yyssp);
1798 yystate = *yyssp;
1799 goto yyerrlab1;
1800
1801
1802/*-------------------------------------------------------------.
1803| yyerrlab1 -- common code for both syntax error and YYERROR. |
1804`-------------------------------------------------------------*/
1805yyerrlab1:
1806 yyerrstatus = 3; /* Each real token shifted decrements this. */
1807
1808 /* Pop stack until we find a state that shifts the error token. */
1809 for (;;)
1810 {
1811 yyn = yypact[yystate];
1812 if (!yypact_value_is_default (yyn))
1813 {
1814 yyn += YYSYMBOL_YYerror;
1815 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
1816 {
1817 yyn = yytable[yyn];
1818 if (0 < yyn)
1819 break;
1820 }
1821 }
1822
1823 /* Pop the current state because it cannot handle the error token. */
1824 if (yyssp == yyss)
1825 YYABORT;
1826
1827
1828 yydestruct ("Error: popping",
1829 YY_ACCESSING_SYMBOL (yystate), yyvsp, scanner);
1830 YYPOPSTACK (1);
1831 yystate = *yyssp;
1832 YY_STACK_PRINT (yyss, yyssp);
1833 }
1834
1836 *++yyvsp = yylval;
1838
1839
1840 /* Shift the error token. */
1841 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
1842
1843 yystate = yyn;
1844 goto yynewstate;
1845
1846
1847/*-------------------------------------.
1848| yyacceptlab -- YYACCEPT comes here. |
1849`-------------------------------------*/
1850yyacceptlab:
1851 yyresult = 0;
1852 goto yyreturnlab;
1853
1854
1855/*-----------------------------------.
1856| yyabortlab -- YYABORT comes here. |
1857`-----------------------------------*/
1858yyabortlab:
1859 yyresult = 1;
1860 goto yyreturnlab;
1861
1862
1863/*-----------------------------------------------------------.
1864| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
1865`-----------------------------------------------------------*/
1866yyexhaustedlab:
1867 yyerror (scanner, YY_("memory exhausted"));
1868 yyresult = 2;
1869 goto yyreturnlab;
1870
1871
1872/*----------------------------------------------------------.
1873| yyreturnlab -- parsing is finished, clean up and return. |
1874`----------------------------------------------------------*/
1875yyreturnlab:
1876 if (yychar != HTMLEMPTY)
1877 {
1878 /* Make sure we have latest lookahead translation. See comments at
1879 user semantic actions for why this is necessary. */
1880 yytoken = YYTRANSLATE (yychar);
1881 yydestruct ("Cleanup: discarding lookahead",
1882 yytoken, &yylval, scanner);
1883 }
1884 /* Do not reclaim the symbols of the rule whose action triggered
1885 this YYABORT or YYACCEPT. */
1886 YYPOPSTACK (yylen);
1887 YY_STACK_PRINT (yyss, yyssp);
1888 while (yyssp != yyss)
1889 {
1890 yydestruct ("Cleanup: popping",
1891 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, scanner);
1892 YYPOPSTACK (1);
1893 }
1894#ifndef yyoverflow
1895 if (yyss != yyssa)
1896 YYSTACK_FREE (yyss);
1897#endif
1898
1899 return yyresult;
1900}
1901
1902#line 367 "../../lib/common/htmlparse.y"
1903
1904
1905static void
1907{
1908 const textspan_t ti = {.str = agxbdisown(ag),
1909 .font = *LIST_BACK(&html_state->fontstack)};
1910 LIST_APPEND(&html_state->fitemList, ti);
1911}
1912
1913static void
1915{
1916 htextspan_t lp = {0};
1917
1918 size_t cnt = LIST_SIZE(&html_state->fitemList);
1919 lp.just = v;
1920 if (cnt) {
1921 lp.nitems = cnt;
1922 lp.items = gv_calloc(cnt, sizeof(textspan_t));
1923
1924 for (size_t i = 0; i < LIST_SIZE(&html_state->fitemList); ++i) {
1925 // move this text span into the new list
1926 textspan_t *ti = LIST_AT(&html_state->fitemList, i);
1927 lp.items[i] = *ti;
1928 *ti = (textspan_t){0};
1929 }
1930 }
1931 else {
1932 lp.items = gv_alloc(sizeof(textspan_t));
1933 lp.nitems = 1;
1934 lp.items[0].str = gv_strdup("");
1935 lp.items[0].font = *LIST_BACK(&html_state->fontstack);
1936 }
1937
1938 LIST_CLEAR(&html_state->fitemList);
1939
1940 LIST_APPEND(&html_state->fspanList, lp);
1941}
1942
1943static htmltxt_t*
1945{
1946 htmltxt_t *hft = gv_alloc(sizeof(htmltxt_t));
1947
1948 if (!LIST_IS_EMPTY(&html_state->fitemList))
1949 appendFLineList (html_state, UNSET_ALIGN);
1950
1951 size_t cnt = LIST_SIZE(&html_state->fspanList);
1952 hft->nspans = cnt;
1953
1954 hft->spans = gv_calloc(cnt, sizeof(htextspan_t));
1955 for (size_t i = 0; i < LIST_SIZE(&html_state->fspanList); ++i) {
1956 // move this HTML text span into the new list
1957 htextspan_t *hi = LIST_AT(&html_state->fspanList, i);
1958 hft->spans[i] = *hi;
1959 *hi = (htextspan_t){0};
1960 }
1961
1962 LIST_CLEAR(&html_state->fspanList);
1963
1964 return hft;
1965}
1966
1967static row_t *lastRow(htmlparserstate_t *html_state) {
1968 htmltbl_t* tbl = html_state->tblstack;
1969 row_t *sp = *LIST_BACK(&tbl->rows);
1970 return sp;
1971}
1972
1973static void addRow(htmlparserstate_t *html_state) {
1974 htmltbl_t* tbl = html_state->tblstack;
1975 row_t *sp = gv_alloc(sizeof(row_t));
1976 if (tbl->hrule)
1977 sp->ruled = true;
1978 LIST_APPEND(&tbl->rows, sp);
1979}
1980
1981static void setCell(htmlparserstate_t *html_state, htmlcell_t *cp, void *obj, label_type_t kind) {
1982 htmltbl_t* tbl = html_state->tblstack;
1983 row_t *rp = *LIST_BACK(&tbl->rows);
1984 LIST_APPEND(&rp->rp, cp);
1985 cp->child.kind = kind;
1986 if (tbl->vrule) {
1987 cp->vruled = true;
1988 cp->hruled = false;
1989 }
1990
1991 if(kind == HTML_TEXT)
1992 cp->child.u.txt = obj;
1993 else if (kind == HTML_IMAGE)
1994 cp->child.u.img = obj;
1995 else
1996 cp->child.u.tbl = obj;
1997}
1998
1999static void cleanup (htmlparserstate_t *html_state)
2000{
2001 htmltbl_t* tp = html_state->tblstack;
2002 htmltbl_t* next;
2003
2004 if (html_state->lbl) {
2005 free_html_label (html_state->lbl,1);
2006 html_state->lbl = NULL;
2007 }
2008 while (tp) {
2009 next = tp->prev;
2010 cleanTbl (tp);
2011 tp = next;
2012 }
2013
2014 LIST_CLEAR(&html_state->fitemList);
2015 LIST_CLEAR(&html_state->fspanList);
2016
2017 LIST_FREE(&html_state->fontstack);
2018}
2019
2020static void
2022{
2023 textfont_t* curfont = *LIST_BACK(&html_state->fontstack);
2024 textfont_t f = *fp;
2025
2026 if (curfont) {
2027 if (!f.color && curfont->color)
2028 f.color = curfont->color;
2029 if ((f.size < 0.0) && (curfont->size >= 0.0))
2030 f.size = curfont->size;
2031 if (!f.name && curfont->name)
2032 f.name = curfont->name;
2033 if (curfont->flags)
2034 f.flags |= curfont->flags;
2035 }
2036
2037 textfont_t *const ft = dtinsert(html_state->gvc->textfont_dt, &f);
2038 LIST_PUSH_BACK(&html_state->fontstack, ft);
2039}
2040
2041static void
2043{
2044 LIST_DROP_BACK(&html_state->fontstack);
2045}
2046
2047/* Return parsed label or NULL if failure.
2048 * Set warn to 0 on success; 1 for warning message; 2 if no expat; 3 for error
2049 * message.
2050 */
2052parseHTML (char* txt, int* warn, htmlenv_t *env)
2053{
2054 agxbuf str = {0};
2055 htmllabel_t* l = NULL;
2056 htmlscan_t scanner = {0};
2057
2058 LIST_PUSH_BACK(&scanner.parser.fontstack, NULL);
2059 scanner.parser.fitemList.dtor = free_ti;
2060 scanner.parser.fspanList.dtor = free_hi;
2061 scanner.parser.gvc = GD_gvc(env->g);
2062 scanner.parser.str = &str;
2063
2064 if (initHTMLlexer (&scanner, txt, &str, env)) {/* failed: no libexpat - give up */
2065 *warn = 2;
2066 }
2067 else {
2069 *warn = clearHTMLlexer (&scanner);
2070 l = scanner.parser.lbl;
2071 }
2072
2073 LIST_FREE(&scanner.parser.fitemList);
2074 LIST_FREE(&scanner.parser.fspanList);
2075
2076 LIST_FREE(&scanner.parser.fontstack);
2077
2078 agxbfree (&str);
2079
2080 return l;
2081}
static void agxbfree(agxbuf *xb)
free any malloced resources
Definition agxbuf.h:97
static WUR char * agxbuse(agxbuf *xb)
Definition agxbuf.h:325
static char * agxbdisown(agxbuf *xb)
Definition agxbuf.h:345
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:186
static const char * yysymbol_name(yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED
Definition exparse.c:733
static const char *const yytname[]
Definition exparse.c:708
yysymbol_kind_t
Definition gmlparse.c:289
#define YYSTYPE
Definition gmlparse.c:67
short yytype_int16
Definition gmlparse.c:388
#define yychar
Definition gmlparse.c:75
static void cleanup(void)
Definition gmlparse.c:130
#define yylval
Definition gmlparse.c:74
int yy_state_fast_t
Definition gmlparse.c:467
signed char yytype_int8
Definition gmlparse.c:380
yytype_int8 yy_state_t
Definition gmlparse.c:464
node NULL
Definition grammar.y:181
static int cnt(Dict_t *d, Dtlink_t **set)
Definition graph.c:204
#define GD_gvc(g)
Definition types.h:355
int clearHTMLlexer(htmlscan_t *scanner)
Definition htmllex.c:774
int initHTMLlexer(htmlscan_t *scanner, char *src, agxbuf *xb, htmlenv_t *env)
Definition htmllex.c:741
void htmlerror(htmlscan_t *scanner, const char *msg)
Definition htmllex.c:52
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition htmlparse.c:451
#define YYMAXDEPTH
Definition htmlparse.c:1070
static void appendFItemList(htmlparserstate_t *html_state, agxbuf *ag)
Append a new text span to the list.
Definition htmlparse.c:1906
#define YYSTACK_FREE
Definition htmlparse.c:513
static const yytype_int8 yytranslate[]
Definition htmlparse.c:627
yysymbol_kind_t
Definition htmlparse.c:192
@ YYSYMBOL_overline
Definition htmlparse.c:250
@ YYSYMBOL_T_BR
Definition htmlparse.c:221
@ YYSYMBOL_T_end_vr
Definition htmlparse.c:220
@ YYSYMBOL_sup
Definition htmlparse.c:252
@ YYSYMBOL_T_underline
Definition htmlparse.c:230
@ YYSYMBOL_table
Definition htmlparse.c:258
@ YYSYMBOL_T_n_s
Definition htmlparse.c:214
@ YYSYMBOL_YYUNDEF
Definition htmlparse.c:196
@ YYSYMBOL_T_end_font
Definition htmlparse.c:205
@ YYSYMBOL_image
Definition htmlparse.c:271
@ YYSYMBOL_74_4
Definition htmlparse.c:268
@ YYSYMBOL_n_bold
Definition htmlparse.c:245
@ YYSYMBOL_n_underline
Definition htmlparse.c:249
@ YYSYMBOL_T_sub
Definition htmlparse.c:233
@ YYSYMBOL_T_n_underline
Definition htmlparse.c:210
@ YYSYMBOL_T_n_italic
Definition htmlparse.c:208
@ YYSYMBOL_br
Definition htmlparse.c:256
@ YYSYMBOL_n_font
Definition htmlparse.c:241
@ YYSYMBOL_70_2
Definition htmlparse.c:264
@ YYSYMBOL_n_overline
Definition htmlparse.c:251
@ YYSYMBOL_T_end_row
Definition htmlparse.c:200
@ YYSYMBOL_73_3
Definition htmlparse.c:267
@ YYSYMBOL_YYerror
Definition htmlparse.c:195
@ YYSYMBOL_T_end_table
Definition htmlparse.c:203
@ YYSYMBOL_T_table
Definition htmlparse.c:225
@ YYSYMBOL_strike
Definition htmlparse.c:246
@ YYSYMBOL_75_5
Definition htmlparse.c:269
@ YYSYMBOL_n_sup
Definition htmlparse.c:253
@ YYSYMBOL_T_VR
Definition htmlparse.c:218
@ YYSYMBOL_T_HR
Definition htmlparse.c:215
@ YYSYMBOL_html
Definition htmlparse.c:236
@ YYSYMBOL_79_8
Definition htmlparse.c:273
@ YYSYMBOL_T_br
Definition htmlparse.c:222
@ YYSYMBOL_78_7
Definition htmlparse.c:272
@ YYSYMBOL_T_end_br
Definition htmlparse.c:197
@ YYSYMBOL_T_n_sup
Definition htmlparse.c:212
@ YYSYMBOL_string
Definition htmlparse.c:257
@ YYSYMBOL_T_end_img
Definition htmlparse.c:198
@ YYSYMBOL_text
Definition htmlparse.c:238
@ YYSYMBOL_underline
Definition htmlparse.c:248
@ YYSYMBOL_n_sub
Definition htmlparse.c:255
@ YYSYMBOL_T_end_cell
Definition htmlparse.c:204
@ YYSYMBOL_VR
Definition htmlparse.c:275
@ YYSYMBOL_T_overline
Definition htmlparse.c:231
@ YYSYMBOL_T_end_html
Definition htmlparse.c:202
@ YYSYMBOL_T_italic
Definition htmlparse.c:228
@ YYSYMBOL_T_html
Definition htmlparse.c:201
@ YYSYMBOL_bold
Definition htmlparse.c:244
@ YYSYMBOL_sub
Definition htmlparse.c:254
@ YYSYMBOL_T_row
Definition htmlparse.c:199
@ YYSYMBOL_T_img
Definition htmlparse.c:224
@ YYSYMBOL_T_n_overline
Definition htmlparse.c:211
@ YYSYMBOL_YYACCEPT
Definition htmlparse.c:235
@ YYSYMBOL_n_italic
Definition htmlparse.c:243
@ YYSYMBOL_rows
Definition htmlparse.c:262
@ YYSYMBOL_T_hr
Definition htmlparse.c:216
@ YYSYMBOL_n_strike
Definition htmlparse.c:247
@ YYSYMBOL_YYEOF
Definition htmlparse.c:194
@ YYSYMBOL_T_s
Definition htmlparse.c:234
@ YYSYMBOL_T_bold
Definition htmlparse.c:229
@ YYSYMBOL_T_string
Definition htmlparse.c:206
@ YYSYMBOL_65_1
Definition htmlparse.c:259
@ YYSYMBOL_T_sup
Definition htmlparse.c:232
@ YYSYMBOL_cell
Definition htmlparse.c:266
@ YYSYMBOL_T_end_hr
Definition htmlparse.c:217
@ YYSYMBOL_cells
Definition htmlparse.c:265
@ YYSYMBOL_T_n_bold
Definition htmlparse.c:209
@ YYSYMBOL_T_font
Definition htmlparse.c:227
@ YYSYMBOL_fonttable
Definition htmlparse.c:260
@ YYSYMBOL_row
Definition htmlparse.c:263
@ YYSYMBOL_YYEMPTY
Definition htmlparse.c:193
@ YYSYMBOL_T_error
Definition htmlparse.c:207
@ YYSYMBOL_font
Definition htmlparse.c:240
@ YYSYMBOL_T_n_sub
Definition htmlparse.c:213
@ YYSYMBOL_T_IMG
Definition htmlparse.c:223
@ YYSYMBOL_italic
Definition htmlparse.c:242
@ YYSYMBOL_opt_space
Definition htmlparse.c:261
@ YYSYMBOL_fonttext
Definition htmlparse.c:237
@ YYSYMBOL_T_cell
Definition htmlparse.c:226
@ YYSYMBOL_textitem
Definition htmlparse.c:239
@ YYSYMBOL_76_6
Definition htmlparse.c:270
@ YYSYMBOL_HR
Definition htmlparse.c:274
@ YYSYMBOL_T_vr
Definition htmlparse.c:219
#define YY_ASSERT(E)
Definition htmlparse.c:471
#define YY_(Msgid)
Definition htmlparse.c:405
#define YYNOMEM
Definition htmlparse.c:902
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition htmlparse.c:452
static const yytype_int8 yydefact[]
Definition htmlparse.c:742
#define YYNSTATES
Definition htmlparse.c:612
#define YYSTYPE
Definition htmlparse.c:67
static void popFont(htmlparserstate_t *html_state)
Definition htmlparse.c:2042
#define YY_IGNORE_USELESS_CAST_END
Definition htmlparse.c:467
short yytype_int16
Definition htmlparse.c:316
static void addRow(htmlparserstate_t *html_state)
Add new cell row to current table.
Definition htmlparse.c:1973
#define YYABORT
Definition htmlparse.c:900
#define YYSTACK_BYTES(N)
Definition htmlparse.c:556
static const yytype_int8 yycheck[]
Definition htmlparse.c:815
static void cleanTbl(htmltbl_t *tp)
Clean up table if error in parsing.
Definition htmlparse.c:89
static void appendFLineList(htmlparserstate_t *html_state, int v)
Definition htmlparse.c:1914
htmllabel_t * parseHTML(char *txt, int *warn, htmlenv_t *env)
Definition htmlparse.c:2052
#define YY_REDUCE_PRINT(Rule)
Definition htmlparse.c:1053
#define YY_CAST(Type, Val)
Definition htmlparse.c:173
static const yytype_int16 yypact[]
Definition htmlparse.c:722
#define yylex
Definition htmlparse.c:70
#define YY_NULLPTR
Definition htmlparse.c:185
static row_t * lastRow(htmlparserstate_t *html_state)
Definition htmlparse.c:1967
#define YYFINAL
Definition htmlparse.c:601
#define YY_ACCESSING_SYMBOL(State)
Definition htmlparse.c:677
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
Definition htmlparse.c:1051
static const yytype_int16 yypgoto[]
Definition htmlparse.c:760
#define YY_INITIAL_VALUE(Value)
Definition htmlparse.c:448
static void yydestruct(const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep, htmlscan_t *scanner)
Definition htmlparse.c:1083
#define yyparse
Definition htmlparse.c:69
static void cleanCell(htmlcell_t *cp)
Clean up cell if error in parsing.
Definition htmlparse.c:104
#define YYNTOKENS
Definition htmlparse.c:606
unsigned char yytype_uint8
Definition htmlparse.c:337
#define YY_STACK_PRINT(Bottom, Top)
Definition htmlparse.c:1052
#define YYSIZE_T
Definition htmlparse.c:378
#define yydebug
Definition htmlparse.c:72
#define YY_IGNORE_USELESS_CAST_BEGIN
Definition htmlparse.c:466
static const yytype_int8 yyr2[]
Definition htmlparse.c:881
void * malloc(YYSIZE_T)
static const yytype_int8 yytable[]
Definition htmlparse.c:782
#define YYPTRDIFF_T
Definition htmlparse.c:364
static htmltxt_t * mkText(htmlparserstate_t *html_state)
Definition htmlparse.c:1944
#define yynerrs
Definition htmlparse.c:73
#define YYACCEPT
Definition htmlparse.c:899
#define yytable_value_is_error(Yyn)
Definition htmlparse.c:717
#define YYTRANSLATE(YYX)
Definition htmlparse.c:620
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:1981
static const yytype_int8 yystos[]
Definition htmlparse.c:850
#define YY_ATTRIBUTE_UNUSED
Definition htmlparse.c:422
@ YYENOMEM
Definition htmlparse.c:894
static const yytype_int8 yyr1[]
Definition htmlparse.c:868
static htmllabel_t * mkLabel(void *obj, label_type_t kind)
Create label, given body and type.
Definition htmlparse.c:131
#define YYPOPSTACK(N)
int yy_state_fast_t
Definition htmlparse.c:395
unsigned short yytype_uint16
Definition htmlparse.c:348
static const yytype_int8 yydefgoto[]
Definition htmlparse.c:770
static bool nonSpace(const char *s)
Return true if s contains a non-space character.
Definition htmlparse.c:149
#define YYLAST
Definition htmlparse.c:603
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition htmlparse.c:567
#define yypact_value_is_default(Yyn)
Definition htmlparse.c:712
#define YYINITDEPTH
Definition htmlparse.c:1059
signed char yytype_int8
Definition htmlparse.c:308
static void pushFont(htmlparserstate_t *html_state, textfont_t *fp)
Fonts are allocated in the lexer.
Definition htmlparse.c:2021
void free(void *)
#define YYERROR
Definition htmlparse.c:901
#define YYSIZEOF(X)
Definition htmlparse.c:388
#define YYSTACK_ALLOC
Definition htmlparse.c:512
yytype_int8 yy_state_t
Definition htmlparse.c:392
#define YYDPRINTF(Args)
Definition htmlparse.c:1050
#define YY_USE(E)
Definition htmlparse.c:428
#define yyerror
Definition htmlparse.c:71
int htmlparse(htmlscan_t *scanner)
#define HTMLerror
Definition htmlparse.h:121
static void free_ti(textspan_t item)
Definition htmlparse.h:193
#define HTMLEMPTY
Definition htmlparse.h:119
static void free_hi(htextspan_t item)
Definition htmlparse.h:197
#define HTMLUNDEF
Definition htmlparse.h:122
#define HTMLEOF
Definition htmlparse.h:120
$2 prev
Definition htmlparse.y:291
textitem scanner parser str
Definition htmlparse.y:218
$2 font
Definition htmlparse.y:294
cell HTML_TBL
Definition htmlparse.y:332
cleanup & scanner
Definition htmlparse.y:289
$2 rows
Definition htmlparse.y:292
void free_html_text(htmltxt_t *t)
Definition htmltable.c:780
void free_html_label(htmllabel_t *lp, int root)
Definition htmltable.c:834
void free_html_data(htmldata_t *dp)
Definition htmltable.c:770
#define UNSET_ALIGN
Definition htmltable.h:46
static void free_ritem(row_t *p)
Free row. This closes and frees row’s list, then the item itself is freed.
Definition htmltable.h:119
label_type_t
Definition htmltable.h:103
@ HTML_TEXT
Definition htmltable.h:103
@ HTML_IMAGE
Definition htmltable.h:103
#define LIST_PUSH_BACK(list,...)
Definition list.h:431
#define LIST_AT(list, index)
Definition list.h:210
#define LIST_APPEND(list,...)
Definition list.h:151
#define LIST_BACK(list)
Definition list.h:233
#define LIST_SIZE(list)
Definition list.h:92
#define LIST_CLEAR(list)
Definition list.h:307
#define LIST_DROP_BACK(list)
Definition list.h:483
#define LIST_FREE(list)
Definition list.h:413
#define LIST_IS_EMPTY(list)
Definition list.h:102
#define LIST_GET(list, index)
Definition list.h:197
Dt_t * textfont_dt
Definition gvcint.h:108
result of partitioning available space, part of maze
Definition grid.h:33
size_t nitems
Definition htmltable.h:56
textspan_t * items
Definition htmltable.h:55
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
htmltbl_t * tbl
Definition htmltable.h:150
htmlimg_t * img
Definition htmltable.h:152
label_type_t kind
Definition htmltable.h:154
union htmllabel_t::@50 u
htmllabel_t * lbl
Definition htmlparse.h:205
htmltbl_t * tblstack
Definition htmlparse.h:206
bool vrule
vertical rule
Definition htmltable.h:145
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:64
htextspan_t * spans
Definition htmltable.h:63
bool ruled
Definition htmltable.h:115
char * color
Definition textspan.h:57
char * name
Definition textspan.h:56
unsigned int flags
Definition textspan.h:61
double size
Definition textspan.h:59
char * str
Definition textspan.h:68
textfont_t * font
Definition textspan.h:69
Definition grammar.c:90