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