9 #include <unordered_map> 13 #include <hilti/ast/node-ref.h> 14 #include <hilti/base/intrusive-ptr.h> 32 void insertNotFound(
ID id);
35 bool has(
const ID&
id)
const {
return ! _findID(
id).empty(); }
45 std::vector<Referee>
lookupAll(
const ID&
id)
const {
return _findID(
id); }
48 std::optional<Referee>
lookup(
const ID&
id)
const {
49 if (
auto ids = _findID(
id); ! ids.empty() )
56 void clear() { _items.clear(); }
59 const auto&
items()
const {
return _items; }
67 void render(std::ostream& out,
const std::string& prefix =
"")
const;
75 using ItemMap = std::map<std::string, std::vector<NodeRef>>;
77 std::vector<Referee> _findID(
const ID&
id,
bool external =
false)
const;
78 std::vector<Referee> _findID(
const Scope* scope,
const ID&
id,
bool external =
false)
const;
bool has(const ID &id) const
Definition: scope.h:35
Definition: intrusive-ptr.h:28
NodeRef node
Definition: scope.h:39
const auto & items() const
Definition: scope.h:59
std::optional< Referee > lookup(const ID &id) const
Definition: scope.h:48
std::string qualified
Definition: scope.h:40
void clear()
Definition: scope.h:56
Definition: node-ref.h:44
void render(std::ostream &out, const std::string &prefix="") const
Definition: scope.cc:100
std::vector< Referee > lookupAll(const ID &id) const
Definition: scope.h:45
bool external
Definition: scope.h:41