# vim: ts=2 sw=2 et # -*- coding: ascii-8bit -*- require 'ircp/parser/message_node_classes' module Ircp module Parser # RFC1459 based grammar Message rule message prefix:( ':' v:prefix space )? command params:params? crlf? end rule prefix '' servername &space / nick user:( '!' v:user )? host:( '@' v:host )? end rule command letter+ / number 3..3 end rule params middles:( space v:middle )* trailing:( space ':' v:trailing )? end rule middle [^ :] [^ ]* end rule trailing .* end rule space [ ]+ end rule nospace [^ ] end rule crlf [\x0D\x0A] end rule letter [a-zA-Z] end rule number [0-9] end rule servername '' host end rule host [^ !@]+ end rule nick [^ !@]+ end rule user [^ !@]+ end end end end