diff options
author | Bobby Bingham <koorogi@koorogi.info> | 2017-07-23 22:24:32 -0500 |
---|---|---|
committer | Bobby Bingham <koorogi@koorogi.info> | 2017-07-24 21:19:10 -0500 |
commit | c8a0b7157d544f2359f2373160dcc69cdef8f4de (patch) | |
tree | 2fa9c2cc4646cab3886025a9663289b177ad4c55 /pattern2regex.c |
Initial commit
Diffstat (limited to 'pattern2regex.c')
-rw-r--r-- | pattern2regex.c | 20 |
1 files changed, 20 insertions, 0 deletions
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 <stdio.h> + +#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; +} + |