是否可以使用 phpDocumentor 来解析 DocBlock 标签?

发布于 2024-08-07 10:43:59 字数 150 浏览 2 评论 0原文

我想使用 phpDocumentor 类来解析我自己的 PHP 文档并处理结果。我可以手动执行此操作,但我很确定可以使用 phpDocumentor。

问题是我找不到任何关于此的文档。我到底应该如何使用 phpDocumentor 的类?

感谢您的链接!

I want to use phpDocumentor classes for parsing of my own PHP documentation and working with results. I can do this manually, but I'm pretty sure that phpDocumentor could be used.

The problem is that I can't find any documentation about this. How exactly should I use phpDocumentor's classes?

Thanks for the link!

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

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

发布评论

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

评论(3

稀香 2024-08-14 10:43:59

我发现 Zend_Reflection_* 类可以完成这项工作。

I found out that Zend_Reflection_* classes can do this job.

情徒 2024-08-14 10:43:59

PHPDocumentor 手册包含 700 多页,是在 PHPDoc 下运行 PHPDoc 的结果。但几个月前我只看了几个小时。该代码是标记器内容与正则表达式的极端组合 - 这使得 PHPDoc 无法为其文档字符串提供正式的 BNF 语法。

如果这很重要,您应该考虑编写自己的 PHP 解析器 - 至少了解一点编译器构造。 PHP 是一种非常简单的语言。

The PHPDocumentor Manual conatins over 700 pages as the result of running PHPDoc under PHPDoc. But i only looked for a couple of hours at it a few month ago. The code is an extreme mix of tokenizer stuff mixed with regular expressions - which makes it for example impossible for PHPDoc to give a formal BNF grammer for its doc strings.

If it is important you should consider writing your own PHP parser - at least if know a little bit about compiler construction. PHP is a pretty simple language.

や三分注定 2024-08-14 10:43:59

phpDocumentor 是在 PHP4 时代编写的,我不认为它的设计方式允许轻松扩展自身。

此外,我几乎猜测您实际上想要作为基础的开始是 PHP 中的 tokenizer 扩展,无论如何,这主要是 phpDocumentor 内部使用的。

phpDocumentor was written back in the PHP4 days, and I don't believe it was designed in a way to allow easy extension of itself.

Further, I'd almost guess that what you actually want to start with as a base would be the tokenizer extension in PHP, which is mostly what phpDocumentor uses internally anyway.

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