-e ::= word => "nonTerminal"
- | Quoted => "literal"
- | ^"()"
- | ^"{" Sequence "}" /ws
- | ^"[" Range* "]"
-
- | e ^"++" /ws -> ~[/]
- | e ^"+" /ws -> ~[+]
- | e ^"++/" e /ws
- | e ^"+/" e /ws
- | e ^"**" /ws -> ~[/]
- | e ^"*" /ws -> ~[*]
- | e ^"**/" e /ws
- | e ^"*/" e /ws
- | ^"!" e /ws
- | e ^"?" /ws
- | ^"^" Quoted /ws
-
- | "(" word ^")" /ws
- > ^"(" RHS ")" /ws
- | ^"~" e
-
-word ::= [a-zA-Z0-9_]++
-Quoted ::= "\"" ((~[\"\\] | escaped)+) "\""
- | "\"\"" => ""
-escaped ::= "\\n" => "\n"
- | "\\r" => "\r"
- | "\\" ~[nr]
-
-
-w ::= " " | "\n" | "\r"
-ws ::= w** => ()
- | w** "//" ~[\n]* "\n" ws => ()
-wp ::= w++
+e = (Quoted|Word) ^":" e
+ > NonTerminalReference
+ | Literal
+ | ^"()"
+ | ^"{" PreSequence "}" /ws
+ | ^"[" Range* "]"
+ | e ^"++" /ws -> ~[/]
+ | e ^"+" /ws -> ~[+]
+ | e ^"++/" e /ws
+ | e ^"+/" e /ws
+ | e ^"**" /ws -> ~[/]
+ | e ^"*" /ws -> ~[*]
+ | e ^"**/" e /ws
+ | e ^"*/" e /ws
+ | e ^"!"
+ | e ^"?" /ws
+ | ^"^" Quoted
+ > ^"(" RHS ")" /ws
+ | ^"~" e
+
+NonTerminalReference = Word
+Literal = Quoted
+Word = [a-zA-Z0-9_]++
+Quoted = "\"" ((~[\"\\] | escaped)+) "\""
+ | "":: "\"\""
+
+escaped = "\n":: "\\n"
+ | "\r":: "\\r"
+ | "\\" ~[nr]
+
+w = " " | "\n" | "\r"
+ws = "()":: w**
+ | "()":: w** "//" (~[\n])* "\n" ws
+wp = w++