summaryrefslogtreecommitdiffstats
path: root/src/xmlpatterns/qtokenautomaton/qtokenautomaton.xsd
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2009-03-23 09:34:13 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2009-03-23 09:34:13 (GMT)
commit67ad0519fd165acee4a4d2a94fa502e9e4847bd0 (patch)
tree1dbf50b3dff8d5ca7e9344733968c72704eb15ff /src/xmlpatterns/qtokenautomaton/qtokenautomaton.xsd
downloadQt-67ad0519fd165acee4a4d2a94fa502e9e4847bd0.zip
Qt-67ad0519fd165acee4a4d2a94fa502e9e4847bd0.tar.gz
Qt-67ad0519fd165acee4a4d2a94fa502e9e4847bd0.tar.bz2
Long live Qt!
Diffstat (limited to 'src/xmlpatterns/qtokenautomaton/qtokenautomaton.xsd')
-rw-r--r--src/xmlpatterns/qtokenautomaton/qtokenautomaton.xsd89
1 files changed, 89 insertions, 0 deletions
diff --git a/src/xmlpatterns/qtokenautomaton/qtokenautomaton.xsd b/src/xmlpatterns/qtokenautomaton/qtokenautomaton.xsd
new file mode 100644
index 0000000..322c50e
--- /dev/null
+++ b/src/xmlpatterns/qtokenautomaton/qtokenautomaton.xsd
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+TODO docs
+-->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified">
+
+ <xs:element name="tokenAutomaton" type="tokenAutomatonElementType"/>
+
+ <xs:simpleType name="cppIdentifierType">
+ <xs:restriction base="xs:string">
+ <xs:pattern value="[a-zA-Z_][a-zA-Z0-9_]*"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="filenameType">
+ <xs:restriction base="xs:string">
+ <!-- At least one character. -->
+ <xs:pattern value=".+"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="scopeType">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="protected"/>
+ <xs:enumeration value="public"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:complexType name="tokenAutomatonElementType">
+ <xs:sequence>
+ <xs:element name="tokens" minOccurs="1" maxOccurs="1" type="tokensElementType">
+ <!-- Each token name (the enum name), must be unique. -->
+ <xs:unique name="tokenNames">
+ <xs:selector xpath="token"/>
+ <xs:field xpath="@name"/>
+ </xs:unique>
+ <!-- Each string must be unique, otherwise one string can map to two or
+ more enums. -->
+ <xs:unique name="tokenValues">
+ <xs:selector xpath="token"/>
+ <xs:field xpath="."/>
+ </xs:unique>
+ </xs:element>
+ <xs:element name="boilerplate" minOccurs="0" maxOccurs="1" type="boilerplateElementType"/>
+
+ </xs:sequence>
+ <xs:attribute name="className" type="cppIdentifierType"/>
+ <xs:attribute name="includeGuardName" type="cppIdentifierType"/>
+ <xs:attribute name="headerFile" type="filenameType" use="required"/>
+ <xs:attribute name="namespace" type="cppIdentifierType" use="optional"/>
+ <xs:attribute name="sourceFile" type="filenameType" use="required"/>
+ <xs:attribute name="scope" type="scopeType" use="required"/>
+ <xs:attribute name="defaultToken" type="cppIdentifierType" use="required"/>
+ <xs:attribute name="hasToString" type="xs:boolean" use="required"/>
+ <xs:attribute name="tokenEnum" type="cppIdentifierType" use="required"/>
+ </xs:complexType>
+
+ <xs:complexType name="tokensElementType">
+ <xs:sequence>
+ <xs:element name="token" maxOccurs="unbounded" type="tokenElementType" minOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="tokenElementType">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="name" use="optional" type="cppIdentifierType"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <xs:complexType name="boilerplateElementType">
+ <xs:sequence>
+ <xs:element name="prolog" maxOccurs="1" type="prologElementType" minOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="prologElementType">
+ <xs:simpleContent>
+ <xs:extension base="xs:string"/>
+ </xs:simpleContent>
+ </xs:complexType>
+
+</xs:schema>
+<!--
+vim: et:ts=4:sw=4:sts=4
+-->