开发者

Generate C++ code for BNF grammar [closed]

开发者 https://www.devze.com 2022-12-10 06:10 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
开发者_StackOverflow中文版

Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.

Closed 9 years ago.

Improve this question

I have looked at the following software tools:

  • Ragel
  • ANTLR
  • BNF Converter
  • Boost::Spirit
  • Coco/R
  • YACC

ANTLR seems the most straight-forward, however its documentation is lacking. Ragel looks possible, too, but I do not see an easy way to convert BNF into its syntax.

What other tools are available that can take BNF input and generate a corresponding, Unicode-friendly, cross-platform, standalone, C++ parser?

Many thanks for all suggestions.

Edit: Changed Objective-C requirement to C++.


Try boost.spirit 2.

The boost spirit user list is very active and answers are quick from the authors.


TDParseKit! (Most specifically, this page on Objective-C parser generation with BNF grammars)


Have you looked at QLALR? It is a creative Friday project from QtDF. I have not tried it personally, but the trolls seems to be pragmatic about their approach to problems, so I guess this is too.


You can try GOLD Parser! It's a great tool for parsing and generating. With a simple UI, all what you need to do is to provide a valid grammar file and select your favored programming languages for your output code.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号