summaryrefslogtreecommitdiff
path: root/pattern2regex.c
blob: 646b007e1ae6c31edf3a04096bb9b0a7632527f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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()) print_regex(ast);

	fclose(yyin);
	return 0;
}