From: "Iñaki Baz Castillo" Date: 2008-03-16T11:42:52+09:00 Subject: Re: Looking for an appropiate parser generator El Domingo, 16 de Marzo de 2008, Eleanor McHugh escribió: > The SIP protocol is in principle simple enough opss, sure it's not simple at all, a lot of amiguations, each header has its own format, lots of extensions in lot of RFC's.... buff... simple? > that you could probably > get by rolling your own custom parser by hand. It's what I'm doing for now but maybe it's better using an existing one. No idea. > My colleague > implemented a console-driven SIP stack this way and whilst the code is > inefficient compared to a table-driven parser it's eminently more > readable. > > However if you do want to go down the parser-generator route for > performance reasons then look at the Ragel parser in Mongrel as that's > very efficient and highly conformant with the HTTP RFC specs (given > some of the boundary cases in SIP conformance is probably high on your > list of priorities). As far as I'm aware Ragel produces parsers in C, > but the Mongrel code will show you how to turn that into a Ruby native > extension. AFAIK Ragel can write to Ruby since verison 6.0: http://www.devchix.com/2008/01/13/a-hello-world-for-ruby-on-ragel-60 Thanks a lot, I'll try Ragel. -- Iñaki Baz Castillo