summaryrefslogtreecommitdiffstats
path: root/ds9/parsers/frameparser.tac
blob: 27aa32c8e3d6dd6c3e9c0b41b66f5bb1b722773c (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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
%{
%}
#include def.tin

#include coordsys.tin
#include wcssys.tin
#include int.tin
#include string.tin

%start command

%token 3D_
%token ALL_
%token BACK_
%token CENTER_
%token CLEAR_
%token DELETE_
%token FIRST_
%token FORWARD_
%token FRAMENO_
%token HIDE_
%token LAST_
%token LOCK_
%token MATCH_
%token MOVE_
%token NEW_
%token NEXT_
%token NONE_
%token PREV_
%token REFRESH_
%token RESET_
%token RGB_
%token SHOW_

%%

#include coordsys.trl
#include wcssys.trl

command : frame 
 | frame {yyclearin; YYACCEPT} STRING_
 ;

frame : MATCH_ match {MatchFrameCurrent $2}
 | LOCK_ lock {ProcessCmdSet panzoom lock $2; LockFrameCurrent}
 | CENTER_ center
 | CLEAR_ clear
 | DELETE_ delete
 | NEW_ new
 | RESET_ reset
 | REFRESH_ refresh
 | HIDE_ hide
 | SHOW_ show
 | MOVE_ move
 | FIRST_ {FirstFrame}
 | LAST_ {LastFrame}
 | PREV_ {PrevFrame}
 | NEXT_ {NextFrame}
 | INT_ {CreateGotoFrame $1 base}
 | FRAMENO_ INT_ {CreateGotoFrame $2 base}
 ;

center : {CenterCurrentFrame}
 | INT_ {CenterFrame "Frame$1"}
 | ALL_ {CenterAllFrame}
 ;

clear : {ClearCurrentFrame}
 | INT_ {ClearFrame "Frame$1"}
 | ALL_ {ClearAllFrame}
 ;

delete : {DeleteCurrentFrame}
 | INT_ {DeleteSingleFrame "Frame$1"}
 | ALL_ {DeleteAllFrames}
 ;
 
new : {CreateFrame}
 | RGB_ {CreateRGBFrame}
 | 3D_ {Create3DFrame}
 ;
 
reset : {ResetCurrentFrame}
 | INT_ {ResetFrame "Frame$1"}
 | ALL_ {ResetAllFrame}
 ;

refresh : {UpdateCurrentFrame}
 | INT_ {UpdateFrame "Frame$1"}
 | ALL_ {UpdateAllFrame}
 ;

hide : {global current; ProcessCmdSet active $current(frame) 0 UpdateActiveFrames}
 | INT_ {ProcessCmdSet active "Frame$1" 0 UpdateActiveFrames}
 | ALL_ {ActiveFrameNone}
 ;
 
show :
 | INT_ {ProcessCmdSet active "Frame$1" 1 UpdateActiveFrames}
 | ALL_ {ActiveFrameAll}
 ;

move : FIRST_ {FirstFrame}
 | LAST_ {LastFrame}
 | BACK_ {PrevFrame}
 | FORWARD_ {NextFrame}
 ;

lock : coordsys {set _ $1}
 | wcssys {set _ $1}
 | NONE_  {set _ none}
 ;

match : coordsys {set _ $1}
 | wcssys {set _ $1}
 ;

%%

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

     ParserError $msg $yycnt $yy_current_buffer $index_
}