-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathnamespace_matcher.cpp
More file actions
50 lines (34 loc) · 1.43 KB
/
namespace_matcher.cpp
File metadata and controls
50 lines (34 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
Copyright 2018 Adobe
All Rights Reserved.
NOTICE: Adobe permits you to use, modify, and distribute this file in
accordance with the terms of the Adobe license agreement accompanying
it. If you have received this file from a source other than Adobe,
then your use, modification, or distribution of it requires the prior
written permission of Adobe.
*/
// identity
#include "namespace_matcher.hpp"
// stdc++
#include <iostream>
// clang
#include "clang/AST/ASTConsumer.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/ASTMatchers/ASTMatchers.h"
// application
#include "json.hpp"
#include "matchers/utilities.hpp"
using namespace clang;
using namespace clang::ast_matchers;
/**************************************************************************************************/
namespace hyde {
/**************************************************************************************************/
void NamespaceInfo::run(const MatchFinder::MatchResult& Result) {
auto ns = Result.Nodes.getNodeAs<NamespaceDecl>("ns");
if (!PathCheck(_paths, ns, Result.Context)) return;
if (!AccessCheck(_access_filter, ns->getAccess())) return;
_j["namespaces"].push_back(StandardDeclInfo(Result.Context, ns));
}
/**************************************************************************************************/
} // namespace hyde
/**************************************************************************************************/