Mercurial > hg > Applications > Grep
view c/regexParser/main.cc @ 162:d7f762404113 pairPro
add TestCode
author | masa |
---|---|
date | Fri, 18 Dec 2015 19:31:13 +0900 |
parents | 1fad21fd6028 |
children |
line wrap: on
line source
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "subsetConstraction.h" extern NodePtr regex(RegexInfoPtr); extern void printTree(NodePtr); int main(int argc, char **argv) { RegexInfoPtr ri = (RegexInfoPtr)malloc(sizeof(RegexInfo)); ri->nodeNumber = 1; for (int i = 1; i < argc; i++) { if (strcmp(argv[i],"-regex") == 0) { ri->ptr = (unsigned char*)argv[i+1]; i++; } } printf("regex : %s\n",ri->ptr); NodePtr n = regex(ri); printTree(n); return 0; }