summaryrefslogtreecommitdiffstats
path: root/ds9
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-03-12 18:07:57 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-03-12 18:07:57 (GMT)
commite4366300aca0d6d4ad10f7ab58c5b3176715b611 (patch)
tree8f977973ec15479f1a6ff0aae4a76a9ec8dcfaf5 /ds9
parent550ef7c4a7e97d1113c7b790d7294906680e37e0 (diff)
downloadblt-e4366300aca0d6d4ad10f7ab58c5b3176715b611.zip
blt-e4366300aca0d6d4ad10f7ab58c5b3176715b611.tar.gz
blt-e4366300aca0d6d4ad10f7ab58c5b3176715b611.tar.bz2
add 3d ds9 parser
Diffstat (limited to 'ds9')
-rw-r--r--ds9/library/3d.tcl14
-rw-r--r--ds9/library/source.tcl2
-rw-r--r--ds9/parsers/threedlex.fcl35
-rw-r--r--ds9/parsers/threedparser.tac81
4 files changed, 132 insertions, 0 deletions
diff --git a/ds9/library/3d.tcl b/ds9/library/3d.tcl
index 9e9f04a..9b258ec 100644
--- a/ds9/library/3d.tcl
+++ b/ds9/library/3d.tcl
@@ -462,6 +462,20 @@ proc PrefsDialog3d {} {
proc Process3DCmd {varname iname} {
upvar $varname var
+ upvar $iname ii
+
+ global threed
+
+ 3DDialog
+
+ threed::YY_FLUSH_BUFFER
+ threed::yy_scan_string [lrange $var $ii end]
+ threed::yyparse
+ incr ii [expr $threed::yycnt-1]
+}
+
+proc oProcess3DCmd {varname iname} {
+ upvar $varname var
upvar $iname i
global threed
diff --git a/ds9/library/source.tcl b/ds9/library/source.tcl
index 4cd0890..4cf43ce 100644
--- a/ds9/library/source.tcl
+++ b/ds9/library/source.tcl
@@ -210,6 +210,8 @@ source $ds9(root)/library/panparser.tcl
source $ds9(root)/library/panlex.tcl
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/twomassparser.tcl
source $ds9(root)/library/twomasslex.tcl
source $ds9(root)/library/vlaparser.tcl
diff --git a/ds9/parsers/threedlex.fcl b/ds9/parsers/threedlex.fcl
new file mode 100644
index 0000000..0a568fb
--- /dev/null
+++ b/ds9/parsers/threedlex.fcl
@@ -0,0 +1,35 @@
+#tab threedparser.tab.tcl
+
+%{
+%}
+
+#include defs.fin
+
+%%
+
+aip {return $AIP_}
+az {return $AZ_}
+azimuth {return $AZ_}
+background {return $BG_}
+bg {return $BG_}
+border {return $BORDER_}
+close {return $CLOSE_}
+color {return $COLOR_}
+compass {return $COMPASS_}
+el {return $EL_}
+elevation {return $EL_}
+highlite {return $HIGHLITE_}
+lock {return $LOCK_}
+match {return $MATCH_}
+method {return $METHOD_}
+mip {return $MIP_}
+none {return $NONE_}
+open {return $OPEN_}
+scale {return $SCALE_}
+view {return $VIEW_}
+vp {return $VIEW_}
+
+#include yesno.fin
+#include base.fin
+
+%%
diff --git a/ds9/parsers/threedparser.tac b/ds9/parsers/threedparser.tac
new file mode 100644
index 0000000..f694b56
--- /dev/null
+++ b/ds9/parsers/threedparser.tac
@@ -0,0 +1,81 @@
+%{
+%}
+
+#include yesno.tin
+#include base.tin
+
+%start command
+
+%token AIP_
+%token AZ_
+%token BG_
+%token BORDER_
+%token CLOSE_
+%token COLOR_
+%token COMPASS_
+%token EL_
+%token HIGHLITE_
+%token LOCK_
+%token MATCH_
+%token METHOD_
+%token MIP_
+%token NONE_
+%token OPEN_
+%token SCALE_
+%token VIEW_
+
+%%
+
+#include yesno.trl
+#include base.trl
+
+command : 3d
+ | 3d {yyclearin; YYACCEPT} CMD_
+ ;
+
+3d : {Create3DFrame}
+ | OPEN_
+ | CLOSE_ {3DDestroyDialog}
+ | AZ_ numeric {global threed; set threed(az) $2; 3DViewPoint}
+ | EL_ numeric {global threed; set threed(el) $2; 3DViewPoint}
+ | VIEW_ numeric numeric {global threed; set threed(az) $2; set threed(el) $3; 3DViewPoint}
+ | SCALE_ numeric {global threed; set threed(scale) $2; 3DScale}
+ | METHOD_ method {global threed; set threed(method) $2; 3DRenderMethod}
+ | BG_ bg {global threed; set threed(background) $2; 3DBackground}
+ | HIGHLITE_ highlite
+ | BORDER_ border
+ | COMPASS_ compass
+ | MATCH_ {Match3DCurrent}
+ | LOCK_ yesno {global threed; set threed(lock) $2; Lock3DCurrent}
+ ;
+
+method : AIP_ {set _ aip}
+ | MIP_ {set _ mip}
+ ;
+
+bg : NONE_ {set _ none}
+ | AZ_ {set _ azimuth}
+ | EL_ {set _ elevation}
+ ;
+
+highlite : COLOR_ STRING_ {global threed; set threed(highlite,color) $2; 3DHighliteColor}
+ | yesno {global threed; set threed(highlite) $1; 3DHighlite}
+ ;
+
+border : COLOR_ STRING_ {global threed; set threed(border,color) $2; 3DBorderColor}
+ | yesno {global threed; set threed(border) $1; 3DBorder}
+ ;
+
+compass : COLOR_ STRING_ {global threed; set threed(compass,color) $2; 3DCompassColor}
+ | yesno {global threed; set threed(compass) $1; 3DCompass}
+ ;
+
+%%
+
+proc threed::yyerror {msg} {
+ variable yycnt
+ variable yy_current_buffer
+ variable index_
+
+ ParserError $msg $yycnt $yy_current_buffer $index_
+}