diff options
author | Stefan Weigl-Bosker <stefan@s00.xyz> | 2024-12-15 10:56:28 -0500 |
---|---|---|
committer | Stefan Weigl-Bosker <stefan@s00.xyz> | 2024-12-15 10:56:28 -0500 |
commit | dca73fef741a57c8cc1913def98a305c2b709391 (patch) | |
tree | f3e8947287cae444d301c787232415e268147833 | |
parent | 668a93ecfe243b307dcd3cc1c5bc42181e2a3ce8 (diff) | |
download | lg-dca73fef741a57c8cc1913def98a305c2b709391.tar.gz |
wrote initial grammar for parsing regular expressions
-rw-r--r-- | docs/regex_grammar.peg | 13 |
1 files changed, 13 insertions, 0 deletions
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" |