Spicy
address.h
1 // Copyright (c) 2020-2021 by the Zeek Project. See LICENSE for details.
2 
3 #pragma once
4 
5 #include <utility>
6 
7 #include <hilti/rt/types/address.h>
8 
9 #include <hilti/ast/ctor.h>
10 #include <hilti/ast/types/address.h>
11 
12 namespace hilti {
13 namespace ctor {
14 
16 class Address : public NodeBase, public hilti::trait::isCtor {
17 public:
18  using Value = hilti::rt::Address;
19 
20  Address(const Value& addr, Meta m = Meta()) : NodeBase(std::move(m)), _address(addr) {}
21 
22  const auto& value() const { return _address; }
23 
24  bool operator==(const Address& other) const { return value() == other.value(); }
25 
27  auto type() const { return type::Address(meta()); }
29  bool isConstant() const { return true; }
31  auto isLhs() const { return false; }
33  auto isTemporary() const { return true; }
35  auto isEqual(const Ctor& other) const { return node::isEqual(this, other); }
37  auto properties() const { return node::Properties{{"address", to_string(_address)}}; }
38 
39 private:
40  Value _address;
41 };
42 
43 } // namespace ctor
44 } // namespace hilti
bool isConstant() const
Definition: address.h:29
Definition: address.h:13
Definition: meta.h:18
auto type() const
Definition: address.h:27
auto isTemporary() const
Definition: address.h:33
auto isEqual(const Ctor &other) const
Definition: address.h:35
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:83
Definition: address.h:24
Definition: ctor.h:15
Definition: address.h:16
auto & meta() const
Definition: node.h:449
auto isLhs() const
Definition: address.h:31
auto properties() const
Definition: address.h:37
Definition: node.h:318