summaryrefslogtreecommitdiffstats
path: root/ds9/parsers
diff options
context:
space:
mode:
Diffstat (limited to 'ds9/parsers')
-rw-r--r--ds9/parsers/smoothlex.fcl29
-rw-r--r--ds9/parsers/smoothparser.tac62
2 files changed, 91 insertions, 0 deletions
diff --git a/ds9/parsers/smoothlex.fcl b/ds9/parsers/smoothlex.fcl
new file mode 100644
index 0000000..81fd963
--- /dev/null
+++ b/ds9/parsers/smoothlex.fcl
@@ -0,0 +1,29 @@
+#tab smoothparser.tab.tcl
+
+%{
+%}
+
+#include defs.fin
+
+%%
+
+angle {return $ANGLE_}
+boxcar {return $BOXCAR_}
+close {return $CLOSE_}
+elliptic {return $ELLIPTIC_}
+function {return $FUNCTION_}
+gaussian {return $GAUSSIAN_}
+lock {return $LOCK_}
+match {return $MATCH_}
+open {return $OPEN_}
+radius {return $RADIUS_}
+radiusminor {return $RADIUSMINOR_}
+sigma {return $SIGMA_}
+sigmaminor {return $SIGMAMINOR_}
+tophat {return $TOPHAT_}
+
+#include yesno.fin
+#include numeric.fin
+#include string.fin
+
+%%
diff --git a/ds9/parsers/smoothparser.tac b/ds9/parsers/smoothparser.tac
new file mode 100644
index 0000000..7a59a74
--- /dev/null
+++ b/ds9/parsers/smoothparser.tac
@@ -0,0 +1,62 @@
+%{
+%}
+
+#include yesno.tin
+#include numeric.tin
+#include string.tin
+
+%start command
+
+%token ANGLE_
+%token BOXCAR_
+%token CLOSE_
+%token ELLIPTIC_
+%token FUNCTION_
+%token GAUSSIAN_
+%token LOCK_
+%token MATCH_
+%token OPEN_
+%token RADIUS_
+%token RADIUSMINOR_
+%token SIGMA_
+%token SIGMAMINOR_
+%token TOPHAT_
+
+%%
+
+#include yesno.trl
+#include numeric.trl
+
+command : smooth
+ | smooth {yyclearin; YYACCEPT} STRING_
+ ;
+
+
+smooth : yesno {SmoothCmdSet view $1 SmoothUpdate}
+ | OPEN_ {SmoothDialog}
+ | CLOSE_ {SmoothDestroyDialog}
+ | MATCH_ {MatchSmoothCurrent}
+ | LOCK_ yesno {SmoothCmdSet lock $2 LockSmoothCurrent}
+ | FUNCTION_ function {SmoothCmdSet function $2 SmoothUpdate}
+ | RADIUS_ INT_ {SmoothCmdSet radius $2 SmoothUpdate}
+ | RADIUSMINOR_ INT_ {SmoothCmdSet radius,minor $2 SmoothUpdate}
+ | SIGMA_ numeric {SmoothCmdSet sigma $2 SmoothUpdate}
+ | SIGMAMINOR_ numeric {SmoothCmdSet sigma,minor $2 SmoothUpdate}
+ | ANGLE_ numeric {SmoothCmdSet angle $2 SmoothUpdate}
+ ;
+
+function : BOXCAR_ {set _ boxcar}
+ | ELLIPTIC_ {set _ elliptic}
+ | TOPHAT_ {set _ tophat}
+ | GAUSSIAN_ {set _ gaussian}
+ ;
+
+%%
+
+proc smooth::yyerror {msg} {
+ variable yycnt
+ variable yy_current_buffer
+ variable index_
+
+ ParserError $msg $yycnt $yy_current_buffer $index_
+}