summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ds9/library/pixel.tcl17
-rw-r--r--ds9/library/source.tcl2
-rw-r--r--ds9/parsers/pixeltablelex.fcl16
-rw-r--r--ds9/parsers/pixeltableparser.tac34
4 files changed, 69 insertions, 0 deletions
diff --git a/ds9/library/pixel.tcl b/ds9/library/pixel.tcl
index 594bab0..5445841 100644
--- a/ds9/library/pixel.tcl
+++ b/ds9/library/pixel.tcl
@@ -266,6 +266,14 @@ proc ProcessPixelTableCmd {varname iname} {
upvar $varname var
upvar $iname i
+ global debug
+ if {$debug(tcl,parser)} {
+ pixeltable::YY_FLUSH_BUFFER
+ pixeltable::yy_scan_string [lrange $var $i end]
+ pixeltable::yyparse
+ incr i [expr $pixeltable::yycnt-1]
+ } else {
+
switch -- [string tolower [lindex $var $i]] {
open -
yes -
@@ -285,6 +293,15 @@ proc ProcessPixelTableCmd {varname iname} {
}
}
}
+}
+
+proc PixelTableCmd {which} {
+ if {$which} {
+ PixelTableDialog
+ } else {
+ PixelTableDestroyDialog
+ }
+}
proc ProcessSendPixelTableCmd {proc id param sock fn} {
PixelTableDialog
diff --git a/ds9/library/source.tcl b/ds9/library/source.tcl
index fe0220c..511ac15 100644
--- a/ds9/library/source.tcl
+++ b/ds9/library/source.tcl
@@ -246,6 +246,8 @@ source $ds9(root)/library/rotateparser.tcl
source $ds9(root)/library/rotatelex.tcl
source $ds9(root)/library/panparser.tcl
source $ds9(root)/library/panlex.tcl
+source $ds9(root)/library/pixeltableparser.tcl
+source $ds9(root)/library/pixeltablelex.tcl
source $ds9(root)/library/plotparser.tcl
source $ds9(root)/library/plotlex.tcl
source $ds9(root)/library/prefsparser.tcl
diff --git a/ds9/parsers/pixeltablelex.fcl b/ds9/parsers/pixeltablelex.fcl
new file mode 100644
index 0000000..6ba9705
--- /dev/null
+++ b/ds9/parsers/pixeltablelex.fcl
@@ -0,0 +1,16 @@
+#tab pixeltableparser.tab.tcl
+
+%{
+%}
+
+#include defs.fin
+
+%%
+
+close {return $CLOSE_}
+open {return $OPEN_}
+
+#include yesno.fin
+#include string.fin
+
+%%
diff --git a/ds9/parsers/pixeltableparser.tac b/ds9/parsers/pixeltableparser.tac
new file mode 100644
index 0000000..43b2375
--- /dev/null
+++ b/ds9/parsers/pixeltableparser.tac
@@ -0,0 +1,34 @@
+%{
+%}
+
+#include yesno.tin
+#include string.tin
+
+%start command
+
+%token CLOSE_
+%token OPEN_
+
+%%
+
+#include yesno.trl
+
+command : pixeltable
+ | pixeltable {yyclearin; YYACCEPT} STRING_
+ ;
+
+pixeltable : {PixelTableDialog}
+ | OPEN_ {PixelTableDialog}
+ | CLOSE_ {PixelTableDestroyDialog}
+ | yesno
+ ;
+
+%%
+
+proc pixeltable::yyerror {msg} {
+ variable yycnt
+ variable yy_current_buffer
+ variable index_
+
+ ParserError $msg $yycnt $yy_current_buffer $index_
+}