Rewrite in C using Ragel