stage3/print_datatypes_error.cc
changeset 933 76324f461aed
parent 895 f824bf8e1579
child 936 0f7bcc160568
equal deleted inserted replaced
932:061824c45a5b 933:76324f461aed
  1042 /* B.3 - Language ST (Structured Text) */
  1042 /* B.3 - Language ST (Structured Text) */
  1043 /***************************************/
  1043 /***************************************/
  1044 /***********************/
  1044 /***********************/
  1045 /* B 3.1 - Expressions */
  1045 /* B 3.1 - Expressions */
  1046 /***********************/
  1046 /***********************/
       
  1047 /* SYM_REF1(deref_expression_c, exp)  --> an extension to the IEC 61131-3 standard - based on the IEC 61131-3 v3 standard. Returns address of the varible! */
       
  1048 void *print_datatypes_error_c::visit(deref_expression_c  *symbol) {
       
  1049 	symbol->exp->accept(*this);
       
  1050 	/* we should really check whether the expression is merely a variable. For now, leave it for the future! */
       
  1051 	if ((symbol->candidate_datatypes.size() == 0) && (symbol->exp->candidate_datatypes.size() > 0))
       
  1052 		STAGE3_ERROR(0, symbol, symbol, "DREF operator must be used with a value of type REF_TO.");
       
  1053 	return NULL;
       
  1054 }
       
  1055 
  1047 /* 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! */
  1056 /* 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! */
  1048 void *print_datatypes_error_c::visit(  ref_expression_c  *symbol) {
  1057 void *print_datatypes_error_c::visit(  ref_expression_c  *symbol) {
  1049 	symbol->exp->accept(*this);
  1058 	symbol->exp->accept(*this);
  1050 	/* we should really check whether the expression is merely a variable. For now, leave it for the future! */
  1059 	/* we should really check whether the expression is merely a variable. For now, leave it for the future! */
  1051 	if ((symbol->candidate_datatypes.size() == 0) && (symbol->exp->candidate_datatypes.size() > 0))
  1060 	if ((symbol->candidate_datatypes.size() == 0) && (symbol->exp->candidate_datatypes.size() > 0))