diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-03-12 21:49:44 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-03-12 21:49:44 (GMT) |
commit | 902d073ecfb62a1788c919782fe9ad9704b86000 (patch) | |
tree | 0ee1faf4a3c1e6515b32e616bfe4e78ea9bc2f32 /ds9 | |
parent | 2667a0c5040a17fad6a4c8328a81e43b9460da13 (diff) | |
download | blt-902d073ecfb62a1788c919782fe9ad9704b86000.zip blt-902d073ecfb62a1788c919782fe9ad9704b86000.tar.gz blt-902d073ecfb62a1788c919782fe9ad9704b86000.tar.bz2 |
update ds9 parsers
Diffstat (limited to 'ds9')
-rw-r--r-- | ds9/library/error.tcl | 2 | ||||
-rw-r--r-- | ds9/library/scale.tcl | 11 | ||||
-rw-r--r-- | ds9/library/source.tcl | 2 | ||||
-rw-r--r-- | ds9/parsers/base.fin | 3 | ||||
-rw-r--r-- | ds9/parsers/base.tin | 1 | ||||
-rw-r--r-- | ds9/parsers/binparser.tac | 2 | ||||
-rw-r--r-- | ds9/parsers/blockparser.tac | 2 | ||||
-rw-r--r-- | ds9/parsers/cmapparser.tac | 2 | ||||
-rw-r--r-- | ds9/parsers/colorbarparser.tac | 2 | ||||
-rw-r--r-- | ds9/parsers/coords.trl | 8 | ||||
-rw-r--r-- | ds9/parsers/dssesoparser.tac | 2 | ||||
-rw-r--r-- | ds9/parsers/dsssaoparser.tac | 2 | ||||
-rw-r--r-- | ds9/parsers/dssstsciparser.tac | 2 | ||||
-rw-r--r-- | ds9/parsers/nvssparser.tac | 2 | ||||
-rw-r--r-- | ds9/parsers/panparser.tac | 2 | ||||
-rw-r--r-- | ds9/parsers/skyformat.trl | 3 | ||||
-rw-r--r-- | ds9/parsers/skyframe.trl | 3 | ||||
-rw-r--r-- | ds9/parsers/skyviewparser.tac | 2 | ||||
-rw-r--r-- | ds9/parsers/threedparser.tac | 2 | ||||
-rw-r--r-- | ds9/parsers/twomassparser.tac | 2 | ||||
-rw-r--r-- | ds9/parsers/vlaparser.tac | 2 | ||||
-rw-r--r-- | ds9/parsers/vlssparser.tac | 2 | ||||
-rw-r--r-- | ds9/parsers/zoomparser.tac | 5 | ||||
-rw-r--r-- | ds9/parsers/zscalelex.fcl | 17 | ||||
-rw-r--r-- | ds9/parsers/zscaleparser.tac | 36 |
25 files changed, 83 insertions, 36 deletions
diff --git a/ds9/library/error.tcl b/ds9/library/error.tcl index e6e6b0e..afed4ea 100644 --- a/ds9/library/error.tcl +++ b/ds9/library/error.tcl @@ -62,7 +62,7 @@ proc ParserError {msg yycnt yy_current_buffer index_} { Error "$msg: [lindex $yy_current_buffer [expr $yycnt-1]]" } default { - puts stderr "[string range $yy_current_buffer 0 60]" + puts stderr "[string range $yy_current_buffer 0 80]" puts stderr [format "%*s" $index_ ^] puts stderr "$msg:" QuitDS9 diff --git a/ds9/library/scale.tcl b/ds9/library/scale.tcl index 91af618..e114d56 100644 --- a/ds9/library/scale.tcl +++ b/ds9/library/scale.tcl @@ -1009,6 +1009,16 @@ proc ProcessSendMinMaxCmd {proc id param} { proc ProcessZScaleCmd {varname iname} { upvar $varname var + upvar $iname ii + + zscale::YY_FLUSH_BUFFER + zscale::yy_scan_string [lrange $var $ii end] + zscale::yyparse + incr ii [expr $zscale::yycnt-1] +} + +proc oProcessZScaleCmd {varname iname} { + upvar $varname var upvar $iname i global zscale @@ -1031,7 +1041,6 @@ proc ProcessZScaleCmd {varname iname} { ChangeZScale } default { - # for backward compatibility set scale(mode) zscale ChangeScaleMode incr i -1 diff --git a/ds9/library/source.tcl b/ds9/library/source.tcl index 4cf43ce..930fd37 100644 --- a/ds9/library/source.tcl +++ b/ds9/library/source.tcl @@ -218,6 +218,8 @@ 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/zscaleparser.tcl +source $ds9(root)/library/zscalelex.tcl source $ds9(root)/library/zoomparser.tcl source $ds9(root)/library/zoomlex.tcl diff --git a/ds9/parsers/base.fin b/ds9/parsers/base.fin index aa3058c..6a63cac 100644 --- a/ds9/parsers/base.fin +++ b/ds9/parsers/base.fin @@ -14,9 +14,6 @@ # Quoted STRING \{[^\}]*\} {set yylval [string range $yytext 1 end-1]; return $STRING_} -# CMD --\w+ {return $CMD_} - # STRING \S+\S+ {set yylval $yytext; return $STRING_} diff --git a/ds9/parsers/base.tin b/ds9/parsers/base.tin index 1fb0e1f..f885055 100644 --- a/ds9/parsers/base.tin +++ b/ds9/parsers/base.tin @@ -1,4 +1,3 @@ %token INT_ %token REAL_ %token STRING_ -%token CMD_
\ No newline at end of file diff --git a/ds9/parsers/binparser.tac b/ds9/parsers/binparser.tac index 7163ea8..3a7b554 100644 --- a/ds9/parsers/binparser.tac +++ b/ds9/parsers/binparser.tac @@ -32,7 +32,7 @@ #include base.trl command : bin - | bin {yyclearin; YYACCEPT} CMD_ + | bin {yyclearin; YYACCEPT} STRING_ ; bin : CLOSE_ {BinDestroyDialog} diff --git a/ds9/parsers/blockparser.tac b/ds9/parsers/blockparser.tac index 90d1fd7..b77aaad 100644 --- a/ds9/parsers/blockparser.tac +++ b/ds9/parsers/blockparser.tac @@ -21,7 +21,7 @@ #include base.trl command : block - | block {yyclearin; YYACCEPT} CMD_ + | block {yyclearin; YYACCEPT} STRING_ ; block : OPEN_ {BlockDialog} diff --git a/ds9/parsers/cmapparser.tac b/ds9/parsers/cmapparser.tac index 18eecfe..5e48072 100644 --- a/ds9/parsers/cmapparser.tac +++ b/ds9/parsers/cmapparser.tac @@ -24,7 +24,7 @@ #include base.trl command : cmap - | cmap {yyclearin; YYACCEPT} CMD_ + | cmap {yyclearin; YYACCEPT} STRING_ ; cmap : STRING_ {CmapCmd $1} diff --git a/ds9/parsers/colorbarparser.tac b/ds9/parsers/colorbarparser.tac index 28bec3c..eeffc11 100644 --- a/ds9/parsers/colorbarparser.tac +++ b/ds9/parsers/colorbarparser.tac @@ -26,7 +26,7 @@ #include base.trl command : colorbar - | colorbar {yyclearin; YYACCEPT} CMD_ + | colorbar {yyclearin; YYACCEPT} STRING_ ; colorbar : yesno {global view; set view(colorbar) $1; UpdateView} diff --git a/ds9/parsers/coords.trl b/ds9/parsers/coords.trl index ffd6cfa..823751a 100644 --- a/ds9/parsers/coords.trl +++ b/ds9/parsers/coords.trl @@ -9,10 +9,6 @@ coordsys : IMAGE_ {set _ image} # YYABORT # } -coordsysdef : {set _ physical} - | coordsys {set _ $1} - ; - wcssys : WCS_ {set _ wcs} | WCSA_ {set _ wcsa} | WCSB_ {set _ wcsb} @@ -47,7 +43,3 @@ wcssys : WCS_ {set _ wcs} # YYABORT # } -wcssysdef : {set _ wcs} - | wcssys {set _ $1} - ; - diff --git a/ds9/parsers/dssesoparser.tac b/ds9/parsers/dssesoparser.tac index 66a2f5a..fe26c0a 100644 --- a/ds9/parsers/dssesoparser.tac +++ b/ds9/parsers/dssesoparser.tac @@ -19,7 +19,7 @@ #include base.trl command : dsseso - | dsseso {yyclearin; YYACCEPT} CMD_ + | dsseso {yyclearin; YYACCEPT} STRING_ ; dsseso : {IMGSVRApply deso 1} diff --git a/ds9/parsers/dsssaoparser.tac b/ds9/parsers/dsssaoparser.tac index d4f54b0..a41ee1e 100644 --- a/ds9/parsers/dsssaoparser.tac +++ b/ds9/parsers/dsssaoparser.tac @@ -14,7 +14,7 @@ #include base.trl command : dsssao - | dsssao {yyclearin; YYACCEPT} CMD_ + | dsssao {yyclearin; YYACCEPT} STRING_ ; dsssao : {IMGSVRApply dsao 1} diff --git a/ds9/parsers/dssstsciparser.tac b/ds9/parsers/dssstsciparser.tac index 96ae566..e8b15dc 100644 --- a/ds9/parsers/dssstsciparser.tac +++ b/ds9/parsers/dssstsciparser.tac @@ -24,7 +24,7 @@ #include base.trl command : dssstsci - | dssstsci {yyclearin; YYACCEPT} CMD_ + | dssstsci {yyclearin; YYACCEPT} STRING_ ; dssstsci : {IMGSVRApply dstsci 1} diff --git a/ds9/parsers/nvssparser.tac b/ds9/parsers/nvssparser.tac index af01121..34add74 100644 --- a/ds9/parsers/nvssparser.tac +++ b/ds9/parsers/nvssparser.tac @@ -14,7 +14,7 @@ #include base.trl command : nvss - | nvss {yyclearin; YYACCEPT} CMD_ + | nvss {yyclearin; YYACCEPT} STRING_ ; nvss : {IMGSVRApply dnvss 1} diff --git a/ds9/parsers/panparser.tac b/ds9/parsers/panparser.tac index 68b78d7..900275d 100644 --- a/ds9/parsers/panparser.tac +++ b/ds9/parsers/panparser.tac @@ -18,7 +18,7 @@ #include base.trl command : pan -| pan {yyclearin; YYACCEPT} CMD_ +| pan {yyclearin; YYACCEPT} STRING_ ; pan : OPEN_ {PanZoomDialog} diff --git a/ds9/parsers/skyformat.trl b/ds9/parsers/skyformat.trl index a0685b5..becfec9 100644 --- a/ds9/parsers/skyformat.trl +++ b/ds9/parsers/skyformat.trl @@ -3,6 +3,3 @@ skyformat : DEGREES_ {set _ degrees} | ARCSEC_ {set _ arcsec} ; -skyformatdef : {set _ degrees} - | skyformat {set _ $1} - ; diff --git a/ds9/parsers/skyframe.trl b/ds9/parsers/skyframe.trl index b9a7a41..92b61fa 100644 --- a/ds9/parsers/skyframe.trl +++ b/ds9/parsers/skyframe.trl @@ -12,6 +12,3 @@ skyframe : FK4_ {set _ fk4} # YYABORT # } -skyframedef : {set _ fk5} - | skyframe {set _ $1} - ; diff --git a/ds9/parsers/skyviewparser.tac b/ds9/parsers/skyviewparser.tac index 75fc09f..e9da994 100644 --- a/ds9/parsers/skyviewparser.tac +++ b/ds9/parsers/skyviewparser.tac @@ -16,7 +16,7 @@ #include base.trl command : skyview - | skyview {yyclearin; YYACCEPT} CMD_ + | skyview {yyclearin; YYACCEPT} STRING_ ; skyview : {IMGSVRApply dskyview 1} diff --git a/ds9/parsers/threedparser.tac b/ds9/parsers/threedparser.tac index f694b56..564adf9 100644 --- a/ds9/parsers/threedparser.tac +++ b/ds9/parsers/threedparser.tac @@ -30,7 +30,7 @@ #include base.trl command : 3d - | 3d {yyclearin; YYACCEPT} CMD_ + | 3d {yyclearin; YYACCEPT} STRING_ ; 3d : {Create3DFrame} diff --git a/ds9/parsers/twomassparser.tac b/ds9/parsers/twomassparser.tac index f7f02b5..c43ac8b 100644 --- a/ds9/parsers/twomassparser.tac +++ b/ds9/parsers/twomassparser.tac @@ -14,7 +14,7 @@ #include base.trl command : 2mass - | 2mass {yyclearin; YYACCEPT} CMD_ + | 2mass {yyclearin; YYACCEPT} STRING_ ; 2mass : {IMGSVRApply dtwomass 1} diff --git a/ds9/parsers/vlaparser.tac b/ds9/parsers/vlaparser.tac index bcb5a51..d44d77e 100644 --- a/ds9/parsers/vlaparser.tac +++ b/ds9/parsers/vlaparser.tac @@ -17,7 +17,7 @@ #include base.trl command : vla - | vla {yyclearin; YYACCEPT} CMD_ + | vla {yyclearin; YYACCEPT} STRING_ ; vla : {IMGSVRApply dvla 1} diff --git a/ds9/parsers/vlssparser.tac b/ds9/parsers/vlssparser.tac index 1f2a18b..cbf7ab6 100644 --- a/ds9/parsers/vlssparser.tac +++ b/ds9/parsers/vlssparser.tac @@ -14,7 +14,7 @@ #include base.trl command : vlss - | vlss {yyclearin; YYACCEPT} CMD_ + | vlss {yyclearin; YYACCEPT} STRING_ ; vlss : {IMGSVRApply dvlss 1} diff --git a/ds9/parsers/zoomparser.tac b/ds9/parsers/zoomparser.tac index 0956132..41ad906 100644 --- a/ds9/parsers/zoomparser.tac +++ b/ds9/parsers/zoomparser.tac @@ -16,10 +16,11 @@ #include base.trl -command : zoom - | zoom {yyclearin; YYACCEPT} CMD_ +command : zoom + | zoom {yyclearin; YYACCEPT} STRING_ ; + zoom : OPEN_ {PanZoomDialog} | CLOSE_ {PanZoomDestroyDialog} | IN_ {Zoom 2 2} diff --git a/ds9/parsers/zscalelex.fcl b/ds9/parsers/zscalelex.fcl new file mode 100644 index 0000000..cc30329 --- /dev/null +++ b/ds9/parsers/zscalelex.fcl @@ -0,0 +1,17 @@ +#tab zscaleparser.tab.tcl + +%{ +%} + +#include defs.fin + +%% + +contrast {return $CONTRAST_} +sample {return $SAMPLE_} +line {return $LINE_} + +#include yesno.fin +#include base.fin + +%% diff --git a/ds9/parsers/zscaleparser.tac b/ds9/parsers/zscaleparser.tac new file mode 100644 index 0000000..90a4cf6 --- /dev/null +++ b/ds9/parsers/zscaleparser.tac @@ -0,0 +1,36 @@ +%{ +%} + +#include yesno.tin +#include base.tin + +%start command + +%token CONTRAST_ +%token SAMPLE_ +%token LINE_ + +%% + +#include yesno.trl +#include base.trl + +command : zscale + | zscale {yyclearin; YYACCEPT} STRING_ + ; + +zscale : yesno {global scale; set scale(mode) zscale; ChangeScaleMode} + | CONTRAST_ {global zscale; set zscale(contrast) zscale; ChangeZScale} + | SAMPLE_ {global zscale; set zscale(sample) zscale; ChangeZScale} + | LINE_ {global zscale; set zscale(line) zscale; ChangeZScale} + ; + +%% + +proc zscale::yyerror {msg} { + variable yycnt + variable yy_current_buffer + variable index_ + + ParserError $msg $yycnt $yy_current_buffer $index_ +} |