/***************************************************************************/ /* * Portions Copyright (c) 1999 GMRS Software GmbH * Carl-von-Linde-Str. 38, D-85716 Unterschleissheim, http://www.gmrs.de * All rights reserved. * * Author: Arno Unkrig */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License in the file COPYING for more details. */ /***************************************************************************/ /* * Changes to version 1.2.2 were made by Martin Bayer * Dates and reasons of modifications: * Sun Apr 7 11:54:06 CEST 2002: Make some closing tags optional * Mon Jul 22 13:42:13 CEST 2002: Don't insert Paragraphs to other block elements * Mon Aug 12 17:14:57 CEST 2002: Make even more closing tags optional */ /***************************************************************************/ %name HTMLParser %define PURE %define DEBUG 1 %{ /* ------------------------------------------------------------------------- */ #ident "$Id: HTMLParser.y,v 1.14 1999/10/26 10:56:55 arno Exp $" #include "html.h" #include "HTMLParser.h" // MIPS machines don't have "alloca()", so disable stack realloc'ing. #ifdef mips #define yyoverflow yyerror("parser stack overflow"), (void) #endif /* ------------------------------------------------------------------------- */ %} /* ------------------------------------------------------------------------- */ %define LEX_BODY = 0 %define ERROR_BODY = 0 %define MEMBERS\ virtual ~HTMLParser(); \ virtual void process(const Document &) = 0;\ virtual bool read_cdata(const char *terminal, string *) = 0;\ int list_nesting; %define CONSTRUCTOR_INIT : list_nesting(0) %union { Document *document; Element *element; list > *element_list; PCData *pcdata; string *strinG; list *tag_attributes; int inT; list > *table_rows; list > *table_cells; ListItem *list_item; list > *list_items; Caption *caption; Heading *heading; list > *option_list; Option *option; DefinitionList *definition_list; list > *definition_list_item_list; TermName *term_name; TermDefinition *term_definition; Preformatted *preformatted; Address *address; list > > *tag_attributes_list; } %type document_ %type pcdata %type opt_pcdata %type body_content %type heading %type HX %type END_HX %type block %type block_except_p %type text %type texts %type opt_texts %type font %type phrase %type special %type form %type table_rows %type table_cells %type caption %type opt_caption %type applet_content %type definition_list %type definition_list_content %type term_name %type term_definition %type select_content %type