用于C ++的分析器生成器 [英] Parser Generator for C++

查看:72
本文介绍了用于C ++的分析器生成器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我需要在C ++中创建一个解析器来解析一个有点复杂的
文件结构。是的,有可能从头开始写它在

C ++中然而我觉得它会更容易,最终结果会是如果我使用的话,那么
可能更有效率解析器生成器。但是,我只知道很久以前来自C项目的flex / bison。关于什么

现在和C ++使用的想法都不错。


干杯,


Paulo Matos

Hi all,

I need to create a parser in C++ which should parse a somewhat complex
file structure. Yeah, it would be possible to write it from scratch in
C++ however I think it would be easier and the end-result would
probably be more efficient if I use a parser generator. However, I only
know flex/bison from a project in C along time ago. Any ideas on what
to use nowadays and for C++ would be nice.

Cheers,

Paulo Matos

推荐答案

pmatos写道:
我需要在C ++中创建一个解析器,它应该解析一些有点复杂的
文件结构。是的,可以在C ++中从头开始编写它,但是我觉得它会更容易,如果我使用解析器生成器,最终结果可能会更有效。但是,我只是从不久前的C项目中了解flex / bison。关于现在使用什么和使用C ++的任何想法都会很好。
I need to create a parser in C++ which should parse a somewhat complex
file structure. Yeah, it would be possible to write it from scratch in
C++ however I think it would be easier and the end-result would
probably be more efficient if I use a parser generator. However, I only
know flex/bison from a project in C along time ago. Any ideas on what
to use nowadays and for C++ would be nice.




AFAIK关心并且可以定义文件语法的人仍然是

使用lex / yacc(或其等价物)来完成这项工作。


V



AFAIK people who care and who can define the grammar of their files still
use lex/yacc (or their equivalents) to do the job.

V


pmatos写道:
大家好,我需要在C ++中创建一个解析器来解析一个有点复杂的文件结构。是的,可以在C ++中从头开始编写它,但是我觉得它会更容易,如果我使用解析器生成器,最终结果可能会更有效。但是,我之前只知道来自C项目的flex / bison。关于
现在和C ++使用什么的任何想法都会很好。
Hi all,

I need to create a parser in C++ which should parse a somewhat complex
file structure. Yeah, it would be possible to write it from scratch in
C++ however I think it would be easier and the end-result would
probably be more efficient if I use a parser generator. However, I
only know flex/bison from a project in C along time ago. Any ideas on
what to use nowadays and for C++ would be nice.




如何在 http://www.boost.org/libs/spirit/index.html


Jeff F



How about boost.spirit at http://www.boost.org/libs/spirit/index.html

Jeff F


Victor Bazarov写道:
Victor Bazarov wrote:
pmatos写道:
pmatos wrote:
我需要在C ++中创建一个解析器来解析一个有点复杂的文件结构。是的,可以在C ++中从头开始编写它,但是我觉得它会更容易,如果我使用解析器生成器,最终结果可能会更有效。但是,我只是从不久前的C项目中了解flex / bison。关于现在使用什么和使用C ++的任何想法都会很好。
I need to create a parser in C++ which should parse a somewhat complex
file structure. Yeah, it would be possible to write it from scratch in
C++ however I think it would be easier and the end-result would
probably be more efficient if I use a parser generator. However, I only
know flex/bison from a project in C along time ago. Any ideas on what
to use nowadays and for C++ would be nice.



AFAIK关心并且可以定义文件语法的人仍然使用lex / yacc(或它们的等价物)来完成这项工作。

V


AFAIK people who care and who can define the grammar of their files still
use lex/yacc (or their equivalents) to do the job.

V




我们必须为一个C ++项目使用flex / bison解析器并且很难让b $ b平静编译器来编译生成的代码(g ++)...

我认为他的问题是合理的,我会感兴趣对于C ++来说,如果有
就是这样的话。


-

问候,

Matthias



We had to use a flex/bison parser for a C++ project and had a hard time
calming the compiler to compile the generated code at all (g++)...
I think his question was reasonable and I''d be interested, too, if there
is such a thing for C++.

--
Regards,
Matthias


这篇关于用于C ++的分析器生成器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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