From c8a0b7157d544f2359f2373160dcc69cdef8f4de Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Sun, 23 Jul 2017 22:24:32 -0500 Subject: Initial commit --- pattern2regex.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pattern2regex.c (limited to 'pattern2regex.c') diff --git a/pattern2regex.c b/pattern2regex.c new file mode 100644 index 0000000..669206a --- /dev/null +++ b/pattern2regex.c @@ -0,0 +1,20 @@ +#include + +#include "ast.h" +#include "lex-pattern.h" +#include "parse-pattern.h" + +int main(int argc, char **argv) +{ + if (argc >= 2) { + yyin = fmemopen(argv[1], strlen(argv[1]), "r"); + } else { + yyin = stdin; + } + + if (!yyparse()) dump_atom(ast); + + fclose(yyin); + return 0; +} + -- cgit v1.2.3