* 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.
26 lines
746 B
C++
26 lines
746 B
C++
#ifndef AST_BODY_VISITOR
|
|
#define AST_BODY_VISITOR
|
|
|
|
#include "clang/AST/StmtVisitor.h"
|
|
#include "data/parser/cxx/ASTBodyVisitorClient.h"
|
|
|
|
class ASTBodyVisitor: public clang::StmtVisitor<ASTBodyVisitor>
|
|
{
|
|
public:
|
|
ASTBodyVisitor(ASTBodyVisitorClient* client, clang::NamedDecl* parentDecl);
|
|
virtual ~ASTBodyVisitor();
|
|
|
|
void VisitStmt(clang::Stmt* stmt);
|
|
void VisitChildren(clang::Stmt* stmt);
|
|
void VisitCallExpr(clang::CallExpr* expr);
|
|
void VisitCXXConstructExpr(clang::CXXConstructExpr* expr);
|
|
void VisitMemberExpr(clang::make_ptr<clang::MemberExpr>::type expr);
|
|
void VisitDeclRefExpr(clang::make_ptr<clang::DeclRefExpr>::type expr);
|
|
|
|
private:
|
|
ASTBodyVisitorClient* m_client;
|
|
clang::NamedDecl* m_parentDecl;
|
|
};
|
|
|
|
#endif // AST_BODY_VISITOR
|