C ++的最佳lex / yacc? [英] Best lex/yacc for C++?

查看:90
本文介绍了C ++的最佳lex / yacc?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在寻找最好的lex和yacc组合(或类似的东西)

可以与C ++结合使用可以包含C ++代码。我

有常规的flex / bison端口工作但是我当然不能在动作中使用

C ++构造。

虽然我可以制作一个简单的命令行解析器

(经过太多小时后),但我已经尝试了精神,用它创建一个解析器树是不可能的

一个简单的方法(编译包含文件时编译器被阻塞),所以回到

到一个lex / yacc克隆我猜。


有没有人有意见(特别是如果你自己或正在使用一些

的实现)。


任何帮助表示感谢。


此致,Ron AF Greve。

Hi,

I am searching for the best lex and yacc combination (or something similar)
that can be used in combination with C++ and that can contain C++ code. I
have the regular flex/bison port working but then I, of course, can''t use
C++ constructs in the actions.

I have tried spirit although I could make a simple command line parser
(after too many hours), creating a parser tree with it was not possible in
an easy way (the compiler choked while compiling the include files), so back
to a lex/yacc clone I guess.

Does anyone have any opinion (especially if you have or are using some
implemtation yourself).

Any help appreciated.

Regards, Ron AF Greve.

推荐答案



" Moonlit" <人****** @ jupiter.universe>在消息中写道

news:3f *********************** @ news.xs4all.nl ...

"Moonlit" <al******@jupiter.universe> wrote in message
news:3f***********************@news.xs4all.nl...


我正在寻找可以与C ++结合使用并且可以包含C ++代码的最佳lex和yacc组合(或类似的
)。我有常规的flex / bison端口工作但是我当然不能在动作中使用
C ++构造。
Hi,

I am searching for the best lex and yacc combination (or something similar) that can be used in combination with C++ and that can contain C++ code. I
have the regular flex/bison port working but then I, of course, can''t use
C++ constructs in the actions.




你可以写包装链接到并调用实际C ++代码的函数。

您希望在操作中使用哪些C ++代码?



You can write "wrapper" functions that link to and call the actual C++ code.
What C++ code are you looking to use in the actions ?


在星期三,8 2003年10月17:30:56 +0200,Moonlit

< al ****** @ jupiter.universe>写道:
On Wed, 8 Oct 2003 17:30:56 +0200, "Moonlit"
<al******@jupiter.universe> wrote:


我正在寻找可以与之结合使用的最佳lex和yacc组合(或类似的东西)
C ++,可以包含C ++代码。我有常规的flex / bison端口工作但是我当然不能在动作中使用
C ++构造。

虽然我可以尝试精神制作一个简单的命令行解析器(经过几个小时),用它创建一个解析器树是不可能的简单方法(编译包含文件时编译器被阻塞),所以返回
我想是一个lex / yacc克隆。
Hi,

I am searching for the best lex and yacc combination (or something similar)
that can be used in combination with C++ and that can contain C++ code. I
have the regular flex/bison port working but then I, of course, can''t use
C++ constructs in the actions.

I have tried spirit although I could make a simple command line parser
(after too many hours), creating a parser tree with it was not possible in
an easy way (the compiler choked while compiling the include files), so back
to a lex/yacc clone I guess.




我相信有一个精神邮件列表:

https://lists.sourceforge.net/lists/...spirit-general


兼容性信息在这里:

http://www.boost.org/libs/spirit/doc/portability.html


Tom



There is a spirit mailing list I believe:

https://lists.sourceforge.net/lists/...spirit-general

Compatibility information is here:

http://www.boost.org/libs/spirit/doc/portability.html

Tom





感谢您的回复。


啊,他们应该我认为在他们的头版上已经链接了。现在我看到我的

vc6显然不支持

(不是解析树,但没有它们......)。


我实际上尝试过他们的新闻服务器,但由于某种原因我的新闻帖子不会

到达那里虽然我可以阅读其他帖子。


是否有人使用vc7.1和精神获得了某种语言解析器的经验(没有大b $ b,但至少有超过20条规则)。


我必须承认你可以用C ++代码编写你的解析器的方式吸引我很多,这就是为什么我花了很多时间在它上面而且我会是

愿意为此购买7.1编译器,如果我至少

最近有信心我可以使用它(使用合理的解析树
尺寸)。


再次感谢您的回复。

问候,Ron AF Greve。




" tom_usenet" <到******** @ hotmail.com>在消息中写道

news:44 ******************************** @ 4ax.com ...
Hi,

Thanks for your reply.

Ah, they should have linked that on their front page I think. Now I see my
vc6 is apparently
not supported (well not the parse trees, but without them ....).

I tried actually their news server but for some reason my news post won''t
arrive there though I can read the other posts.

Has someone got experience with some kind of language parser (doesn''t have
to be big but at least with more than say 20 rules) with vc7.1 and spirit.

I must admit the way you can write your parser just in C++ code appeals to
me a lot, that''s why I spend already so much time on it and I would be
willing to buy the 7.1 compiler just for that, if I would be at least
recently confident that I could use it then (with parse trees of reasonable
size).

Thanks for your reply again.
Regards, Ron AF Greve.



"tom_usenet" <to********@hotmail.com> wrote in message
news:44********************************@4ax.com...
2003年10月8日星期三17:30:56 +0200,Moonlit
< al ****** @ jupiter.universe>写道:
On Wed, 8 Oct 2003 17:30:56 +0200, "Moonlit"
<al******@jupiter.universe> wrote:


我正在寻找可以与之结合使用的最佳lex和yacc组合(或类似的
) C ++,可以包含C ++代码。我有常规的flex / bison端口工作但是我当然不能在动作中使用
C ++构造。

虽然我可以尝试精神制作一个简单的命令行解析器
(经过太多时间),创建一个解析器树是不可能的
简单的方法(编译包含文件时编译器被阻塞),所以
backto我想是一个lex / yacc克隆。
Hi,

I am searching for the best lex and yacc combination (or something similar)that can be used in combination with C++ and that can contain C++ code. I
have the regular flex/bison port working but then I, of course, can''t use
C++ constructs in the actions.

I have tried spirit although I could make a simple command line parser
(after too many hours), creating a parser tree with it was not possible inan easy way (the compiler choked while compiling the include files), so backto a lex/yacc clone I guess.



我相信有一个精神邮件列表:

https://lists.sourceforge.net/lists/...spirit-general
兼容性信息在此处:

http://www.boost.org/libs/spirit/doc/portability.html

Tom



There is a spirit mailing list I believe:

https://lists.sourceforge.net/lists/...spirit-general

Compatibility information is here:

http://www.boost.org/libs/spirit/doc/portability.html

Tom



这篇关于C ++的最佳lex / yacc?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆