diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-05-11 19:40:07 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-05-11 19:40:07 (GMT) |
commit | 44a961c1f3f71474c45744f1dd3f590d6aa3eadd (patch) | |
tree | 4f48d399cd8452c42416df0db55c94e5c6deea7e | |
parent | da712e58d02b1e0cb0edf2da3a7b9a01190093b4 (diff) | |
download | blt-44a961c1f3f71474c45744f1dd3f590d6aa3eadd.zip blt-44a961c1f3f71474c45744f1dd3f590d6aa3eadd.tar.gz blt-44a961c1f3f71474c45744f1dd3f590d6aa3eadd.tar.bz2 |
add ds9 smosaiciraf parser
-rw-r--r-- | ds9/library/smosaiciraf.tcl | 22 | ||||
-rw-r--r-- | ds9/library/source.tcl | 2 | ||||
-rw-r--r-- | ds9/parsers/smosaiciraflex.fcl | 15 | ||||
-rw-r--r-- | ds9/parsers/smosaicirafparser.tac | 33 |
4 files changed, 60 insertions, 12 deletions
diff --git a/ds9/library/smosaiciraf.tcl b/ds9/library/smosaiciraf.tcl index 18d92c5..bf5cde2 100644 --- a/ds9/library/smosaiciraf.tcl +++ b/ds9/library/smosaiciraf.tcl @@ -21,11 +21,15 @@ proc ProcessSMosaicIRAFCmd {varname iname sock fn layer} { upvar $varname var upvar $iname i - global loadParam - global current + global debug + if {$debug(tcl,parser)} { + smosaiciraf::YY_FLUSH_BUFFER + smosaiciraf::yy_scan_string [lrange $var $i end] + smosaiciraf::yyparse + incr i [expr $smosaiciraf::yycnt-1] + } else { set layer {} - switch -- [string tolower [lindex $var $i]] { new { incr i @@ -41,20 +45,13 @@ proc ProcessSMosaicIRAFCmd {varname iname sock fn layer} { } } - set opt [lindex $var $i] - if {$opt != {}} { - incr i - } else { - set opt wcs - } - if {$sock != {}} { # xpa if {0} { # not supported } else { LoadSMosaicIRAFFile [lindex $var $i] [lindex $var [expr $i+1]] \ - $layer $opt + $layer } } else { # comm @@ -62,8 +59,9 @@ proc ProcessSMosaicIRAFCmd {varname iname sock fn layer} { # not supported } else { LoadSMosaicIRAFFile [lindex $var $i] [lindex $var [expr $i+1]] \ - $layer $opt + $layer } } FinishLoad } +} diff --git a/ds9/library/source.tcl b/ds9/library/source.tcl index 2030400..b22de0b 100644 --- a/ds9/library/source.tcl +++ b/ds9/library/source.tcl @@ -324,6 +324,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/smosaicirafparser.tcl +source $ds9(root)/library/smosaiciraflex.tcl source $ds9(root)/library/smosaicwcsparser.tcl source $ds9(root)/library/smosaicwcslex.tcl source $ds9(root)/library/sourceparser.tcl diff --git a/ds9/parsers/smosaiciraflex.fcl b/ds9/parsers/smosaiciraflex.fcl new file mode 100644 index 0000000..9af2cd3 --- /dev/null +++ b/ds9/parsers/smosaiciraflex.fcl @@ -0,0 +1,15 @@ +#tab smosaicirafparser.tab.tcl + +%{ +%} + +#include defs.fin + +%% + +mask {return $MASK_} +new {return $NEW_} + +#include string.fin + +%% diff --git a/ds9/parsers/smosaicirafparser.tac b/ds9/parsers/smosaicirafparser.tac new file mode 100644 index 0000000..daa6a3b --- /dev/null +++ b/ds9/parsers/smosaicirafparser.tac @@ -0,0 +1,33 @@ +%{ +%} + +#include string.tin + +%start command + +%token MASK_ +%token NEW_ + +%% + +command : smosaiciraf + | smosaiciraf {yyclearin; YYACCEPT} STRING_ + ; + +smosaiciraf : opts STRING_ STRING_ {LoadSMosaicIRAFFile $2 $3 $1} + ; + +opts : + | NEW_ {CreateFrame; set _ {}} + | MASK_ {set _ mask} + ; + +%% + +proc smosaiciraf::yyerror {msg} { + variable yycnt + variable yy_current_buffer + variable index_ + + ParserError $msg $yycnt $yy_current_buffer $index_ +} |