diff options
author | fche <fche> | 2005-06-08 22:02:09 +0000 |
---|---|---|
committer | fche <fche> | 2005-06-08 22:02:09 +0000 |
commit | bb2e3076ea20631d4606050550bc9664204f2c62 (patch) | |
tree | ef9cfb841ddb001c1f3aa266523f1ff6f56b21b5 /testsuite/parseok | |
parent | 22f4623195facb4cbc1b50c45c0bd689f6958a9d (diff) | |
download | systemtap-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 'testsuite/parseok')
-rwxr-xr-x | testsuite/parseok/eleven.stp | 54 | ||||
-rwxr-xr-x | testsuite/parseok/ten.stp | 14 |
2 files changed, 61 insertions, 7 deletions
diff --git a/testsuite/parseok/eleven.stp b/testsuite/parseok/eleven.stp new file mode 100755 index 00000000..c05ca66f --- /dev/null +++ b/testsuite/parseok/eleven.stp @@ -0,0 +1,54 @@ +#! stap -p1 + +probe two +{ + # all assignment operators + a = b + a <<< b + a += b + a -= b + a *= b + a /= b + a %= b + a <<= b + a >>= b + a &= b + a ^= b + a |= b + + # all ternary operators + a ? b : c + + # all binary operators + a || b + a && b + a | b + a & b + a ^ b + a < b + a > b + a == b + a != b + a <= b + a >= b + a << b + a >> b + a . b + a + b + a - b + a * b + a / b + a % b + + # all unary operators + a ++ + a -- + -- a + ++ a + ~ a + ! a + ; # grammar glitch + + a + ; # grammar glitch + - a +} diff --git a/testsuite/parseok/ten.stp b/testsuite/parseok/ten.stp index 25d16e62..2da82f04 100755 --- a/testsuite/parseok/ten.stp +++ b/testsuite/parseok/ten.stp @@ -4,13 +4,13 @@ probe two { for (;;) ; for (a=0;;) { a + 4; break } - for (;a>0;) { a + 5; continue } - for (;;a++) { a + 5 } - for (a=0;a>0;) { a + 4 } - for (;a>0;a++) { a + 5 } - for (a=0;;a++) { a + 5 } - for (a=0; a<=4; a++) ; - for (a=0; a<=4; a++) { b = a } + for (;a>0;) { a ^ 5; continue } + for (;;a++) { a | 5 } + for (a=0;a>0;) { a << 4 } + for (;a>0;++a) { a >> 5 } + for (a=0;;a--) { a & 5 * b } + for (a=0; a<=4 && b>=5; --a) ; + for (a=0; a==4 || b!=5; a++) { b = a } next while (99) ; while (99) { break continue } |