c ported version of re2c from yasm