0
|
1 |
<?xml version="1.0" encoding="UTF-8" ?>
|
|
2 |
<!--
|
|
3 |
TODO docs
|
|
4 |
-->
|
|
5 |
|
|
6 |
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
|
7 |
elementFormDefault="qualified">
|
|
8 |
|
|
9 |
<xs:element name="tokenAutomaton" type="tokenAutomatonElementType"/>
|
|
10 |
|
|
11 |
<xs:simpleType name="cppIdentifierType">
|
|
12 |
<xs:restriction base="xs:string">
|
|
13 |
<xs:pattern value="[a-zA-Z_][a-zA-Z0-9_]*"/>
|
|
14 |
</xs:restriction>
|
|
15 |
</xs:simpleType>
|
|
16 |
|
|
17 |
<xs:simpleType name="filenameType">
|
|
18 |
<xs:restriction base="xs:string">
|
|
19 |
<!-- At least one character. -->
|
|
20 |
<xs:pattern value=".+"/>
|
|
21 |
</xs:restriction>
|
|
22 |
</xs:simpleType>
|
|
23 |
|
|
24 |
<xs:simpleType name="scopeType">
|
|
25 |
<xs:restriction base="xs:string">
|
|
26 |
<xs:enumeration value="protected"/>
|
|
27 |
<xs:enumeration value="public"/>
|
|
28 |
</xs:restriction>
|
|
29 |
</xs:simpleType>
|
|
30 |
|
|
31 |
<xs:complexType name="tokenAutomatonElementType">
|
|
32 |
<xs:sequence>
|
|
33 |
<xs:element name="tokens" minOccurs="1" maxOccurs="1" type="tokensElementType">
|
|
34 |
<!-- Each token name (the enum name), must be unique. -->
|
|
35 |
<xs:unique name="tokenNames">
|
|
36 |
<xs:selector xpath="token"/>
|
|
37 |
<xs:field xpath="@name"/>
|
|
38 |
</xs:unique>
|
|
39 |
<!-- Each string must be unique, otherwise one string can map to two or
|
|
40 |
more enums. -->
|
|
41 |
<xs:unique name="tokenValues">
|
|
42 |
<xs:selector xpath="token"/>
|
|
43 |
<xs:field xpath="."/>
|
|
44 |
</xs:unique>
|
|
45 |
</xs:element>
|
|
46 |
<xs:element name="boilerplate" minOccurs="0" maxOccurs="1" type="boilerplateElementType"/>
|
|
47 |
|
|
48 |
</xs:sequence>
|
|
49 |
<xs:attribute name="className" type="cppIdentifierType"/>
|
|
50 |
<xs:attribute name="includeGuardName" type="cppIdentifierType"/>
|
|
51 |
<xs:attribute name="headerFile" type="filenameType" use="required"/>
|
|
52 |
<xs:attribute name="namespace" type="cppIdentifierType" use="optional"/>
|
|
53 |
<xs:attribute name="sourceFile" type="filenameType" use="required"/>
|
|
54 |
<xs:attribute name="scope" type="scopeType" use="required"/>
|
|
55 |
<xs:attribute name="defaultToken" type="cppIdentifierType" use="required"/>
|
|
56 |
<xs:attribute name="hasToString" type="xs:boolean" use="required"/>
|
|
57 |
<xs:attribute name="tokenEnum" type="cppIdentifierType" use="required"/>
|
|
58 |
</xs:complexType>
|
|
59 |
|
|
60 |
<xs:complexType name="tokensElementType">
|
|
61 |
<xs:sequence>
|
|
62 |
<xs:element name="token" maxOccurs="unbounded" type="tokenElementType" minOccurs="1"/>
|
|
63 |
</xs:sequence>
|
|
64 |
</xs:complexType>
|
|
65 |
|
|
66 |
<xs:complexType name="tokenElementType">
|
|
67 |
<xs:simpleContent>
|
|
68 |
<xs:extension base="xs:string">
|
|
69 |
<xs:attribute name="name" use="optional" type="cppIdentifierType"/>
|
|
70 |
</xs:extension>
|
|
71 |
</xs:simpleContent>
|
|
72 |
</xs:complexType>
|
|
73 |
|
|
74 |
<xs:complexType name="boilerplateElementType">
|
|
75 |
<xs:sequence>
|
|
76 |
<xs:element name="prolog" maxOccurs="1" type="prologElementType" minOccurs="1"/>
|
|
77 |
</xs:sequence>
|
|
78 |
</xs:complexType>
|
|
79 |
|
|
80 |
<xs:complexType name="prologElementType">
|
|
81 |
<xs:simpleContent>
|
|
82 |
<xs:extension base="xs:string"/>
|
|
83 |
</xs:simpleContent>
|
|
84 |
</xs:complexType>
|
|
85 |
|
|
86 |
</xs:schema>
|
|
87 |
<!--
|
|
88 |
vim: et:ts=4:sw=4:sts=4
|
|
89 |
-->
|