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 {
11 namespace expression {
12 
14 class Type_ : public NodeBase, public trait::isExpression {
15 public:
16  Type_(Type t, Meta m = Meta()) : NodeBase({std::move(t)}, std::move(m)) {}
17 
18  auto typeValue() const { return type::effectiveType(child<Type>(0)); }
19 
20  bool operator==(const Type_& other) const { return typeValue() == other.typeValue(); }
21 
23  bool isLhs() const { return false; }
25  bool isTemporary() const { return true; }
27  auto type() const { return type::Type_(child<Type>(0)); }
29  auto isConstant() const { return true; }
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
Definition: type.h:14
bool isLhs() const
Definition: type.h:23
auto isEqual(const Expression &other) const
Definition: type.h:31
Definition: expression.h:16
auto properties() const
Definition: type.h:34
bool isTemporary() const
Definition: type.h:25
auto type() const
Definition: type.h:27
Definition: meta.h:18
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:83
Definition: type.h:14
auto isConstant() const
Definition: type.h:29
Definition: node.h:318