Add support for .tlo TableLook files from SPSS 15 and earlier.
[pspp] / src / output / spv / tlo.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 TableLook =>
18    PTTableLook[tl]
19    PVSeparatorStyle[ss]
20    PVCellStyle[cs]
21    PVTextStyle[ts]
22    V2Styles?
23
24 PTTableLook =>
25    ff ff 00 00 "PTTableLook" (00|02)[version]
26    int16[flags]
27    00 00
28    bool[nested-row-labels] 00
29    bool[footnote-marker-subscripts] 00
30    i54 i18
31
32 PVSeparatorStyle =>
33    ff ff 00 00 "PVSeparatorStyle" 00
34    Separator*4[sep1]
35    03 80 00
36    Separator*4[sep2]
37
38 Separator =>
39    case(
40        00 (00)
41      | 01 (00) int32[color] int16[style] int16[width]
42    )[type]
43
44 PVCellStyle =>
45    ff ff 00 00 "PVCellStyle"
46    AreaColor[title-color]
47
48 PVTextStyle =>
49    ff ff 00 00 "PVTextStyle" 00
50    AreaStyle[title-style] MostAreas*7[most-areas]
51
52 MostAreas =>
53    06 80
54    AreaColor[color] 08 80 00 AreaStyle[style]
55
56 AreaColor =>
57    00 01 00 int32[color10] int32[color0] byte[shading] 00
58
59 AreaStyle =>
60    int16[valign] int16[halign] int16[decimal-offset]
61    int16[left-margin] int16[right-margin] int16[top-margin] int16[bottom-margin]
62    00 00 01 00
63    int32[font-size] int16[stretch]
64    00*2
65    int32[rotation-angle]
66    00*4
67    int16[weight]
68    00*2
69    bool[italic] bool[underline] bool[strikethrough]
70    int32[rtf-charset-number]
71    22
72    byte[font-name-len] byte*[font-name-len][font-name]
73    int32[text-color]
74    00*2
75
76 V2Styles =>
77    Separator*11[sep3]
78    byte[continuation-len] byte*[continuation-len][continuation]
79    int32[min-col-width] int32[max-col-width]
80    int32[min-row-height] int32[max-row-height]
81