blob: 71c738d166745ee0cca68024a04b42e00bda58bd (
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
|
%{
%}
#include base.tin
%start command
%token CLOSE_
%token IN_
%token FIT_
%token OPEN_
%token OUT_
%token TO_
%%
#include base.trl
command : zoom
| zoom {yyclearin; YYACCEPT} STRING_
;
zoom : OPEN_ {PanZoomDialog}
| CLOSE_ {PanZoomDestroyDialog}
| IN_ {Zoom 2 2}
| OUT_ {Zoom .5 .5}
| TO_ zoomTo
| numeric {Zoom $1 $1}
| numeric numeric {Zoom $1 $2}
;
zoomTo: FIT_ {ZoomToFit}
| numeric {ZoomTo $1 $1}
| numeric numeric {ZoomTo $1 $2}
;
%%
proc zoom::yyerror {msg} {
variable yycnt
variable yy_current_buffer
Error "$msg: [lindex yy_current_buffer [expr $yycnt-1]]"
}
|