equal
deleted
inserted
replaced
347 } |
347 } |
348 |
348 |
349 /* TODO: power expression... */ |
349 /* TODO: power expression... */ |
350 void *visit(power_expression_c *symbol) {ERROR; return print_binary_expression(symbol->l_exp, symbol->r_exp, " ** ");} |
350 void *visit(power_expression_c *symbol) {ERROR; return print_binary_expression(symbol->l_exp, symbol->r_exp, " ** ");} |
351 void *visit(neg_expression_c *symbol) {return print_unary_expression(symbol->exp, " -");} |
351 void *visit(neg_expression_c *symbol) {return print_unary_expression(symbol->exp, " -");} |
352 void *visit(not_expression_c *symbol) {return print_unary_expression(symbol->exp, search_expression_type->is_bool_type(symbol->exp)?"!":"~");} |
352 |
|
353 void *visit(not_expression_c *symbol) { |
|
354 symbol_c *exp_type = search_expression_type->get_type(symbol->exp); |
|
355 if (!search_expression_type->is_binary_type(exp_type)) |
|
356 ERROR; |
|
357 return print_unary_expression(symbol->exp, search_expression_type->is_bool_type(exp_type)?"!":"~"); |
|
358 } |
353 |
359 |
354 void *visit(function_invocation_c *symbol) { |
360 void *visit(function_invocation_c *symbol) { |
355 function_declaration_c *f_decl = function_symtable.find_value(symbol->function_name); |
361 function_declaration_c *f_decl = function_symtable.find_value(symbol->function_name); |
356 |
362 |
357 if (f_decl == function_symtable.end_value()) { |
363 if (f_decl == function_symtable.end_value()) { |