From: Eric Mahurin Date: 2008-09-27T14:30:44+09:00 Subject: Re: my ears are burning... ;) ------=_Part_16780_12788582.1222493409289 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Fri, Sep 26, 2008 at 1:19 AM, wrote: > As for packrat etc... Turn on backtrack=true and ANTLR throttles up > from LL(1) to LL(*) to a PEG as necessary. Memoization only occurs if > you say so, either on grammar or on rule. I have plans to have ANTLR > suggest where you should memoize. This sounds very good. I'd like to see how you did some of this. My parser generator does LL(1) and LL(*) where directed. When you set "backtrack=true", does it generate backtracking code only where the grammar really needs it (a lookahead token/character could match two alternatives?) or for (almost) all alternatives? Now I'm curious to see what kind of code ANTLR generates, especially with selective memoization. As for my attitude, most think I'm quite a nice guy. Even a few > students! ;) I do go off the reservation a few times a year, > though. :) I have a few buttons that set me off related to demands > people make about my software. I work nonstop on them for free > etc... Anyhoo, not sure how I ran you guys off, but sorry. Well, not > sorry if it's "heh, dumbass why don't you have a ruby target yet" ;) > ha! As an ex-ANTLR guy, I've always found you to be nice. I learned quite a bit about parsing while using ANTLR that I wanted to go off and design my own. I've counted a bunch of others that did the same. That says a lot. I was much easier to wrap your head around parsing when you saw the recursive descent LL code that ANTLR generated compared to the tables of *ACC. Hopefully somebody will get the Ruby target working! I'd like to see a ruby parser out of ANTLR and benchmark it against my parser. My current benchmark is JSON->ruby. > Pretty cool that > the retargetable codegen works, eh? Got a guy doing emacs Lisp at the > moment, if you can believe it! > I finally got my parser generator setup for re-targeting. The code generator is more generically a grammar tree traverser. There are a ton of possibilities for a given traverser: generate code in a specific language, parse while traversing (no code generation), generate a different type of parser (LALR?), generate grammar diagrams, etc. Thanks for ANTLR! Eric ------=_Part_16780_12788582.1222493409289--