From da712e58d02b1e0cb0edf2da3a7b9a01190093b4 Mon Sep 17 00:00:00 2001 From: William Joye Date: Fri, 11 May 2018 15:28:43 -0400 Subject: add ds9 smosaicwcs parser --- ds9/parsers/smosaicwcslex.fcl | 16 ++++++++++++++++ ds9/parsers/smosaicwcsparser.tac | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 ds9/parsers/smosaicwcslex.fcl create mode 100644 ds9/parsers/smosaicwcsparser.tac diff --git a/ds9/parsers/smosaicwcslex.fcl b/ds9/parsers/smosaicwcslex.fcl new file mode 100644 index 0000000..f5da16f --- /dev/null +++ b/ds9/parsers/smosaicwcslex.fcl @@ -0,0 +1,16 @@ +#tab smosaicwcsparser.tab.tcl + +%{ +%} + +#include defs.fin + +%% + +mask {return $MASK_} +new {return $NEW_} + +#include coords.fin +#include string.fin + +%% diff --git a/ds9/parsers/smosaicwcsparser.tac b/ds9/parsers/smosaicwcsparser.tac new file mode 100644 index 0000000..e75864c --- /dev/null +++ b/ds9/parsers/smosaicwcsparser.tac @@ -0,0 +1,40 @@ +%{ +%} + +#include coords.tin +#include string.tin + +%start command + +%token MASK_ +%token NEW_ + +%% + +#include coords.trl + +command : smosaicwcs + | smosaicwcs {yyclearin; YYACCEPT} STRING_ + ; + +smosaicwcs : opts sys STRING_ STRING_ {LoadSMosaicWCSFile $3 $4 $2 $1} + ; + +sys : {set _ wcs} + | wcssys {set _ $1} + ; + +opts : + | NEW_ {CreateFrame; set _ {}} + | MASK_ {set _ mask} + ; + +%% + +proc smosaicwcs::yyerror {msg} { + variable yycnt + variable yy_current_buffer + variable index_ + + ParserError $msg $yycnt $yy_current_buffer $index_ +} -- cgit v0.12