stage3/fill_candidate_datatypes.cc
changeset 936 0f7bcc160568
parent 935 be4373d07201
child 938 31e3b3f2eff1
--- a/stage3/fill_candidate_datatypes.cc	Sun Sep 28 17:48:42 2014 +0100
+++ b/stage3/fill_candidate_datatypes.cc	Sun Oct 19 08:36:49 2014 +0100
@@ -1906,6 +1906,23 @@
 }
 
 
+/* SYM_REF1(deref_operator_c, exp)  --> an extension to the IEC 61131-3 standard - based on the IEC 61131-3 v3 standard. Returns address of the varible! */
+void *fill_candidate_datatypes_c::visit(deref_operator_c  *symbol) {
+  symbol->exp->accept(*this);
+
+  for (unsigned int i = 0; i < symbol->exp->candidate_datatypes.size(); i++) {
+    /* Determine whether the datatype is a ref_spec_c, as this is the class used as the    */
+    /* canonical/base datatype of REF_TO types (see search_base_type_c ...)                */ 
+    ref_spec_c *ref_spec = dynamic_cast<ref_spec_c *>(symbol->exp->candidate_datatypes[i]);
+    
+    if (NULL != ref_spec)
+      add_datatype_to_candidate_list(symbol, search_base_type_c::get_basetype_decl(ref_spec->type_name));
+  }
+  
+  return NULL;
+}
+
+
 /* SYM_REF1(ref_expression_c, exp)  --> an extension to the IEC 61131-3 standard - based on the IEC 61131-3 v3 standard. Returns address of the varible! */
 void *fill_candidate_datatypes_c::visit(  ref_expression_c  *symbol) {
   /* We must first determine the datatype of the expression passed to the REF() operator, with no ambiguities!