Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
1 // Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // contains the parser specialisation (BNF grammar) for a DTD parser.
15 // See CBNFParser for function details
19 #ifndef __CDTDMODEL_H__
20 #define __CDTDMODEL_H__
23 #include <cbnfparser.h>
24 #include <crulemarkedstack.h>
26 //##ModelId=3B666BCB001C
30 class CDTDModel : public CBNFParser
31 /** Creates a tree that represents a specified DTD.
35 1. call the base class function ProcessDataL() with the filename of the DTD, and call CommitL()
37 2. call GeneratedTree() to get the tree
44 class CDTDElementAttribute : public CBase
45 /** Represents an attribute of a DTD element. */
48 /** DTD element attribute value types. */
51 /** Attribute supplies a default. */
53 /** Attribute is #REQUIRED. */
55 /** Attribute is #IMPLIED. */
57 /** Attribute is #FIXED. */
59 /** Attribute is a reference. */
66 virtual ~CDTDElementAttribute()
73 /** Node that specifies the attribute type. */
75 /** Node that specifies the attribute value. */
77 /** Attribute value type. */
78 KValueType iValueType;
89 //##ModelId=3B666BCB0321
90 IMPORT_C static CDTDModel* NewL(CAttributeLookupTable& aLUT);
91 //##ModelId=3B666BCB0320
92 IMPORT_C virtual ~CDTDModel();
94 // This method MUST be invoked before data can be processed by the parser.
95 //##ModelId=3B666BCB031F
96 IMPORT_C virtual void ResetL();
98 //##ModelId=3B666BCB0315
99 IMPORT_C CBNFNode* GeneratedTree();
101 // Building method for a hard coded WML1.1 DTD tree
103 // aPackageRoot - A root node to which the generated tree is attached
105 //##ModelId=3B666BCB030B
106 IMPORT_C void BuildWml11DTDL(CBNFNode& aPackageRootNode);
109 IMPORT_C CDTDModel(CAttributeLookupTable& aLUT);
111 // construct our BNF rule tree
112 //##ModelId=3B666BCB0302
113 IMPORT_C virtual CBNFNode* TreeL();
115 // to control our internal state on conditional rules.
116 //##ModelId=3B666BCB02F7
117 IMPORT_C virtual void StartConditional(TParserNodeTypes aRuleType);
118 //##ModelId=3B666BCB02E3
119 IMPORT_C virtual void EndConditional(TParserNodeTypes aRuleType, TBool aSuccess);
121 // rule callbacks to build the DTD Tree
122 //##ModelId=3B666BCB02D9
123 static void PreRulesL(CBNFParser& aParser);
124 //##ModelId=3B666BCB02CF
125 static void PostRulesL(CBNFParser& aParser);
126 //##ModelId=3B666BCB02C5
127 static void PreElementDeclL(CBNFParser& aParser);
128 //##ModelId=3B666BCB02B1
129 static void PostElementDeclL(CBNFParser& aParser);
130 //##ModelId=3B666BCB02A7
131 static void PreEntityDeclL(CBNFParser& aParser);
132 //##ModelId=3B666BCB0294
133 static void PostEntityDeclL(CBNFParser& aParser);
134 //##ModelId=3B666BCB0289
135 static void PreAttlistLineL(CBNFParser& aParser);
136 //##ModelId=3B666BCB027F
137 static void PostAttlistLineL(CBNFParser& aParser);
138 //##ModelId=3B666BCB0275
139 static void PostAttlistReferenceL(CBNFParser& aParser);
140 //##ModelId=3B666BCB026B
141 static void PreAttValueL(CBNFParser& aParser);
142 //##ModelId=3B666BCB0261
143 static void PostAttValueL(CBNFParser& aParser);
144 //##ModelId=3B666BCB024E
145 static void PostRequiredL(CBNFParser& aParser);
146 //##ModelId=3B666BCB0243
147 static void PostFixedL(CBNFParser& aParser);
148 //##ModelId=3B666BCB0239
149 static void PostImpliedL(CBNFParser& aParser);
150 //##ModelId=3B666BCB022F
151 static void PostAndL(CBNFParser& aParser);
152 //##ModelId=3B666BCB0225
153 static void PostOrL(CBNFParser& aParser);
154 //##ModelId=3B666BCB021B
155 static void PreGroupL(CBNFParser& aParser);
156 //##ModelId=3B666BCB0208
157 static void PostGroupL(CBNFParser& aParser);
158 //##ModelId=3B666BCB01FD
159 static void PostMatch0PlusL(CBNFParser& aParser);
160 //##ModelId=3B666BCB01F3
161 static void PostMatch1PlusL(CBNFParser& aParser);
162 //##ModelId=3B666BCB01E9
163 static void PostOptionalL(CBNFParser& aParser);
164 //##ModelId=3B666BCB01DF
165 static void PostIdentifierL(CBNFParser& aParser);
166 //##ModelId=3B666BCB01CC
167 static void PostEntityDeclNameL(CBNFParser& aParser);
168 //##ModelId=3B666BCB01C1
169 static void PostElementDeclNameL(CBNFParser& aParser);
170 //##ModelId=3B666BCB01B7
171 static void PostAttlistDeclNameL(CBNFParser& aParser);
172 //##ModelId=3B666BCB01AD
173 static void PostAttfieldNameL(CBNFParser& aParser);
174 //##ModelId=3B666BCB01A3
175 static void PostReferenceNameL(CBNFParser& aParser);
176 //##ModelId=3B666BCB0199
177 static void PostStringL(CBNFParser& aParser);
178 //##ModelId=3B666BCB0186
179 static void PostValidHexCharL(CBNFParser& aParser);
180 //##ModelId=3B666BCB017B
181 static void PostValidDecCharL(CBNFParser& aParser);
182 //##ModelId=3B666BCB0171
183 static void PrePEDeclL(CBNFParser& aParser);
184 //##ModelId=3B666BCB0167
185 static void PostPEDeclL(CBNFParser& aParser);
186 //##ModelId=3B666BCB015D
187 static void PostGEDeclL(CBNFParser& aParser);
188 //##ModelId=3B666BCB0153
189 static void PreGEContentL(CBNFParser& aParser);
190 //##ModelId=3B666BCB0149
191 static void PostGEContentL(CBNFParser& aParser);
194 //##ModelId=3B666BCB0135
195 static void PostValidCharL(CBNFParser& aParser, TRadix aRadix);
196 //##ModelId=3B666BCB0117
197 static void PostRuleL(CBNFParser& aParser, TParserNodeTypes aType, const TDesC* aAttribute);
199 //##ModelId=3B666BCB0104
200 void CharRefReplacement(TPtr& aString);
202 //##ModelId=3B666BCB0103
205 // Help methods for the hardcoded WML 1.1 tree
206 //##ModelId=3B666BCB00DB
207 void AddNewAttributeL(CBNFNode& aNode, const TDesC* aAttributeId, const TDesC& aAttributeType, CDTDElementAttribute::KValueType aAttributeValueType, CBNFNode* aRootNode);
208 //##ModelId=3B666BCB00BD
209 void AddNewReferenceAttributeL(CBNFNode& aNode, const TDesC& aAttributeType, CBNFNode* aRootNode);
210 //##ModelId=3B666BCB0095
211 void AddNewAttributeWithValueL(CBNFNode& aNode, const TDesC* aAttributeId, const TDesC& aAttributeType, const TDesC& aAttributeDefaultValue, CBNFNode* aRootNode);
215 typedef CRuleMarkedStack<ETrue> COwnerRuleMarkedStack;
218 //##ModelId=3B666BCB008B
220 //##ModelId=3B666BCB0078
222 //##ModelId=3B666BCB006E
225 //##ModelId=3B666BCB0064
226 HBufC* iNewAttfieldName;
227 //##ModelId=3B666BCB005A
228 CDTDElementAttribute* iNewElementAttribute;
229 //##ModelId=3B666BCB0046
231 //##ModelId=3B666BCB003C
233 //##ModelId=3B666BCB0030
234 COwnerRuleMarkedStack iNewRuleStack;
237 #endif // __CDTDMODEL_H__