-grammar ::= R+/ws => "grammar"
-Grammar ::= R+ => "grammar"
-R ::= word ^"::=" Alternatives
- | word ^"!::=" Alternatives
-
-ec ::= [~\]\\\-\~] | escaped
-
-Alternatives ::= EquiAlt +/ ">"
-EquiAlt ::= Conjuncts +/ "|" => "alternatives"
-
-sequence ::= Es
- > Es ^"/" E /ws
-Es ::= E+
-
-Conjuncts ::= rewrite
- | rewrite ^"&" sequence
- | rewrite ^"&~" sequence
-
-rewrite ::= sequence /ws => "rewrite"
- | sequence ^"=>" word /ws
- | sequence ^"=>" quoted /ws
- | sequence "=>" "()" /ws => "wrap"
-
-range ::= ec => "range0" | ec ^"-" ec => "range0"
-E ::= word => "nonTerminalY"
- | [(][)] => "epsilon"
- | ^"{" Alternatives "}"
- | "[" [\~]? range* "]" => "range"
- | E ^"*/" E
- | E ^"+/" E
- | E ^"?"
- | E ^"~/~"
-
- | E ^"-" E
-
- | ^"!" E
- | "^" quoted => "care"
- | ^"`" E
- | E ^"#"
- | quoted => "literal"
+grammar ::= r +/ ws => "grammar"
+r ::= word ^"::=" alternatives /ws
+ | word ^"!::=" alternatives /ws
+
+alternatives ::= equiAlt +/ (ws ">" ws)
+equiAlt ::= conjuncts +/ (ws "|" ws)
+
+conjuncts ::= rewrite
+ | rewrite ^"&" e*/ws /ws
+ | rewrite ^"&~" e*/ws /ws
+
+sequence ::= e*/ws
+ (ws "/" e)?
+ (ws "=>" ws (word|quoted))? => "seq"
+
+rewrite ::= sequence
+
+ec ::= [~\-\]\\\~]
+ | escaped