stage4/generate_c/generate_c_st.cc
changeset 694 a010763dd4cb
parent 693 51a2fa6441b9
child 718 a9f8cc778444
equal deleted inserted replaced
693:51a2fa6441b9 694:a010763dd4cb
   465   ERROR;
   465   ERROR;
   466 return NULL;
   466 return NULL;
   467 }
   467 }
   468 
   468 
   469 void *visit(equ_expression_c *symbol) {
   469 void *visit(equ_expression_c *symbol) {
   470   if (get_datatype_info_c::is_TIME_compatible      (symbol->datatype) ||
   470   if (get_datatype_info_c::is_TIME_compatible      (symbol->l_exp->datatype) ||
   471       get_datatype_info_c::is_ANY_DATE_compatible  (symbol->datatype) ||
   471       get_datatype_info_c::is_ANY_DATE_compatible  (symbol->l_exp->datatype) ||
   472       get_datatype_info_c::is_ANY_STRING_compatible(symbol->datatype))
   472       get_datatype_info_c::is_ANY_STRING_compatible(symbol->l_exp->datatype))
   473     return print_compare_function("EQ_", symbol->datatype, symbol->l_exp, symbol->r_exp);
   473     return print_compare_function("EQ_", symbol->l_exp->datatype, symbol->l_exp, symbol->r_exp);
   474   return print_binary_expression(symbol->l_exp, symbol->r_exp, " == ");
   474   return print_binary_expression(symbol->l_exp, symbol->r_exp, " == ");
   475 }
   475 }
   476 
   476 
   477 void *visit(notequ_expression_c *symbol) {
   477 void *visit(notequ_expression_c *symbol) {
   478   if (get_datatype_info_c::is_TIME_compatible      (symbol->datatype) ||
   478   if (get_datatype_info_c::is_TIME_compatible      (symbol->l_exp->datatype) ||
   479       get_datatype_info_c::is_ANY_DATE_compatible  (symbol->datatype) ||
   479       get_datatype_info_c::is_ANY_DATE_compatible  (symbol->l_exp->datatype) ||
   480       get_datatype_info_c::is_ANY_STRING_compatible(symbol->datatype))
   480       get_datatype_info_c::is_ANY_STRING_compatible(symbol->l_exp->datatype))
   481     return print_compare_function("NE_", symbol->datatype, symbol->l_exp, symbol->r_exp);
   481     return print_compare_function("NE_", symbol->l_exp->datatype, symbol->l_exp, symbol->r_exp);
   482   return print_binary_expression(symbol->l_exp, symbol->r_exp, " != ");
   482   return print_binary_expression(symbol->l_exp, symbol->r_exp, " != ");
   483 }
   483 }
   484 
   484 
   485 void *visit(lt_expression_c *symbol) {
   485 void *visit(lt_expression_c *symbol) {
   486   if (get_datatype_info_c::is_TIME_compatible      (symbol->datatype) ||
   486   if (get_datatype_info_c::is_TIME_compatible      (symbol->l_exp->datatype) ||
   487       get_datatype_info_c::is_ANY_DATE_compatible  (symbol->datatype) ||
   487       get_datatype_info_c::is_ANY_DATE_compatible  (symbol->l_exp->datatype) ||
   488       get_datatype_info_c::is_ANY_STRING_compatible(symbol->datatype))
   488       get_datatype_info_c::is_ANY_STRING_compatible(symbol->l_exp->datatype))
   489     return print_compare_function("LT_", symbol->datatype, symbol->l_exp, symbol->r_exp);
   489     return print_compare_function("LT_", symbol->l_exp->datatype, symbol->l_exp, symbol->r_exp);
   490   return print_binary_expression(symbol->l_exp, symbol->r_exp, " < ");
   490   return print_binary_expression(symbol->l_exp, symbol->r_exp, " < ");
   491 }
   491 }
   492 
   492 
   493 void *visit(gt_expression_c *symbol) {
   493 void *visit(gt_expression_c *symbol) {
   494   if (get_datatype_info_c::is_TIME_compatible      (symbol->datatype) ||
   494   if (get_datatype_info_c::is_TIME_compatible      (symbol->l_exp->datatype) ||
   495       get_datatype_info_c::is_ANY_DATE_compatible  (symbol->datatype) ||
   495       get_datatype_info_c::is_ANY_DATE_compatible  (symbol->l_exp->datatype) ||
   496       get_datatype_info_c::is_ANY_STRING_compatible(symbol->datatype))
   496       get_datatype_info_c::is_ANY_STRING_compatible(symbol->l_exp->datatype))
   497     return print_compare_function("GT_", symbol->datatype, symbol->l_exp, symbol->r_exp);
   497     return print_compare_function("GT_", symbol->l_exp->datatype, symbol->l_exp, symbol->r_exp);
   498   return print_binary_expression(symbol->l_exp, symbol->r_exp, " > ");
   498   return print_binary_expression(symbol->l_exp, symbol->r_exp, " > ");
   499 }
   499 }
   500 
   500 
   501 void *visit(le_expression_c *symbol) {
   501 void *visit(le_expression_c *symbol) {
   502   if (get_datatype_info_c::is_TIME_compatible      (symbol->datatype) ||
   502   if (get_datatype_info_c::is_TIME_compatible      (symbol->l_exp->datatype) ||
   503       get_datatype_info_c::is_ANY_DATE_compatible  (symbol->datatype) ||
   503       get_datatype_info_c::is_ANY_DATE_compatible  (symbol->l_exp->datatype) ||
   504       get_datatype_info_c::is_ANY_STRING_compatible(symbol->datatype))
   504       get_datatype_info_c::is_ANY_STRING_compatible(symbol->l_exp->datatype))
   505     return print_compare_function("LE_", symbol->datatype, symbol->l_exp, symbol->r_exp);
   505     return print_compare_function("LE_", symbol->l_exp->datatype, symbol->l_exp, symbol->r_exp);
   506   return print_binary_expression(symbol->l_exp, symbol->r_exp, " <= ");
   506   return print_binary_expression(symbol->l_exp, symbol->r_exp, " <= ");
   507 }
   507 }
   508 
   508 
   509 void *visit(ge_expression_c *symbol) {
   509 void *visit(ge_expression_c *symbol) {
   510   if (get_datatype_info_c::is_TIME_compatible      (symbol->datatype) ||
   510   if (get_datatype_info_c::is_TIME_compatible      (symbol->l_exp->datatype) ||
   511       get_datatype_info_c::is_ANY_DATE_compatible  (symbol->datatype) ||
   511       get_datatype_info_c::is_ANY_DATE_compatible  (symbol->l_exp->datatype) ||
   512       get_datatype_info_c::is_ANY_STRING_compatible(symbol->datatype))
   512       get_datatype_info_c::is_ANY_STRING_compatible(symbol->l_exp->datatype))
   513     return print_compare_function("GE_", symbol->datatype, symbol->l_exp, symbol->r_exp);
   513     return print_compare_function("GE_", symbol->l_exp->datatype, symbol->l_exp, symbol->r_exp);
   514   return print_binary_expression(symbol->l_exp, symbol->r_exp, " >= ");
   514   return print_binary_expression(symbol->l_exp, symbol->r_exp, " >= ");
   515 }
   515 }
   516 
   516 
   517 void *visit(add_expression_c *symbol) {
   517 void *visit(add_expression_c *symbol) {
   518 /*
   518 /*