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> |
Fariborz Jahanian | 35760a8 | 2012-09-28 22:35:49 +0000 | [diff] [blame] | 82 | <zeroOrMore> |
Fariborz Jahanian | c491c3f | 2012-10-01 18:42:25 +0000 | [diff] [blame] | 83 | <ref name="Availability" /> |
Fariborz Jahanian | 35760a8 | 2012-09-28 22:35:49 +0000 | [diff] [blame] | 84 | </zeroOrMore> |
Fariborz Jahanian | de0ae1e | 2012-10-02 20:05:47 +0000 | [diff] [blame] | 85 | <zeroOrMore> |
| 86 | <ref name="Deprecated" /> |
| 87 | </zeroOrMore> |
| 88 | <zeroOrMore> |
| 89 | <ref name="Unavailable" /> |
| 90 | </zeroOrMore> |
Dmitri Gribenko | 740c0fb | 2012-08-07 17:54:38 +0000 | [diff] [blame] | 91 | <optional> |
| 92 | <ref name="ResultDiscussion" /> |
| 93 | </optional> |
| 94 | <optional> |
| 95 | <ref name="Discussion" /> |
| 96 | </optional> |
| 97 | </element> |
| 98 | </define> |
| 99 | |
| 100 | <define name="Class"> |
| 101 | <element name="Class"> |
| 102 | <optional> |
| 103 | <attribute name="templateKind"> |
| 104 | <choice> |
| 105 | <value>template</value> |
| 106 | <value>specialization</value> |
| 107 | <value>partialSpecialization</value> |
| 108 | </choice> |
| 109 | </attribute> |
| 110 | </optional> |
| 111 | <ref name="attrSourceLocation" /> |
| 112 | |
| 113 | <ref name="Name" /> |
| 114 | <optional> |
| 115 | <ref name="USR" /> |
| 116 | </optional> |
| 117 | <optional> |
| 118 | <ref name="Abstract" /> |
| 119 | </optional> |
| 120 | <optional> |
| 121 | <ref name="TemplateParameters" /> |
| 122 | </optional> |
| 123 | |
| 124 | <!-- Parameters and results don't make sense for classes, but the user |
| 125 | can specify \param or \returns in a comment anyway. --> |
| 126 | <optional> |
| 127 | <ref name="Parameters" /> |
| 128 | </optional> |
| 129 | <optional> |
| 130 | <ref name="ResultDiscussion" /> |
| 131 | </optional> |
| 132 | |
| 133 | <optional> |
| 134 | <ref name="Discussion" /> |
| 135 | </optional> |
| 136 | </element> |
| 137 | </define> |
| 138 | |
| 139 | <define name="Variable"> |
| 140 | <element name="Variable"> |
| 141 | <ref name="attrSourceLocation" /> |
| 142 | <ref name="Name" /> |
| 143 | <optional> |
| 144 | <ref name="USR" /> |
| 145 | </optional> |
| 146 | <optional> |
| 147 | <ref name="Abstract" /> |
| 148 | </optional> |
| 149 | |
| 150 | <!-- Template parameters, parameters and results don't make sense for |
| 151 | variables, but the user can specify \tparam \param or \returns |
| 152 | in a comment anyway. --> |
| 153 | <optional> |
| 154 | <ref name="TemplateParameters" /> |
| 155 | </optional> |
| 156 | <optional> |
| 157 | <ref name="Parameters" /> |
| 158 | </optional> |
| 159 | <optional> |
| 160 | <ref name="ResultDiscussion" /> |
| 161 | </optional> |
| 162 | |
| 163 | <optional> |
| 164 | <ref name="Discussion" /> |
| 165 | </optional> |
| 166 | </element> |
| 167 | </define> |
| 168 | |
| 169 | <define name="Namespace"> |
| 170 | <element name="Namespace"> |
| 171 | <ref name="attrSourceLocation" /> |
| 172 | <ref name="Name" /> |
| 173 | <optional> |
| 174 | <ref name="USR" /> |
| 175 | </optional> |
| 176 | <optional> |
| 177 | <ref name="Abstract" /> |
| 178 | </optional> |
| 179 | |
| 180 | <!-- Template parameters, parameters and results don't make sense for |
| 181 | namespaces, but the user can specify \tparam, \param or \returns |
| 182 | in a comment anyway. --> |
| 183 | <optional> |
| 184 | <ref name="TemplateParameters" /> |
| 185 | </optional> |
| 186 | <optional> |
| 187 | <ref name="Parameters" /> |
| 188 | </optional> |
| 189 | <optional> |
| 190 | <ref name="ResultDiscussion" /> |
| 191 | </optional> |
| 192 | |
| 193 | <optional> |
| 194 | <ref name="Discussion" /> |
| 195 | </optional> |
| 196 | </element> |
| 197 | </define> |
| 198 | |
| 199 | <define name="Typedef"> |
| 200 | <element name="Typedef"> |
| 201 | <ref name="attrSourceLocation" /> |
| 202 | <ref name="Name" /> |
| 203 | <optional> |
| 204 | <ref name="USR" /> |
| 205 | </optional> |
| 206 | <optional> |
| 207 | <ref name="Abstract" /> |
| 208 | </optional> |
| 209 | |
| 210 | <optional> |
| 211 | <ref name="TemplateParameters" /> |
| 212 | </optional> |
| 213 | |
| 214 | <!-- Parameters and results might make sense for typedefs if the type is |
| 215 | a function pointer type. --> |
| 216 | <optional> |
| 217 | <ref name="Parameters" /> |
| 218 | </optional> |
| 219 | <optional> |
| 220 | <ref name="ResultDiscussion" /> |
| 221 | </optional> |
| 222 | |
| 223 | <optional> |
| 224 | <ref name="Discussion" /> |
| 225 | </optional> |
| 226 | </element> |
| 227 | </define> |
| 228 | |
Dmitri Gribenko | 168d234 | 2012-08-07 18:59:04 +0000 | [diff] [blame] | 229 | <define name="Enum"> |
| 230 | <element name="Enum"> |
| 231 | <ref name="attrSourceLocation" /> |
| 232 | <ref name="Name" /> |
| 233 | <optional> |
| 234 | <ref name="USR" /> |
| 235 | </optional> |
| 236 | <optional> |
| 237 | <ref name="Abstract" /> |
| 238 | </optional> |
| 239 | |
| 240 | <!-- Template parameters, parameters and results don't make sense for |
| 241 | enums, but the user can specify \tparam \param or \returns in a |
| 242 | comment anyway. --> |
| 243 | <optional> |
| 244 | <ref name="TemplateParameters" /> |
| 245 | </optional> |
| 246 | <optional> |
| 247 | <ref name="Parameters" /> |
| 248 | </optional> |
| 249 | <optional> |
| 250 | <ref name="ResultDiscussion" /> |
| 251 | </optional> |
| 252 | |
| 253 | <optional> |
| 254 | <ref name="Discussion" /> |
| 255 | </optional> |
| 256 | </element> |
| 257 | </define> |
| 258 | |
Dmitri Gribenko | 740c0fb | 2012-08-07 17:54:38 +0000 | [diff] [blame] | 259 | <define name="attrSourceLocation"> |
| 260 | <optional> |
| 261 | <attribute name="file"> |
| 262 | <!-- Non-empty text content. --> |
| 263 | <data type="string"> |
| 264 | <param name="pattern">.*\S.*</param> |
| 265 | </data> |
| 266 | </attribute> |
| 267 | </optional> |
| 268 | <optional> |
| 269 | <attribute name="line"> |
| 270 | <data type="positiveInteger" /> |
| 271 | </attribute> |
| 272 | <attribute name="column"> |
| 273 | <data type="positiveInteger" /> |
| 274 | </attribute> |
| 275 | </optional> |
| 276 | </define> |
| 277 | |
| 278 | <define name="Name"> |
| 279 | <element name="Name"> |
| 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="USR"> |
| 288 | <element name="USR"> |
| 289 | <!-- Non-empty text content. --> |
| 290 | <data type="string"> |
| 291 | <param name="pattern">.*\S.*</param> |
| 292 | </data> |
| 293 | </element> |
| 294 | </define> |
| 295 | |
| 296 | <define name="Abstract"> |
| 297 | <element name="Abstract"> |
| 298 | <zeroOrMore> |
| 299 | <ref name="TextBlockContent" /> |
| 300 | </zeroOrMore> |
| 301 | </element> |
| 302 | </define> |
| 303 | |
| 304 | <define name="Discussion"> |
| 305 | <element name="Discussion"> |
Dmitri Gribenko | 0b1a96a | 2012-09-13 21:32:58 +0000 | [diff] [blame] | 306 | <zeroOrMore> |
Dmitri Gribenko | 740c0fb | 2012-08-07 17:54:38 +0000 | [diff] [blame] | 307 | <ref name="TextBlockContent" /> |
Dmitri Gribenko | 0b1a96a | 2012-09-13 21:32:58 +0000 | [diff] [blame] | 308 | </zeroOrMore> |
Dmitri Gribenko | 740c0fb | 2012-08-07 17:54:38 +0000 | [diff] [blame] | 309 | </element> |
| 310 | </define> |
| 311 | |
| 312 | <define name="TemplateParameters"> |
| 313 | <element name="TemplateParameters"> |
| 314 | <!-- Parameter elements should be sorted according to position. --> |
| 315 | <oneOrMore> |
| 316 | <element name="Parameter"> |
| 317 | <element name="Name"> |
| 318 | <!-- Non-empty text content. --> |
| 319 | <data type="string"> |
| 320 | <param name="pattern">.*\S.*</param> |
| 321 | </data> |
| 322 | </element> |
| 323 | <optional> |
| 324 | <!-- This is index at depth 0. libclang API can return more |
| 325 | information about position, but we expose only essential |
| 326 | information here, since "Parameter" elements are already |
| 327 | sorted. |
| 328 | |
| 329 | "Position" element could be added in future if needed. --> |
| 330 | <element name="Index"> |
| 331 | <data type="nonNegativeInteger" /> |
| 332 | </element> |
| 333 | </optional> |
| 334 | <!-- In general, template parameters with whitespace discussion |
| 335 | should not be emitted. Schema might be more strict here. --> |
| 336 | <element name="Discussion"> |
| 337 | <ref name="TextBlockContent" /> |
| 338 | </element> |
| 339 | </element> |
| 340 | </oneOrMore> |
| 341 | </element> |
| 342 | </define> |
| 343 | |
| 344 | <define name="Parameters"> |
| 345 | <element name="Parameters"> |
| 346 | <!-- Parameter elements should be sorted according to index. --> |
| 347 | <oneOrMore> |
| 348 | <element name="Parameter"> |
| 349 | <element name="Name"> |
| 350 | <!-- Non-empty text content. --> |
| 351 | <data type="string"> |
| 352 | <param name="pattern">.*\S.*</param> |
| 353 | </data> |
| 354 | </element> |
| 355 | <optional> |
| 356 | <element name="Index"> |
| 357 | <data type="nonNegativeInteger" /> |
| 358 | </element> |
| 359 | </optional> |
| 360 | <element name="Direction"> |
| 361 | <attribute name="isExplicit"> |
| 362 | <data type="boolean" /> |
| 363 | </attribute> |
| 364 | <choice> |
| 365 | <value>in</value> |
| 366 | <value>out</value> |
| 367 | <value>in,out</value> |
| 368 | </choice> |
| 369 | </element> |
| 370 | <!-- In general, template parameters with whitespace discussion |
| 371 | should not be emitted, unless direction is explicitly specified. |
| 372 | Schema might be more strict here. --> |
| 373 | <element name="Discussion"> |
| 374 | <ref name="TextBlockContent" /> |
| 375 | </element> |
| 376 | </element> |
| 377 | </oneOrMore> |
| 378 | </element> |
| 379 | </define> |
| 380 | |
Dmitri Gribenko | 61b1db1 | 2012-10-03 09:04:56 +0000 | [diff] [blame^] | 381 | <define name="Availability"> |
| 382 | <element name="Availability"> |
| 383 | <attribute name="distribution"> |
| 384 | <data type="string" /> |
| 385 | </attribute> |
| 386 | <optional> |
| 387 | <element name="IntroducedInVersion"> |
| 388 | <data type="string"> |
| 389 | <param name="pattern">\d+|\d+\.\d+|\d+\.\d+.\d+</param> |
| 390 | </data> |
| 391 | </element> |
| 392 | </optional> |
| 393 | <optional> |
| 394 | <element name="DeprecatedInVersion"> |
| 395 | <data type="string"> |
| 396 | <param name="pattern">\d+|\d+\.\d+|\d+\.\d+.\d+</param> |
| 397 | </data> |
| 398 | </element> |
| 399 | </optional> |
| 400 | <optional> |
| 401 | <element name="RemovedAfterVersion"> |
| 402 | <data type="string"> |
| 403 | <param name="pattern">\d+|\d+\.\d+|\d+\.\d+.\d+</param> |
| 404 | </data> |
| 405 | </element> |
| 406 | </optional> |
| 407 | <optional> |
| 408 | <element name="DeprecationSummary"> |
| 409 | <data type="string" /> |
| 410 | </element> |
| 411 | </optional> |
| 412 | <optional> |
| 413 | <ref name="Unavailable" /> |
| 414 | </optional> |
| 415 | </element> |
| 416 | </define> |
| 417 | |
| 418 | <define name="Deprecated"> |
| 419 | <element name="Deprecated"> |
| 420 | <optional> |
| 421 | <data type="string" /> |
| 422 | </optional> |
| 423 | </element> |
| 424 | </define> |
| 425 | |
| 426 | <define name="Unavailable"> |
| 427 | <element name="Unavailable"> |
| 428 | <optional> |
| 429 | <data type="string" /> |
| 430 | </optional> |
| 431 | </element> |
| 432 | </define> |
| 433 | |
Dmitri Gribenko | 740c0fb | 2012-08-07 17:54:38 +0000 | [diff] [blame] | 434 | <define name="ResultDiscussion"> |
| 435 | <element name="ResultDiscussion"> |
| 436 | <zeroOrMore> |
| 437 | <ref name="TextBlockContent" /> |
| 438 | </zeroOrMore> |
| 439 | </element> |
| 440 | </define> |
| 441 | |
| 442 | <define name="TextBlockContent"> |
| 443 | <choice> |
| 444 | <element name="Para"> |
| 445 | <zeroOrMore> |
| 446 | <ref name="TextInlineContent" /> |
| 447 | </zeroOrMore> |
| 448 | </element> |
| 449 | <element name="Verbatim"> |
Dmitri Gribenko | 6cffc19 | 2012-08-08 22:10:24 +0000 | [diff] [blame] | 450 | <attribute name="xml:space"> |
| 451 | <value>preserve</value> |
| 452 | </attribute> |
Dmitri Gribenko | 740c0fb | 2012-08-07 17:54:38 +0000 | [diff] [blame] | 453 | <attribute name="kind"> |
| 454 | <!-- TODO: add all Doxygen verbatim kinds --> |
| 455 | <choice> |
| 456 | <value>code</value> |
| 457 | <value>verbatim</value> |
| 458 | </choice> |
| 459 | </attribute> |
| 460 | <text /> |
| 461 | </element> |
| 462 | </choice> |
| 463 | </define> |
| 464 | |
| 465 | <define name="TextInlineContent"> |
| 466 | <choice> |
| 467 | <text /> |
| 468 | <element name="bold"> |
| 469 | <!-- Non-empty text content. --> |
| 470 | <data type="string"> |
| 471 | <param name="pattern">.*\S.*</param> |
| 472 | </data> |
| 473 | </element> |
| 474 | <element name="monospaced"> |
| 475 | <!-- Non-empty text content. --> |
| 476 | <data type="string"> |
| 477 | <param name="pattern">.*\S.*</param> |
| 478 | </data> |
| 479 | </element> |
| 480 | <element name="emphasized"> |
| 481 | <!-- Non-empty text content. --> |
| 482 | <data type="string"> |
| 483 | <param name="pattern">.*\S.*</param> |
| 484 | </data> |
| 485 | </element> |
| 486 | <element name="rawHTML"> |
| 487 | <!-- Non-empty text content. --> |
| 488 | <data type="string"> |
| 489 | <param name="pattern">.*\S.*</param> |
| 490 | </data> |
| 491 | </element> |
| 492 | </choice> |
| 493 | </define> |
| 494 | |
| 495 | </grammar> |
| 496 | |