summaryrefslogtreecommitdiffstats
path: root/ds9/parsers/webparser.tac
blob: 51eb7f0b01f1fd654061cba8a69051d4e52723a5 (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
%{
%}
#include def.tin

#include int.tin
#include string.tin

%start command

%token BACK_
%token CLEAR_
%token CLICK_
%token CLOSE_
%token FORWARD_
%token NEW_
%token RELOAD_
%token STOP_

%%

command : web 
 | web {global ds9; if {!$ds9(init)} {YYERROR} else {yyclearin; YYACCEPT}} STRING_
 ;

web : {WebCmdNew {}}
 | STRING_ {WebCmdNew $1}
 | NEW_ STRING_ STRING_ {WebCmdNew $3 $2}

 | {if {![WebCmdCheck]} {web::YYABORT}} webCmd
 | STRING_ {if {![WebCmdRef $1]} {web::YYABORT}} webCmd
 ;

webCmd : CLICK_ click
 | CLEAR_ {ProcessCmdCVAR0 HVClearCmd}
 | CLOSE_ {ProcessCmdCVAR0 HVDestroy}
 ;

click : BACK_ {ProcessCmdCVAR0 HVBackCmd}
 | FORWARD_ {ProcessCmdCVAR0 HVForwardCmd}
 | STOP_ {ProcessCmdCVAR0 HVStopCmd}
 | RELOAD_ {ProcessCmdCVAR0 HVReloadCmd}
 | INT_ {WebCmdClick $1}
 ;
 
%%

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

     ParserError $msg $yycnt $yy_current_buffer $index_
}