Implement array access expressions

This commit is contained in:
2026-01-14 19:48:28 +01:00
parent 30e18517ab
commit cfef0550ca
3 changed files with 227 additions and 52 deletions

View File

@@ -2707,7 +2707,15 @@ begin
if parser_node^.kind = ElnaTreeKind.dereference_expression then
dereference_expression := parser_node;
first_instruction := elna_tac_designator(dereference_expression^.pointer, symbol_table, is_address, operand_type, operand_value, operand_length);
is_address^ := 1
if is_address^ = 1 then
last_instruction := _elna_tac_instruction_create(ElnaTacOperator.load);
_elna_tac_instruction_set_operand(last_instruction, 1, operand_type^, operand_value^, operand_length^);
_elna_tac_instruction_set_operand(last_instruction, 2, operand_type^, operand_value^, operand_length^);
first_instruction := elna_instruction_list_concatenate(first_instruction, last_instruction)
else
is_address^ := 1
end
elsif parser_node^.kind = ElnaTreeKind.field_access_expression then
field_access_expression := parser_node;
expression_type := field_access_expression^.type_decoration;