stage3/print_datatypes_error.cc
changeset 873 dea39ef02847
parent 848 db78824cec23
child 895 f824bf8e1579
--- a/stage3/print_datatypes_error.cc	Mon Feb 24 22:00:55 2014 +0000
+++ b/stage3/print_datatypes_error.cc	Sun Mar 02 16:42:56 2014 +0000
@@ -1032,6 +1032,15 @@
 /***********************/
 /* B 3.1 - Expressions */
 /***********************/
+/* 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! */
+void *print_datatypes_error_c::visit(  ref_expression_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, "REF operator must be used with a variable.");
+	return NULL;
+}
+    
 
 void *print_datatypes_error_c::print_binary_expression_errors(const char *operation, symbol_c *symbol, symbol_c *l_expr, symbol_c *r_expr, bool deprecated_operation) {
 	l_expr->accept(*this);