From d7f3e0c5d0b0af0dcb5f8168e1184f15a0554a4e Mon Sep 17 00:00:00 2001 From: graydon Date: Wed, 10 Aug 2005 03:15:21 +0000 Subject: 2005-08-09 Graydon Hoare * staptree.{cxx,h} (target_symbol): New struct. (*_visitor::visit_target_symbol): Support it. (visitor::active_lvalues) (visitor::is_active_lvalue) (visitor::push_active_lvalue) (visitor::pop_active_lvalue): Support lvalue-detection. (delete_statement::visit) (pre_crement::visit) (post_crement::visit) (assignment::visit): Push and pop lvalue expressions. * elaborate.{cxx,h} (lvalule_aware_traversing_visitor): Remove class. (no_map_mutation_during_iteration_check) (mutated_map_collector): Update lvalue logic. (typeresolution_info::visit_target_symbol): Add, throw error. * parse.{cxx,h} (tt2str) (tok_is) (parser::expect_*) (parser::peek_*): New helpers. (parser::parse_symbol): Rewrite, support target_symbols. * translate.cxx (c_unparser::visit_target_symbol): Implement. * tapsets.cxx (var_expanding_copy_visitor): Update lvalue logic, change visit_symbol to visit_target_symbol. --- translate.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'translate.cxx') diff --git a/translate.cxx b/translate.cxx index b013fc29..4add7b64 100644 --- a/translate.cxx +++ b/translate.cxx @@ -121,6 +121,7 @@ struct c_unparser: public unparser, public visitor void visit_ternary_expression (ternary_expression* e); void visit_assignment (assignment* e); void visit_symbol (symbol* e); + void visit_target_symbol (target_symbol* e); void visit_arrayindex (arrayindex* e); void visit_functioncall (functioncall* e); }; @@ -1836,6 +1837,13 @@ c_unparser_assignment::visit_symbol (symbol *e) } +void +c_unparser::visit_target_symbol (target_symbol* e) +{ + throw semantic_error("cannot translate general target-symbol expression"); +} + + void c_tmpcounter::visit_arrayindex (arrayindex *e) { -- cgit