3 Grammar:: = Declaration +/ ws
5 Declaration = NonTerminal
6 | ^"#import" FileName /ws
7 | ^"#import" FileName "as" Word /ws
9 FileName:: = (~[\r\n ] | escaped)+ -> [\r\n ]
11 NonTerminal = NonTerminal:: Word ws "=" ws RHS
12 | DropNT:: Word "!" ws "=" ws RHS
13 | Colons:: Word "::" ws "=" ws RHS
14 | Word "*" ws ^"=" ws RHS
15 | Word "*/" Word ws ^"=" ws RHS
17 RHS:: = ("|":: Sequence +/ (ws "|" ws)) +/ (ws ">" ws)
21 PreSequence = Elements
22 | (Quoted|Word) ^"::" PreSequence /ws
23 > PreSequence ^"/" e /ws
24 | PreSequence ^"->" e /ws
26 Sequence = PreSequence
27 | Sequence ^"&" Elements /ws
28 | Sequence ^"&~" Elements /ws
31 > (Quoted|Word) ^":" e
32 > NonTerminalReference:: Word
35 | ^"{" PreSequence "}" /ws
53 Word:: = [.a-zA-Z0-9_]++
54 Quoted:: = "\"" (~[\"\\] | escaped)+ "\""
62 escaped = "\n":: "\\n"
66 ws! = [ \r\n]** ("//" ~[\n]* "\n" ws)?