diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-03-22 21:30:35 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-03-22 21:30:35 (GMT) |
commit | a62b1b0bb3868e37139c72aafd92ad310635c31c (patch) | |
tree | 5cacc1d10ae9a5b83566136f6d38be01ccd4d881 /ds9/parsers/crosshairparser.tac | |
parent | 6e4991730ba8fd5e33a6e7fd7ecaee9aba17fcaa (diff) | |
download | blt-a62b1b0bb3868e37139c72aafd92ad310635c31c.zip blt-a62b1b0bb3868e37139c72aafd92ad310635c31c.tar.gz blt-a62b1b0bb3868e37139c72aafd92ad310635c31c.tar.bz2 |
add ds9 crosshair parser
Diffstat (limited to 'ds9/parsers/crosshairparser.tac')
-rw-r--r-- | ds9/parsers/crosshairparser.tac | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/ds9/parsers/crosshairparser.tac b/ds9/parsers/crosshairparser.tac new file mode 100644 index 0000000..fa16124 --- /dev/null +++ b/ds9/parsers/crosshairparser.tac @@ -0,0 +1,55 @@ +%{ +%} + +#include skyframe.tin +#include coords.tin +#include numeric.tin +#include string.tin + +%start command + +%token LOCK_ +%token MATCH_ +%token NONE_ + +%% + +#include skyframe.trl +#include coords.trl +#include numeric.trl + +command : crosshair + | crosshair {yyclearin; YYACCEPT} STRING_ + ; + +crosshair : MATCH_ match {MatchCrosshairCurrent $2} + | LOCK_ lock {CrosshairCmdLock $2} + | numeric numeric {CrosshairTo $1 $2 physical fk5} + | numeric numeric coordsys {CrosshairTo $1 $2 $3 fk5} + | numeric numeric wcssys {CrosshairTo $1 $2 $3 fk5} + | numeric numeric skyframe {CrosshairTo $1 $2 wcs $3} + | numeric numeric wcssys skyframe {CrosshairTo $1 $2 $3 $4} + | SEXSTR_ SEXSTR_ {CrosshairTo $1 $2 wcs fk5} + | SEXSTR_ SEXSTR_ wcssys {CrosshairTo $1 $2 $3 fk5} + | SEXSTR_ SEXSTR_ skyframe {CrosshairTo $1 $2 wcs $3} + | SEXSTR_ SEXSTR_ wcssys skyframe {CrosshairTo $1 $2 $3 $4} + ; + +match : coordsys {set _ $1} + | wcssys {set _ $1} + ; + +lock : coordsys {set _ $1} + | wcssys {set _ $1} + | NONE_ {set _ none} + ; + +%% + +proc crosshair::yyerror {msg} { + variable yycnt + variable yy_current_buffer + variable index_ + + ParserError $msg $yycnt $yy_current_buffer $index_ +} |