module Tnql grammar Registry rule registry exclude:exclude_crown_dependencies? space registry:(registry_code / registry_abbr) end rule exclude_crown_dependencies space ('not' / 'non' / 'exclude') space crown_dependency:('channel islands' / 'iom' / 'isle of man') end rule registry_code 'y' [0-9] 4..4 end rule registry_abbr ('nycris' / 'trent' / 'ecric' / 'thames' / 'oxford' / 'ociu' / 'swcis' / 'wmciu' / 'nwcis') end end end