1030 /* B.3 - Language ST (Structured Text) */ |
1030 /* B.3 - Language ST (Structured Text) */ |
1031 /***************************************/ |
1031 /***************************************/ |
1032 /***********************/ |
1032 /***********************/ |
1033 /* B 3.1 - Expressions */ |
1033 /* B 3.1 - Expressions */ |
1034 /***********************/ |
1034 /***********************/ |
|
1035 /* 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! */ |
|
1036 void *print_datatypes_error_c::visit( ref_expression_c *symbol) { |
|
1037 symbol->exp->accept(*this); |
|
1038 /* we should really check whether the expression is merely a variable. For now, leave it for the future! */ |
|
1039 if ((symbol->candidate_datatypes.size() == 0) && (symbol->exp->candidate_datatypes.size() > 0)) |
|
1040 STAGE3_ERROR(0, symbol, symbol, "REF operator must be used with a variable."); |
|
1041 return NULL; |
|
1042 } |
|
1043 |
1035 |
1044 |
1036 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) { |
1045 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) { |
1037 l_expr->accept(*this); |
1046 l_expr->accept(*this); |
1038 r_expr->accept(*this); |
1047 r_expr->accept(*this); |
1039 if ((symbol->candidate_datatypes.size() == 0) && |
1048 if ((symbol->candidate_datatypes.size() == 0) && |