How do you specify the access specifier on an ANTLR v3 generated parser or lexer?

Using ANTLR v3 and the CSharp2 language specifier, is there any way to indicate that you want the generated lexer or parser to be internal versus the default of public?

The namespace is specified with:

@lexer::namespace {My.Namespace}

and I would assume something similar exists for the access specifier, but I have been unable to find it.

10.12.2008 21:37:02
2 ОТВЕТА

I wanted to know the same thing, from looking at the template that it uses, it doesn't look like you can. "public" is hard coded.

0
17.12.2008 04:19:16
РЕШЕНИЕ

This thread on the antlr-interest mailing list talks about it. At the time of writing they are adding access specifiers to rules, but don't support access specifiers on the entire parser/lexer class. Will update if that changes.

2
10.02.2009 22:35:49