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 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565
|
# ----------------------------------------------------------------------------
#
# This is the schema for helpdoc DEF files, written in its own schema-language
#
# ----------------------------------------------------------------------------
##############################################################################
# helpdoc schema-keywords:
# ------------------------
#
### toplevel keywords:
#
# # -- comment
# rootelement -- used to describe a root element
# element -- used to describe an element
# attribute -- used to describe an attribute
# @ -- used to describe a special "@" prefixed elements that are allowed within the text
#
### keywords describing the content/data of leaf elements:
#
# empty -- tells that the element is empty, i.e., it is w/o content
# word -- tells that the content of an element is a single word (i.e. without spaces, \t, \n, \r)
# varname -- tells that the content of an element is a variable name; varname is a word with more a
# restrictive set of allowed characters; current regexp == (\w+([%]\w+)*)
# string -- tells that the content of an element or attribute is a string (it can contain spaces,
# i.e., string can be seen as a plain simple text)
# text -- tells that the content of an element is a text
# (text can contain special @ref and @link elements, which are
# expanded to <ref></ref> and <link></link> XML elements by helpdoc)
# clist -- tells that the content of an element or attribute is a comma-separated list
# (i.e. "word1, word2, word3, ...")
# plist -- tells that the content of an element or attribute is a pipe-separated list
# (i.e. "word1 | word2 | word3 | ...");
# the plist is used, e.g., to specify exclusive options
#
# ident -- tells that element has an identifier (DEF syntax: myelem myIdent { ... })
# ident must be a "word" (see above)
#
### ref & define keywords:
#
# ref -- used to specify the reference to an element (but the element is defined elsewhere)
# define -- used to define a group of elements or ref's that can be later-on referenced
# (should be specified before referencing it)
#
### keywords specifying optionality, repeatably, interleaving, ....
#
# interleave -- used to mark that the order of enclosed elements is not important
# optional -- used to mark anything enclosed as optional
# choice -- used to mark alternatice choices
# ? -- zero or one repetition of instances of anything enclosed is allowed (synonymous with "optional")
# * -- zero or more repetitions of instances of anything enclosed is allowed
# + -- one or more repetitions of instances of anything enclosed is allowed
#
# ancestorElements -- mark that all the elements (with rules, such as, optional,
# conditional, and repetition) of the ancestor are allowed
#
#######################
# IMPLICIT ASSUMPTIONS:
#----------------------
# - order of attributes is not important
# - attributes are mandatory (when they are not, use: optional { ... } keyword)
# - order of elements is important (when it is not, use: interleave { ... } keyword)
# - elements are mandatory (when they are not, use: optional { ... } keyword)
# ------------------------------------------------------------------------
# toplevel element
rootelement input_description {
attribute distribution { string }
attribute package { string }
attribute program { string }
optional {
interleave {
element intro { text }
element toc {}
}
}
+ {
interleave {
optional {
ref group
ref namelist
ref supercard
ref card
ref linecard
ref table
ref label
ref message
ref if
ref choose
ref optional
ref conditional
ref section
ref subsection
ref subsubsection
ref paragraph
}
}
}
}
#
# definition of simple elements
#
element info { text }
element default { text }
element status { text }
element label { text }
element message { text }
element see { clist }
element keyword { ident }
#
# define what elements are used within var, dimension, ...
# (will be used many times)
#
define varTags {
interleave {
optional {
ref status
ref default
ref see
}
}
interleave {
* { ref info }
? { ref options }
}
}
#
# definition of complex elements
#
element options {
interleave {
* {
ref info
}
+ {
element opt {
attribute val { clist }
text
}
}
}
}
element list {
ident
attribute type { word }
interleave {
element format { string }
ref varTags
}
}
element var {
ident
attribute type { word }
ref varTags
}
element vargroup {
attribute type { word }
interleave {
+ { ref var }
ref varTags
}
}
element dimension {
ident
attribute type { word }
attribute start { word }
attribute end { word }
ref varTags
}
element multidimension {
ident
attribute type { word }
attribute indexes { clist }
attribute start { clist }
attribute end { clist}
ref varTags
}
element dimensiongroup {
attribute type { word }
attribute start { word }
attribute end { word }
interleave {
+ { ref dimension }
ref varTags
}
}
element multidimensiongroup {
attribute type { word }
attribute indexes { clist }
attribute start { clist }
attribute end { clist }
interleave {
+ { ref multidimension }
ref varTags
}
}
element table {
ident
choice {
element rows {
attribute start { word }
attribute end { word }
+ {
interleave {
optional {
ref col
ref optional
ref conditional
element colgroup {
attribute type { word }
interleave {
+ { ref col }
optional {
ref varTags
ref optional
ref conditional
}
}
}
}
}
}
}
element cols {
attribute start { word }
attribute end { word }
+ {
interleave {
optional {
ref row
ref optional
ref conditional
element rowgroup {
attribute type { word }
interleave {
+ { ref row }
optional {
ref varTags
ref optional
ref conditional
}
}
}
}
}
}
}
}
}
element col {
ident
optional {
attribute type { word }
ref varTags
}
}
element row {
ident
optional {
attribute type { word }
ref varTags
}
}
#
# higher level complex elements
#
element optional { ancestorElements }
element conditional { ancestorElements }
element group { ancestorElements }
element supercard {
ident
optional {
attribute starttag { word }
attribute endtag { word }
attribute remark { text }
}
interleave {
+ {
optional {
ref supercard
ref namelist
ref card
ref linecard
}
}
* {
optional {
ref if
ref choose
ref label
ref message
ref optional
ref conditional
}
}
}
}
element namelist {
ident
interleave {
+ {
optional {
ref var
ref vargroup
ref dimension
ref dimensiongroup
}
}
* {
optional {
ref group
ref label
ref message
ref if
ref choose
}
}
}
}
element card {
ident
optional {
attribute nameless { word }
ref flag
}
+ {
interleave {
optional {
ref syntax
ref choose
* {
ref if
ref label
ref message
}
}
}
}
}
element linecard {
interleave {
+ {
optional {
ref keyword
ref var
ref vargroup
ref list
}
}
optional {
ref optional
ref conditional
}
}
}
element flag {
ident
optional { attribute use { word } }
element enum { plist }
ref varTags
}
element syntax {
? { attribute flag { plist } }
+ {
interleave {
optional {
ref line
ref table
ref optional
ref conditional
}
}
}
}
element line {
+ {
interleave {
optional {
ref group
ref keyword
ref var
ref vargroup
ref list
ref if
ref choose
ref label
ref message
ref optional
ref conditional
}
}
}
}
element if {
attribute test { text }
optional { ref label }
ancestorElements
}
element choose {
element when {
attribute test { text }
optional { ref label }
ancestorElements
}
* {
element elsewhen {
attribute test { text }
optional { ref label }
ancestorElements
}
}
? {
element otherwise {
optional { ref label }
ancestorElements
}
}
}
#
# some text structure stuff
#
element section {
attribute title { text }
+ {
interleave {
optional {
ref subsection
ref subsubsection
ref paragraph
ref text
}
}
}
}
element subsection {
attribute title { text }
+ {
interleave {
optional {
ref subsubsection
ref paragraph
ref text
}
}
}
}
element subsubsection {
attribute title { text }
+ {
interleave {
optional {
ref paragraph
ref text
}
}
}
}
element paragraph {
attribute title { text }
ref text
}
element text { text }
#---------------
# Special @ prefixed elements that are allowed within the text
#
# within the text these are uses as:
# @tag -- for empty elements, defined below as @ tag { empty }
# @tag word -- for word and text elements, defined below as "@ tag { word }" or "@ tag { text }"
# @tag { many words text } -- for text elements, defined below as "@ tag { text }"
#
# ref: used inside text for referencing a variable inside a document (usage: @ref var)
@ ref { varname }; # varname is a word with more a restrictive set of
# allowed characters; current regexp == (\w+([%]\w+)*)
# link: used inside text to link to an external document (usage: @link doc)
@ link { word }
#--------------------
# let's support some basic HTML tags
# text-styles
@ b { text }
@ i { text }
@ tt { text }
@ u { text }
@ sub { text }
@ sup { text }
@ code { text }
@ pre { text }
# breaks, rule, paragraph ...
@ br { empty }
@ hr { empty }
@ p { empty }
## lists (currently disabled : nested @tag commands do not work properly)
#@ ol { text }
#@ ul { text }
#@ li { text }
#
#@ dl { text }
#@ dt { text }
#@ dd { text }
|