summaryrefslogtreecommitdiffstats
path: root/ds9
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-03-06 21:25:45 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-03-06 21:25:45 (GMT)
commit6eac06049e2a6911ba9e6c36a1ba624fe0956b39 (patch)
tree4ee7dfff822f1989bd28060b5c328558243de172 /ds9
parent8a03f0daaee5e3981cd4f9f69b3841694e8dc0be (diff)
downloadblt-6eac06049e2a6911ba9e6c36a1ba624fe0956b39.zip
blt-6eac06049e2a6911ba9e6c36a1ba624fe0956b39.tar.gz
blt-6eac06049e2a6911ba9e6c36a1ba624fe0956b39.tar.bz2
add ds9 parsers
Diffstat (limited to 'ds9')
-rw-r--r--ds9/library/error.tcl2
-rw-r--r--ds9/parsers/base.trl4
-rw-r--r--ds9/parsers/coords.trl28
-rw-r--r--ds9/parsers/panparser.tac2
4 files changed, 18 insertions, 18 deletions
diff --git a/ds9/library/error.tcl b/ds9/library/error.tcl
index fac9b8a..9a9311e 100644
--- a/ds9/library/error.tcl
+++ b/ds9/library/error.tcl
@@ -62,9 +62,9 @@ proc ParserError {msg yycnt yy_current_buffer index_} {
Error "$msg: [lindex $yy_current_buffer [expr $yycnt-1]]"
}
default {
- puts stderr "$msg:"
puts stderr "$yy_current_buffer"
puts stderr [format "%*s" $index_ ^]
+ puts stderr "$msg:"
QuitDS9
}
}
diff --git a/ds9/parsers/base.trl b/ds9/parsers/base.trl
index db44bfa..2399afd 100644
--- a/ds9/parsers/base.trl
+++ b/ds9/parsers/base.trl
@@ -1,3 +1,7 @@
numeric : INT_ {set _ $1}
| REAL_ {set _ $1}
+ | error {
+ yyerror "must be: integer or float"
+ YYABORT
+ }
;
diff --git a/ds9/parsers/coords.trl b/ds9/parsers/coords.trl
index 0acc063..c055be1 100644
--- a/ds9/parsers/coords.trl
+++ b/ds9/parsers/coords.trl
@@ -2,13 +2,12 @@ coordsys : IMAGE_ {set _ image}
| PHYSICAL_ {set _ physical}
| AMPLIFIER_ {set _ amplifier}
| DETECTOR_ {set _ detector}
+ | error {
+ yyerror "must be: image|physical|amplifier|detector"
+ YYABORT
+ }
;
-#| error {
-# yyerror "must be: image|physical|amplifier|detector"
-# YYABORT
-# }
-
wcssys : WCS_ {set _ wcs}
| WCSA_ {set _ wcsa}
| WCSB_ {set _ wcsb}
@@ -36,13 +35,12 @@ wcssys : WCS_ {set _ wcs}
| WCSX_ {set _ wcsx}
| WCSY_ {set _ wcsy}
| WCSZ_ {set _ wcsz}
+ | error {
+ yyerror "must be: wcs|wcsa...wcsz"
+ YYABORT
+ }
;
-# | error {
-# yyerror "must be: wcs|wcsa...wcsz"
-# YYABORT
-# }
-
skyframe : FK4_ {set _ fk4}
| B1950_ {set _ fk4}
| FK5_ {set _ fk5}
@@ -50,10 +48,8 @@ skyframe : FK4_ {set _ fk4}
| ICRS_ {set _ icrs}
| GALACTIC_ {set _ galactic}
| ECLIPTIC_ {set _ ecliptic}
+ | error {
+ yyerror "must be: fk4|fk5|icrs|galactic|ecliptic"
+ YYABORT
+ }
;
-
-# | error {
-# yyerror "must be: fk4|fk5|icrs|galactic|ecliptic"
-# YYABORT
-# }
-
diff --git a/ds9/parsers/panparser.tac b/ds9/parsers/panparser.tac
index d1c8df9..d76d6d5 100644
--- a/ds9/parsers/panparser.tac
+++ b/ds9/parsers/panparser.tac
@@ -33,7 +33,7 @@ pan : OPEN_ {PanZoomDialog}
| SEXSTR_ SEXSTR_ wcssys skyframe {Pan $1 $2 $3 $4}
;
-panto : numeric numeric {PanTo $1 $2 physical fk5}
+panto : | numeric numeric {PanTo $1 $2 physical fk5}
| numeric numeric coordsys {PanTo $1 $2 $3 fk5}
| numeric numeric wcssys {PanTo $1 $2 $3 fk5}
| numeric numeric skyframe {PanTo $1 $2 wcs $3}