data: saving locations of return and parameter types

This change introduces the structure ParseTypeUsage for passing information about type usage from the parser to it's
client. It is used for passing data type and location information about return types and parameter types, which now
get saved to the corresponding edges in the Storage.
This commit is contained in:
Eberhard Graether
2014-07-14 16:21:10 +02:00
parent ce54bd50ed
commit b7cbef3772
13 changed files with 215 additions and 60 deletions
+5 -4
View File
@@ -36,12 +36,12 @@ public:
virtual void onFieldParsed(const ParseLocation& location, const ParseVariable& variable, AccessType access);
virtual void onFunctionParsed(
const ParseLocation& location, const std::string& fullName, const DataType& returnType,
const std::vector<ParseVariable>& parameters
const ParseLocation& location, const std::string& fullName, const ParseTypeUsage& returnType,
const std::vector<ParseTypeUsage>& parameters
);
virtual void onMethodParsed(
const ParseLocation& location, const std::string& fullName, const DataType& returnType,
const std::vector<ParseVariable>& parameters, AccessType access, AbstractionType abstraction,
const ParseLocation& location, const std::string& fullName, const ParseTypeUsage& returnType,
const std::vector<ParseTypeUsage>& parameters, AccessType access, AbstractionType abstraction,
bool isConst, bool isStatic
);
@@ -73,6 +73,7 @@ public:
private:
Edge::AccessType convertAccessType(ParserClient::AccessType access) const;
Edge* addTypeEdge(Node* node, Edge::EdgeType edgeType, const DataType& type);
Edge* addTypeEdge(Node* node, Edge::EdgeType edgeType, const ParseTypeUsage& typeUsage);
TokenLocation* addTokenLocation(Token* token, const ParseLocation& location);
void log(std::string type, std::string str, const ParseLocation& location) const;