在哪里可以找到 C# 3.0 语法?

发布于 2024-08-08 05:32:15 字数 82 浏览 5 评论 0原文

我计划用 C# 编写一个 C# 3.0 编译器。在哪里可以获得解析器生成的语法?

最好是无需修改即可与 ANTLR v3 配合使用的。

I'm planning to write a C# 3.0 compiler in C#. Where can I get the grammar for parser generation?

Preferably one that works with ANTLR v3 without modification.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

不交电费瞎发啥光 2024-08-15 05:32:15

看一下 C# 语言规范。在 B 章中。语法您会找到语法。

Take a look at C# Language Specification. In the chapter B. Grammar you'll find the grammar.

带上头具痛哭 2024-08-15 05:32:15

我遇到了 CodePlex 上的 ANTLR C# 语法。这是一个相对较新的项目,使用 ANTLR 3.2。它表示它支持 C# 4.0 并根据 Eclipse 公共许可证 (EPL) 获得许可。

我玩了一下。它有一堆包含表达式的测试文件。它支持 lambda、不安全上下文……正如您自然所期望的那样。它解析 C# 文件并为您提供一个抽象语法树。你可以用它做任何你想做的事。

I ran into ANTLR C# Grammar on CodePlex. It's a relatively new project and uses ANTLR 3.2. It says it supports C# 4.0 and is licensed under the Eclipse Public License (EPL).

I played with it a little. It has a bunch of test files containing expressions. It supports lambdas, unsafe context, ... as you'd naturally expect. It parses a C# file and hands you an abstract syntax tree. You can do whatever you want with it.

您是否在寻找类似 this这个

另请参阅C# ANLTR 语法问题。

Are you looking for something like this or this?

Please also refer to C# ANLTR grammar question.

甜味超标? 2024-08-15 05:32:15

看看 COCO/R 好像他们有语言规范对于 C# 3.0

Take a look at COCO/R it seems that they have the language specification for C# 3.0.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文