summaryrefslogtreecommitdiffstats
path: root/ds9/parsers/modeparser.tac
blob: f745303bf5475bb81eec865cbc47df4ef1b23cf6 (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
%{
%}
#include def.tin

#include string.tin

%start command

%token NONE_
%token REGION_
%token CROSSHAIR_
%token COLORBAR_
%token PAN_
%token ZOOM_
%token ROTATE_
%token CROP_
%token CATALOG_
%token EXAMINE_
%token POINTER_

%%

command : mode 
 | mode {global ds9; if {!$ds9(init)} {YYERROR} else {yyclearin; YYACCEPT}} STRING_
 ;

mode : item {ProcessCmdSet current mode $1 ChangeMode}
 ;

item : NONE_ {set _ none}
 | REGION_ {set _ region}
 | CROSSHAIR_ {set _ crosshair}
 | COLORBAR_ {set _ colorbar}
 | PAN_ {set _ pan}
 | ZOOM_ {set _ zoom}
 | ROTATE_ {set _ rotate}
 | CROP_ {set _ crop}
 | CATALOG_ {set _ catalog}
 | EXAMINE_ {set _ examine}
# backward compatibilty
 | POINTER_ {set _ region}
 ;

%%

proc mode::yyerror {msg} {
     variable yycnt
     variable yy_current_buffer
     variable index_

     ParserError $msg $yycnt $yy_current_buffer $index_
}