data: Parsing functions with ParseFunction for signature comparing

This change switches function and method parsing to use the structure ParseFunction, which holds all important values of
the function. This structure is then used also in call and usage parsing to allow distinction between signatures.
This commit is contained in:
Eberhard Graether
2014-07-30 13:32:38 +02:00
parent acfc4934c2
commit dc09860680
19 changed files with 397 additions and 215 deletions
+2 -2
View File
@@ -90,7 +90,7 @@ Node* Graph::createNodeHierarchy(Node::NodeType type, const std::string& fullNam
Node* Graph::createNodeHierarchyWithDistinctSignature(const std::string& fullName, const std::string& signature)
{
return createNodeHierarchyWithDistinctSignature(Node::NODE_UNDEFINED, fullName, signature);
return createNodeHierarchyWithDistinctSignature(Node::NODE_UNDEFINED_FUNCTION, fullName, signature);
}
Node* Graph::createNodeHierarchyWithDistinctSignature(
@@ -103,7 +103,7 @@ Node* Graph::createNodeHierarchyWithDistinctSignature(
TokenComponentSignature* sigComponent = node->getComponent<TokenComponentSignature>();
if (sigComponent && sigComponent->getSignature() == signature)
{
if (type != Node::NODE_UNDEFINED)
if (type != Node::NODE_UNDEFINED && type != Node::NODE_UNDEFINED_FUNCTION)
{
node->setType(type);
}
+5 -3
View File
@@ -31,10 +31,10 @@ Node::NodeType Node::getType() const
void Node::setType(NodeType type)
{
if (type != m_type && m_type != NODE_UNDEFINED)
if (type != m_type && m_type != NODE_UNDEFINED && m_type != NODE_UNDEFINED_FUNCTION)
{
LOG_WARNING(
"Changing NodeType after it was already set, from " + getTypeString(m_type) + " to " + getTypeString(type)
"Cannot change NodeType after it was already set from " + getTypeString(m_type) + " to " + getTypeString(type)
);
return;
}
@@ -229,7 +229,7 @@ void Node::addComponentSignature(std::shared_ptr<TokenComponentSignature> compon
{
LOG_ERROR("TokenComponentSignature has been set before!");
}
else if (m_type != NODE_FUNCTION && m_type != NODE_METHOD)
else if (m_type != NODE_UNDEFINED_FUNCTION && m_type != NODE_FUNCTION && m_type != NODE_METHOD)
{
LOG_ERROR("TokenComponentSignature can't be set on node of type: " + getTypeString(m_type));
}
@@ -245,6 +245,8 @@ std::string Node::getTypeString(NodeType type) const
{
case NODE_UNDEFINED:
return "undefined";
case NODE_UNDEFINED_FUNCTION:
return "undefined function";
case NODE_CLASS:
return "class";
case NODE_STRUCT:
+1
View File
@@ -19,6 +19,7 @@ public:
enum NodeType
{
NODE_UNDEFINED,
NODE_UNDEFINED_FUNCTION,
NODE_CLASS,
NODE_STRUCT,
NODE_GLOBAL_VARIABLE,