Paste: ebnf help
Author: | bb |
Mode: | factor |
Date: | Mon, 8 Dec 2008 16:05:54 |
Plain Text |
TUPLE: msg sender mask chan msg ; C: <msg> msg
TUPLE: join nick mask chan ; C: <join> join
TUPLE: part nick mask chan msg ; C: <part> part
TUPLE: kick sender mask chan victim msg ; C: <kick> kick
EBNF: parse
nobang = (!("!").)+ => [[ >string ]]
word = (!(" ").)+ => [[ >string ]]
num = [0-9]+ => [[ string>number ]]
any = (.)* => [[ >string ]]
pong = "PING " any:code => [[ "PONG " write code print ignore ]]
privmsg = ":" nobang:sender "!" word:mask " PRIVMSG " word:chan " :" any:msg => [[ sender mask chan <msg> ]]
join = ":" nobang:sender "!" word:mask " JOIN " word:chan => [[ sender mask chan <join> ]]
part = ":" nobang:sender "!" word:mask " PART " word:chan " :" any:msg => [[ sender mask chan msg <part> ]]
kick = ":" nobang:sender "!" word:mask " KICK " word:chan " " word:nick " :" any:msg => [[ sender mask chan nick <kick> ]]
invite = ":" nobang:sender "!" word:mask " INVITE " word:invitee " :" word:chan => [[ sender mask invitee chan <invite> ]]
parse = pong | privmsg | join | part | kick | invitee
;EBNF
New Annotation