17 #define impl_afw_value_optional_release NULL
18 #define impl_afw_value_get_reference NULL
20 #define impl_afw_value_get_evaluated_metas \
21 afw_value_internal_get_evaluated_metas_default
24 #define AFW_IMPLEMENTATION_ID "assignment_target"
25 #define AFW_IMPLEMENTATION_INF_SPECIFIER AFW_DEFINE_CONST_DATA
26 #define AFW_IMPLEMENTATION_INF_LABEL afw_value_assignment_target_inf
38 impl_assignment_types[] = {
39 #define XX(id, description) \
40 { AFW_UTF8_LITERAL(AFW_STRINGIFY(id)), \
41 AFW_UTF8_LITERAL(description) \
61 result->contextual = contextual;
62 result->assignment_target = assignment_target;
81 if (self->assignment_target->target_type ==
82 afw_compile_assignment_target_type_variable_reference)
84 return (
const afw_value_t *)
self->assignment_target->variable_reference;
94 impl_afw_value_get_data_type(
105 impl_afw_value_get_evaluated_data_type(
117 impl_afw_value_get_evaluated_data_type_parameter(
140 impl_assignment_element_produce_compiler_listing(
145 afw_value_compiler_listing_begin_value(writer, NULL, NULL, xctx);
150 if (self->assignment_target) {
158 if (self->default_value) {
170 impl_assignment_property_produce_compiler_listing(
175 afw_value_compiler_listing_begin_value(writer, NULL, NULL, xctx);
176 if (self->is_rename) {
185 impl_assignment_element_produce_compiler_listing(
186 self->assignment_element, writer, xctx);
194 (
const afw_value_t *)self->variable_reference, writer, xctx);
196 if (self->default_value) {
209 impl_list_destructure_produce_compiler_listing(
216 afw_value_compiler_listing_begin_value(writer, NULL, NULL, xctx);
221 for (ae = self->assignment_element; ae; ae = ae->next) {
222 impl_assignment_element_produce_compiler_listing(ae, writer, xctx);
237 impl_object_destructure_produce_compiler_listing(
244 afw_value_compiler_listing_begin_value(writer, NULL, NULL, xctx);
249 for (ap = self->assignment_property; ap; ap = ap->next) {
250 impl_assignment_property_produce_compiler_listing(ap, writer, xctx);
268 impl_afw_value_produce_compiler_listing(
276 afw_value_compiler_listing_begin_value(writer, instance,
277 self->contextual, xctx);
280 &impl_assignment_types[self->assignment_target->assignment_type].id,
286 switch (self->assignment_target->target_type) {
287 case afw_compile_assignment_target_type_list_destructure:
288 impl_list_destructure_produce_compiler_listing(
289 self->assignment_target->list_destructure, writer, xctx);
292 case afw_compile_assignment_target_type_object_destructure:
293 impl_object_destructure_produce_compiler_listing(
294 self->assignment_target->object_destructure, writer, xctx);
297 case afw_compile_assignment_target_type_variable_reference:
299 (
const afw_value_t *)self->assignment_target->variable_reference,
303 case afw_compile_assignment_target_type_max_type:
317 impl_afw_value_decompile(
323 "Decompile is not supported for assignment target.",
331 impl_afw_value_get_info(
341 info->value_inf_id = &instance->inf->rti.implementation_id;
342 info->contextual =
self->contextual;
AFW_DEFINE(const afw_object_t *)
Adaptive Framework Core Internal.
Interface afw_interface implementation declares.
#define AFW_COMPILE_INTERNAL_ASSIGNMENT_TYPE_MAP(XX)
Assignment type Map.
#define AFW_THROW_ERROR_Z(code, message_z, xctx)
Macro used to set error and 0 rv in xctx and throw it.
#define afw_memory_clear(to)
Clear preallocated memory for sizeof(*(to)).
#define afw_pool_calloc_type(instance, type, xctx)
Macro to allocate cleared memory to hold type in pool.
const afw_value_t * impl_afw_value_get_evaluated_meta(const afw_value_t *instance, const afw_pool_t *p, afw_xctx_t *xctx)
const afw_value_t * impl_afw_value_optional_evaluate(const afw_value_t *instance, const afw_pool_t *p, afw_xctx_t *xctx)
#define afw_value_produce_compiler_listing(instance, writer, xctx)
Call method produce_compiler_listing of interface afw_value.
afw_value_assignment_target_inf
Value annotated inf.
afw_value_assignment_target_create(const afw_compile_value_contextual_t *contextual, const afw_compile_assignment_target_t *assignment_target, const afw_pool_t *p, afw_xctx_t *xctx)
Create assignment target value.
#define afw_writer_increment_indent(instance, xctx)
Call method increment_indent of interface afw_writer.
#define afw_writer_write_eol(instance, xctx)
Call method write_eol of interface afw_writer.
#define afw_writer_decrement_indent(instance, xctx)
Call method decrement_indent of interface afw_writer.
#define afw_writer_write_z(writer, s_z, xctx)
Call afw_writer_write() with zero terminated string.
#define afw_writer_write_utf8(writer, S, xctx)
Call afw_writer_write() with a afw_utf8_t string.
Contextual information provided in some values.
Interface afw_data_type public struct.
Interface afw_pool public struct.
NFC normalized UTF-8 string.
Struct for assignment target value.
Filled in by afw_value get_info method.
Interface afw_value public struct.
Interface afw_writer public struct.
Interface afw_xctx public struct.