37bbabcf2519875d0081dffe5e3d02197303a4c8
[pspp] / src / output / spv / detail-xml.grammar
1 # PSPP - a program for statistical analysis.
2 # Copyright (C) 2017, 2018, 2019 Free Software Foundation, Inc.
3 #
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 visualization
18    :creator
19    :date
20    :lang
21    :name
22    :style[style_ref]=ref style
23    :type
24    :version
25    :schemaLocation?
26 => visualization_extension?
27    userSource
28    (sourceVariable | derivedVariable)+
29    categoricalDomain?
30    graph
31    labelFrame[lf1]*
32    container?
33    labelFrame[lf2]*
34    style+
35    layerController?
36
37 extension[visualization_extension]
38    :numRows=int?
39    :showGridline=bool?
40    :minWidthSet=(true)?
41    :maxWidthSet=(true)?
42 => EMPTY
43
44 userSource :missing=(listwise | pairwise)? => EMPTY   # Related to omit_empty?
45
46 categoricalDomain => variableReference simpleSort
47
48 simpleSort :method[sort_method]=(custom) => categoryOrder
49
50 sourceVariable
51    :id
52    :categorical=(true)
53    :source
54    :domain=ref categoricalDomain?
55    :sourceName
56    :dependsOn=ref sourceVariable?
57    :label?
58    :labelVariable=ref sourceVariable?
59 => variable_extension* (format | stringFormat)?
60
61 derivedVariable
62    :id
63    :categorical=(true)
64    :value
65    :dependsOn=ref sourceVariable?
66 => variable_extension* (format | stringFormat)? valueMapEntry*
67
68 extension[variable_extension] :from :helpId => EMPTY
69
70 valueMapEntry :from :to => EMPTY
71
72 categoryOrder => TEXT
73
74 graph
75    :cellStyle=ref style
76    :style=ref style
77 => location+ coordinates faceting facetLayout interval
78
79 location
80    :part=(height | width | top | bottom | left | right)
81    :method=(sizeToContent | attach | fixed | same)
82    :min=dimension?
83    :max=dimension?
84    :target=ref (labelFrame | graph | container)?
85    :value?
86 => EMPTY
87
88 coordinates => EMPTY
89
90 faceting => layer[layers1]* cross layer[layers2]*
91
92 cross => (unity | nest) (unity | nest)
93
94 nest => variableReference[vars]+
95
96 unity => EMPTY
97
98 variableReference :ref=ref (sourceVariable | derivedVariable) => EMPTY
99
100 layer
101    :variable=ref (sourceVariable | derivedVariable)
102    :value
103    :visible=bool?
104    :method[layer_method]=(nest)?
105    :titleVisible=bool?
106 => EMPTY
107
108 facetLayout => tableLayout setCellProperties[scp1]*
109                facetLevel+ setCellProperties[scp2]*
110
111 tableLayout
112    :verticalTitlesInCorner=bool
113    :style=ref style?
114    :fitCells=(ticks both)?
115 => EMPTY
116
117 facetLevel :level=int :gap=dimension? => axis
118
119 axis :style=ref style => label? majorTicks
120
121 label
122    :style=ref style
123    :textFrameStyle=ref style?
124    :purpose=(title | subTitle | subSubTitle | layer | footnote)?
125 => text+ | descriptionGroup
126
127 descriptionGroup
128    :target=ref faceting
129    :separator?
130 => (description | text)+
131
132 description :name=(variable | value) => EMPTY
133
134 majorTicks
135    :labelAngle=int
136    :length=dimension
137    :style=ref style
138    :tickFrameStyle=ref style
139    :labelFrequency=int?
140    :stagger=bool?
141 => gridline?
142
143 gridline
144    :style=ref style
145    :zOrder=int
146 => EMPTY
147
148 setCellProperties
149    :applyToConverse=bool?
150 => (setStyle | setFrameStyle | setFormat | setMetaData)* union[union_]?
151
152 setStyle
153    :target=ref (labeling | graph | interval | majorTicks)
154    :style=ref style
155 => EMPTY
156
157 setMetaData
158    :target=ref graph
159    :key
160    :value
161 => EMPTY
162
163 setFormat
164    :target=ref (majorTicks | labeling)
165    :reset=bool?
166 => format | numberFormat | stringFormat+ | dateTimeFormat | elapsedTimeFormat
167
168 setFrameStyle
169    :style=ref style
170    :target=ref majorTicks
171 => EMPTY
172
173 format
174    :baseFormat[f_base_format]=(date | time | dateTime | elapsedTime)?
175    :errorCharacter?
176    :separatorChars?
177    :mdyOrder=(dayMonthYear | monthDayYear | yearMonthDay)?
178    :showYear=bool?
179    :showQuarter=bool?
180    :quarterPrefix?
181    :quarterSuffix?
182    :yearAbbreviation=bool?
183    :showMonth=bool?
184    :monthFormat=(long | short | number | paddedNumber)?
185    :dayPadding=bool?
186    :dayOfMonthPadding=bool?
187    :showWeek=bool?
188    :weekPadding=bool?
189    :weekSuffix?
190    :showDayOfWeek=bool?
191    :dayOfWeekAbbreviation=bool?
192    :hourPadding=bool?
193    :minutePadding=bool?
194    :secondPadding=bool?
195    :showDay=bool?
196    :showHour=bool?
197    :showMinute=bool?
198    :showSecond=bool?
199    :showMillis=bool?
200    :dayType=(month | year)?
201    :hourFormat=(AMPM | AS_24 | AS_12)?
202    :minimumIntegerDigits=int?
203    :maximumFractionDigits=int?
204    :minimumFractionDigits=int?
205    :useGrouping=bool?
206    :scientific=(onlyForSmall | whenNeeded | true | false)?
207    :small=real?
208    :prefix?
209    :suffix?
210    :tryStringsAsNumbers=bool?
211    :negativesOutside=bool?
212 => relabel* affix*
213
214 numberFormat
215    :minimumIntegerDigits=int?
216    :maximumFractionDigits=int?
217    :minimumFractionDigits=int?
218    :useGrouping=bool?
219    :scientific=(onlyForSmall | whenNeeded | true | false)?
220    :small=real?
221    :prefix?
222    :suffix?
223 => affix*
224
225 stringFormat => relabel* affix*
226
227 dateTimeFormat
228    :baseFormat[dt_base_format]=(date | time | dateTime)
229    :separatorChars?
230    :mdyOrder=(dayMonthYear | monthDayYear | yearMonthDay)?
231    :showYear=bool?
232    :yearAbbreviation=bool?
233    :showQuarter=bool?
234    :quarterPrefix?
235    :quarterSuffix?
236    :showMonth=bool?
237    :monthFormat=(long | short | number | paddedNumber)?
238    :showWeek=bool?
239    :weekPadding=bool?
240    :weekSuffix?
241    :showDayOfWeek=bool?
242    :dayOfWeekAbbreviation=bool?
243    :dayPadding=bool?
244    :dayOfMonthPadding=bool?
245    :hourPadding=bool?
246    :minutePadding=bool?
247    :secondPadding=bool?
248    :showDay=bool?
249    :showHour=bool?
250    :showMinute=bool?
251    :showSecond=bool?
252    :showMillis=bool?
253    :dayType=(month | year)?
254    :hourFormat=(AMPM | AS_24 | AS_12)?
255 => affix*
256
257 elapsedTimeFormat
258    :baseFormat[dt_base_format]=(date | time | dateTime)
259    :dayPadding=bool?
260    :hourPadding=bool?
261    :minutePadding=bool?
262    :secondPadding=bool?
263    :showYear=bool?
264    :showDay=bool?
265    :showHour=bool?
266    :showMinute=bool?
267    :showSecond=bool?
268    :showMillis=bool?
269 => affix*
270
271 affix
272    :definesReference=int
273    :position=(subscript | superscript)
274    :suffix=bool
275    :value
276 => EMPTY
277
278 relabel :from=real :to => EMPTY
279
280 union => intersect+
281
282 intersect => where+ | intersectWhere | alternating | EMPTY
283
284 where
285    :variable=ref (sourceVariable | derivedVariable)
286    :include
287 => EMPTY
288
289 intersectWhere
290    :variable=ref (sourceVariable | derivedVariable)
291    :variable2=ref (sourceVariable | derivedVariable)
292 => EMPTY
293
294 alternating => EMPTY
295
296 text
297    :usesReference=int?
298    :definesReference=int?
299    :position=(subscript | superscript)?
300    :style=ref style
301 => TEXT
302
303 interval :style=ref style => labeling footnotes?
304
305 labeling
306    :style=ref style?
307    :variable=ref (sourceVariable | derivedVariable)
308 => (formatting | format | footnotes)*
309
310 formatting :variable=ref (sourceVariable | derivedVariable) => formatMapping*
311
312 formatMapping :from=int => format?
313
314 footnotes
315    :superscript=bool?
316    :variable=ref (sourceVariable | derivedVariable)
317 => footnoteMapping*
318
319 footnoteMapping :definesReference=int :from=int :to => EMPTY
320
321 style
322    :color=color?
323    :color2=color?
324    :labelAngle=real?
325    :border-bottom=(solid | thick | thin | double | none)?
326    :border-top=(solid | thick | thin | double | none)?
327    :border-left=(solid | thick | thin | double | none)?
328    :border-right=(solid | thick | thin | double | none)?
329    :border-bottom-color?
330    :border-top-color?
331    :border-left-color?
332    :border-right-color?
333    :font-family?
334    :font-size?
335    :font-weight=(regular | bold)?
336    :font-style=(regular | italic)?
337    :font-underline=(none | underline)?
338    :margin-bottom=dimension?
339    :margin-left=dimension?
340    :margin-right=dimension?
341    :margin-top=dimension?
342    :textAlignment=(left | right | center | decimal | mixed)?
343    :labelLocationHorizontal=(positive | negative | center)?
344    :labelLocationVertical=(positive | negative | center)?
345    :decimal-offset=dimension?
346    :size?
347    :width?
348    :visible=bool?
349 => EMPTY
350
351 layerController
352    :source=(tableData)
353    :target=ref label?
354 => EMPTY
355
356 container :style=ref style => container_extension? location+ labelFrame*
357
358 extension[container_extension] :combinedFootnotes=(true) => EMPTY
359
360 labelFrame :style=ref style => location+ label? paragraph?
361
362 paragraph :hangingIndent=dimension? => EMPTY