I have an interesting problem. Let's say that i have file with lines filled like this:
name1[xp,y,z321](a,b,c){text};//comment
#comment
name2(aaaa);
also I have (simplified) class:
class something {
public:
something(const std::string& name);
addOptionalParam(const std::string& value);
addMandatoryParam(const std::string& value);
setData((const std::string& value);
};
name corresponds to param name of some class constructor. Things listed in [] brackets are optional, in () are mandatory and everything between {} should be pased as string.
For the first line one should call constructor with "name1" as name; 3 times call addOptionalParam, one once for each item separated with colon; also 3 times addMandatoryParam and setData with "text".
I can work out how to do the comments, but everything else is mangled for me...
Now I need some good advice how(or if) this is possible, if I can wor out how to do that for simple objects, I can work out how to handle all the extra gory details like semantic correctness an all that.