[antlr-interest] error handling v3 style

Martin Probst mail at martin-probst.com
Sun Dec 11 14:46:16 PST 2005


> >> Does anybody use the paraphrase feature from v2?
> >
> > Yes, I do. And it's nice. Btw. there was once something about
> > internationalization support with those messages - it might be nice to
> > have a "printf" like template for those errors - possibly runtime
> > configurable.
> 
> Interesting...the paraphrase would be a StringTemplate that I pass  
> some standard data...

Thinking a little bit longer I'm not completly sure it's worth the
effort. I guess if you want really good error reporting, including i18n
and proper texts, you might have a bigger system you're using anyways -
in that case it might be easier to just retrieve the information from
the ANTLR exception and do all the formatting/translation yourself.

On the other hand, you might just allow people passing a message bundle
to the parser, providing format strings. That's probably flexible enough
for almost everything, and in Java those things come as a language
feature.

Martin



More information about the antlr-interest mailing list