1 | /**************************************************************************** |
2 | ** |
3 | ** Copyright (C) 2016 The Qt Company Ltd. |
4 | ** Contact: https://www.qt.io/licensing/ |
5 | ** |
6 | ** This file is part of the QtXmlPatterns module of the Qt Toolkit. |
7 | ** |
8 | ** $QT_BEGIN_LICENSE:LGPL$ |
9 | ** Commercial License Usage |
10 | ** Licensees holding valid commercial Qt licenses may use this file in |
11 | ** accordance with the commercial license agreement provided with the |
12 | ** Software or, alternatively, in accordance with the terms contained in |
13 | ** a written agreement between you and The Qt Company. For licensing terms |
14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
15 | ** information use the contact form at https://www.qt.io/contact-us. |
16 | ** |
17 | ** GNU Lesser General Public License Usage |
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser |
19 | ** General Public License version 3 as published by the Free Software |
20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the |
21 | ** packaging of this file. Please review the following information to |
22 | ** ensure the GNU Lesser General Public License version 3 requirements |
23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. |
24 | ** |
25 | ** GNU General Public License Usage |
26 | ** Alternatively, this file may be used under the terms of the GNU |
27 | ** General Public License version 2.0 or (at your option) the GNU General |
28 | ** Public license version 3 or any later version approved by the KDE Free |
29 | ** Qt Foundation. The licenses are as published by the Free Software |
30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 |
31 | ** included in the packaging of this file. Please review the following |
32 | ** information to ensure the GNU General Public License requirements will |
33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and |
34 | ** https://www.gnu.org/licenses/gpl-3.0.html. |
35 | ** |
36 | ** $QT_END_LICENSE$ |
37 | ** |
38 | ****************************************************************************/ |
39 | |
40 | #include "qxsdschemaparser_p.h" |
41 | |
42 | #include "qbuiltintypes_p.h" |
43 | |
44 | QT_BEGIN_NAMESPACE |
45 | |
46 | using namespace QPatternist; |
47 | |
48 | /** |
49 | * @page using_dfa_for_schema Using DFA for validation of correct XML tag occurrence |
50 | * |
51 | * This page describes how to use DFAs for validating that the XML child tags of an |
52 | * XML parent tag occur in the right order. |
53 | * |
54 | * To validate the occurrence of XML tags one need a regular expression that describes |
55 | * which tags can appear how often in what context. For example the regular expression |
56 | * of the global <em>attribute</em> tag in XML Schema is (annotation?, simpleType?). |
57 | * That means the <em>attribute</em> tag can contain an <em>annotation</em> tag followed |
58 | * by a <em>simpleType</em> tag, or just one <em>simpleType</em> tag and even no child |
59 | * tag at all. |
60 | * So the regular expression describes some kind of language and all the various occurrences |
61 | * of the child tags can be seen as words of that language. |
62 | * We can create a DFA now, that accepts all words (and only these words) of that language |
63 | * and whenever we want to check if a sequence of child tags belongs to the language, |
64 | * we test if the sequence passes the DFA successfully. |
65 | * |
66 | * The following example shows how to create the DFA for the regular expression method |
67 | * above. |
68 | * |
69 | * \dotfile GlobalAttribute_diagram.dot |
70 | * |
71 | * At first we need a start state (1), that's the state the DFA is before it |
72 | * starts running. As our regular expression allows that there are no child tags, the |
73 | * start state is an end state as well (marked by the double circle). |
74 | * Now we fetch the first token from the XML file (let's assume it is an <em>annotation</em> tag) |
75 | * and check if there is an edge labled with the tag name leaving the current state of the DFA. |
76 | * If there is no such edge, the input doesn't fullfill the rules of the regular expression, |
77 | * so we throw an error. Otherwise we follow that edge and the DFA is set to the new state (2) the |
78 | * edge points to. Now we fetch the next token from the XML file and do the previous steps again. |
79 | * If there is no further input from the XML file, we check whether the DFA is in an end state and |
80 | * throw an error if not. |
81 | * |
82 | * So the algorithm for checking is quite simple, the whole logic is encoded in the DFA and creating |
83 | * one for a regular expression is sometimes not easy, however the ones for XML Schema are straight |
84 | * forward. |
85 | * |
86 | * <h2>Legend:</h2> |
87 | * \dotfile legend.dot |
88 | * <br> |
89 | * |
90 | * <h2>DFA for <em>all</em> tag</h2> |
91 | * \dotfile All_diagram.dot |
92 | * <br> |
93 | * <h2>DFA for <em>alternative</em> tag</h2> |
94 | * \dotfile Alternative_diagram.dot |
95 | * <br> |
96 | * <h2>DFA for <em>annotation</em> tag</h2> |
97 | * \dotfile Annotation_diagram.dot |
98 | * <br> |
99 | * <h2>DFA for <em>anyAttribute</em> tag</h2> |
100 | * \dotfile AnyAttribute_diagram.dot |
101 | * <br> |
102 | * <h2>DFA for <em>any</em> tag</h2> |
103 | * \dotfile Any_diagram.dot |
104 | * <br> |
105 | * <h2>DFA for <em>assert</em> tag</h2> |
106 | * \dotfile Assert_diagram.dot |
107 | * <br> |
108 | * <h2>DFA for <em>choice</em> tag</h2> |
109 | * \dotfile Choice_diagram.dot |
110 | * <br> |
111 | * <h2>DFA for <em>complexContent</em> tag</h2> |
112 | * \dotfile ComplexContent_diagram.dot |
113 | * <br> |
114 | * <h2>DFA for <em>extension</em> tag inside a <em>complexContent</em> tag</h2> |
115 | * \dotfile ComplexContentExtension_diagram.dot |
116 | * <br> |
117 | * <h2>DFA for <em>restriction</em> tag inside a <em>complexContent</em> tag</h2> |
118 | * \dotfile ComplexContentRestriction_diagram.dot |
119 | * <br> |
120 | * <h2>DFA for <em>defaultOpenContent</em> tag</h2> |
121 | * \dotfile DefaultOpenContent_diagram.dot |
122 | * <br> |
123 | * <h2>DFA for <em>enumeration</em> tag</h2> |
124 | * \dotfile EnumerationFacet_diagram.dot |
125 | * <br> |
126 | * <h2>DFA for <em>field</em> tag</h2> |
127 | * \dotfile Field_diagram.dot |
128 | * <br> |
129 | * <h2>DFA for <em>fractionDigits</em> tag</h2> |
130 | * \dotfile FractionDigitsFacet_diagram.dot |
131 | * <br> |
132 | * <h2>DFA for <em>attribute</em> tag</h2> |
133 | * \dotfile GlobalAttribute_diagram.dot |
134 | * <br> |
135 | * <h2>DFA for <em>complexType</em> tag</h2> |
136 | * \dotfile GlobalComplexType_diagram.dot |
137 | * <br> |
138 | * <h2>DFA for <em>element</em> tag</h2> |
139 | * \dotfile GlobalElement_diagram.dot |
140 | * <br> |
141 | * <h2>DFA for <em>simpleType</em> tag</h2> |
142 | * \dotfile GlobalSimpleType_diagram.dot |
143 | * <br> |
144 | * <h2>DFA for <em>import</em> tag</h2> |
145 | * \dotfile Import_diagram.dot |
146 | * <br> |
147 | * <h2>DFA for <em>include</em> tag</h2> |
148 | * \dotfile Include_diagram.dot |
149 | * <br> |
150 | * <h2>DFA for <em>key</em> tag</h2> |
151 | * \dotfile Key_diagram.dot |
152 | * <br> |
153 | * <h2>DFA for <em>keyref</em> tag</h2> |
154 | * \dotfile KeyRef_diagram.dot |
155 | * <br> |
156 | * <h2>DFA for <em>length</em> tag</h2> |
157 | * \dotfile LengthFacet_diagram.dot |
158 | * <br> |
159 | * <h2>DFA for <em>list</em> tag</h2> |
160 | * \dotfile List_diagram.dot |
161 | * <br> |
162 | * <h2>DFA for <em>all</em> tag</h2> |
163 | * \dotfile LocalAll_diagram.dot |
164 | * <br> |
165 | * <h2>DFA for <em>attribute</em> tag</h2> |
166 | * \dotfile LocalAttribute_diagram.dot |
167 | * <br> |
168 | * <h2>DFA for <em>choice</em> tag</h2> |
169 | * \dotfile LocalChoice_diagram.dot |
170 | * <br> |
171 | * <h2>DFA for <em>complexType</em> tag</h2> |
172 | * \dotfile LocalComplexType_diagram.dot |
173 | * <br> |
174 | * <h2>DFA for <em>element</em> tag</h2> |
175 | * \dotfile LocalElement_diagram.dot |
176 | * <br> |
177 | * <h2>DFA for <em>sequence</em> tag</h2> |
178 | * \dotfile LocalSequence_diagram.dot |
179 | * <br> |
180 | * <h2>DFA for <em>simpleType</em> tag that </h2> |
181 | * \dotfile LocalSimpleType_diagram.dot |
182 | * <br> |
183 | * <h2>DFA for <em>maxExclusive</em> tag</h2> |
184 | * \dotfile MaxExclusiveFacet_diagram.dot |
185 | * <br> |
186 | * <h2>DFA for <em>maxInclusive</em> tag</h2> |
187 | * \dotfile MaxInclusiveFacet_diagram.dot |
188 | * <br> |
189 | * <h2>DFA for <em>maxLength</em> tag</h2> |
190 | * \dotfile MaxLengthFacet_diagram.dot |
191 | * <br> |
192 | * <h2>DFA for <em>minExclusive</em> tag</h2> |
193 | * \dotfile MinExclusiveFacet_diagram.dot |
194 | * <br> |
195 | * <h2>DFA for <em>minInclusive</em> tag</h2> |
196 | * \dotfile MinInclusiveFacet_diagram.dot |
197 | * <br> |
198 | * <h2>DFA for <em>minLength</em> tag</h2> |
199 | * \dotfile MinLengthFacet_diagram.dot |
200 | * <br> |
201 | * <h2>DFA for <em>attributeGroup</em> tag without <em>ref</em> attribute</h2> |
202 | * \dotfile NamedAttributeGroup_diagram.dot |
203 | * <br> |
204 | * <h2>DFA for <em>group</em> tag without <em>ref</em> attribute</h2> |
205 | * \dotfile NamedGroup_diagram.dot |
206 | * <br> |
207 | * <h2>DFA for <em>notation</em> tag</h2> |
208 | * \dotfile Notation_diagram.dot |
209 | * <br> |
210 | * <h2>DFA for <em>override</em> tag</h2> |
211 | * \dotfile Override_diagram.dot |
212 | * <br> |
213 | * <h2>DFA for <em>pattern</em> tag</h2> |
214 | * \dotfile PatternFacet_diagram.dot |
215 | * <br> |
216 | * <h2>DFA for <em>redefine</em> tag</h2> |
217 | * \dotfile Redefine_diagram.dot |
218 | * <br> |
219 | * <h2>DFA for <em>attributeGroup</em> tag with <em>ref</em> attribute</h2> |
220 | * \dotfile ReferredAttributeGroup_diagram.dot |
221 | * <br> |
222 | * <h2>DFA for <em>group</em> tag with <em>ref</em> attribute</h2> |
223 | * \dotfile ReferredGroup_diagram.dot |
224 | * <br> |
225 | * <h2>DFA for <em>schema</em> tag</h2> |
226 | * \dotfile Schema_diagram.dot |
227 | * <br> |
228 | * <h2>DFA for <em>selector</em> tag</h2> |
229 | * \dotfile Selector_diagram.dot |
230 | * <br> |
231 | * <h2>DFA for <em>sequence</em> tag</h2> |
232 | * \dotfile Sequence_diagram.dot |
233 | * <br> |
234 | * <h2>DFA for <em>simpleContent</em> tag</h2> |
235 | * \dotfile SimpleContent_diagram.dot |
236 | * <br> |
237 | * <h2>DFA for <em>extension</em> tag inside a <em>simpleContent</em> tag</h2> |
238 | * \dotfile SimpleContentExtension_diagram.dot |
239 | * <br> |
240 | * <h2>DFA for <em>restriction</em> tag inside a <em>simpleContent</em> tag</h2> |
241 | * \dotfile SimpleContentRestriction_diagram.dot |
242 | * <br> |
243 | * <h2>DFA for <em>restriction</em> tag inside a <em>simpleType</em> tag</h2> |
244 | * \dotfile SimpleRestriction_diagram.dot |
245 | * <br> |
246 | * <h2>DFA for <em>totalDigits</em> tag</h2> |
247 | * \dotfile TotalDigitsFacet_diagram.dot |
248 | * <br> |
249 | * <h2>DFA for <em>union</em> tag</h2> |
250 | * \dotfile Union_diagram.dot |
251 | * <br> |
252 | * <h2>DFA for <em>unique</em> tag</h2> |
253 | * \dotfile Unique_diagram.dot |
254 | * <br> |
255 | * <h2>DFA for <em>whiteSpace</em> tag</h2> |
256 | * \dotfile WhiteSpaceFacet_diagram.dot |
257 | */ |
258 | |
259 | void XsdSchemaParser::setupStateMachines() |
260 | { |
261 | { |
262 | XsdStateMachine<XsdSchemaToken::NodeName> machine(m_namePool); |
263 | |
264 | // setup state machine for (annotation?, simpleType?) : attribute |
265 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId startState = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::StartEndState); |
266 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s1 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
267 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s2 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
268 | |
269 | machine.addTransition(start: startState, transition: XsdSchemaToken::Annotation, end: s1); |
270 | machine.addTransition(start: startState, transition: XsdSchemaToken::SimpleType, end: s2); |
271 | machine.addTransition(start: s1, transition: XsdSchemaToken::SimpleType, end: s2); |
272 | |
273 | m_stateMachines.insert(akey: XsdTagScope::GlobalAttribute, avalue: machine); |
274 | m_stateMachines.insert(akey: XsdTagScope::LocalAttribute, avalue: machine); |
275 | } |
276 | |
277 | { |
278 | XsdStateMachine<XsdSchemaToken::NodeName> machine(m_namePool); |
279 | |
280 | // setup state machine for (annotation?, ((simpleType | complexType)?, alternative*, (unique | key | keyref)*)) : element |
281 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId startState = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::StartEndState); |
282 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s1 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
283 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s2 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
284 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s3 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
285 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s4 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
286 | |
287 | machine.addTransition(start: startState, transition: XsdSchemaToken::Annotation, end: s1); |
288 | machine.addTransition(start: startState, transition: XsdSchemaToken::SimpleType, end: s2); |
289 | machine.addTransition(start: startState, transition: XsdSchemaToken::ComplexType, end: s2); |
290 | machine.addTransition(start: startState, transition: XsdSchemaToken::Alternative, end: s3); |
291 | machine.addTransition(start: startState, transition: XsdSchemaToken::Unique, end: s4); |
292 | machine.addTransition(start: startState, transition: XsdSchemaToken::Key, end: s4); |
293 | machine.addTransition(start: startState, transition: XsdSchemaToken::Keyref, end: s4); |
294 | |
295 | machine.addTransition(start: s1, transition: XsdSchemaToken::SimpleType, end: s2); |
296 | machine.addTransition(start: s1, transition: XsdSchemaToken::ComplexType, end: s2); |
297 | machine.addTransition(start: s1, transition: XsdSchemaToken::Alternative, end: s3); |
298 | machine.addTransition(start: s1, transition: XsdSchemaToken::Unique, end: s4); |
299 | machine.addTransition(start: s1, transition: XsdSchemaToken::Key, end: s4); |
300 | machine.addTransition(start: s1, transition: XsdSchemaToken::Keyref, end: s4); |
301 | |
302 | machine.addTransition(start: s2, transition: XsdSchemaToken::Alternative, end: s3); |
303 | machine.addTransition(start: s2, transition: XsdSchemaToken::Unique, end: s4); |
304 | machine.addTransition(start: s2, transition: XsdSchemaToken::Key, end: s4); |
305 | machine.addTransition(start: s2, transition: XsdSchemaToken::Keyref, end: s4); |
306 | |
307 | machine.addTransition(start: s3, transition: XsdSchemaToken::Alternative, end: s3); |
308 | machine.addTransition(start: s3, transition: XsdSchemaToken::Unique, end: s4); |
309 | machine.addTransition(start: s3, transition: XsdSchemaToken::Key, end: s4); |
310 | machine.addTransition(start: s3, transition: XsdSchemaToken::Keyref, end: s4); |
311 | |
312 | machine.addTransition(start: s4, transition: XsdSchemaToken::Unique, end: s4); |
313 | machine.addTransition(start: s4, transition: XsdSchemaToken::Key, end: s4); |
314 | machine.addTransition(start: s4, transition: XsdSchemaToken::Keyref, end: s4); |
315 | |
316 | m_stateMachines.insert(akey: XsdTagScope::GlobalElement, avalue: machine); |
317 | m_stateMachines.insert(akey: XsdTagScope::LocalElement, avalue: machine); |
318 | } |
319 | |
320 | { |
321 | XsdStateMachine<XsdSchemaToken::NodeName> machine(m_namePool); |
322 | |
323 | // setup state machine for (annotation?, (simpleContent | complexContent | (openContent?, (group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?), assert*))) : complexType |
324 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId startState = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::StartEndState); |
325 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s1 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
326 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s2 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
327 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s3 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
328 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s4 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
329 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s5 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
330 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s6 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
331 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s7 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
332 | |
333 | machine.addTransition(start: startState, transition: XsdSchemaToken::Annotation, end: s1); |
334 | machine.addTransition(start: startState, transition: XsdSchemaToken::SimpleContent, end: s2); |
335 | machine.addTransition(start: startState, transition: XsdSchemaToken::ComplexContent, end: s2); |
336 | machine.addTransition(start: startState, transition: XsdSchemaToken::OpenContent, end: s3); |
337 | machine.addTransition(start: startState, transition: XsdSchemaToken::Group, end: s4); |
338 | machine.addTransition(start: startState, transition: XsdSchemaToken::All, end: s4); |
339 | machine.addTransition(start: startState, transition: XsdSchemaToken::Choice, end: s4); |
340 | machine.addTransition(start: startState, transition: XsdSchemaToken::Sequence, end: s4); |
341 | machine.addTransition(start: startState, transition: XsdSchemaToken::Attribute, end: s5); |
342 | machine.addTransition(start: startState, transition: XsdSchemaToken::AttributeGroup, end: s5); |
343 | machine.addTransition(start: startState, transition: XsdSchemaToken::AnyAttribute, end: s6); |
344 | machine.addTransition(start: startState, transition: XsdSchemaToken::Assert, end: s7); |
345 | |
346 | machine.addTransition(start: s1, transition: XsdSchemaToken::SimpleContent, end: s2); |
347 | machine.addTransition(start: s1, transition: XsdSchemaToken::ComplexContent, end: s2); |
348 | machine.addTransition(start: s1, transition: XsdSchemaToken::OpenContent, end: s3); |
349 | machine.addTransition(start: s1, transition: XsdSchemaToken::Group, end: s4); |
350 | machine.addTransition(start: s1, transition: XsdSchemaToken::All, end: s4); |
351 | machine.addTransition(start: s1, transition: XsdSchemaToken::Choice, end: s4); |
352 | machine.addTransition(start: s1, transition: XsdSchemaToken::Sequence, end: s4); |
353 | machine.addTransition(start: s1, transition: XsdSchemaToken::Attribute, end: s5); |
354 | machine.addTransition(start: s1, transition: XsdSchemaToken::AttributeGroup, end: s5); |
355 | machine.addTransition(start: s1, transition: XsdSchemaToken::AnyAttribute, end: s6); |
356 | machine.addTransition(start: s1, transition: XsdSchemaToken::Assert, end: s7); |
357 | |
358 | machine.addTransition(start: s3, transition: XsdSchemaToken::Group, end: s4); |
359 | machine.addTransition(start: s3, transition: XsdSchemaToken::All, end: s4); |
360 | machine.addTransition(start: s3, transition: XsdSchemaToken::Choice, end: s4); |
361 | machine.addTransition(start: s3, transition: XsdSchemaToken::Sequence, end: s4); |
362 | machine.addTransition(start: s3, transition: XsdSchemaToken::Attribute, end: s5); |
363 | machine.addTransition(start: s3, transition: XsdSchemaToken::AttributeGroup, end: s5); |
364 | machine.addTransition(start: s3, transition: XsdSchemaToken::AnyAttribute, end: s6); |
365 | machine.addTransition(start: s3, transition: XsdSchemaToken::Assert, end: s7); |
366 | |
367 | machine.addTransition(start: s4, transition: XsdSchemaToken::Attribute, end: s5); |
368 | machine.addTransition(start: s4, transition: XsdSchemaToken::AttributeGroup, end: s5); |
369 | machine.addTransition(start: s4, transition: XsdSchemaToken::AnyAttribute, end: s6); |
370 | machine.addTransition(start: s4, transition: XsdSchemaToken::Assert, end: s7); |
371 | |
372 | machine.addTransition(start: s5, transition: XsdSchemaToken::Attribute, end: s5); |
373 | machine.addTransition(start: s5, transition: XsdSchemaToken::AttributeGroup, end: s5); |
374 | machine.addTransition(start: s5, transition: XsdSchemaToken::AnyAttribute, end: s6); |
375 | machine.addTransition(start: s5, transition: XsdSchemaToken::Assert, end: s7); |
376 | |
377 | machine.addTransition(start: s6, transition: XsdSchemaToken::Assert, end: s7); |
378 | |
379 | machine.addTransition(start: s7, transition: XsdSchemaToken::Assert, end: s7); |
380 | |
381 | m_stateMachines.insert(akey: XsdTagScope::GlobalComplexType, avalue: machine); |
382 | m_stateMachines.insert(akey: XsdTagScope::LocalComplexType, avalue: machine); |
383 | } |
384 | |
385 | { |
386 | XsdStateMachine<XsdSchemaToken::NodeName> machine(m_namePool); |
387 | |
388 | // setup state machine for (annotation?, (restriction | extension)) : simpleContent/complexContent |
389 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId startState = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::StartState); |
390 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s1 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::InternalState); |
391 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s2 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
392 | |
393 | machine.addTransition(start: startState, transition: XsdSchemaToken::Annotation, end: s1); |
394 | machine.addTransition(start: startState, transition: XsdSchemaToken::Restriction, end: s2); |
395 | machine.addTransition(start: startState, transition: XsdSchemaToken::Extension, end: s2); |
396 | |
397 | machine.addTransition(start: s1, transition: XsdSchemaToken::Restriction, end: s2); |
398 | machine.addTransition(start: s1, transition: XsdSchemaToken::Extension, end: s2); |
399 | |
400 | m_stateMachines.insert(akey: XsdTagScope::SimpleContent, avalue: machine); |
401 | m_stateMachines.insert(akey: XsdTagScope::ComplexContent, avalue: machine); |
402 | } |
403 | |
404 | { |
405 | XsdStateMachine<XsdSchemaToken::NodeName> machine(m_namePool); |
406 | |
407 | // setup state machine for (annotation?, (simpleType?, (minExclusive | minInclusive | maxExclusive | maxInclusive | totalDigits | fractionDigits | length | minLength | maxLength | enumeration | whiteSpace | pattern | assertion)*)?, ((attribute | attributeGroup)*, anyAttribute?), assert*) : simpleContent restriction |
408 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId startState = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::StartEndState); |
409 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s1 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
410 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s2 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
411 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s3 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
412 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s4 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
413 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s5 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
414 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s6 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
415 | |
416 | machine.addTransition(start: startState, transition: XsdSchemaToken::Annotation, end: s1); |
417 | machine.addTransition(start: startState, transition: XsdSchemaToken::SimpleType, end: s2); |
418 | machine.addTransition(start: startState, transition: XsdSchemaToken::MinExclusive, end: s3); |
419 | machine.addTransition(start: startState, transition: XsdSchemaToken::MinInclusive, end: s3); |
420 | machine.addTransition(start: startState, transition: XsdSchemaToken::MaxExclusive, end: s3); |
421 | machine.addTransition(start: startState, transition: XsdSchemaToken::MaxInclusive, end: s3); |
422 | machine.addTransition(start: startState, transition: XsdSchemaToken::TotalDigits, end: s3); |
423 | machine.addTransition(start: startState, transition: XsdSchemaToken::FractionDigits, end: s3); |
424 | machine.addTransition(start: startState, transition: XsdSchemaToken::Length, end: s3); |
425 | machine.addTransition(start: startState, transition: XsdSchemaToken::MinLength, end: s3); |
426 | machine.addTransition(start: startState, transition: XsdSchemaToken::MaxLength, end: s3); |
427 | machine.addTransition(start: startState, transition: XsdSchemaToken::Enumeration, end: s3); |
428 | machine.addTransition(start: startState, transition: XsdSchemaToken::WhiteSpace, end: s3); |
429 | machine.addTransition(start: startState, transition: XsdSchemaToken::Pattern, end: s3); |
430 | machine.addTransition(start: startState, transition: XsdSchemaToken::Assertion, end: s3); |
431 | machine.addTransition(start: startState, transition: XsdSchemaToken::Attribute, end: s4); |
432 | machine.addTransition(start: startState, transition: XsdSchemaToken::AttributeGroup, end: s4); |
433 | machine.addTransition(start: startState, transition: XsdSchemaToken::AnyAttribute, end: s5); |
434 | machine.addTransition(start: startState, transition: XsdSchemaToken::Assert, end: s6); |
435 | |
436 | machine.addTransition(start: s1, transition: XsdSchemaToken::SimpleType, end: s2); |
437 | machine.addTransition(start: s1, transition: XsdSchemaToken::MinExclusive, end: s3); |
438 | machine.addTransition(start: s1, transition: XsdSchemaToken::MinInclusive, end: s3); |
439 | machine.addTransition(start: s1, transition: XsdSchemaToken::MaxExclusive, end: s3); |
440 | machine.addTransition(start: s1, transition: XsdSchemaToken::MaxInclusive, end: s3); |
441 | machine.addTransition(start: s1, transition: XsdSchemaToken::TotalDigits, end: s3); |
442 | machine.addTransition(start: s1, transition: XsdSchemaToken::FractionDigits, end: s3); |
443 | machine.addTransition(start: s1, transition: XsdSchemaToken::Length, end: s3); |
444 | machine.addTransition(start: s1, transition: XsdSchemaToken::MinLength, end: s3); |
445 | machine.addTransition(start: s1, transition: XsdSchemaToken::MaxLength, end: s3); |
446 | machine.addTransition(start: s1, transition: XsdSchemaToken::Enumeration, end: s3); |
447 | machine.addTransition(start: s1, transition: XsdSchemaToken::WhiteSpace, end: s3); |
448 | machine.addTransition(start: s1, transition: XsdSchemaToken::Pattern, end: s3); |
449 | machine.addTransition(start: s1, transition: XsdSchemaToken::Assertion, end: s3); |
450 | machine.addTransition(start: s1, transition: XsdSchemaToken::Attribute, end: s4); |
451 | machine.addTransition(start: s1, transition: XsdSchemaToken::AttributeGroup, end: s4); |
452 | machine.addTransition(start: s1, transition: XsdSchemaToken::AnyAttribute, end: s5); |
453 | machine.addTransition(start: s1, transition: XsdSchemaToken::Assert, end: s6); |
454 | |
455 | machine.addTransition(start: s2, transition: XsdSchemaToken::MinExclusive, end: s3); |
456 | machine.addTransition(start: s2, transition: XsdSchemaToken::MinInclusive, end: s3); |
457 | machine.addTransition(start: s2, transition: XsdSchemaToken::MaxExclusive, end: s3); |
458 | machine.addTransition(start: s2, transition: XsdSchemaToken::MaxInclusive, end: s3); |
459 | machine.addTransition(start: s2, transition: XsdSchemaToken::TotalDigits, end: s3); |
460 | machine.addTransition(start: s2, transition: XsdSchemaToken::FractionDigits, end: s3); |
461 | machine.addTransition(start: s2, transition: XsdSchemaToken::Length, end: s3); |
462 | machine.addTransition(start: s2, transition: XsdSchemaToken::MinLength, end: s3); |
463 | machine.addTransition(start: s2, transition: XsdSchemaToken::MaxLength, end: s3); |
464 | machine.addTransition(start: s2, transition: XsdSchemaToken::Enumeration, end: s3); |
465 | machine.addTransition(start: s2, transition: XsdSchemaToken::WhiteSpace, end: s3); |
466 | machine.addTransition(start: s2, transition: XsdSchemaToken::Pattern, end: s3); |
467 | machine.addTransition(start: s2, transition: XsdSchemaToken::Assertion, end: s3); |
468 | machine.addTransition(start: s2, transition: XsdSchemaToken::Attribute, end: s4); |
469 | machine.addTransition(start: s2, transition: XsdSchemaToken::AttributeGroup, end: s4); |
470 | machine.addTransition(start: s2, transition: XsdSchemaToken::AnyAttribute, end: s5); |
471 | machine.addTransition(start: s2, transition: XsdSchemaToken::Assert, end: s6); |
472 | |
473 | machine.addTransition(start: s3, transition: XsdSchemaToken::MinExclusive, end: s3); |
474 | machine.addTransition(start: s3, transition: XsdSchemaToken::MinInclusive, end: s3); |
475 | machine.addTransition(start: s3, transition: XsdSchemaToken::MaxExclusive, end: s3); |
476 | machine.addTransition(start: s3, transition: XsdSchemaToken::MaxInclusive, end: s3); |
477 | machine.addTransition(start: s3, transition: XsdSchemaToken::TotalDigits, end: s3); |
478 | machine.addTransition(start: s3, transition: XsdSchemaToken::FractionDigits, end: s3); |
479 | machine.addTransition(start: s3, transition: XsdSchemaToken::Length, end: s3); |
480 | machine.addTransition(start: s3, transition: XsdSchemaToken::MinLength, end: s3); |
481 | machine.addTransition(start: s3, transition: XsdSchemaToken::MaxLength, end: s3); |
482 | machine.addTransition(start: s3, transition: XsdSchemaToken::Enumeration, end: s3); |
483 | machine.addTransition(start: s3, transition: XsdSchemaToken::WhiteSpace, end: s3); |
484 | machine.addTransition(start: s3, transition: XsdSchemaToken::Pattern, end: s3); |
485 | machine.addTransition(start: s3, transition: XsdSchemaToken::Assertion, end: s3); |
486 | machine.addTransition(start: s3, transition: XsdSchemaToken::Attribute, end: s4); |
487 | machine.addTransition(start: s3, transition: XsdSchemaToken::AttributeGroup, end: s4); |
488 | machine.addTransition(start: s3, transition: XsdSchemaToken::AnyAttribute, end: s5); |
489 | machine.addTransition(start: s3, transition: XsdSchemaToken::Assert, end: s6); |
490 | |
491 | machine.addTransition(start: s4, transition: XsdSchemaToken::Attribute, end: s4); |
492 | machine.addTransition(start: s4, transition: XsdSchemaToken::AttributeGroup, end: s4); |
493 | machine.addTransition(start: s4, transition: XsdSchemaToken::AnyAttribute, end: s5); |
494 | machine.addTransition(start: s4, transition: XsdSchemaToken::Assert, end: s6); |
495 | |
496 | machine.addTransition(start: s5, transition: XsdSchemaToken::Assert, end: s6); |
497 | |
498 | machine.addTransition(start: s6, transition: XsdSchemaToken::Assert, end: s6); |
499 | |
500 | m_stateMachines.insert(akey: XsdTagScope::SimpleContentRestriction, avalue: machine); |
501 | } |
502 | |
503 | { |
504 | XsdStateMachine<XsdSchemaToken::NodeName> machine(m_namePool); |
505 | |
506 | // setup state machine for (annotation?, ((attribute | attributeGroup)*, anyAttribute?), assert*) : simple content extension |
507 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId startState = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::StartEndState); |
508 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s1 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
509 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s2 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
510 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s3 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
511 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s4 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
512 | |
513 | machine.addTransition(start: startState, transition: XsdSchemaToken::Annotation, end: s1); |
514 | machine.addTransition(start: startState, transition: XsdSchemaToken::Attribute, end: s2); |
515 | machine.addTransition(start: startState, transition: XsdSchemaToken::AttributeGroup, end: s2); |
516 | machine.addTransition(start: startState, transition: XsdSchemaToken::AnyAttribute, end: s3); |
517 | machine.addTransition(start: startState, transition: XsdSchemaToken::Assert, end: s4); |
518 | |
519 | machine.addTransition(start: s1, transition: XsdSchemaToken::Attribute, end: s2); |
520 | machine.addTransition(start: s1, transition: XsdSchemaToken::AttributeGroup, end: s2); |
521 | machine.addTransition(start: s1, transition: XsdSchemaToken::AnyAttribute, end: s3); |
522 | machine.addTransition(start: s1, transition: XsdSchemaToken::Assert, end: s4); |
523 | |
524 | machine.addTransition(start: s2, transition: XsdSchemaToken::Attribute, end: s2); |
525 | machine.addTransition(start: s2, transition: XsdSchemaToken::AttributeGroup, end: s2); |
526 | machine.addTransition(start: s2, transition: XsdSchemaToken::AnyAttribute, end: s3); |
527 | machine.addTransition(start: s2, transition: XsdSchemaToken::Assert, end: s4); |
528 | |
529 | machine.addTransition(start: s3, transition: XsdSchemaToken::Assert, end: s4); |
530 | |
531 | machine.addTransition(start: s4, transition: XsdSchemaToken::Assert, end: s4); |
532 | |
533 | m_stateMachines.insert(akey: XsdTagScope::SimpleContentExtension, avalue: machine); |
534 | } |
535 | |
536 | { |
537 | XsdStateMachine<XsdSchemaToken::NodeName> machine(m_namePool); |
538 | |
539 | // setup state machine for (annotation?, openContent?, ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?), assert*)) : complex content restriction/complex content extension |
540 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId startState = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::StartEndState); |
541 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s1 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
542 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s2 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
543 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s3 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
544 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s4 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
545 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s5 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
546 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s6 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
547 | |
548 | machine.addTransition(start: startState, transition: XsdSchemaToken::Annotation, end: s1); |
549 | machine.addTransition(start: startState, transition: XsdSchemaToken::OpenContent, end: s2); |
550 | machine.addTransition(start: startState, transition: XsdSchemaToken::Group, end: s3); |
551 | machine.addTransition(start: startState, transition: XsdSchemaToken::All, end: s3); |
552 | machine.addTransition(start: startState, transition: XsdSchemaToken::Choice, end: s3); |
553 | machine.addTransition(start: startState, transition: XsdSchemaToken::Sequence, end: s3); |
554 | machine.addTransition(start: startState, transition: XsdSchemaToken::Attribute, end: s4); |
555 | machine.addTransition(start: startState, transition: XsdSchemaToken::AttributeGroup, end: s4); |
556 | machine.addTransition(start: startState, transition: XsdSchemaToken::AnyAttribute, end: s5); |
557 | machine.addTransition(start: startState, transition: XsdSchemaToken::Assert, end: s6); |
558 | |
559 | machine.addTransition(start: s1, transition: XsdSchemaToken::OpenContent, end: s2); |
560 | machine.addTransition(start: s1, transition: XsdSchemaToken::Group, end: s3); |
561 | machine.addTransition(start: s1, transition: XsdSchemaToken::All, end: s3); |
562 | machine.addTransition(start: s1, transition: XsdSchemaToken::Choice, end: s3); |
563 | machine.addTransition(start: s1, transition: XsdSchemaToken::Sequence, end: s3); |
564 | machine.addTransition(start: s1, transition: XsdSchemaToken::Attribute, end: s4); |
565 | machine.addTransition(start: s1, transition: XsdSchemaToken::AttributeGroup, end: s4); |
566 | machine.addTransition(start: s1, transition: XsdSchemaToken::AnyAttribute, end: s5); |
567 | machine.addTransition(start: s1, transition: XsdSchemaToken::Assert, end: s6); |
568 | |
569 | machine.addTransition(start: s2, transition: XsdSchemaToken::Group, end: s3); |
570 | machine.addTransition(start: s2, transition: XsdSchemaToken::All, end: s3); |
571 | machine.addTransition(start: s2, transition: XsdSchemaToken::Choice, end: s3); |
572 | machine.addTransition(start: s2, transition: XsdSchemaToken::Sequence, end: s3); |
573 | machine.addTransition(start: s2, transition: XsdSchemaToken::Attribute, end: s4); |
574 | machine.addTransition(start: s2, transition: XsdSchemaToken::AttributeGroup, end: s4); |
575 | machine.addTransition(start: s2, transition: XsdSchemaToken::AnyAttribute, end: s5); |
576 | machine.addTransition(start: s2, transition: XsdSchemaToken::Assert, end: s6); |
577 | |
578 | machine.addTransition(start: s3, transition: XsdSchemaToken::Attribute, end: s4); |
579 | machine.addTransition(start: s3, transition: XsdSchemaToken::AttributeGroup, end: s4); |
580 | machine.addTransition(start: s3, transition: XsdSchemaToken::AnyAttribute, end: s5); |
581 | machine.addTransition(start: s3, transition: XsdSchemaToken::Assert, end: s6); |
582 | |
583 | machine.addTransition(start: s4, transition: XsdSchemaToken::Attribute, end: s4); |
584 | machine.addTransition(start: s4, transition: XsdSchemaToken::AttributeGroup, end: s4); |
585 | machine.addTransition(start: s4, transition: XsdSchemaToken::AnyAttribute, end: s5); |
586 | machine.addTransition(start: s4, transition: XsdSchemaToken::Assert, end: s6); |
587 | |
588 | machine.addTransition(start: s5, transition: XsdSchemaToken::Assert, end: s6); |
589 | |
590 | machine.addTransition(start: s6, transition: XsdSchemaToken::Assert, end: s6); |
591 | |
592 | m_stateMachines.insert(akey: XsdTagScope::ComplexContentRestriction, avalue: machine); |
593 | m_stateMachines.insert(akey: XsdTagScope::ComplexContentExtension, avalue: machine); |
594 | } |
595 | |
596 | { |
597 | XsdStateMachine<XsdSchemaToken::NodeName> machine(m_namePool); |
598 | |
599 | // setup state machine for (annotation?, ((attribute | attributeGroup)*, anyAttribute?)) : named attribute group |
600 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId startState = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::StartEndState); |
601 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s1 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
602 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s2 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
603 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s3 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
604 | |
605 | machine.addTransition(start: startState, transition: XsdSchemaToken::Annotation, end: s1); |
606 | machine.addTransition(start: startState, transition: XsdSchemaToken::Attribute, end: s2); |
607 | machine.addTransition(start: startState, transition: XsdSchemaToken::AttributeGroup, end: s2); |
608 | machine.addTransition(start: startState, transition: XsdSchemaToken::AnyAttribute, end: s3); |
609 | |
610 | machine.addTransition(start: s1, transition: XsdSchemaToken::Attribute, end: s2); |
611 | machine.addTransition(start: s1, transition: XsdSchemaToken::AttributeGroup, end: s2); |
612 | machine.addTransition(start: s1, transition: XsdSchemaToken::AnyAttribute, end: s3); |
613 | |
614 | machine.addTransition(start: s2, transition: XsdSchemaToken::Attribute, end: s2); |
615 | machine.addTransition(start: s2, transition: XsdSchemaToken::AttributeGroup, end: s2); |
616 | machine.addTransition(start: s2, transition: XsdSchemaToken::AnyAttribute, end: s3); |
617 | |
618 | m_stateMachines.insert(akey: XsdTagScope::NamedAttributeGroup, avalue: machine); |
619 | } |
620 | |
621 | { |
622 | XsdStateMachine<XsdSchemaToken::NodeName> machine(m_namePool); |
623 | |
624 | // setup state machine for (annotation?, (all | choice | sequence)?) : group |
625 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId startState = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::StartEndState); |
626 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s1 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
627 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s2 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
628 | |
629 | machine.addTransition(start: startState, transition: XsdSchemaToken::Annotation, end: s1); |
630 | machine.addTransition(start: startState, transition: XsdSchemaToken::All, end: s2); |
631 | machine.addTransition(start: startState, transition: XsdSchemaToken::Choice, end: s2); |
632 | machine.addTransition(start: startState, transition: XsdSchemaToken::Sequence, end: s2); |
633 | |
634 | machine.addTransition(start: s1, transition: XsdSchemaToken::All, end: s2); |
635 | machine.addTransition(start: s1, transition: XsdSchemaToken::Choice, end: s2); |
636 | machine.addTransition(start: s1, transition: XsdSchemaToken::Sequence, end: s2); |
637 | |
638 | m_stateMachines.insert(akey: XsdTagScope::NamedGroup, avalue: machine); |
639 | m_stateMachines.insert(akey: XsdTagScope::ReferredGroup, avalue: machine); |
640 | } |
641 | |
642 | { |
643 | XsdStateMachine<XsdSchemaToken::NodeName> machine(m_namePool); |
644 | |
645 | // setup state machine for (annotation?, (element | any)*) : all |
646 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId startState = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::StartEndState); |
647 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s1 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
648 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s2 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
649 | |
650 | machine.addTransition(start: startState, transition: XsdSchemaToken::Annotation, end: s1); |
651 | machine.addTransition(start: startState, transition: XsdSchemaToken::Element, end: s2); |
652 | machine.addTransition(start: startState, transition: XsdSchemaToken::Any, end: s2); |
653 | |
654 | machine.addTransition(start: s1, transition: XsdSchemaToken::Element, end: s2); |
655 | machine.addTransition(start: s1, transition: XsdSchemaToken::Any, end: s2); |
656 | |
657 | machine.addTransition(start: s2, transition: XsdSchemaToken::Element, end: s2); |
658 | machine.addTransition(start: s2, transition: XsdSchemaToken::Any, end: s2); |
659 | |
660 | m_stateMachines.insert(akey: XsdTagScope::All, avalue: machine); |
661 | m_stateMachines.insert(akey: XsdTagScope::LocalAll, avalue: machine); |
662 | } |
663 | |
664 | { |
665 | XsdStateMachine<XsdSchemaToken::NodeName> machine(m_namePool); |
666 | |
667 | // setup state machine for (annotation?, (element | group | choice | sequence | any)*) : choice sequence |
668 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId startState = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::StartEndState); |
669 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s1 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
670 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s2 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
671 | |
672 | machine.addTransition(start: startState, transition: XsdSchemaToken::Annotation, end: s1); |
673 | machine.addTransition(start: startState, transition: XsdSchemaToken::Element, end: s2); |
674 | machine.addTransition(start: startState, transition: XsdSchemaToken::Group, end: s2); |
675 | machine.addTransition(start: startState, transition: XsdSchemaToken::Choice, end: s2); |
676 | machine.addTransition(start: startState, transition: XsdSchemaToken::Sequence, end: s2); |
677 | machine.addTransition(start: startState, transition: XsdSchemaToken::Any, end: s2); |
678 | |
679 | machine.addTransition(start: s1, transition: XsdSchemaToken::Element, end: s2); |
680 | machine.addTransition(start: s1, transition: XsdSchemaToken::Group, end: s2); |
681 | machine.addTransition(start: s1, transition: XsdSchemaToken::Choice, end: s2); |
682 | machine.addTransition(start: s1, transition: XsdSchemaToken::Sequence, end: s2); |
683 | machine.addTransition(start: s1, transition: XsdSchemaToken::Any, end: s2); |
684 | |
685 | machine.addTransition(start: s2, transition: XsdSchemaToken::Element, end: s2); |
686 | machine.addTransition(start: s2, transition: XsdSchemaToken::Group, end: s2); |
687 | machine.addTransition(start: s2, transition: XsdSchemaToken::Choice, end: s2); |
688 | machine.addTransition(start: s2, transition: XsdSchemaToken::Sequence, end: s2); |
689 | machine.addTransition(start: s2, transition: XsdSchemaToken::Any, end: s2); |
690 | |
691 | m_stateMachines.insert(akey: XsdTagScope::Choice, avalue: machine); |
692 | m_stateMachines.insert(akey: XsdTagScope::LocalChoice, avalue: machine); |
693 | m_stateMachines.insert(akey: XsdTagScope::Sequence, avalue: machine); |
694 | m_stateMachines.insert(akey: XsdTagScope::LocalSequence, avalue: machine); |
695 | } |
696 | |
697 | { |
698 | XsdStateMachine<XsdSchemaToken::NodeName> machine(m_namePool); |
699 | |
700 | // setup state machine for (annotation?) : any/selector/field/notation/include/import/referred attribute group/anyAttribute/all facets/assert |
701 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId startState = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::StartEndState); |
702 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s1 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
703 | |
704 | machine.addTransition(start: startState, transition: XsdSchemaToken::Annotation, end: s1); |
705 | |
706 | m_stateMachines.insert(akey: XsdTagScope::Any, avalue: machine); |
707 | m_stateMachines.insert(akey: XsdTagScope::Selector, avalue: machine); |
708 | m_stateMachines.insert(akey: XsdTagScope::Field, avalue: machine); |
709 | m_stateMachines.insert(akey: XsdTagScope::Notation, avalue: machine); |
710 | m_stateMachines.insert(akey: XsdTagScope::Include, avalue: machine); |
711 | m_stateMachines.insert(akey: XsdTagScope::Import, avalue: machine); |
712 | m_stateMachines.insert(akey: XsdTagScope::ReferredAttributeGroup, avalue: machine); |
713 | m_stateMachines.insert(akey: XsdTagScope::AnyAttribute, avalue: machine); |
714 | m_stateMachines.insert(akey: XsdTagScope::MinExclusiveFacet, avalue: machine); |
715 | m_stateMachines.insert(akey: XsdTagScope::MinInclusiveFacet, avalue: machine); |
716 | m_stateMachines.insert(akey: XsdTagScope::MaxExclusiveFacet, avalue: machine); |
717 | m_stateMachines.insert(akey: XsdTagScope::MaxInclusiveFacet, avalue: machine); |
718 | m_stateMachines.insert(akey: XsdTagScope::TotalDigitsFacet, avalue: machine); |
719 | m_stateMachines.insert(akey: XsdTagScope::FractionDigitsFacet, avalue: machine); |
720 | m_stateMachines.insert(akey: XsdTagScope::LengthFacet, avalue: machine); |
721 | m_stateMachines.insert(akey: XsdTagScope::MinLengthFacet, avalue: machine); |
722 | m_stateMachines.insert(akey: XsdTagScope::MaxLengthFacet, avalue: machine); |
723 | m_stateMachines.insert(akey: XsdTagScope::EnumerationFacet, avalue: machine); |
724 | m_stateMachines.insert(akey: XsdTagScope::WhiteSpaceFacet, avalue: machine); |
725 | m_stateMachines.insert(akey: XsdTagScope::PatternFacet, avalue: machine); |
726 | m_stateMachines.insert(akey: XsdTagScope::Assert, avalue: machine); |
727 | m_stateMachines.insert(akey: XsdTagScope::Assertion, avalue: machine); |
728 | } |
729 | |
730 | { |
731 | XsdStateMachine<XsdSchemaToken::NodeName> machine(m_namePool); |
732 | |
733 | // setup state machine for (annotation?, (selector, field+)) : unique/key/keyref |
734 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId startState = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::StartState); |
735 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s1 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::InternalState); |
736 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s2 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::InternalState); |
737 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s3 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
738 | |
739 | machine.addTransition(start: startState, transition: XsdSchemaToken::Annotation, end: s1); |
740 | machine.addTransition(start: startState, transition: XsdSchemaToken::Selector, end: s2); |
741 | |
742 | machine.addTransition(start: s1, transition: XsdSchemaToken::Selector, end: s2); |
743 | machine.addTransition(start: s2, transition: XsdSchemaToken::Field, end: s3); |
744 | machine.addTransition(start: s3, transition: XsdSchemaToken::Field, end: s3); |
745 | |
746 | m_stateMachines.insert(akey: XsdTagScope::Unique, avalue: machine); |
747 | m_stateMachines.insert(akey: XsdTagScope::Key, avalue: machine); |
748 | m_stateMachines.insert(akey: XsdTagScope::KeyRef, avalue: machine); |
749 | } |
750 | |
751 | { |
752 | XsdStateMachine<XsdSchemaToken::NodeName> machine(m_namePool); |
753 | |
754 | // setup state machine for (annotation?, (simpleType | complexType)?) : alternative |
755 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId startState = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::StartEndState); |
756 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s1 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
757 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s2 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
758 | |
759 | machine.addTransition(start: startState, transition: XsdSchemaToken::Annotation, end: s1); |
760 | machine.addTransition(start: startState, transition: XsdSchemaToken::SimpleType, end: s2); |
761 | machine.addTransition(start: startState, transition: XsdSchemaToken::ComplexType, end: s2); |
762 | |
763 | machine.addTransition(start: s1, transition: XsdSchemaToken::SimpleType, end: s2); |
764 | machine.addTransition(start: s1, transition: XsdSchemaToken::ComplexType, end: s2); |
765 | |
766 | m_stateMachines.insert(akey: XsdTagScope::Alternative, avalue: machine); |
767 | } |
768 | |
769 | { |
770 | XsdStateMachine<XsdSchemaToken::NodeName> machine(m_namePool); |
771 | |
772 | // setup state machine for (appinfo | documentation)* : annotation |
773 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId startState = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::StartEndState); |
774 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s1 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
775 | |
776 | machine.addTransition(start: startState, transition: XsdSchemaToken::Appinfo, end: s1); |
777 | machine.addTransition(start: startState, transition: XsdSchemaToken::Documentation, end: s1); |
778 | |
779 | machine.addTransition(start: s1, transition: XsdSchemaToken::Appinfo, end: s1); |
780 | machine.addTransition(start: s1, transition: XsdSchemaToken::Documentation, end: s1); |
781 | |
782 | m_stateMachines.insert(akey: XsdTagScope::Annotation, avalue: machine); |
783 | } |
784 | |
785 | { |
786 | XsdStateMachine<XsdSchemaToken::NodeName> machine(m_namePool); |
787 | |
788 | // setup state machine for (annotation?, (restriction | list | union)) : simpleType |
789 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId startState = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::StartState); |
790 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s1 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::InternalState); |
791 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s2 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
792 | |
793 | machine.addTransition(start: startState, transition: XsdSchemaToken::Annotation, end: s1); |
794 | machine.addTransition(start: startState, transition: XsdSchemaToken::Restriction, end: s2); |
795 | machine.addTransition(start: startState, transition: XsdSchemaToken::List, end: s2); |
796 | machine.addTransition(start: startState, transition: XsdSchemaToken::Union, end: s2); |
797 | |
798 | machine.addTransition(start: s1, transition: XsdSchemaToken::Restriction, end: s2); |
799 | machine.addTransition(start: s1, transition: XsdSchemaToken::List, end: s2); |
800 | machine.addTransition(start: s1, transition: XsdSchemaToken::Union, end: s2); |
801 | |
802 | m_stateMachines.insert(akey: XsdTagScope::GlobalSimpleType, avalue: machine); |
803 | m_stateMachines.insert(akey: XsdTagScope::LocalSimpleType, avalue: machine); |
804 | } |
805 | |
806 | { |
807 | XsdStateMachine<XsdSchemaToken::NodeName> machine(m_namePool); |
808 | |
809 | // setup state machine for (annotation?, (simpleType?, (minExclusive | minInclusive | maxExclusive | maxInclusive | totalDigits | fractionDigits | length | minLength | maxLength | enumeration | whiteSpace | pattern | assertion)*)) : simple type restriction |
810 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId startState = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::StartEndState); |
811 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s1 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
812 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s2 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
813 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s3 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
814 | |
815 | machine.addTransition(start: startState, transition: XsdSchemaToken::Annotation, end: s1); |
816 | machine.addTransition(start: startState, transition: XsdSchemaToken::SimpleType, end: s2); |
817 | machine.addTransition(start: startState, transition: XsdSchemaToken::MinExclusive, end: s3); |
818 | machine.addTransition(start: startState, transition: XsdSchemaToken::MinInclusive, end: s3); |
819 | machine.addTransition(start: startState, transition: XsdSchemaToken::MaxExclusive, end: s3); |
820 | machine.addTransition(start: startState, transition: XsdSchemaToken::MaxInclusive, end: s3); |
821 | machine.addTransition(start: startState, transition: XsdSchemaToken::TotalDigits, end: s3); |
822 | machine.addTransition(start: startState, transition: XsdSchemaToken::FractionDigits, end: s3); |
823 | machine.addTransition(start: startState, transition: XsdSchemaToken::Length, end: s3); |
824 | machine.addTransition(start: startState, transition: XsdSchemaToken::MinLength, end: s3); |
825 | machine.addTransition(start: startState, transition: XsdSchemaToken::MaxLength, end: s3); |
826 | machine.addTransition(start: startState, transition: XsdSchemaToken::Enumeration, end: s3); |
827 | machine.addTransition(start: startState, transition: XsdSchemaToken::WhiteSpace, end: s3); |
828 | machine.addTransition(start: startState, transition: XsdSchemaToken::Pattern, end: s3); |
829 | machine.addTransition(start: startState, transition: XsdSchemaToken::Assertion, end: s3); |
830 | |
831 | machine.addTransition(start: s1, transition: XsdSchemaToken::SimpleType, end: s2); |
832 | machine.addTransition(start: s1, transition: XsdSchemaToken::MinExclusive, end: s3); |
833 | machine.addTransition(start: s1, transition: XsdSchemaToken::MinInclusive, end: s3); |
834 | machine.addTransition(start: s1, transition: XsdSchemaToken::MaxExclusive, end: s3); |
835 | machine.addTransition(start: s1, transition: XsdSchemaToken::MaxInclusive, end: s3); |
836 | machine.addTransition(start: s1, transition: XsdSchemaToken::TotalDigits, end: s3); |
837 | machine.addTransition(start: s1, transition: XsdSchemaToken::FractionDigits, end: s3); |
838 | machine.addTransition(start: s1, transition: XsdSchemaToken::Length, end: s3); |
839 | machine.addTransition(start: s1, transition: XsdSchemaToken::MinLength, end: s3); |
840 | machine.addTransition(start: s1, transition: XsdSchemaToken::MaxLength, end: s3); |
841 | machine.addTransition(start: s1, transition: XsdSchemaToken::Enumeration, end: s3); |
842 | machine.addTransition(start: s1, transition: XsdSchemaToken::WhiteSpace, end: s3); |
843 | machine.addTransition(start: s1, transition: XsdSchemaToken::Pattern, end: s3); |
844 | machine.addTransition(start: s1, transition: XsdSchemaToken::Assertion, end: s3); |
845 | |
846 | machine.addTransition(start: s2, transition: XsdSchemaToken::MinExclusive, end: s3); |
847 | machine.addTransition(start: s2, transition: XsdSchemaToken::MinInclusive, end: s3); |
848 | machine.addTransition(start: s2, transition: XsdSchemaToken::MaxExclusive, end: s3); |
849 | machine.addTransition(start: s2, transition: XsdSchemaToken::MaxInclusive, end: s3); |
850 | machine.addTransition(start: s2, transition: XsdSchemaToken::TotalDigits, end: s3); |
851 | machine.addTransition(start: s2, transition: XsdSchemaToken::FractionDigits, end: s3); |
852 | machine.addTransition(start: s2, transition: XsdSchemaToken::Length, end: s3); |
853 | machine.addTransition(start: s2, transition: XsdSchemaToken::MinLength, end: s3); |
854 | machine.addTransition(start: s2, transition: XsdSchemaToken::MaxLength, end: s3); |
855 | machine.addTransition(start: s2, transition: XsdSchemaToken::Enumeration, end: s3); |
856 | machine.addTransition(start: s2, transition: XsdSchemaToken::WhiteSpace, end: s3); |
857 | machine.addTransition(start: s2, transition: XsdSchemaToken::Pattern, end: s3); |
858 | machine.addTransition(start: s2, transition: XsdSchemaToken::Assertion, end: s3); |
859 | |
860 | machine.addTransition(start: s3, transition: XsdSchemaToken::MinExclusive, end: s3); |
861 | machine.addTransition(start: s3, transition: XsdSchemaToken::MinInclusive, end: s3); |
862 | machine.addTransition(start: s3, transition: XsdSchemaToken::MaxExclusive, end: s3); |
863 | machine.addTransition(start: s3, transition: XsdSchemaToken::MaxInclusive, end: s3); |
864 | machine.addTransition(start: s3, transition: XsdSchemaToken::TotalDigits, end: s3); |
865 | machine.addTransition(start: s3, transition: XsdSchemaToken::FractionDigits, end: s3); |
866 | machine.addTransition(start: s3, transition: XsdSchemaToken::Length, end: s3); |
867 | machine.addTransition(start: s3, transition: XsdSchemaToken::MinLength, end: s3); |
868 | machine.addTransition(start: s3, transition: XsdSchemaToken::MaxLength, end: s3); |
869 | machine.addTransition(start: s3, transition: XsdSchemaToken::Enumeration, end: s3); |
870 | machine.addTransition(start: s3, transition: XsdSchemaToken::WhiteSpace, end: s3); |
871 | machine.addTransition(start: s3, transition: XsdSchemaToken::Pattern, end: s3); |
872 | machine.addTransition(start: s3, transition: XsdSchemaToken::Assertion, end: s3); |
873 | |
874 | m_stateMachines.insert(akey: XsdTagScope::SimpleRestriction, avalue: machine); |
875 | } |
876 | |
877 | { |
878 | XsdStateMachine<XsdSchemaToken::NodeName> machine(m_namePool); |
879 | |
880 | // setup state machine for (annotation?, simpleType?) : list |
881 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId startState = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::StartEndState); |
882 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s1 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
883 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s2 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
884 | |
885 | machine.addTransition(start: startState, transition: XsdSchemaToken::Annotation, end: s1); |
886 | machine.addTransition(start: startState, transition: XsdSchemaToken::SimpleType, end: s2); |
887 | |
888 | machine.addTransition(start: s1, transition: XsdSchemaToken::SimpleType, end: s2); |
889 | |
890 | m_stateMachines.insert(akey: XsdTagScope::List, avalue: machine); |
891 | } |
892 | |
893 | { |
894 | XsdStateMachine<XsdSchemaToken::NodeName> machine(m_namePool); |
895 | |
896 | // setup state machine for (annotation?, simpleType*) : union |
897 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId startState = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::StartEndState); |
898 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s1 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
899 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s2 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
900 | |
901 | machine.addTransition(start: startState, transition: XsdSchemaToken::Annotation, end: s1); |
902 | machine.addTransition(start: startState, transition: XsdSchemaToken::SimpleType, end: s2); |
903 | |
904 | machine.addTransition(start: s1, transition: XsdSchemaToken::SimpleType, end: s2); |
905 | machine.addTransition(start: s2, transition: XsdSchemaToken::SimpleType, end: s2); |
906 | |
907 | m_stateMachines.insert(akey: XsdTagScope::Union, avalue: machine); |
908 | } |
909 | |
910 | { |
911 | XsdStateMachine<XsdSchemaToken::NodeName> machine(m_namePool); |
912 | |
913 | // setup state machine for ((include | import | redefine |i override | annotation)*, (defaultOpenContent, annotation*)?, (((simpleType | complexType | group | attributeGroup) | element | attribute | notation), annotation*)*) : schema |
914 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId startState = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::StartEndState); |
915 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s1 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
916 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s2 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
917 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s3 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
918 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s4 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
919 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s5 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
920 | |
921 | machine.addTransition(start: startState, transition: XsdSchemaToken::Include, end: s1); |
922 | machine.addTransition(start: startState, transition: XsdSchemaToken::Import, end: s1); |
923 | machine.addTransition(start: startState, transition: XsdSchemaToken::Redefine, end: s1); |
924 | machine.addTransition(start: startState, transition: XsdSchemaToken::Override, end: s1); |
925 | machine.addTransition(start: startState, transition: XsdSchemaToken::Annotation, end: s1); |
926 | machine.addTransition(start: startState, transition: XsdSchemaToken::DefaultOpenContent, end: s2); |
927 | machine.addTransition(start: startState, transition: XsdSchemaToken::SimpleType, end: s4); |
928 | machine.addTransition(start: startState, transition: XsdSchemaToken::ComplexType, end: s4); |
929 | machine.addTransition(start: startState, transition: XsdSchemaToken::Group, end: s4); |
930 | machine.addTransition(start: startState, transition: XsdSchemaToken::AttributeGroup, end: s4); |
931 | machine.addTransition(start: startState, transition: XsdSchemaToken::Element, end: s4); |
932 | machine.addTransition(start: startState, transition: XsdSchemaToken::Attribute, end: s4); |
933 | machine.addTransition(start: startState, transition: XsdSchemaToken::Notation, end: s4); |
934 | |
935 | machine.addTransition(start: s1, transition: XsdSchemaToken::Include, end: s1); |
936 | machine.addTransition(start: s1, transition: XsdSchemaToken::Import, end: s1); |
937 | machine.addTransition(start: s1, transition: XsdSchemaToken::Redefine, end: s1); |
938 | machine.addTransition(start: s1, transition: XsdSchemaToken::Override, end: s1); |
939 | machine.addTransition(start: s1, transition: XsdSchemaToken::Annotation, end: s1); |
940 | machine.addTransition(start: s1, transition: XsdSchemaToken::DefaultOpenContent, end: s2); |
941 | machine.addTransition(start: s1, transition: XsdSchemaToken::SimpleType, end: s4); |
942 | machine.addTransition(start: s1, transition: XsdSchemaToken::ComplexType, end: s4); |
943 | machine.addTransition(start: s1, transition: XsdSchemaToken::Group, end: s4); |
944 | machine.addTransition(start: s1, transition: XsdSchemaToken::AttributeGroup, end: s4); |
945 | machine.addTransition(start: s1, transition: XsdSchemaToken::Element, end: s4); |
946 | machine.addTransition(start: s1, transition: XsdSchemaToken::Attribute, end: s4); |
947 | machine.addTransition(start: s1, transition: XsdSchemaToken::Notation, end: s4); |
948 | |
949 | machine.addTransition(start: s2, transition: XsdSchemaToken::Annotation, end: s3); |
950 | machine.addTransition(start: s2, transition: XsdSchemaToken::SimpleType, end: s4); |
951 | machine.addTransition(start: s2, transition: XsdSchemaToken::ComplexType, end: s4); |
952 | machine.addTransition(start: s2, transition: XsdSchemaToken::Group, end: s4); |
953 | machine.addTransition(start: s2, transition: XsdSchemaToken::AttributeGroup, end: s4); |
954 | machine.addTransition(start: s2, transition: XsdSchemaToken::Element, end: s4); |
955 | machine.addTransition(start: s2, transition: XsdSchemaToken::Attribute, end: s4); |
956 | machine.addTransition(start: s2, transition: XsdSchemaToken::Notation, end: s4); |
957 | |
958 | machine.addTransition(start: s3, transition: XsdSchemaToken::SimpleType, end: s4); |
959 | machine.addTransition(start: s3, transition: XsdSchemaToken::ComplexType, end: s4); |
960 | machine.addTransition(start: s3, transition: XsdSchemaToken::Group, end: s4); |
961 | machine.addTransition(start: s3, transition: XsdSchemaToken::AttributeGroup, end: s4); |
962 | machine.addTransition(start: s3, transition: XsdSchemaToken::Element, end: s4); |
963 | machine.addTransition(start: s3, transition: XsdSchemaToken::Attribute, end: s4); |
964 | machine.addTransition(start: s3, transition: XsdSchemaToken::Notation, end: s4); |
965 | |
966 | machine.addTransition(start: s4, transition: XsdSchemaToken::SimpleType, end: s4); |
967 | machine.addTransition(start: s4, transition: XsdSchemaToken::ComplexType, end: s4); |
968 | machine.addTransition(start: s4, transition: XsdSchemaToken::Group, end: s4); |
969 | machine.addTransition(start: s4, transition: XsdSchemaToken::AttributeGroup, end: s4); |
970 | machine.addTransition(start: s4, transition: XsdSchemaToken::Element, end: s4); |
971 | machine.addTransition(start: s4, transition: XsdSchemaToken::Attribute, end: s4); |
972 | machine.addTransition(start: s4, transition: XsdSchemaToken::Notation, end: s4); |
973 | machine.addTransition(start: s4, transition: XsdSchemaToken::Annotation, end: s5); |
974 | |
975 | machine.addTransition(start: s5, transition: XsdSchemaToken::SimpleType, end: s4); |
976 | machine.addTransition(start: s5, transition: XsdSchemaToken::ComplexType, end: s4); |
977 | machine.addTransition(start: s5, transition: XsdSchemaToken::Group, end: s4); |
978 | machine.addTransition(start: s5, transition: XsdSchemaToken::AttributeGroup, end: s4); |
979 | machine.addTransition(start: s5, transition: XsdSchemaToken::Element, end: s4); |
980 | machine.addTransition(start: s5, transition: XsdSchemaToken::Attribute, end: s4); |
981 | machine.addTransition(start: s5, transition: XsdSchemaToken::Notation, end: s4); |
982 | machine.addTransition(start: s5, transition: XsdSchemaToken::Annotation, end: s5); |
983 | |
984 | m_stateMachines.insert(akey: XsdTagScope::Schema, avalue: machine); |
985 | } |
986 | |
987 | { |
988 | XsdStateMachine<XsdSchemaToken::NodeName> machine(m_namePool); |
989 | |
990 | // setup state machine for (annotation?, any) : defaultOpenContent |
991 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId startState = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::StartEndState); |
992 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s1 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::InternalState); |
993 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s2 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
994 | |
995 | machine.addTransition(start: startState, transition: XsdSchemaToken::Annotation, end: s1); |
996 | machine.addTransition(start: startState, transition: XsdSchemaToken::Any, end: s2); |
997 | |
998 | machine.addTransition(start: s1, transition: XsdSchemaToken::Any, end: s2); |
999 | |
1000 | m_stateMachines.insert(akey: XsdTagScope::DefaultOpenContent, avalue: machine); |
1001 | } |
1002 | |
1003 | { |
1004 | XsdStateMachine<XsdSchemaToken::NodeName> machine(m_namePool); |
1005 | |
1006 | // setup state machine for (annotation | (simpleType | complexType | group | attributeGroup))* : redefine |
1007 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId startState = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::StartEndState); |
1008 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s1 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
1009 | |
1010 | machine.addTransition(start: startState, transition: XsdSchemaToken::Annotation, end: s1); |
1011 | machine.addTransition(start: startState, transition: XsdSchemaToken::SimpleType, end: s1); |
1012 | machine.addTransition(start: startState, transition: XsdSchemaToken::ComplexType, end: s1); |
1013 | machine.addTransition(start: startState, transition: XsdSchemaToken::Group, end: s1); |
1014 | machine.addTransition(start: startState, transition: XsdSchemaToken::AttributeGroup, end: s1); |
1015 | |
1016 | machine.addTransition(start: s1, transition: XsdSchemaToken::Annotation, end: s1); |
1017 | machine.addTransition(start: s1, transition: XsdSchemaToken::SimpleType, end: s1); |
1018 | machine.addTransition(start: s1, transition: XsdSchemaToken::ComplexType, end: s1); |
1019 | machine.addTransition(start: s1, transition: XsdSchemaToken::Group, end: s1); |
1020 | machine.addTransition(start: s1, transition: XsdSchemaToken::AttributeGroup, end: s1); |
1021 | |
1022 | m_stateMachines.insert(akey: XsdTagScope::Redefine, avalue: machine); |
1023 | } |
1024 | |
1025 | { |
1026 | XsdStateMachine<XsdSchemaToken::NodeName> machine(m_namePool); |
1027 | |
1028 | // setup state machine for (annotation | (simpleType | complexType | group | attributeGroup | element | attribute | notation))* : override |
1029 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId startState = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::StartEndState); |
1030 | const XsdStateMachine<XsdSchemaToken::NodeName>::StateId s1 = machine.addState(type: XsdStateMachine<XsdSchemaToken::NodeName>::EndState); |
1031 | |
1032 | machine.addTransition(start: startState, transition: XsdSchemaToken::Annotation, end: s1); |
1033 | machine.addTransition(start: startState, transition: XsdSchemaToken::SimpleType, end: s1); |
1034 | machine.addTransition(start: startState, transition: XsdSchemaToken::ComplexType, end: s1); |
1035 | machine.addTransition(start: startState, transition: XsdSchemaToken::Group, end: s1); |
1036 | machine.addTransition(start: startState, transition: XsdSchemaToken::AttributeGroup, end: s1); |
1037 | machine.addTransition(start: startState, transition: XsdSchemaToken::Element, end: s1); |
1038 | machine.addTransition(start: startState, transition: XsdSchemaToken::Attribute, end: s1); |
1039 | machine.addTransition(start: startState, transition: XsdSchemaToken::Notation, end: s1); |
1040 | |
1041 | machine.addTransition(start: s1, transition: XsdSchemaToken::Annotation, end: s1); |
1042 | machine.addTransition(start: s1, transition: XsdSchemaToken::SimpleType, end: s1); |
1043 | machine.addTransition(start: s1, transition: XsdSchemaToken::ComplexType, end: s1); |
1044 | machine.addTransition(start: s1, transition: XsdSchemaToken::Group, end: s1); |
1045 | machine.addTransition(start: s1, transition: XsdSchemaToken::AttributeGroup, end: s1); |
1046 | machine.addTransition(start: s1, transition: XsdSchemaToken::Element, end: s1); |
1047 | machine.addTransition(start: s1, transition: XsdSchemaToken::Attribute, end: s1); |
1048 | machine.addTransition(start: s1, transition: XsdSchemaToken::Notation, end: s1); |
1049 | |
1050 | m_stateMachines.insert(akey: XsdTagScope::Override, avalue: machine); |
1051 | } |
1052 | } |
1053 | |
1054 | void XsdSchemaParser::setupBuiltinTypeNames() |
1055 | { |
1056 | m_builtinTypeNames.reserve(asize: 48); |
1057 | |
1058 | m_builtinTypeNames.insert(value: BuiltinTypes::xsAnyType->name(np: m_namePool)); |
1059 | m_builtinTypeNames.insert(value: BuiltinTypes::xsAnySimpleType->name(np: m_namePool)); |
1060 | m_builtinTypeNames.insert(value: BuiltinTypes::xsUntyped->name(np: m_namePool)); |
1061 | m_builtinTypeNames.insert(value: BuiltinTypes::xsAnyAtomicType->name(np: m_namePool)); |
1062 | m_builtinTypeNames.insert(value: BuiltinTypes::xsUntypedAtomic->name(np: m_namePool)); |
1063 | m_builtinTypeNames.insert(value: BuiltinTypes::xsDateTime->name(np: m_namePool)); |
1064 | m_builtinTypeNames.insert(value: BuiltinTypes::xsDate->name(np: m_namePool)); |
1065 | m_builtinTypeNames.insert(value: BuiltinTypes::xsTime->name(np: m_namePool)); |
1066 | m_builtinTypeNames.insert(value: BuiltinTypes::xsDuration->name(np: m_namePool)); |
1067 | m_builtinTypeNames.insert(value: BuiltinTypes::xsYearMonthDuration->name(np: m_namePool)); |
1068 | m_builtinTypeNames.insert(value: BuiltinTypes::xsDayTimeDuration->name(np: m_namePool)); |
1069 | m_builtinTypeNames.insert(value: BuiltinTypes::xsFloat->name(np: m_namePool)); |
1070 | m_builtinTypeNames.insert(value: BuiltinTypes::xsDouble->name(np: m_namePool)); |
1071 | m_builtinTypeNames.insert(value: BuiltinTypes::xsInteger->name(np: m_namePool)); |
1072 | m_builtinTypeNames.insert(value: BuiltinTypes::xsDecimal->name(np: m_namePool)); |
1073 | m_builtinTypeNames.insert(value: BuiltinTypes::xsNonPositiveInteger->name(np: m_namePool)); |
1074 | m_builtinTypeNames.insert(value: BuiltinTypes::xsNegativeInteger->name(np: m_namePool)); |
1075 | m_builtinTypeNames.insert(value: BuiltinTypes::xsLong->name(np: m_namePool)); |
1076 | m_builtinTypeNames.insert(value: BuiltinTypes::xsInt->name(np: m_namePool)); |
1077 | m_builtinTypeNames.insert(value: BuiltinTypes::xsShort->name(np: m_namePool)); |
1078 | m_builtinTypeNames.insert(value: BuiltinTypes::xsByte->name(np: m_namePool)); |
1079 | m_builtinTypeNames.insert(value: BuiltinTypes::xsNonNegativeInteger->name(np: m_namePool)); |
1080 | m_builtinTypeNames.insert(value: BuiltinTypes::xsUnsignedLong->name(np: m_namePool)); |
1081 | m_builtinTypeNames.insert(value: BuiltinTypes::xsUnsignedInt->name(np: m_namePool)); |
1082 | m_builtinTypeNames.insert(value: BuiltinTypes::xsUnsignedShort->name(np: m_namePool)); |
1083 | m_builtinTypeNames.insert(value: BuiltinTypes::xsUnsignedByte->name(np: m_namePool)); |
1084 | m_builtinTypeNames.insert(value: BuiltinTypes::xsPositiveInteger->name(np: m_namePool)); |
1085 | m_builtinTypeNames.insert(value: BuiltinTypes::xsGYearMonth->name(np: m_namePool)); |
1086 | m_builtinTypeNames.insert(value: BuiltinTypes::xsGYear->name(np: m_namePool)); |
1087 | m_builtinTypeNames.insert(value: BuiltinTypes::xsGMonthDay->name(np: m_namePool)); |
1088 | m_builtinTypeNames.insert(value: BuiltinTypes::xsGDay->name(np: m_namePool)); |
1089 | m_builtinTypeNames.insert(value: BuiltinTypes::xsGMonth->name(np: m_namePool)); |
1090 | m_builtinTypeNames.insert(value: BuiltinTypes::xsBoolean->name(np: m_namePool)); |
1091 | m_builtinTypeNames.insert(value: BuiltinTypes::xsBase64Binary->name(np: m_namePool)); |
1092 | m_builtinTypeNames.insert(value: BuiltinTypes::xsHexBinary->name(np: m_namePool)); |
1093 | m_builtinTypeNames.insert(value: BuiltinTypes::xsAnyURI->name(np: m_namePool)); |
1094 | m_builtinTypeNames.insert(value: BuiltinTypes::xsQName->name(np: m_namePool)); |
1095 | m_builtinTypeNames.insert(value: BuiltinTypes::xsString->name(np: m_namePool)); |
1096 | m_builtinTypeNames.insert(value: BuiltinTypes::xsNormalizedString->name(np: m_namePool)); |
1097 | m_builtinTypeNames.insert(value: BuiltinTypes::xsToken->name(np: m_namePool)); |
1098 | m_builtinTypeNames.insert(value: BuiltinTypes::xsLanguage->name(np: m_namePool)); |
1099 | m_builtinTypeNames.insert(value: BuiltinTypes::xsNMTOKEN->name(np: m_namePool)); |
1100 | m_builtinTypeNames.insert(value: BuiltinTypes::xsName->name(np: m_namePool)); |
1101 | m_builtinTypeNames.insert(value: BuiltinTypes::xsNCName->name(np: m_namePool)); |
1102 | m_builtinTypeNames.insert(value: BuiltinTypes::xsID->name(np: m_namePool)); |
1103 | m_builtinTypeNames.insert(value: BuiltinTypes::xsIDREF->name(np: m_namePool)); |
1104 | m_builtinTypeNames.insert(value: BuiltinTypes::xsENTITY->name(np: m_namePool)); |
1105 | m_builtinTypeNames.insert(value: BuiltinTypes::xsNOTATION->name(np: m_namePool)); |
1106 | } |
1107 | |
1108 | QT_END_NAMESPACE |
1109 | |