summaryrefslogtreecommitdiff
path: root/tools/d2c/pattern/tokens.l
diff options
context:
space:
mode:
Diffstat (limited to 'tools/d2c/pattern/tokens.l')
-rw-r--r--tools/d2c/pattern/tokens.l34
1 files changed, 34 insertions, 0 deletions
diff --git a/tools/d2c/pattern/tokens.l b/tools/d2c/pattern/tokens.l
new file mode 100644
index 0000000..bef1e44
--- /dev/null
+++ b/tools/d2c/pattern/tokens.l
@@ -0,0 +1,34 @@
+
+%top {
+
+#include "grammar.h"
+
+}
+
+
+%option noyywrap
+%option nounput
+%option noinput
+%option yylineno
+%option stack
+%option noyy_top_state
+%option noyy_push_state
+%option noyy_pop_state
+
+
+%%
+
+
+[ \t] { }
+
+[^ ]+ { yylvalp->string = strdup(yytext); return OPERAND; }
+
+. {
+ char *msg;
+ asprintf(&msg, "Unhandled token in d2c pattern block: '%s'", yytext);
+ YY_FATAL_ERROR(msg);
+ free(msg);
+ }
+
+
+%%