I need to parse a custom file format with C#. The file format is a PBX file of Xcode project. There is no official documentation on the format. But it's rather straightforward. Here is the simple example:
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
5143B90C1884374800F27FD8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5143B90B1884374800F27FD8 /* Foundation.framework */; };
5143B90E1884374800F27FD8 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5143B90D1884374800F27FD8 /* CoreGraphics.framework */; };
5143B9101884374800F27FD8 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5143B90F1884374800F27FD8 /* UIKit.framework */; };
/* End PBXBuildFile section */
};
rootObject = 5143B9001884374800F27FD8 /* Project object */;
}
In objects section there is a sequence of object definitions: object unique id followed by its properties. You can see comments here. Also property values can be enclosed in quotes.
The complete example of PBX file is here.
Now I need to build DOM of the file. What is the best approach to solve this kind of tasks?