Dmitri Gribenko | 740c0fb | 2012-08-07 17:54:38 +0000 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | |
| 3 | <grammar xmlns="http://relaxng.org/ns/structure/1.0" |
| 4 | datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> |
| 5 | |
| 6 | <start> |
| 7 | <choice> |
| 8 | <!-- Everything else not explicitly mentioned below. --> |
| 9 | <ref name="Other" /> |
| 10 | |
| 11 | <ref name="Function" /> |
| 12 | <ref name="Class" /> |
| 13 | <ref name="Variable" /> |
| 14 | <ref name="Namespace" /> |
| 15 | <ref name="Typedef" /> |
Dmitri Gribenko | 168d234 | 2012-08-07 18:59:04 +0000 | [diff] [blame] | 16 | <ref name="Enum" /> |
Dmitri Gribenko | 740c0fb | 2012-08-07 17:54:38 +0000 | [diff] [blame] | 17 | </choice> |
| 18 | </start> |
| 19 | |
| 20 | <define name="Other"> |
| 21 | <element name="Other"> |
| 22 | <ref name="attrSourceLocation" /> |
| 23 | <ref name="Name" /> |
| 24 | <optional> |
| 25 | <ref name="USR" /> |
| 26 | </optional> |
| 27 | <optional> |
| 28 | <ref name="Abstract" /> |
| 29 | </optional> |
| 30 | <optional> |
| 31 | <ref name="TemplateParameters" /> |
| 32 | </optional> |
| 33 | <optional> |
| 34 | <ref name="Parameters" /> |
| 35 | </optional> |
| 36 | <optional> |
| 37 | <ref name="ResultDiscussion" /> |
| 38 | </optional> |
| 39 | <optional> |
| 40 | <ref name="Discussion" /> |
| 41 | </optional> |
| 42 | </element> |
| 43 | </define> |
| 44 | |
| 45 | <define name="Function"> |
| 46 | <element name="Function"> |
| 47 | <optional> |
| 48 | <attribute name="templateKind"> |
| 49 | <choice> |
| 50 | <value>template</value> |
| 51 | <value>specialization</value> |
| 52 | </choice> |
| 53 | </attribute> |
| 54 | </optional> |
| 55 | <ref name="attrSourceLocation" /> |
| 56 | |
| 57 | <optional> |
| 58 | <attribute name="isInstanceMethod"> |
| 59 | <data type="boolean" /> |
| 60 | </attribute> |
| 61 | </optional> |
| 62 | <optional> |
| 63 | <attribute name="isClassMethod"> |
| 64 | <data type="boolean" /> |
| 65 | </attribute> |
| 66 | </optional> |
| 67 | |
| 68 | <ref name="Name" /> |
| 69 | <optional> |
| 70 | <ref name="USR" /> |
| 71 | </optional> |
| 72 | <!-- TODO: Add exception specification. --> |
| 73 | <optional> |
| 74 | <ref name="Abstract" /> |
| 75 | </optional> |
| 76 | <optional> |
| 77 | <ref name="TemplateParameters" /> |
| 78 | </optional> |
| 79 | <optional> |
| 80 | <ref name="Parameters" /> |
| 81 | </optional> |
| 82 | <optional> |
| 83 | <ref name="ResultDiscussion" /> |
| 84 | </optional> |
| 85 | <optional> |
| 86 | <ref name="Discussion" /> |
| 87 | </optional> |
| 88 | </element> |
| 89 | </define> |
| 90 | |
| 91 | <define name="Class"> |
| 92 | <element name="Class"> |
| 93 | <optional> |
| 94 | <attribute name="templateKind"> |
| 95 | <choice> |
| 96 | <value>template</value> |
| 97 | <value>specialization</value> |
| 98 | <value>partialSpecialization</value> |
| 99 | </choice> |
| 100 | </attribute> |
| 101 | </optional> |
| 102 | <ref name="attrSourceLocation" /> |
| 103 | |
| 104 | <ref name="Name" /> |
| 105 | <optional> |
| 106 | <ref name="USR" /> |
| 107 | </optional> |
| 108 | <optional> |
| 109 | <ref name="Abstract" /> |
| 110 | </optional> |
| 111 | <optional> |
| 112 | <ref name="TemplateParameters" /> |
| 113 | </optional> |
| 114 | |
| 115 | <!-- Parameters and results don't make sense for classes, but the user |
| 116 | can specify \param or \returns in a comment anyway. --> |
| 117 | <optional> |
| 118 | <ref name="Parameters" /> |
| 119 | </optional> |
| 120 | <optional> |
| 121 | <ref name="ResultDiscussion" /> |
| 122 | </optional> |
| 123 | |
| 124 | <optional> |
| 125 | <ref name="Discussion" /> |
| 126 | </optional> |
| 127 | </element> |
| 128 | </define> |
| 129 | |
| 130 | <define name="Variable"> |
| 131 | <element name="Variable"> |
| 132 | <ref name="attrSourceLocation" /> |
| 133 | <ref name="Name" /> |
| 134 | <optional> |
| 135 | <ref name="USR" /> |
| 136 | </optional> |
| 137 | <optional> |
| 138 | <ref name="Abstract" /> |
| 139 | </optional> |
| 140 | |
| 141 | <!-- Template parameters, parameters and results don't make sense for |
| 142 | variables, but the user can specify \tparam \param or \returns |
| 143 | in a comment anyway. --> |
| 144 | <optional> |
| 145 | <ref name="TemplateParameters" /> |
| 146 | </optional> |
| 147 | <optional> |
| 148 | <ref name="Parameters" /> |
| 149 | </optional> |
| 150 | <optional> |
| 151 | <ref name="ResultDiscussion" /> |
| 152 | </optional> |
| 153 | |
| 154 | <optional> |
| 155 | <ref name="Discussion" /> |
| 156 | </optional> |
| 157 | </element> |
| 158 | </define> |
| 159 | |
| 160 | <define name="Namespace"> |
| 161 | <element name="Namespace"> |
| 162 | <ref name="attrSourceLocation" /> |
| 163 | <ref name="Name" /> |
| 164 | <optional> |
| 165 | <ref name="USR" /> |
| 166 | </optional> |
| 167 | <optional> |
| 168 | <ref name="Abstract" /> |
| 169 | </optional> |
| 170 | |
| 171 | <!-- Template parameters, parameters and results don't make sense for |
| 172 | namespaces, but the user can specify \tparam, \param or \returns |
| 173 | in a comment anyway. --> |
| 174 | <optional> |
| 175 | <ref name="TemplateParameters" /> |
| 176 | </optional> |
| 177 | <optional> |
| 178 | <ref name="Parameters" /> |
| 179 | </optional> |
| 180 | <optional> |
| 181 | <ref name="ResultDiscussion" /> |
| 182 | </optional> |
| 183 | |
| 184 | <optional> |
| 185 | <ref name="Discussion" /> |
| 186 | </optional> |
| 187 | </element> |
| 188 | </define> |
| 189 | |
| 190 | <define name="Typedef"> |
| 191 | <element name="Typedef"> |
| 192 | <ref name="attrSourceLocation" /> |
| 193 | <ref name="Name" /> |
| 194 | <optional> |
| 195 | <ref name="USR" /> |
| 196 | </optional> |
| 197 | <optional> |
| 198 | <ref name="Abstract" /> |
| 199 | </optional> |
| 200 | |
| 201 | <optional> |
| 202 | <ref name="TemplateParameters" /> |
| 203 | </optional> |
| 204 | |
| 205 | <!-- Parameters and results might make sense for typedefs if the type is |
| 206 | a function pointer type. --> |
| 207 | <optional> |
| 208 | <ref name="Parameters" /> |
| 209 | </optional> |
| 210 | <optional> |
| 211 | <ref name="ResultDiscussion" /> |
| 212 | </optional> |
| 213 | |
| 214 | <optional> |
| 215 | <ref name="Discussion" /> |
| 216 | </optional> |
| 217 | </element> |
| 218 | </define> |
| 219 | |
Dmitri Gribenko | 168d234 | 2012-08-07 18:59:04 +0000 | [diff] [blame] | 220 | <define name="Enum"> |
| 221 | <element name="Enum"> |
| 222 | <ref name="attrSourceLocation" /> |
| 223 | <ref name="Name" /> |
| 224 | <optional> |
| 225 | <ref name="USR" /> |
| 226 | </optional> |
| 227 | <optional> |
| 228 | <ref name="Abstract" /> |
| 229 | </optional> |
| 230 | |
| 231 | <!-- Template parameters, parameters and results don't make sense for |
| 232 | enums, but the user can specify \tparam \param or \returns in a |
| 233 | comment anyway. --> |
| 234 | <optional> |
| 235 | <ref name="TemplateParameters" /> |
| 236 | </optional> |
| 237 | <optional> |
| 238 | <ref name="Parameters" /> |
| 239 | </optional> |
| 240 | <optional> |
| 241 | <ref name="ResultDiscussion" /> |
| 242 | </optional> |
| 243 | |
| 244 | <optional> |
| 245 | <ref name="Discussion" /> |
| 246 | </optional> |
| 247 | </element> |
| 248 | </define> |
| 249 | |
Dmitri Gribenko | 740c0fb | 2012-08-07 17:54:38 +0000 | [diff] [blame] | 250 | <define name="attrSourceLocation"> |
| 251 | <optional> |
| 252 | <attribute name="file"> |
| 253 | <!-- Non-empty text content. --> |
| 254 | <data type="string"> |
| 255 | <param name="pattern">.*\S.*</param> |
| 256 | </data> |
| 257 | </attribute> |
| 258 | </optional> |
| 259 | <optional> |
| 260 | <attribute name="line"> |
| 261 | <data type="positiveInteger" /> |
| 262 | </attribute> |
| 263 | <attribute name="column"> |
| 264 | <data type="positiveInteger" /> |
| 265 | </attribute> |
| 266 | </optional> |
| 267 | </define> |
| 268 | |
| 269 | <define name="Name"> |
| 270 | <element name="Name"> |
| 271 | <!-- Non-empty text content. --> |
| 272 | <data type="string"> |
| 273 | <param name="pattern">.*\S.*</param> |
| 274 | </data> |
| 275 | </element> |
| 276 | </define> |
| 277 | |
| 278 | <define name="USR"> |
| 279 | <element name="USR"> |
| 280 | <!-- Non-empty text content. --> |
| 281 | <data type="string"> |
| 282 | <param name="pattern">.*\S.*</param> |
| 283 | </data> |
| 284 | </element> |
| 285 | </define> |
| 286 | |
| 287 | <define name="Abstract"> |
| 288 | <element name="Abstract"> |
| 289 | <zeroOrMore> |
| 290 | <ref name="TextBlockContent" /> |
| 291 | </zeroOrMore> |
| 292 | </element> |
| 293 | </define> |
| 294 | |
| 295 | <define name="Discussion"> |
| 296 | <element name="Discussion"> |
| 297 | <oneOrMore> |
| 298 | <ref name="TextBlockContent" /> |
| 299 | </oneOrMore> |
| 300 | </element> |
| 301 | </define> |
| 302 | |
| 303 | <define name="TemplateParameters"> |
| 304 | <element name="TemplateParameters"> |
| 305 | <!-- Parameter elements should be sorted according to position. --> |
| 306 | <oneOrMore> |
| 307 | <element name="Parameter"> |
| 308 | <element name="Name"> |
| 309 | <!-- Non-empty text content. --> |
| 310 | <data type="string"> |
| 311 | <param name="pattern">.*\S.*</param> |
| 312 | </data> |
| 313 | </element> |
| 314 | <optional> |
| 315 | <!-- This is index at depth 0. libclang API can return more |
| 316 | information about position, but we expose only essential |
| 317 | information here, since "Parameter" elements are already |
| 318 | sorted. |
| 319 | |
| 320 | "Position" element could be added in future if needed. --> |
| 321 | <element name="Index"> |
| 322 | <data type="nonNegativeInteger" /> |
| 323 | </element> |
| 324 | </optional> |
| 325 | <!-- In general, template parameters with whitespace discussion |
| 326 | should not be emitted. Schema might be more strict here. --> |
| 327 | <element name="Discussion"> |
| 328 | <ref name="TextBlockContent" /> |
| 329 | </element> |
| 330 | </element> |
| 331 | </oneOrMore> |
| 332 | </element> |
| 333 | </define> |
| 334 | |
| 335 | <define name="Parameters"> |
| 336 | <element name="Parameters"> |
| 337 | <!-- Parameter elements should be sorted according to index. --> |
| 338 | <oneOrMore> |
| 339 | <element name="Parameter"> |
| 340 | <element name="Name"> |
| 341 | <!-- Non-empty text content. --> |
| 342 | <data type="string"> |
| 343 | <param name="pattern">.*\S.*</param> |
| 344 | </data> |
| 345 | </element> |
| 346 | <optional> |
| 347 | <element name="Index"> |
| 348 | <data type="nonNegativeInteger" /> |
| 349 | </element> |
| 350 | </optional> |
| 351 | <element name="Direction"> |
| 352 | <attribute name="isExplicit"> |
| 353 | <data type="boolean" /> |
| 354 | </attribute> |
| 355 | <choice> |
| 356 | <value>in</value> |
| 357 | <value>out</value> |
| 358 | <value>in,out</value> |
| 359 | </choice> |
| 360 | </element> |
| 361 | <!-- In general, template parameters with whitespace discussion |
| 362 | should not be emitted, unless direction is explicitly specified. |
| 363 | Schema might be more strict here. --> |
| 364 | <element name="Discussion"> |
| 365 | <ref name="TextBlockContent" /> |
| 366 | </element> |
| 367 | </element> |
| 368 | </oneOrMore> |
| 369 | </element> |
| 370 | </define> |
| 371 | |
| 372 | <define name="ResultDiscussion"> |
| 373 | <element name="ResultDiscussion"> |
| 374 | <zeroOrMore> |
| 375 | <ref name="TextBlockContent" /> |
| 376 | </zeroOrMore> |
| 377 | </element> |
| 378 | </define> |
| 379 | |
| 380 | <define name="TextBlockContent"> |
| 381 | <choice> |
| 382 | <element name="Para"> |
| 383 | <zeroOrMore> |
| 384 | <ref name="TextInlineContent" /> |
| 385 | </zeroOrMore> |
| 386 | </element> |
| 387 | <element name="Verbatim"> |
Dmitri Gribenko | 6cffc19 | 2012-08-08 22:10:24 +0000 | [diff] [blame] | 388 | <attribute name="xml:space"> |
| 389 | <value>preserve</value> |
| 390 | </attribute> |
Dmitri Gribenko | 740c0fb | 2012-08-07 17:54:38 +0000 | [diff] [blame] | 391 | <attribute name="kind"> |
| 392 | <!-- TODO: add all Doxygen verbatim kinds --> |
| 393 | <choice> |
| 394 | <value>code</value> |
| 395 | <value>verbatim</value> |
| 396 | </choice> |
| 397 | </attribute> |
| 398 | <text /> |
| 399 | </element> |
| 400 | </choice> |
| 401 | </define> |
| 402 | |
| 403 | <define name="TextInlineContent"> |
| 404 | <choice> |
| 405 | <text /> |
| 406 | <element name="bold"> |
| 407 | <!-- Non-empty text content. --> |
| 408 | <data type="string"> |
| 409 | <param name="pattern">.*\S.*</param> |
| 410 | </data> |
| 411 | </element> |
| 412 | <element name="monospaced"> |
| 413 | <!-- Non-empty text content. --> |
| 414 | <data type="string"> |
| 415 | <param name="pattern">.*\S.*</param> |
| 416 | </data> |
| 417 | </element> |
| 418 | <element name="emphasized"> |
| 419 | <!-- Non-empty text content. --> |
| 420 | <data type="string"> |
| 421 | <param name="pattern">.*\S.*</param> |
| 422 | </data> |
| 423 | </element> |
| 424 | <element name="rawHTML"> |
| 425 | <!-- Non-empty text content. --> |
| 426 | <data type="string"> |
| 427 | <param name="pattern">.*\S.*</param> |
| 428 | </data> |
| 429 | </element> |
| 430 | </choice> |
| 431 | </define> |
| 432 | |
| 433 | </grammar> |
| 434 | |