From 2957e913c0d0e7b0565bfcb8af21409648aa5822 Mon Sep 17 00:00:00 2001 From: Camden Dixie O'Brien Date: Fri, 25 Oct 2024 11:31:21 +0100 Subject: [PATCH] Create README with grammar spec --- README | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 README diff --git a/README b/README new file mode 100644 index 0000000..c74d2a0 --- /dev/null +++ b/README @@ -0,0 +1,18 @@ + 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 ( '|' regex )? + sequence ::= term+ + term ::= ( '.' | class | literal | '(' regex ')' ) quantifier? + class ::= '[' '^'? literal+ ']' + literal ::= non-special | '\' special + quantifier ::= '*' | '+' | '?' + special ::= quantifier | '|' | '(' | ')' | '[' | ']' | '^' | '\'