summaryrefslogtreecommitdiffstats
path: root/ds9/parsers
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-06-19 21:24:38 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-06-19 21:24:38 (GMT)
commit764b96185d0b6778f50724d14609e5083f81abec (patch)
tree6882bebdb2fb63caa89923b080e83a94e9e86b00 /ds9/parsers
parent621489ea721d60c8472d234b97e6757327292daa (diff)
downloadblt-764b96185d0b6778f50724d14609e5083f81abec.zip
blt-764b96185d0b6778f50724d14609e5083f81abec.tar.gz
blt-764b96185d0b6778f50724d14609e5083f81abec.tar.bz2
add ds9 iexam send parser
Diffstat (limited to 'ds9/parsers')
-rw-r--r--ds9/parsers/iexamsendlex.fcl24
-rw-r--r--ds9/parsers/iexamsendparser.tac65
2 files changed, 89 insertions, 0 deletions
diff --git a/ds9/parsers/iexamsendlex.fcl b/ds9/parsers/iexamsendlex.fcl
new file mode 100644
index 0000000..9acf95f
--- /dev/null
+++ b/ds9/parsers/iexamsendlex.fcl
@@ -0,0 +1,24 @@
+#tab iexamsendparser.tab.tcl
+
+%{
+%}
+
+#include defs.fin
+
+%%
+
+any {return $ANY_}
+button {return $BUTTON_}
+coordinate {return $COORDINATE_}
+data {return $DATA_}
+key {return $KEY_}
+value {return $VALUE_}
+
+#include coordsys.fin
+#include wcssys.fin
+#include skyframe.fin
+#include skyformat.fin
+#include string.fin
+#include ws.fin
+
+%%
diff --git a/ds9/parsers/iexamsendparser.tac b/ds9/parsers/iexamsendparser.tac
new file mode 100644
index 0000000..9bd277a
--- /dev/null
+++ b/ds9/parsers/iexamsendparser.tac
@@ -0,0 +1,65 @@
+%{
+%}
+
+#include coordsys.tin
+#include wcssys.tin
+#include skyframe.tin
+#include skyformat.tin
+#include string.tin
+#include int.tin
+
+%token ANY_
+%token BUTTON_
+%token COORDINATE_
+%token DATA_
+%token KEY_
+%token VALUE_
+
+%start iexamsend
+
+%%
+
+#include coordsys.trl
+#include wcssys.trl
+#include skyframe.trl
+#include skyformat.trl
+
+iexamsend : dest cmd
+ | cmd
+ ;
+
+cmd : COORDINATE_ coordinate
+ | DATA_ data
+# backward compatibility
+ | VALUE_ data
+ | STRING_ {IExamSendCmdMacro $1}
+ ;
+
+dest : BUTTON_ {IExamSendCmdDest button}
+ | KEY_ {IExamSendCmdDest key}
+ | ANY_ {IExamSendCmdDest any}
+ ;
+
+coordinate : {IExamSendCmdCoord image fk5 degrees}
+ | coordsys {IExamSendCmdCoord $1 fk5 degrees}
+ | wcssys {IExamSendCmdCoord $1 fk5 degrees}
+ | skyframe {IExamSendCmdCoord wcs $1 degrees}
+ | wcssys skyframe {IExamSendCmdCoord $1 $2 degrees}
+ | wcssys skyformat {IExamSendCmdCoord $1 fk5 $2}
+ | skyframe skyformat {IExamSendCmdCoord wcs $1 $2}
+ | wcssys skyframe skyformat {IExamSendCmdCoord $1 $2 $3}
+ ;
+
+data : {IExamSendCmdData 1 1}
+ | INT_ INT_ {IExamSendCmdData $1 $2}
+ ;
+
+%%
+
+proc iexamsend::yyerror {msg} {
+ variable yycnt
+ variable yy_current_buffer
+ variable index_
+
+ ParserError $msg $yycnt $yy_current_buffer $index_
+}