寻找完整的 Delphi (object pascal) 语法

发布于 2024-07-06 08:28:39 字数 836 浏览 3 评论 0 原文

我需要完整的 Object Pascal 语法(最好是 Delphi 2009)。 帮助文件给出了一些语法,但并未提供所有信息。 所以我开始收集零散的信息。 最近我将这些添加到或多或少完整的语法描述中(类似 EBNF)。

尽管它看起来很广泛,但仍然存在错误,并且我确信缺少某些部分(特别是在 .NET 语法中)。 所以我询问 SO Delphi 社区。 您有任何信息或者您可以纠正错误吗? 作为回报,我向社区提供完整的语法。 它可能会节省您一些时间;-)。 将来,我喜欢对其他语言(如 C#/C++/Java)做同样的事情。

我已经给出了语法描述:我的语法到目前为止。 或者,如果您喜欢文本版本。 (XHTML 是从文本版本生成的)。

请注意,语法集中于句法部分,因为词汇部分并不是真正的问题。

更新

我有新版本的 Delphi 语法。 html 版本。 它包括包括 2009 在内的所有版本。Prism 扩展仍在待办事项列表中。 我不确定我是否要把他们放在一起。

对于真正的纯粹主义者来说,它还包含完整的汇编代码(它不支持全部 100% 的 intel 集,但只遗漏了一些指令。)。

I need a complete Object Pascal syntax (preferably Delphi 2009). Some of the syntax is given by the help files, but not all information is provided. So I started collecting loose bits of information. Recently I added these to a more or less complete syntax description (EBNF like).

Although it looks extensive, there are still bugs and I'm sure parts are missing (specially in the .NET syntax). So I'm asking the SO Delphi community. Do you have any information or can you correct the errors? In return I provide the complete syntax to the community. It probably saves you some time ;-).
In the future, I like to do the same for other languages (Like C#/C++/Java).

The syntax description I already have is given: My Syntax sofar. Or if you like a Text version. (The XHTML is generated from the text version).

Please note that the syntax focusses on the syntactical part, because the lexical part is not really a problem.

Update

I have a new version of the Delphi Syntax. html version. It includes al versions including 2009. Prism extentions are still on the todo list. And I'm not sure if I'm going to keep them together.

For the real purists, it also contains the full assembler code (which does not support the full 100% of the intel set but only a few instructions are missed.).

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

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

发布评论

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

评论(6

阳光的暖冬 2024-07-13 08:28:39

试试这个:DGrok - Delphi 语法

Try this: DGrok - Delphi grammar

如何视而不见 2024-07-13 08:28:39

Delphi 没有完整的、已发布的语法。 请记住,.net 和 win32 delphi 具有不同的语法。

这个项目中有手工构建的Delphi解析器。 还有许多可以编译但突破语法限制的代码测试用例。

There is no complete, published syntax for Delphi. Bear in mind that .net and win32 delphi have different syntaxes.

This project has hand-build Delphi parser in it. And lots of test cases of code that compiles but pushes the limits of the syntax.

沙与沫 2024-07-13 08:28:39

Delphi 7的语法在Object Pascal一书的后面。

你的意思是几千块钱他们都不给你寄吗? 他们甚至会寄给您一张 6' x 6' 的海报吗?

Delphi 7's grammar is in the back of the Object Pascal book.

You mean for a few thousand dollars they don't even send you that? Do they even send you a 6' x 6' poster?

等风来 2024-07-13 08:28:39

这可能是一个很好的帮助。 它是 解析器。 com/" rel="nofollow noreferrer">TwoDesk 的 Castalia。

This might be a good help. It is the parser used in TwoDesk's Castalia.

家住魔仙堡 2024-07-13 08:28:39

您到底缺少哪些错误和功能?

通过扫描您的文档,您似乎混合了语法和语义。 我不明白为什么要在语法级别上区分 SimpleTypeFloat 和 SimpleTypeOrdinal,也不明白为什么要在 AddOp 和 MulOp 中区分代码运算符优先级作为语法功能。 true、false、nil 是标识符,就像您选择的任何变量名称一样。

What exactly are the bugs and functionality you're missing?

From scanning over your document, it seems you mingle syntax and semantics. I do not understand why to distinguish between SimpleTypeFloat and SimpleTypeOrdinal on a syntactic level, or code operator precedence as syntactic feature in AddOp and MulOp. true, false, nil are identifiers just as any variable name you choose.

嘴硬脾气大 2024-07-13 08:28:39

您始终可以阅读 Free Pascal 编译器 的源代码。 它支持对象 Pascal。

You could always read the source to the Free Pascal Compiler. It supports Object Pascal.

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