Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

IRC Protocol (I give up ) Re:(6)

 [1/2] from: peoyli:algonet:se at: 8-Sep-2000 15:14


> Is this line "prefix: make object! [full: nick: user: host: string!]" > supposed to be replaced with the actual nick user and host portions or is > this proper syntax! > > Paul Tretter >
I use this object to store a parsed RAW line from the IRC server (a call to a parse-irc-str function I wrote for this purpose). 'full' contains the whole prefix from the string sent by the server, and the rest of the prefix object contains the actual parts of the prefix.
>From the RFC:
Each IRC message may consist of up to three main parts: the prefix (optional), the command, and the command parameters (of which there may be up to 15). The prefix, command, and all parameters are separated by one (or more) ASCII space character(s) (0x20). The presence of a prefix is indicated with a single leading ASCII colon character (':', 0x3b), which must be the first character of the message itself. ... <message> ::= [':' <prefix> <SPACE> ] <command> <params> <crlf> <prefix> ::= <servername> | <nick> [ '!' <user> ] [ ['--'] <host> ] It could be nice to have a REBOL function to actually parse (any) whole 'pseudo' BNF formatted description.. /PeO

 [2/2] from: bhandley:zip:au at: 10-Sep-2000 18:25


<message> ::= [':' <prefix> <SPACE> ] <command> <params> <crlf>
> <prefix> ::= <servername> | <nick> [ '!' <user> ] [ ['--'] <host> ] > > It could be nice to have a REBOL function to actually parse (any) > whole 'pseudo' BNF formatted description.. > > /PeO
I agree. I started looking at a function like this (given the number of EBNF floating around w3c.org) but unfortunately have not produced anything remotely useful. Though the exercise taught me a heap about all sort of things I didn't know before... Problems struck include "backtracking". I found a relevent scscript called search-text.r (on www.rebol.org) by Eric Long that takes regular expressions - but again I got lost. So I second the motion, it would be nice to a such a function :) Brett.