CppParser
|
#include <cppvisitormatcher.h>
Public Member Functions | |
CppVisitorMatcher (const std::vector< CppObjType > &typesToMatch) | |
The only ctor of the class. More... | |
CppVisitorMatcher (const std::vector< CppObjType > &typesToMatch, MatchedFuncType &&matchedFunc) | |
virtual bool | matched (CppObj *p) |
The virtual method to be called when a tree node is matched. More... | |
~CppVisitorMatcher () override=default | |
![]() | |
virtual | ~CppVisitorBase ()=default |
virtual bool | visit (CppVarType *p)=0 |
The visitor pattern's visit methods for the given types. More... | |
virtual bool | visit (CppCompound *p)=0 |
virtual bool | visit (CppUnRecogPrePro *p)=0 |
virtual bool | visit (CppUndef *p)=0 |
virtual bool | visit (CppUsingDecl *p)=0 |
virtual bool | visit (CppUsingNamespaceDecl *p)=0 |
virtual bool | visit (CppVar *p)=0 |
virtual bool | visit (CppVarList *p)=0 |
virtual bool | visit (CppCommonBlock< CppObjType::kIfBlock > *p)=0 |
virtual bool | visit (CppCommonBlock< CppObjType::kWhileBlock > *p)=0 |
virtual bool | visit (CppCommonBlock< CppObjType::kDoWhileBlock > *p)=0 |
virtual bool | visit (CppAsmBlock *p)=0 |
virtual bool | visit (CppBlob *p)=0 |
virtual bool | visit (CppDefine *p)=0 |
virtual bool | visit (CppDocComment *p)=0 |
virtual bool | visit (CppEnum *p)=0 |
virtual bool | visit (CppExpr *p)=0 |
virtual bool | visit (CppForBlock *p)=0 |
virtual bool | visit (CppLambda *p)=0 |
virtual bool | visit (CppDestructor *p)=0 |
virtual bool | visit (CppConstructor *p)=0 |
virtual bool | visit (CppFunction *p)=0 |
virtual bool | visit (CppFunctionPointer *p)=0 |
virtual bool | visit (CppTypeConverter *p)=0 |
virtual bool | visit (CppFwdClsDecl *p)=0 |
virtual bool | visit (CppHashError *p)=0 |
virtual bool | visit (CppHashIf *p)=0 |
virtual bool | visit (CppHashWarning *p)=0 |
virtual bool | visit (CppImport *p)=0 |
virtual bool | visit (CppInclude *p)=0 |
virtual bool | visit (CppLabel *p)=0 |
virtual bool | visit (CppMacroCall *p)=0 |
virtual bool | visit (CppNamespaceAlias *p)=0 |
virtual bool | visit (CppPragma *p)=0 |
virtual bool | visit (CppRangeForBlock *p)=0 |
virtual bool | visit (CppSwitchBlock *p)=0 |
virtual bool | visit (CppTryBlock *p)=0 |
virtual bool | visit (CppTypedefList *p)=0 |
virtual bool | visit (CppTypedefName *p)=0 |
Protected Member Functions | |
bool | visit (CppVarType *p) override |
The visitor pattern's visit methods for the given types. More... | |
bool | visit (CppCompound *p) override |
bool | visit (CppUnRecogPrePro *p) override |
bool | visit (CppUndef *p) override |
bool | visit (CppUsingDecl *p) override |
bool | visit (CppUsingNamespaceDecl *p) override |
bool | visit (CppVar *p) override |
bool | visit (CppVarList *p) override |
bool | visit (CppCommonBlock< CppObjType::kIfBlock > *p) override |
bool | visit (CppCommonBlock< CppObjType::kWhileBlock > *p) override |
bool | visit (CppCommonBlock< CppObjType::kDoWhileBlock > *p) override |
bool | visit (CppAsmBlock *p) override |
bool | visit (CppBlob *p) override |
bool | visit (CppDefine *p) override |
bool | visit (CppDocComment *p) override |
bool | visit (CppEnum *p) override |
bool | visit (CppExpr *p) override |
bool | visit (CppForBlock *p) override |
bool | visit (CppLambda *p) override |
bool | visit (CppDestructor *p) override |
bool | visit (CppConstructor *p) override |
bool | visit (CppFunction *p) override |
bool | visit (CppFunctionPointer *p) override |
bool | visit (CppTypeConverter *p) override |
bool | visit (CppFwdClsDecl *p) override |
bool | visit (CppHashError *p) override |
bool | visit (CppHashIf *p) override |
bool | visit (CppHashWarning *p) override |
bool | visit (CppImport *p) override |
bool | visit (CppInclude *p) override |
bool | visit (CppLabel *p) override |
bool | visit (CppMacroCall *p) override |
bool | visit (CppNamespaceAlias *p) override |
bool | visit (CppPragma *p) override |
bool | visit (CppRangeForBlock *p) override |
bool | visit (CppSwitchBlock *p) override |
bool | visit (CppTryBlock *p) override |
bool | visit (CppTypedefList *p) override |
bool | visit (CppTypedefName *p) override |
Private Types | |
using | MatchedFuncType = std::function< bool(CppObj *p)> |
Private Member Functions | |
bool | check (CppObj *p) |
Checks the given pointer to the current AST node against the node types that are to be matched. More... | |
Private Attributes | |
const std::vector< CppObjType > | typesToMatch |
MatchedFuncType | matchedFunc |
Definition at line 19 of file cppvisitormatcher.h.
|
private |
Definition at line 21 of file cppvisitormatcher.h.
|
inlineexplicit |
The only ctor of the class.
typesToMatch | A vector of the AST node types that are to be matched. |
Definition at line 30 of file cppvisitormatcher.h.
|
inlineexplicit |
Definition at line 38 of file cppvisitormatcher.h.
|
overridedefault |
|
inlineprivate |
Checks the given pointer to the current AST node against the node types that are to be matched.
Calls the match
method when a node is matched and returns the value returned by that method to enforce user's choice for an early abortion of traversing the rest of the AST.
p | A pointer to an AST node. |
Definition at line 66 of file cppvisitormatcher.h.
|
inlinevirtual |
The virtual method to be called when a tree node is matched.
Override this method to implement your very own AST-matcher.
p | A pointer to the matched AST node. |
Definition at line 50 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 120 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 124 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 116 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 108 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 112 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 80 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 156 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 128 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 152 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 132 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 136 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 140 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 144 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 160 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 164 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 172 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 176 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 180 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 184 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 188 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 192 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 196 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 148 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 200 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 204 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 208 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 212 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 216 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 220 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 168 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 224 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 228 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 88 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 84 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 92 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 96 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 100 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
Implements CppVisitorBase.
Definition at line 104 of file cppvisitormatcher.h.
|
inlineoverrideprotectedvirtual |
The visitor pattern's visit
methods for the given types.
p | A pointer to the matched AST node. |
Implements CppVisitorBase.
Definition at line 76 of file cppvisitormatcher.h.
|
private |
Definition at line 23 of file cppvisitormatcher.h.
|
private |
Definition at line 22 of file cppvisitormatcher.h.