summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-05-08 21:29:57 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-05-08 21:29:57 (GMT)
commit20f0238cf86a6819ed9071d84a4620e6b2ce5d2d (patch)
tree5a8b6c2bd488de589fc6fdbff1859e5d9caf8167
parent6736e9427bcbabf9a02b7549337df06226b805ae (diff)
downloadblt-20f0238cf86a6819ed9071d84a4620e6b2ce5d2d.zip
blt-20f0238cf86a6819ed9071d84a4620e6b2ce5d2d.tar.gz
blt-20f0238cf86a6819ed9071d84a4620e6b2ce5d2d.tar.bz2
add ds9 threads parser
-rw-r--r--ds9/library/source.tcl2
-rw-r--r--ds9/library/util.tcl9
-rw-r--r--ds9/parsers/nanparser.tac2
-rw-r--r--ds9/parsers/threadslex.fcl13
-rw-r--r--ds9/parsers/threadsparser.tac28
5 files changed, 53 insertions, 1 deletions
diff --git a/ds9/library/source.tcl b/ds9/library/source.tcl
index fc00f74..b7b76c1 100644
--- a/ds9/library/source.tcl
+++ b/ds9/library/source.tcl
@@ -296,6 +296,8 @@ source $ds9(root)/library/smoothparser.tcl
source $ds9(root)/library/smoothlex.tcl
source $ds9(root)/library/sourceparser.tcl
source $ds9(root)/library/sourcelex.tcl
+source $ds9(root)/library/threadsparser.tcl
+source $ds9(root)/library/threadslex.tcl
source $ds9(root)/library/threedparser.tcl
source $ds9(root)/library/threedlex.tcl
source $ds9(root)/library/tileparser.tcl
diff --git a/ds9/library/util.tcl b/ds9/library/util.tcl
index 5a67d90..f3f44d7 100644
--- a/ds9/library/util.tcl
+++ b/ds9/library/util.tcl
@@ -1352,10 +1352,19 @@ proc ProcessThreadsCmd {varname iname} {
upvar $varname var
upvar $iname i
+ global debug
+ if {$debug(tcl,parser)} {
+ threads::YY_FLUSH_BUFFER
+ threads::yy_scan_string [lrange $var $i end]
+ threads::yyparse
+ incr i [expr $threads::yycnt-1]
+ } else {
+
global ds9
set ds9(threads) [lindex $var $i]
ChangeThreads
}
+}
proc ProcessSendThreadsCmd {proc id param} {
global ds9
diff --git a/ds9/parsers/nanparser.tac b/ds9/parsers/nanparser.tac
index f033034..25fcdc1 100644
--- a/ds9/parsers/nanparser.tac
+++ b/ds9/parsers/nanparser.tac
@@ -11,7 +11,7 @@ command : nan
| nan {yyclearin; YYACCEPT} STRING_
;
-nan : STRING_ {ds9CmdSet nan $1 PrefsNanColor}
+nan : STRING_ {pds9CmdSet nan $1 PrefsNanColor}
;
%%
diff --git a/ds9/parsers/threadslex.fcl b/ds9/parsers/threadslex.fcl
new file mode 100644
index 0000000..1648106
--- /dev/null
+++ b/ds9/parsers/threadslex.fcl
@@ -0,0 +1,13 @@
+#tab threadsparser.tab.tcl
+
+%{
+%}
+
+#include defs.fin
+
+%%
+
+#include numeric.fin
+#include string.fin
+
+%%
diff --git a/ds9/parsers/threadsparser.tac b/ds9/parsers/threadsparser.tac
new file mode 100644
index 0000000..ab81d27
--- /dev/null
+++ b/ds9/parsers/threadsparser.tac
@@ -0,0 +1,28 @@
+%{
+%}
+
+#include numeric.tin
+#include string.tin
+
+%start command
+
+%%
+
+#include numeric.trl
+
+command : threads
+ | threads {yyclearin; YYACCEPT} STRING_
+ ;
+
+threads : INT_ {ds9CmdSet threads $1 ChangeThreads}
+ ;
+
+%%
+
+proc threads::yyerror {msg} {
+ variable yycnt
+ variable yy_current_buffer
+ variable index_
+
+ ParserError $msg $yycnt $yy_current_buffer $index_
+}