4 Grammar:: = Declaration +/ ws
6 Declaration = NonTerminal
7 | ^"#import" FileName /ws
8 | ^"#import" FileName "as" Word /ws
10 FileName:: = (~[\r\n ] | escaped)+ -> [\r\n ]
12 NonTerminal = NonTerminal:: Word ws "=" ws RHS
13 | DropNT:: Word "!" ws "=" ws RHS
14 | Colons:: Word "::" ws "=" ws RHS
15 | Word "*" ws ^"=" ws RHS
16 | Word "*/" Word ws ^"=" ws RHS
18 RHS:: = ("|":: Sequence +/ (ws "|" ws)) +/ (ws (">" -> ~">") ws)
22 PreSequence = Elements
23 | (Quoted|Word) ^"::" PreSequence /ws
24 > PreSequence ^"/" e /ws
25 | PreSequence ^"->" e /ws
27 Sequence = PreSequence
28 | Sequence ^"&" Elements /ws
30 | Sequence ^"&~" Elements /ws
33 > (Quoted|Word) ^":" e
34 > NonTerminalReference:: Word
52 | "~":: ("~" -> ~"~")! e
56 Word:: = [.a-zA-Z0-9_]++ &~ "."+
57 Quoted:: = "\"" (~[\"\\] | escaped)+ "\""
69 escaped = "\n":: "\\n"
75 | [ \r\t\n]** "//" ~[\n]* "\n" ws