Does there exist a parser that generates an AST/parse tree at runtime? Kind of like a library that would accept a string of EBNF grammar or something analogous and spit out a data structure?
- I'm aware of antlr, jlex and their ilk. They generate source code which could do this. (like to skip the compile step)
- I'm aware of Boost::Spirit, which uses some black magic with C++ syntax to generate such things at execution time (definitely much closer to what I want, but I'm a wuss when it comes to C++. And it's still somewhat limiting, because your grammar is hardcoded)
- I'm not aware of anything in python or ruby, although a compiler compiler might very well be effective in such a language...
Now I'm aware of parser combinators. (thanks, Jonas) And some libraries (thanks eliben)
incidentally, I also noticed Parsing Expression Grammars lately, which sounds cool were someone to implement it (they say Perl 6 will have it, but Perl evades my understanding)