7 #include <hilti/ast/expression.h> 10 namespace expression {
15 Ternary(Expression cond, Expression true_, Expression false_,
Meta m =
Meta())
16 :
NodeBase({std::move(cond), std::move(true_), std::move(false_)}, std::move(m)) {}
18 const auto& condition()
const {
return child<Expression>(0); }
19 const auto& true_()
const {
return child<Expression>(1); }
20 const auto& false_()
const {
return child<Expression>(2); }
22 bool operator==(
const Ternary& other)
const {
23 return condition() == other.condition() && true_() == other.true_() && false_() == other.false_();
27 bool isLhs()
const {
return false; }
29 bool isTemporary()
const {
return true_().isTemporary() || false_().isTemporary(); }
32 return true_().type();
37 auto isEqual(
const Expression& other)
const {
return node::isEqual(
this, other); }
Type type() const
Definition: ternary.h:31
auto isEqual(const Expression &other) const
Definition: ternary.h:37
bool isTemporary() const
Definition: ternary.h:29
bool isLhs() const
Definition: ternary.h:27
Definition: expression.h:16
auto properties() const
Definition: ternary.h:40
auto isConstant() const
Definition: ternary.h:35
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:83