I'm sorry if it's a very easy question. But how/by which library etc. can i parse a data like below in C++ ?
(car
(position
(x 2500)
(y 3000)
(z开发者_高级运维 1200)
)
(appearance
(color blue)
(type sport)
)
)
sounds like a good candidate for boost spirit.
That looks like LISP. Assuming it's a homework question, writing a simple recursive descent parser for LISP is quite trivial, so I'd write my own parser if I were you.
Don't think I've ever seen a format like that! I'd be tempted to roll my own parser.
Or, write a code generator to convert it to XML. Then there are plenty of libraries.
But there might be an easier answer out there.
精彩评论