data: saving typedef to Storage
This change save typedef expressions to the Storage using a node of type Node::NODE_TYPEDEF and an edge of type Edge::EDGE_TYPEDEF_OF that leads to the original type, with the qualifiers saved as DataType on the edge.
This commit is contained in:
@@ -13,6 +13,10 @@ y fooy();
|
||||
z fooz();
|
||||
*/
|
||||
|
||||
class A {};
|
||||
class B : public A {};
|
||||
typedef A* C;
|
||||
|
||||
const bool *ab(int a, int b);
|
||||
|
||||
bool const *abc(int a, int b);
|
||||
@@ -23,6 +27,3 @@ int main();
|
||||
void foo();
|
||||
int sum(int a, int b);
|
||||
int diff(int a, int b);
|
||||
|
||||
class A {};
|
||||
class B : public A {};
|
||||
|
||||
@@ -47,7 +47,13 @@ void Storage::onTypedefParsed(
|
||||
){
|
||||
log("typedef", fullName + " -> " + underlyingType.getFullTypeName(), location);
|
||||
|
||||
// TODO: save Typedef
|
||||
Node* node = m_graph.createNodeHierarchy(fullName);
|
||||
node->setType(Node::NODE_TYPEDEF);
|
||||
node->setAccess(convertAccessType(access));
|
||||
|
||||
addTokenLocation(node, location);
|
||||
|
||||
addTypeEdge(node, Edge::EDGE_TYPEDEF_OF, underlyingType);
|
||||
}
|
||||
|
||||
void Storage::onClassParsed(const ParseLocation& location, const std::string& fullName, AccessType access)
|
||||
|
||||
@@ -103,6 +103,8 @@ std::string Edge::getTypeString() const
|
||||
return "is derived from";
|
||||
case EDGE_CALL:
|
||||
return "calls";
|
||||
case EDGE_TYPEDEF_OF:
|
||||
return "is typedef of";
|
||||
default:
|
||||
LOG_ERROR("TypeString not implemented for edge type.");
|
||||
}
|
||||
|
||||
@@ -20,7 +20,8 @@ public:
|
||||
EDGE_PARAMETER_TYPE_OF,
|
||||
EDGE_USAGE,
|
||||
EDGE_CALL,
|
||||
EDGE_INHERITANCE
|
||||
EDGE_INHERITANCE,
|
||||
EDGE_TYPEDEF_OF
|
||||
};
|
||||
|
||||
enum AccessType
|
||||
|
||||
@@ -266,6 +266,8 @@ std::string Node::getTypeString(NodeType type) const
|
||||
return "namespace";
|
||||
case NODE_ENUM:
|
||||
return "enum";
|
||||
case NODE_TYPEDEF:
|
||||
return "typedef";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -22,7 +22,8 @@ public:
|
||||
NODE_FUNCTION,
|
||||
NODE_METHOD,
|
||||
NODE_NAMESPACE,
|
||||
NODE_ENUM
|
||||
NODE_ENUM,
|
||||
NODE_TYPEDEF
|
||||
};
|
||||
|
||||
Node(NodeType type, const std::string& name);
|
||||
|
||||
Reference in New Issue
Block a user