mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-29 03:45:35 +02:00
Cosmetics.
This commit is contained in:
parent
c602341aad
commit
666817a093
5 changed files with 108 additions and 101 deletions
|
@ -40,5 +40,4 @@ public interface ICPPASTFieldReference extends IASTFieldReference, IASTImplicitN
|
|||
* @since 5.1
|
||||
*/
|
||||
public ICPPASTFieldReference copy();
|
||||
|
||||
}
|
||||
|
|
|
@ -106,18 +106,22 @@ public class CPPASTBinaryExpression extends ASTNode implements ICPPASTBinaryExpr
|
|||
setInitOperand2(expression);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner#getImplicitNames()
|
||||
*/
|
||||
public IASTImplicitName[] getImplicitNames() {
|
||||
if (implicitNames == null) {
|
||||
ICPPFunction overload = getOverload();
|
||||
if (overload == null)
|
||||
return implicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||
|
||||
if (overload == null) {
|
||||
implicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||
} else {
|
||||
CPPASTImplicitName operatorName = new CPPASTImplicitName(overload.getNameCharArray(), this);
|
||||
operatorName.setBinding(overload);
|
||||
operatorName.setOperator(true);
|
||||
operatorName.computeOperatorOffsets(operand1, true);
|
||||
implicitNames = new IASTImplicitName[] { operatorName };
|
||||
}
|
||||
}
|
||||
|
||||
return implicitNames;
|
||||
}
|
||||
|
@ -149,7 +153,6 @@ public class CPPASTBinaryExpression extends ASTNode implements ICPPASTBinaryExpr
|
|||
if (operand2 != null && !operand2.accept(action))
|
||||
return false;
|
||||
|
||||
|
||||
if (action.shouldVisitExpressions && action.leave(this) == ASTVisitor.PROCESS_ABORT)
|
||||
return false;
|
||||
|
||||
|
|
|
@ -25,14 +25,12 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics;
|
|||
|
||||
|
||||
public class CPPASTDeleteExpression extends ASTNode implements ICPPASTDeleteExpression {
|
||||
|
||||
private IASTExpression operand;
|
||||
private boolean isGlobal;
|
||||
private boolean isVectored;
|
||||
|
||||
private IASTImplicitName[] implicitNames = null;
|
||||
|
||||
|
||||
public CPPASTDeleteExpression() {
|
||||
}
|
||||
|
||||
|
@ -120,7 +118,6 @@ public class CPPASTDeleteExpression extends ASTNode implements ICPPASTDeleteExpr
|
|||
return implicitNames;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean accept(ASTVisitor action) {
|
||||
if (action.shouldVisitExpressions) {
|
||||
|
@ -133,11 +130,13 @@ public class CPPASTDeleteExpression extends ASTNode implements ICPPASTDeleteExpr
|
|||
|
||||
if (action.shouldVisitImplicitNames) {
|
||||
for(IASTImplicitName name : getImplicitNames()) {
|
||||
if(!name.accept(action)) return false;
|
||||
if (!name.accept(action))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if( operand != null ) if( !operand.accept( action ) ) return false;
|
||||
if (operand != null && !operand.accept(action))
|
||||
return false;
|
||||
|
||||
if (action.shouldVisitExpressions) {
|
||||
switch (action.leave(this)) {
|
||||
|
|
|
@ -133,13 +133,15 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
|||
isNewTypeId = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner#getImplicitNames()
|
||||
*/
|
||||
public IASTImplicitName[] getImplicitNames() {
|
||||
if (implicitNames == null) {
|
||||
ICPPFunction operatorFunction = CPPSemantics.findOverloadedOperator(this);
|
||||
if (operatorFunction == null) {
|
||||
implicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
CPPASTImplicitName operatorName = new CPPASTImplicitName(operatorFunction.getNameCharArray(), this);
|
||||
operatorName.setOperator(true);
|
||||
operatorName.setBinding(operatorFunction);
|
||||
|
@ -151,7 +153,6 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
|||
return implicitNames;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns true if this expression is allocating an array.
|
||||
* @since 5.1
|
||||
|
|
|
@ -94,18 +94,22 @@ public class CPPASTUnaryExpression extends ASTNode implements ICPPASTUnaryExpres
|
|||
return op == op_postFixDecr || op == op_postFixIncr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner#getImplicitNames()
|
||||
*/
|
||||
public IASTImplicitName[] getImplicitNames() {
|
||||
if (implicitNames == null) {
|
||||
ICPPFunction overload = getOverload();
|
||||
if (overload == null)
|
||||
return implicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||
|
||||
if (overload == null) {
|
||||
implicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||
} else {
|
||||
CPPASTImplicitName operatorName = new CPPASTImplicitName(overload.getNameCharArray(), this);
|
||||
operatorName.setOperator(true);
|
||||
operatorName.setBinding(overload);
|
||||
operatorName.computeOperatorOffsets(operand, isPostfixOperator());
|
||||
implicitNames = new IASTImplicitName[] { operatorName };
|
||||
}
|
||||
}
|
||||
|
||||
return implicitNames;
|
||||
}
|
||||
|
@ -134,7 +138,8 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue