summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-06-06 21:04:54 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-06-06 21:04:54 (GMT)
commit6688918e7ff171d5d8f405a0b563861258431019 (patch)
tree7325e74d49b26bdb661c66679d4260f2dd8950bd
parent45f0a9da1052918eb9796ee5315bf4c80abdd4ad (diff)
downloadblt-6688918e7ff171d5d8f405a0b563861258431019.zip
blt-6688918e7ff171d5d8f405a0b563861258431019.tar.gz
blt-6688918e7ff171d5d8f405a0b563861258431019.tar.bz2
add ds9 smooth send parser
-rw-r--r--ds9/library/smooth.tcl17
-rw-r--r--ds9/library/source.tcl2
-rw-r--r--ds9/parsers/smoothsendlex.fcl20
-rw-r--r--ds9/parsers/smoothsendparser.tac36
4 files changed, 64 insertions, 11 deletions
diff --git a/ds9/library/smooth.tcl b/ds9/library/smooth.tcl
index f43f156..ca5a5d3 100644
--- a/ds9/library/smooth.tcl
+++ b/ds9/library/smooth.tcl
@@ -352,16 +352,11 @@ proc ProcessSmoothCmd {varname iname} {
}
proc ProcessSendSmoothCmd {proc id param {sock {}} {fn {}}} {
- global smooth
+ global parse
+ set parse(proc) $proc
+ set parse(id) $id
- switch -- [lindex $param 0] {
- lock {$proc $id [ToYesNo $smooth(lock)]}
- function {$proc $id "$smooth(function)\n"}
- radius {$proc $id "$smooth(radius)\n"}
- radiusminor {$proc $id "$smooth(radius,minor)\n"}
- sigma {$proc $id "$smooth(sigma)\n"}
- sigmaminor {$proc $id "$smooth(sigma,minor)\n"}
- angle {$proc $id "$smooth(angle)\n"}
- default {$proc $id [ToYesNo $smooth(view)]}
- }
+ smoothsend::YY_FLUSH_BUFFER
+ smoothsend::yy_scan_string $param
+ smoothsend::yyparse
}
diff --git a/ds9/library/source.tcl b/ds9/library/source.tcl
index 92e40a7..2867569 100644
--- a/ds9/library/source.tcl
+++ b/ds9/library/source.tcl
@@ -364,6 +364,8 @@ source $ds9(root)/library/sleepparser.tcl
source $ds9(root)/library/sleeplex.tcl
source $ds9(root)/library/smoothparser.tcl
source $ds9(root)/library/smoothlex.tcl
+source $ds9(root)/library/smoothsendparser.tcl
+source $ds9(root)/library/smoothsendlex.tcl
source $ds9(root)/library/smosaicirafparser.tcl
source $ds9(root)/library/smosaiciraflex.tcl
source $ds9(root)/library/smosaicwcsparser.tcl
diff --git a/ds9/parsers/smoothsendlex.fcl b/ds9/parsers/smoothsendlex.fcl
new file mode 100644
index 0000000..778f79b
--- /dev/null
+++ b/ds9/parsers/smoothsendlex.fcl
@@ -0,0 +1,20 @@
+#tab smoothsendparser.tab.tcl
+
+%{
+%}
+
+#include defs.fin
+
+%%
+
+angle {return $ANGLE_}
+function {return $FUNCTION_}
+lock {return $LOCK_}
+radius {return $RADIUS_}
+radiusminor {return $RADIUSMINOR_}
+sigma {return $SIGMA_}
+sigmaminor {return $SIGMAMINOR_}
+
+#include string.fin
+
+%%
diff --git a/ds9/parsers/smoothsendparser.tac b/ds9/parsers/smoothsendparser.tac
new file mode 100644
index 0000000..469b0d6
--- /dev/null
+++ b/ds9/parsers/smoothsendparser.tac
@@ -0,0 +1,36 @@
+%{
+%}
+
+#include string.tin
+
+%start smoothsend
+
+%token ANGLE_
+%token FUNCTION_
+%token LOCK_
+%token RADIUS_
+%token RADIUSMINOR_
+%token SIGMA_
+%token SIGMAMINOR_
+
+%%
+
+smoothsend : {ProcessSendCmdYesNo smooth view}
+ | LOCK_ {ProcessSendCmdYesNo smooth lock}
+ | FUNCTION_ {ProcessSendCmdGet smooth function}
+ | RADIUS_ {ProcessSendCmdGet smooth radius}
+ | RADIUSMINOR_ {ProcessSendCmdGet smooth radius,minor}
+ | SIGMA_ {ProcessSendCmdGet smooth sigma}
+ | SIGMAMINOR_ {ProcessSendCmdGet smooth sigma,minor}
+ | ANGLE_ {ProcessSendCmdGet smooth angle}
+ ;
+
+%%
+
+proc smoothsend::yyerror {msg} {
+ variable yycnt
+ variable yy_current_buffer
+ variable index_
+
+ ParserError $msg $yycnt $yy_current_buffer $index_
+}