/misc/src/release/graphviz-2.18-1/src/graphviz-2.18/lib/common/y.tab.c

Go to the documentation of this file.
00001 /* A Bison parser, made by GNU Bison 2.3.  */
00002 
00003 /* Skeleton implementation for Bison's Yacc-like parsers in C
00004 
00005    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
00006    Free Software Foundation, Inc.
00007 
00008    This program is free software; you can redistribute it and/or modify
00009    it under the terms of the GNU General Public License as published by
00010    the Free Software Foundation; either version 2, or (at your option)
00011    any later version.
00012 
00013    This program is distributed in the hope that it will be useful,
00014    but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016    GNU General Public License for more details.
00017 
00018    You should have received a copy of the GNU General Public License
00019    along with this program; if not, write to the Free Software
00020    Foundation, Inc., 51 Franklin Street, Fifth Floor,
00021    Boston, MA 02110-1301, USA.  */
00022 
00023 /* As a special exception, you may create a larger work that contains
00024    part or all of the Bison parser skeleton and distribute that work
00025    under terms of your choice, so long as that work isn't itself a
00026    parser generator using the skeleton or a modified version thereof
00027    as a parser skeleton.  Alternatively, if you modify or redistribute
00028    the parser skeleton itself, you may (at your option) remove this
00029    special exception, which will cause the skeleton and the resulting
00030    Bison output files to be licensed under the GNU General Public
00031    License without this special exception.
00032 
00033    This special exception was added by the Free Software Foundation in
00034    version 2.2 of Bison.  */
00035 
00036 /* C LALR(1) parser skeleton written by Richard Stallman, by
00037    simplifying the original so-called "semantic" parser.  */
00038 
00039 /* All symbols defined below should begin with yy or YY, to avoid
00040    infringing on user name space.  This should be done even for local
00041    variables, as they might otherwise be expanded by user macros.
00042    There are some unavoidable exceptions within include files to
00043    define necessary library symbols; they are noted "INFRINGES ON
00044    USER NAME SPACE" below.  */
00045 
00046 /* Identify Bison output.  */
00047 #define YYBISON 1
00048 
00049 /* Bison version.  */
00050 #define YYBISON_VERSION "2.3"
00051 
00052 /* Skeleton name.  */
00053 #define YYSKELETON_NAME "yacc.c"
00054 
00055 /* Pure parsers.  */
00056 #define YYPURE 0
00057 
00058 /* Using locations.  */
00059 #define YYLSP_NEEDED 0
00060 
00061 
00062 
00063 /* Tokens.  */
00064 #ifndef YYTOKENTYPE
00065 # define YYTOKENTYPE
00066    /* Put the tokens into the symbol table, so that GDB and other debuggers
00067       know about them.  */
00068    enum yytokentype {
00069      T_end_br = 258,
00070      T_end_img = 259,
00071      T_row = 260,
00072      T_end_row = 261,
00073      T_html = 262,
00074      T_end_html = 263,
00075      T_end_table = 264,
00076      T_end_cell = 265,
00077      T_end_font = 266,
00078      T_string = 267,
00079      T_error = 268,
00080      T_BR = 269,
00081      T_br = 270,
00082      T_IMG = 271,
00083      T_img = 272,
00084      T_table = 273,
00085      T_cell = 274,
00086      T_font = 275
00087    };
00088 #endif
00089 /* Tokens.  */
00090 #define T_end_br 258
00091 #define T_end_img 259
00092 #define T_row 260
00093 #define T_end_row 261
00094 #define T_html 262
00095 #define T_end_html 263
00096 #define T_end_table 264
00097 #define T_end_cell 265
00098 #define T_end_font 266
00099 #define T_string 267
00100 #define T_error 268
00101 #define T_BR 269
00102 #define T_br 270
00103 #define T_IMG 271
00104 #define T_img 272
00105 #define T_table 273
00106 #define T_cell 274
00107 #define T_font 275
00108 
00109 
00110 
00111 
00112 /* Copy the first part of user declarations.  */
00113 #line 17 "../../lib/common/htmlparse.y"
00114 
00115 
00116 #include "render.h"
00117 #include "htmltable.h"
00118 #include "htmllex.h"
00119 
00120 extern int yyparse(void);
00121 
00122 typedef struct sfont_t {
00123     htmlfont_t *cfont;  
00124     struct sfont_t *pfont;
00125 } sfont_t;
00126 
00127 static struct {
00128   htmllabel_t* lbl;       /* Generated label */
00129   htmltbl_t*   tblstack;  /* Stack of tables maintained during parsing */
00130 #ifdef OLD
00131   Dt_t*        paras;     /* Dictionary for paras of text */
00132 #endif
00133   Dt_t*        fitemList; /* Dictionary for font text items */
00134   Dt_t*        fparaList; 
00135   agxbuf*      str;       /* Buffer for text */
00136   sfont_t*     fontstack;
00137 } HTMLstate;
00138 
00139 /* free_ritem:
00140  * Free row. This closes and frees row's list, then
00141  * the pitem itself is freed.
00142  */
00143 static void
00144 free_ritem(Dt_t* d, pitem* p,Dtdisc_t* ds)
00145 {
00146   dtclose (p->u.rp);
00147   free (p);
00148 }
00149 
00150 /* free_item:
00151  * Generic Dt free. Only frees container, assuming contents
00152  * have been copied elsewhere.
00153  */
00154 static void
00155 free_item(Dt_t* d, void* p,Dtdisc_t* ds)
00156 {
00157   free (p);
00158 }
00159 
00160 /* cleanTbl:
00161  * Clean up table if error in parsing.
00162  */
00163 static void
00164 cleanTbl (htmltbl_t* tp)
00165 {
00166   dtclose (tp->u.p.rows);
00167   free_html_data (&tp->data);
00168   free (tp);
00169 }
00170 
00171 /* cleanCell:
00172  * Clean up cell if error in parsing.
00173  */
00174 static void
00175 cleanCell (htmlcell_t* cp)
00176 {
00177   if (cp->child.kind == HTML_TBL) cleanTbl (cp->child.u.tbl);
00178   else if (cp->child.kind == HTML_TEXT) free_html_text (cp->child.u.txt);
00179   free_html_data (&cp->data);
00180   free (cp);
00181 }
00182 
00183 /* free_citem:
00184  * Free cell item during parsing. This frees cell and pitem.
00185  */
00186 static void
00187 free_citem(Dt_t* d, pitem* p,Dtdisc_t* ds)
00188 {
00189   cleanCell (p->u.cp);
00190   free (p);
00191 }
00192 
00193 static Dtdisc_t rowDisc = {
00194     offsetof(pitem,u),
00195     sizeof(void*),
00196     offsetof(pitem,link),
00197     NIL(Dtmake_f),
00198     (Dtfree_f)free_ritem,
00199     NIL(Dtcompar_f),
00200     NIL(Dthash_f),
00201     NIL(Dtmemory_f),
00202     NIL(Dtevent_f)
00203 };
00204 static Dtdisc_t cellDisc = {
00205     offsetof(pitem,u),
00206     sizeof(void*),
00207     offsetof(pitem,link),
00208     NIL(Dtmake_f),
00209     (Dtfree_f)free_item,
00210     NIL(Dtcompar_f),
00211     NIL(Dthash_f),
00212     NIL(Dtmemory_f),
00213     NIL(Dtevent_f)
00214 };
00215 
00216 #ifdef OLD
00217 typedef struct {
00218   Dtlink_t      link;
00219   const char*   s;          /* para of text */
00220   char          c;          /* alignment of text */
00221 } sitem;
00222 #endif
00223 
00224 typedef struct {
00225     Dtlink_t    link;
00226     textitem_t  ti;
00227 } fitem;
00228 
00229 typedef struct {
00230     Dtlink_t     link;
00231     htextpara_t  lp;
00232 } fpara;
00233 
00234 #ifdef OLD
00235 static void
00236 free_sitem(Dt_t* d, sitem* p,Dtdisc_t* ds)
00237 {
00238   free (p);
00239 }
00240 #endif
00241 
00242 static void 
00243 free_fitem(Dt_t* d, fitem* p, Dtdisc_t* ds)
00244 {
00245     if (p->ti.str)
00246         free (p->ti.str);
00247     if (p->ti.font)
00248         free_html_font (p->ti.font);
00249     free (p);
00250 }
00251 
00252 static void 
00253 free_fpara(Dt_t* d, fpara* p, Dtdisc_t* ds)
00254 {
00255     textitem_t* ti;
00256 
00257     if (p->lp.nitems) {
00258         int i;
00259         ti = p->lp.items;
00260         for (i = 0; i < p->lp.nitems; i++) {
00261             if (ti->str) free (ti->str);
00262             if (ti->font) free_html_font (ti->font);
00263             ti++;
00264         }
00265         free (p->lp.items);
00266     }
00267     free (p);
00268 }
00269 
00270 #ifdef OLD
00271 static Dtdisc_t strDisc = {
00272     offsetof(sitem,s),
00273     sizeof(char*),
00274     offsetof(sitem,link),
00275     NIL(Dtmake_f),
00276     (Dtfree_f)free_sitem,
00277     NIL(Dtcompar_f),
00278     NIL(Dthash_f),
00279     NIL(Dtmemory_f),
00280     NIL(Dtevent_f)
00281 };
00282 #endif
00283 
00284 static Dtdisc_t fstrDisc = {
00285     0,
00286     0,
00287     offsetof(fitem,link),
00288     NIL(Dtmake_f),
00289     (Dtfree_f)free_item,
00290     NIL(Dtcompar_f),
00291     NIL(Dthash_f),
00292     NIL(Dtmemory_f),
00293     NIL(Dtevent_f)
00294 };
00295 
00296 
00297 static Dtdisc_t fparaDisc = {
00298     0,
00299     0,
00300     offsetof(fpara,link),
00301     NIL(Dtmake_f),
00302     (Dtfree_f)free_item,
00303     NIL(Dtcompar_f),
00304     NIL(Dthash_f),
00305     NIL(Dtmemory_f),
00306     NIL(Dtevent_f)
00307 };
00308 
00309 #ifdef OLD
00310 static void
00311 appendStrList(const char* p,int v)
00312 {
00313   sitem*  sp = NEW(sitem);
00314   sp->s = strdup(p);
00315   sp->c = v;
00316   dtinsert (HTMLstate.paras, sp);
00317 }
00318 #endif
00319 
00320 /* dupFont:
00321  */
00322 static htmlfont_t *
00323 dupFont (htmlfont_t *f)
00324 {
00325     if (f) f->cnt++;
00326     return f;
00327 }
00328 
00329 /* appendFItemList:
00330  * Append a new fitem to the list.
00331  */
00332 static void
00333 appendFItemList (agxbuf *ag)
00334 {
00335     fitem *fi = NEW(fitem);
00336 
00337     fi->ti.str = strdup(agxbuse(ag));
00338     fi->ti.font = dupFont (HTMLstate.fontstack->cfont);
00339     dtinsert(HTMLstate.fitemList, fi);
00340 }       
00341 
00342 /* appendFLineList:
00343  */
00344 static void 
00345 appendFLineList (int v)
00346 {
00347     int cnt;
00348     fpara *ln = NEW(fpara);
00349     fitem *fi;
00350     Dt_t *ilist = HTMLstate.fitemList;
00351 
00352     cnt = dtsize(ilist);
00353     ln->lp.nitems = cnt;
00354     ln->lp.just = v;
00355     if (cnt) {
00356         int i = 0;
00357         ln->lp.items = N_NEW(cnt, textitem_t); 
00358 
00359         fi = (fitem*)dtflatten(ilist);
00360         for (; fi; fi = (fitem*)dtlink(fitemList,(Dtlink_t*)fi)) {
00361             ln->lp.items[i] = fi->ti;
00362             i++;
00363         }
00364     }
00365 
00366     dtclear(ilist);
00367 
00368     dtinsert(HTMLstate.fparaList, ln);
00369 }
00370 
00371 #ifdef OLD
00372 /* mkText:
00373  * Construct htmltxt_t from list of paras in HTMLstate.paras.
00374  * lastl is a last, odd para with no <BR>, so we use n by default.
00375  */
00376 static htmltxt_t*
00377 mkText (const char* lastl)
00378 {
00379   int         cnt;
00380   textpara_t* lp;
00381   sitem*      sp;
00382   Dt_t*       paras = HTMLstate.paras;
00383   htmltxt_t* tp = NEW(htmltxt_t);
00384 
00385   if (paras)
00386     cnt = dtsize (paras);
00387   else
00388     cnt = 0;
00389   if (lastl) cnt++;
00390 
00391   tp->nparas = cnt;
00392   tp->para = N_NEW(cnt+1,textpara_t);
00393 
00394   lp = tp->para;
00395   if (paras) {
00396     sp = (sitem*)dtflatten(paras);
00397     for (; sp; sp = (sitem*)dtlink(paras,(Dtlink_t*)sp)) {
00398       lp->str = (char*)(sp->s);
00399       lp->xshow = NULL;
00400       lp->just = sp->c;
00401       lp++;
00402     }
00403   }
00404   if (lastl) {
00405     lp->str = strdup(lastl);
00406     lp->just = '\0';
00407   }
00408 
00409   if (paras) dtclear (paras);
00410 
00411   return tp;
00412 }
00413 #endif
00414 
00415 static htmltxt_t*
00416 mkText(void)
00417 {
00418     int cnt;
00419     Dt_t * ipara = HTMLstate.fparaList;
00420     fpara *fl ;
00421     htmltxt_t *hft = NEW(htmltxt_t);
00422     
00423     if (dtsize (HTMLstate.fitemList)) 
00424         appendFLineList (UNSET_ALIGN);
00425 
00426     cnt = dtsize(ipara);
00427     hft->nparas = cnt;
00428         
00429     if (cnt) {
00430         int i = 0;
00431         hft->paras = N_NEW(cnt,htextpara_t);    
00432         for(fl=(fpara *)dtfirst(ipara); fl; fl=(fpara *)dtnext(ipara,fl)) {
00433             hft->paras[i] = fl->lp;
00434             i++;
00435         }
00436     }
00437     
00438     dtclear(ipara);
00439 
00440     return hft;
00441 }
00442 
00443 /* addRow:
00444  * Add new cell row to current table.
00445  */
00446 static void addRow (void)
00447 {
00448   Dt_t*      dp = dtopen(&cellDisc, Dtqueue);
00449   htmltbl_t* tbl = HTMLstate.tblstack;
00450   pitem*     sp = NEW(pitem);
00451   sp->u.rp = dp;
00452   dtinsert (tbl->u.p.rows, sp);
00453 }
00454 
00455 /* setCell:
00456  * Set cell body and type and attach to row
00457  */
00458 static void setCell (htmlcell_t* cp, void* obj, int kind)
00459 {
00460   pitem*     sp = NEW(pitem);
00461   htmltbl_t* tbl = HTMLstate.tblstack;
00462   pitem*     rp = (pitem*)dtlast (tbl->u.p.rows);
00463   Dt_t*      row = rp->u.rp;
00464   sp->u.cp = cp;
00465   dtinsert (row, sp);
00466   cp->child.kind = kind;
00467   
00468   if(kind == HTML_TEXT)
00469         cp->child.u.txt = (htmltxt_t*)obj;
00470   else if (kind == HTML_IMAGE)
00471     cp->child.u.img = (htmlimg_t*)obj;
00472   else
00473     cp->child.u.tbl = (htmltbl_t*)obj;
00474 }
00475 
00476 #ifdef OLD
00477 /* setFont:
00478  * Copy in font attributes. fp has the new attributes.
00479  * curf corresponds to the current font info of the object.
00480  * From the parser, we are moving out from the object. Since
00481  * the inmost value is the one used, we only use a new value
00482  * if the attribute has not already been assigned.
00483  */
00484 static htmlfont_t* setFont (htmlfont_t* fp, htmlfont_t*  curf)
00485 {
00486   if (curf) {
00487     if (curf->size < 0.0) curf->size = fp->size;
00488     if (!curf->color) curf->color = fp->color;
00489     else if (fp->color) free (fp->color);
00490     if (!curf->name) curf->name = fp->name;
00491     else if (fp->name) free (fp->name);
00492     free (fp);
00493     return curf;
00494   }
00495   else
00496     return fp;
00497 }
00498 
00499 /* fontText:
00500  * Attach font information to text.
00501  */
00502 static void fontText (htmlfont_t* fp, htmltxt_t* cp)
00503 {
00504   cp->font = setFont (fp, cp->font);
00505 }
00506 
00507 /* fontTable:
00508  * Attach font information to table.
00509  */
00510 static void fontTable (htmlfont_t* fp, htmltbl_t* cp)
00511 {
00512   cp->font = setFont (fp, cp->font);
00513 }
00514 #endif
00515 
00516 /* mkLabel:
00517  * Create label, given body and type.
00518  */
00519 static htmllabel_t* mkLabel (void* obj, int kind)
00520 {
00521   htmllabel_t* lp = NEW(htmllabel_t);
00522 
00523   lp->kind = kind;
00524   if (kind == HTML_TEXT)
00525     lp->u.txt = (htmltxt_t*)obj;
00526   else
00527     lp->u.tbl = (htmltbl_t*)obj;
00528   return lp;
00529 }
00530 
00531 /* freeFontstack:
00532  * Free all stack items but the last, which is
00533  * put on artificially during in parseHTML.
00534  */
00535 static void
00536 freeFontstack(void)
00537 {
00538     sfont_t* s;
00539     sfont_t* next;
00540 
00541     for (s = HTMLstate.fontstack; (next = s->pfont); s = next) {
00542         free_html_font (s->cfont);
00543         free(s);
00544     }
00545 }
00546 
00547 /* cleanup:
00548  * Called on error. Frees resources allocated during parsing.
00549  * This includes a label, plus a walk down the stack of
00550  * tables. Note that we use the free_citem function to actually
00551  * free cells.
00552  */
00553 static void cleanup (void)
00554 {
00555   htmltbl_t* tp = HTMLstate.tblstack;
00556   htmltbl_t* next;
00557 
00558   if (HTMLstate.lbl) {
00559     free_html_label (HTMLstate.lbl,1);
00560     HTMLstate.lbl = NULL;
00561   }
00562   cellDisc.freef = (Dtfree_f)free_citem;
00563   while (tp) {
00564     next = tp->u.p.prev;
00565     cleanTbl (tp);
00566     tp = next;
00567   }
00568   cellDisc.freef = (Dtfree_f)free_item;
00569 
00570   fstrDisc.freef = (Dtfree_f)free_fitem;
00571   dtclear (HTMLstate.fitemList);
00572   fstrDisc.freef = (Dtfree_f)free_item;
00573 
00574   fparaDisc.freef = (Dtfree_f)free_fpara;
00575   dtclear (HTMLstate.fparaList);
00576   fparaDisc.freef = (Dtfree_f)free_item;
00577 
00578   freeFontstack();
00579 }
00580 
00581 /* nonSpace:
00582  * Return 1 if s contains a non-space character.
00583  */
00584 static int nonSpace (char* s)
00585 {
00586   char   c;
00587 
00588   while ((c = *s++)) {
00589     if (c != ' ') return 1;
00590   }
00591   return 0;
00592 }
00593 
00594 /* pushFont:
00595  * Fonts are allocated in the lexer.
00596  */
00597 static void
00598 pushFont (htmlfont_t *f)
00599 {
00600     sfont_t *ft = NEW(sfont_t);
00601     htmlfont_t* curfont = HTMLstate.fontstack->cfont;
00602 
00603     if (curfont) {
00604         if (!f->color && curfont->color)
00605             f->color = strdup(curfont->color);
00606         if ((f->size < 0.0) && (curfont->size >= 0.0))
00607             f->size = curfont->size;
00608         if (!f->name && curfont->name)
00609             f->name = strdup(curfont->name);
00610     }
00611 
00612     ft->cfont = dupFont (f);
00613     ft->pfont = HTMLstate.fontstack;
00614     HTMLstate.fontstack = ft;
00615 }
00616 
00617 /* popFont:
00618  */
00619 static void 
00620 popFont (void)
00621 {
00622     sfont_t* curfont = HTMLstate.fontstack;
00623     sfont_t* prevfont = curfont->pfont;
00624 
00625     free_html_font (curfont->cfont);
00626     free (curfont);
00627     HTMLstate.fontstack = prevfont;
00628 }
00629 
00630 
00631 
00632 /* Enabling traces.  */
00633 #ifndef YYDEBUG
00634 # define YYDEBUG 0
00635 #endif
00636 
00637 /* Enabling verbose error messages.  */
00638 #ifdef YYERROR_VERBOSE
00639 # undef YYERROR_VERBOSE
00640 # define YYERROR_VERBOSE 1
00641 #else
00642 # define YYERROR_VERBOSE 0
00643 #endif
00644 
00645 /* Enabling the token table.  */
00646 #ifndef YYTOKEN_TABLE
00647 # define YYTOKEN_TABLE 0
00648 #endif
00649 
00650 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
00651 typedef union YYSTYPE
00652 #line 535 "../../lib/common/htmlparse.y"
00653 {
00654   int    i;
00655   htmltxt_t*  txt;
00656   htmlcell_t*  cell;
00657   htmltbl_t*   tbl;
00658   htmlfont_t*  font;
00659   htmlimg_t*   img;
00660 }
00661 /* Line 187 of yacc.c.  */
00662 #line 663 "y.tab.c"
00663         YYSTYPE;
00664 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
00665 # define YYSTYPE_IS_DECLARED 1
00666 # define YYSTYPE_IS_TRIVIAL 1
00667 #endif
00668 
00669 
00670 
00671 /* Copy the second part of user declarations.  */
00672 
00673 
00674 /* Line 216 of yacc.c.  */
00675 #line 676 "y.tab.c"
00676 
00677 #ifdef short
00678 # undef short
00679 #endif
00680 
00681 #ifdef YYTYPE_UINT8
00682 typedef YYTYPE_UINT8 yytype_uint8;
00683 #else
00684 typedef unsigned char yytype_uint8;
00685 #endif
00686 
00687 #ifdef YYTYPE_INT8
00688 typedef YYTYPE_INT8 yytype_int8;
00689 #elif (defined __STDC__ || defined __C99__FUNC__ \
00690      || defined __cplusplus || defined _MSC_VER)
00691 typedef signed char yytype_int8;
00692 #else
00693 typedef short int yytype_int8;
00694 #endif
00695 
00696 #ifdef YYTYPE_UINT16
00697 typedef YYTYPE_UINT16 yytype_uint16;
00698 #else
00699 typedef unsigned short int yytype_uint16;
00700 #endif
00701 
00702 #ifdef YYTYPE_INT16
00703 typedef YYTYPE_INT16 yytype_int16;
00704 #else
00705 typedef short int yytype_int16;
00706 #endif
00707 
00708 #ifndef YYSIZE_T
00709 # ifdef __SIZE_TYPE__
00710 #  define YYSIZE_T __SIZE_TYPE__
00711 # elif defined size_t
00712 #  define YYSIZE_T size_t
00713 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
00714      || defined __cplusplus || defined _MSC_VER)
00715 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
00716 #  define YYSIZE_T size_t
00717 # else
00718 #  define YYSIZE_T unsigned int
00719 # endif
00720 #endif
00721 
00722 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
00723 
00724 #ifndef YY_
00725 # if YYENABLE_NLS
00726 #  if ENABLE_NLS
00727 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
00728 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
00729 #  endif
00730 # endif
00731 # ifndef YY_
00732 #  define YY_(msgid) msgid
00733 # endif
00734 #endif
00735 
00736 /* Suppress unused-variable warnings by "using" E.  */
00737 #if ! defined lint || defined __GNUC__
00738 # define YYUSE(e) ((void) (e))
00739 #else
00740 # define YYUSE(e) /* empty */
00741 #endif
00742 
00743 /* Identity function, used to suppress warnings about constant conditions.  */
00744 #ifndef lint
00745 # define YYID(n) (n)
00746 #else
00747 #if (defined __STDC__ || defined __C99__FUNC__ \
00748      || defined __cplusplus || defined _MSC_VER)
00749 static int
00750 YYID (int i)
00751 #else
00752 static int
00753 YYID (i)
00754     int i;
00755 #endif
00756 {
00757   return i;
00758 }
00759 #endif
00760 
00761 #if ! defined yyoverflow || YYERROR_VERBOSE
00762 
00763 /* The parser invokes alloca or malloc; define the necessary symbols.  */
00764 
00765 # ifdef YYSTACK_USE_ALLOCA
00766 #  if YYSTACK_USE_ALLOCA
00767 #   ifdef __GNUC__
00768 #    define YYSTACK_ALLOC __builtin_alloca
00769 #   elif defined __BUILTIN_VA_ARG_INCR
00770 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
00771 #   elif defined _AIX
00772 #    define YYSTACK_ALLOC __alloca
00773 #   elif defined _MSC_VER
00774 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
00775 #    define alloca _alloca
00776 #   else
00777 #    define YYSTACK_ALLOC alloca
00778 #    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00779      || defined __cplusplus || defined _MSC_VER)
00780 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
00781 #     ifndef _STDLIB_H
00782 #      define _STDLIB_H 1
00783 #     endif
00784 #    endif
00785 #   endif
00786 #  endif
00787 # endif
00788 
00789 # ifdef YYSTACK_ALLOC
00790    /* Pacify GCC's `empty if-body' warning.  */
00791 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
00792 #  ifndef YYSTACK_ALLOC_MAXIMUM
00793     /* The OS might guarantee only one guard page at the bottom of the stack,
00794        and a page size can be as small as 4096 bytes.  So we cannot safely
00795        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
00796        to allow for a few compiler-allocated temporary stack slots.  */
00797 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
00798 #  endif
00799 # else
00800 #  define YYSTACK_ALLOC YYMALLOC
00801 #  define YYSTACK_FREE YYFREE
00802 #  ifndef YYSTACK_ALLOC_MAXIMUM
00803 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
00804 #  endif
00805 #  if (defined __cplusplus && ! defined _STDLIB_H \
00806        && ! ((defined YYMALLOC || defined malloc) \
00807              && (defined YYFREE || defined free)))
00808 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
00809 #   ifndef _STDLIB_H
00810 #    define _STDLIB_H 1
00811 #   endif
00812 #  endif
00813 #  ifndef YYMALLOC
00814 #   define YYMALLOC malloc
00815 #   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00816      || defined __cplusplus || defined _MSC_VER)
00817 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
00818 #   endif
00819 #  endif
00820 #  ifndef YYFREE
00821 #   define YYFREE free
00822 #   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00823      || defined __cplusplus || defined _MSC_VER)
00824 void free (void *); /* INFRINGES ON USER NAME SPACE */
00825 #   endif
00826 #  endif
00827 # endif
00828 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
00829 
00830 
00831 #if (! defined yyoverflow \
00832      && (! defined __cplusplus \
00833          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
00834 
00835 /* A type that is properly aligned for any stack member.  */
00836 union yyalloc
00837 {
00838   yytype_int16 yyss;
00839   YYSTYPE yyvs;
00840   };
00841 
00842 /* The size of the maximum gap between one aligned stack and the next.  */
00843 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
00844 
00845 /* The size of an array large to enough to hold all stacks, each with
00846    N elements.  */
00847 # define YYSTACK_BYTES(N) \
00848      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
00849       + YYSTACK_GAP_MAXIMUM)
00850 
00851 /* Copy COUNT objects from FROM to TO.  The source and destination do
00852    not overlap.  */
00853 # ifndef YYCOPY
00854 #  if defined __GNUC__ && 1 < __GNUC__
00855 #   define YYCOPY(To, From, Count) \
00856       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
00857 #  else
00858 #   define YYCOPY(To, From, Count)              \
00859       do                                        \
00860         {                                       \
00861           YYSIZE_T yyi;                         \
00862           for (yyi = 0; yyi < (Count); yyi++)   \
00863             (To)[yyi] = (From)[yyi];            \
00864         }                                       \
00865       while (YYID (0))
00866 #  endif
00867 # endif
00868 
00869 /* Relocate STACK from its old location to the new one.  The
00870    local variables YYSIZE and YYSTACKSIZE give the old and new number of
00871    elements in the stack, and YYPTR gives the new location of the
00872    stack.  Advance YYPTR to a properly aligned location for the next
00873    stack.  */
00874 # define YYSTACK_RELOCATE(Stack)                                        \
00875     do                                                                  \
00876       {                                                                 \
00877         YYSIZE_T yynewbytes;                                            \
00878         YYCOPY (&yyptr->Stack, Stack, yysize);                          \
00879         Stack = &yyptr->Stack;                                          \
00880         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
00881         yyptr += yynewbytes / sizeof (*yyptr);                          \
00882       }                                                                 \
00883     while (YYID (0))
00884 
00885 #endif
00886 
00887 /* YYFINAL -- State number of the termination state.  */
00888 #define YYFINAL  17
00889 /* YYLAST -- Last index in YYTABLE.  */
00890 #define YYLAST   61
00891 
00892 /* YYNTOKENS -- Number of terminals.  */
00893 #define YYNTOKENS  21
00894 /* YYNNTS -- Number of nonterminals.  */
00895 #define YYNNTS  23
00896 /* YYNRULES -- Number of rules.  */
00897 #define YYNRULES  38
00898 /* YYNRULES -- Number of states.  */
00899 #define YYNSTATES  59
00900 
00901 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
00902 #define YYUNDEFTOK  2
00903 #define YYMAXUTOK   275
00904 
00905 #define YYTRANSLATE(YYX)                                                \
00906   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
00907 
00908 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
00909 static const yytype_uint8 yytranslate[] =
00910 {
00911        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00912        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00913        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00914        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00915        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00916        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00917        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00918        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00919        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00920        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00921        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00922        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00923        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00924        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00925        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00926        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00927        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00928        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00929        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00930        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00931        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00932        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00933        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00934        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00935        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00936        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
00937        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
00938       15,    16,    17,    18,    19,    20
00939 };
00940 
00941 #if YYDEBUG
00942 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
00943    YYRHS.  */
00944 static const yytype_uint8 yyprhs[] =
00945 {
00946        0,     0,     3,     7,    11,    13,    15,    18,    20,    22,
00947       24,    28,    30,    32,    35,    37,    39,    42,    43,    50,
00948       52,    56,    58,    59,    61,    64,    65,    70,    72,    75,
00949       76,    81,    82,    87,    88,    93,    94,    98,   101
00950 };
00951 
00952 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
00953 static const yytype_int8 yyrhs[] =
00954 {
00955       22,     0,    -1,     7,    23,     8,    -1,     7,    32,     8,
00956       -1,     1,    -1,    24,    -1,    24,    25,    -1,    25,    -1,
00957       29,    -1,    28,    -1,    26,    24,    27,    -1,    20,    -1,
00958       11,    -1,    15,     3,    -1,    14,    -1,    12,    -1,    29,
00959       12,    -1,    -1,    33,    18,    31,    34,     9,    33,    -1,
00960       30,    -1,    26,    30,    27,    -1,    29,    -1,    -1,    35,
00961       -1,    34,    35,    -1,    -1,     5,    36,    37,     6,    -1,
00962       38,    -1,    37,    38,    -1,    -1,    19,    32,    39,    10,
00963       -1,    -1,    19,    23,    40,    10,    -1,    -1,    19,    43,
00964       41,    10,    -1,    -1,    19,    42,    10,    -1,    17,     4,
00965       -1,    16,    -1
00966 };
00967 
00968 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
00969 static const yytype_uint16 yyrline[] =
00970 {
00971        0,   561,   561,   562,   563,   566,   569,   570,   573,   574,
00972      575,   578,   581,   584,   585,   588,   589,   592,   592,   613,
00973      614,   617,   618,   621,   622,   625,   625,   628,   629,   632,
00974      632,   633,   633,   634,   634,   635,   635,   638,   639
00975 };
00976 #endif
00977 
00978 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
00979 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
00980    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
00981 static const char *const yytname[] =
00982 {
00983   "$end", "error", "$undefined", "T_end_br", "T_end_img", "T_row",
00984   "T_end_row", "T_html", "T_end_html", "T_end_table", "T_end_cell",
00985   "T_end_font", "T_string", "T_error", "T_BR", "T_br", "T_IMG", "T_img",
00986   "T_table", "T_cell", "T_font", "$accept", "html", "fonttext", "text",
00987   "textitem", "sfont", "nfont", "br", "string", "table", "@1", "fonttable",
00988   "opt_space", "rows", "row", "@2", "cells", "cell", "@3", "@4", "@5",
00989   "@6", "image", 0
00990 };
00991 #endif
00992 
00993 # ifdef YYPRINT
00994 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
00995    token YYLEX-NUM.  */
00996 static const yytype_uint16 yytoknum[] =
00997 {
00998        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
00999      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
01000      275
01001 };
01002 # endif
01003 
01004 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
01005 static const yytype_uint8 yyr1[] =
01006 {
01007        0,    21,    22,    22,    22,    23,    24,    24,    25,    25,
01008       25,    26,    27,    28,    28,    29,    29,    31,    30,    32,
01009       32,    33,    33,    34,    34,    36,    35,    37,    37,    39,
01010       38,    40,    38,    41,    38,    42,    38,    43,    43
01011 };
01012 
01013 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
01014 static const yytype_uint8 yyr2[] =
01015 {
01016        0,     2,     3,     3,     1,     1,     2,     1,     1,     1,
01017        3,     1,     1,     2,     1,     1,     2,     0,     6,     1,
01018        3,     1,     0,     1,     2,     0,     4,     1,     2,     0,
01019        4,     0,     4,     0,     4,     0,     3,     2,     1
01020 };
01021 
01022 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
01023    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
01024    means the default is an error.  */
01025 static const yytype_uint8 yydefact[] =
01026 {
01027        0,     4,    22,     0,    15,    14,     0,    11,     0,     5,
01028        7,    22,     9,     8,    19,     0,     0,     1,    13,     2,
01029        6,     0,     8,     0,     0,    16,     3,    17,    12,    10,
01030       20,     0,    25,     0,    23,     0,    22,    24,    22,     0,
01031       27,    21,    18,    38,     0,    31,    29,     0,    33,    26,
01032       28,    37,     0,     0,    36,     0,    32,    30,    34
01033 };
01034 
01035 /* YYDEFGOTO[NTERM-NUM].  */
01036 static const yytype_int8 yydefgoto[] =
01037 {
01038       -1,     3,     8,     9,    10,    21,    29,    12,    13,    14,
01039       31,    15,    16,    33,    34,    35,    39,    40,    53,    52,
01040       55,    47,    48
01041 };
01042 
01043 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
01044    STATE-NUM.  */
01045 #define YYPACT_NINF -9
01046 static const yytype_int8 yypact[] =
01047 {
01048       24,    -9,    18,     3,    -9,    -9,    16,    -9,     4,    18,
01049       -9,    18,    -9,    22,    -9,    19,    21,    -9,    -9,    -9,
01050       -9,    18,    23,     9,    26,    -9,    -9,    -9,    -9,    -9,
01051       -9,    36,    -9,    17,    -9,    25,    30,    -9,    -6,    -1,
01052       -9,    23,    -9,    -9,    39,    -9,    -9,    35,    -9,    -9,
01053       -9,    -9,    37,    38,    -9,    40,    -9,    -9,    -9
01054 };
01055 
01056 /* YYPGOTO[NTERM-NUM].  */
01057 static const yytype_int8 yypgoto[] =
01058 {
01059       -9,    -9,     8,    -4,    -7,    -2,    27,    -9,    -8,    41,
01060       -9,    11,    20,    -9,    28,    -9,    -9,    14,    -9,    -9,
01061       -9,    -9,    -9
01062 };
01063 
01064 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
01065    positive, shift that token.  If negative, reduce the rule which
01066    number is the opposite.  If zero, do what YYDEFACT says.
01067    If YYTABLE_NINF, syntax error.  */
01068 #define YYTABLE_NINF -36
01069 static const yytype_int8 yytable[] =
01070 {
01071       11,    22,    20,    17,   -35,    49,     4,    23,     5,     6,
01072       43,    44,    19,    22,     7,    22,    20,    23,    38,    18,
01073       28,     4,    32,     5,     6,     1,    36,    26,    41,     7,
01074        4,     2,     5,     6,    25,    25,    11,    28,     7,    27,
01075      -21,    32,     4,    51,    38,    54,    45,    56,    57,    46,
01076       58,    30,    24,    50,     0,     0,    42,     0,     0,     0,
01077        0,    37
01078 };
01079 
01080 static const yytype_int8 yycheck[] =
01081 {
01082        2,     9,     9,     0,    10,     6,    12,    11,    14,    15,
01083       16,    17,     8,    21,    20,    23,    23,    21,    19,     3,
01084       11,    12,     5,    14,    15,     1,     9,     8,    36,    20,
01085       12,     7,    14,    15,    12,    12,    38,    11,    20,    18,
01086       18,     5,    12,     4,    19,    10,    38,    10,    10,    38,
01087       10,    24,    11,    39,    -1,    -1,    36,    -1,    -1,    -1,
01088       -1,    33
01089 };
01090 
01091 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
01092    symbol of state STATE-NUM.  */
01093 static const yytype_uint8 yystos[] =
01094 {
01095        0,     1,     7,    22,    12,    14,    15,    20,    23,    24,
01096       25,    26,    28,    29,    30,    32,    33,     0,     3,     8,
01097       25,    26,    29,    24,    30,    12,     8,    18,    11,    27,
01098       27,    31,     5,    34,    35,    36,     9,    35,    19,    37,
01099       38,    29,    33,    16,    17,    23,    32,    42,    43,     6,
01100       38,     4,    40,    39,    10,    41,    10,    10,    10
01101 };
01102 
01103 #define yyerrok         (yyerrstatus = 0)
01104 #define yyclearin       (yychar = YYEMPTY)
01105 #define YYEMPTY         (-2)
01106 #define YYEOF           0
01107 
01108 #define YYACCEPT        goto yyacceptlab
01109 #define YYABORT         goto yyabortlab
01110 #define YYERROR         goto yyerrorlab
01111 
01112 
01113 /* Like YYERROR except do call yyerror.  This remains here temporarily
01114    to ease the transition to the new meaning of YYERROR, for GCC.
01115    Once GCC version 2 has supplanted version 1, this can go.  */
01116 
01117 #define YYFAIL          goto yyerrlab
01118 
01119 #define YYRECOVERING()  (!!yyerrstatus)
01120 
01121 #define YYBACKUP(Token, Value)                                  \
01122 do                                                              \
01123   if (yychar == YYEMPTY && yylen == 1)                          \
01124     {                                                           \
01125       yychar = (Token);                                         \
01126       yylval = (Value);                                         \
01127       yytoken = YYTRANSLATE (yychar);                           \
01128       YYPOPSTACK (1);                                           \
01129       goto yybackup;                                            \
01130     }                                                           \
01131   else                                                          \
01132     {                                                           \
01133       yyerror (YY_("syntax error: cannot back up")); \
01134       YYERROR;                                                  \
01135     }                                                           \
01136 while (YYID (0))
01137 
01138 
01139 #define YYTERROR        1
01140 #define YYERRCODE       256
01141 
01142 
01143 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
01144    If N is 0, then set CURRENT to the empty location which ends
01145    the previous symbol: RHS[0] (always defined).  */
01146 
01147 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
01148 #ifndef YYLLOC_DEFAULT
01149 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
01150     do                                                                  \
01151       if (YYID (N))                                                    \
01152         {                                                               \
01153           (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
01154           (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
01155           (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
01156           (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
01157         }                                                               \
01158       else                                                              \
01159         {                                                               \
01160           (Current).first_line   = (Current).last_line   =              \
01161             YYRHSLOC (Rhs, 0).last_line;                                \
01162           (Current).first_column = (Current).last_column =              \
01163             YYRHSLOC (Rhs, 0).last_column;                              \
01164         }                                                               \
01165     while (YYID (0))
01166 #endif
01167 
01168 
01169 /* YY_LOCATION_PRINT -- Print the location on the stream.
01170    This macro was not mandated originally: define only if we know
01171    we won't break user code: when these are the locations we know.  */
01172 
01173 #ifndef YY_LOCATION_PRINT
01174 # if YYLTYPE_IS_TRIVIAL
01175 #  define YY_LOCATION_PRINT(File, Loc)                  \
01176      fprintf (File, "%d.%d-%d.%d",                      \
01177               (Loc).first_line, (Loc).first_column,     \
01178               (Loc).last_line,  (Loc).last_column)
01179 # else
01180 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
01181 # endif
01182 #endif
01183 
01184 
01185 /* YYLEX -- calling `yylex' with the right arguments.  */
01186 
01187 #ifdef YYLEX_PARAM
01188 # define YYLEX yylex (YYLEX_PARAM)
01189 #else
01190 # define YYLEX yylex ()
01191 #endif
01192 
01193 /* Enable debugging if requested.  */
01194 #if YYDEBUG
01195 
01196 # ifndef YYFPRINTF
01197 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
01198 #  define YYFPRINTF fprintf
01199 # endif
01200 
01201 # define YYDPRINTF(Args)                        \
01202 do {                                            \
01203   if (yydebug)                                  \
01204     YYFPRINTF Args;                             \
01205 } while (YYID (0))
01206 
01207 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
01208 do {                                                                      \
01209   if (yydebug)                                                            \
01210     {                                                                     \
01211       YYFPRINTF (stderr, "%s ", Title);                                   \
01212       yy_symbol_print (stderr,                                            \
01213                   Type, Value); \
01214       YYFPRINTF (stderr, "\n");                                           \
01215     }                                                                     \
01216 } while (YYID (0))
01217 
01218 
01219 /*--------------------------------.
01220 | Print this symbol on YYOUTPUT.  |
01221 `--------------------------------*/
01222 
01223 /*ARGSUSED*/
01224 #if (defined __STDC__ || defined __C99__FUNC__ \
01225      || defined __cplusplus || defined _MSC_VER)
01226 static void
01227 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
01228 #else
01229 static void
01230 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
01231     FILE *yyoutput;
01232     int yytype;
01233     YYSTYPE const * const yyvaluep;
01234 #endif
01235 {
01236   if (!yyvaluep)
01237     return;
01238 # ifdef YYPRINT
01239   if (yytype < YYNTOKENS)
01240     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
01241 # else
01242   YYUSE (yyoutput);
01243 # endif
01244   switch (yytype)
01245     {
01246       default:
01247         break;
01248     }
01249 }
01250 
01251 
01252 /*--------------------------------.
01253 | Print this symbol on YYOUTPUT.  |
01254 `--------------------------------*/
01255 
01256 #if (defined __STDC__ || defined __C99__FUNC__ \
01257      || defined __cplusplus || defined _MSC_VER)
01258 static void
01259 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
01260 #else
01261 static void
01262 yy_symbol_print (yyoutput, yytype, yyvaluep)
01263     FILE *yyoutput;
01264     int yytype;
01265     YYSTYPE const * const yyvaluep;
01266 #endif
01267 {
01268   if (yytype < YYNTOKENS)
01269     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
01270   else
01271     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
01272 
01273   yy_symbol_value_print (yyoutput, yytype, yyvaluep);
01274   YYFPRINTF (yyoutput, ")");
01275 }
01276 
01277 /*------------------------------------------------------------------.
01278 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
01279 | TOP (included).                                                   |
01280 `------------------------------------------------------------------*/
01281 
01282 #if (defined __STDC__ || defined __C99__FUNC__ \
01283      || defined __cplusplus || defined _MSC_VER)
01284 static void
01285 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
01286 #else
01287 static void
01288 yy_stack_print (bottom, top)
01289     yytype_int16 *bottom;
01290     yytype_int16 *top;
01291 #endif
01292 {
01293   YYFPRINTF (stderr, "Stack now");
01294   for (; bottom <= top; ++bottom)
01295     YYFPRINTF (stderr, " %d", *bottom);
01296   YYFPRINTF (stderr, "\n");
01297 }
01298 
01299 # define YY_STACK_PRINT(Bottom, Top)                            \
01300 do {                                                            \
01301   if (yydebug)                                                  \
01302     yy_stack_print ((Bottom), (Top));                           \
01303 } while (YYID (0))
01304 
01305 
01306 /*------------------------------------------------.
01307 | Report that the YYRULE is going to be reduced.  |
01308 `------------------------------------------------*/
01309 
01310 #if (defined __STDC__ || defined __C99__FUNC__ \
01311      || defined __cplusplus || defined _MSC_VER)
01312 static void
01313 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
01314 #else
01315 static void
01316 yy_reduce_print (yyvsp, yyrule)
01317     YYSTYPE *yyvsp;
01318     int yyrule;
01319 #endif
01320 {
01321   int yynrhs = yyr2[yyrule];
01322   int yyi;
01323   unsigned long int yylno = yyrline[yyrule];
01324   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
01325              yyrule - 1, yylno);
01326   /* The symbols being reduced.  */
01327   for (yyi = 0; yyi < yynrhs; yyi++)
01328     {
01329       fprintf (stderr, "   $%d = ", yyi + 1);
01330       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
01331                        &(yyvsp[(yyi + 1) - (yynrhs)])
01332                                        );
01333       fprintf (stderr, "\n");
01334     }
01335 }
01336 
01337 # define YY_REDUCE_PRINT(Rule)          \
01338 do {                                    \
01339   if (yydebug)                          \
01340     yy_reduce_print (yyvsp, Rule); \
01341 } while (YYID (0))
01342 
01343 /* Nonzero means print parse trace.  It is left uninitialized so that
01344    multiple parsers can coexist.  */
01345 int yydebug;
01346 #else /* !YYDEBUG */
01347 # define YYDPRINTF(Args)
01348 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
01349 # define YY_STACK_PRINT(Bottom, Top)
01350 # define YY_REDUCE_PRINT(Rule)
01351 #endif /* !YYDEBUG */
01352 
01353 
01354 /* YYINITDEPTH -- initial size of the parser's stacks.  */
01355 #ifndef YYINITDEPTH
01356 # define YYINITDEPTH 200
01357 #endif
01358 
01359 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
01360    if the built-in stack extension method is used).
01361 
01362    Do not make this value too large; the results are undefined if
01363    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
01364    evaluated with infinite-precision integer arithmetic.  */
01365 
01366 #ifndef YYMAXDEPTH
01367 # define YYMAXDEPTH 10000
01368 #endif
01369 
01370 
01371 
01372 #if YYERROR_VERBOSE
01373 
01374 # ifndef yystrlen
01375 #  if defined __GLIBC__ && defined _STRING_H
01376 #   define yystrlen strlen
01377 #  else
01378 /* Return the length of YYSTR.  */
01379 #if (defined __STDC__ || defined __C99__FUNC__ \
01380      || defined __cplusplus || defined _MSC_VER)
01381 static YYSIZE_T
01382 yystrlen (const char *yystr)
01383 #else
01384 static YYSIZE_T
01385 yystrlen (yystr)
01386     const char *yystr;
01387 #endif
01388 {
01389   YYSIZE_T yylen;
01390   for (yylen = 0; yystr[yylen]; yylen++)
01391     continue;
01392   return yylen;
01393 }
01394 #  endif
01395 # endif
01396 
01397 # ifndef yystpcpy
01398 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
01399 #   define yystpcpy stpcpy
01400 #  else
01401 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
01402    YYDEST.  */
01403 #if (defined __STDC__ || defined __C99__FUNC__ \
01404      || defined __cplusplus || defined _MSC_VER)
01405 static char *
01406 yystpcpy (char *yydest, const char *yysrc)
01407 #else
01408 static char *
01409 yystpcpy (yydest, yysrc)
01410     char *yydest;
01411     const char *yysrc;
01412 #endif
01413 {
01414   char *yyd = yydest;
01415   const char *yys = yysrc;
01416 
01417   while ((*yyd++ = *yys++) != '\0')
01418     continue;
01419 
01420   return yyd - 1;
01421 }
01422 #  endif
01423 # endif
01424 
01425 # ifndef yytnamerr
01426 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
01427    quotes and backslashes, so that it's suitable for yyerror.  The
01428    heuristic is that double-quoting is unnecessary unless the string
01429    contains an apostrophe, a comma, or backslash (other than
01430    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
01431    null, do not copy; instead, return the length of what the result
01432    would have been.  */
01433 static YYSIZE_T
01434 yytnamerr (char *yyres, const char *yystr)
01435 {
01436   if (*yystr == '"')
01437     {
01438       YYSIZE_T yyn = 0;
01439       char const *yyp = yystr;
01440 
01441       for (;;)
01442         switch (*++yyp)
01443           {
01444           case '\'':
01445           case ',':
01446             goto do_not_strip_quotes;
01447 
01448           case '\\':
01449             if (*++yyp != '\\')
01450               goto do_not_strip_quotes;
01451             /* Fall through.  */
01452           default:
01453             if (yyres)
01454               yyres[yyn] = *yyp;
01455             yyn++;
01456             break;
01457 
01458           case '"':
01459             if (yyres)
01460               yyres[yyn] = '\0';
01461             return yyn;
01462           }
01463     do_not_strip_quotes: ;
01464     }
01465 
01466   if (! yyres)
01467     return yystrlen (yystr);
01468 
01469   return yystpcpy (yyres, yystr) - yyres;
01470 }
01471 # endif
01472 
01473 /* Copy into YYRESULT an error message about the unexpected token
01474    YYCHAR while in state YYSTATE.  Return the number of bytes copied,
01475    including the terminating null byte.  If YYRESULT is null, do not
01476    copy anything; just return the number of bytes that would be
01477    copied.  As a special case, return 0 if an ordinary "syntax error"
01478    message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
01479    size calculation.  */
01480 static YYSIZE_T
01481 yysyntax_error (char *yyresult, int yystate, int yychar)
01482 {
01483   int yyn = yypact[yystate];
01484 
01485   if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
01486     return 0;
01487   else
01488     {
01489       int yytype = YYTRANSLATE (yychar);
01490       YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
01491       YYSIZE_T yysize = yysize0;
01492       YYSIZE_T yysize1;
01493       int yysize_overflow = 0;
01494       enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
01495       char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
01496       int yyx;
01497 
01498 # if 0
01499       /* This is so xgettext sees the translatable formats that are
01500          constructed on the fly.  */
01501       YY_("syntax error, unexpected %s");
01502       YY_("syntax error, unexpected %s, expecting %s");
01503       YY_("syntax error, unexpected %s, expecting %s or %s");
01504       YY_("syntax error, unexpected %s, expecting %s or %s or %s");
01505       YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
01506 # endif
01507       char *yyfmt;
01508       char const *yyf;
01509       static char const yyunexpected[] = "syntax error, unexpected %s";
01510       static char const yyexpecting[] = ", expecting %s";
01511       static char const yyor[] = " or %s";
01512       char yyformat[sizeof yyunexpected
01513                     + sizeof yyexpecting - 1
01514                     + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
01515                        * (sizeof yyor - 1))];
01516       char const *yyprefix = yyexpecting;
01517 
01518       /* Start YYX at -YYN if negative to avoid negative indexes in
01519          YYCHECK.  */
01520       int yyxbegin = yyn < 0 ? -yyn : 0;
01521 
01522       /* Stay within bounds of both yycheck and yytname.  */
01523       int yychecklim = YYLAST - yyn + 1;
01524       int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
01525       int yycount = 1;
01526 
01527       yyarg[0] = yytname[yytype];
01528       yyfmt = yystpcpy (yyformat, yyunexpected);
01529 
01530       for (yyx = yyxbegin; yyx < yyxend; ++yyx)
01531         if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
01532           {
01533             if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
01534               {
01535                 yycount = 1;
01536                 yysize = yysize0;
01537                 yyformat[sizeof yyunexpected - 1] = '\0';
01538                 break;
01539               }
01540             yyarg[yycount++] = yytname[yyx];
01541             yysize1 = yysize + yytnamerr (0, yytname[yyx]);
01542             yysize_overflow |= (yysize1 < yysize);
01543             yysize = yysize1;
01544             yyfmt = yystpcpy (yyfmt, yyprefix);
01545             yyprefix = yyor;
01546           }
01547 
01548       yyf = YY_(yyformat);
01549       yysize1 = yysize + yystrlen (yyf);
01550       yysize_overflow |= (yysize1 < yysize);
01551       yysize = yysize1;
01552 
01553       if (yysize_overflow)
01554         return YYSIZE_MAXIMUM;
01555 
01556       if (yyresult)
01557         {
01558           /* Avoid sprintf, as that infringes on the user's name space.
01559              Don't have undefined behavior even if the translation
01560              produced a string with the wrong number of "%s"s.  */
01561           char *yyp = yyresult;
01562           int yyi = 0;
01563           while ((*yyp = *yyf) != '\0')
01564             {
01565               if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
01566                 {
01567                   yyp += yytnamerr (yyp, yyarg[yyi++]);
01568                   yyf += 2;
01569                 }
01570               else
01571                 {
01572                   yyp++;
01573                   yyf++;
01574                 }
01575             }
01576         }
01577       return yysize;
01578     }
01579 }
01580 #endif /* YYERROR_VERBOSE */
01581 
01582 
01583 /*-----------------------------------------------.
01584 | Release the memory associated to this symbol.  |
01585 `-----------------------------------------------*/
01586 
01587 /*ARGSUSED*/
01588 #if (defined __STDC__ || defined __C99__FUNC__ \
01589      || defined __cplusplus || defined _MSC_VER)
01590 static void
01591 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
01592 #else
01593 static void
01594 yydestruct (yymsg, yytype, yyvaluep)
01595     const char *yymsg;
01596     int yytype;
01597     YYSTYPE *yyvaluep;
01598 #endif
01599 {
01600   YYUSE (yyvaluep);
01601 
01602   if (!yymsg)
01603     yymsg = "Deleting";
01604   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
01605 
01606   switch (yytype)
01607     {
01608 
01609       default:
01610         break;
01611     }
01612 }
01613 
01614 
01615 /* Prevent warnings from -Wmissing-prototypes.  */
01616 
01617 #ifdef YYPARSE_PARAM
01618 #if defined __STDC__ || defined __cplusplus
01619 int yyparse (void *YYPARSE_PARAM);
01620 #else
01621 int yyparse ();
01622 #endif
01623 #else /* ! YYPARSE_PARAM */
01624 #if defined __STDC__ || defined __cplusplus
01625 int yyparse (void);
01626 #else
01627 int yyparse ();
01628 #endif
01629 #endif /* ! YYPARSE_PARAM */
01630 
01631 
01632 
01633 /* The look-ahead symbol.  */
01634 int yychar;
01635 
01636 /* The semantic value of the look-ahead symbol.  */
01637 YYSTYPE yylval;
01638 
01639 /* Number of syntax errors so far.  */
01640 int yynerrs;
01641 
01642 
01643 
01644 /*----------.
01645 | yyparse.  |
01646 `----------*/
01647 
01648 #ifdef YYPARSE_PARAM
01649 #if (defined __STDC__ || defined __C99__FUNC__ \
01650      || defined __cplusplus || defined _MSC_VER)
01651 int
01652 yyparse (void *YYPARSE_PARAM)
01653 #else
01654 int
01655 yyparse (YYPARSE_PARAM)
01656     void *YYPARSE_PARAM;
01657 #endif
01658 #else /* ! YYPARSE_PARAM */
01659 #if (defined __STDC__ || defined __C99__FUNC__ \
01660      || defined __cplusplus || defined _MSC_VER)
01661 int
01662 yyparse (void)
01663 #else
01664 int
01665 yyparse ()
01666 
01667 #endif
01668 #endif
01669 {
01670   
01671   int yystate;
01672   int yyn;
01673   int yyresult;
01674   /* Number of tokens to shift before error messages enabled.  */
01675   int yyerrstatus;
01676   /* Look-ahead token as an internal (translated) token number.  */
01677   int yytoken = 0;
01678 #if YYERROR_VERBOSE
01679   /* Buffer for error messages, and its allocated size.  */
01680   char yymsgbuf[128];
01681   char *yymsg = yymsgbuf;
01682   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
01683 #endif
01684 
01685   /* Three stacks and their tools:
01686      `yyss': related to states,
01687      `yyvs': related to semantic values,
01688      `yyls': related to locations.
01689 
01690      Refer to the stacks thru separate pointers, to allow yyoverflow
01691      to reallocate them elsewhere.  */
01692 
01693   /* The state stack.  */
01694   yytype_int16 yyssa[YYINITDEPTH];
01695   yytype_int16 *yyss = yyssa;
01696   yytype_int16 *yyssp;
01697 
01698   /* The semantic value stack.  */
01699   YYSTYPE yyvsa[YYINITDEPTH];
01700   YYSTYPE *yyvs = yyvsa;
01701   YYSTYPE *yyvsp;
01702 
01703 
01704 
01705 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
01706 
01707   YYSIZE_T yystacksize = YYINITDEPTH;
01708 
01709   /* The variables used to return semantic value and location from the
01710      action routines.  */
01711   YYSTYPE yyval;
01712 
01713 
01714   /* The number of symbols on the RHS of the reduced rule.
01715      Keep to zero when no symbol should be popped.  */
01716   int yylen = 0;
01717 
01718   YYDPRINTF ((stderr, "Starting parse\n"));
01719 
01720   yystate = 0;
01721   yyerrstatus = 0;
01722   yynerrs = 0;
01723   yychar = YYEMPTY;             /* Cause a token to be read.  */
01724 
01725   /* Initialize stack pointers.
01726      Waste one element of value and location stack
01727      so that they stay on the same level as the state stack.
01728      The wasted elements are never initialized.  */
01729 
01730   yyssp = yyss;
01731   yyvsp = yyvs;
01732 
01733   goto yysetstate;
01734 
01735 /*------------------------------------------------------------.
01736 | yynewstate -- Push a new state, which is found in yystate.  |
01737 `------------------------------------------------------------*/
01738  yynewstate:
01739   /* In all cases, when you get here, the value and location stacks
01740      have just been pushed.  So pushing a state here evens the stacks.  */
01741   yyssp++;
01742 
01743  yysetstate:
01744   *yyssp = yystate;
01745 
01746   if (yyss + yystacksize - 1 <= yyssp)
01747     {
01748       /* Get the current used size of the three stacks, in elements.  */
01749       YYSIZE_T yysize = yyssp - yyss + 1;
01750 
01751 #ifdef yyoverflow
01752       {
01753         /* Give user a chance to reallocate the stack.  Use copies of
01754            these so that the &'s don't force the real ones into
01755            memory.  */
01756         YYSTYPE *yyvs1 = yyvs;
01757         yytype_int16 *yyss1 = yyss;
01758 
01759 
01760         /* Each stack pointer address is followed by the size of the
01761            data in use in that stack, in bytes.  This used to be a
01762            conditional around just the two extra args, but that might
01763            be undefined if yyoverflow is a macro.  */
01764         yyoverflow (YY_("memory exhausted"),
01765                     &yyss1, yysize * sizeof (*yyssp),
01766                     &yyvs1, yysize * sizeof (*yyvsp),
01767 
01768                     &yystacksize);
01769 
01770         yyss = yyss1;
01771         yyvs = yyvs1;
01772       }
01773 #else /* no yyoverflow */
01774 # ifndef YYSTACK_RELOCATE
01775       goto yyexhaustedlab;
01776 # else
01777       /* Extend the stack our own way.  */
01778       if (YYMAXDEPTH <= yystacksize)
01779         goto yyexhaustedlab;
01780       yystacksize *= 2;
01781       if (YYMAXDEPTH < yystacksize)
01782         yystacksize = YYMAXDEPTH;
01783 
01784       {
01785         yytype_int16 *yyss1 = yyss;
01786         union yyalloc *yyptr =
01787           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
01788         if (! yyptr)
01789           goto yyexhaustedlab;
01790         YYSTACK_RELOCATE (yyss);
01791         YYSTACK_RELOCATE (yyvs);
01792 
01793 #  undef YYSTACK_RELOCATE
01794         if (yyss1 != yyssa)
01795           YYSTACK_FREE (yyss1);
01796       }
01797 # endif
01798 #endif /* no yyoverflow */
01799 
01800       yyssp = yyss + yysize - 1;
01801       yyvsp = yyvs + yysize - 1;
01802 
01803 
01804       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
01805                   (unsigned long int) yystacksize));
01806 
01807       if (yyss + yystacksize - 1 <= yyssp)
01808         YYABORT;
01809     }
01810 
01811   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
01812 
01813   goto yybackup;
01814 
01815 /*-----------.
01816 | yybackup.  |
01817 `-----------*/
01818 yybackup:
01819 
01820   /* Do appropriate processing given the current state.  Read a
01821      look-ahead token if we need one and don't already have one.  */
01822 
01823   /* First try to decide what to do without reference to look-ahead token.  */
01824   yyn = yypact[yystate];
01825   if (yyn == YYPACT_NINF)
01826     goto yydefault;
01827 
01828   /* Not known => get a look-ahead token if don't already have one.  */
01829 
01830   /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
01831   if (yychar == YYEMPTY)
01832     {
01833       YYDPRINTF ((stderr, "Reading a token: "));
01834       yychar = YYLEX;
01835     }
01836 
01837   if (yychar <= YYEOF)
01838     {
01839       yychar = yytoken = YYEOF;
01840       YYDPRINTF ((stderr, "Now at end of input.\n"));
01841     }
01842   else
01843     {
01844       yytoken = YYTRANSLATE (yychar);
01845       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
01846     }
01847 
01848   /* If the proper action on seeing token YYTOKEN is to reduce or to
01849      detect an error, take that action.  */
01850   yyn += yytoken;
01851   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
01852     goto yydefault;
01853   yyn = yytable[yyn];
01854   if (yyn <= 0)
01855     {
01856       if (yyn == 0 || yyn == YYTABLE_NINF)
01857         goto yyerrlab;
01858       yyn = -yyn;
01859       goto yyreduce;
01860     }
01861 
01862   if (yyn == YYFINAL)
01863     YYACCEPT;
01864 
01865   /* Count tokens shifted since error; after three, turn off error
01866      status.  */
01867   if (yyerrstatus)
01868     yyerrstatus--;
01869 
01870   /* Shift the look-ahead token.  */
01871   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
01872 
01873   /* Discard the shifted token unless it is eof.  */
01874   if (yychar != YYEOF)
01875     yychar = YYEMPTY;
01876 
01877   yystate = yyn;
01878   *++yyvsp = yylval;
01879 
01880   goto yynewstate;
01881 
01882 
01883 /*-----------------------------------------------------------.
01884 | yydefault -- do the default action for the current state.  |
01885 `-----------------------------------------------------------*/
01886 yydefault:
01887   yyn = yydefact[yystate];
01888   if (yyn == 0)
01889     goto yyerrlab;
01890   goto yyreduce;
01891 
01892 
01893 /*-----------------------------.
01894 | yyreduce -- Do a reduction.  |
01895 `-----------------------------*/
01896 yyreduce:
01897   /* yyn is the number of a rule to reduce with.  */
01898   yylen = yyr2[yyn];
01899 
01900   /* If YYLEN is nonzero, implement the default value of the action:
01901      `$$ = $1'.
01902 
01903      Otherwise, the following line sets YYVAL to garbage.
01904      This behavior is undocumented and Bison
01905      users should not rely upon it.  Assigning to YYVAL
01906      unconditionally makes the parser a bit smaller, and it avoids a
01907      GCC warning that YYVAL may be used uninitialized.  */
01908   yyval = yyvsp[1-yylen];
01909 
01910 
01911   YY_REDUCE_PRINT (yyn);
01912   switch (yyn)
01913     {
01914         case 2:
01915 #line 561 "../../lib/common/htmlparse.y"
01916     { HTMLstate.lbl = mkLabel((yyvsp[(2) - (3)].txt),HTML_TEXT); }
01917     break;
01918 
01919   case 3:
01920 #line 562 "../../lib/common/htmlparse.y"
01921     { HTMLstate.lbl = mkLabel((yyvsp[(2) - (3)].tbl),HTML_TBL); }
01922     break;
01923 
01924   case 4:
01925 #line 563 "../../lib/common/htmlparse.y"
01926     { cleanup(); YYABORT; }
01927     break;
01928 
01929   case 5:
01930 #line 566 "../../lib/common/htmlparse.y"
01931     { (yyval.txt) = mkText(); }
01932     break;
01933 
01934   case 8:
01935 #line 573 "../../lib/common/htmlparse.y"
01936     { appendFItemList(HTMLstate.str);}
01937     break;
01938 
01939   case 9:
01940 #line 574 "../../lib/common/htmlparse.y"
01941     {appendFLineList((yyvsp[(1) - (1)].i));}
01942     break;
01943 
01944   case 11:
01945 #line 578 "../../lib/common/htmlparse.y"
01946     { pushFont ((yyvsp[(1) - (1)].font)); }
01947     break;
01948 
01949   case 12:
01950 #line 581 "../../lib/common/htmlparse.y"
01951     { popFont (); }
01952     break;
01953 
01954   case 13:
01955 #line 584 "../../lib/common/htmlparse.y"
01956     { (yyval.i) = (yyvsp[(1) - (2)].i); }
01957     break;
01958 
01959   case 14:
01960 #line 585 "../../lib/common/htmlparse.y"
01961     { (yyval.i) = (yyvsp[(1) - (1)].i); }
01962     break;
01963 
01964   case 17:
01965 #line 592 "../../lib/common/htmlparse.y"
01966     { 
01967           if (nonSpace(agxbuse(HTMLstate.str))) {
01968             yyerror ("Syntax error: non-space string used before <TABLE>");
01969             cleanup(); YYABORT;
01970           }
01971           (yyvsp[(2) - (2)].tbl)->u.p.prev = HTMLstate.tblstack;
01972           (yyvsp[(2) - (2)].tbl)->u.p.rows = dtopen(&rowDisc, Dtqueue);
01973           HTMLstate.tblstack = (yyvsp[(2) - (2)].tbl);
01974           (yyvsp[(2) - (2)].tbl)->font = dupFont (HTMLstate.fontstack->cfont);
01975           (yyval.tbl) = (yyvsp[(2) - (2)].tbl);
01976         }
01977     break;
01978 
01979   case 18:
01980 #line 603 "../../lib/common/htmlparse.y"
01981     {
01982           if (nonSpace(agxbuse(HTMLstate.str))) {
01983             yyerror ("Syntax error: non-space string used after </TABLE>");
01984             cleanup(); YYABORT;
01985           }
01986           (yyval.tbl) = HTMLstate.tblstack;
01987           HTMLstate.tblstack = HTMLstate.tblstack->u.p.prev;
01988         }
01989     break;
01990 
01991   case 19:
01992 #line 613 "../../lib/common/htmlparse.y"
01993     { (yyval.tbl) = (yyvsp[(1) - (1)].tbl); }
01994     break;
01995 
01996   case 20:
01997 #line 614 "../../lib/common/htmlparse.y"
01998     { (yyval.tbl)=(yyvsp[(2) - (3)].tbl); }
01999     break;
02000 
02001   case 25:
02002 #line 625 "../../lib/common/htmlparse.y"
02003     { addRow (); }
02004     break;
02005 
02006   case 29:
02007 #line 632 "../../lib/common/htmlparse.y"
02008     { setCell((yyvsp[(1) - (2)].cell),(yyvsp[(2) - (2)].tbl),HTML_TBL); }
02009     break;
02010 
02011   case 31:
02012 #line 633 "../../lib/common/htmlparse.y"
02013     { setCell((yyvsp[(1) - (2)].cell),(yyvsp[(2) - (2)].txt),HTML_TEXT); }
02014     break;
02015 
02016   case 33:
02017 #line 634 "../../lib/common/htmlparse.y"
02018     { setCell((yyvsp[(1) - (2)].cell),(yyvsp[(2) - (2)].img),HTML_IMAGE); }
02019     break;
02020 
02021   case 35:
02022 #line 635 "../../lib/common/htmlparse.y"
02023     { setCell((yyvsp[(1) - (1)].cell),mkText(),HTML_TEXT); }
02024     break;
02025 
02026   case 37:
02027 #line 638 "../../lib/common/htmlparse.y"
02028     { (yyval.img) = (yyvsp[(1) - (2)].img); }
02029     break;
02030 
02031   case 38:
02032 #line 639 "../../lib/common/htmlparse.y"
02033     { (yyval.img) = (yyvsp[(1) - (1)].img); }
02034     break;
02035 
02036 
02037 /* Line 1267 of yacc.c.  */
02038 #line 2039 "y.tab.c"
02039       default: break;
02040     }
02041   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
02042 
02043   YYPOPSTACK (yylen);
02044   yylen = 0;
02045   YY_STACK_PRINT (yyss, yyssp);
02046 
02047   *++yyvsp = yyval;
02048 
02049 
02050   /* Now `shift' the result of the reduction.  Determine what state
02051      that goes to, based on the state we popped back to and the rule
02052      number reduced by.  */
02053 
02054   yyn = yyr1[yyn];
02055 
02056   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
02057   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
02058     yystate = yytable[yystate];
02059   else
02060     yystate = yydefgoto[yyn - YYNTOKENS];
02061 
02062   goto yynewstate;
02063 
02064 
02065 /*------------------------------------.
02066 | yyerrlab -- here on detecting error |
02067 `------------------------------------*/
02068 yyerrlab:
02069   /* If not already recovering from an error, report this error.  */
02070   if (!yyerrstatus)
02071     {
02072       ++yynerrs;
02073 #if ! YYERROR_VERBOSE
02074       yyerror (YY_("syntax error"));
02075 #else
02076       {
02077         YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
02078         if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
02079           {
02080             YYSIZE_T yyalloc = 2 * yysize;
02081             if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
02082               yyalloc = YYSTACK_ALLOC_MAXIMUM;
02083             if (yymsg != yymsgbuf)
02084               YYSTACK_FREE (yymsg);
02085             yymsg = (char *) YYSTACK_ALLOC (yyalloc);
02086             if (yymsg)
02087               yymsg_alloc = yyalloc;
02088             else
02089               {
02090                 yymsg = yymsgbuf;
02091                 yymsg_alloc = sizeof yymsgbuf;
02092               }
02093           }
02094 
02095         if (0 < yysize && yysize <= yymsg_alloc)
02096           {
02097             (void) yysyntax_error (yymsg, yystate, yychar);
02098             yyerror (yymsg);
02099           }
02100         else
02101           {
02102             yyerror (YY_("syntax error"));
02103             if (yysize != 0)
02104               goto yyexhaustedlab;
02105           }
02106       }
02107 #endif
02108     }
02109 
02110 
02111 
02112   if (yyerrstatus == 3)
02113     {
02114       /* If just tried and failed to reuse look-ahead token after an
02115          error, discard it.  */
02116 
02117       if (yychar <= YYEOF)
02118         {
02119           /* Return failure if at end of input.  */
02120           if (yychar == YYEOF)
02121             YYABORT;
02122         }
02123       else
02124         {
02125           yydestruct ("Error: discarding",
02126                       yytoken, &yylval);
02127           yychar = YYEMPTY;
02128         }
02129     }
02130 
02131   /* Else will try to reuse look-ahead token after shifting the error
02132      token.  */
02133   goto yyerrlab1;
02134 
02135 
02136 /*---------------------------------------------------.
02137 | yyerrorlab -- error raised explicitly by YYERROR.  |
02138 `---------------------------------------------------*/
02139 yyerrorlab:
02140 
02141   /* Pacify compilers like GCC when the user code never invokes
02142      YYERROR and the label yyerrorlab therefore never appears in user
02143      code.  */
02144   if (/*CONSTCOND*/ 0)
02145      goto yyerrorlab;
02146 
02147   /* Do not reclaim the symbols of the rule which action triggered
02148      this YYERROR.  */
02149   YYPOPSTACK (yylen);
02150   yylen = 0;
02151   YY_STACK_PRINT (yyss, yyssp);
02152   yystate = *yyssp;
02153   goto yyerrlab1;
02154 
02155 
02156 /*-------------------------------------------------------------.
02157 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
02158 `-------------------------------------------------------------*/
02159 yyerrlab1:
02160   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
02161 
02162   for (;;)
02163     {
02164       yyn = yypact[yystate];
02165       if (yyn != YYPACT_NINF)
02166         {
02167           yyn += YYTERROR;
02168           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
02169             {
02170               yyn = yytable[yyn];
02171               if (0 < yyn)
02172                 break;
02173             }
02174         }
02175 
02176       /* Pop the current state because it cannot handle the error token.  */
02177       if (yyssp == yyss)
02178         YYABORT;
02179 
02180 
02181       yydestruct ("Error: popping",
02182                   yystos[yystate], yyvsp);
02183       YYPOPSTACK (1);
02184       yystate = *yyssp;
02185       YY_STACK_PRINT (yyss, yyssp);
02186     }
02187 
02188   if (yyn == YYFINAL)
02189     YYACCEPT;
02190 
02191   *++yyvsp = yylval;
02192 
02193 
02194   /* Shift the error token.  */
02195   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
02196 
02197   yystate = yyn;
02198   goto yynewstate;
02199 
02200 
02201 /*-------------------------------------.
02202 | yyacceptlab -- YYACCEPT comes here.  |
02203 `-------------------------------------*/
02204 yyacceptlab:
02205   yyresult = 0;
02206   goto yyreturn;
02207 
02208 /*-----------------------------------.
02209 | yyabortlab -- YYABORT comes here.  |
02210 `-----------------------------------*/
02211 yyabortlab:
02212   yyresult = 1;
02213   goto yyreturn;
02214 
02215 #ifndef yyoverflow
02216 /*-------------------------------------------------.
02217 | yyexhaustedlab -- memory exhaustion comes here.  |
02218 `-------------------------------------------------*/
02219 yyexhaustedlab:
02220   yyerror (YY_("memory exhausted"));
02221   yyresult = 2;
02222   /* Fall through.  */
02223 #endif
02224 
02225 yyreturn:
02226   if (yychar != YYEOF && yychar != YYEMPTY)
02227      yydestruct ("Cleanup: discarding lookahead",
02228                  yytoken, &yylval);
02229   /* Do not reclaim the symbols of the rule which action triggered
02230      this YYABORT or YYACCEPT.  */
02231   YYPOPSTACK (yylen);
02232   YY_STACK_PRINT (yyss, yyssp);
02233   while (yyssp != yyss)
02234     {
02235       yydestruct ("Cleanup: popping",
02236                   yystos[*yyssp], yyvsp);
02237       YYPOPSTACK (1);
02238     }
02239 #ifndef yyoverflow
02240   if (yyss != yyssa)
02241     YYSTACK_FREE (yyss);
02242 #endif
02243 #if YYERROR_VERBOSE
02244   if (yymsg != yymsgbuf)
02245     YYSTACK_FREE (yymsg);
02246 #endif
02247   /* Make sure YYID is used.  */
02248   return YYID (yyresult);
02249 }
02250 
02251 
02252 #line 642 "../../lib/common/htmlparse.y"
02253 
02254 
02255 #ifdef OLD
02256 htmllabel_t*
02257 simpleHTML (char* txt)
02258 {
02259   htmltxt_t*   tobj = mkText (txt);
02260   htmllabel_t* l = mkLabel(tobj,HTML_TEXT);
02261   return l;
02262 }
02263 #endif
02264 
02265 /* parseHTML:
02266  * Return parsed label or NULL if failure.
02267  * Set warn to 0 on success; 1 for warning message; 2 if no expat.
02268  */
02269 htmllabel_t*
02270 parseHTML (char* txt, int* warn, int charset)
02271 {
02272   unsigned char buf[SMALLBUF];
02273   agxbuf        str;
02274   htmllabel_t*  l;
02275   sfont_t       dfltf;
02276 
02277   dfltf.cfont = NULL;
02278   dfltf.pfont = NULL;
02279   HTMLstate.fontstack = &dfltf;
02280   HTMLstate.tblstack = 0;
02281   HTMLstate.lbl = 0;
02282   HTMLstate.fitemList = dtopen(&fstrDisc, Dtqueue);
02283   HTMLstate.fparaList = dtopen(&fparaDisc, Dtqueue);
02284 
02285   agxbinit (&str, SMALLBUF, buf);
02286   HTMLstate.str = &str;
02287   
02288   if (initHTMLlexer (txt, &str, charset)) {/* failed: no libexpat - give up */
02289     *warn = 2;
02290     l = NULL;
02291   }
02292   else {
02293     yyparse();
02294     *warn = clearHTMLlexer ();
02295     l = HTMLstate.lbl;
02296   }
02297 
02298   dtclose (HTMLstate.fitemList);
02299   dtclose (HTMLstate.fparaList);
02300   
02301   HTMLstate.fitemList = NULL;
02302   HTMLstate.fparaList = NULL;
02303   HTMLstate.fontstack = NULL;
02304   
02305   agxbfree (&str);
02306 
02307   return l;
02308 }
02309 
02310 

Generated on Mon Mar 31 19:03:25 2008 for Graphviz by  doxygen 1.5.1