summaryrefslogtreecommitdiffstats
path: root/ds9/parsers
diff options
context:
space:
mode:
Diffstat (limited to 'ds9/parsers')
-rw-r--r--ds9/parsers/sourcelex.fcl12
-rw-r--r--ds9/parsers/sourceparser.tac25
2 files changed, 37 insertions, 0 deletions
diff --git a/ds9/parsers/sourcelex.fcl b/ds9/parsers/sourcelex.fcl
new file mode 100644
index 0000000..8c17472
--- /dev/null
+++ b/ds9/parsers/sourcelex.fcl
@@ -0,0 +1,12 @@
+#tab sourceparser.tab.tcl
+
+%{
+%}
+
+#include defs.fin
+
+%%
+
+#include string.fin
+
+%%
diff --git a/ds9/parsers/sourceparser.tac b/ds9/parsers/sourceparser.tac
new file mode 100644
index 0000000..4ae5b8a
--- /dev/null
+++ b/ds9/parsers/sourceparser.tac
@@ -0,0 +1,25 @@
+%{
+%}
+
+#include string.tin
+
+%start command
+
+%%
+
+command : source
+ | source {yyclearin; YYACCEPT} STRING_
+ ;
+
+source : STRING_ {SourceCmd $1}
+ ;
+
+%%
+
+proc source::yyerror {msg} {
+ variable yycnt
+ variable yy_current_buffer
+ variable index_
+
+ ParserError $msg $yycnt $yy_current_buffer $index_
+}