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

#include numeric.tin
#include string.tin

%start command

%token 3D_
%token AZFROM_
%token AZTO_
%token ELFROM_
%token ELTO_
%token FRAME_
%token NUMBER_
%token OSCILLATE_
%token REPEAT_
%token SLICE_
%token SLFROM_
%token SLTO_

%%

#include numeric.trl

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

movie : STRING_ {MovieCmdSet action frame; Movie $1}
 | FRAME_ STRING_ {MovieCmdSet action frame; Movie $2}
 | SLICE_ STRING_ {MovieCmdSet action slice; Movie $2}
 | 3D_ STRING_ {MovieCmdSet action 3d; Movie $2}
 | 3D_ STRING_ opts {MovieCmdSet action 3d; Movie $2}
 ;

opts : opts opt
 | opt
 ;

opt : NUMBER_ INT_ {MovieCmdSet number $2}
 | AZFROM_ numeric {MovieCmdSet azfrom $2}
 | AZTO_ numeric {MovieCmdSet azto $2}
 | ELFROM_ numeric {MovieCmdSet elfrom $2}
 | ELTO_ numeric {MovieCmdSet elto $2}
 | SLFROM_ INT_ {MovieCmdSet slfrom $2}
 | SLTO_ INT_ {MovieCmdSet slto $2}
 | OSCILLATE_ INT_ {MovieCmdSet repeat oscillate; MovieCmdSet repeat,num $2}
 | REPEAT_ INT_ {MovieCmdSet repeat repeat; MovieCmdSet repeat,num $2}
 ;

%%

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

     ParserError $msg $yycnt $yy_current_buffer $index_
}