summaryrefslogtreecommitdiffstats
path: root/ds9/parsers/rotateparser.tac
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-04-13 20:29:06 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-04-13 20:29:06 (GMT)
commita05e03dc6a6b011f0ca615c8abf26962df5ca8a2 (patch)
tree4a09a17104131a7ab3f8370b95c792c9abd55cf6 /ds9/parsers/rotateparser.tac
parent8682bf46c3d3b410ba128bd37497daa6991f91c3 (diff)
downloadblt-a05e03dc6a6b011f0ca615c8abf26962df5ca8a2.zip
blt-a05e03dc6a6b011f0ca615c8abf26962df5ca8a2.tar.gz
blt-a05e03dc6a6b011f0ca615c8abf26962df5ca8a2.tar.bz2
add ds9 orient/rotate parser
Diffstat (limited to 'ds9/parsers/rotateparser.tac')
-rw-r--r--ds9/parsers/rotateparser.tac35
1 files changed, 35 insertions, 0 deletions
diff --git a/ds9/parsers/rotateparser.tac b/ds9/parsers/rotateparser.tac
new file mode 100644
index 0000000..e9d81df
--- /dev/null
+++ b/ds9/parsers/rotateparser.tac
@@ -0,0 +1,35 @@
+%{
+%}
+
+#include numeric.tin
+#include string.tin
+
+%start command
+
+%token CLOSE_
+%token OPEN_
+%token TO_
+
+%%
+
+#include numeric.trl
+
+command : rotate
+ | rotate {yyclearin; YYACCEPT} STRING_
+ ;
+
+rotate : numeric {Rotate $1}
+ | TO_ numeric {CurrentCmdSet rotate $2 ChangeRotate}
+ | OPEN_ {PanZoomDialog}
+ | CLOSE_ {PanZoomDestroyDialog}
+ ;
+
+%%
+
+proc rotate::yyerror {msg} {
+ variable yycnt
+ variable yy_current_buffer
+ variable index_
+
+ ParserError $msg $yycnt $yy_current_buffer $index_
+}