Generate C++ code for BNF grammar [closed]
-
13-09-2019 - |
Question
I have looked at the following software tools:
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++.
Solution
Try boost.spirit 2.
The boost spirit user list is very active and answers are quick from the authors.
OTHER TIPS
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.