diff options
Diffstat (limited to 'ds9/parsers/webparser.tac')
-rw-r--r-- | ds9/parsers/webparser.tac | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/ds9/parsers/webparser.tac b/ds9/parsers/webparser.tac new file mode 100644 index 0000000..d3298db --- /dev/null +++ b/ds9/parsers/webparser.tac @@ -0,0 +1,55 @@ +%{ +%} + +#include numeric.tin +#include string.tin + +%start command + +%token BACK_ +%token CLEAR_ +%token CLICK_ +%token CLOSE_ +%token FORWARD_ +%token NEW_ +%token RELOAD_ +%token STOP_ + +%% + +#include numeric.trl + +command : web + | web {yyclearin; YYACCEPT} STRING_ + ; + +web : {WebCmdNew {}} + | STRING_ {WebCmdNew $1} + | NEW_ STRING_ {WebCmdNew $2} + | NEW_ STRING_ STRING_ {WebCmdNew $3 $2} + + | {WebCmdCheck} webCmd + | STRING_ {WebCmdRef $1} webCmd + ; + +webCmd : CLICK_ click + | CLEAR_ {global cvarname; HVClearCmd $cvarname} + | CLOSE_ {global cvarname; HVDestroy $cvarname} + ; + +click : BACK_ {global cvarname; HVBackCmd $cvarname} + | FORWARD_ {global cvarname; HVForwardCmd $cvarname} + | STOP_ {global cvarname; HVStopCmd $cvarname} + | RELOAD_ {global cvarname; HVReloadCmd $cvarname} + | INT_ {WebCmdClick $1} + ; + +%% + +proc web::yyerror {msg} { + variable yycnt + variable yy_current_buffer + variable index_ + + ParserError $msg $yycnt $yy_current_buffer $index_ +} |