Grammar ::= NonTerminal +/ ws => "grammar"
NonTerminal ::= word ^"::=" RHS /ws
-w ::= " " | "\n" | "\r"
-ws ::= w** => ()
- | w** "//" (~[\n]*) "\n" ws => ()
-wp ::= w++
-
-RHS ::= (Conjuncts +/ (!ws "|" !ws)) +/ (!ws ">" !ws)
-
-Conjuncts ::= Sequence
- | Sequence ^"&" e*/ws /ws
- | Sequence ^"&~" e*/ws /ws
-
-ps ::= e*/ws => "ps"
- | (e+/ws !ws)? ^"^" Quoted (!ws e+/ws)?
-psy ::= ps
- | ps !wp ^"/" !ws e
-psx ::= psy => "psy"
- | psy ^"->" e /ws
-Sequence ::= Quoted => "qprod"
- > psx => "psx"
- | psx "=>" ^"[]" /ws
- | psx ^"=>" ("()"|word|Quoted) /ws
-
-ec ::= ~[\-\]\\]
- | escaped
-
-Range ::= ec => "range"
- | ec ^"-" ec
-
-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
-
- | "(" word ^")" /ws
- > ^"(" RHS ")" /ws
- | ^"~" e
+RHS ::= (Conjuncts +/ (!ws "|" !ws)) +/ (!ws ">" !ws)
+
+Conjuncts ::= Sequence
+ | Sequence ^"&" Elements /ws
+ | Sequence ^"&~" Elements /ws
+Elements ::= e*/ws
+
+ps ::= Elements => "ps"
+ | (e+/ws !ws)? ^"^" Quoted (!ws e+/ws)?
+psy ::= ps
+ | ps !wp ^"/" !ws e
+psx ::= psy => "psy"
+ | psy ^"->" e /ws
+Sequence ::= Quoted => "qprod"
+ > psx => "psx"
+ | psx "=>" ^"[]" /ws
+ | psx ^"=>" ("()"|word|Quoted) /ws
+
+ec ::= ~[\-\]\\]
+ | escaped
+
+Range ::= ec => "range"
+ | ec ^"-" ec
+
+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
+
+ | "(" word ^")" /ws
+ > ^"(" RHS ")" /ws
+ | ^"~" e
word ::= [a-zA-Z0-9_]++
Quoted ::= "\"" ((~[\"\\] | escaped)+) "\""
| "\\" ~[nr]
+w ::= " " | "\n" | "\r"
+ws ::= w** => ()
+ | w** "//" ~[\n]* "\n" ws => ()
+wp ::= w++