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

StackOverflow https://stackoverflow.com/questions/357695

  •  21-08-2019
  •  | 
  •  

Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top