From: Logan Capaldo Date: 2007-02-22T12:50:02+09:00 Subject: Re: Parser as an alternative to RegExen On Thu, Feb 22, 2007 at 12:26:12PM +0900, James Edward Gray II wrote: > On Feb 21, 2007, at 8:15 PM, S. Robert James wrote: > > >I'm parsing a large file, currently using compound regexen: > > > >PREAMBLE = 'AA' > >USERID = '\d{8}' > >USER_HELLO = "#{PREMABLE}(#{USERID})" > > > >Is there a simple way to do this using a parser such as ANTLR? I've > >never used one before, so if it requires a learning curve, I'll stick > >to my regexen. > > I really don't think there's any value in going all the way to a > parser generator here. This job looks to be squarely in the Regexp > domain, so there's no reason to feel bad about using them. > Agreed. OTOH, Parsers are sure fun to write! (esp. rec descent ones for simple grammars). If you do decide to go with a parser generator, check out Dhaka, http://dhaka.rubyforge.org/ > James Edward Gray II