diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-03-09 18:53:46 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-03-09 18:53:46 (GMT) |
commit | c846ca88b1423a436ed8ea5b1207d564f1383042 (patch) | |
tree | d067114ca4818267e0c483c302ed745dab72338e /ds9/parsers/blockparser.tac | |
parent | 5887ab5abc8f404e9bb970062800dcf0f1431756 (diff) | |
download | blt-c846ca88b1423a436ed8ea5b1207d564f1383042.zip blt-c846ca88b1423a436ed8ea5b1207d564f1383042.tar.gz blt-c846ca88b1423a436ed8ea5b1207d564f1383042.tar.bz2 |
add block ds9 parser
Diffstat (limited to 'ds9/parsers/blockparser.tac')
-rw-r--r-- | ds9/parsers/blockparser.tac | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/ds9/parsers/blockparser.tac b/ds9/parsers/blockparser.tac new file mode 100644 index 0000000..53a22ca --- /dev/null +++ b/ds9/parsers/blockparser.tac @@ -0,0 +1,51 @@ +%{ +%} + +#include yesno.tin +#include base.tin + +%start command + +%token CLOSE_ +%token FIT_ +%token IN_ +%token LOCK_ +%token MATCH_ +%token OPEN_ +%token OUT_ +%token TO_ + +%% + +#include yesno.trl +#include base.trl + +command : block + | block {yyclearin; YYACCEPT} CMD_ + ; + +block : CLOSE_ {BlockDestroyDialog} + | OPEN_ {BlockDialog} + | MATCH_ {MatchBlockCurrent} + | LOCK_ yesno {global block; set block(lock) $2; LockBlockCurrent} + | numeric {Block $1 $1} + | numeric numeric {Block $1 $2} + | IN_ {Block .5 .5} + | OUT_ {Block 2 2} + | TO_ blockTo + ; + +blockTo : numeric {global block; set block(factor) "$1 $1"; ChangeBlock} + | numeric numeric {global block; set block(factor) "$1 $2"; ChangeBlock} + | FIT_ {BlockToFit} + ; + +%% + +proc block::yyerror {msg} { + variable yycnt + variable yy_current_buffer + variable index_ + + ParserError $msg $yycnt $yy_current_buffer $index_ +} |