equal
deleted
inserted
replaced
609 } |
609 } |
610 ERROR; |
610 ERROR; |
611 return NULL; |
611 return NULL; |
612 } |
612 } |
613 |
613 |
614 /* TODO: power expression... */ |
|
615 void *visit(power_expression_c *symbol) { |
614 void *visit(power_expression_c *symbol) { |
616 ERROR; |
615 symbol_c *left_type = search_expression_type->get_type(symbol->l_exp); |
617 return print_binary_expression(symbol->l_exp, symbol->r_exp, " ** "); |
616 symbol_c *right_type = search_expression_type->get_type(symbol->r_exp); |
|
617 if (search_expression_type->is_real_type(left_type) && search_expression_type->is_num_type(right_type)) { |
|
618 s4o.print("__expt_LREAL((BOOL)__BOOL_LITERAL(TRUE),\n"); |
|
619 s4o.indent_right(); |
|
620 s4o.print(s4o.indent_spaces + "NULL,\n"); |
|
621 s4o.print(s4o.indent_spaces + "(LREAL)("); |
|
622 symbol->l_exp->accept(*this); |
|
623 s4o.print("),\n"); |
|
624 s4o.print(s4o.indent_spaces + "(LREAL)("); |
|
625 symbol->r_exp->accept(*this); |
|
626 s4o.print("))"); |
|
627 return NULL; |
|
628 } |
|
629 ERROR; |
618 } |
630 } |
619 |
631 |
620 void *visit(neg_expression_c *symbol) { |
632 void *visit(neg_expression_c *symbol) { |
621 return print_unary_expression(symbol->exp, " -"); |
633 return print_unary_expression(symbol->exp, " -"); |
622 } |
634 } |