data: Saving TokenLocations of scopes separately

This change parses the TokenLocations of scopes of classes, structs, functions, methods, namespaces and enums and
saves them in Storage with type LOCATION_SCOPE. The TokenLocations of these nodes are just their name declarations now.
Scope locations are displayed in blue color in the code view.
This commit is contained in:
Eberhard Graether
2014-07-28 17:54:36 +02:00
parent 182e18840e
commit 96df63055a
18 changed files with 261 additions and 114 deletions
+13 -3
View File
@@ -14,13 +14,23 @@ class TokenLocationLine;
class TokenLocation
{
public:
enum LocationType
{
LOCATION_TOKEN,
LOCATION_SCOPE
};
TokenLocation(Id tokenId, TokenLocationLine* line, unsigned int columnNumber, bool isStart);
TokenLocation(Id id, Id tokenId, TokenLocationLine* line, unsigned int columnNumber, bool isStart);
TokenLocation(TokenLocation* other, TokenLocationLine* line, unsigned int columnNumber, bool isStart);
TokenLocation(const TokenLocation& other, TokenLocationLine* line);
~TokenLocation();
Id getId() const;
Id getTokenId() const;
LocationType getType() const;
void setType(LocationType type);
TokenLocationLine* getTokenLocationLine() const;
TokenLocationFile* getTokenLocationFile() const;
@@ -37,14 +47,14 @@ public:
bool isStartTokenLocation() const;
bool isEndTokenLocation() const;
std::shared_ptr<TokenLocation> createPlainCopy(TokenLocationLine* line) const;
private:
static Id s_locationId; // next free own id
const Id m_id; // own id
const Id m_tokenId;
LocationType m_type;
TokenLocationLine* const m_line;
const unsigned int m_columnNumber;