开发者

By which library etc. can i parse these type of data? in C++

开发者 https://www.devze.com 2023-02-07 22:46 出处:网络
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++ ?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号