-s ::= ws grammar ws => "gram"
-ws !::= w**
-grammar ::= r +/ ws => "grammar"
-r ::= word ^"::=" alternatives /ws
- | word ^"!::=" alternatives /ws
-
-alternatives ::= equiAlt +/ (ws ">" ws)
-equiAlt ::= conjuncts +/ (ws "|" ws)
-
-sequence ::= e */ (w**)
- > es ws ^"/" e
-es ::= e */ (w**)
-
-ss ::= es => "seq" | es ^"/" e /ws
-
-conjuncts ::= rewrite
- | rewrite ^"&" e*/ws /ws
- | rewrite ^"&~" e*/ws /ws
-
-rewrite ::= sequence /ws => "rewrite"
- | sequence ^"=>" (word|quoted) /ws
-
-ec ::= [~\-\]\\\~]
- | escaped
-
-range ::= ec => "range"
- | ec ^"-" ec
-
-e ::= word => "nonTerminal"
- | [(][)] => "epsilon"
- | ^"{" alternatives "}" /ws
- | ^"[" (range*) "]"
- | ^"[~" (range*) "]"
- | ^"^" quoted /ws
- | ^"!" e /ws
-
- | (e ws ^"**" > e ws ^"*")
- | e ^"*/" e /ws
- | (e ws ^"++" > e ws ^"+")
- | e ^"+/" e /ws
- | e ^"?" /ws
-
- | quoted => "literal"
-
- | "(" word ^")" /ws
- > ^"(" alternatives ")" /ws
-
-w !::= " "
- | "//" ([~\n]*) "\n"
- | "\n"
- | "\r"
-an ::= [a-zA-Z0-9_]
-word ::= an++
-quoted ::= "\"" (([~\"\\] | escaped)+) "\""
- | "\"\"" => ""
-escaped ::= "\\n" => "\n"
- | "\\r" => "\r"
- | "\\" [~nr]