summaryrefslogtreecommitdiffstats
path: root/ds9/parsers/cropparser.tac
blob: 366f26c5f984f3dccdeb67a07feb433efd6aa638 (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
%{
%}

#include skyformat.tin
#include skyframe.tin
#include coords.tin
#include numeric.tin
#include string.tin

%start command

%token 3D_
%token CLOSE_
%token LOCK_
%token MATCH_
%token NONE_
%token OPEN_
%token RESET_

%%

#include skyformat.trl
#include skyframe.trl
#include coords.trl
#include numeric.trl

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

crop : OPEN_ {CropDialog}
 | CLOSE_ {CropDestroyDialog}
 | MATCH_ match {MatchCropCurrent $2}
 | LOCK_ lock {CropCmdLock $2}
 | RESET_ {CropReset}
 | 3D_ 3d

 | numeric numeric numeric numeric {global current; $current(frame) crop center $1 $2 physical fk5 $3 $4 physical degrees}
 | numeric numeric numeric numeric coordsys {global current; $current(frame) crop center $1 $2 $5 fk5 $3 $4 $5 degrees}

 | numeric numeric numeric numeric wcssys {global current; $current(frame) crop center $1 $2 $5 fk5 $3 $4 $5 degrees}
 | numeric numeric numeric numeric wcssys skyformat {global current; $current(frame) crop center $1 $2 $5 fk5 $3 $4 $5 $6}
 | numeric numeric numeric numeric skyframe {global current; $current(frame) crop center $1 $2 wcs $5 $3 $4 wcs degrees}
 | numeric numeric numeric numeric skyframe skyformat {global current; $current(frame) crop center $1 $2 wcs $5 $3 $4 wcs $6}
 | numeric numeric numeric numeric wcssys skyframe {global current; $current(frame) crop center $1 $2 $5 $6 $3 $4 $5 degrees}
 | numeric numeric numeric numeric wcssys skyframe skyformat {global current; $current(frame) crop center $1 $2 $5 $6 $3 $4 $5 $7}

 | SEXSTR_ SEXSTR_ numeric numeric {global current; $current(frame) crop center $1 $2 wcs fk5 $3 $4 wcs degrees}
 | SEXSTR_ SEXSTR_ numeric numeric wcssys {global current; $current(frame) crop center $1 $2 $5 fk5 $3 $4 $5 degrees}
 | SEXSTR_ SEXSTR_ numeric numeric wcssys skyformat {global current; $current(frame) crop center $1 $2 $5 fk5 $3 $4 $5 $6}
 | SEXSTR_ SEXSTR_ numeric numeric skyframe {global current; $current(frame) crop center $1 $2 wcs $5 $3 $4 wcs degrees}
 | SEXSTR_ SEXSTR_ numeric numeric skyframe skyformat {global current; $current(frame) crop center $1 $2 wcs $5 $3 $4 wcs $6}
 | SEXSTR_ SEXSTR_ numeric numeric wcssys skyframe {global current; $current(frame) crop center $1 $2 $5 $6 $3 $4 $5 degrees}
 | SEXSTR_ SEXSTR_ numeric numeric wcssys skyframe skyformat {global current; $current(frame) crop center $1 $2 $5 $6 $3 $4 $5 $7}
 ;

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

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

3d : numeric numeric {global current; $current(frame) crop 3d $1 $2 image}
 | numeric numeric coordsys {global current; $current(frame) crop 3d $1 $2 $3}
 | numeric numeric wcssys {global current; $current(frame) crop 3d $1 $2 $3}
 ;

%%

proc crop::yyerror {msg} {
     variable yycnt
     variable yy_current_buffer
     variable index_
     
     ParserError $msg $yycnt $yy_current_buffer $index_
}