summaryrefslogtreecommitdiffstats
path: root/ds9/parsers
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-06-11 16:57:18 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-06-11 16:57:18 (GMT)
commit6489dc12e00c3704176619f7e6a43369ae50b2ec (patch)
tree275f5a867166ed5fb012f8af4956ae7214bbc468 /ds9/parsers
parentd233cb16ebbd17b7b0279a369554531709e1e9e5 (diff)
downloadblt-6489dc12e00c3704176619f7e6a43369ae50b2ec.zip
blt-6489dc12e00c3704176619f7e6a43369ae50b2ec.tar.gz
blt-6489dc12e00c3704176619f7e6a43369ae50b2ec.tar.bz2
add ds9 rgb send parser
Diffstat (limited to 'ds9/parsers')
-rw-r--r--ds9/parsers/rgbsendlex.fcl30
-rw-r--r--ds9/parsers/rgbsendparser.tac57
2 files changed, 87 insertions, 0 deletions
diff --git a/ds9/parsers/rgbsendlex.fcl b/ds9/parsers/rgbsendlex.fcl
new file mode 100644
index 0000000..92e6e0a
--- /dev/null
+++ b/ds9/parsers/rgbsendlex.fcl
@@ -0,0 +1,30 @@
+#tab rgbsendparser.tab.tcl
+
+%{
+%}
+
+#include defs.fin
+
+%%
+
+axes {return $AXES_}
+bin {return $BIN_}
+block {return $BLOCK_}
+blue {return $BLUE_}
+channel {return $CHANNEL_}
+colorbar {return $COLORBAR_}
+crop {return $CROP_}
+green {return $GREEN_}
+lock {return $LOCK_}
+red {return $RED_}
+scale {return $SCALE_}
+scalelimits {return $SCALELIMITS_}
+slice {return $SLICE_}
+smooth {return $SMOOTH_}
+system {return $SYSTEM_}
+view {return $VIEW_}
+wcs {return $WCS_}
+
+#include ws.fin
+
+%%
diff --git a/ds9/parsers/rgbsendparser.tac b/ds9/parsers/rgbsendparser.tac
new file mode 100644
index 0000000..2b7eed9
--- /dev/null
+++ b/ds9/parsers/rgbsendparser.tac
@@ -0,0 +1,57 @@
+%{
+%}
+
+%start rgbsend
+
+%token AXES_
+%token BIN_
+%token BLOCK_
+%token BLUE_
+%token CHANNEL_
+%token COLORBAR_
+%token CROP_
+%token GREEN_
+%token LOCK_
+%token RED_
+%token SCALE_
+%token SCALELIMITS_
+%token SLICE_
+%token SMOOTH_
+%token SYSTEM_
+%token VIEW_
+%token WCS_
+
+%%
+
+rgbsend : CHANNEL_ {ProcessSendCmdGet current rgb}
+ | LOCK_ lock {ProcessSendCmdYesNo rgb lock,$2}
+ | SYSTEM_ {ProcessSendCmdGet rgb system}
+ | VIEW_ view {ProcessSendCmdYesNo rgb $2}
+ ;
+
+lock : WCS_ {set _ wcs}
+ | CROP_ {set _ crop}
+ | SLICE_ {set _ slice}
+ | BIN_ {set _ bin}
+ | AXES_ {set _ axes}
+ | SCALE_ {set _ scale}
+ | SCALELIMITS_ {set _ scalelimits}
+ | COLORBAR_ {set _ colorbar}
+ | BLOCK_ {set _ block}
+ | SMOOTH_ {set _ smooth}
+ ;
+
+view : RED_ {set _ red}
+ | GREEN_ {set _ green}
+ | BLUE_ {set _ blue}
+ ;
+
+%%
+
+proc rgbsend::yyerror {msg} {
+ variable yycnt
+ variable yy_current_buffer
+ variable index_
+
+ ParserError $msg $yycnt $yy_current_buffer $index_
+}