summaryrefslogtreecommitdiffstats
path: root/ds9
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-06-30 17:01:58 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-06-30 17:01:58 (GMT)
commit60b9ec152dea8708a5aa249dfa32ffb17f0abf12 (patch)
tree54c60f4e496d5b82958c7106fb3bc87de87ec7e7 /ds9
parentecf3cf407ecf8f5f853811fdec88efa00a98b9a5 (diff)
downloadblt-60b9ec152dea8708a5aa249dfa32ffb17f0abf12.zip
blt-60b9ec152dea8708a5aa249dfa32ffb17f0abf12.tar.gz
blt-60b9ec152dea8708a5aa249dfa32ffb17f0abf12.tar.bz2
update parser 2mass
Diffstat (limited to 'ds9')
-rw-r--r--ds9/library/lex.fcl50
-rw-r--r--ds9/library/parser.tac4
-rw-r--r--ds9/library/source.tcl4
-rw-r--r--ds9/make.include13
4 files changed, 33 insertions, 38 deletions
diff --git a/ds9/library/lex.fcl b/ds9/library/lex.fcl
index 01b7963..36418a4 100644
--- a/ds9/library/lex.fcl
+++ b/ds9/library/lex.fcl
@@ -12,32 +12,6 @@ E [Ee][+-]?{D}+
%%
-# INT
-[+-]?{D}+ {set ::yylval $yytext; return $::INT_}
-
-# REAL
-[+-]?{D}+"."?({E})? |
-[+-]?{D}*"."{D}+({E})? {set ::yylval $yytext; return $::REAL_}
-
-# STRING
-#[!-~][!-~]+ {set ::yylval $yytext; return $::STRING_}
-
-# SEXAGESIMAL
-[+-]?{D}+:{D}+:{D}+"."? |
-[+-]?{D}+:{D}+:{D}*"."{D}+ {set ::yylval $yytext; return $::SEXSTR_}
-
-# HMS
-[+-]?{D}+h{D}+m{D}+"."?s |
-[+-]?{D}+h{D}+m{D}*"."{D}+s {set ::yylval $yytext; return $::HMSSTR_}
-
-# DMS
-[+-]?{D}+d{D}+m{D}+"."?s |
-[+-]?{D}+d{D}+m{D}*"."{D}+s {set ::yylval $yytext; return $::SMSSTR_}
-
-\n # ignore return
-\s # ignore whitespace
-. {set ::yylval $yytext; return $yytext}
-
2mass {return $::2MASS_}
3d {return $::3D_}
about {return $::ABOUT_}
@@ -69,4 +43,28 @@ true {return $::TRUE_}
update {return $::UPDATE_}
yes {return $::YES_}
+# INT
+[+-]?{D}+ {set ::yylval $yytext; return $::INT_}
+
+# REAL
+[+-]?{D}+"."?({E})? |
+[+-]?{D}*"."{D}+({E})? {set ::yylval $yytext; return $::REAL_}
+
+# SEXAGESIMAL
+[+-]?{D}+:{D}+:{D}+"."? |
+[+-]?{D}+:{D}+:{D}*"."{D}+ {set ::yylval $yytext; return $::SEXSTR_}
+
+# HMS
+[+-]?{D}+h{D}+m{D}+"."?s |
+[+-]?{D}+h{D}+m{D}*"."{D}+s {set ::yylval $yytext; return $::HMSSTR_}
+
+# DMS
+[+-]?{D}+d{D}+m{D}+"."?s |
+[+-]?{D}+d{D}+m{D}*"."{D}+s {set ::yylval $yytext; return $::SMSSTR_}
+
+\n # ignore return
+\s # ignore whitespace
+. {set ::yylval $yytext; return $yytext}
+
+
diff --git a/ds9/library/parser.tac b/ds9/library/parser.tac
index 560ca3d..9380810 100644
--- a/ds9/library/parser.tac
+++ b/ds9/library/parser.tac
@@ -45,7 +45,7 @@ commands : commands command
| command
;
-command : 2MASS_ 2mass
+command : 2MASS_ {2MASSDialog} 2mass
| 3D_ 3d
| ABOUT_ about
| ALIGN_ align
@@ -94,7 +94,7 @@ optDeg : {set _ degrees}
| SURVEY_ 2massSurvey {global dtwomass; set dtwomass(survey) $2}
| UPDATE_ FRAME_ {IMGSVRUpdate dtwomass; IMGSVRApply dtwomass 1}
| UPDATE_ CROSSHAIR_ {IMGSVRCrosshair dtwomass; IMGSVRApply dtwomass 1}
- | COORD_ 2massCoord
+ | COORD_ 2massCoord {IMGSVRApply dtwomass 1}
| NAME_
;
# default
diff --git a/ds9/library/source.tcl b/ds9/library/source.tcl
index 7eb3603..cf78a6b 100644
--- a/ds9/library/source.tcl
+++ b/ds9/library/source.tcl
@@ -187,8 +187,8 @@ source $ds9(root)/library/wcs.tcl
source $ds9(root)/library/xmfbox.tcl
source $ds9(root)/library/xmlrpc.tcl
source $ds9(root)/library/xpa.tcl
-#source $ds9(root)/library/lex.tcl
-#source $ds9(root)/library/parser.tcl
+source $ds9(root)/library/lex.tcl
+source $ds9(root)/library/parser.tcl
switch [tk windowingsystem] {
x11 {}
diff --git a/ds9/make.include b/ds9/make.include
index 4009c44..6cc9e53 100644
--- a/ds9/make.include
+++ b/ds9/make.include
@@ -1,17 +1,14 @@
#--------------------------parser
-# will not work for win
-$(prefix)/ds9/library/lex.tcl : $(prefix)/ds9/library/lex.fcl
- tclsh $(prefix)/fickle/fickle.tcl -o $@ $?
+%.tcl: %.fcl
+ tclsh $(prefix)/fickle/fickle.tcl $<
-# will not work for win
-$(prefix)/ds9/library/parser.tcl : $(prefix)/ds9/library/parser.tac
- tclsh $(prefix)/taccle/taccle.tcl -d -o $@ $?
+%.tcl: %.tac
+ tclsh $(prefix)/taccle/taccle.tcl -d -w $<
#--------------------------framework
-#$(prefix)/ds9/library/parser.tcl $(prefix)/ds9/library/lex.tcl
-$(LIBDIR)/library : $(prefix)/ds9/library/*.tcl
+$(LIBDIR)/library : $(prefix)/ds9/library/parser.tcl $(prefix)/ds9/library/lex.tcl $(prefix)/ds9/library/*.tcl
mkdir -p "$@"
cp -p $? "$@"
# must do it this way for win