summaryrefslogtreecommitdiffstats
path: root/ds9/parsers/wcsparser.tac
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-04-11 19:17:58 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-04-11 19:17:58 (GMT)
commitf01d60ccbb6124acd3b51fb67a3332f07b824cee (patch)
tree4944cd63e716af229ae49af96e67f1a3b5f58aab /ds9/parsers/wcsparser.tac
parent0687f8781a9d6ae85df3eec400dae77a0f06fd4a (diff)
downloadblt-f01d60ccbb6124acd3b51fb67a3332f07b824cee.zip
blt-f01d60ccbb6124acd3b51fb67a3332f07b824cee.tar.gz
blt-f01d60ccbb6124acd3b51fb67a3332f07b824cee.tar.bz2
add ds9 wcs parser
Diffstat (limited to 'ds9/parsers/wcsparser.tac')
-rw-r--r--ds9/parsers/wcsparser.tac66
1 files changed, 66 insertions, 0 deletions
diff --git a/ds9/parsers/wcsparser.tac b/ds9/parsers/wcsparser.tac
new file mode 100644
index 0000000..fd904f1
--- /dev/null
+++ b/ds9/parsers/wcsparser.tac
@@ -0,0 +1,66 @@
+%{
+%}
+
+#include yesno.tin
+#include coords.tin
+#include numeric.tin
+#include string.tin
+
+%start command
+
+%token ALIGN_
+%token APPEND_
+%token CLOSE_
+%token OPEN_
+%token REPLACE_
+%token RESET_
+%token SKY_
+%token SKYFORMAT_
+%token SYSTEM_
+
+%%
+
+#include yesno.trl
+#include coords.trl
+#include numeric.trl
+
+command : wcs
+ | wcs {yyclearin; YYACCEPT} STRING_
+ ;
+
+wcs : OPEN_ {WCSDialog}
+ | CLOSE_ {WCSDestroyDialog}
+ | wcssys {WCSCmdSet system $1 UpdateWCS}
+ | SYSTEM_ wcssys {WCSCmdSet system $2 UpdateWCS}
+ | skyframe {WCSCmdSet sky $1 UpdateWCS}
+ | SKY_ skyframe {WCSCmdSet sky $2 UpdateWCS}
+ | skyformat {WCSCmdSet skyformat $1 UpdateWCS}
+ | SKYFORMAT_ skyformat {WCSCmdSet skyformat $2 UpdateWCS}
+ | ALIGN_ yesno {CurrentCmdSet align $2 AlignWCSFrame}
+ | RESET_ {WCSCmdReset 1}
+ | RESET_ INT_ {WCSCmdReset $2}
+ | REPLACE_ replace
+ | APPEND_ append
+ ;
+
+replace : {WCSCmdLoad replace 1}
+ | INT_ {WCSCmdLoad replace $1}
+ | STRING_ {WCSCmdLoadFn replace 1 $1}
+ | INT_ STRING_ {WCSCmdLoadFn replace $1 $2}
+ ;
+
+append : {WCSCmdLoad append 1}
+ | INT_ {WCSCmdLoad append $1}
+ | STRING_ {WCSCmdLoadFn append 1 $1}
+ | INT_ STRING_ {WCSCmdLoadFn append $1 $2}
+ ;
+
+%%
+
+proc wcs::yyerror {msg} {
+ variable yycnt
+ variable yy_current_buffer
+ variable index_
+
+ ParserError $msg $yycnt $yy_current_buffer $index_
+}