0

I've got a grammar for the IRC-protocol from RFC 2812:

message    =  [ ":" prefix SPACE ] command [ params ] crlf
prefix     =  servername / ( nickname [ [ "!" user ] "@" host ] )
command    =  1*letter / 3digit
params     =  *14( SPACE middle ) [ SPACE ":" trailing ]
           =/ 14( SPACE middle ) [ SPACE [ ":" ] trailing ]

nospcrlfcl =  %x01-09 / %x0B-0C / %x0E-1F / %x21-39 / %x3B-FF
                ; any octet except NUL, CR, LF, " " and ":"
middle     =  nospcrlfcl *( ":" / nospcrlfcl )
trailing   =  *( ":" / " " / nospcrlfcl )

SPACE      =  %x20        ; space character
crlf       =  %x0D %x0A   ; "carriage return" "linefeed"

What does the "1*letter" mean? I guess one to infinite occurrences. And what does "*14( SPACE middle )" mean? And what dows "14( SPACE middle )" mean? Thanks in advance.

Bonita Montero
  • 2,817
  • 9
  • 22

1 Answers1

0

RFC 2812's References section lists RFC 2234 as the specification of Augmented BNF for Syntax Specifications.

There, in section 3.6, we see:

The operator "*" preceding an element indicates repetition. The full form is:

   <a>*<b>element

where <a> and <b> are optional decimal values, indicating at least <a> and at most <b> occurrences of element.

Default values are 0 and infinity so that *<element> allows any number, including zero; 1*<element> requires at least one; 3*3<element> allows exactly 3 and 1*2<element> allows one or two.

Community
  • 1
  • 1
Toby Speight
  • 27,591
  • 48
  • 66
  • 103