[antlr-interest] Help - ANTLR and localized keywords

Milos Silhanek silhanek.m at gmail.com
Sun Sep 5 13:27:35 PDT 2010


Hi,

I have implemented Karel language support in NetBeans Platform and I will
use ANTLR to generate lexer, parser and AST.
Karel language is described on
http://karelnb.sourceforge.net/introduction.html

But Karel's keywords are nationale specific (and case insensitive) - the
STEP command in English is KROK in Czech. I tried several ways. Using
predicates generates code into parser but not in lexer. Advices in mailing
list didn't help me.

How can I test keywords in different languages in lexer?

Can I translate localized keywords into basic (English) in AntlrCharStream ?


I suppose to load localized keywords in each lexer/parser. Program will be
able to translate Karel sources from one language to others.

Thanks for help.

Milos Silhanek
silhanek.m at seznam.cz


More information about the antlr-interest mailing list