stage3/visit_expression_type.cc
changeset 331 e08e14782a4f
parent 324 f763383992c9
child 333 b495a49f5038
equal deleted inserted replaced
330:d2facfcf485a 331:e08e14782a4f
  2000   if (debug) {
  2000   if (debug) {
  2001     printf("visit_expression_type_c::visit(assignment_statement_c) called. Checking --->");  
  2001     printf("visit_expression_type_c::visit(assignment_statement_c) called. Checking --->");  
  2002     symbolic_variable_c *hi = dynamic_cast<symbolic_variable_c *>(symbol->l_exp);  
  2002     symbolic_variable_c *hi = dynamic_cast<symbolic_variable_c *>(symbol->l_exp);  
  2003     if (hi != NULL) {
  2003     if (hi != NULL) {
  2004       identifier_c *hi1 = dynamic_cast<identifier_c *>(hi->var_name);  
  2004       identifier_c *hi1 = dynamic_cast<identifier_c *>(hi->var_name);  
  2005       if (hi1 != NULL) printf(hi1->value);
  2005       if (hi1 != NULL) printf("%s", hi1->value);
  2006     }
  2006     }
  2007     printf(" := ");
  2007     printf(" := ");
  2008     hex_integer_c *hi2 = dynamic_cast<hex_integer_c *>(symbol->r_exp);  
  2008     hex_integer_c *hi2 = dynamic_cast<hex_integer_c *>(symbol->r_exp);  
  2009     if (hi2 != NULL) printf(hi2->value);
  2009     if (hi2 != NULL) printf("%s", hi2->value);
  2010     printf("\n");
  2010     printf("\n");
  2011   } // if (debug)
  2011   } // if (debug)
  2012   
  2012   
  2013   if (!is_valid_assignment(left_type, right_type))  {
  2013   if (!is_valid_assignment(left_type, right_type))  {
  2014      STAGE3_ERROR(symbol, symbol, "data type mismatch in assignment statement!\n");
  2014      STAGE3_ERROR(symbol, symbol, "data type mismatch in assignment statement!\n");