summaryrefslogtreecommitdiffstats
path: root/ds9/parsers/precisionparser.tac
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-04-18 20:59:59 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-04-18 20:59:59 (GMT)
commitb7da8b6d6135adc2779c60b0e346e6440599caa2 (patch)
tree8103c6f41419fb08d6f573e5b096408ea4dc4cc8 /ds9/parsers/precisionparser.tac
parent13692448a7ff8facb5c78d9fbb2534f4fa474ac0 (diff)
downloadblt-b7da8b6d6135adc2779c60b0e346e6440599caa2.zip
blt-b7da8b6d6135adc2779c60b0e346e6440599caa2.tar.gz
blt-b7da8b6d6135adc2779c60b0e346e6440599caa2.tar.bz2
add ds9 precision parser
Diffstat (limited to 'ds9/parsers/precisionparser.tac')
-rw-r--r--ds9/parsers/precisionparser.tac28
1 files changed, 28 insertions, 0 deletions
diff --git a/ds9/parsers/precisionparser.tac b/ds9/parsers/precisionparser.tac
new file mode 100644
index 0000000..859a1d0
--- /dev/null
+++ b/ds9/parsers/precisionparser.tac
@@ -0,0 +1,28 @@
+%{
+%}
+
+#include numeric.tin
+#include string.tin
+
+%start command
+
+%%
+
+#include numeric.trl
+
+command : precision
+ | precision {yyclearin; YYACCEPT} STRING_
+ ;
+
+precision : INT_ INT_ INT_ INT_ INT_ INT_ {pds9CmdSet prec,linear $1; pds9CmdSet prec,deg $2; pds9CmdSet prec,hms $3;pds9CmdSet prec,dms $4; pds9CmdSet prec,arcmin $5; pds9CmdSet prec,arcsec $6 PrefsPrecision}
+ ;
+
+%%
+
+proc precision::yyerror {msg} {
+ variable yycnt
+ variable yy_current_buffer
+ variable index_
+
+ ParserError $msg $yycnt $yy_current_buffer $index_
+}