1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 02:06:01 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2010-03-29 03:54:04 +00:00
parent cd70847e0a
commit c602341aad
2 changed files with 37 additions and 45 deletions

View file

@ -43,7 +43,6 @@ public class CPPASTBinaryExpression extends ASTNode implements ICPPASTBinaryExpr
private ICPPFunction overload= UNINITIALIZED_FUNCTION;
private IASTImplicitName[] implicitNames = null;
public CPPASTBinaryExpression() {
}
@ -123,7 +122,6 @@ public class CPPASTBinaryExpression extends ASTNode implements ICPPASTBinaryExpr
return implicitNames;
}
@Override
public boolean accept(ASTVisitor action) {
if (operand1 instanceof IASTBinaryExpression || operand2 instanceof IASTBinaryExpression) {
@ -196,7 +194,8 @@ public class CPPASTBinaryExpression extends ASTNode implements ICPPASTBinaryExpr
if (stack.fState == 1) {
if (action.shouldVisitImplicitNames) {
for (IASTImplicitName name : ((IASTImplicitNameOwner) expr).getImplicitNames()) {
if(!name.accept(action)) return false;
if (!name.accept(action))
return false;
}
}
stack.fState= 2;
@ -300,7 +299,6 @@ public class CPPASTBinaryExpression extends ASTNode implements ICPPASTBinaryExpr
return type;
}
switch (op) {
case IASTBinaryExpression.op_lessEqual:
case IASTBinaryExpression.op_lessThan:
@ -311,11 +309,13 @@ public class CPPASTBinaryExpression extends ASTNode implements ICPPASTBinaryExpr
case IASTBinaryExpression.op_equals:
case IASTBinaryExpression.op_notequals:
return new CPPBasicType(Kind.eBoolean, 0, this);
case IASTBinaryExpression.op_plus:
if (type2 instanceof IPointerType) {
return type2;
}
break;
case IASTBinaryExpression.op_minus:
if (type2 instanceof IPointerType) {
if (type1 instanceof IPointerType) {
@ -324,6 +324,7 @@ public class CPPASTBinaryExpression extends ASTNode implements ICPPASTBinaryExpr
return type1;
}
break;
case ICPPASTBinaryExpression.op_pmarrow:
case ICPPASTBinaryExpression.op_pmdot:
if (type2 instanceof ICPPPointerToMemberType) {
@ -333,5 +334,4 @@ public class CPPASTBinaryExpression extends ASTNode implements ICPPASTBinaryExpr
}
return type1;
}
}

View file

@ -94,7 +94,6 @@ public class CPPASTUnaryExpression extends ASTNode implements ICPPASTUnaryExpres
return op == op_postFixDecr || op == op_postFixIncr;
}
public IASTImplicitName[] getImplicitNames() {
if (implicitNames == null) {
ICPPFunction overload = getOverload();
@ -111,7 +110,6 @@ public class CPPASTUnaryExpression extends ASTNode implements ICPPASTUnaryExpres
return implicitNames;
}
@Override
public boolean accept(ASTVisitor action) {
if (action.shouldVisitExpressions) {
@ -126,11 +124,13 @@ public class CPPASTUnaryExpression extends ASTNode implements ICPPASTUnaryExpres
if (!isPostfix && action.shouldVisitImplicitNames) {
for (IASTImplicitName name : getImplicitNames()) {
if(!name.accept(action)) return false;
if (!name.accept(action))
return false;
}
}
if (operand != null && !operand.accept(action)) return false;
if (operand != null && !operand.accept(action))
return false;
if (isPostfix && action.shouldVisitImplicitNames) {
for (IASTImplicitName name : getImplicitNames()) {
@ -156,7 +156,6 @@ public class CPPASTUnaryExpression extends ASTNode implements ICPPASTUnaryExpres
}
}
public ICPPFunction getOverload() {
if (overload != UNINITIALIZED_FUNCTION)
return overload;
@ -168,8 +167,6 @@ public class CPPASTUnaryExpression extends ASTNode implements ICPPASTUnaryExpres
return overload;
}
private IType computePointerToMemberType() {
IASTNode child= operand;
boolean inParenthesis= false;
@ -200,7 +197,6 @@ public class CPPASTUnaryExpression extends ASTNode implements ICPPASTUnaryExpres
return null;
}
public IType getExpressionType() {
final int op= getOperator();
switch (op) {
@ -227,7 +223,6 @@ public class CPPASTUnaryExpression extends ASTNode implements ICPPASTUnaryExpres
return new CPPPointerType(type);
}
if (op == op_star) {
IType type= operand.getExpressionType();
type = SemanticUtil.getNestedType(type, TDEF | REF | CVTYPE);
@ -245,7 +240,6 @@ public class CPPASTUnaryExpression extends ASTNode implements ICPPASTUnaryExpres
return new ProblemBinding(this, IProblemBinding.SEMANTIC_INVALID_TYPE, this.getRawSignature().toCharArray());
}
IType origType= operand.getExpressionType();
IType type = SemanticUtil.getUltimateTypeUptoPointers(origType);
IType operator = findOperatorReturnType();
@ -304,6 +298,4 @@ public class CPPASTUnaryExpression extends ASTNode implements ICPPASTUnaryExpres
}
return null;
}
}