stage3/print_datatypes_error.cc
changeset 936 0f7bcc160568
parent 933 76324f461aed
child 958 7474d2cd1d6e
--- a/stage3/print_datatypes_error.cc	Sun Sep 28 17:48:42 2014 +0100
+++ b/stage3/print_datatypes_error.cc	Sun Oct 19 08:36:49 2014 +0100
@@ -1044,6 +1044,15 @@
 /***********************/
 /* B 3.1 - Expressions */
 /***********************/
+/* 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 *print_datatypes_error_c::visit(deref_operator_c  *symbol) {
+	symbol->exp->accept(*this);
+	/* we should really check whether the expression is merely a variable. For now, leave it for the future! */
+	if ((symbol->candidate_datatypes.size() == 0) && (symbol->exp->candidate_datatypes.size() > 0))
+		STAGE3_ERROR(0, symbol, symbol, "^ operator must be preceded by a value of type REF_TO.");
+	return NULL;
+}
+
 /* 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! */
 void *print_datatypes_error_c::visit(deref_expression_c  *symbol) {
 	symbol->exp->accept(*this);