Camden Dixie O'Brien d4b7a0a25c Revert "Use char instead of int for FSA rule input"
This reverts commit eb22abfb1b6dbdf6dc702e3d9d99314cbbb22d7b.
2024-10-27 13:55:12 +00:00
2024-10-27 02:39:24 +00:00
2024-10-25 14:22:20 +01:00
2024-10-26 19:33:10 +01:00
2024-10-25 14:21:55 +01:00
2024-10-27 02:39:24 +00:00

                             REGEX ENGINE

I've thought for a while it would be fun and interesting to write my
own regular expression engine using Thompson's construction algorithm,
so here we are.


                               Grammar

This engine is not going to be strictly supporting any standard
syntax; the expression syntax I intend to support follows.

	regex ::= sequence ( '|' sequence )*
	sequence ::= term+
	term ::= ( '.' | class | literal | '(' regex ')' ) quantifier?
	class ::= '[' '^'? literal+ ']'
	literal ::= non-special | '\' special
	quantifier ::= '*' | '+' | '?'
	special ::= quantifier | '|' | '(' | ')' | '[' | ']' | '^' | '\'


                      Building and Running Tests

The build uses CMake.  There are two scripts, build.sh and test.sh,
which will (much to everybody's shock) build the project and run the
tests.  I use Clang but the code is ISO C11, it should compile just
fine with GCC.  You might need to faff with CMakeLists.txt to get it
to work with another compiler due to command-line flag nonsense.

	scripts/build.sh  # Compile library and tests
	scripts/test.sh   # Run tests

There is also an entr.sh script which will watch all the project's
files and rebuild then rerun the tests on any changes (uses entr --
hence the name of the script).
Description
No description provided
Readme 181 KiB
Languages
C 96.2%
CMake 2.9%
Shell 0.9%