39 }
catch (std::logic_error &e) {
52 string key = token.
value;
58 cout <<
"=object=|" << key <<
"|===>>\n";
61 cout <<
"<<===end object\n";
66 cout <<
"-list-|" << key <<
"|--->>\n";
69 cout <<
"<<---end list\n";
76 cout << key <<
"='" << (*keyObjectMap)[key]->str() <<
"'\n";
83 cout << key <<
"=" << (*keyObjectMap)[key]->nbr() <<
"\n";
90 cout << key <<
"(BOOL)\n";
105 throw std::logic_error(
"No more tokens");
114 bool hasCompleted =
false;
115 while (!hasCompleted) {
117 throw std::logic_error(
"No more tokens");
121 switch (token.
type) {
124 cout <<
"=object===>>\n";
127 cout <<
"<<===end object\n";
132 cout <<
"-list--->>\n";
135 cout <<
"<<---end list\n";
142 cout <<
"|'" << subNode->
str() <<
"'";
149 cout <<
"|" << subNode->
nbr();
164 list->push_back(subNode);
177 string *sValue =
new string(token.
value);
184 string value = token.
value;
185 int nbr = std::atoi(value.c_str());
void setObject(JSONObject *object)
void setString(string *str)
void setList(JSONList *list)
JSONParser(const string filename)
JSONNode * parseBoolean()
std::vector< JSONNode * > JSONList
std::map< string, JSONNode * > JSONObject