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

#include yesno.tin
#include base.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 base.trl

command : 3d
 | 3d {yyclearin; YYACCEPT} CMD_
 ;

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

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

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

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

     ParserError $msg $yycnt $yy_current_buffer $index_
}