Mercurial > hg > Applications > Grep
view regexParser/transition.cc @ 172:540fc12871d9 pairPro
remove some warnings and errors (not working)
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Dec 2015 15:56:33 +0900 |
parents | 3bf2c6d6d53e |
children | 3be0fbcd4b52 |
line wrap: on
line source
#include <stdlib.h> #include "transition.h" TransitionPtr createTransition(CharClassPtr cc, BitVectorPtr state) { TransitionPtr transition = (TransitionPtr)malloc(sizeof(Transition)); transition->condition = cc; transition->condition->nextState = *state; return transition; } TransitionPtr appendTransition0(TransitionPtr x, TransitionPtr y) { TransitionPtr x0 = x; for(;;) { if (x->next == NULL) { x->next = y; return x0; } } return x; } TransitionPtr appendTransition(TransitionPtr x, TransitionPtr y) { TransitionPtr x0 = createTransition(x->condition, &x->condition->nextState); TransitionPtr x1 = x0; for(;;) { if (x->next == NULL) { x1->next = y; return x0; } x = x->next; x1->next = createTransition(x->condition, &x->condition->nextState); x1 = x1->next; } return x0; }