[antlr-interest] ENHANCEMENT: Friendlier parser class, syntactic sugar for top level production.

Jim Idle jimi at temporal-wave.com
Thu Jul 31 09:49:14 PDT 2008


On Thu, 2008-07-31 at 11:45 +0200, Johannes Luber wrote:

> Austin Hastings schrieb:
> > I didn't see this in the 3.1b? release notes, so I thought I'd ask for 
> > it again.
> > 
> > I'd like to see the Parser class come with a .parse(...) method. This 
> > would do what the examples suggest: create  a lexer, etc., and then 
> > invoke the top level production.
> > 
> > Obviously, you could override this. If you do, then no harm done. But 
> > most people are doing the same things, so why should the code generator 
> > generate the last little bit that they need?
> > 
> > Equally obviously, there would need to be a way to identify the  top 
> > level production. The most obvious way is to use the first one 
> > encountered. A slightly better way would be to add some syntax to 
> > identify it. Either as an option, or as a rule attribute:


I just don't think that this makes any sense. The whole point of an
ANTLR parser is that you can start parsing with any rule. Hence where it
starts is more of a subjective matter for the programmer. All you need
ot do is copy and paste from the myriad examples in the target language.
I think that there are more important usability issues to work on,
starting with getting ANTLR3 grammars to be parsed by an ANTLR3 parser.

Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080731/84a07938/attachment.html 


More information about the antlr-interest mailing list