From bb2e3076ea20631d4606050550bc9664204f2c62 Mon Sep 17 00:00:00 2001 From: fche Date: Wed, 8 Jun 2005 22:02:09 +0000 Subject: 2005-06-08 Frank Ch. Eigler systemtap/916 Implement all basic scalar operators, including modify-assignment. * parse.cxx (lexer): Allow multi-character lookahead in order to scan 1/2/3-character operators. (parse_boolean_or/and/xor/shift): New routines. * translate.cxx (visit_assignment, visit_binary_expression, visit_*_crement): Generally rewrote. (visit_*): Added more parentheses in output. (emit_module_init): Initialize globals. * staptree.h, elaborate.cxx, elaborate.h: Remove exponentiation. * main.cxx (main): Add an end-of-line to output file. * testsuite/*: Several new tests. --- staptree.cxx | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) (limited to 'staptree.cxx') diff --git a/staptree.cxx b/staptree.cxx index 3ee34950..f74f9a91 100644 --- a/staptree.cxx +++ b/staptree.cxx @@ -285,7 +285,7 @@ void block::print (ostream& o) o << "{" << endl; for (unsigned i=0; iprint (o); o << "; "; incr->print (o); - o << ")" << endl; + o << ") "; block->print (o); } @@ -310,7 +310,7 @@ void foreach_loop::print (ostream& o) if (i > 0) o << ", "; indexes[i]->print (o); } - o << "] in " << base << ")" << endl; + o << "] in " << base << ") "; block->print (o); } @@ -355,7 +355,7 @@ void continue_statement::print (ostream& o) void if_statement::print (ostream& o) { - o << "if (" << *condition << ") " << endl + o << "if (" << *condition << ") " << *thenblock << endl; if (elseblock) o << "else " << *elseblock << endl; @@ -569,12 +569,6 @@ concatenation::visit (visitor* u) u->visit_concatenation (this); } -void -exponentiation::visit (visitor* u) -{ - u->visit_exponentiation (this); -} - void ternary_expression::visit (visitor* u) { @@ -749,13 +743,6 @@ traversing_visitor::visit_concatenation (concatenation* e) e->right->visit (this); } -void -traversing_visitor::visit_exponentiation (exponentiation* e) -{ - e->left->visit (this); - e->right->visit (this); -} - void traversing_visitor::visit_ternary_expression (ternary_expression* e) { @@ -937,12 +924,6 @@ throwing_visitor::visit_concatenation (concatenation* e) throwone (e->tok); } -void -throwing_visitor::visit_exponentiation (exponentiation* e) -{ - throwone (e->tok); -} - void throwing_visitor::visit_ternary_expression (ternary_expression* e) { -- cgit