[antlr-interest] how to let parser control lexer state.

Benjamin Niemann pink at odahoda.de
Sun Apr 29 03:48:34 PDT 2007


Jim Idle wrote:

> Indeed. Perhaps, someday, the world can require that any 'new' [insert
> post-modernistic interpolation of 'reality' here ;-)] languages have to
> have a sane ANTLR parser as proof of their ability not to drive anyone
> with any sense mad and generally propagate the idea that languages
> should be 'useful' on their own terms - 'useful' being really "I can't
> be bothered to learn how to do this properly, so pass me the magic
> bullet". I will be the first to program the windows Vista gun gadget
> control to shoot anyone deciding that indenting should be
> lexically/grammatically significant on the vague justification that it
> makes people format code - something that a good programmer should do
> naturally anyway.

(High level) Languages are primarily designed for humans. That's why I
consider 'blocking by indention' more important than {..}, BEGIN..END or
whatever. Why should millions of language users be bothered with
maintaining two ways to define blocks - one for humans and one for the
compiler, if one is sufficient? Just to make those few poor souls happier,
who want to build parsers for these languages? IMHO: no.

-- 
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/



More information about the antlr-interest mailing list