stage3/print_datatypes_error.cc
changeset 470 d2cd05c5e01a
parent 459 01f6664bf8c5
child 476 38d85e9a0507
equal deleted inserted replaced
469:9fe6c4633ed6 470:d2cd05c5e01a
   860 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'STN' operator.");
   860 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'STN' operator.");
   861 	return NULL;
   861 	return NULL;
   862 }
   862 }
   863 
   863 
   864 void *print_datatypes_error_c::visit(NOT_operator_c *symbol) {
   864 void *print_datatypes_error_c::visit(NOT_operator_c *symbol) {
       
   865 	/* NOTE: the standard allows syntax in which the NOT operator is followed by an optional <il_operand>
       
   866 	 *              NOT [<il_operand>]
       
   867 	 *       However, it does not define the semantic of the NOT operation when the <il_operand> is specified.
       
   868 	 *       We therefore consider it an error if an il_operand is specified!
       
   869 	 */
       
   870 	if (il_operand != NULL)
       
   871 		STAGE3_ERROR(0, symbol, symbol, "'NOT' operator may not have an operand.");
       
   872 	if (symbol->candidate_datatypes.size() == 0)
       
   873 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'NOT' operator.");
   865 	return NULL;
   874 	return NULL;
   866 }
   875 }
   867 
   876 
   868 void *print_datatypes_error_c::visit(S_operator_c *symbol) {
   877 void *print_datatypes_error_c::visit(S_operator_c *symbol) {
   869   /* TODO: what if this is a FB call ?? */
   878   /* TODO: what if this is a FB call ?? */