他们的任何语法文件是否以Flex/Bison格式为Flex/Bison输入文件?

发布于 2025-01-23 22:07:47 字数 509 浏览 4 评论 0原文

我想编写一个flex和野牛,该弯曲和野牛会生成纯-CPP标头文件,以便平台独立。 实际上,我写了一些代码。

我使用一些字符串技巧来解析Flex和Bison输入文件。

我做的是我手工写了一个解析器。 解析器适用于某些文件,但对于其他格式来说是错误的。

突然,我意识到弹性和野牛输入解析也是可以在Flex和Bison中完成的任务。

因此,问题是,他们的任何人都做过这样的事情吗,它正在以Flex/Bison格式编写Flex和Bison Input File Grammar?

我在Google中搜索了,但没有得到一个,所以他们的某个原因是Flex/Bison输入文件格式不适合Flex/Bison语法格式吗?

从RICI评论中,我找到了以下答案:

  1. pubs.opengroup.org/onlinepubs/96999919799/utilities/yacc.html。您不能仅将其送入野牛/弯曲,但这是一个很好的开始。
  2. flex输入格式并不真正适合柔性令牌。

i would like to write a flex and bison which will generate pure-cpp header file so that can platform independ.
actually i have written some code of them.

i parse the flex and bison input file using some string trick.

what i have done is that i wrote a parser by hand.
the parser is work for some file, but is buggy for other format.

suddenly i realized that the flex and bison input parse is a task that can be done in flex and bison too.

so the question is, is their anyone have done such thing, which is writing the flex and bison input file grammar in flex/bison format?

i searched in google and not get one, so, is their some reason that the flex/bison input file format is not suitable for flex/bison grammar format?

from the rici comment, i find this answer:

  1. pubs.opengroup.org/onlinepubs/9699919799/utilities/yacc.html. You can't just feed it into bison/flex, but it's a good start.
  2. the flex input format is not really suitable for flex-style tokenisation;

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文