From: Eric Mahurin Date: 2005-10-28T21:57:31+09:00 Subject: Re: PARSER for RUBY --- puellula@gmail.com wrote: > Hi, > can you help me? > I have to write a parser for Ruby. I had think to use the > parser > generator ANTLR. > I have find Ruby Grammar, but I have problem with ANTLR for > "infinite > recursion". I have cancel left recursion but I have the same > problem :( Hey, we are doing the same thing! I'm using my grammar project to implement a ruby lexer/parser: http://rubyforge.org/projects/grammar/ I'm starting with what's in parse.y (from the 1.8 ruby source). This is for yacc (an LALR parser). My parser is also an LL parser like ANTLR so I have to do the same LR -> LL conversion. I used ANTLR about a year ago and as a matter of fact one of my contributions is in the ANTLR distribution - C preprocessor lexer. Almost any feature you find in ANTLR will be in Grammar. Anybody know of something that can convert from LR to LL grammar? Hasn't anybody made something like that for ANTLR? Right now, my focus is only the ruby lexer and managing the lexer states (some of it is determined by the parser). I think making the lexer (hand coded C in parse.y) is much harder than converting from LR to LL (a fairly mechanical process) for the parser. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com