aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ASTJsonConverter.cpp8
-rw-r--r--ASTJsonConverter.h2
2 files changed, 4 insertions, 6 deletions
diff --git a/ASTJsonConverter.cpp b/ASTJsonConverter.cpp
index 3ef6728b..0e40713a 100644
--- a/ASTJsonConverter.cpp
+++ b/ASTJsonConverter.cpp
@@ -42,12 +42,12 @@ void ASTJsonConverter::addJsonNode(string const& _typeName,
attrs[e.first] = e.second;
node["attributes"] = attrs;
- m_jsonNodePtrs.top()->append(node);
+ m_jsonNodePtrs.top().append(node);
if (_hasChildren) {
Json::Value children(Json::arrayValue);
node["children"] = children;
- m_jsonNodePtrs.push(&node["children"]);
+ m_jsonNodePtrs.push(node["children"]);
m_depth ++;
cout << "goDown" << endl;
}
@@ -62,9 +62,7 @@ ASTJsonConverter::ASTJsonConverter(ASTNode const& _ast): m_ast(&_ast), m_depth(0
m_astJson["attributes"] = attrs;
attrs["name"] = "nameoffile"; //TODO
m_astJson["children"] = children;
- // m_jsonNodePtrs.push(&m_astJson["children"]);
- m_jsonNodePtrs.push(&m_astJson["children"]);
- // m_jsonNodePtrs.push(&children);
+ m_jsonNodePtrs.push(m_astJson["children"]);
}
void ASTJsonConverter::print(ostream& _stream)
diff --git a/ASTJsonConverter.h b/ASTJsonConverter.h
index 44bd3461..6db625fe 100644
--- a/ASTJsonConverter.h
+++ b/ASTJsonConverter.h
@@ -128,7 +128,7 @@ private:
};
Json::Value m_astJson;
- std::stack<Json::Value *> m_jsonNodePtrs;
+ std::stack<Json::Value> m_jsonNodePtrs;
std::string m_source;
ASTNode const* m_ast;
int m_depth;