I am looking for a dynamic C-based parser/framework. It must be dynamic because the EBNF is constantly changing, something like bison is not applicable in this situation. And boost::spirit is practi开发者_如何转开发cally useless to me because it requires C++.
Does anyone have an idea?
If you want the grammar to change while the computation is running, then what you want is an Earley-style context free parser. You can change the rules at any time and run the Earley parsing algorithm.
If the grammar changes "slowly" (e.g., once a day), then you don't need a dynamically-augmentable parser like Earley; you can use conventional parser generators and simply run them as needed.
精彩评论