7 #include <hilti/ast/expression.h> 8 #include <hilti/ast/types/computed.h> 11 namespace expression {
45 :
NodeBase(nodes(std::move(e), std::move(t)), std::move(m)), _validate_type_match(
true) {}
48 :
NodeBase(nodes(std::move(e)), std::move(m)), _type_node_ref(std::move(t)) {}
51 :
NodeBase(nodes(std::move(e)), std::move(m)), _validate_type_match(
true), _type_node_ref(std::move(t)) {}
53 const auto& expression()
const {
return child<Expression>(0); }
54 bool validateTypeMatch()
const {
return _validate_type_match; }
57 return expression() == other.expression() &&
type() == other.
type();
61 bool isLhs()
const {
return expression().isLhs(); }
63 bool isTemporary()
const {
return expression().isTemporary(); }
67 return _type_node_ref->template as<Type>();
69 if (
auto t =
childs()[1].tryAs<Type>() ) {
70 if ( t->template isA<type::Computed>() )
75 return type::effectiveType(*t);
82 auto isConstant()
const {
return expression().isConstant(); }
84 auto isEqual(
const Expression& other)
const {
return node::isEqual(
this, other); }
90 bool _validate_type_match =
false;
Definition: type-wrapped.h:38
auto & childs() const
Definition: node.h:445
const Node none
Definition: node.cc:12
Type type() const
Definition: type-wrapped.h:65
Definition: computed.h:28
Definition: expression.h:16
auto properties() const
Definition: type-wrapped.h:87
Definition: type-wrapped.h:36
auto isConstant() const
Definition: type-wrapped.h:82
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:83
bool isLhs() const
Definition: type-wrapped.h:61
Definition: node_ref.h:44
auto isEqual(const Expression &other) const
Definition: type-wrapped.h:84
bool isTemporary() const
Definition: type-wrapped.h:63
auto & meta() const
Definition: node.h:449