summaryrefslogtreecommitdiffstats
path: root/ds9/parsers
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
parent7f2438deb2325b457f5d770667654190c8376dbc (diff)
downloadblt-7cfa08b0968e0af4bc64ea0eab90d2b3f315fcbc.zip
blt-7cfa08b0968e0af4bc64ea0eab90d2b3f315fcbc.tar.gz
blt-7cfa08b0968e0af4bc64ea0eab90d2b3f315fcbc.tar.bz2
add ds9 mask parser
Diffstat (limited to 'ds9/parsers')
-rw-r--r--ds9/parsers/iislex.fcl15
-rw-r--r--ds9/parsers/iisparser.tac31
-rw-r--r--ds9/parsers/masklex.fcl20
-rw-r--r--ds9/parsers/maskparser.tac41
4 files changed, 107 insertions, 0 deletions
diff --git a/ds9/parsers/iislex.fcl b/ds9/parsers/iislex.fcl
new file mode 100644
index 0000000..7795f16
--- /dev/null
+++ b/ds9/parsers/iislex.fcl
@@ -0,0 +1,15 @@
+#tab iisparser.tab.tcl
+
+%{
+%}
+
+#include defs.fin
+
+%%
+
+filename {return $FILENAME_}
+
+#include numeric.fin
+#include string.fin
+
+%%
diff --git a/ds9/parsers/iisparser.tac b/ds9/parsers/iisparser.tac
new file mode 100644
index 0000000..e486cbb
--- /dev/null
+++ b/ds9/parsers/iisparser.tac
@@ -0,0 +1,31 @@
+%{
+%}
+
+#include numeric.tin
+#include string.tin
+
+%start command
+
+%token FILENAME_
+
+%%
+
+#include numeric.trl
+
+command : iis
+ | iis {yyclearin; YYACCEPT} STRING_
+ ;
+
+iis : FILENAME_ STRING_ {IISCmd $2}
+ | FILENAME_ STRING_ INT_ {IISCmd $2 $3}
+ ;
+
+%%
+
+proc iis::yyerror {msg} {
+ variable yycnt
+ variable yy_current_buffer
+ variable index_
+
+ ParserError $msg $yycnt $yy_current_buffer $index_
+}
diff --git a/ds9/parsers/masklex.fcl b/ds9/parsers/masklex.fcl
new file mode 100644
index 0000000..a64b52f
--- /dev/null
+++ b/ds9/parsers/masklex.fcl
@@ -0,0 +1,20 @@
+#tab maskparser.tab.tcl
+
+%{
+%}
+
+#include defs.fin
+
+%%
+
+close {return $CLOSE_}
+clear {return $CLEAR_}
+color {return $COLOR_}
+mark {return $MARK_}
+open {return $OPEN_}
+transparency {return $TRANSPARENCY_}
+
+#include numeric.fin
+#include string.fin
+
+%%
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_
+}