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: SgmlParser.h /main/1 1996/07/29 17:04:16 cde-hp $ */
24 // Copyright (c) 1994 James Clark
25 // See the file COPYING for copying permission.
27 #ifndef SgmlParser_INCLUDED
28 #define SgmlParser_INCLUDED 1
37 #include "EntityManager.h"
42 namespace SP_NAMESPACE {
47 class UnivCharsetDesc;
50 template<class T> class Ptr;
51 template<class T> class ConstPtr;
52 class InputSourceOrigin;
57 class SP_API SgmlParser {
59 struct SP_API Params {
66 EntityType entityType; // defaults to document
67 StringC sysid; // must be specified
68 Ptr<InputSourceOrigin> origin;
69 Ptr<EntityManager> entityManager;
70 const UnivCharsetDesc *initialCharset;
71 const SgmlParser *parent;
73 ConstPtr<Syntax> prologSyntax;
74 ConstPtr<Syntax> instanceSyntax;
76 const ParserOptions *options;
77 PackedBoolean subdocInheritActiveLinkTypes;
78 // referenced subdocs count against SUBDOC limit in SGML declaration
79 PackedBoolean subdocReferenced;
82 SgmlParser(); // must call init
83 SgmlParser(const Params ¶ms);
84 void init(const Params ¶ms);
87 void parseAll(EventHandler &,
88 SP_CONST SP_VOLATILE sig_atomic_t *cancelPtr = 0);
89 ConstPtr<Sd> sd() const;
90 ConstPtr<Syntax> instanceSyntax() const;
91 ConstPtr<Syntax> prologSyntax() const;
92 const EntityManager &entityManager() const;
93 const EntityCatalog &entityCatalog() const;
94 const ParserOptions &options() const;
95 // Only to be called after the parse has ended.
97 void activateLinkType(const StringC &);
98 void allLinkTypesActivated();
99 void swap(SgmlParser &);
102 SgmlParser(const SgmlParser &);
103 void operator=(const SgmlParser &);
111 #endif /* not SgmlParser_INCLUDED */