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

*爱你&永不变心* 提交于 2019-12-11 06:47:51

问题


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.


回答1:


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:


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.



来源:https://stackoverflow.com/questions/357695/how-do-you-specify-the-access-specifier-on-an-antlr-v3-generated-parser-or-lexer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!