Generate C++ code for BNF grammar [closed]
开发者_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 questionI 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.
精彩评论