[antlr-interest] Re: Antlr noobie, nondeterminism abounds

John D. Mitchell johnm-antlr at non.net
Tue May 11 08:57:41 PDT 2004


>>>>> "Mark" == Mark Lentczner <markl at glyphic.com> writes:
[...are parser-generators worth it for silly languages...] 

> Well, I can't say it is a clear answer one way or the other!  For most
> internet protocols I'd think that a generated parser is in appropriate:
> They generally have very few reused or recursive structures, need almost
> no parsing look ahead, have irregular and context sensitive token
> definitions, and all-in-all aren't that big.  For example, I don't think
> parser would really help parsing HTTP headers.

Part of the problem is the fact that many of the protocols (like IMAP) are
completely crap from a language POV.

Part of the lack of need is, as you say, due to the fact that some
protocols are purposefully made to be very easy to "parse" "manually".
However, I strongly urge caution in relying too much on this as many
protocols are more complicated than they first appear.  I.e., doing a quick
and dirty hack is doable quite easily but creating a serious, production
quality version can be a lot harder.

[...]

> Sure, I might use a grammar for IMAP responses - but I probably wouldn't
> build and AST, and instead generate my own response structures directly
> in the parser actions.  I think I'd have to do most of the work in the
> parser, and leave the lexer to only pass on characters.

To be a bit more explicit... As with lexers and parsers, a tree recognizer
or transformer has a purpose that doesn't always match the needs of the
problem.  In this case, it's unclear whether the requirements of this
project needs any of them or not.


Finally, even if the original poster chooses not to use a generator such as
Antlr, a disciplined approach to manually creating a solution will go a
long way.

Hope this helps,
		John



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list