Hi I was interested to see how Mongrel uses Lex/Yacc to parse the HTTP requests using a Regal generated parser. I downloaded the source but do not see the lex and yacc files...
On 9/25/06, Kris Leech <krisleech at interkonect.com> wrote:> Hi I was interested to see how Mongrel uses Lex/Yacc to parse the HTTP > requests using a Regal generated parser. I downloaded the source but do > not see the lex and yacc files... > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users>From former thread "Mongrel grammar file": > The Ragel grammar is ext/http11/http11_parser.rlIt seems that there''s no lex/yacc involved. Ragel is a replacement of lex/yacc, if I understood it properly.
On 2006-09-25 17:48:23 +0100, Kris Leech wrote:> Hi I was interested to see how Mongrel uses Lex/Yacc to parse the HTTP > requests using a Regal generated parser. I downloaded the source but > do not see the lex and yacc files...as you wrote yourself mongrel is using ragel for its parser. ragel does not use lex/yacc at all. http://rubyforge.org/cgi-bin/viewvc.cgi/trunk/ext/http11/?root=mongrel http11_parser.c and http11_parser.rl are your friends. and of course the ragel documentation at http://www.cs.queensu.ca/home/thurston/ragel/. hope this helps darix -- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org
On Mon, 25 Sep 2006 17:48:23 +0100 Kris Leech <krisleech at interkonect.com> wrote:> Hi I was interested to see how Mongrel uses Lex/Yacc to parse the HTTP > requests using a Regal generated parser. I downloaded the source but do > not see the lex and yacc files... >No lex and yacc used, just Ragel. Look for the .rl file and google for Ragel. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help.
Kris Leech wrote:>Hi I was interested to see how Mongrel uses Lex/Yacc to parse the HTTP >requests using a Regal generated parser. I downloaded the source but do >not see the lex and yacc files... > >Thanks for the replies... I see, my mistake, Regal is a replacement for Lex/Yacc, Im guessing it is very similar just a different implementation for the same concept of grammer and parser? Do you mind me asking what made you choose Regal over Lex/Yacc?>_______________________________________________ >Mongrel-users mailing list >Mongrel-users at rubyforge.org >http://rubyforge.org/mailman/listinfo/mongrel-users > > > > >
On Tue, 26 Sep 2006 08:49:09 +0100 Kris Leech <krisleech at interkonect.com> wrote:> Kris Leech wrote: > > >Hi I was interested to see how Mongrel uses Lex/Yacc to parse the HTTP > >requests using a Regal generated parser. I downloaded the source but do > >not see the lex and yacc files... > > > > > Thanks for the replies... > > I see, my mistake, Regal is a replacement for Lex/Yacc, Im guessing it > is very similar just a different implementation for the same concept of > grammer and parser? > Do you mind me asking what made you choose Regal over Lex/Yacc?I wouldn''t say it "replaces" yacc (I like lemon myself). I''d consider it like lex + 1/2 of yacc or a super fantastic insane lex. It''s still using the regex algorithms that lex does, it just gives you a lot more control and power in a nicer syntax. If you wanted to parse a full language you''d probably still want to use a LL or LR parser generator. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help.