[antlr-interest] Q: Advice on localizing lexer

C. Mundi cmundi at gmail.com
Sun Jun 14 15:48:18 PDT 2009


On Sun, Jun 14, 2009 at 1:42 AM, Gavin Lambert <antlr at mirality.co.nz> wrote:

> At 17:12 14/06/2009, C. Mundi wrote:
>
> When you start to run into issues like this (configurable token definitions
> -- especially if they're configurable at runtime), I think it goes a little
> beyond the scope of ANTLR's lexer.
>
> But it's fairly easy to roll your own lexer that takes care of all that and
> then feed the resulting tokens into an ANTLR parser... but bear in mind that
> you'll still need to localise error messages and the like once you get there
> (though that's usually fairly straightforward).
>
>

Thanks.  I would not permit runtime configuration per se.  I would detect
the user locale (or let the user pick one) and use a lexer built
specifically for that local.

So I guess what I am really looking for (in an odd way) is grammar resuse.
I accept at the outset that I need to localize.  But I want to do this in a
way that makes porting changes (like fixes) easy from one grammar to all the
others.

I actually feel a little better that I'm not the only one who thinks this is
as you say a little outside ANTLR's scope.

Thanks!
Carlos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090614/3aa88781/attachment.html 


More information about the antlr-interest mailing list