From dca73fef741a57c8cc1913def98a305c2b709391 Mon Sep 17 00:00:00 2001 From: Stefan Weigl-Bosker Date: Sun, 15 Dec 2024 10:56:28 -0500 Subject: wrote initial grammar for parsing regular expressions --- docs/regex_grammar.peg | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 docs/regex_grammar.peg (limited to 'docs') diff --git a/docs/regex_grammar.peg b/docs/regex_grammar.peg new file mode 100644 index 0000000..c3bb644 --- /dev/null +++ b/docs/regex_grammar.peg @@ -0,0 +1,13 @@ +re <- cat rer + +rer <- '|' cat + | ε + +cat <- e catr + +catr <- e catr + | ε + +e <- l "Plus" | l "Question" | l "Star" | l + +l <- "Literal" | "Class" | "Dot" | "LRaren" re "RParen" -- cgit v1.2.3