re2c is a small program that compiles regular expression-based grammars to C or C++. Specify grammars inside a comment block that starts with /*!re2c, and re2c will produce standards-compliant C or C++ code with no external dependencies.
re2c
/*!re2c