data: Fixed ASTVisitor to not use Node::NodeType
This commit is contained in:
@@ -4,7 +4,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "data/graph/Node.h"
|
|
||||||
#include "data/name/NameHierarchy.h"
|
#include "data/name/NameHierarchy.h"
|
||||||
#include "utility/file/FileInfo.h"
|
#include "utility/file/FileInfo.h"
|
||||||
#include "utility/types.h"
|
#include "utility/types.h"
|
||||||
@@ -86,7 +85,7 @@ public:
|
|||||||
virtual Id onCallParsed(
|
virtual Id onCallParsed(
|
||||||
const ParseLocation& location, const NameHierarchy& caller, const NameHierarchy& callee) = 0;
|
const ParseLocation& location, const NameHierarchy& caller, const NameHierarchy& callee) = 0;
|
||||||
virtual Id onUsageParsed(
|
virtual Id onUsageParsed(
|
||||||
const ParseLocation& location, const NameHierarchy& userName, Node::NodeType usedType, const NameHierarchy& usedName) = 0;
|
const ParseLocation& location, const NameHierarchy& userName, int usedType, const NameHierarchy& usedName) = 0;
|
||||||
virtual Id onTypeUsageParsed(const ParseLocation& location, const NameHierarchy& user, const NameHierarchy& used) = 0;
|
virtual Id onTypeUsageParsed(const ParseLocation& location, const NameHierarchy& user, const NameHierarchy& used) = 0;
|
||||||
|
|
||||||
virtual Id onTemplateArgumentTypeParsed(
|
virtual Id onTemplateArgumentTypeParsed(
|
||||||
|
|||||||
@@ -240,12 +240,12 @@ Id ParserClientImpl::onCallParsed(const ParseLocation& location, const NameHiera
|
|||||||
}
|
}
|
||||||
|
|
||||||
Id ParserClientImpl::onUsageParsed(
|
Id ParserClientImpl::onUsageParsed(
|
||||||
const ParseLocation& location, const NameHierarchy& userName, Node::NodeType usedType, const NameHierarchy& usedName)
|
const ParseLocation& location, const NameHierarchy& userName, int usedType, const NameHierarchy& usedName)
|
||||||
{
|
{
|
||||||
log("usage", userName.getQualifiedNameWithSignature() + " -> " + usedName.getQualifiedName(), location);
|
log("usage", userName.getQualifiedNameWithSignature() + " -> " + usedName.getQualifiedName(), location);
|
||||||
|
|
||||||
Id userNodeId = addNodeHierarchy(Node::NODE_UNDEFINED, userName, DEFINITION_NONE);
|
Id userNodeId = addNodeHierarchy(Node::NODE_UNDEFINED, userName, DEFINITION_NONE);
|
||||||
Id usedNodeId = addNodeHierarchy(usedType, usedName, DEFINITION_NONE);
|
Id usedNodeId = addNodeHierarchy(Node::intToType(usedType), usedName, DEFINITION_NONE);
|
||||||
Id edgeId = addEdge(Edge::EDGE_USAGE, userNodeId, usedNodeId);
|
Id edgeId = addEdge(Edge::EDGE_USAGE, userNodeId, usedNodeId);
|
||||||
addSourceLocation(edgeId, location, locationTypeToInt(LOCATION_TOKEN));
|
addSourceLocation(edgeId, location, locationTypeToInt(LOCATION_TOKEN));
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#ifndef PARSER_CLIENT_IMPL_H
|
#ifndef PARSER_CLIENT_IMPL_H
|
||||||
#define PARSER_CLIENT_IMPL_H
|
#define PARSER_CLIENT_IMPL_H
|
||||||
|
|
||||||
|
#include "data/graph/Node.h"
|
||||||
#include "data/parser/ParserClient.h"
|
#include "data/parser/ParserClient.h"
|
||||||
#include "data/IntermediateStorage.h"
|
#include "data/IntermediateStorage.h"
|
||||||
#include "data/graph/token_component/TokenComponentAccess.h"
|
#include "data/graph/token_component/TokenComponentAccess.h"
|
||||||
#include "data/graph/Node.h"
|
|
||||||
|
|
||||||
#include "data/DefinitionType.h"
|
#include "data/DefinitionType.h"
|
||||||
#include "data/SqliteStorage.h"
|
#include "data/SqliteStorage.h"
|
||||||
@@ -59,7 +59,7 @@ public:
|
|||||||
virtual Id onCallParsed(
|
virtual Id onCallParsed(
|
||||||
const ParseLocation& location, const NameHierarchy& caller, const NameHierarchy& callee);
|
const ParseLocation& location, const NameHierarchy& caller, const NameHierarchy& callee);
|
||||||
virtual Id onUsageParsed(
|
virtual Id onUsageParsed(
|
||||||
const ParseLocation& location, const NameHierarchy& userName, Node::NodeType usedType, const NameHierarchy& usedName);
|
const ParseLocation& location, const NameHierarchy& userName, int usedType, const NameHierarchy& usedName);
|
||||||
virtual Id onTypeUsageParsed(const ParseLocation& location, const NameHierarchy& user, const NameHierarchy& used);
|
virtual Id onTypeUsageParsed(const ParseLocation& location, const NameHierarchy& user, const NameHierarchy& used);
|
||||||
|
|
||||||
virtual Id onTemplateArgumentTypeParsed(
|
virtual Id onTemplateArgumentTypeParsed(
|
||||||
|
|||||||
@@ -1400,23 +1400,23 @@ void ASTVisitor::RecordDeclRef(
|
|||||||
case RT_AddressTaken:
|
case RT_AddressTaken:
|
||||||
{
|
{
|
||||||
const NameHierarchy contextNameHierarchy = getContextName();
|
const NameHierarchy contextNameHierarchy = getContextName();
|
||||||
Node::NodeType usedType = Node::NODE_UNDEFINED;
|
int usedType = 0x1;
|
||||||
switch (symbolType)
|
switch (symbolType)
|
||||||
{
|
{
|
||||||
case ST_Field:
|
case ST_Field:
|
||||||
usedType = Node::NODE_FIELD;
|
usedType = 0x40;
|
||||||
break;
|
break;
|
||||||
case ST_GlobalVariable:
|
case ST_GlobalVariable:
|
||||||
usedType = Node::NODE_GLOBAL_VARIABLE;
|
usedType = 0x20;
|
||||||
break;
|
break;
|
||||||
case ST_Enumerator:
|
case ST_Enumerator:
|
||||||
usedType = Node::NODE_ENUM_CONSTANT;
|
usedType = 0x400;
|
||||||
break;
|
break;
|
||||||
case ST_Function:
|
case ST_Function:
|
||||||
usedType = Node::NODE_FUNCTION;
|
usedType = 0x80;
|
||||||
break;
|
break;
|
||||||
case ST_Method:
|
case ST_Method:
|
||||||
usedType = Node::NODE_METHOD;
|
usedType = 0x100;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2998,7 +2998,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual Id onUsageParsed(
|
virtual Id onUsageParsed(
|
||||||
const ParseLocation& location, const NameHierarchy& userName, Node::NodeType usedType, const NameHierarchy& usedName)
|
const ParseLocation& location, const NameHierarchy& userName, int usedType, const NameHierarchy& usedName)
|
||||||
{
|
{
|
||||||
usages.push_back(addLocationSuffix(userName.getQualifiedNameWithSignature() + " -> " + usedName.getQualifiedName(), location));
|
usages.push_back(addLocationSuffix(userName.getQualifiedNameWithSignature() + " -> " + usedName.getQualifiedName(), location));
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user