TIVI-153: Add as dependency for iputils
[profile/ivi/opensp.git] / include / ParserApp.h
1 // Copyright (c) 1996 James Clark
2 // See the file COPYING for copying permission.
3
4 #ifndef ParserApp_INCLUDED
5 #define ParserApp_INCLUDED 1
6
7 #ifdef __GNUG__
8 #pragma interface
9 #endif
10
11 #include "SgmlParser.h"
12 #include "ParserOptions.h"
13 #include "EntityApp.h"
14 #include "StringC.h"
15 #include "ErrorCountEventHandler.h"
16
17 #ifdef SP_NAMESPACE
18 namespace SP_NAMESPACE {
19 #endif
20
21 class SP_API ParserApp : public EntityApp {
22 public:
23   ParserApp(const char *requiredInternalCode = 0);
24   void processOption(AppChar opt, const AppChar *arg);
25   int processSysid(const StringC &);
26   virtual ErrorCountEventHandler *makeEventHandler() = 0;
27   Boolean enableWarning(const AppChar *s);
28   void initParser(const StringC &sysid);
29   SgmlParser &parser();
30   // This calls the ArcEngine if the options have enabled that.
31   void parseAll(SgmlParser &, EventHandler &,
32                 const volatile sig_atomic_t *cancelPtr);
33   virtual void allLinkTypesActivated();
34 protected:
35   virtual int generateEvents(ErrorCountEventHandler *);
36   ParserOptions options_;
37   SgmlParser parser_;
38   unsigned errorLimit_;
39   Vector<StringC> arcNames_;
40   Vector<const AppChar *> activeLinkTypes_;
41 };
42
43 inline
44 SgmlParser &ParserApp::parser()
45 {
46   return parser_;
47 }
48
49 #ifdef SP_NAMESPACE
50 }
51 #endif
52
53 #endif /* not ParserApp_INCLUDED */