summaryrefslogtreecommitdiffstats
path: root/ds9/parsers/sfitsparser.tac
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-05-11 18:47:55 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-05-11 18:47:55 (GMT)
commit53b50211e69350789ad170bfe6ce01b0e255c1c0 (patch)
treee7ebca33b2fab855be784083617bf17731254688 /ds9/parsers/sfitsparser.tac
parentd51c41654a715f539154ec29fe1603a07dbcec58 (diff)
downloadblt-53b50211e69350789ad170bfe6ce01b0e255c1c0.zip
blt-53b50211e69350789ad170bfe6ce01b0e255c1c0.tar.gz
blt-53b50211e69350789ad170bfe6ce01b0e255c1c0.tar.bz2
add ds9 sfits parser
Diffstat (limited to 'ds9/parsers/sfitsparser.tac')
-rw-r--r--ds9/parsers/sfitsparser.tac36
1 files changed, 36 insertions, 0 deletions
diff --git a/ds9/parsers/sfitsparser.tac b/ds9/parsers/sfitsparser.tac
new file mode 100644
index 0000000..3340139
--- /dev/null
+++ b/ds9/parsers/sfitsparser.tac
@@ -0,0 +1,36 @@
+%{
+%}
+
+#include string.tin
+
+%start command
+
+%token MASK_
+%token NEW_
+%token SLICE_
+
+%%
+
+command : sfits
+ | sfits {yyclearin; YYACCEPT} STRING_
+ ;
+
+sfits: new STRING_ STRING_ {LoadSFitsFile $2 $3 {} {}}
+ | new MASK_ STRING_ STRING_ {LoadSFitsFile $3 $4 mask {}}
+ | new SLICE_ STRING_ STRING_ {LoadSFitsFile $3 $4 {} slice}
+ | new MASK_ SLICE_ STRING_ STRING_ {LoadSFitsFile $4 $5 mask slice}
+;
+
+new :
+ | NEW_ {CreateFrame}
+ ;
+
+%%
+
+proc sfits::yyerror {msg} {
+ variable yycnt
+ variable yy_current_buffer
+ variable index_
+
+ ParserError $msg $yycnt $yy_current_buffer $index_
+}