Qt 4.8
qxsdschemaparser_setup.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
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 Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include "qxsdschemaparser_p.h"
43 
44 #include "qbuiltintypes_p.h"
45 
47 
48 using namespace QPatternist;
49 
51 {
52  NamePool::Ptr namePool(m_namePool);
53  {
55 
56  // setup state machine for (annotation?, simpleType?) : attribute
60 
61  machine.addTransition(startState, XsdSchemaToken::Annotation, s1);
62  machine.addTransition(startState, XsdSchemaToken::SimpleType, s2);
64 
67  }
68 
69  {
71 
72  // setup state machine for (annotation?, ((simpleType | complexType)?, alternative*, (unique | key | keyref)*)) : element
78 
79  machine.addTransition(startState, XsdSchemaToken::Annotation, s1);
80  machine.addTransition(startState, XsdSchemaToken::SimpleType, s2);
81  machine.addTransition(startState, XsdSchemaToken::ComplexType, s2);
82  machine.addTransition(startState, XsdSchemaToken::Alternative, s3);
83  machine.addTransition(startState, XsdSchemaToken::Unique, s4);
84  machine.addTransition(startState, XsdSchemaToken::Key, s4);
85  machine.addTransition(startState, XsdSchemaToken::Keyref, s4);
86 
90  machine.addTransition(s1, XsdSchemaToken::Unique, s4);
91  machine.addTransition(s1, XsdSchemaToken::Key, s4);
92  machine.addTransition(s1, XsdSchemaToken::Keyref, s4);
93 
95  machine.addTransition(s2, XsdSchemaToken::Unique, s4);
96  machine.addTransition(s2, XsdSchemaToken::Key, s4);
97  machine.addTransition(s2, XsdSchemaToken::Keyref, s4);
98 
100  machine.addTransition(s3, XsdSchemaToken::Unique, s4);
101  machine.addTransition(s3, XsdSchemaToken::Key, s4);
102  machine.addTransition(s3, XsdSchemaToken::Keyref, s4);
103 
104  machine.addTransition(s4, XsdSchemaToken::Unique, s4);
105  machine.addTransition(s4, XsdSchemaToken::Key, s4);
106  machine.addTransition(s4, XsdSchemaToken::Keyref, s4);
107 
110  }
111 
112  {
114 
115  // setup state machine for (annotation?, (simpleContent | complexContent | (openContent?, (group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?), assert*))) : complexType
124 
125  machine.addTransition(startState, XsdSchemaToken::Annotation, s1);
126  machine.addTransition(startState, XsdSchemaToken::SimpleContent, s2);
127  machine.addTransition(startState, XsdSchemaToken::ComplexContent, s2);
128  machine.addTransition(startState, XsdSchemaToken::OpenContent, s3);
129  machine.addTransition(startState, XsdSchemaToken::Group, s4);
130  machine.addTransition(startState, XsdSchemaToken::All, s4);
131  machine.addTransition(startState, XsdSchemaToken::Choice, s4);
132  machine.addTransition(startState, XsdSchemaToken::Sequence, s4);
133  machine.addTransition(startState, XsdSchemaToken::Attribute, s5);
134  machine.addTransition(startState, XsdSchemaToken::AttributeGroup, s5);
135  machine.addTransition(startState, XsdSchemaToken::AnyAttribute, s6);
136  machine.addTransition(startState, XsdSchemaToken::Assert, s7);
137 
141  machine.addTransition(s1, XsdSchemaToken::Group, s4);
142  machine.addTransition(s1, XsdSchemaToken::All, s4);
143  machine.addTransition(s1, XsdSchemaToken::Choice, s4);
144  machine.addTransition(s1, XsdSchemaToken::Sequence, s4);
145  machine.addTransition(s1, XsdSchemaToken::Attribute, s5);
148  machine.addTransition(s1, XsdSchemaToken::Assert, s7);
149 
150  machine.addTransition(s3, XsdSchemaToken::Group, s4);
151  machine.addTransition(s3, XsdSchemaToken::All, s4);
152  machine.addTransition(s3, XsdSchemaToken::Choice, s4);
153  machine.addTransition(s3, XsdSchemaToken::Sequence, s4);
154  machine.addTransition(s3, XsdSchemaToken::Attribute, s5);
157  machine.addTransition(s3, XsdSchemaToken::Assert, s7);
158 
159  machine.addTransition(s4, XsdSchemaToken::Attribute, s5);
162  machine.addTransition(s4, XsdSchemaToken::Assert, s7);
163 
164  machine.addTransition(s5, XsdSchemaToken::Attribute, s5);
167  machine.addTransition(s5, XsdSchemaToken::Assert, s7);
168 
169  machine.addTransition(s6, XsdSchemaToken::Assert, s7);
170 
171  machine.addTransition(s7, XsdSchemaToken::Assert, s7);
172 
175  }
176 
177  {
179 
180  // setup state machine for (annotation?, (restriction | extension)) : simpleContent/complexContent
184 
185  machine.addTransition(startState, XsdSchemaToken::Annotation, s1);
186  machine.addTransition(startState, XsdSchemaToken::Restriction, s2);
187  machine.addTransition(startState, XsdSchemaToken::Extension, s2);
188 
190  machine.addTransition(s1, XsdSchemaToken::Extension, s2);
191 
194  }
195 
196  {
198 
199  // 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
207 
208  machine.addTransition(startState, XsdSchemaToken::Annotation, s1);
209  machine.addTransition(startState, XsdSchemaToken::SimpleType, s2);
210  machine.addTransition(startState, XsdSchemaToken::MinExclusive, s3);
211  machine.addTransition(startState, XsdSchemaToken::MinInclusive, s3);
212  machine.addTransition(startState, XsdSchemaToken::MaxExclusive, s3);
213  machine.addTransition(startState, XsdSchemaToken::MaxInclusive, s3);
214  machine.addTransition(startState, XsdSchemaToken::TotalDigits, s3);
215  machine.addTransition(startState, XsdSchemaToken::FractionDigits, s3);
216  machine.addTransition(startState, XsdSchemaToken::Length, s3);
217  machine.addTransition(startState, XsdSchemaToken::MinLength, s3);
218  machine.addTransition(startState, XsdSchemaToken::MaxLength, s3);
219  machine.addTransition(startState, XsdSchemaToken::Enumeration, s3);
220  machine.addTransition(startState, XsdSchemaToken::WhiteSpace, s3);
221  machine.addTransition(startState, XsdSchemaToken::Pattern, s3);
222  machine.addTransition(startState, XsdSchemaToken::Assertion, s3);
223  machine.addTransition(startState, XsdSchemaToken::Attribute, s4);
224  machine.addTransition(startState, XsdSchemaToken::AttributeGroup, s4);
225  machine.addTransition(startState, XsdSchemaToken::AnyAttribute, s5);
226  machine.addTransition(startState, XsdSchemaToken::Assert, s6);
227 
228  machine.addTransition(s1, XsdSchemaToken::SimpleType, s2);
235  machine.addTransition(s1, XsdSchemaToken::Length, s3);
236  machine.addTransition(s1, XsdSchemaToken::MinLength, s3);
237  machine.addTransition(s1, XsdSchemaToken::MaxLength, s3);
239  machine.addTransition(s1, XsdSchemaToken::WhiteSpace, s3);
240  machine.addTransition(s1, XsdSchemaToken::Pattern, s3);
241  machine.addTransition(s1, XsdSchemaToken::Assertion, s3);
242  machine.addTransition(s1, XsdSchemaToken::Attribute, s4);
245  machine.addTransition(s1, XsdSchemaToken::Assert, s6);
246 
253  machine.addTransition(s2, XsdSchemaToken::Length, s3);
254  machine.addTransition(s2, XsdSchemaToken::MinLength, s3);
255  machine.addTransition(s2, XsdSchemaToken::MaxLength, s3);
257  machine.addTransition(s2, XsdSchemaToken::WhiteSpace, s3);
258  machine.addTransition(s2, XsdSchemaToken::Pattern, s3);
259  machine.addTransition(s2, XsdSchemaToken::Assertion, s3);
260  machine.addTransition(s2, XsdSchemaToken::Attribute, s4);
263  machine.addTransition(s2, XsdSchemaToken::Assert, s6);
264 
271  machine.addTransition(s3, XsdSchemaToken::Length, s3);
272  machine.addTransition(s3, XsdSchemaToken::MinLength, s3);
273  machine.addTransition(s3, XsdSchemaToken::MaxLength, s3);
275  machine.addTransition(s3, XsdSchemaToken::WhiteSpace, s3);
276  machine.addTransition(s3, XsdSchemaToken::Pattern, s3);
277  machine.addTransition(s3, XsdSchemaToken::Assertion, s3);
278  machine.addTransition(s3, XsdSchemaToken::Attribute, s4);
281  machine.addTransition(s3, XsdSchemaToken::Assert, s6);
282 
283  machine.addTransition(s4, XsdSchemaToken::Attribute, s4);
286  machine.addTransition(s4, XsdSchemaToken::Assert, s6);
287 
288  machine.addTransition(s5, XsdSchemaToken::Assert, s6);
289 
290  machine.addTransition(s6, XsdSchemaToken::Assert, s6);
291 
293  }
294 
295  {
297 
298  // setup state machine for (annotation?, ((attribute | attributeGroup)*, anyAttribute?), assert*) : simple content extension
304 
305  machine.addTransition(startState, XsdSchemaToken::Annotation, s1);
306  machine.addTransition(startState, XsdSchemaToken::Attribute, s2);
307  machine.addTransition(startState, XsdSchemaToken::AttributeGroup, s2);
308  machine.addTransition(startState, XsdSchemaToken::AnyAttribute, s3);
309  machine.addTransition(startState, XsdSchemaToken::Assert, s4);
310 
311  machine.addTransition(s1, XsdSchemaToken::Attribute, s2);
314  machine.addTransition(s1, XsdSchemaToken::Assert, s4);
315 
316  machine.addTransition(s2, XsdSchemaToken::Attribute, s2);
319  machine.addTransition(s2, XsdSchemaToken::Assert, s4);
320 
321  machine.addTransition(s3, XsdSchemaToken::Assert, s4);
322 
323  machine.addTransition(s4, XsdSchemaToken::Assert, s4);
324 
326  }
327 
328  {
330 
331  // setup state machine for (annotation?, openContent?, ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?), assert*)) : complex content restriction/complex content extension
339 
340  machine.addTransition(startState, XsdSchemaToken::Annotation, s1);
341  machine.addTransition(startState, XsdSchemaToken::OpenContent, s2);
342  machine.addTransition(startState, XsdSchemaToken::Group, s3);
343  machine.addTransition(startState, XsdSchemaToken::All, s3);
344  machine.addTransition(startState, XsdSchemaToken::Choice, s3);
345  machine.addTransition(startState, XsdSchemaToken::Sequence, s3);
346  machine.addTransition(startState, XsdSchemaToken::Attribute, s4);
347  machine.addTransition(startState, XsdSchemaToken::AttributeGroup, s4);
348  machine.addTransition(startState, XsdSchemaToken::AnyAttribute, s5);
349  machine.addTransition(startState, XsdSchemaToken::Assert, s6);
350 
352  machine.addTransition(s1, XsdSchemaToken::Group, s3);
353  machine.addTransition(s1, XsdSchemaToken::All, s3);
354  machine.addTransition(s1, XsdSchemaToken::Choice, s3);
355  machine.addTransition(s1, XsdSchemaToken::Sequence, s3);
356  machine.addTransition(s1, XsdSchemaToken::Attribute, s4);
359  machine.addTransition(s1, XsdSchemaToken::Assert, s6);
360 
361  machine.addTransition(s2, XsdSchemaToken::Group, s3);
362  machine.addTransition(s2, XsdSchemaToken::All, s3);
363  machine.addTransition(s2, XsdSchemaToken::Choice, s3);
364  machine.addTransition(s2, XsdSchemaToken::Sequence, s3);
365  machine.addTransition(s2, XsdSchemaToken::Attribute, s4);
368  machine.addTransition(s2, XsdSchemaToken::Assert, s6);
369 
370  machine.addTransition(s3, XsdSchemaToken::Attribute, s4);
373  machine.addTransition(s3, XsdSchemaToken::Assert, s6);
374 
375  machine.addTransition(s4, XsdSchemaToken::Attribute, s4);
378  machine.addTransition(s4, XsdSchemaToken::Assert, s6);
379 
380  machine.addTransition(s5, XsdSchemaToken::Assert, s6);
381 
382  machine.addTransition(s6, XsdSchemaToken::Assert, s6);
383 
386  }
387 
388  {
390 
391  // setup state machine for (annotation?, ((attribute | attributeGroup)*, anyAttribute?)) : named attribute group
396 
397  machine.addTransition(startState, XsdSchemaToken::Annotation, s1);
398  machine.addTransition(startState, XsdSchemaToken::Attribute, s2);
399  machine.addTransition(startState, XsdSchemaToken::AttributeGroup, s2);
400  machine.addTransition(startState, XsdSchemaToken::AnyAttribute, s3);
401 
402  machine.addTransition(s1, XsdSchemaToken::Attribute, s2);
405 
406  machine.addTransition(s2, XsdSchemaToken::Attribute, s2);
409 
411  }
412 
413  {
415 
416  // setup state machine for (annotation?, (all | choice | sequence)?) : group
420 
421  machine.addTransition(startState, XsdSchemaToken::Annotation, s1);
422  machine.addTransition(startState, XsdSchemaToken::All, s2);
423  machine.addTransition(startState, XsdSchemaToken::Choice, s2);
424  machine.addTransition(startState, XsdSchemaToken::Sequence, s2);
425 
426  machine.addTransition(s1, XsdSchemaToken::All, s2);
427  machine.addTransition(s1, XsdSchemaToken::Choice, s2);
428  machine.addTransition(s1, XsdSchemaToken::Sequence, s2);
429 
430  m_stateMachines.insert(XsdTagScope::NamedGroup, machine);
432  }
433 
434  {
436 
437  // setup state machine for (annotation?, (element | any)*) : all
441 
442  machine.addTransition(startState, XsdSchemaToken::Annotation, s1);
443  machine.addTransition(startState, XsdSchemaToken::Element, s2);
444  machine.addTransition(startState, XsdSchemaToken::Any, s2);
445 
446  machine.addTransition(s1, XsdSchemaToken::Element, s2);
447  machine.addTransition(s1, XsdSchemaToken::Any, s2);
448 
449  machine.addTransition(s2, XsdSchemaToken::Element, s2);
450  machine.addTransition(s2, XsdSchemaToken::Any, s2);
451 
452  m_stateMachines.insert(XsdTagScope::All, machine);
453  m_stateMachines.insert(XsdTagScope::LocalAll, machine);
454  }
455 
456  {
458 
459  // setup state machine for (annotation?, (element | group | choice | sequence | any)*) : choice sequence
463 
464  machine.addTransition(startState, XsdSchemaToken::Annotation, s1);
465  machine.addTransition(startState, XsdSchemaToken::Element, s2);
466  machine.addTransition(startState, XsdSchemaToken::Group, s2);
467  machine.addTransition(startState, XsdSchemaToken::Choice, s2);
468  machine.addTransition(startState, XsdSchemaToken::Sequence, s2);
469  machine.addTransition(startState, XsdSchemaToken::Any, s2);
470 
471  machine.addTransition(s1, XsdSchemaToken::Element, s2);
472  machine.addTransition(s1, XsdSchemaToken::Group, s2);
473  machine.addTransition(s1, XsdSchemaToken::Choice, s2);
474  machine.addTransition(s1, XsdSchemaToken::Sequence, s2);
475  machine.addTransition(s1, XsdSchemaToken::Any, s2);
476 
477  machine.addTransition(s2, XsdSchemaToken::Element, s2);
478  machine.addTransition(s2, XsdSchemaToken::Group, s2);
479  machine.addTransition(s2, XsdSchemaToken::Choice, s2);
480  machine.addTransition(s2, XsdSchemaToken::Sequence, s2);
481  machine.addTransition(s2, XsdSchemaToken::Any, s2);
482 
483  m_stateMachines.insert(XsdTagScope::Choice, machine);
484  m_stateMachines.insert(XsdTagScope::LocalChoice, machine);
485  m_stateMachines.insert(XsdTagScope::Sequence, machine);
487  }
488 
489  {
491 
492  // setup state machine for (annotation?) : any/selector/field/notation/include/import/referred attribute group/anyAttribute/all facets/assert
495 
496  machine.addTransition(startState, XsdSchemaToken::Annotation, s1);
497 
498  m_stateMachines.insert(XsdTagScope::Any, machine);
499  m_stateMachines.insert(XsdTagScope::Selector, machine);
500  m_stateMachines.insert(XsdTagScope::Field, machine);
501  m_stateMachines.insert(XsdTagScope::Notation, machine);
502  m_stateMachines.insert(XsdTagScope::Include, machine);
503  m_stateMachines.insert(XsdTagScope::Import, machine);
512  m_stateMachines.insert(XsdTagScope::LengthFacet, machine);
518  m_stateMachines.insert(XsdTagScope::Assert, machine);
519  m_stateMachines.insert(XsdTagScope::Assertion, machine);
520  }
521 
522  {
524 
525  // setup state machine for (annotation?, (selector, field+)) : unique/key/keyref
530 
531  machine.addTransition(startState, XsdSchemaToken::Annotation, s1);
532  machine.addTransition(startState, XsdSchemaToken::Selector, s2);
533 
534  machine.addTransition(s1, XsdSchemaToken::Selector, s2);
535  machine.addTransition(s2, XsdSchemaToken::Field, s3);
536  machine.addTransition(s3, XsdSchemaToken::Field, s3);
537 
538  m_stateMachines.insert(XsdTagScope::Unique, machine);
539  m_stateMachines.insert(XsdTagScope::Key, machine);
540  m_stateMachines.insert(XsdTagScope::KeyRef, machine);
541  }
542 
543  {
545 
546  // setup state machine for (annotation?, (simpleType | complexType)?) : alternative
550 
551  machine.addTransition(startState, XsdSchemaToken::Annotation, s1);
552  machine.addTransition(startState, XsdSchemaToken::SimpleType, s2);
553  machine.addTransition(startState, XsdSchemaToken::ComplexType, s2);
554 
555  machine.addTransition(s1, XsdSchemaToken::SimpleType, s2);
557 
558  m_stateMachines.insert(XsdTagScope::Alternative, machine);
559  }
560 
561  {
563 
564  // setup state machine for (appinfo | documentation)* : annotation
567 
568  machine.addTransition(startState, XsdSchemaToken::Appinfo, s1);
569  machine.addTransition(startState, XsdSchemaToken::Documentation, s1);
570 
571  machine.addTransition(s1, XsdSchemaToken::Appinfo, s1);
573 
574  m_stateMachines.insert(XsdTagScope::Annotation, machine);
575  }
576 
577  {
579 
580  // setup state machine for (annotation?, (restriction | list | union)) : simpleType
584 
585  machine.addTransition(startState, XsdSchemaToken::Annotation, s1);
586  machine.addTransition(startState, XsdSchemaToken::Restriction, s2);
587  machine.addTransition(startState, XsdSchemaToken::List, s2);
588  machine.addTransition(startState, XsdSchemaToken::Union, s2);
589 
591  machine.addTransition(s1, XsdSchemaToken::List, s2);
592  machine.addTransition(s1, XsdSchemaToken::Union, s2);
593 
596  }
597 
598  {
600 
601  // setup state machine for (annotation?, (simpleType?, (minExclusive | minInclusive | maxExclusive | maxInclusive | totalDigits | fractionDigits | length | minLength | maxLength | enumeration | whiteSpace | pattern | assertion)*)) : simple type restriction
606 
607  machine.addTransition(startState, XsdSchemaToken::Annotation, s1);
608  machine.addTransition(startState, XsdSchemaToken::SimpleType, s2);
609  machine.addTransition(startState, XsdSchemaToken::MinExclusive, s3);
610  machine.addTransition(startState, XsdSchemaToken::MinInclusive, s3);
611  machine.addTransition(startState, XsdSchemaToken::MaxExclusive, s3);
612  machine.addTransition(startState, XsdSchemaToken::MaxInclusive, s3);
613  machine.addTransition(startState, XsdSchemaToken::TotalDigits, s3);
614  machine.addTransition(startState, XsdSchemaToken::FractionDigits, s3);
615  machine.addTransition(startState, XsdSchemaToken::Length, s3);
616  machine.addTransition(startState, XsdSchemaToken::MinLength, s3);
617  machine.addTransition(startState, XsdSchemaToken::MaxLength, s3);
618  machine.addTransition(startState, XsdSchemaToken::Enumeration, s3);
619  machine.addTransition(startState, XsdSchemaToken::WhiteSpace, s3);
620  machine.addTransition(startState, XsdSchemaToken::Pattern, s3);
621  machine.addTransition(startState, XsdSchemaToken::Assertion, s3);
622 
623  machine.addTransition(s1, XsdSchemaToken::SimpleType, s2);
630  machine.addTransition(s1, XsdSchemaToken::Length, s3);
631  machine.addTransition(s1, XsdSchemaToken::MinLength, s3);
632  machine.addTransition(s1, XsdSchemaToken::MaxLength, s3);
634  machine.addTransition(s1, XsdSchemaToken::WhiteSpace, s3);
635  machine.addTransition(s1, XsdSchemaToken::Pattern, s3);
636  machine.addTransition(s1, XsdSchemaToken::Assertion, s3);
637 
644  machine.addTransition(s2, XsdSchemaToken::Length, s3);
645  machine.addTransition(s2, XsdSchemaToken::MinLength, s3);
646  machine.addTransition(s2, XsdSchemaToken::MaxLength, s3);
648  machine.addTransition(s2, XsdSchemaToken::WhiteSpace, s3);
649  machine.addTransition(s2, XsdSchemaToken::Pattern, s3);
650  machine.addTransition(s2, XsdSchemaToken::Assertion, s3);
651 
658  machine.addTransition(s3, XsdSchemaToken::Length, s3);
659  machine.addTransition(s3, XsdSchemaToken::MinLength, s3);
660  machine.addTransition(s3, XsdSchemaToken::MaxLength, s3);
662  machine.addTransition(s3, XsdSchemaToken::WhiteSpace, s3);
663  machine.addTransition(s3, XsdSchemaToken::Pattern, s3);
664  machine.addTransition(s3, XsdSchemaToken::Assertion, s3);
665 
667  }
668 
669  {
671 
672  // setup state machine for (annotation?, simpleType?) : list
676 
677  machine.addTransition(startState, XsdSchemaToken::Annotation, s1);
678  machine.addTransition(startState, XsdSchemaToken::SimpleType, s2);
679 
680  machine.addTransition(s1, XsdSchemaToken::SimpleType, s2);
681 
682  m_stateMachines.insert(XsdTagScope::List, machine);
683  }
684 
685  {
687 
688  // setup state machine for (annotation?, simpleType*) : union
692 
693  machine.addTransition(startState, XsdSchemaToken::Annotation, s1);
694  machine.addTransition(startState, XsdSchemaToken::SimpleType, s2);
695 
696  machine.addTransition(s1, XsdSchemaToken::SimpleType, s2);
697  machine.addTransition(s2, XsdSchemaToken::SimpleType, s2);
698 
699  m_stateMachines.insert(XsdTagScope::Union, machine);
700  }
701 
702  {
704 
705  // setup state machine for ((include | import | redefine |i override | annotation)*, (defaultOpenContent, annotation*)?, (((simpleType | complexType | group | attributeGroup) | element | attribute | notation), annotation*)*) : schema
712 
713  machine.addTransition(startState, XsdSchemaToken::Include, s1);
714  machine.addTransition(startState, XsdSchemaToken::Import, s1);
715  machine.addTransition(startState, XsdSchemaToken::Redefine, s1);
716  machine.addTransition(startState, XsdSchemaToken::Override, s1);
717  machine.addTransition(startState, XsdSchemaToken::Annotation, s1);
718  machine.addTransition(startState, XsdSchemaToken::DefaultOpenContent, s2);
719  machine.addTransition(startState, XsdSchemaToken::SimpleType, s4);
720  machine.addTransition(startState, XsdSchemaToken::ComplexType, s4);
721  machine.addTransition(startState, XsdSchemaToken::Group, s4);
722  machine.addTransition(startState, XsdSchemaToken::AttributeGroup, s4);
723  machine.addTransition(startState, XsdSchemaToken::Element, s4);
724  machine.addTransition(startState, XsdSchemaToken::Attribute, s4);
725  machine.addTransition(startState, XsdSchemaToken::Notation, s4);
726 
727  machine.addTransition(s1, XsdSchemaToken::Include, s1);
728  machine.addTransition(s1, XsdSchemaToken::Import, s1);
729  machine.addTransition(s1, XsdSchemaToken::Redefine, s1);
730  machine.addTransition(s1, XsdSchemaToken::Override, s1);
731  machine.addTransition(s1, XsdSchemaToken::Annotation, s1);
733  machine.addTransition(s1, XsdSchemaToken::SimpleType, s4);
735  machine.addTransition(s1, XsdSchemaToken::Group, s4);
737  machine.addTransition(s1, XsdSchemaToken::Element, s4);
738  machine.addTransition(s1, XsdSchemaToken::Attribute, s4);
739  machine.addTransition(s1, XsdSchemaToken::Notation, s4);
740 
741  machine.addTransition(s2, XsdSchemaToken::Annotation, s3);
742  machine.addTransition(s2, XsdSchemaToken::SimpleType, s4);
744  machine.addTransition(s2, XsdSchemaToken::Group, s4);
746  machine.addTransition(s2, XsdSchemaToken::Element, s4);
747  machine.addTransition(s2, XsdSchemaToken::Attribute, s4);
748  machine.addTransition(s2, XsdSchemaToken::Notation, s4);
749 
750  machine.addTransition(s3, XsdSchemaToken::SimpleType, s4);
752  machine.addTransition(s3, XsdSchemaToken::Group, s4);
754  machine.addTransition(s3, XsdSchemaToken::Element, s4);
755  machine.addTransition(s3, XsdSchemaToken::Attribute, s4);
756  machine.addTransition(s3, XsdSchemaToken::Notation, s4);
757 
758  machine.addTransition(s4, XsdSchemaToken::SimpleType, s4);
760  machine.addTransition(s4, XsdSchemaToken::Group, s4);
762  machine.addTransition(s4, XsdSchemaToken::Element, s4);
763  machine.addTransition(s4, XsdSchemaToken::Attribute, s4);
764  machine.addTransition(s4, XsdSchemaToken::Notation, s4);
765  machine.addTransition(s4, XsdSchemaToken::Annotation, s5);
766 
767  machine.addTransition(s5, XsdSchemaToken::SimpleType, s4);
769  machine.addTransition(s5, XsdSchemaToken::Group, s4);
771  machine.addTransition(s5, XsdSchemaToken::Element, s4);
772  machine.addTransition(s5, XsdSchemaToken::Attribute, s4);
773  machine.addTransition(s5, XsdSchemaToken::Notation, s4);
774  machine.addTransition(s5, XsdSchemaToken::Annotation, s5);
775 
776  m_stateMachines.insert(XsdTagScope::Schema, machine);
777  }
778 
779  {
781 
782  // setup state machine for (annotation?, any) : defaultOpenContent
786 
787  machine.addTransition(startState, XsdSchemaToken::Annotation, s1);
788  machine.addTransition(startState, XsdSchemaToken::Any, s2);
789 
790  machine.addTransition(s1, XsdSchemaToken::Any, s2);
791 
793  }
794 
795  {
797 
798  // setup state machine for (annotation | (simpleType | complexType | group | attributeGroup))* : redefine
801 
802  machine.addTransition(startState, XsdSchemaToken::Annotation, s1);
803  machine.addTransition(startState, XsdSchemaToken::SimpleType, s1);
804  machine.addTransition(startState, XsdSchemaToken::ComplexType, s1);
805  machine.addTransition(startState, XsdSchemaToken::Group, s1);
806  machine.addTransition(startState, XsdSchemaToken::AttributeGroup, s1);
807 
808  machine.addTransition(s1, XsdSchemaToken::Annotation, s1);
809  machine.addTransition(s1, XsdSchemaToken::SimpleType, s1);
811  machine.addTransition(s1, XsdSchemaToken::Group, s1);
813 
814  m_stateMachines.insert(XsdTagScope::Redefine, machine);
815  }
816 
817  {
819 
820  // setup state machine for (annotation | (simpleType | complexType | group | attributeGroup | element | attribute | notation))* : override
823 
824  machine.addTransition(startState, XsdSchemaToken::Annotation, s1);
825  machine.addTransition(startState, XsdSchemaToken::SimpleType, s1);
826  machine.addTransition(startState, XsdSchemaToken::ComplexType, s1);
827  machine.addTransition(startState, XsdSchemaToken::Group, s1);
828  machine.addTransition(startState, XsdSchemaToken::AttributeGroup, s1);
829  machine.addTransition(startState, XsdSchemaToken::Element, s1);
830  machine.addTransition(startState, XsdSchemaToken::Attribute, s1);
831  machine.addTransition(startState, XsdSchemaToken::Notation, s1);
832 
833  machine.addTransition(s1, XsdSchemaToken::Annotation, s1);
834  machine.addTransition(s1, XsdSchemaToken::SimpleType, s1);
836  machine.addTransition(s1, XsdSchemaToken::Group, s1);
838  machine.addTransition(s1, XsdSchemaToken::Element, s1);
839  machine.addTransition(s1, XsdSchemaToken::Attribute, s1);
840  machine.addTransition(s1, XsdSchemaToken::Notation, s1);
841 
842  m_stateMachines.insert(XsdTagScope::Override, machine);
843  }
844 }
845 
847 {
848  NamePool::Ptr namePool(m_namePool);
850 
899 }
900 
static const AtomicType::Ptr xsBase64Binary
static const AtomicType::Ptr xsID
static const AtomicType::Ptr xsDayTimeDuration
static const AtomicType::Ptr xsInt
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
void addTransition(StateId start, TransitionType transition, StateId end)
static const AtomicType::Ptr xsShort
static const AtomicType::Ptr xsNegativeInteger
static const AtomicType::Ptr xsByte
static const AtomicType::Ptr xsDuration
static const AtomicType::Ptr xsGYearMonth
static const AtomicType::Ptr xsNormalizedString
static const AtomicType::Ptr xsGMonthDay
QStringRef name() const
Returns the local name of a StartElement, EndElement, or an EntityReference.
static const AtomicType::Ptr xsYearMonthDuration
static const AtomicType::Ptr xsName
static const AtomicType::Ptr xsUnsignedByte
static const AtomicType::Ptr xsIDREF
static const AtomicType::Ptr xsString
static const AtomicType::Ptr xsNMTOKEN
static const SchemaType::Ptr xsAnyType
static const AtomicType::Ptr xsGDay
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
static const AtomicType::Ptr xsDateTime
static const AtomicType::Ptr xsUnsignedInt
The namespace for the internal API of QtXmlPatterns.
const_iterator insert(const T &value)
Definition: qset.h:179
static const AtomicType::Ptr xsDouble
static const AtomicType::Ptr xsENTITY
static const AtomicType::Ptr xsGYear
static const AtomicType::Ptr xsUntypedAtomic
QHash< XsdTagScope::Type, XsdStateMachine< XsdSchemaToken::NodeName > > m_stateMachines
static const AtomicType::Ptr xsNonNegativeInteger
static const AtomicType::Ptr xsQName
static const AtomicType::Ptr xsNonPositiveInteger
static const SchemaType::Ptr xsAnySimpleType
static const AtomicType::Ptr xsFloat
static const AtomicType::Ptr xsInteger
static const AtomicType::Ptr xsTime
static const AtomicType::Ptr xsUnsignedShort
static const AtomicType::Ptr xsDecimal
static const AtomicType::Ptr xsBoolean
static const AtomicType::Ptr xsNCName
static const AtomicType::Ptr xsAnyAtomicType
static const AtomicType::Ptr xsPositiveInteger
static const AtomicType::Ptr xsDate
static const AtomicType::Ptr xsLanguage
static const AtomicType::Ptr xsLong
static const AtomicType::Ptr xsNOTATION
static const AtomicType::Ptr xsGMonth
static const SchemaType::Ptr xsUntyped
static const AtomicType::Ptr xsHexBinary
static const AtomicType::Ptr xsUnsignedLong
static const AtomicType::Ptr xsAnyURI
StateId addState(StateType type)
static const AtomicType::Ptr xsToken
void reserve(int size)
Definition: qset.h:241