summaryrefslogtreecommitdiffstats
path: root/ds9
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-03-08 18:23:00 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-03-08 18:23:00 (GMT)
commit8f16be81d8537a9719436104ff9198c33510b8ed (patch)
tree0e3f1f73f8fd2b1370882089186097dcdf45a0dc /ds9
parentcba0eaac11f975b42e1576eb5b13dd679dd6965b (diff)
downloadblt-8f16be81d8537a9719436104ff9198c33510b8ed.zip
blt-8f16be81d8537a9719436104ff9198c33510b8ed.tar.gz
blt-8f16be81d8537a9719436104ff9198c33510b8ed.tar.bz2
add nvss parser
Diffstat (limited to 'ds9')
-rw-r--r--ds9/library/nvss.tcl12
-rw-r--r--ds9/library/source.tcl14
-rw-r--r--ds9/parsers/imgsvr.trl5
-rw-r--r--ds9/parsers/nvsslex.fcl14
-rw-r--r--ds9/parsers/nvssparser.tac48
5 files changed, 87 insertions, 6 deletions
diff --git a/ds9/library/nvss.tcl b/ds9/library/nvss.tcl
index e572899..b6bc5dd 100644
--- a/ds9/library/nvss.tcl
+++ b/ds9/library/nvss.tcl
@@ -150,6 +150,18 @@ charting of the Universe.
proc ProcessNVSSCmd {varname iname} {
upvar $varname var
+ upvar $iname ii
+
+ NVSSDialog
+
+ nvss::YY_FLUSH_BUFFER
+ nvss::yy_scan_string [lrange $var $ii end]
+ nvss::yyparse
+ incr ii [expr $nvss::yycnt-1]
+}
+
+proc oProcessNVSSCmd {varname iname} {
+ upvar $varname var
upvar $iname i
NVSSDialog
diff --git a/ds9/library/source.tcl b/ds9/library/source.tcl
index 00e2b7b..8c2c452 100644
--- a/ds9/library/source.tcl
+++ b/ds9/library/source.tcl
@@ -188,18 +188,20 @@ source $ds9(root)/library/xmfbox.tcl
source $ds9(root)/library/xmlrpc.tcl
source $ds9(root)/library/xpa.tcl
-source $ds9(root)/library/twomassparser.tcl
-source $ds9(root)/library/twomasslex.tcl
-source $ds9(root)/library/dsssaoparser.tcl
-source $ds9(root)/library/dsssaolex.tcl
source $ds9(root)/library/dssesoparser.tcl
source $ds9(root)/library/dssesolex.tcl
+source $ds9(root)/library/dsssaoparser.tcl
+source $ds9(root)/library/dsssaolex.tcl
source $ds9(root)/library/dssstsciparser.tcl
source $ds9(root)/library/dssstscilex.tcl
-source $ds9(root)/library/skyviewparser.tcl
-source $ds9(root)/library/skyviewlex.tcl
+source $ds9(root)/library/nvssparser.tcl
+source $ds9(root)/library/nvsslex.tcl
source $ds9(root)/library/panparser.tcl
source $ds9(root)/library/panlex.tcl
+source $ds9(root)/library/skyviewparser.tcl
+source $ds9(root)/library/skyviewlex.tcl
+source $ds9(root)/library/twomassparser.tcl
+source $ds9(root)/library/twomasslex.tcl
source $ds9(root)/library/zoomparser.tcl
source $ds9(root)/library/zoomlex.tcl
diff --git a/ds9/parsers/imgsvr.trl b/ds9/parsers/imgsvr.trl
index 959ea08..3cb2c0e 100644
--- a/ds9/parsers/imgsvr.trl
+++ b/ds9/parsers/imgsvr.trl
@@ -1,3 +1,8 @@
+# COORD_ is depricated
+# NAME_ is depricated
+# new optional WCS_ FK5_, does nothing
+# SIZE_ default is DEGREES_
+
deg : {set _ degrees}
| DEGREES_ {set _ degrees}
;
diff --git a/ds9/parsers/nvsslex.fcl b/ds9/parsers/nvsslex.fcl
new file mode 100644
index 0000000..f809d83
--- /dev/null
+++ b/ds9/parsers/nvsslex.fcl
@@ -0,0 +1,14 @@
+#tab nvssparser.tab.tcl
+
+%{
+%}
+
+#include defs.fin
+
+%%
+
+#include yesno.fin
+#include imgsvr.fin
+#include base.fin
+
+%%
diff --git a/ds9/parsers/nvssparser.tac b/ds9/parsers/nvssparser.tac
new file mode 100644
index 0000000..7efa349
--- /dev/null
+++ b/ds9/parsers/nvssparser.tac
@@ -0,0 +1,48 @@
+%{
+%}
+
+#include yesno.tin
+#include imgsvr.tin
+#include base.tin
+
+%start command
+
+%%
+
+#include yesno.trl
+#include imgsvr.trl
+#include base.trl
+
+command : nvss
+ | nvss {yyclearin; YYACCEPT} CMD_
+ ;
+
+nvss : {IMGSVRApply dnvss 1}
+ | OPEN_ {}
+ | CLOSE_ {ARDestroy dnvss}
+ | STRING_ {global dnvss; set dnvss(name) $1; IMGSVRApply dnvss 1}
+ | numeric numeric coordOpt {global dnvss; set dnvss(x) $1; set dnvss(y) $2; set dnvss(skyformat) degrees; set dnvss(skyformat,msg) degrees; IMGSVRApply dnvss 1}
+ | SEXSTR_ SEXSTR_ coordOpt {global dnvss; set dnvss(x) $1; set dnvss(y) $2; set dnvss(skyformat) sexagesimal; set dnvss(skyformat,msg) sexagesimal; IMGSVRApply dnvss 1}
+ | SIZE_ numeric numeric sizeOpt {global dnvss; set dnvss(width) $2; set dnvss(height) $3; set dnvss(rformat) $4; set dnvss(rformat,msg) $4}
+ | SAVE_ yesno {global dnvss; set dnvss(save) $2}
+ | FRAME_ frame {global dnvss; set dnvss(mode) $2}
+ | UPDATE_ update
+
+ | COORD_ numeric numeric deg {global dnvss; set dnvss(x) $2; set dnvss(y) $3; set dnvss(skyformat) $4; set dnvss(skyformat,msg) $4; IMGSVRApply dnvss 1}
+ | COORD_ SEXSTR_ SEXSTR_ sex {global dnvss; set dnvss(x) $2; set dnvss(y) $3; set dnvss(skyformat) $4; set dnvss(skyformat,msg) $4; IMGSVRApply dnvss 1}
+ | NAME_ STRING_ {global dnvss; set dnvss(name) $2; IMGSVRApply dnvss 1}
+ ;
+
+update : FRAME_ {IMGSVRUpdate dnvss; IMGSVRApply dnvss 1}
+ | CROSSHAIR_ {IMGSVRCrosshair dnvss; IMGSVRApply dnvss 1}
+ ;
+
+%%
+
+proc nvss::yyerror {msg} {
+ variable yycnt
+ variable yy_current_buffer
+ variable index_
+
+ ParserError $msg $yycnt $yy_current_buffer $index_
+}