[antlr-interest] Re: Problem with token names that are also keywords in target language (e.g. C#)

Sinan sinan.karasu at boeing.com
Wed Mar 13 10:15:22 PST 2002

micheal_jor wrote:
> --- In antlr-interest at y..., Ric Klaren <klaren at c...> wrote:
> > If this is some example files you have ported to C# then I'd say
> change the
> > examples. Doing a global prefixing for everything java/c++ just
> because C#
> > does something different seems not practical to me. Or do you mean
> some of
> > the variable names which are generated by some of the generic parts
> of
> > antlr?
> >
> > Or it may be that I'm completely missing the point.
> The culprit grammar files are the existing examples (e.g. Java
> grammar) supplied with ANTLR. Some of the variables names that are
> generated in the Parser are keywords in C#. This could happen to some
> other language in the future too I would guess....

Isn't the intent of mangleLiteralPrefix exactly this?

options {
	mangleLiteralPrefix = "TK_";



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

More information about the antlr-interest mailing list