diff options
Diffstat (limited to 'ds9')
-rw-r--r-- | ds9/library/2mass.tcl | 9 | ||||
-rw-r--r-- | ds9/library/source.tcl | 2 | ||||
-rw-r--r-- | ds9/library/util.tcl | 16 | ||||
-rw-r--r-- | ds9/parsers/twomassparser.tac | 6 | ||||
-rw-r--r-- | ds9/parsers/twomasssendlex.fcl | 13 | ||||
-rw-r--r-- | ds9/parsers/twomasssendparser.tac | 28 |
6 files changed, 70 insertions, 4 deletions
diff --git a/ds9/library/2mass.tcl b/ds9/library/2mass.tcl index 36158ea..e8697ac 100644 --- a/ds9/library/2mass.tcl +++ b/ds9/library/2mass.tcl @@ -141,5 +141,12 @@ proc Process2MASSCmd {varname iname} { proc ProcessSend2MASSCmd {proc id param {sock {}} {fn {}}} { 2MASSDialog - IMGSVRProcessSendCmd $proc $id $param dtwomass + + global parse + set parse(proc) $proc + set parse(id) $id + + twomasssend::YY_FLUSH_BUFFER + twomasssend::yy_scan_string $param + twomasssend::yyparse } diff --git a/ds9/library/source.tcl b/ds9/library/source.tcl index 6f52cac..6d7c950 100644 --- a/ds9/library/source.tcl +++ b/ds9/library/source.tcl @@ -370,6 +370,8 @@ source $ds9(root)/library/tileparser.tcl source $ds9(root)/library/tilelex.tcl source $ds9(root)/library/twomassparser.tcl source $ds9(root)/library/twomasslex.tcl +source $ds9(root)/library/twomasssendparser.tcl +source $ds9(root)/library/twomasssendlex.tcl source $ds9(root)/library/updateparser.tcl source $ds9(root)/library/updatelex.tcl source $ds9(root)/library/urlfitsparser.tcl diff --git a/ds9/library/util.tcl b/ds9/library/util.tcl index b2fdc8d..b72eb2a 100644 --- a/ds9/library/util.tcl +++ b/ds9/library/util.tcl @@ -202,6 +202,22 @@ proc ProcessSendCmdGet {varname key} { $parse(proc) $parse(id) "$var($key)\n" } +proc ProcessSendCmdGet2 {varname key key2} { + upvar #0 $varname var + global $varname + + global parse + $parse(proc) $parse(id) "$var($key) $var($key2)\n" +} + +proc ProcessSendCmdGet3 {varname key key2 key3} { + upvar #0 $varname var + global $varname + + global parse + $parse(proc) $parse(id) "$var($key) $var($key2) $var($key3)\n" +} + proc ProcessSendCmdYesNo {varname key} { upvar #0 $varname var global $varname diff --git a/ds9/parsers/twomassparser.tac b/ds9/parsers/twomassparser.tac index 4432080..ce02100 100644 --- a/ds9/parsers/twomassparser.tac +++ b/ds9/parsers/twomassparser.tac @@ -16,11 +16,11 @@ #include imgsvr.trl #include numeric.trl -command : 2mass - | 2mass {yyclearin; YYACCEPT} STRING_ +command : twomass + | twomass {yyclearin; YYACCEPT} STRING_ ; -2mass : {IMGSVRApply dtwomass 1} +twomass : {IMGSVRApply dtwomass 1} | OPEN_ {} | CLOSE_ {ARDestroy dtwomass} | STRING_ {IMGSVRCmdName dtwomass $1} diff --git a/ds9/parsers/twomasssendlex.fcl b/ds9/parsers/twomasssendlex.fcl new file mode 100644 index 0000000..82c9463 --- /dev/null +++ b/ds9/parsers/twomasssendlex.fcl @@ -0,0 +1,13 @@ +#tab twomasssendparser.tab.tcl + +%{ +%} + +#include defs.fin + +%% + +#include imgsvr.fin +#include string.fin + +%% diff --git a/ds9/parsers/twomasssendparser.tac b/ds9/parsers/twomasssendparser.tac new file mode 100644 index 0000000..0c8abe4 --- /dev/null +++ b/ds9/parsers/twomasssendparser.tac @@ -0,0 +1,28 @@ +%{ +%} + +#include imgsvr.tin +#include string.tin + +%start twomasssend + +%% + +twomasssend : {ProcessSendCmdGet dtwomass name} + | NAME_ {ProcessSendCmdGet dtwomass name} + | SAVE_ {ProcessSendCmdYesNo dtwomass save} + | FRAME_ {ProcessSendCmdGet dtwomass mode} + | SURVEY_ {ProcessSendCmdGet dtwomass survey} + | SIZE_ {ProcessSendCmdGet3 dtwomass width height rformat} + | COORD_ {ProcessSendCmdGet3 dtwomass x y skyformat} + ; + +%% + +proc twomasssend::yyerror {msg} { + variable yycnt + variable yy_current_buffer + variable index_ + + ParserError $msg $yycnt $yy_current_buffer $index_ +} |