I am parsing a script. I am looking for the most effective method to parse braced blocks, prefixed by a descriptor. The prefixes are arbitrary. I would also like [a, b] to be parsed as a list. More braced blocks would be added as such, supporting recursion. If you cannot provide a definite script, please at least point me in the right direction.
Example:
_data{abc; def; gh i; j k l; mn[op, qr]}}
_main{abc; de f; ji(k, l); if(a==b){pass;};}
I would want it parsed into
{
"_data": ["abc", "def", "gh i", "j k l", ["mn", ["op", "qr"]]],
"_main": ["abc", "de f", ["ji", ["k", "l"]], ["if", "a==b", ["pass"]]]
}