From: Robert Feldt Date: 2001-10-30T20:28:54+09:00 Subject: [ruby-talk:23833] Re: GUI for Ruby On Tue, 30 Oct 2001, hipster wrote: > JFYI: ANTLR should be able to handle any type 0-3 grammar using > semantic and syntactic predicates, multiple parsers/lexers, AST > transformations, &c. Still extra work, but no need to rewrite the > grammar. > Maybe we are misunderstanding each other but I would consider this extra work a rewrite of the grammar since when I have a grammar in my head there is no need for syntactic predicates, multiple lexers etc. If you need it to describe the grammar then the tool adds unnecessary things. I'm not saying its evil (since you would typically get better performance by describing things in more detail) just that it adds things so its no simpler. The only situation were you *HAVE* to add things to your grammar is if it is ambigous and you want the parser to return only one tree. All other situations are tool-specifics. The big drawback with GLR and Early parsing is that the algorithmic complexity is higher for *some* grammars, ie. parsing can take *long* time. However, in practice these grammars are rare. Another drawback is that we have less experience with these algorithms so there are still implementation issues etc. You might want to check out the article "Why Bison is becoming extinct" at http://www.acm.org/crossroads/xrds7-5/bison.html for some info relating to this. However, he doesn't mention ANTLR. If you want to check out mature GLR and Early parser gens you might take a look at Accent and ASF+SDF. Sorry if this is already familiar to you. I'm unfamiliar with the term "type 0-3" grammar. How does it relate to Context-freeness an LL(k), LALR(k) etc? Oh, and ANTLR seems to be a really powerful tool. And its a plus you get parser that can be read by a human (compared to table-based ones). I especially like the rewrite stuff in there and how you can use the same formalism both for lexing and parsing. Cool stuff. Regards, Robert