在 Linux 上使用 Bison --graph=[file] 的技巧

发布于 2024-08-12 02:08:57 字数 614 浏览 3 评论 0原文

最近(大约一个月前),我试图向公司的内部扩展语言引入新的构造,并与一些减少-减少错误作斗争。虽然我最终解决了这个问题,但深入研究 y.output 文件并不容易。

作为实验,我尝试使用 Bison 的 --graph=选项来输出 DOT 文件(请注意,我们的标准构建使用 Byacc,而不是 Bison)。由于我使用的是“交钥匙”Linux 机器,因此我没有安装 Graphviz,并且无法轻松地从 RPM 进行安装(在 Red Hat Enterprise Linux 4 上工作)。相反,我从源代码构建了它。

作为最初的实验,我尝试使用 Postscript 的输出运行dotty。现在我们的内部语言是普通的本土开发的、图灵完备的、动态类型的脚本语言,但我对接下来的事情毫无准备。 dotty 运行花费了四个多小时(2GHz 双核 AMD64 盒子)!当它完成时,渲染的图表不是我所说的可读的。

所以,很简单,我正在寻求建议。是否有一组开关可以改善我采用的“默认”方法的结果?我正在寻找

  • 优化“渲染”时间
  • 的经验,提高图形的可读性,
  • 为更好的图形查看器提供可能的建议

Recently (about a month ago) I was trying to introduce new constructs to my company's in-house extension language, and struggling with a couple of reduce-reduce errors. While I eventually solved this problem, digging into the y.output file was no picnic.

As an experiment, I tried using Bison's --graph=<file> option to output a DOT file (note that our standard build uses Byacc, not Bison). As I'm on a 'turnkey' Linux box, I didn't have a Graphviz installation and could not easily install from RPMs (working on Red Hat Enterprise Linux 4). Instead, I built it from source.

As an initial experiment, I tried to run dotty with an output of Postscript. Now our internal language is your average home-grown, Turing-complete, dynamically typed scripting language, but I was unprepared for what followed. The dotty run took over four hours (2GHz dual core AMD64 box)! And when it was done, the graph that was rendered was not what I would call readable.

So, quite simply, I'm looking for advice. Are there a set of switches which would improve the outcome over the 'default' approach I took? I'm looking for experience in

  • optimizing 'render' time
  • improving readability of the graph
  • possible advice on better graphical viewers

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

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

发布评论

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

评论(1

笔芯 2024-08-19 02:08:57

我想您已经看过这个链接,但为了完整起见,在以下位置有一个查看者列表等: http: //graphviz.org/resources/ 或参见 https://web.archive.org/web/20131005020548/http://graphviz.org/Resources.php 获取存档副本。

I imagine you've already seen this link, but just for completeness, there is a list of viewers etc. at: http://graphviz.org/resources/ or see https://web.archive.org/web/20131005020548/http://graphviz.org/Resources.php for an archived copy.

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