9 #include <hilti/ast/ctor.h> 10 #include <hilti/ast/expression.h> 11 #include <hilti/ast/id.h> 12 #include <hilti/ast/types/struct.h> 19 using Field = std::pair<ID, Expression>;
26 :
NodeBase(nodes(type::unknown, std::move(f)), std::move(m)) {}
28 :
NodeBase(nodes(std::move(t), std::move(f)), std::move(m)) {}
31 auto ids()
const {
return childsOfType<ID>(); }
34 auto values()
const {
return childsOfType<Expression>(); }
40 std::optional<struct_::Field>
field(
const ID&
id)
const {
41 for (
auto f : fields() ) {
49 bool operator==(
const Struct& other)
const {
return ids() == other.
ids() && values() == other.
values(); }
53 if (
auto t = childs()[0].as<Type>(); ! t.isA<
type::Unknown>() )
54 return type::effectiveType(t);
65 auto isLhs()
const {
return false; }
69 auto isEqual(
const Ctor& other)
const {
return node::isEqual(
this, other); }
Type type() const
Definition: struct.h:52
auto isEqual(const Ctor &other) const
Definition: struct.h:69
auto values() const
Definition: struct.h:34
auto fields() const
Definition: struct.h:37
std::optional< struct_::Field > field(const ID &id) const
Definition: struct.h:40
std::list< std::pair< A, B > > zip2(const std::list< A > &lhs, const std::list< B > &rhs)
Definition: util.h:475
auto isLhs() const
Definition: struct.h:65
auto ids() const
Definition: struct.h:31
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:83
auto isTemporary() const
Definition: struct.h:67
auto properties() const
Definition: struct.h:72
auto transform(const std::vector< X > &x, F f)
Definition: util.h:86
bool isConstant() const
Definition: struct.h:63