91 */ |
91 */ |
92 void lvalue_check_c::check_assignment_to_output(symbol_c *lvalue) { |
92 void lvalue_check_c::check_assignment_to_output(symbol_c *lvalue) { |
93 decompose_var_instance_name_c decompose_lvalue(lvalue); |
93 decompose_var_instance_name_c decompose_lvalue(lvalue); |
94 search_base_type_c search_base_type; |
94 search_base_type_c search_base_type; |
95 |
95 |
|
96 /* Get the first element/record of the potentially structured variable symbol */ |
|
97 /* Note that if symbol is pointing to an expression (or simply a literal value), it will return a NULL. |
|
98 * Once we have implemented the check_assignment_to_expression() method, and abort calling the other checks (including this one) |
|
99 * when an expression is found, we may replace this check with an assertion... |
|
100 * if (NULL == struct_elem) ERROR; |
|
101 */ |
96 symbol_c *struct_elem = decompose_lvalue.next_part(); |
102 symbol_c *struct_elem = decompose_lvalue.next_part(); |
97 if (NULL == struct_elem) return; |
103 if (NULL == struct_elem) return; |
|
104 |
98 symbol_c *type_decl = search_var_instance_decl->get_decl(struct_elem); |
105 symbol_c *type_decl = search_var_instance_decl->get_decl(struct_elem); |
99 // symbol_c *type_id = spec_init_sperator_c::get_spec(type_decl); /* this is not required! search_base_type_c can handle spec_init symbols! */ |
106 // symbol_c *type_id = spec_init_sperator_c::get_spec(type_decl); /* this is not required! search_base_type_c can handle spec_init symbols! */ |
100 symbol_c *basetype_id = search_base_type.get_basetype_id(/*type_id*/ type_decl); |
107 symbol_c *basetype_id = search_base_type.get_basetype_id(/*type_id*/ type_decl); |
101 /* If we can not determine the data type of the element, then the code must have a data type semantic error. |
108 /* If we can not determine the data type of the element, then the code must have a data type semantic error. |
102 * This will have been caught by the data type semantic verifier, so we do not bother with this anymore! |
109 * This will have been caught by the data type semantic verifier, so we do not bother with this anymore! |