2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: DocParser.h /main/6 1996/06/11 17:06:11 cde-hal $ */
24 /* Copyright (c) 1995 FUJITSU LIMITED */
25 /* All Rights Reserved */
32 #include "Exceptions.hh"
38 // parse SGML like documents
40 // attributes follow elements in an olias section
43 // <#><attr_1>value</>
45 // <#olias_attr>value</>
52 class DocParser : public Destructable
55 enum TagType { StartTag, EndTag, AttributeSection, OliasAttribute, NoTag };
57 DocParser(Resolver &);
61 unsigned int parse(istream &);
63 // parse without calling Begin() and End() on the renderer.
64 unsigned int rawParse(istream &);
67 virtual void read_data(istream &, ostringstream &);
71 void process(istream &, ostringstream &, const Symbol &tagname,
72 unsigned int sibling_number,
73 unsigned int relative_sibling_number);
74 TagType read_tag(istream &, ostringstream &);
75 void process_entity(istream &, ostringstream &);
77 void process_attributes(istream &, ostringstream &,
78 AttributeList *&attrs,
79 AttributeList *&olias_attrs);
80 Attribute *process_attribute(istream &, ostringstream &, const Symbol &name, TagType);
83 unsigned int f_ignoring_element ;
89 stringbuf *f_streambuf;
90 ostringstream f_output;