Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2009-03-30 09:17:26 -0400
committerMarkus Schorn2009-03-30 09:17:26 -0400
commitdae94a218c53df561809280cd2d81dedf2a730de (patch)
treeb96df5346f387e393a0b5ccecf83621eea5c9202 /core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter
parent8d8462bc9357ee26b1fcc68ad8533274517abda3 (diff)
downloadorg.eclipse.cdt-dae94a218c53df561809280cd2d81dedf2a730de.tar.gz
org.eclipse.cdt-dae94a218c53df561809280cd2d81dedf2a730de.tar.xz
org.eclipse.cdt-dae94a218c53df561809280cd2d81dedf2a730de.zip
Decouple cast-expressions from unary expressions by Richard Miskin, bug 270252.
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ExpressionWriter.java20
1 files changed, 9 insertions, 11 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ExpressionWriter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ExpressionWriter.java
index 241cb58a80..2693a6c807 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ExpressionWriter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ExpressionWriter.java
@@ -125,8 +125,10 @@ public class ExpressionWriter extends NodeWriter{
((IASTIdExpression) expression).getName().accept(visitor);
} else if (expression instanceof IASTLiteralExpression) {
writeLiteralExpression((IASTLiteralExpression) expression);
- } else if (expression instanceof IASTUnaryExpression) {//UnaryExpressions including Cast Expressions
+ } else if (expression instanceof IASTUnaryExpression) {
writeUnaryExpression((IASTUnaryExpression) expression);
+ } else if (expression instanceof IASTCastExpression) {
+ writeCastExpression((IASTCastExpression) expression);
} else if (expression instanceof ICPPASTNewExpression) {
writeCPPNewExpression((ICPPASTNewExpression) expression);
}else if (expression instanceof IASTConditionalExpression) {
@@ -372,16 +374,12 @@ public class ExpressionWriter extends NodeWriter{
}
private void writeUnaryExpression(IASTUnaryExpression unExp) {
- if (unExp instanceof IASTCastExpression) {//Castoperatoren sind auch Un´┐Żreoperatoren
- writeCastExpression((IASTCastExpression) unExp);
- }else{
- if(isPrefixExpression(unExp )) {
- scribe.print(getPrefixOperator(unExp));
- }
- unExp.getOperand().accept(visitor);
- if(isPostfixExpression(unExp)) {
- scribe.print(getPostfixOperator(unExp));
- }
+ if(isPrefixExpression(unExp )) {
+ scribe.print(getPrefixOperator(unExp));
+ }
+ unExp.getOperand().accept(visitor);
+ if(isPostfixExpression(unExp)) {
+ scribe.print(getPostfixOperator(unExp));
}
}

Back to the top