开发者

How do I parse a curly bracket structured file (e.g. Ruby)?

The contents of the file looks like (any deep possible):

{
  {bla: XBS/333: bla9,1-}
}
{
  {q: XBS/333: bla9,1-}
  {{}}
  {x:{t: QWA/333: C}}
}

How do I parse it to e.g. an Array or a Hash with Ruby? What do you think is a good data structure 开发者_开发问答object to store it to?

(It's a SWIFT-Banking file, if that helps)


Try any proper parsers generator, for example http://treetop.rubyforge.org/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜