by skvadrik

skvadrik / re2c

lexer generator for C, C++ and Go

512 Stars 104 Forks Last release: 2 months ago (2.0.3) Other 2.6K Commits 28 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:


re2c is a free and open-source lexer generator for C, C++ and Go.

Its main goal is generating fast lexers: at least as fast as their reasonably optimized hand-coded counterparts. Instead of using traditional table-driven approach, re2c encodes the generated finite state automata directly in the form of conditional jumps and comparisons. The resulting programs are faster and often smaller than their table-driven analogues, and they are much easier to debug and understand. re2c applies quite a few optimizations in order to speed up and compress the generated code.

Another distinctive feature is its flexible interface: instead of assuming a fixed program template, re2c lets the programmer write most of the interface code and adapt the generated lexer to any particular environment.


Official re2c website is It has a lot of examples.


Release tarballs:

Source code:

$ git clone
$ git clone

Github is the main repo, sourceforge is a mirror and can be slightly outdated.


re2c is an Open Source, community-driven project. See for details about contributions to this repository.


re2c has two build systems: Autotools and CMake. Both are maintained and tested on Travis CI. See the documentation for instructions how to build re2c.




Mailing lists:

IRC channel:

  • freenode/#re2c

You are welcome to ask for help or share your thoughts and ideas.


Re2c was originally written by Peter Bumbulis [email protected]. Since then many people contributed to the project. The current maintainer is Ulya Trofimovich [email protected].

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.