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

查看:19
本文介绍了您如何在 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.

推荐答案

这个 thread onantlr-interest 邮件列表讨论了它.在撰写本文时,他们正在向规则添加访问说明符,但不支持整个解析器/词法分析器类上的访问说明符.如果情况发生变化,将会更新.

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天全站免登陆