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

#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 {yyclearin; YYACCEPT} STRING_
 ;

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

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

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

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

     ParserError $msg $yycnt $yy_current_buffer $index_
}