1

I have an application that reads some parameters from a json file, but now the file has changed (it is not my decision). The file looks pretty the same, but instead of {} it has [], so if until now it looked like

{
  "A":
  {
    "a":"a",
    "b":"b"
  }
}

now it is like this:

[
  "A":
  [
    "a":"a",
    "b":"b"
  ]
]

My application is written in C++, so I have used boost to parse the json file, but now I am looking for a new parser, is there a way to do it with boost?

I have started to search, but I have also asked the question thinking that maybe someone may help me faster than me finding the answer. Thanks

sop
  • 3,445
  • 8
  • 41
  • 84

1 Answers1

1

It looks like Yet Another YAML/Mustache/JSON/... derivative.

Without a formal spec it's hard to actually assess what effort would be required, but here's a list of implementations of similar grammars in Boost Spirit, with varying amounts of feature completeness:

Applications of a toy JSON parser implementation:

Community
  • 1
  • 1
sehe
  • 374,641
  • 47
  • 450
  • 633