view c/regexParser/main.cc @ 117:166136236891 pairPro

add header files
author Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
date Wed, 25 Nov 2015 14:58:03 +0900
parents 66c633575b53
children b930be74a16e
line wrap: on
line source

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bitVector.h"

extern NodePtr regex(RegexInfoPtr);
extern void printTree(NodePtr);
BitVectorListPtr createBitVectorList(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);
    createBitVectorList(n);
    return 0;
}