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:
+12
-11
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user