#include #include #include #include /* * https://github.com/kazuho/picojson * */ #include "picojson/picojson.h" using namespace std; int main(int argc, char** argv) { ifstream ifs(argv[1]); string json_str((istreambuf_iterator(ifs)), (istreambuf_iterator())); picojson::value v; istringstream iss(json_str); picojson::parse(v, iss); picojson::value::object& obj = v.get(); picojson::value::object& last_edge = obj["edges"].get().back().get(); string s(last_edge["rule"].get()); cerr << s.substr(1, 4) << endl; return 0; }