blob: e6e0e725ab096253446b5fa18420039ecba56372 (
plain)
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
|
%{
%}
#include yesno.tin
#include numeric.tin
#include string.tin
%start command
%token CLOSE_
%token DELETE_
%token FILE_
%token INVERT_
%token LOAD_
%token LOCK_
%token MATCH_
%token OPEN_
%token SAVE_
%token TAG_
%token VALUE_
%%
#include yesno.trl
#include numeric.trl
command : cmap
| cmap {yyclearin; YYACCEPT} STRING_
;
cmap : STRING_ {CmapCmd $1}
| OPEN_ {ColormapDialog}
| CLOSE_ {ColormapDestroyDialog}
# backward compatibility
| MATCH_ {MatchColorCurrent}
| LOCK_ yesno {ColorbarCmdSet lock $2 LockColorCurrent}
| LOAD_ cmapLoad
# backward compatibility
| FILE_ cmapLoad
| SAVE_ STRING_ {SaveColormapFile $2; FileLast colormapfbox $2}
| INVERT_ yesno {ColorbarCmdSet invert $2 InvertColorbar}
| TAG_ cmapTag
| numeric numeric {CmapValueCmd $1 $2}
# backward compatibility
| VALUE_ numeric numeric {CmapValueCmd $2 $3}
;
cmapLoad : STRING_ {LoadColormapFile $1; FileLast colormapfbox $1}
;
cmapTag : LOAD_ STRING_ {LoadColorTag $2}
| SAVE_ STRING_ {global current; $current(colorbar) tag save $2}
| DELETE_ {DeleteColorTag}
;
%%
proc cmap::yyerror {msg} {
variable yycnt
variable yy_current_buffer
variable index_
ParserError $msg $yycnt $yy_current_buffer $index_
}
|