data: parse variable usage

* Implemented functions for parsing usages of fields and global variables in ASTBodyVisitor and ASTVisitor.
* Storage adds TokenLocatons and Edges for usages.
* Added tests for parsing usage of fields and global variables.

fortune cookie message = Fame, riches and love are yours for the taking.
This commit is contained in:
malte_langkabel
2014-07-17 15:09:53 +02:00
parent 4578c109ec
commit ad5056354d
12 changed files with 180 additions and 12 deletions
+12 -11
View File
@@ -35,29 +35,31 @@ public:
, m_importantestValue(3.14159265359f)
{
}
~A()
{
}
void doImportantStuff()
{
m_importantValue *= 1;
}
void doModeratelyImportantStuff()
{
m_importanterValue = 'R';
sum(21, 21);
}
private:
int m_importantValue;
char m_importanterValue;
float m_importantestValue;
};
A globalA;
class B : public A {};
class C
@@ -66,23 +68,22 @@ public:
C()
: m_valuable(0)
{
globalA.doImportantStuff();
}
~C()
{
}
void solveAllProblems()
{
A aInstance;
aInstance.doImportantStuff();
aInstance.doModeratelyImportantStuff();
}
private:
int m_valuable;
};
A globalA;
typedef A* C;
typedef A* D;