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