stage3/print_datatypes_error.cc
changeset 936 0f7bcc160568
parent 933 76324f461aed
child 958 7474d2cd1d6e
equal deleted inserted replaced
935:be4373d07201 936:0f7bcc160568
  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_operator_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_operator_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, "^ operator must be preceded by a value of type REF_TO.");
       
  1053 	return NULL;
       
  1054 }
       
  1055 
  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! */
  1056 /* 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) {
  1057 void *print_datatypes_error_c::visit(deref_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))