An attempt at a BNF for the Gopher command

This command is emcoded to get rid of disallowed characters, and then follows something like (not complete by a long way ...)
gbits
gsep [ search ] gsep gpstring
gsep
tab
gpstring
$ | ! | $ gattrs | ! gattrs | + gviewlang
gattrs
galphas [ space gattrs ]
gviewlang
galpha1s space galpha1s
galphas
galpha [ galphas ]
galpha
alpaha | digit safe | extra | esc1 | esc2
esc1
% 0 not9
esc2
% not0 hex
not 0
9 | others
not 9
0 | others
others
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | a | b | c | d | e | f | A | B | C | D | E F
Tim BL