组合两个 lex/yacc 解决方案

发布于 2024-12-24 22:48:59 字数 319 浏览 5 评论 0原文

为了获得用于解析和分析嵌入式sql代码完整解决方案,我想知道是否可以组合两个< lex|yacc 解决方案,一个用于 Ansi C,另一个用于 SQL,在同一程序中。我认为这两种语法之间会有一种编排。

抱歉,如果我的想法有点模棱两可;至于建议,我将更多地解释我的观点。

首先,我的问题是:解析解决方案(lex|yaccflex|bison)是否可以包含多个 lex 文件并且yacc 文件也有同样的问题吗?

In order to get a complete solution for parsing and analysing an embedded sql code I'd like to know if it is possible to combine two lex|yacc solutions, one for Ansi C and the other for SQL, in the same program. I assume there will be a kind of orchestration between the two grammars.

Sorry if my idea is a little bit ambiguous; as far as proposals come I'll explain more my point of view.

So first of all, my question is: can a parsing solution(lex|yacc or flex|bison) contain more than one lex file and also the same question for a yacc file?

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

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

发布评论

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

评论(1

日暮斜阳 2024-12-31 22:48:59

您可以使用 -P 选项向生成的代码和文件名添加前缀。

有关更多信息,请在 google 上搜索“lex yacc prefix”。

You can use the -P option to add a prefix to the generated code and to the file names.

For more information, google for "lex yacc prefix".

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