c++ - boost::Spirit Grammar for unsorted schema -
I have a piece of schema for that model that I have to parse, say it looks like the following.
{type = "standard"; Hostname = "x.y.z"; Port = "123"; }
Properties are:
- Elements may appear undefined.
- All elements that are part of the schema must appear, and none else.
- The synthesized properties of all the elements go into a structure
- (Optional) The schema may depend on the type field in the future - that is, different fields depending on the type - although at this time I'm not worried about this. According to the soul forums, the following answer is:
You may want to take a look at the permutation parser:
a ^ b ^ c
B matches (or its combination) in any sequence.
If analyzing in a structure is the best way, then all the necessary members have been initialized, the composition members should have boost :: optional
Comments
Post a Comment