Spicy
type.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/expression.h>
8 #include <hilti/ast/types/type.h>
9 
10 namespace hilti::expression {
11 
13 class Type_ : public NodeBase, public trait::isExpression {
14 public:
15  Type_(Type t, const Meta& m = Meta()) : NodeBase(nodes(type::Type_(std::move(t), m)), m) {}
16 
17  const auto& typeValue() const { return child<type::Type_>(0).typeValue(); }
18 
19  bool operator==(const Type_& other) const { return typeValue() == other.typeValue(); }
20 
22  bool isLhs() const { return false; }
24  bool isTemporary() const { return true; }
26  const auto& type() const { return child<Type>(0); }
28  auto isConstant() const { return true; }
30  auto isEqual(const Expression& other) const { return node::isEqual(this, other); }
31 
33  auto properties() const { return node::Properties{}; }
34 };
35 
36 } // namespace hilti::expression
Definition: type.h:13
bool isLhs() const
Definition: type.h:22
auto isEqual(const Expression &other) const
Definition: type.h:30
Definition: expression.h:18
auto properties() const
Definition: type.h:33
bool isTemporary() const
Definition: type.h:24
Definition: meta.h:19
Definition: type.h:160
const auto & type() const
Definition: type.h:26
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:98
Definition: type.h:13
auto isConstant() const
Definition: type.h:28
Definition: node.h:360
Definition: expression.h:21