The translator could be in boost::spirit too. I couldn't find any in the Internet. Maybe I should make one?
+1
A:
From the spirit introduction:
Expression templates allow us to approximate the syntax of Extended Backus-Normal Form (EBNF) completely in C++.
So you can almost write plain EBNF, no need for a translator.
I'm not so familiar with spirit to know how exactly the syntax is different, but if the differences of spirit C++ EBNF and real EBNF are minor a simple sed script may suffice.
If not you are right, you could write a spirit parser that understands EBNF and then use the AST to create C++ code that is a spirit representation of that AST.
lothar
2009-05-29 00:27:38
For large EBNFs (http://grammatica.percederberg.net/grammar/asn1/asn1.grammar), even thou it's almost identical, it's still a pain. It's not necessary to have one, but it would be helpful.
2009-05-29 01:01:47
If your Grammar is that large, you probably don't want to use Spirit for it ;)
Billy ONeal
2009-05-31 04:05:27