diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-04-13 19:07:24 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-04-13 19:07:24 (GMT) |
commit | c035c9899e98dd4963f4e26948c4a5159f294f56 (patch) | |
tree | 9c614ce9d8910642704d598656ef2bca68cf2372 /ds9/parsers/matchparser.tac | |
parent | 9dbeaaa6ccc5cb8f3bef0bd33f26b9f7c5332cd4 (diff) | |
download | blt-c035c9899e98dd4963f4e26948c4a5159f294f56.zip blt-c035c9899e98dd4963f4e26948c4a5159f294f56.tar.gz blt-c035c9899e98dd4963f4e26948c4a5159f294f56.tar.bz2 |
add ds9 lock/match parser
Diffstat (limited to 'ds9/parsers/matchparser.tac')
-rw-r--r-- | ds9/parsers/matchparser.tac | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/ds9/parsers/matchparser.tac b/ds9/parsers/matchparser.tac new file mode 100644 index 0000000..3d81696 --- /dev/null +++ b/ds9/parsers/matchparser.tac @@ -0,0 +1,65 @@ +%{ +%} + +#include coords.tin +#include numeric.tin +#include string.tin + +%start command + +%token 3D_ +%token AXES_ +%token BIN_ +%token BLOCK_ +%token COLORBAR_ +%token CROP_ +%token CROSSHAIR_ +%token FRAME_ +%token NONE_ +%token SCALE_ +%token SCALELIMITS_ +%token SLICE_ +%token SMOOTH_ + +%% + +#include coords.trl +#include numeric.trl + +command : match + | match {yyclearin; YYACCEPT} STRING_ + ; + +match : FRAME_ coordnone {MatchFrameCurrent $2} + | CROSSHAIR_ coordnone {MatchCrosshairCurrent $2} + | CROP_ coordnone {MatchCropCurrent $2} + | SLICE_ slice {MatchCubeCurrent $2} + | BIN_ {MatchBinCurrent} + | AXES_ {MatchAxesCurrent} + | SCALE_ {MatchScaleCurrent} + | SCALELIMITS_ {MatchScaleLimitsCurrent} + | COLORBAR_ {MatchColorCurrent} + | BLOCK_ {MatchBlockCurrent} + | SMOOTH_ {MatchSmoothCurrent} + | 3D_ {Match3DCurrent} + ; + +coordnone : coordsys {set _ $1} + | wcssys {set _ $1} + | NONE_ {set _ none} + ; + +slice : IMAGE_ {set _ image} + | wcssys {set _ $1} + | NONE_ {set _ none} + ; + +%% + +proc match::yyerror {msg} { + variable yycnt + variable yy_current_buffer + variable index_ + + ParserError $msg $yycnt $yy_current_buffer $index_ +} |