summaryrefslogtreecommitdiff
path: root/meta/grammar.html
diff options
context:
space:
mode:
Diffstat (limited to 'meta/grammar.html')
-rw-r--r--meta/grammar.html106
1 files changed, 106 insertions, 0 deletions
diff --git a/meta/grammar.html b/meta/grammar.html
new file mode 100644
index 0000000..074c4a1
--- /dev/null
+++ b/meta/grammar.html
@@ -0,0 +1,106 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+<link rel="stylesheet" href="/fonts/fonts.css">
+<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png">
+<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">
+<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png">
+<link rel="manifest" href="/favicon/site.webmanifest">
+<style>
+:root {font-size: 15px;}
+body {background-color: #111; margin: 2rem;}
+pre {color: #ddd; font-family: jetbrains-mono-regular, Consolas, Menlo, monospace; font-style: normal; font-size: 1rem; line-height: 1.5em; white-space: pre-wrap;}
+pre a {color: #ddd;}
+pre a:link {text-decoration: none; color: #ddd;}
+pre a:visited {text-decoration: none; color: #ddd;}
+pre a:hover {text-decoration: none; color: #111; background-color: #ddd;}
+pre a:active {text-decoration: none; color: #ddd;}
+</style>
+<title></title>
+<meta http-equiv="last-modified" content="2021-11-16 12:20:05-05:00" />
+</head>
+
+<body>
+<pre>
+grammar : rule (rule-separator rule)*
+
+rule : non-terminal separator ':' separator expression
+
+rule-separator : \x0A \x0A+
+
+separator : (\x09 | \x20)+
+ | \x0A (\x09 | \x20)*
+
+non-terminal : ([A-Z] | [a-z] | [-_]) ([0-9] | [A-Z] | [a-z] | [-_])*
+
+expression : layer-0
+ | layer-1
+ | layer-2
+
+layer-0 : terminal
+ | non-terminal
+
+layer-1 : optional
+ | repetition
+ | free-monoid
+
+layer-2 : alternation
+ | concatenation
+ | exception
+
+terminal : string
+ | hex-literal
+ | character-set
+ | extension
+
+optional : layer-0 '?'
+ | '(' (layer-1 | layer-2) ')' '?'
+
+repetition : layer-0 '+'
+ | '(' (layer-1 | layer-2) ')' '+'
+
+free-monoid : layer-0 '*'
+ | '(' (layer-1 | layer-2) ')' '*'
+
+alternation : alt-operand separator '|' separator alt-operand
+
+concatenation : con-operand ' ' con-operand
+
+exception : exc-operand ' - ' exc-operand
+
+alt-operand : layer-0
+ | layer-1
+ | '(' layer-2 ')'
+ | alternation
+ | concatenation
+
+con-operand : layer-0
+ | layer-1
+ | '(' layer-2 ')'
+ | concatenation
+
+exc-operand : layer-0
+ | layer-1
+ | '(' layer-2 ')'
+
+string : "'" (anything - "'")* "'"
+ | '"' (anything - '"')* '"'
+
+hex-literal : '\x' ([0-9] | [A-F])+
+
+character-set : '[' (character-list | character-range | extension) ']'
+
+character-list : anything+
+ | hex-literal+
+
+character-range : anything '-' anything
+ | hex-literal '-' hex-literal
+
+extension : '<' anything+ '>'
+
+anything : [&lt;all valid UTF-8 characters&gt;]
+</pre>
+</body>
+</html> \ No newline at end of file