grammar: grammar-section+ grammar-section: non-terminal new-line? predicate new-line? whitespace? comment new-line? whitespace? new-line whitespace comment: TERMINAL(//) NONE_OF(\r\n)* whitespace: ONE_OF( \t\v\f)+ new-line: TERMINAL(\r) TERMINAL(\n)? TERMINAL(\n) //--------------------- non-terminal: name-characters TERMINAL(:) whitespace? new-line productions productions: production+ production: qualified-symbols whitespace? new-line qualified-symbols: qualified-symbol+ qualified-symbol: whitespace symbol-name multiplicity? whitespace terminal multiplicity? whitespace none-of multiplicity? whitespace one-of multiplicity? multiplicity: ONE_OF(?+*) TERMINAL({) decimal-digits TERMINAL(}) TERMINAL({) decimal-digits TERMINAL(,) decimal-digits TERMINAL(}) decimal-digits: ONE_OF(0123456789)+ //--------------------- symbol-name: name-characters terminal: TERMINAL(TERMINAL() terminal-characters TERMINAL()) none-of: TERMINAL(NONE_OF() terminal-characters TERMINAL()) one-of: TERMINAL(ONE_OF() terminal-characters TERMINAL()) predicate: TERMINAL(PREDICATE() name-characters TERMINAL()) terminal-characters: TERMINAL()) NONE_OF())+ name-characters: ONE_OF(abcdefghijklmnopqrstuvwxyz-)+