blob: 4bff69b3adc4c6f3720e77793978db8353db96b9 (
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
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
|
%{
%}
#include def.tin
#include yesno.tin
#include numeric.tin
#include string.tin
%start command
%token ASINH_
%token CLOSE_
%token DATASEC_
%token EXP_
%token GLOBAL_
%token HISTEQU_
%token LIMITS_
%token LINEAR_
%token LOCAL_
%token LOCK_
%token LOG_
%token MATCH_
%token MINMAX_
%token MODE_
%token OPEN_
%token POW_
%token SCALELIMITS_
%token SCOPE_
%token SINH_
%token SQRT_
%token SQUARED_
%token USER_
%token ZMAX_
%token ZSCALE_
%%
#include yesno.trl
#include numeric.trl
command : scale
| scale {global ds9; if {!$ds9(init)} {YYERROR} else {yyclearin; YYACCEPT}} STRING_
;
scale : OPEN_ {ScaleDialog}
| CLOSE_ {ScaleDestroyDialog}
| MATCH_ match
| LOCK_ lock
| scales {ProcessCmdSet scale type $1 ChangeScale}
| LOG_ EXP_ numeric {ProcessCmdSet scale log $3 ChangeScale}
| DATASEC_ yesno {ProcessCmdSet scale datasec $2 ChangeDATASEC}
| LIMITS_ numeric numeric {ProcessCmdSet scale min $2 {}; ProcessCmdSet scale max $3 ChangeScaleLimit}
# backward compatibility
| SCALELIMITS_ numeric numeric {ProcessCmdSet scale min $2 {}; ProcessCmdSet scale max $3 ChangeScaleLimit}
| mode {ProcessCmdSet scale mode $1 ChangeScaleMode}
| MODE_ mode {ProcessCmdSet scale mode $2 ChangeScaleMode}
| scope {ProcessCmdSet scale scope $1 ChangeScaleScope}
| SCOPE_ scope {ProcessCmdSet scale scope $2 ChangeScaleScope}
;
scales : LINEAR_ {set _ linear}
| LOG_ {set _ log}
| POW_ {set _ pow}
| SQRT_ {set _ sqrt}
| SQUARED_ {set _ squared}
| ASINH_ {set _ asinh}
| SINH_ {set _ sinh}
| HISTEQU_ {set _ histequ}
;
match : {MatchScaleCurrent}
| LIMITS_ {MatchScaleLimitsCurrent}
| SCALELIMITS_ {MatchScaleLimitsCurrent}
;
lock : yesno {ProcessCmdSet scale lock $1 LockScaleCurrent}
| LIMITS_ yesno {ProcessCmdSet scale lock,limits $2 LockScaleLimitsCurrent}
| SCALELIMITS_ yesno {ProcessCmdSet scale lock,limits $2 LockScaleLimitsCurrent}
;
mode : numeric {set _ $1}
| MINMAX_ {set _ minmax}
| ZSCALE_ {set _ zscale}
| ZMAX_ {set _ zmax}
| USER_ {set _ user}
;
scope : LOCAL_ {set _ local}
| GLOBAL_ {set _ global}
;
%%
proc scale::yyerror {msg} {
variable yycnt
variable yy_current_buffer
variable index_
ParserError $msg $yycnt $yy_current_buffer $index_
}
|