File: helpdoc.schema

package info (click to toggle)
espresso 5.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 146,004 kB
  • ctags: 17,245
  • sloc: f90: 253,041; sh: 51,271; ansic: 27,494; tcl: 15,570; xml: 14,508; makefile: 2,958; perl: 2,035; fortran: 1,924; python: 337; cpp: 200; awk: 57
file content (420 lines) | stat: -rw-r--r-- 7,011 bytes parent folder | download | duplicates (2)
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
# ------------------------------------------------------------------------
#
# This is the schema for helpdoc, written in its own schema-language
#
# ------------------------------------------------------------------------


# helpdoc schema-keywords: 
# ------------------------
#   #           -- comment
#   rootelement -- used to describe a root element
#   element     -- used to describe an element
#   attribute   -- used to describe an attribute
#   text        -- tells that the content of an element or attribute is a simple text
#   string      -- tells that the content of an element or attribute is a single word
#   ident       -- tells that element has an identifier (syntax: myelem myIdent { ... })
#   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 
#                  (should be specified before referencing it)
#   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
#   group       -- used for grouping items
#   ?           -- zero or one repetition of instances of anything enclosed is allowed
#   *           -- 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 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     { string }
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 info
	    ref see
	}
    }
}


#
# definition of complex elements
#

element list {
    ident 
    attribute type { string }

    interleave {
	element format { text }
	ref varTags
    }
}


element var {
    ident
    attribute type { string }        

    ref varTags
}
element vargroup {
    attribute type { string }            

    interleave {
	+ { ref var }
	ref varTags
    }
}


element dimension {
    ident
    attribute type  { string }   	
    attribute start { string }
    attribute end   { string }

    ref varTags
}
element dimensiongroup {
    attribute type  { string }
    attribute start { string }
    attribute end   { string }

    interleave {
	+ { ref dimension }
	ref varTags
    }
}


element table {
    ident
    
    choice {
	element rows {
	    attribute start { string }
	    attribute end   { string }
	    + {
		interleave {
		    optional {
			ref col
			ref optional
			ref conditional
			element colgroup {
			    attribute type { string }
			    interleave {
				+ { ref col }
				optional { 
				    ref varTags 
				    ref optional
				    ref conditional
				}			
			    }
			}
		    }
		}
	    }
	}
	element cols {
	    attribute start { string }
	    attribute end   { string }
	    + {
		interleave {
		    optional {
			ref row
			ref optional
			ref conditional
			element rowgroup {
			    attribute type { string }
			    interleave {
				+ { ref row }
				optional { 
				    ref varTags
				    ref optional
				    ref conditional
				}	
			    }
			}
		    }
		}
	    }
	}
    }
}

element col {
    ident
    optional {
	attribute type { string }
	ref varTags
    }
}
element row {
    ident
    optional {
	attribute type { string }
	ref varTags
    }
}


#
# higher level complex elements
#

element optional    { ancestorElements }
element conditional { ancestorElements }
element group       { ancestorElements }


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 { string }
	ref flag 
    }	
    
    + {
	interleave {
	    optional {
		ref syntax
		ref choose
		* { 
		    ref if 
		    ref label
		    ref message
		}
	    }    
	}
    }
}

element linecard {    
    interleave {
	+ {
	    optional {
		ref var
		ref vargroup
		ref list
	    }
	}
	optional {
	    ref optional
	    ref conditional
	}
    }
}

element flag { 
    ident
    optional { attribute use { string } }	    
    element enum { text }
    ref varTags
}

element syntax { 
    ? { attribute flag { text } }
    + {
	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 }