summaryrefslogtreecommitdiffstats
path: root/staptree.cxx
diff options
context:
space:
mode:
authorfche <fche>2005-06-08 22:02:09 +0000
committerfche <fche>2005-06-08 22:02:09 +0000
commitbb2e3076ea20631d4606050550bc9664204f2c62 (patch)
treeef9cfb841ddb001c1f3aa266523f1ff6f56b21b5 /staptree.cxx
parent22f4623195facb4cbc1b50c45c0bd689f6958a9d (diff)
downloadsystemtap-steved-bb2e3076ea20631d4606050550bc9664204f2c62.tar.gz
systemtap-steved-bb2e3076ea20631d4606050550bc9664204f2c62.tar.xz
systemtap-steved-bb2e3076ea20631d4606050550bc9664204f2c62.zip
2005-06-08 Frank Ch. Eigler <fche@redhat.com>
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.
Diffstat (limited to 'staptree.cxx')
-rw-r--r--staptree.cxx27
1 files changed, 4 insertions, 23 deletions
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; i<statements.size(); i++)
o << *statements [i] << endl;
- o << "}" << endl;
+ o << "}";
}
@@ -297,7 +297,7 @@ void for_loop::print (ostream& o)
cond->print (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;
@@ -570,12 +570,6 @@ concatenation::visit (visitor* u)
}
void
-exponentiation::visit (visitor* u)
-{
- u->visit_exponentiation (this);
-}
-
-void
ternary_expression::visit (visitor* u)
{
u->visit_ternary_expression (this);
@@ -750,13 +744,6 @@ traversing_visitor::visit_concatenation (concatenation* e)
}
void
-traversing_visitor::visit_exponentiation (exponentiation* e)
-{
- e->left->visit (this);
- e->right->visit (this);
-}
-
-void
traversing_visitor::visit_ternary_expression (ternary_expression* e)
{
e->cond->visit (this);
@@ -938,12 +925,6 @@ throwing_visitor::visit_concatenation (concatenation* e)
}
void
-throwing_visitor::visit_exponentiation (exponentiation* e)
-{
- throwone (e->tok);
-}
-
-void
throwing_visitor::visit_ternary_expression (ternary_expression* e)
{
throwone (e->tok);