stage3/fill_candidate_datatypes.cc
changeset 936 0f7bcc160568
parent 935 be4373d07201
child 938 31e3b3f2eff1
equal deleted inserted replaced
935:be4373d07201 936:0f7bcc160568
  1904   
  1904   
  1905   return NULL;
  1905   return NULL;
  1906 }
  1906 }
  1907 
  1907 
  1908 
  1908 
       
  1909 /* 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! */
       
  1910 void *fill_candidate_datatypes_c::visit(deref_operator_c  *symbol) {
       
  1911   symbol->exp->accept(*this);
       
  1912 
       
  1913   for (unsigned int i = 0; i < symbol->exp->candidate_datatypes.size(); i++) {
       
  1914     /* Determine whether the datatype is a ref_spec_c, as this is the class used as the    */
       
  1915     /* canonical/base datatype of REF_TO types (see search_base_type_c ...)                */ 
       
  1916     ref_spec_c *ref_spec = dynamic_cast<ref_spec_c *>(symbol->exp->candidate_datatypes[i]);
       
  1917     
       
  1918     if (NULL != ref_spec)
       
  1919       add_datatype_to_candidate_list(symbol, search_base_type_c::get_basetype_decl(ref_spec->type_name));
       
  1920   }
       
  1921   
       
  1922   return NULL;
       
  1923 }
       
  1924 
       
  1925 
  1909 /* 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! */
  1926 /* 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! */
  1910 void *fill_candidate_datatypes_c::visit(  ref_expression_c  *symbol) {
  1927 void *fill_candidate_datatypes_c::visit(  ref_expression_c  *symbol) {
  1911   /* We must first determine the datatype of the expression passed to the REF() operator, with no ambiguities! 
  1928   /* We must first determine the datatype of the expression passed to the REF() operator, with no ambiguities! 
  1912    * To do this, we could use the complete standard fill/narrow algorithm for determining the datatype
  1929    * To do this, we could use the complete standard fill/narrow algorithm for determining the datatype
  1913    * of the expression. This is actually possible, as nothing stops us from directly calling the narrow_candidate_datatypes_c
  1930    * of the expression. This is actually possible, as nothing stops us from directly calling the narrow_candidate_datatypes_c