diff options
author | Markus Schorn | 2008-03-07 12:13:38 +0000 |
---|---|---|
committer | Markus Schorn | 2008-03-07 12:13:38 +0000 |
commit | 1f19d506f8745932555a3d93e1578e9ca48e54ac (patch) | |
tree | 0305f4cd0ec042da5d0afd538a048dfdc7f06ff5 /core/org.eclipse.cdt.core.tests/resources/rewrite/ASTWriterExpressionTestSource.awts | |
parent | f242093f1e29c5f6350a66f6fa1e5cea77642860 (diff) | |
download | org.eclipse.cdt-1f19d506f8745932555a3d93e1578e9ca48e54ac.tar.gz org.eclipse.cdt-1f19d506f8745932555a3d93e1578e9ca48e54ac.tar.xz org.eclipse.cdt-1f19d506f8745932555a3d93e1578e9ca48e54ac.zip |
Source Change Generator for ASTTransformations by Emanuel Graf and others, bug 214605.
Diffstat (limited to 'core/org.eclipse.cdt.core.tests/resources/rewrite/ASTWriterExpressionTestSource.awts')
-rw-r--r-- | core/org.eclipse.cdt.core.tests/resources/rewrite/ASTWriterExpressionTestSource.awts | 185 |
1 files changed, 185 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core.tests/resources/rewrite/ASTWriterExpressionTestSource.awts b/core/org.eclipse.cdt.core.tests/resources/rewrite/ASTWriterExpressionTestSource.awts new file mode 100644 index 00000000000..594bebbea6c --- /dev/null +++ b/core/org.eclipse.cdt.core.tests/resources/rewrite/ASTWriterExpressionTestSource.awts @@ -0,0 +1,185 @@ +//!CCastExpression +//%C +int i = (int)'A'; + +//!CPPCastExpression +//%CPP +TestClass *i = dynamic_cast<TestClass*>(tc); +TestClass *i = static_cast<TestClass*>(tc); +TestClass *i = reinterpret_cast<TestClass*>(tc); +TestClass *i = const_cast<TestClass*>(tc); + +//!ArraySubscrition +//%C GNU +int i = arr[0]; +int i = arr[y]; + +//!CPPBinaryExpression +//%CPP +int i = 1 * x; +int i = 1 / x; +int i = 1 % x; +int i = 1 + x; +int i = 1 - x; +int i = 1 << x; +int i = 1 >> x; +bool b = 1 < x; +bool b = 1 > x; +bool b = 1 <= x; +bool b = 1 >= x; +int i = 1 & x; +int i = 1 ^ x; +int i = 1 | x; +bool b = 1 && x; +bool b = 1 || x; +int i = x; +void foo() +{ + i *= x; +} + +void foo() +{ + i /= x; +} + +void foo() +{ + 1 %= x; +} + +void foo() +{ + 1 += x; +} + +void foo() +{ + 1 -= x; +} + +void foo() +{ + 1 <<= x; +} + +void foo() +{ + 1 >>= x; +} + +void foo() +{ + 1 &= x; +} + +void foo() +{ + 1 |= x; +} + +bool b = 1 == x; +bool b = 1 != x; +int i = a.x; +int i = a->x; + +//!BinaryExpression with MacroExpansions +//%CPP +#define ZWO 2 +int i = ZWO + 2; +int i = 2 + ZWO; +//= Preprocessor-Direkrive wird nur bei VP-Translationunits geschrieben +int i = ZWO + 2; +int i = 2 + ZWO; + +//!GPPBinaryExpression +//%CPP GNU +int i = 1 <? x; +int i = 1 >? x; + +//!ConditionalExpression +//%CPP +int a = 1 < 2 ? 2 : 3; + +//!ExpressionList +//%CPP +int a = 1, b = 2, c = 3; + +//!FieldReference +//%CPP +int i = tc->a; +int y = tc.getI(); + +//!CPPFieldReference +//%CPP +int i = tc->template get_new<int>(); +int y = tc.template get_new<int>(); + +//!FunctionCall +//%CPP +int a = tc.getI(); + +//!IdExpression +//%CPP +int i = a; + +//!LiteralExpression +//%CPP +int i = 1; +int i = 'a'; +string s = "abc"; + +//!CPPLiteralExpression +//%CPP +TestClass *tc = this; +bool b = true; +bool b = false; + +//!UnaryExpression +//%CPP +int i = ++a; +int i = --a; +int i = +a; +int i = -a; +int *b = &a; +int i = *b; +int i = ~b; +bool b = !false; +int i = sizeof a; +int i = a--; +int i = a++; +int i = (b); + +//!CPPUnaryExpression +//%CPP +void f() +{ + throw "Fehler"; +} + +type_info c = typeid (a); + +//!TypeIdExpression +//%CPP +int d = sizeof (int); + +//!CPPTypeIdExpression +//%CPP +type_info c = typeid (int); + +//!CPPDeleteExpression +//%CPP +void f() +{ + delete tc; +} + + +//!CPPNewExpression +//%CPP +TestClass *tc = new TestClass(); + +//!CPPSimpleTypeConstructorExpression +//%CPP +int i = int(1); + |