stage3/narrow_candidate_datatypes.cc
changeset 490 29f6ab0bf954
parent 489 2c874cccbb44
child 502 a6211f73690b
equal deleted inserted replaced
489:2c874cccbb44 490:29f6ab0bf954
  1022 void *narrow_candidate_datatypes_c::visit(   add_expression_c *symbol) {return narrow_binary_expression(widen_ADD_table, symbol, symbol->l_exp, symbol->r_exp, &symbol->deprecated_operation);}
  1022 void *narrow_candidate_datatypes_c::visit(   add_expression_c *symbol) {return narrow_binary_expression(widen_ADD_table, symbol, symbol->l_exp, symbol->r_exp, &symbol->deprecated_operation);}
  1023 void *narrow_candidate_datatypes_c::visit(   sub_expression_c *symbol) {return narrow_binary_expression(widen_SUB_table, symbol, symbol->l_exp, symbol->r_exp, &symbol->deprecated_operation);}
  1023 void *narrow_candidate_datatypes_c::visit(   sub_expression_c *symbol) {return narrow_binary_expression(widen_SUB_table, symbol, symbol->l_exp, symbol->r_exp, &symbol->deprecated_operation);}
  1024 void *narrow_candidate_datatypes_c::visit(   mul_expression_c *symbol) {return narrow_binary_expression(widen_MUL_table, symbol, symbol->l_exp, symbol->r_exp, &symbol->deprecated_operation);}
  1024 void *narrow_candidate_datatypes_c::visit(   mul_expression_c *symbol) {return narrow_binary_expression(widen_MUL_table, symbol, symbol->l_exp, symbol->r_exp, &symbol->deprecated_operation);}
  1025 void *narrow_candidate_datatypes_c::visit(   div_expression_c *symbol) {return narrow_binary_expression(widen_DIV_table, symbol, symbol->l_exp, symbol->r_exp, &symbol->deprecated_operation);}
  1025 void *narrow_candidate_datatypes_c::visit(   div_expression_c *symbol) {return narrow_binary_expression(widen_DIV_table, symbol, symbol->l_exp, symbol->r_exp, &symbol->deprecated_operation);}
  1026 void *narrow_candidate_datatypes_c::visit(   mod_expression_c *symbol) {return narrow_binary_expression(widen_MOD_table, symbol, symbol->l_exp, symbol->r_exp);}
  1026 void *narrow_candidate_datatypes_c::visit(   mod_expression_c *symbol) {return narrow_binary_expression(widen_MOD_table, symbol, symbol->l_exp, symbol->r_exp);}
  1027 
  1027 void *narrow_candidate_datatypes_c::visit( power_expression_c *symbol) {return narrow_binary_expression(widen_EXPT_table,symbol, symbol->l_exp, symbol->r_exp);}
  1028 
       
  1029 
       
  1030 
       
  1031 void *narrow_candidate_datatypes_c::visit(power_expression_c *symbol) {
       
  1032 	symbol->l_exp->datatype = symbol->datatype;
       
  1033 	symbol->l_exp->accept(*this);
       
  1034 	if (! symbol->r_exp->candidate_datatypes.size()){
       
  1035 		symbol->r_exp->datatype = symbol->r_exp->candidate_datatypes[0];
       
  1036 		symbol->r_exp->accept(*this);
       
  1037 	}
       
  1038 	return NULL;
       
  1039 }
       
  1040 
  1028 
  1041 
  1029 
  1042 void *narrow_candidate_datatypes_c::visit(neg_expression_c *symbol) {
  1030 void *narrow_candidate_datatypes_c::visit(neg_expression_c *symbol) {
  1043 	symbol->exp->datatype = symbol->datatype;
  1031 	symbol->exp->datatype = symbol->datatype;
  1044 	symbol->exp->accept(*this);
  1032 	symbol->exp->accept(*this);