summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2019-07-17 17:01:30 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2019-07-17 17:01:30 (GMT)
commitc4bea0ea32e44bbb9fb2591ca1e31c520b32a179 (patch)
tree84fa58965d012a93d91150c7de9d46cb1ec42f3d
parentd9693bf774ec087b5cdcc5663777426f2091a5c3 (diff)
downloadblt-c4bea0ea32e44bbb9fb2591ca1e31c520b32a179.zip
blt-c4bea0ea32e44bbb9fb2591ca1e31c520b32a179.tar.gz
blt-c4bea0ea32e44bbb9fb2591ca1e31c520b32a179.tar.bz2
new -prefs yes/no command line option
-rw-r--r--ds9/parsers/prefsfirstlex.fcl22
-rw-r--r--ds9/parsers/prefsfirstparser.tac43
2 files changed, 65 insertions, 0 deletions
diff --git a/ds9/parsers/prefsfirstlex.fcl b/ds9/parsers/prefsfirstlex.fcl
new file mode 100644
index 0000000..e1d4f9a
--- /dev/null
+++ b/ds9/parsers/prefsfirstlex.fcl
@@ -0,0 +1,22 @@
+#tab prefsfirstparser.tab.tcl
+
+%{
+%}
+
+#include defs.fin
+
+%%
+
+bgcolor {return $BGCOLOR_}
+clear {return $CLEAR_}
+irafalign {return $IRAFALIGN_}
+nancolor {return $NANCOLOR_}
+precision {return $PRECISION_}
+threads {return $THREADS_}
+
+#include yesno.fin
+#include int.fin
+#include string.fin
+#include ws.fin
+
+%%
diff --git a/ds9/parsers/prefsfirstparser.tac b/ds9/parsers/prefsfirstparser.tac
new file mode 100644
index 0000000..04b712a
--- /dev/null
+++ b/ds9/parsers/prefsfirstparser.tac
@@ -0,0 +1,43 @@
+%{
+%}
+#include def.tin
+
+#include yesno.tin
+#include int.tin
+#include string.tin
+
+%start command
+
+%token BGCOLOR_
+%token CLEAR_
+%token IRAFALIGN_
+%token NANCOLOR_
+%token PRECISION_
+%token THREADS_
+
+%%
+
+#include yesno.trl
+
+command : prefs
+ | prefs {global ds9; if {!$ds9(init)} {YYERROR} else {yyclearin; YYACCEPT}} STRING_
+ ;
+
+prefs : yesno {ProcessCmdSet ds9 prefs $1}
+ | CLEAR_
+ | PRECISION_ INT_ INT_ INT_ INT_ INT_ INT_
+ | BGCOLOR_ STRING_
+ | NANCOLOR_ STRING_
+ | THREADS_ INT_
+ | IRAFALIGN_ yesno
+ ;
+
+%%
+
+proc prefsfirst::yyerror {msg} {
+ variable yycnt
+ variable yy_current_buffer
+ variable index_
+
+ ParserError $msg $yycnt $yy_current_buffer $index_
+}