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:

  1. Elements may appear undefined.
  2. All elements that are part of the schema must appear, and none else.
  3. The synthesized properties of all the elements go into a structure
  4. (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 , then post-parsing can be easily tested during run-time after survival.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -