[LLVMdev] C++ Interpreter
Axel.Naumann at cern.ch
Tue Sep 1 02:00:23 PDT 2009
Renato Golin wrote on 09/01/2009 10:40 AM:
> 2009/8/31 Douglas Gregor <dgregor at apple.com>:
>> Clang is meant to be flexible enough to be used as the basis for a C++
>> interpreter. However, there will probably be a bit of work to do in Clang to
>> make this happen, e.g., by providing clean APIs for an interpreter to call
>> into Clang's parser to parse a new expression/statement/function.
> Speaking of those APIs, I guess if you do have something of the sort,
> it may be easy to evaluate expressions and understanding the structure
> of a program on a debugger.
Correct. As a matter of fact we use the current interpreter's knowledge
also for introspection and serialization.
> If you manage to parse dwarf information on the same structure as
> clang (or the interpreter) does with code, one can later list the
> members of a class, print their values etc.
Right, having a working interactive C++ interpreter would also help for
a debugger, as you said assuming that the symbols "are there". Function
calls will be possible, too; you could also create objects in the
interpreter stack and evaluate them.
So - are you interested? :-)
More information about the llvm-dev