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