summaryrefslogtreecommitdiffstats
path: root/ds9/parsers/contourparser.tac
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-03-16 16:48:21 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-03-16 16:48:21 (GMT)
commitf6362e12a6c080c84c2f102ad5dc44e2fb63357a (patch)
tree239f3dfe781705a5e0a2505220b166f990bbc6f2 /ds9/parsers/contourparser.tac
parente1f5a6a2b516116e280c01e383a73c4ca12df423 (diff)
downloadblt-f6362e12a6c080c84c2f102ad5dc44e2fb63357a.zip
blt-f6362e12a6c080c84c2f102ad5dc44e2fb63357a.tar.gz
blt-f6362e12a6c080c84c2f102ad5dc44e2fb63357a.tar.bz2
add ds9 contour parsers
Diffstat (limited to 'ds9/parsers/contourparser.tac')
-rw-r--r--ds9/parsers/contourparser.tac132
1 files changed, 132 insertions, 0 deletions
diff --git a/ds9/parsers/contourparser.tac b/ds9/parsers/contourparser.tac
new file mode 100644
index 0000000..23c6df4
--- /dev/null
+++ b/ds9/parsers/contourparser.tac
@@ -0,0 +1,132 @@
+%{
+%}
+
+#include yesno.tin
+#include coords.tin
+#include skyframe.tin
+#include numeric.tin
+#include string.tin
+
+%start command
+
+%token ASINH_
+%token BLOCK_
+%token CLEAR_
+%token CLOSE_
+%token COLOR_
+%token CONVERT_
+%token COPY_
+%token DASH_
+%token EXP_
+%token GENERATE_
+%token GLOBAL_
+%token HISTEQU_
+%token LEVELS_
+%token LIMITS_
+%token LINEAR_
+%token LOAD_
+%token LOADLEVELS_
+%token LOCAL_
+%token LOG_
+%token METHOD_
+%token MINMAX_
+%token MODE_
+%token NLEVELS_
+%token OPEN_
+%token PASTE_
+%token POW_
+%token SAVE_
+%token SAVELEVELS_
+%token SCALE_
+%token SCOPE_
+%token SINH_
+%token SMOOTH_
+%token SQRT_
+%token SQUARED_
+%token WIDTH_
+%token ZMAX_
+%token ZSCALE_
+
+%%
+
+#include yesno.trl
+#include coords.trl
+#include skyframe.trl
+#include numeric.trl
+
+command : contour
+ | contour {yyclearin; YYACCEPT} STRING_
+ ;
+
+contour : yesno {global contour; set contour(view) $1; UpdateContour}
+ | OPEN_ {ContourDialog}
+ | CLOSE_ {ContourDestroyDialog}
+ | CLEAR_ {ContourOffDialog}
+ | LOAD_
+ | SAVE_
+ | CONVERT_ {Contour2Polygons}
+ | LOADLEVELS_
+ | SAVELEVELS_
+ | COPY_ {ContourCCopyDialog}
+ | PASTE_ paste
+ | COLOR_ STRING_ {ContourCmdColor $2}
+ | WIDTH_ INT_ {ContourCmdWidth $2}
+ | DASH_ yesno {ContourCmdDash $2}
+ | SMOOTH_ INT_ {ContourCmdSmooth $2}
+ | METHOD_ method {ContourCmdMethod $2}
+ | NLEVELS_ INT_ {ContourCmdNLevels $2}
+ | SCALE_ scale {ContourCmdScale $2}
+ | LOG_ log
+ | MODE_ modes
+ | SCOPE_ scope {ContourCmdScope $2}
+ | LIMITS_ numeric numeric {ContourCmdLimits $2 $3}
+ | LEVELS_ STRING_ {ContourCmdLevels $2}
+ | GENERATE_ {ContourCmdGenerate}
+ ;
+
+paste : coordsys STRING_ INT_ yesno
+ | wcssys STRING_ INT_ yesno
+ | skyframe STRING_ INT_ yesno
+ | wcssys skyframe STRING_ INT_ yesno
+ ;
+
+method : BLOCK_ {set _ block}
+ | SMOOTH_ {set _ smooth}
+ ;
+
+scale : LINEAR_ {set _ linear}
+ | LOG_ {set _ log}
+ | POW_ {set _ pow}
+ | SQUARED_ {set _ squared}
+ | SQRT_ {set _ sqrt}
+ | ASINH_ {set _ asinh}
+ | SINH_ {set _ sinh}
+ | HISTEQU_ {set _ histequ}
+ ;
+
+log : numeric {ContourCmdLog $1}
+ | EXP_ numeric {ContourCmdLog $2}
+ ;
+
+modes : numeric {ContourCmdMode $1}
+ | mode {ContourCmdMode $1}
+ ;
+
+mode : MINMAX_ {set _ minmax}
+ | ZSCALE_ {set _ zscale}
+ | ZMAX_ {set _ zmax}
+ ;
+
+scope : LOCAL_ {set _ local}
+ | GLOBAL_ {set _ global}
+ ;
+
+%%
+
+proc contour::yyerror {msg} {
+ variable yycnt
+ variable yy_current_buffer
+ variable index_
+
+ ParserError $msg $yycnt $yy_current_buffer $index_
+}