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