stage3/narrow_candidate_datatypes.cc
changeset 873 dea39ef02847
parent 854 13d0b67de111
child 889 5f380b99e95e
equal deleted inserted replaced
872:3d682f87c870 873:dea39ef02847
  1335 /* B.3 - Language ST (Structured Text) */
  1335 /* B.3 - Language ST (Structured Text) */
  1336 /***************************************/
  1336 /***************************************/
  1337 /***********************/
  1337 /***********************/
  1338 /* B 3.1 - Expressions */
  1338 /* B 3.1 - Expressions */
  1339 /***********************/
  1339 /***********************/
       
  1340 /* 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! */
       
  1341 void *narrow_candidate_datatypes_c::visit(  ref_expression_c  *symbol) {
       
  1342   if (symbol->exp->candidate_datatypes.size() > 0) {
       
  1343     symbol->exp->datatype = symbol->exp->candidate_datatypes[0]; /* just use the first possible datatype */
       
  1344     symbol->exp->accept(*this);
       
  1345   }
       
  1346   return NULL;
       
  1347 }
       
  1348 
       
  1349 
       
  1350 
  1340 /* allow_enums is FALSE by default!!
  1351 /* allow_enums is FALSE by default!!
  1341  * deprecated_operation is NULL by default!!
  1352  * deprecated_operation is NULL by default!!
  1342  * if (allow_enums) then consider that we are ectually processing an equ_expression or notequ_expression, where two enums of the same data type may also be legally compared 
  1353  * if (allow_enums) then consider that we are ectually processing an equ_expression or notequ_expression, where two enums of the same data type may also be legally compared 
  1343  *  e.g.      symbol := l_expr == r_expr              
  1354  *  e.g.      symbol := l_expr == r_expr              
  1344  *            symbol := l_expr != r_expr
  1355  *            symbol := l_expr != r_expr