diff options
-rw-r--r-- | ds9/library/source.tcl | 2 | ||||
-rw-r--r-- | ds9/library/vo.tcl | 45 | ||||
-rw-r--r-- | ds9/parsers/vosendlex.fcl | 18 | ||||
-rw-r--r-- | ds9/parsers/vosendparser.tac | 30 |
4 files changed, 69 insertions, 26 deletions
diff --git a/ds9/library/source.tcl b/ds9/library/source.tcl index ffee7f2..f71b9e0 100644 --- a/ds9/library/source.tcl +++ b/ds9/library/source.tcl @@ -436,6 +436,8 @@ source $ds9(root)/library/vlsssendparser.tcl source $ds9(root)/library/vlsssendlex.tcl source $ds9(root)/library/voparser.tcl source $ds9(root)/library/volex.tcl +source $ds9(root)/library/vosendparser.tcl +source $ds9(root)/library/vosendlex.tcl source $ds9(root)/library/wcsparser.tcl source $ds9(root)/library/wcslex.tcl source $ds9(root)/library/wcssendparser.tcl diff --git a/ds9/library/vo.tcl b/ds9/library/vo.tcl index 3f52ac7..b5c1be4 100644 --- a/ds9/library/vo.tcl +++ b/ds9/library/vo.tcl @@ -501,35 +501,28 @@ proc VOCmdDisconnect {str} { } proc ProcessSendVOCmd {proc id param {sock {}} {fn {}}} { + global parse + set parse(proc) $proc + set parse(id) $id + + vosend::YY_FLUSH_BUFFER + vosend::yy_scan_string $param + vosend::yyparse +} + +proc VOSendCmdConnect {{all {0}}} { global ivo global pvo - switch -- [string tolower $param] { - method {$proc $id "$pvo(method)\n"} - server {$proc $id "$pvo(server)\n"} - internal {$proc $id [ToYesNo $pvo(hv)]} - delay {$proc $id "$pvo(delay)\n"} - connect { - # current connections - set len [llength $ivo(server,button)] - set rr {} - for {set ii 0} {$ii<$len} {incr ii} { - if {$ivo(b$ii)} { - append rr "[lindex $ivo(server,host) $ii] [lindex $ivo(server,title) $ii] [lindex $ivo(server,url) $ii] $ivo(b$ii)\n" - } - } - $proc $id $rr - } - default { - VODialog - # all possible connections - set len [llength $ivo(server,button)] - set rr {} - for {set ii 0} {$ii<$len} {incr ii} { - append rr "[lindex $ivo(server,host) $ii] [lindex $ivo(server,title) $ii] [lindex $ivo(server,url) $ii] $ivo(b$ii)\n" - } - $proc $id $rr + VODialog + + set len [llength $ivo(server,button)] + set rr {} + for {set ii 0} {$ii<$len} {incr ii} { + if {$all || $ivo(b$ii)} { + append rr "[lindex $ivo(server,host) $ii] [lindex $ivo(server,title) $ii] [lindex $ivo(server,url) $ii] $ivo(b$ii)\n" } } -} + ProcessSendCmdTxt $rr +} diff --git a/ds9/parsers/vosendlex.fcl b/ds9/parsers/vosendlex.fcl new file mode 100644 index 0000000..22ed2e6 --- /dev/null +++ b/ds9/parsers/vosendlex.fcl @@ -0,0 +1,18 @@ +#tab vosendparser.tab.tcl + +%{ +%} + +#include defs.fin + +%% + +connect {return $CONNECT_} +delay {return $DELAY_} +internal {return $INTERNAL_} +method {return $METHOD_} +server {return $SERVER_} + +#include ws.fin + +%% diff --git a/ds9/parsers/vosendparser.tac b/ds9/parsers/vosendparser.tac new file mode 100644 index 0000000..065f8e5 --- /dev/null +++ b/ds9/parsers/vosendparser.tac @@ -0,0 +1,30 @@ +%{ +%} + +%start vosend + +%token CONNECT_ +%token DELAY_ +%token INTERNAL_ +%token METHOD_ +%token SERVER_ + +%% + +vosend : {VOSendCmdConnect 1} + | METHOD_ {ProcessSendCmdGet pvo method} + | SERVER_ {ProcessSendCmdGet pvo server} + | INTERNAL_ {ProcessSendCmdYesNo pvo hv} + | DELAY_ {ProcessSendCmdGet pvo delay} + | CONNECT_ {VOSendCmdConnect} + ; + +%% + +proc vosend::yyerror {msg} { + variable yycnt + variable yy_current_buffer + variable index_ + + ParserError $msg $yycnt $yy_current_buffer $index_ +} |