Mercurial > hg > Members > masakoha > testcode
view c/regexParser/bitVectorNode.cc @ 115:ca30f8334741 pairPro
rename createRegexParser.cc to regexParser.cc
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 24 Nov 2015 14:38:26 +0900 |
parents | a3adc5c24e19 |
children | 66c633575b53 |
line wrap: on
line source
#include <stdio.h> #include <stdlib.h> #include <ctype.h> #include "bitVector.h" #include "regexParser.h" extern BitVectorPtr bitSet(int); BitVectorListPtr allocateBitVectorList(); BitVectorListPtr initBitVector(); BitVectorListPtr allocateBitVectorList() { BitVectorListPtr bvl = (BitVectorListPtr)malloc(sizeof(BitVectorList)); if (bvl == NULL) { fprintf(stderr, "Failed to allocate memory.\n"); exit(-1); } bvl->self = bvl; bvl->bi = (BitVectorPtr)malloc(sizeof(BitVector)); if (bvl->bi == NULL) { fprintf(stderr, "Failed to allocate memory.\n"); exit(-1); } return bvl; } BitVectorListPtr initBitVector() { BitVectorListPtr bvl = allocateBitVectorList(); bvl->initBvl = bvl; bvl->bi = bitSet(0); for (int i = 0; i < 256; i++) { bvl->next[i] = NULL; } return bvl; }