This is a compiler that can:
- compile regular expressions into fast, streaming parsers, and
- compile programs written in the regular expression-based language Kleenex into fast, streaming string transformations.
To build, run cabal configure && cabal build
. This will place a binary in dist/build/repg/repg
.
A number of test suites are included.
- To run the unit tests:
cabal test
. - To test the C runtime:
cd crt_test && make
. Note that this uses the Valgrind tool. - To run the end-to-end blackbox tests:
cd test/test_compiled && make
.
The repository includes a benchmark suite that compares the performance of string transformation programs written in Kleenex with equivalent programs written using other regular expression-based libraries and tools.
To run the benchmarks and generate the plots, first cd bench
and then:
- generate the test data:
make generate-test-data
- install the external benchmark dependencies (libraries, etc.):
make install-benchmark-dependencies
- build the benchmark programs (not Kleenex programs):
make build-benchmark-programs
- (optional) check that the benchmark programs are equivalent:
make -k equality-check
- build the Kleenex programs:
./compiletime.sh -f
- run /all/ the benchmark programs N times with M warm-up rounds:
./runningtime.sh -r <N> -w <M> -f
- generate the plots:
./mkplots.py
- the plots are placed in
bench/plots
(unless otherwise specified tomkplots.py
)