-s ::= Grammar ws => "gram"
-Grammar ::= NonTerminal +/ ws => "grammar"
-NonTerminal ::= word ^"::=" RHS /ws
-
-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 ::= ~[\-\]\\]
+s = !ws (grammar::Grammar) !ws
+
+Grammar = NonTerminal +/ ws
+
+NonTerminal = Word ^"=" RHS /ws
+
+// use 'a'-'z' or 'a-z' instead of [a-z]?
+// EOF token?
+// #include (with renaming?)
+// ANTLR uses ! and ^ suffixes
+
+RHS = (Sequence +/ (!ws "|" !ws)) +/ (!ws ">" !ws)
+
+Elements = e*/ws
+
+PreSequence = ps:: Elements
+ | (Quoted|Word) ^"::" PreSequence /ws
+ > PreSequence ^"/" e /ws
+ | PreSequence ^"->" e /ws
+
+Sequence = psx:: PreSequence
+ | Sequence ^"&" Elements /ws
+ | Sequence ^"&~" Elements /ws
+
+ec = ~[\-\]\\]