forked from davidmalcolm/gcc-python-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.rng
132 lines (117 loc) · 3.54 KB
/
api.rng
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2012, 2013 David Malcolm <dmalcolm@redhat.com>
Copyright 2012, 2013 Red Hat, Inc.
This is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see
<http://www.gnu.org/licenses/>.
-->
<!--
RelaxNG schema for the api format
-->
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
<start>
<element name="api">
<attribute name="name"> <text/> </attribute>
<element name="doc">
<text/>
</element>
<zeroOrMore>
<element name="type">
<attribute name="name"> <text/> </attribute>
<optional>
<attribute name="base"> <text/> </attribute>
</optional>
<optional>
<attribute name="inner"> <text/> </attribute>
</optional>
<optional>
<attribute name="varname"> <text/> </attribute>
</optional>
<optional>
<element name="doc">
<text/>
</element>
</optional>
<!-- the attributes of this type -->
<zeroOrMore>
<ref name="attribute"/>
</zeroOrMore>
<zeroOrMore>
<ref name="iterator"/>
</zeroOrMore>
</element>
</zeroOrMore>
<!-- global attributes -->
<zeroOrMore>
<ref name="attribute"/>
</zeroOrMore>
<!-- global iterators -->
<zeroOrMore>
<ref name="iterator"/>
</zeroOrMore>
<!-- global functions -->
<zeroOrMore>
<ref name="function"/>
</zeroOrMore>
</element>
</start>
<!-- <attribute> is shared by both <type> and by <api> -->
<define name="attribute">
<element name="attribute">
<attribute name="name"> <text/> </attribute>
<attribute name="kind"> <text/> </attribute>
<optional>
<attribute name="access">
<choice>
<value type="string">rw</value>
<value type="string">r</value> <!-- default to readonly -->
</choice>
</attribute>
</optional>
<optional>
<element name="doc">
<text/>
</element>
</optional>
</element>
</define>
<!-- <iterator> is shared by both <type> and by <api> -->
<define name="iterator">
<element name="iterator">
<attribute name="name"> <text/> </attribute>
<attribute name="kind"> <text/> </attribute>
<optional>
<element name="doc">
<text/>
</element>
</optional>
</element>
</define>
<!-- <function> is shared by both <type> and by <api> -->
<define name="function">
<element name="function">
<attribute name="name"> <text/> </attribute>
<attribute name="returntype"> <text/> </attribute>
<zeroOrMore>
<element name="parameter">
<attribute name="name"> <text/> </attribute>
<attribute name="type"> <text/> </attribute>
</element>
</zeroOrMore>
<optional>
<element name="doc">
<text/>
</element>
</optional>
</element>
</define>
</grammar>