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

3
  • 1
    You could be lazy and simply replace characters from your input, and then process it exactly as you do now. Then check if there is a noticeable decrease in performance. Commented Feb 19, 2015 at 8:45
  • "My application is written in C++, so I have used boost to parse the json file" – no, you definitely don't have to use Boost. Commented Feb 19, 2015 at 8:56
  • @TheParamagneticCroissant: true, I do not have to use boost, but I've used it :) Commented Feb 19, 2015 at 9:00

1 Answer 1

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:

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.