summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ds9/library/frame.tcl10
-rw-r--r--ds9/library/source.tcl2
-rw-r--r--ds9/parsers/binparser.tac6
-rw-r--r--ds9/parsers/tilelex.fcl23
-rw-r--r--ds9/parsers/tileparser.tac78
-rw-r--r--ds9/parsers/yesno.trl3
6 files changed, 116 insertions, 6 deletions
diff --git a/ds9/library/frame.tcl b/ds9/library/frame.tcl
index 21f3754..d36ac41 100644
--- a/ds9/library/frame.tcl
+++ b/ds9/library/frame.tcl
@@ -2308,6 +2308,16 @@ proc ProcessSendSingleCmd {proc id param} {
proc ProcessTileCmd {varname iname} {
upvar $varname var
+ upvar $iname ii
+
+ tile::YY_FLUSH_BUFFER
+ tile::yy_scan_string [lrange $var $ii end]
+ tile::yyparse
+ incr ii [expr $tile::yycnt-1]
+}
+
+proc oProcessTileCmd {varname iname} {
+ upvar $varname var
upvar $iname i
global current
diff --git a/ds9/library/source.tcl b/ds9/library/source.tcl
index 930fd37..1df6e93 100644
--- a/ds9/library/source.tcl
+++ b/ds9/library/source.tcl
@@ -212,6 +212,8 @@ source $ds9(root)/library/skyviewparser.tcl
source $ds9(root)/library/skyviewlex.tcl
source $ds9(root)/library/threedparser.tcl
source $ds9(root)/library/threedlex.tcl
+source $ds9(root)/library/tileparser.tcl
+source $ds9(root)/library/tilelex.tcl
source $ds9(root)/library/twomassparser.tcl
source $ds9(root)/library/twomasslex.tcl
source $ds9(root)/library/vlaparser.tcl
diff --git a/ds9/parsers/binparser.tac b/ds9/parsers/binparser.tac
index 3a7b554..dc04007 100644
--- a/ds9/parsers/binparser.tac
+++ b/ds9/parsers/binparser.tac
@@ -45,7 +45,7 @@ bin : CLOSE_ {BinDestroyDialog}
| COLSZ_ cols cols cols {BinCols \"$2\" \"$3\" \"$4\"}
| FACTOR_ binFactor
| DEPTH_ INT_ {global bin; set bin(depth) $2; ChangeBinDepth}
- | FILTER_ binFilter
+ | FILTER_ STRING_ {BinFilter $2}
| FUNCTION_ binFunction {global bin; set bin(function) $2; ChangeBinFunction}
| IN_ {Bin .5 .5}
| OUT_ {Bin 2 2}
@@ -72,10 +72,6 @@ binFactor : numeric {global bin; set bin(factor) "$1 $1"; ChangeBinFactor}
| numeric numeric {global bin; set bin(factor) "$1 $2"; ChangeBinFactor}
;
-binFilter : {BinFilter {}}
- | STRING_ {BinFilter $1}
- ;
-
binFunction: AVERAGE_ {set _ average}
| SUM_ {set _ sum}
;
diff --git a/ds9/parsers/tilelex.fcl b/ds9/parsers/tilelex.fcl
new file mode 100644
index 0000000..afcddca
--- /dev/null
+++ b/ds9/parsers/tilelex.fcl
@@ -0,0 +1,23 @@
+#tab tileparser.tab.tcl
+
+%{
+%}
+
+#include defs.fin
+
+%%
+
+automatic {return $AUTOMATIC_}
+column {return $COLUMN_}
+direction {return $DIRECTION_}
+gap {return $GAP_}
+grid {return $GRID_}
+layout {return $LAYOUT_}
+manual {return $MANUAL_}
+mode {return $MODE_}
+row {return $ROW_}
+
+#include yesno.fin
+#include base.fin
+
+%%
diff --git a/ds9/parsers/tileparser.tac b/ds9/parsers/tileparser.tac
new file mode 100644
index 0000000..9276a05
--- /dev/null
+++ b/ds9/parsers/tileparser.tac
@@ -0,0 +1,78 @@
+%{
+%}
+
+#include yesno.tin
+#include base.tin
+
+%start command
+
+%token AUTOMATIC_
+%token COLUMN_
+%token DIRECTION_
+%token GAP_
+%token GRID_
+%token LAYOUT_
+%token MANUAL_
+%token MODE_
+%token ROW_
+
+%%
+
+#include yesno.trl
+#include base.trl
+
+
+yes : YES_ {set _ 1}
+ | ON_ {set _ 1}
+ | TRUE_ {set _ 1}
+ ;
+
+no : NO_ {set _ 0}
+ | OFF_ {set _ 0}
+ | FALSE_ {set _ 0}
+ ;
+
+command : tile
+ | tile {yyclearin; YYACCEPT} STRING_
+ ;
+
+tile: {global current; set current(display) tile; DisplayMode}
+ | yes {global current; set current(display) tile; DisplayMode}
+ | no {global current; set current(display) single; DisplayMode}
+ | MODE_ tileMode {global tile; set tile(mode) $2; DisplayMode}
+ | GRID_ tileGrid
+ | COLUMN_ {global tile; set tile(mode) column; DisplayMode}
+ | ROW_ {global tile; set tile(mode) row; DisplayMode}
+ ;
+
+tileMode : GRID_ {set _ grid}
+ | COLUMN_ {set _ column}
+ | ROW_ {set _ row}
+ ;
+
+tileGrid : {global tile; set tile(mode) grid; DisplayMode}
+ | MODE_ tileGridMode {global tile; set tile(grid,mode) $2; DisplayMode}
+ | DIRECTION_ tileGridDir {global tile; set tile(grid,dir) $2; DisplayMode}
+ | LAYOUT_ INT_ INT_ {global tile; set tile(grid,col) $2; set tile(grid,row) $3; set tile(grid,mode) manual; DisplayMode}
+ | GAP_ INT_ {global tile; set tile(grid,gap) $2; DisplayMode}
+ ;
+
+tileGridMode : AUTOMATIC_ {set _ automatic}
+ | MANUAL_ {set _ manual}
+ ;
+
+tileGridDir : 'x' {set _ x}
+ | 'X' {set _ x}
+ | 'y' {set _ y}
+ | 'Y' {set _ y}
+ ;
+
+%%
+
+proc tile::yyerror {msg} {
+ variable yycnt
+ variable yy_current_buffer
+ variable index_
+
+ ParserError $msg $yycnt $yy_current_buffer $index_
+}
diff --git a/ds9/parsers/yesno.trl b/ds9/parsers/yesno.trl
index e4fdcd0..a34d258 100644
--- a/ds9/parsers/yesno.trl
+++ b/ds9/parsers/yesno.trl
@@ -5,9 +5,10 @@ yesno : {set _ 1}
| NO_ {set _ 0}
| OFF_ {set _ 0}
| FALSE_ {set _ 0}
-;
+ ;
# | error {
# yyerror "must be: yes|on|true|no|off|false"
# YYABORT
# }
+