Lexer generator for C, C++, D, Go, Haskell, Java, JS, OCaml, Python, Rust, Swift, V and Zig. https://re2c.org
  • C 47.7%
  • C++ 43.6%
  • Roff 5%
  • Java 1.6%
  • Reason 0.3%
  • Other 1.4%
Find a file
2026-09-06 22:07:26 +01:00
.github Github Actions: try 'oracle-openjdk' as 'redhat' has no macOS support. 2026-09-06 22:07:26 +01:00
bazel [re2c.bzl] Always pass --no-generation-date 2025-12-23 21:00:53 +00:00
benchmarks Benchmarks(C/C++): use the same benchmark names as filename infixes. 2025-03-18 16:50:44 +00:00
bootstrap Release 4.6. 2026-08-29 22:26:02 +01:00
build Add support for Swift 2025-03-20 22:32:00 +01:00
cmake CMake: align disabled warnings with configure.ac. 2024-11-14 10:55:48 +00:00
doc Add Zig computed-continue optimization 2026-08-26 14:46:23 +01:00
examples Revert "Avoid new features added in 4.0 in C/C++ examples." 2026-08-29 21:20:36 +01:00
fuzz Remove staDFA algorithm. 2022-06-13 21:44:17 +01:00
include Add Zig computed-continue optimization 2026-08-26 14:46:23 +01:00
lib Fix negative char2class[] index on high-byte input in libre2c DFA matchers 2026-07-19 22:51:50 +01:00
libre2c_old docs: fix simple typo, otheriwse -> otherwise 2020-12-17 13:53:02 +00:00
src Add Zig computed-continue optimization 2026-08-26 14:46:23 +01:00
test Add Zig computed-continue optimization 2026-08-26 14:46:23 +01:00
unicode Implement Unicode case mapping for case-insensitive string literals. 2026-03-22 22:22:51 +00:00
.gitattributes Move and rename backend specific tests. 2024-07-16 06:55:25 +01:00
.gitignore Provide a min viable http://bazel.build integration. 2023-04-27 13:22:59 +01:00
.gitmodules Restructure benchmark layout (prepare to add new benchmarks). 2024-12-11 07:38:40 +00:00
.travis.yml Travis CI: use Ubuntu 20.04 (Focal Fossa) to have Python 3 by default. 2021-07-25 11:08:03 +01:00
add-release.txt Prepare release 0.15: updated release instructions. 2015-11-22 19:48:37 +00:00
autogen.sh autogen.sh: drop dangerous 'git clean -dfx' command 2022-07-05 23:44:22 +01:00
BUILD.bazel support WORKSPACE; use lastest skylib 2025-02-03 09:23:33 +00:00
BUILD.md Make build directory name explicit in the instructions. 2025-04-21 06:46:12 +01:00
CHANGELOG Update CHANGELOG for release 4.6. 2026-08-29 22:15:34 +01:00
CMakeLists.txt Release 4.6. 2026-08-29 22:26:02 +01:00
CMakePresets.json CMakePresets.json: update VS version. 2026-06-23 21:17:58 +01:00
configure.ac Release 4.6. 2026-08-29 22:26:02 +01:00
CONTRIBUTING.md Update CONTRIBUTING.md. 2024-10-27 16:07:26 +00:00
IDEAS.md IDEAS.md: fix typo s/inforamtion/information/ 2024-02-26 07:11:34 +00:00
LICENSE Moved LICENSE, README, NO_WARRANTY and CHANGELOG to the root directory. 2019-03-04 17:32:50 +00:00
MAINTAINERS.md Remove TDFA(0) algorithm. 2022-06-13 23:15:50 +01:00
Makefile.am Add missing include files to the distribution. 2026-03-27 21:01:55 +00:00
Makefile.lib.am Implement Unicode case mapping for case-insensitive string literals. 2026-03-22 22:22:51 +00:00
MODULE.bazel support WORKSPACE; use lastest skylib 2025-02-03 09:23:33 +00:00
NO_WARRANTY Moved LICENSE, README, NO_WARRANTY and CHANGELOG to the root directory. 2019-03-04 17:32:50 +00:00
README.md Update README.md and BUILD.md. 2022-01-24 07:38:02 +00:00
release.sh release.sh: Add option --ignore-examples. 2025-12-01 22:13:08 +00:00
run_tests.py.in Add support for Swift 2025-03-20 22:32:00 +01:00
sf-cheatsheet Added text file 'sf-cheatsheet' to make some notes about sourceforge administration. 2015-03-26 16:27:21 +00:00
WORKSPACE support WORKSPACE; use lastest skylib 2025-02-03 09:23:33 +00:00
WORKSPACE.bzlmod support WORKSPACE; use lastest skylib 2025-02-03 09:23:33 +00:00

DESCRIPTION

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

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.

DOCUMENTATION

Official re2c website is re2c.org. It has a lot of examples.

DOWNLOAD

Release tarballs: https://github.com/skvadrik/re2c/releases

Source code:

$ git clone https://github.com/skvadrik/re2c.git
$ git clone https://git.code.sf.net/p/re2c/code-git

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

CONTRIBUTING

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

BUILD

See BUILD.md or the online docs for instructions how to build re2c.

FEEDBACK

Bugtracker:

Mailing lists:

IRC channels:

  • irc.oftc.net/#re2c
  • irc.libera.chat/#re2c

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

AUTHORS

re2c was originally written by Peter Bumbulis peter@csg.uwaterloo.ca. Since then many volunteers have contributed to the project. The current maintainer is Ulya Trofimovich skvadrik@gmail.com.