diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-06-05 20:08:38 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-06-05 20:08:38 (GMT) |
commit | 5e379797126ae52c57fa5fb8e8d3984e6a0a359e (patch) | |
tree | 519fea1835e9da7799626fd3b98ff944b6eda9eb /ds9/parsers | |
parent | 3379de35277197a1e5b31e508a68dcf523afebac (diff) | |
download | blt-5e379797126ae52c57fa5fb8e8d3984e6a0a359e.zip blt-5e379797126ae52c57fa5fb8e8d3984e6a0a359e.tar.gz blt-5e379797126ae52c57fa5fb8e8d3984e6a0a359e.tar.bz2 |
add ds9 send scale, minmax, zscale parsers
Diffstat (limited to 'ds9/parsers')
-rw-r--r-- | ds9/parsers/minmaxsendlex.fcl | 15 | ||||
-rw-r--r-- | ds9/parsers/minmaxsendparser.tac | 29 | ||||
-rw-r--r-- | ds9/parsers/scaleparser.tac | 7 | ||||
-rw-r--r-- | ds9/parsers/scalesendlex.fcl | 21 | ||||
-rw-r--r-- | ds9/parsers/scalesendparser.tac | 41 | ||||
-rw-r--r-- | ds9/parsers/zscalesendlex.fcl | 14 | ||||
-rw-r--r-- | ds9/parsers/zscalesendparser.tac | 27 |
7 files changed, 149 insertions, 5 deletions
diff --git a/ds9/parsers/minmaxsendlex.fcl b/ds9/parsers/minmaxsendlex.fcl new file mode 100644 index 0000000..6a33af6 --- /dev/null +++ b/ds9/parsers/minmaxsendlex.fcl @@ -0,0 +1,15 @@ +#tab minmaxsendparser.tab.tcl + +%{ +%} + +#include defs.fin + +%% + +interval {return $INTERVAL_} +mode {return $MODE_} + +#include string.fin + +%% diff --git a/ds9/parsers/minmaxsendparser.tac b/ds9/parsers/minmaxsendparser.tac new file mode 100644 index 0000000..21fe269 --- /dev/null +++ b/ds9/parsers/minmaxsendparser.tac @@ -0,0 +1,29 @@ +%{ +%} + +#include numeric.tin +#include string.tin + +%start minmaxsend + +%token INTERVAL_ +%token MODE_ + +%% + +#include numeric.trl + +minmaxsend : {ProcessSendCmdGet minmax mode} + | MODE_ {ProcessSendCmdGet minmax mode} + | INTERVAL_ {ProcessSendCmdGet minmax sample} + ; + +%% + +proc minmaxsend::yyerror {msg} { + variable yycnt + variable yy_current_buffer + variable index_ + + ParserError $msg $yycnt $yy_current_buffer $index_ +} diff --git a/ds9/parsers/scaleparser.tac b/ds9/parsers/scaleparser.tac index 7ca2bec..4a437a6 100644 --- a/ds9/parsers/scaleparser.tac +++ b/ds9/parsers/scaleparser.tac @@ -46,9 +46,10 @@ scale : OPEN_ {ScaleDialog} | MATCH_ match | LOCK_ lock | scales {ProcessCmdSet scale type $1 ChangeScale} - | LOG_ log + | LOG_ EXP_ numeric {ProcessCmdSet scale log $3 ChangeScale} | DATASEC_ yesno {ProcessCmdSet scale datasec $2 ChangeDATASEC} | LIMITS_ numeric numeric {ProcessCmdSet scale min $2 {}; ProcessCmdSet scale max $3 ChangeScaleLimit} +# backward compatibility | SCALELIMITS_ numeric numeric {ProcessCmdSet scale min $2 {}; ProcessCmdSet scale max $3 ChangeScaleLimit} | mode {ProcessCmdSet scale mode $1 ChangeScaleMode} | MODE_ mode {ProcessCmdSet scale mode $2 ChangeScaleMode} @@ -76,10 +77,6 @@ lock : yesno {ProcessCmdSet scale lock $1 LockScaleCurrent} | SCALELIMITS_ yesno {ProcessCmdSet scale lock,limits $2 LockScaleLimitsCurrent} ; -log : {ProcessCmdSet scale type log ChangeScale} - | EXP_ numeric {ProcessCmdSet scale log $2 ChangeScale} - ; - mode : numeric {set _ $1} | MINMAX_ {set _ minmax} | ZSCALE_ {set _ zscale} diff --git a/ds9/parsers/scalesendlex.fcl b/ds9/parsers/scalesendlex.fcl new file mode 100644 index 0000000..272efaf --- /dev/null +++ b/ds9/parsers/scalesendlex.fcl @@ -0,0 +1,21 @@ +#tab scalesendparser.tab.tcl + +%{ +%} + +#include defs.fin + +%% + +datasec {return $DATASEC_} +exp {return $EXP_} +limits {return $LIMITS_} +lock {return $LOCK_} +log {return $LOG_} +mode {return $MODE_} +scalelimits {return $SCALELIMITS_} +scope {return $SCOPE_} + +#include string.fin + +%% diff --git a/ds9/parsers/scalesendparser.tac b/ds9/parsers/scalesendparser.tac new file mode 100644 index 0000000..b47f4a6 --- /dev/null +++ b/ds9/parsers/scalesendparser.tac @@ -0,0 +1,41 @@ +%{ +%} + +#include string.tin + +%start scalesend + +%token DATASEC_ +%token EXP_ +%token LIMITS_ +%token LOCK_ +%token LOG_ +%token MODE_ +%token SCALELIMITS_ +%token SCOPE_ + +%% + +scalesend : {ProcessSendCmdGet scale type} + | LOCK_ {ProcessSendCmdYesNo scale lock} + | LOCK_ LIMITS_ {ProcessSendCmdYesNo scale lock,limits} + | DATASEC_ {ProcessSendCmdGet scale datasec} + | LIMITS_ {ProcessSendCmdCurrent "get clip"} +# backward compatibility + | SCALELIMITS_ {ProcessSendCmdCurrent "get clip"} + | MODE_ {ProcessSendCmdGet scale mode} + | SCOPE_ {ProcessSendCmdGet scale scope} + | LOG_ EXP_ {ProcessSendCmdGet scale log} +# backward compatibility + | LOG_ {ProcessSendCmdGet scale log} + ; + +%% + +proc scale::yyerror {msg} { + variable yycnt + variable yy_current_buffer + variable index_ + + ParserError $msg $yycnt $yy_current_buffer $index_ +} diff --git a/ds9/parsers/zscalesendlex.fcl b/ds9/parsers/zscalesendlex.fcl new file mode 100644 index 0000000..ea43480 --- /dev/null +++ b/ds9/parsers/zscalesendlex.fcl @@ -0,0 +1,14 @@ +#tab zscalesendparser.tab.tcl + +%{ +%} + +#include defs.fin + +%% + +contrast {return $CONTRAST_} +sample {return $SAMPLE_} +line {return $LINE_} + +%% diff --git a/ds9/parsers/zscalesendparser.tac b/ds9/parsers/zscalesendparser.tac new file mode 100644 index 0000000..a3ebd96 --- /dev/null +++ b/ds9/parsers/zscalesendparser.tac @@ -0,0 +1,27 @@ +%{ +%} + +#include string.tin + +%start zscalesend + +%token CONTRAST_ +%token SAMPLE_ +%token LINE_ + +%% + +zscalesend : CONTRAST_ {ProcessSendCmdGet zscale contrast} + | SAMPLE_ {ProcessSendCmdGet zscale sample} + | LINE_ {ProcessSendCmdGet zscale line} + ; + +%% + +proc zscalesend::yyerror {msg} { + variable yycnt + variable yy_current_buffer + variable index_ + + ParserError $msg $yycnt $yy_current_buffer $index_ +} |