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(nodes(type::Address(m)), 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  const auto& type() const { return child<Type>(0); }
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); }
36 
38  auto properties() const { return node::Properties{{"address", to_string(_address)}}; }
39 
40 private:
41  Value _address;
42 };
43 
44 } // namespace ctor
45 } // namespace hilti
bool isConstant() const
Definition: address.h:29
Definition: address.h:13
Definition: meta.h:18
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:99
Definition: address.h:24
Definition: ctor.h:15
Definition: address.h:16
auto isLhs() const
Definition: address.h:31
auto properties() const
Definition: address.h:38
const auto & type() const
Definition: address.h:27
Definition: node.h:358