This is a question out of curiousity for java or c++, I wanted to ask if it is possible to turn any text input into some executable statements?
For example say I have a text file with info like:
"class: Abc, Param: 32"
Now say in C++ or Java I want to read that file and do something like:
new Abc(32);
How would I do that? Its easy enough to read the value Abc but how do say create a class Abc? Is there a standard way to do that? in both C++ and Java?
Main curiosity came from those persistance mechanisms in Java that store object properties in XML file and create an object by reading that XML file, how do they do that? Is that seperate from what I am asking for above? EDIT: This is different from the standard java serialization, i've seen this as solutions for long term persistence where object implementation can change and instead of serializing they store properties including execution statements in XML files which are used to create an object at runtime.