Develop and Download Open Source Software

Browse CVS Repository

Contents of /tombo/Tombo/Src/TSParser.h

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.4 - (show annotations) (download) (as text)
Fri Aug 25 14:58:15 2006 UTC (17 years, 7 months ago) by hirami
Branch: MAIN
CVS Tags: Tombo_2_0b2, Tombo_2_0b3, Tombo_2_0b1, Tombo_2_0b4, B228, B229, B226, B227, B224, B225, B223, B231, B230, HEAD
Changes since 1.3: +2 -1 lines
File MIME type: text/x-chdr
- Migrate VC6 to VisualStudio2005 (win32).
- replace expat libs (win32).

1 #ifndef TSCOMPILER_H
2 #define TSCOMPILER_H
3
4 #include <expat.h>
5 class MemoSelectView;
6 class ParseInfo;
7 class VFStream;
8 class TreeViewVirtualFolder;
9 class VirtualFolderEnumListener;
10
11 ////////////////////////////////////
12 // TOMBO script parser
13 ////////////////////////////////////
14
15 class TSParser {
16 public:
17 TSParser();
18 ~TSParser();
19
20 BOOL Parse(LPCTSTR pFileName, VirtualFolderEnumListener *pListener);
21 };
22
23 ///////////////////////////////////////
24 // XML TAG abstruction
25 ///////////////////////////////////////
26
27 class TSParseTagItem {
28 protected:
29 DWORD nTagID;
30 TSParseTagItem *pNext;
31
32 public:
33 VFStream *pHead;
34 VFStream *pTail;
35
36 ////////////////////////
37 // ctor & dtor
38
39 TSParseTagItem(DWORD nID) : nTagID(nID), pHead(NULL), pTail(NULL) {}
40 virtual ~TSParseTagItem();
41
42 ////////////////////////
43 // accessor & mutator
44
45 DWORD GetTagID() { return nTagID; }
46
47 ////////////////////////
48 // tag chain operation
49
50 void SetNext(TSParseTagItem *p) { pNext = p; }
51 TSParseTagItem *GetNext() { return pNext; }
52
53 ////////////////////////
54 // Start element
55 virtual BOOL StartElement(ParseInfo *p, const XML_Char **atts);
56
57 ////////////////////////
58 // End element
59 virtual BOOL EndElement(ParseInfo *p);
60 };
61
62 ///////////////////////////////////////
63 // XML Parser helper
64 ///////////////////////////////////////
65
66 class ParseInfo {
67 BOOL bError;
68 TSParseTagItem *pTop;
69 public:
70 ////////////////////////
71 // ctor & dtor
72
73 ParseInfo() : bError(FALSE), pTop(NULL), pListener(NULL) {}
74 ~ParseInfo();
75 BOOL Init(VirtualFolderEnumListener *pLsnr);
76
77 ////////////////////////
78 // public vars
79 VirtualFolderEnumListener *pListener;
80
81 ////////////////////////
82 // Error info
83
84 BOOL IsError() { return bError; }
85 void SetError() { bError = TRUE; }
86
87 ////////////////////////
88 // check & get tag Object
89
90 DWORD GetTagID(const WCHAR *pTagName);
91 TSParseTagItem *GetTagObjectFactory(DWORD nTagID);
92
93 ////////////////////////
94 // Tag info operation
95
96 void Push(TSParseTagItem *p);
97 TSParseTagItem *Top() { return pTop; }
98 void Pop();
99
100 ////////////////////////
101 // Tag validation
102 BOOL IsValidParent(DWORD nTag);
103 };
104
105
106 #endif

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26