From bef231e411516b6453f9c7addf9863b0ce0d93c6 Mon Sep 17 00:00:00 2001 From: William Joye Date: Thu, 8 Mar 2018 13:39:29 -0500 Subject: add vla/vlss parsers --- ds9/library/source.tcl | 4 +++ ds9/library/vla.tcl | 12 +++++++++ ds9/library/vlss.tcl | 12 +++++++++ ds9/parsers/dssesoparser.tac | 5 ---- ds9/parsers/dsssaoparser.tac | 5 ---- ds9/parsers/dssstsciparser.tac | 5 ---- ds9/parsers/skyviewparser.tac | 5 ---- ds9/parsers/twomassparser.tac | 5 ---- ds9/parsers/vlalex.fcl | 17 +++++++++++++ ds9/parsers/vlaparser.tac | 56 ++++++++++++++++++++++++++++++++++++++++++ ds9/parsers/vlsslex.fcl | 14 +++++++++++ ds9/parsers/vlssparser.tac | 48 ++++++++++++++++++++++++++++++++++++ 12 files changed, 163 insertions(+), 25 deletions(-) create mode 100644 ds9/parsers/vlalex.fcl create mode 100644 ds9/parsers/vlaparser.tac create mode 100644 ds9/parsers/vlsslex.fcl create mode 100644 ds9/parsers/vlssparser.tac diff --git a/ds9/library/source.tcl b/ds9/library/source.tcl index 8c2c452..e8f560a 100644 --- a/ds9/library/source.tcl +++ b/ds9/library/source.tcl @@ -202,6 +202,10 @@ 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/vlaparser.tcl +source $ds9(root)/library/vlalex.tcl +source $ds9(root)/library/vlssparser.tcl +source $ds9(root)/library/vlsslex.tcl source $ds9(root)/library/zoomparser.tcl source $ds9(root)/library/zoomlex.tcl diff --git a/ds9/library/vla.tcl b/ds9/library/vla.tcl index 034dfef..ef33a6f 100644 --- a/ds9/library/vla.tcl +++ b/ds9/library/vla.tcl @@ -161,6 +161,18 @@ charting of the Universe. proc ProcessVLACmd {varname iname} { upvar $varname var + upvar $iname ii + + VLADialog + + vla::YY_FLUSH_BUFFER + vla::yy_scan_string [lrange $var $ii end] + vla::yyparse + incr ii [expr $vla::yycnt-1] +} + +proc oProcessVLACmd {varname iname} { + upvar $varname var upvar $iname i VLADialog diff --git a/ds9/library/vlss.tcl b/ds9/library/vlss.tcl index ac1093c..cf2ba36 100644 --- a/ds9/library/vlss.tcl +++ b/ds9/library/vlss.tcl @@ -120,6 +120,18 @@ Naval Research Lab. proc ProcessVLSSCmd {varname iname} { upvar $varname var + upvar $iname ii + + VLSSDialog + + vlss::YY_FLUSH_BUFFER + vlss::yy_scan_string [lrange $var $ii end] + vlss::yyparse + incr ii [expr $vlss::yycnt-1] +} + +proc oProcessVLSSCmd {varname iname} { + upvar $varname var upvar $iname i VLSSDialog diff --git a/ds9/parsers/dssesoparser.tac b/ds9/parsers/dssesoparser.tac index 89dbf96..1b6bccc 100644 --- a/ds9/parsers/dssesoparser.tac +++ b/ds9/parsers/dssesoparser.tac @@ -22,11 +22,6 @@ command : dsseso | dsseso {yyclearin; YYACCEPT} CMD_ ; -# COORD_ is depricated -# NAME_ is depricated -# new optional WCS_ FK5_, does nothing -# SIZE_ default is DEGREES_ - dsseso : {IMGSVRApply deso 1} | OPEN_ {} | CLOSE_ {ARDestroy deso} diff --git a/ds9/parsers/dsssaoparser.tac b/ds9/parsers/dsssaoparser.tac index 87b253a..d774630 100644 --- a/ds9/parsers/dsssaoparser.tac +++ b/ds9/parsers/dsssaoparser.tac @@ -17,11 +17,6 @@ command : dsssao | dsssao {yyclearin; YYACCEPT} CMD_ ; -# COORD_ is depricated -# NAME_ is depricated -# new optional WCS_ FK5_, does nothing -# SIZE_ default is DEGREES_ - dsssao : {IMGSVRApply dsao 1} | OPEN_ {} | CLOSE_ {ARDestroy dsao} diff --git a/ds9/parsers/dssstsciparser.tac b/ds9/parsers/dssstsciparser.tac index cb3ed8c..649b2f3 100644 --- a/ds9/parsers/dssstsciparser.tac +++ b/ds9/parsers/dssstsciparser.tac @@ -27,11 +27,6 @@ command : dssstsci | dssstsci {yyclearin; YYACCEPT} CMD_ ; -# COORD_ is depricated -# NAME_ is depricated -# new optional WCS_ FK5_, does nothing -# SIZE_ default is DEGREES_ - dssstsci : {IMGSVRApply dstscii 1} | OPEN_ {} | CLOSE_ {ARDestroy dstscii} diff --git a/ds9/parsers/skyviewparser.tac b/ds9/parsers/skyviewparser.tac index 276fa43..9384969 100644 --- a/ds9/parsers/skyviewparser.tac +++ b/ds9/parsers/skyviewparser.tac @@ -19,11 +19,6 @@ command : skyview | skyview {yyclearin; YYACCEPT} CMD_ ; -# COORD_ is depricated -# NAME_ is depricated -# new optional WCS_ FK5_, does nothing -# SIZE_ default is DEGREES_ - skyview : {IMGSVRApply dskyview 1} | OPEN_ {} | CLOSE_ {ARDestroy dskyview} diff --git a/ds9/parsers/twomassparser.tac b/ds9/parsers/twomassparser.tac index ecc4d13..d206d1a 100644 --- a/ds9/parsers/twomassparser.tac +++ b/ds9/parsers/twomassparser.tac @@ -17,11 +17,6 @@ command : 2mass | 2mass {yyclearin; YYACCEPT} CMD_ ; -# COORD_ is depricated -# NAME_ is depricated -# new optional WCS_ FK5_, does nothing -# SIZE_ default is DEGREES_ - 2mass : {IMGSVRApply dtwomass 1} | OPEN_ {} | CLOSE_ {ARDestroy dtwomass} diff --git a/ds9/parsers/vlalex.fcl b/ds9/parsers/vlalex.fcl new file mode 100644 index 0000000..a7629e8 --- /dev/null +++ b/ds9/parsers/vlalex.fcl @@ -0,0 +1,17 @@ +#tab vlaparser.tab.tcl + +%{ +%} + +#include defs.fin + +%% + +stripe82 {return $STRIPE82_} +first {return $FIRST_} + +#include yesno.fin +#include imgsvr.fin +#include base.fin + +%% diff --git a/ds9/parsers/vlaparser.tac b/ds9/parsers/vlaparser.tac new file mode 100644 index 0000000..9a8369f --- /dev/null +++ b/ds9/parsers/vlaparser.tac @@ -0,0 +1,56 @@ +%{ +%} + +#include yesno.tin +#include imgsvr.tin +#include base.tin + +%start command + +%token STRIPE82_ +%token FIRST_ + +%% + +#include yesno.trl +#include imgsvr.trl +#include base.trl + +command : vla + | vla {yyclearin; YYACCEPT} CMD_ + ; + +vla : {IMGSVRApply dvla 1} + | OPEN_ {} + | CLOSE_ {ARDestroy dvla} + | STRING_ {global dvla; set dvla(name) $1; IMGSVRApply dvla 1} + | numeric numeric coordOpt {global dvla; set dvla(x) $1; set dvla(y) $2; set dvla(skyformat) degrees; set dvla(skyformat,msg) degrees; IMGSVRApply dvla 1} + | SEXSTR_ SEXSTR_ coordOpt {global dvla; set dvla(x) $1; set dvla(y) $2; set dvla(skyformat) sexagesimal; set dvla(skyformat,msg) sexagesimal; IMGSVRApply dvla 1} + | SIZE_ numeric numeric sizeOpt {global dvla; set dvla(width) $2; set dvla(height) $3; set dvla(rformat) $4; set dvla(rformat,msg) $4} + | SAVE_ yesno {global dvla; set dvla(save) $2} + | FRAME_ frame {global dvla; set dvla(mode) $2} + | UPDATE_ update + | SURVEY_ survey {global dvla; set dvla(survey) $2} + + | COORD_ numeric numeric deg {global dvla; set dvla(x) $2; set dvla(y) $3; set dvla(skyformat) $4; set dvla(skyformat,msg) $4; IMGSVRApply dvla 1} + | COORD_ SEXSTR_ SEXSTR_ sex {global dvla; set dvla(x) $2; set dvla(y) $3; set dvla(skyformat) $4; set dvla(skyformat,msg) $4; IMGSVRApply dvla 1} + | NAME_ STRING_ {global dvla; set dvla(name) $2; IMGSVRApply dvla 1} + ; + +update : FRAME_ {IMGSVRUpdate dvla; IMGSVRApply dvla 1} + | CROSSHAIR_ {IMGSVRCrosshair dvla; IMGSVRApply dvla 1} + ; + +survey : STRIPE82_ {set _ stripe82} + | FIRST_ {set _ first} + ; + +%% + +proc vla::yyerror {msg} { + variable yycnt + variable yy_current_buffer + variable index_ + + ParserError $msg $yycnt $yy_current_buffer $index_ +} diff --git a/ds9/parsers/vlsslex.fcl b/ds9/parsers/vlsslex.fcl new file mode 100644 index 0000000..93bba40 --- /dev/null +++ b/ds9/parsers/vlsslex.fcl @@ -0,0 +1,14 @@ +#tab vlssparser.tab.tcl + +%{ +%} + +#include defs.fin + +%% + +#include yesno.fin +#include imgsvr.fin +#include base.fin + +%% diff --git a/ds9/parsers/vlssparser.tac b/ds9/parsers/vlssparser.tac new file mode 100644 index 0000000..9cccb35 --- /dev/null +++ b/ds9/parsers/vlssparser.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 : vlss + | vlss {yyclearin; YYACCEPT} CMD_ + ; + +vlss : {IMGSVRApply dvlss 1} + | OPEN_ {} + | CLOSE_ {ARDestroy dvlss} + | STRING_ {global dvlss; set dvlss(name) $1; IMGSVRApply dvlss 1} + | numeric numeric coordOpt {global dvlss; set dvlss(x) $1; set dvlss(y) $2; set dvlss(skyformat) degrees; set dvlss(skyformat,msg) degrees; IMGSVRApply dvlss 1} + | SEXSTR_ SEXSTR_ coordOpt {global dvlss; set dvlss(x) $1; set dvlss(y) $2; set dvlss(skyformat) sexagesimal; set dvlss(skyformat,msg) sexagesimal; IMGSVRApply dvlss 1} + | SIZE_ numeric numeric sizeOpt {global dvlss; set dvlss(width) $2; set dvlss(height) $3; set dvlss(rformat) $4; set dvlss(rformat,msg) $4} + | SAVE_ yesno {global dvlss; set dvlss(save) $2} + | FRAME_ frame {global dvlss; set dvlss(mode) $2} + | UPDATE_ update + + | COORD_ numeric numeric deg {global dvlss; set dvlss(x) $2; set dvlss(y) $3; set dvlss(skyformat) $4; set dvlss(skyformat,msg) $4; IMGSVRApply dvlss 1} + | COORD_ SEXSTR_ SEXSTR_ sex {global dvlss; set dvlss(x) $2; set dvlss(y) $3; set dvlss(skyformat) $4; set dvlss(skyformat,msg) $4; IMGSVRApply dvlss 1} + | NAME_ STRING_ {global dvlss; set dvlss(name) $2; IMGSVRApply dvlss 1} + ; + +update : FRAME_ {IMGSVRUpdate dvlss; IMGSVRApply dvlss 1} + | CROSSHAIR_ {IMGSVRCrosshair dvlss; IMGSVRApply dvlss 1} + ; + +%% + +proc vlss::yyerror {msg} { + variable yycnt + variable yy_current_buffer + variable index_ + + ParserError $msg $yycnt $yy_current_buffer $index_ +} -- cgit v0.12