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

#include yesno.tin
#include numeric.tin
#include string.tin

%start command

%token AIP_
%token AZ_
%token BG_
%token BORDER_
%token CLOSE_
%token COLOR_
%token COMPASS_
%token EL_
%token HIGHLITE_
%token LOCK_
%token MATCH_
%token METHOD_
%token MIP_
%token NONE_
%token OPEN_
%token SCALE_
%token VIEW_

%%

#include yesno.trl
#include numeric.trl

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

3d : {Create3DFrame}
 | OPEN_
 | CLOSE_ {3DDestroyDialog}
 | AZ_ numeric {ProcessCmdSet threed az $2 3DViewPoint}
 | EL_ numeric {ProcessCmdSet threed el $2 3DViewPoint}
 | VIEW_ numeric numeric {ProcessCmdSet threed az $2; ProcessCmdSet threed el $3 3DViewPoint}
 | SCALE_ numeric {ProcessCmdSet threed scale $2 3DScale}
 | METHOD_ method {ProcessCmdSet threed method $2 3DRenderMethod}
 | BG_ bg {ProcessCmdSet threed background $2 3DBackground}
 | HIGHLITE_ highlite
 | BORDER_ border
 | COMPASS_ compass
 | MATCH_ {Match3DCurrent}
 | LOCK_ yesno {ProcessCmdSet threed lock $2 Lock3DCurrent}
 ;

method : AIP_ {set _ aip}
 | MIP_ {set _ mip}
 ;
 
bg : NONE_ {set _ none}
 | AZ_ {set _ azimuth}
 | EL_ {set _ elevation}
 ;

highlite : COLOR_ STRING_ {ProcessCmdSet threed highlite,color $2 3DHighliteColor}
 | yesno {ProcessCmdSet threed highlite $1 3DHighlite}
 ;
 
border : COLOR_ STRING_ {ProcessCmdSet threed border,color $2 3DBorderColor}
 | yesno {ProcessCmdSet threed border $1 3DBorder}
 ;
 
compass : COLOR_ STRING_ {ProcessCmdSet threed compass,color $2 3DCompassColor}
 | yesno {ProcessCmdSet threed compass $1 3DCompass}
 ;
 
%%

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

     ParserError $msg $yycnt $yy_current_buffer $index_
}