Spicy
ctor.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/ast/ctor.h>
8 #include <hilti/ast/expression.h>
9 
10 namespace hilti {
11 namespace expression {
12 
14 class Ctor : public NodeBase, public trait::isExpression {
15 public:
16  Ctor(hilti::Ctor c, Meta m = Meta()) : NodeBase({std::move(c)}, std::move(m)) {}
17 
18  const auto& ctor() const { return child<::hilti::Ctor>(0); }
19 
20  bool operator==(const Ctor& other) const { return ctor() == other.ctor(); }
21 
23  bool isLhs() const { return ctor().isLhs(); }
25  bool isTemporary() const { return ctor().isTemporary(); }
27  auto type() const { return type::effectiveType(ctor().type()); }
29  auto isConstant() const { return ctor().isConstant(); }
31  auto isEqual(const Expression& other) const { return node::isEqual(this, other); }
32 
34  auto properties() const { return node::Properties{}; }
35 };
36 
37 } // namespace expression
38 } // namespace hilti
auto type() const
Definition: ctor.h:27
Definition: expression.h:16
Definition: meta.h:18
bool isTemporary() const
Definition: ctor.h:25
auto properties() const
Definition: ctor.h:34
auto isConstant() const
Definition: ctor.h:29
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:83
Definition: ctor.h:14
auto isEqual(const Expression &other) const
Definition: ctor.h:31
bool isLhs() const
Definition: ctor.h:23
Definition: node.h:318