mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Cosmetics.
This commit is contained in:
parent
411047a2e4
commit
60322d05d5
5 changed files with 57 additions and 59 deletions
|
@ -94,9 +94,9 @@ public class CPPASTArraySubscriptExpression extends ASTNode implements ICPPASTAr
|
|||
}
|
||||
|
||||
public IASTImplicitName[] getImplicitNames() {
|
||||
if(implicitNames == null) {
|
||||
if (implicitNames == null) {
|
||||
ICPPFunction overload = getOverload();
|
||||
if(overload == null)
|
||||
if (overload == null)
|
||||
return implicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||
|
||||
// create separate implicit names for the two brackets
|
||||
|
@ -129,49 +129,47 @@ public class CPPASTArraySubscriptExpression extends ASTNode implements ICPPASTAr
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean accept( ASTVisitor action ){
|
||||
if( action.shouldVisitExpressions ){
|
||||
switch( action.visit( this ) ){
|
||||
case ASTVisitor.PROCESS_ABORT : return false;
|
||||
case ASTVisitor.PROCESS_SKIP : return true;
|
||||
default : break;
|
||||
public boolean accept(ASTVisitor action) {
|
||||
if (action.shouldVisitExpressions) {
|
||||
switch (action.visit(this)) {
|
||||
case ASTVisitor.PROCESS_ABORT: return false;
|
||||
case ASTVisitor.PROCESS_SKIP: return true;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
if( arrayExpression != null )
|
||||
if( !arrayExpression.accept( action ) ) return false;
|
||||
if (arrayExpression != null && !arrayExpression.accept(action))
|
||||
return false;
|
||||
|
||||
IASTImplicitName[] implicits = action.shouldVisitImplicitNames ? getImplicitNames() : null;
|
||||
|
||||
if(implicits != null && implicits.length > 0)
|
||||
if(!implicits[0].accept(action)) return false;
|
||||
if (implicits != null && implicits.length > 0 && !implicits[0].accept(action))
|
||||
return false;
|
||||
|
||||
if( subscriptExp != null )
|
||||
if( !subscriptExp.accept( action ) ) return false;
|
||||
if (subscriptExp != null && !subscriptExp.accept(action))
|
||||
return false;
|
||||
|
||||
if(implicits != null && implicits.length > 0)
|
||||
if(!implicits[1].accept(action)) return false;
|
||||
if (implicits != null && implicits.length > 0 && !implicits[1].accept(action))
|
||||
return false;
|
||||
|
||||
if( action.shouldVisitExpressions ){
|
||||
switch( action.leave( this ) ){
|
||||
case ASTVisitor.PROCESS_ABORT : return false;
|
||||
case ASTVisitor.PROCESS_SKIP : return true;
|
||||
default : break;
|
||||
if (action.shouldVisitExpressions) {
|
||||
switch (action.leave(this)) {
|
||||
case ASTVisitor.PROCESS_ABORT: return false;
|
||||
case ASTVisitor.PROCESS_SKIP: return true;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void replace(IASTNode child, IASTNode other) {
|
||||
if( child == subscriptExp )
|
||||
{
|
||||
other.setPropertyInParent( child.getPropertyInParent() );
|
||||
other.setParent( child.getParent() );
|
||||
if (child == subscriptExp) {
|
||||
other.setPropertyInParent(child.getPropertyInParent());
|
||||
other.setParent(child.getParent());
|
||||
subscriptExp = (IASTExpression) other;
|
||||
}
|
||||
if( child == arrayExpression )
|
||||
{
|
||||
other.setPropertyInParent( child.getPropertyInParent() );
|
||||
other.setParent( child.getParent() );
|
||||
if (child == arrayExpression) {
|
||||
other.setPropertyInParent(child.getPropertyInParent());
|
||||
other.setParent(child.getParent());
|
||||
arrayExpression = (IASTExpression) other;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -136,7 +136,7 @@ public class CPPASTBinaryExpression extends ASTNode implements ICPPASTBinaryExpr
|
|||
switch (action.visit(this)) {
|
||||
case ASTVisitor.PROCESS_ABORT: return false;
|
||||
case ASTVisitor.PROCESS_SKIP: return true;
|
||||
default : break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -117,8 +117,8 @@ public class CPPASTFieldReference extends ASTNode implements ICPPASTFieldReferen
|
|||
}
|
||||
|
||||
public IASTImplicitName[] getImplicitNames() {
|
||||
if(implicitNames == null) {
|
||||
if(!isDeref)
|
||||
if (implicitNames == null) {
|
||||
if (!isDeref)
|
||||
return implicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||
|
||||
// collect the function bindings
|
||||
|
@ -128,7 +128,7 @@ public class CPPASTFieldReference extends ASTNode implements ICPPASTFieldReferen
|
|||
} catch (DOMException e) {
|
||||
return implicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||
}
|
||||
if(functionBindings.isEmpty())
|
||||
if (functionBindings.isEmpty())
|
||||
return implicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||
|
||||
// create a name to wrap each binding
|
||||
|
@ -154,15 +154,18 @@ public class CPPASTFieldReference extends ASTNode implements ICPPASTFieldReferen
|
|||
}
|
||||
}
|
||||
|
||||
if (owner != null && !owner.accept(action)) return false;
|
||||
if (owner != null && !owner.accept(action))
|
||||
return false;
|
||||
|
||||
if(action.shouldVisitImplicitNames) {
|
||||
for(IASTImplicitName name : getImplicitNames()) {
|
||||
if(!name.accept(action)) return false;
|
||||
if (action.shouldVisitImplicitNames) {
|
||||
for (IASTImplicitName name : getImplicitNames()) {
|
||||
if (!name.accept(action))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (name != null && !name.accept(action)) return false;
|
||||
if (name != null && !name.accept(action))
|
||||
return false;
|
||||
|
||||
if (action.shouldVisitExpressions) {
|
||||
switch (action.leave(this)) {
|
||||
|
|
|
@ -107,9 +107,9 @@ public class CPPASTFunctionCallExpression extends ASTNode implements
|
|||
}
|
||||
|
||||
public IASTImplicitName[] getImplicitNames() {
|
||||
if(implicitNames == null) {
|
||||
if (implicitNames == null) {
|
||||
ICPPFunction overload = getOperator();
|
||||
if(overload == null)
|
||||
if (overload == null)
|
||||
return implicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||
|
||||
// create separate implicit names for the two brackets
|
||||
|
@ -126,12 +126,12 @@ public class CPPASTFunctionCallExpression extends ASTNode implements
|
|||
IToken lparen = functionName.getTrailingSyntax();
|
||||
IToken rparen = lparen.getNext();
|
||||
|
||||
if(lparen.getType() == IToken.tLPAREN)
|
||||
if (lparen.getType() == IToken.tLPAREN)
|
||||
n1.setOffsetAndLength(idEndOffset + lparen.getOffset(), 1);
|
||||
else
|
||||
n1.setOffsetAndLength(idEndOffset + lparen.getEndOffset(), 0);
|
||||
|
||||
if(rparen.getType() == IToken.tRPAREN)
|
||||
if (rparen.getType() == IToken.tRPAREN)
|
||||
n2.setOffsetAndLength(idEndOffset + rparen.getOffset(), 1);
|
||||
else
|
||||
n2.setOffsetAndLength(idEndOffset + rparen.getEndOffset(), 0);
|
||||
|
@ -150,12 +150,12 @@ public class CPPASTFunctionCallExpression extends ASTNode implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean accept( ASTVisitor action ){
|
||||
if( action.shouldVisitExpressions ){
|
||||
switch( action.visit( this ) ){
|
||||
case ASTVisitor.PROCESS_ABORT : return false;
|
||||
case ASTVisitor.PROCESS_SKIP : return true;
|
||||
default : break;
|
||||
public boolean accept(ASTVisitor action) {
|
||||
if (action.shouldVisitExpressions) {
|
||||
switch (action.visit(this)) {
|
||||
case ASTVisitor.PROCESS_ABORT: return false;
|
||||
case ASTVisitor.PROCESS_SKIP: return true;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -164,18 +164,16 @@ public class CPPASTFunctionCallExpression extends ASTNode implements
|
|||
|
||||
IASTImplicitName[] implicits = action.shouldVisitImplicitNames ? getImplicitNames() : null;
|
||||
|
||||
if (implicits != null && implicits.length > 0)
|
||||
if (!implicits[0].accept(action))
|
||||
return false;
|
||||
if (implicits != null && implicits.length > 0 && !implicits[0].accept(action))
|
||||
return false;
|
||||
|
||||
for (IASTInitializerClause arg : fArguments) {
|
||||
if (!arg.accept(action))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (implicits != null && implicits.length > 0)
|
||||
if (!implicits[1].accept(action))
|
||||
return false;
|
||||
if (implicits != null && implicits.length > 0 && !implicits[1].accept(action))
|
||||
return false;
|
||||
|
||||
if (action.shouldVisitExpressions && action.leave(this) == ASTVisitor.PROCESS_ABORT)
|
||||
return false;
|
||||
|
@ -252,7 +250,7 @@ public class CPPASTFunctionCallExpression extends ASTNode implements
|
|||
if (op != null) {
|
||||
// overload can be a surrogate function call, which consists of a conversion and a call to
|
||||
// a dynamically computed function pointer.
|
||||
if(!(op instanceof CPPImplicitFunction))
|
||||
if (!(op instanceof CPPImplicitFunction))
|
||||
overload = op;
|
||||
return op.getType().getReturnType();
|
||||
}
|
||||
|
|
|
@ -161,12 +161,11 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
|||
IType t = CPPVisitor.createType(getTypeId());
|
||||
return t instanceof IArrayType;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean accept(ASTVisitor action) {
|
||||
if (action.shouldVisitExpressions) {
|
||||
switch(action.visit(this)) {
|
||||
switch (action.visit(this)) {
|
||||
case ASTVisitor.PROCESS_ABORT: return false;
|
||||
case ASTVisitor.PROCESS_SKIP: return true;
|
||||
default: break;
|
||||
|
@ -174,7 +173,7 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
|||
}
|
||||
|
||||
if (action.shouldVisitImplicitNames) {
|
||||
for(IASTImplicitName name : getImplicitNames()) {
|
||||
for (IASTImplicitName name : getImplicitNames()) {
|
||||
if (!name.accept(action)) return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue