Reflection for RapidJSON 0.0.17
Reflection for serializing/deserializing with RapidJSON
Loading...
Searching...
No Matches
visitor.h
Go to the documentation of this file.
1#ifndef REFLECTIVE_RAPIDJSON_VISITOR_H
2#define REFLECTIVE_RAPIDJSON_VISITOR_H
3
4#include <clang/AST/ASTContext.h>
5#include <clang/AST/RecursiveASTVisitor.h>
6#include <clang/Frontend/CompilerInstance.h>
7
8namespace ReflectiveRapidJSON {
9
10class CodeFactory;
11
15class Visitor : public clang::RecursiveASTVisitor<Visitor> {
16public:
17 explicit Visitor(CodeFactory &factory);
18 bool VisitDecl(clang::Decl *decl);
19 bool VisitFunctionDecl(clang::FunctionDecl *func);
20 bool VisitStmt(clang::Stmt *st);
21 bool VisitNamespaceDecl(clang::NamespaceDecl *decl);
22 bool VisitCXXRecordDecl(clang::CXXRecordDecl *decl);
23
24private:
25 CodeFactory &m_factory;
26};
27
28} // namespace ReflectiveRapidJSON
29
30#endif // REFLECTIVE_RAPIDJSON_VISITOR_H
The CodeFactory class produces additional (reflection) code for a specified list of C++ source files.
Definition codefactory.h:27
bool VisitCXXRecordDecl(clang::CXXRecordDecl *decl)
Visits classes and class templates.
Definition visitor.cpp:62
bool VisitDecl(clang::Decl *decl)
Adds any kind of declaration to the factory.
Definition visitor.cpp:25
Visitor(CodeFactory &factory)
Constructs a new Visitor.
Definition visitor.cpp:17
bool VisitNamespaceDecl(clang::NamespaceDecl *decl)
Visits namespace declarations.
Definition visitor.cpp:53
bool VisitStmt(clang::Stmt *st)
Visits statements.
Definition visitor.cpp:44
bool VisitFunctionDecl(clang::FunctionDecl *func)
Visits function declarations.
Definition visitor.cpp:35