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

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

%start command

%token DISTANCE_
%token HORIZONTAL_
%token LOCK_
%token MATCH_
%token NUMERICS_
%token ORIENTATION_
%token SIZE_
%token SPACE_
%token TICKS_
%token VALUE_
%token VERTICAL_

%%

#include yesno.trl
#include font.trl
#include numeric.trl

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

colorbar : yesno {ViewCmdSet colorbar $1 UpdateView}
# backward compatibility
 | MATCH_ {MatchColorCurrent}
 | LOCK_ yesno {ColorbarCmdSet lock $2 LockColorCurrent}

 | NUMERICS_ yesno {ColorbarCmdSet numerics $2 UpdateView}
 | SPACE_ space {ColorbarCmdSet space $2 UpdateView}
 | FONT_ font {ColorbarCmdSet font $2 UpdateView}
 | FONTSIZE_ INT_ {ColorbarCmdSet font,size $2 UpdateView}
 | FONTWEIGHT_ fontWeight {ColorbarCmdSet font,weight $2 UpdateView}
 | FONTSLANT_ fontSlant {ColorbarCmdSet font,slant $2 UpdateView}
 | FONTSTYLE_ fontStyle {ColorbarCmdFontStyle $2 UpdateView}

 | orientation {ColorbarCmdSet orientation $1 UpdateView}
# backward compatibility
 | ORIENTATION_ orientation {ColorbarCmdSet orientation $2 UpdateView}

 | SIZE_ INT_ {ColorbarCmdSet size $2 UpdateView}
 | TICKS_ INT_ {ColorbarCmdSet ticks $2 UpdateView}
 ;
 
space : VALUE_ {set _ 1}
 | DISTANCE_ {set _ 0}
 ;

orientation : VERTICAL_ {set _ vertical}
 | HORIZONTAL_ {set _ horizontal}
 ;

%%

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

     ParserError $msg $yycnt $yy_current_buffer $index_
}