summaryrefslogtreecommitdiffstats
path: root/ds9/parsers/maskparser.tac
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-05-08 19:41:03 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-05-08 19:41:03 (GMT)
commit7cfa08b0968e0af4bc64ea0eab90d2b3f315fcbc (patch)
tree862adadde8bc462291baf42d9f48f51f454e19d6 /ds9/parsers/maskparser.tac
parent7f2438deb2325b457f5d770667654190c8376dbc (diff)
downloadblt-7cfa08b0968e0af4bc64ea0eab90d2b3f315fcbc.zip
blt-7cfa08b0968e0af4bc64ea0eab90d2b3f315fcbc.tar.gz
blt-7cfa08b0968e0af4bc64ea0eab90d2b3f315fcbc.tar.bz2
add ds9 mask parser
Diffstat (limited to 'ds9/parsers/maskparser.tac')
-rw-r--r--ds9/parsers/maskparser.tac41
1 files changed, 41 insertions, 0 deletions
diff --git a/ds9/parsers/maskparser.tac b/ds9/parsers/maskparser.tac
new file mode 100644
index 0000000..4d37592
--- /dev/null
+++ b/ds9/parsers/maskparser.tac
@@ -0,0 +1,41 @@
+%{
+%}
+
+#include numeric.tin
+#include string.tin
+
+%start command
+
+%token CLEAR_
+%token CLOSE_
+%token COLOR_
+%token MARK_
+%token OPEN_
+%token TRANSPARENCY_
+
+%%
+
+#include numeric.trl
+
+command : mask
+ | mask {yyclearin; YYACCEPT} STRING_
+ ;
+
+mask : {MaskCmdSet rr mask}
+ | OPEN_ {MaskDialog}
+ | CLOSE_ {MaskDestroyDialog}
+ | CLEAR_ {MaskClear}
+ | COLOR_ STRING_ {MaskCmdSet color $2 MaskColor}
+ | MARK_ INT_ {MaskCmdSet mark $2 MaskMark}
+ | TRANSPARENCY_ INT_ {MaskCmdSet transparency $2 MaskTransparency}
+ ;
+
+%%
+
+proc mask::yyerror {msg} {
+ variable yycnt
+ variable yy_current_buffer
+ variable index_
+
+ ParserError $msg $yycnt $yy_current_buffer $index_
+}