diff options
-rw-r--r-- | ds9/parsers/minmaxlex.fcl | 22 | ||||
-rw-r--r-- | ds9/parsers/minmaxparser.tac | 47 |
2 files changed, 69 insertions, 0 deletions
diff --git a/ds9/parsers/minmaxlex.fcl b/ds9/parsers/minmaxlex.fcl new file mode 100644 index 0000000..be171dd --- /dev/null +++ b/ds9/parsers/minmaxlex.fcl @@ -0,0 +1,22 @@ +#tab minmaxparser.tab.tcl + +%{ +%} + +#include defs.fin + +%% + +close {return $CLOSE_} +auto {return $AUTO_} +datamin {return $DATAMIN_} +irafmin {return $IRAFMIN_} +interval {return $INTERVAL_} +mode {return $MODE_} +sample {return $SAMPLE_} +scan {return $SCAN_} + +#include numeric.fin +#include string.fin + +%% diff --git a/ds9/parsers/minmaxparser.tac b/ds9/parsers/minmaxparser.tac new file mode 100644 index 0000000..7b926f2 --- /dev/null +++ b/ds9/parsers/minmaxparser.tac @@ -0,0 +1,47 @@ +%{ +%} + +#include numeric.tin +#include string.tin + +%start command + +%token AUTO_ +%token DATAMIN_ +%token IRAFMIN_ +%token INTERVAL_ +%token MODE_ +%token SAMPLE_ +%token SCAN_ + +%% + +#include numeric.trl + +command : minmax + | minmax {yyclearin; YYACCEPT} STRING_ + ; + +minmax : {ScaleCmdSet mode minmax ChangeScaleMode} + | mode {MinmaxCmdSet mode $1 ChangeMinMax} + | MODE_ mode {MinmaxCmdSet mode $2 ChangeMinMax} + | INTERVAL_ INT_ {MinmaxCmdSet sample $2 ChangeMinMax} + ; + +mode : SCAN_ {set _ scan} + | SAMPLE_ {set _ sample} + | DATAMIN_ {set _ datamin} + | IRAFMIN_ {set _ irafmin} +# backward compatibility + | AUTO_ {set _ scan} + ; + +%% + +proc minmax::yyerror {msg} { + variable yycnt + variable yy_current_buffer + variable index_ + + ParserError $msg $yycnt $yy_current_buffer $index_ +} |