如何在ANTLR v3生成的解析器或词法分析器上指定访问说明符? [英] How do you specify the access specifier on an ANTLR v3 generated parser or lexer?

查看:73
本文介绍了如何在ANTLR v3生成的解析器或词法分析器上指定访问说明符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用ANTLR v3和CSharp2语言说明符,有没有办法表明您希望生成的词法分析器或解析器是内部的,而不是默认的public?

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?

命名空间指定为:

@lexer::namespace {My.Namespace}

并且我认为访问说明符也存在类似的东西,但是我一直找不到它.

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

推荐答案

线程感兴趣的邮件列表对此进行了讨论.在撰写本文时,他们将访问说明添加到规则中,但不支持整个解析器/词法分析器类上的访问说明.如果发生更改,将进行更新.

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.

这篇关于如何在ANTLR v3生成的解析器或词法分析器上指定访问说明符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆