/xmlbench/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/xmlbench/trunk

« back to all changes in this revision

Viewing changes to parse/parabix.20090922/src/xml_error.h

  • Committer: Suren A. Chilingaryan
  • Date: 2009-09-23 17:13:04 UTC
  • Revision ID: csa@dside.dyndns.org-20090923171304-osvtr4zqb29h11kd
Intel, Tango, Phobos, and RapidXML parsers; Memory benchmark scripts

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  xml_error.h - Error codes for XML parsing/validation.
 
2
    Copyright (c) 2008, Robert D. Cameron and Dan Lin.
 
3
    Licensed to the public under the Open Software License 3.0.
 
4
    Licensed to International Characters, Inc., under the Academic
 
5
    Free License 3.0.
 
6
 
 
7
   The following enum provides codes for the well-formedness (wfErr)
 
8
   and validity (vErr) constraints of XML, based on the ids for those
 
9
   constraints in the REC-xml-20060816.xml document.  The ids may be
 
10
   recovered by stripping wfErr_ or vc_Err and substituting "-" for "_".
 
11
*/
 
12
#ifndef XML_ERROR_H
 
13
#define XML_ERROR_H
 
14
 
 
15
enum XML_Constraint {
 
16
                wfErr_wfc_PEinInternalSubset,
 
17
                wfErr_ExtSubset,
 
18
                wfErr_PE_between_Decls,
 
19
                wfErr_GIMatch,
 
20
                wfErr_uniqattspec,
 
21
                wfErr_NoExternalRefs,
 
22
                wfErr_CleanAttrVals,
 
23
                wfErr_wf_Legalchar,
 
24
                wfErr_wf_entdeclared,
 
25
                wfErr_textent,
 
26
                wfErr_norecursion,
 
27
                wfErr_indtd,
 
28
                vErr_vc_roottype,
 
29
                vErr_vc_PEinMarkupDecl,
 
30
                vErr_vc_check_rmd,
 
31
                vErr_elementvalid,
 
32
                vErr_ValueType,
 
33
                vErr_EDUnique,
 
34
                vErr_vc_PEinGroup,
 
35
                vErr_vc_MixedChildrenUnique,
 
36
                vErr_id,
 
37
                vErr_one_id_per_el,
 
38
                vErr_id_default,
 
39
                vErr_idref,
 
40
                vErr_entname,
 
41
                vErr_nmtok,
 
42
                vErr_notatn,
 
43
                vErr_OneNotationPer,
 
44
                vErr_NoNotationEmpty,
 
45
                vErr_NoDuplicateTokens,
 
46
                vErr_enum,
 
47
                vErr_RequiredAttr,
 
48
                vErr_defattrvalid,
 
49
                vErr_FixedAttr,
 
50
                vErr_condsec_nesting,
 
51
                vErr_vc_entdeclared,
 
52
                vErr_not_declared,
 
53
                vErr_UniqueNotationName};
 
54
 
 
55
const char * XML_Constraint_Strings[] = {
 
56
                "wfc-PEinInternalSubset",
 
57
                "ExtSubset",
 
58
                "PE-between-Decls",
 
59
                "GIMatch",
 
60
                "uniqattspec",
 
61
                "NoExternalRefs",
 
62
                "CleanAttrVals",
 
63
                "wf-Legalchar",
 
64
                "wf-entdeclared",
 
65
                "textent",
 
66
                "norecursion",
 
67
                "indtd",
 
68
                "vc-roottype",
 
69
                "vc-PEinMarkupDecl",
 
70
                "vc-check-rmd",
 
71
                "elementvalid",
 
72
                "ValueType",
 
73
                "EDUnique",
 
74
                "vc-PEinGroup",
 
75
                "vc-MixedChildrenUnique",
 
76
                "id",
 
77
                "one-id-per-el",
 
78
                "id-default",
 
79
                "idref",
 
80
                "entname",
 
81
                "nmtok",
 
82
                "notatn",
 
83
                "OneNotationPer",
 
84
                "NoNotationEmpty",
 
85
                "NoDuplicateTokens",
 
86
                "enum",
 
87
                "RequiredAttr",
 
88
                "defattrvalid",
 
89
                "FixedAttr",
 
90
                "condsec-nesting",
 
91
                "vc-entdeclared",
 
92
                "not-declared",
 
93
                "UniqueNotationName"};
 
94
 
 
95
/* The following enum provides codes for XML nonterminals using
 
96
   codes in the REC-xml-20060816.xml document.  The ids may be
 
97
   recovered by substituting "-" for "_".
 
98
*/
 
99
 
 
100
enum XML_NonTerminal {
 
101
                NT_document,
 
102
                NT_Char,
 
103
                NT_S,
 
104
                NT_NameChar,
 
105
                NT_Name,
 
106
                NT_Names,
 
107
                NT_Nmtoken,
 
108
                NT_Nmtokens,
 
109
                NT_EntityValue,
 
110
                NT_AttValue,
 
111
                NT_SystemLiteral,
 
112
                NT_PubidLiteral,
 
113
                NT_PubidChar,
 
114
                NT_CharData,
 
115
                NT_Comment,
 
116
                NT_PI,
 
117
                NT_PITarget,
 
118
                NT_CDSect,
 
119
                NT_CDStart,
 
120
                NT_CData,
 
121
                NT_CDEnd,
 
122
                NT_prolog,
 
123
                NT_XMLDecl,
 
124
                NT_VersionInfo,
 
125
                NT_Eq,
 
126
                NT_VersionNum,
 
127
                NT_Misc,
 
128
                NT_doctypedecl,
 
129
                NT_DeclSep,
 
130
                NT_intSubset,
 
131
                NT_markupdecl,
 
132
                NT_extSubset,
 
133
                NT_extSubsetDecl,
 
134
                NT_SDDecl,
 
135
                NT_element,
 
136
                NT_STag,
 
137
                NT_Attribute,
 
138
                NT_ETag,
 
139
                NT_content,
 
140
                NT_EmptyElemTag,
 
141
                NT_elementdecl,
 
142
                NT_contentspec,
 
143
                NT_children,
 
144
                NT_cp,
 
145
                NT_choice,
 
146
                NT_seq,
 
147
                NT_Mixed,
 
148
                NT_AttlistDecl,
 
149
                NT_AttDef,
 
150
                NT_AttType,
 
151
                NT_StringType,
 
152
                NT_TokenizedType,
 
153
                NT_EnumeratedType,
 
154
                NT_NotationType,
 
155
                NT_Enumeration,
 
156
                NT_DefaultDecl,
 
157
                NT_conditionalSect,
 
158
                NT_includeSect,
 
159
                NT_ignoreSect,
 
160
                NT_ignoreSectContents,
 
161
                NT_Ignore,
 
162
                NT_CharRef,
 
163
                NT_Reference,
 
164
                NT_EntityRef,
 
165
                NT_PEReference,
 
166
                NT_EntityDecl,
 
167
                NT_GEDecl,
 
168
                NT_PEDecl,
 
169
                NT_EntityDef,
 
170
                NT_PEDef,
 
171
                NT_ExternalID,
 
172
                NT_NDataDecl,
 
173
                NT_TextDecl,
 
174
                NT_extParsedEnt,
 
175
                NT_EncodingDecl,
 
176
                NT_EncName,
 
177
                NT_NotationDecl,
 
178
                NT_PublicID,
 
179
                NT_Letter,
 
180
                NT_BaseChar,
 
181
                NT_Ideographic,
 
182
                NT_CombiningChar,
 
183
                NT_Digit,
 
184
                NT_Extender};
 
185
 
 
186
const char * XML_NonTerminal_Names[] = {
 
187
                "document  [1]",
 
188
                "Char  [2]",
 
189
                "S  [3]",
 
190
                "NameChar  [4]",
 
191
                "Name  [5]",
 
192
                "Names  [6]",
 
193
                "Nmtoken  [7]",
 
194
                "Nmtokens  [8]",
 
195
                "EntityValue  [9]",
 
196
                "AttValue  [10]",
 
197
                "SystemLiteral  [11]",
 
198
                "PubidLiteral  [12]",
 
199
                "PubidChar  [13]",
 
200
                "CharData  [14]",
 
201
                "Comment  [15]",
 
202
                "PI  [16]",
 
203
                "PITarget  [17]",
 
204
                "CDSect  [18]",
 
205
                "CDStart  [19]",
 
206
                "CData  [20]",
 
207
                "CDEnd  [21]",
 
208
                "prolog  [22]",
 
209
                "XMLDecl  [23]",
 
210
                "VersionInfo  [24]",
 
211
                "Eq  [25]",
 
212
                "VersionNum  [26]",
 
213
                "Misc  [27]",
 
214
                "doctypedecl  [28]",
 
215
                "DeclSep  [28a]",
 
216
                "intSubset  [28b]",
 
217
                "markupdecl  [29]",
 
218
                "extSubset  [30]",
 
219
                "extSubsetDecl  [31]",
 
220
                "SDDecl  [32]",
 
221
                "element  [39]",
 
222
                "STag  [40]",
 
223
                "Attribute  [41]",
 
224
                "ETag  [42]",
 
225
                "content  [43]",
 
226
                "EmptyElemTag  [44]",
 
227
                "elementdecl  [45]",
 
228
                "contentspec  [46]",
 
229
                "children  [47]",
 
230
                "cp  [48]",
 
231
                "choice  [49]",
 
232
                "seq  [50]",
 
233
                "Mixed  [51]",
 
234
                "AttlistDecl  [52]",
 
235
                "AttDef  [53]",
 
236
                "AttType  [54]",
 
237
                "StringType  [55]",
 
238
                "TokenizedType  [56]",
 
239
                "EnumeratedType  [57]",
 
240
                "NotationType  [58]",
 
241
                "Enumeration  [59]",
 
242
                "DefaultDecl  [60]",
 
243
                "conditionalSect  [61]",
 
244
                "includeSect  [62]",
 
245
                "ignoreSect  [63]",
 
246
                "ignoreSectContents  [64]",
 
247
                "Ignore  [65]",
 
248
                "CharRef  [66]",
 
249
                "Reference  [67]",
 
250
                "EntityRef  [68]",
 
251
                "PEReference  [69]",
 
252
                "EntityDecl  [70]",
 
253
                "GEDecl  [71]",
 
254
                "PEDecl  [72]",
 
255
                "EntityDef  [73]",
 
256
                "PEDef  [74]",
 
257
                "ExternalID  [75]",
 
258
                "NDataDecl  [76]",
 
259
                "TextDecl  [77]",
 
260
                "extParsedEnt  [78]",
 
261
                "EncodingDecl  [80]",
 
262
                "EncName  [81]",
 
263
                "NotationDecl  [82]",
 
264
                "PublicID  [83]",
 
265
                "Letter  [84]",
 
266
                "BaseChar  [85]",
 
267
                "Ideographic  [86]",
 
268
                "CombiningChar  [87]",
 
269
                "Digit  [88]",
 
270
                "Extender  [89]"};
 
271
 
 
272
void ShowConstraintError(XML_Constraint errCode);
 
273
 
 
274
void ShowSyntaxError(XML_NonTerminal errCode);
 
275
 
 
276
void NoEncodingError(char * msg);
 
277
 
 
278
void EncodingError(char * msg, unsigned char * encoding, int lgth);
 
279
 
 
280
void CharSetValidationError(char * encoding, int err_pos);
 
281
 
 
282
void XMLCharacterError(int err_pos);
 
283
 
 
284
void IncompleteCodeUnitError();
 
285
 
 
286
void DeclarationError(int pos);
 
287
 
 
288
void ImplementationLimitError(char * msg);
 
289
 
 
290
void ContentModelError();
 
291
#endif