mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-02 13:55:39 +02:00
Cosmetics.
This commit is contained in:
parent
0e152439bd
commit
eb31f64c07
2 changed files with 17 additions and 21 deletions
|
@ -41,12 +41,10 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics;
|
||||||
*/
|
*/
|
||||||
public class CPPASTConstructorChainInitializer extends ASTNode implements
|
public class CPPASTConstructorChainInitializer extends ASTNode implements
|
||||||
ICPPASTConstructorChainInitializer, IASTCompletionContext {
|
ICPPASTConstructorChainInitializer, IASTCompletionContext {
|
||||||
|
|
||||||
private IASTName name;
|
private IASTName name;
|
||||||
private IASTInitializer initializer;
|
private IASTInitializer initializer;
|
||||||
private boolean fIsPackExpansion;
|
private boolean fIsPackExpansion;
|
||||||
|
|
||||||
|
|
||||||
public CPPASTConstructorChainInitializer() {
|
public CPPASTConstructorChainInitializer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +61,7 @@ public class CPPASTConstructorChainInitializer extends ASTNode implements
|
||||||
copy.fIsPackExpansion= fIsPackExpansion;
|
copy.fIsPackExpansion= fIsPackExpansion;
|
||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IASTName getMemberInitializerId() {
|
public IASTName getMemberInitializerId() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
@ -71,7 +69,7 @@ public class CPPASTConstructorChainInitializer extends ASTNode implements
|
||||||
public void setMemberInitializerId(IASTName name) {
|
public void setMemberInitializerId(IASTName name) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
this.name = name;
|
this.name = name;
|
||||||
if(name != null) {
|
if (name != null) {
|
||||||
name.setParent(this);
|
name.setParent(this);
|
||||||
name.setPropertyInParent(MEMBER_ID);
|
name.setPropertyInParent(MEMBER_ID);
|
||||||
}
|
}
|
||||||
|
@ -84,7 +82,7 @@ public class CPPASTConstructorChainInitializer extends ASTNode implements
|
||||||
public void setInitializer(IASTInitializer init) {
|
public void setInitializer(IASTInitializer init) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
initializer = init;
|
initializer = init;
|
||||||
if(init != null) {
|
if (init != null) {
|
||||||
init.setParent(this);
|
init.setParent(this);
|
||||||
init.setPropertyInParent(INITIALIZER);
|
init.setPropertyInParent(INITIALIZER);
|
||||||
}
|
}
|
||||||
|
@ -93,7 +91,7 @@ public class CPPASTConstructorChainInitializer extends ASTNode implements
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(ASTVisitor action) {
|
public boolean accept(ASTVisitor action) {
|
||||||
if (action.shouldVisitInitializers) {
|
if (action.shouldVisitInitializers) {
|
||||||
switch(action.visit(this)) {
|
switch (action.visit(this)) {
|
||||||
case ASTVisitor.PROCESS_ABORT:
|
case ASTVisitor.PROCESS_ABORT:
|
||||||
return false;
|
return false;
|
||||||
case ASTVisitor.PROCESS_SKIP:
|
case ASTVisitor.PROCESS_SKIP:
|
||||||
|
@ -102,13 +100,13 @@ public class CPPASTConstructorChainInitializer extends ASTNode implements
|
||||||
}
|
}
|
||||||
if (name != null && !name.accept(action))
|
if (name != null && !name.accept(action))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (initializer != null && !initializer.accept(action))
|
if (initializer != null && !initializer.accept(action))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (action.shouldVisitInitializers && action.leave(this) == ASTVisitor.PROCESS_ABORT)
|
if (action.shouldVisitInitializers && action.leave(this) == ASTVisitor.PROCESS_ABORT)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,7 +125,6 @@ public class CPPASTConstructorChainInitializer extends ASTNode implements
|
||||||
if ((bindings[i] instanceof ICPPField) || (bindings[i] instanceof ICPPNamespace)) {
|
if ((bindings[i] instanceof ICPPField) || (bindings[i] instanceof ICPPNamespace)) {
|
||||||
continue;
|
continue;
|
||||||
} else if (bindings[i] instanceof ICPPConstructor) {
|
} else if (bindings[i] instanceof ICPPConstructor) {
|
||||||
|
|
||||||
if (baseClasses == null) {
|
if (baseClasses == null) {
|
||||||
baseClasses = getBaseClasses(n);
|
baseClasses = getBaseClasses(n);
|
||||||
}
|
}
|
||||||
|
@ -161,10 +158,9 @@ public class CPPASTConstructorChainInitializer extends ASTNode implements
|
||||||
return specifier.getBaseSpecifiers();
|
return specifier.getBaseSpecifiers();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPackExpansion() {
|
public boolean isPackExpansion() {
|
||||||
return fIsPackExpansion;
|
return fIsPackExpansion;
|
||||||
}
|
}
|
||||||
|
@ -173,7 +169,7 @@ public class CPPASTConstructorChainInitializer extends ASTNode implements
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
fIsPackExpansion= val;
|
fIsPackExpansion= val;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public IASTExpression getInitializerValue() {
|
public IASTExpression getInitializerValue() {
|
||||||
if (initializer == null || initializer instanceof IASTExpression) {
|
if (initializer == null || initializer instanceof IASTExpression) {
|
||||||
|
|
|
@ -67,15 +67,15 @@ public class CPPASTConstructorInitializer extends ASTNode implements ICPPASTCons
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept( ASTVisitor action ){
|
public boolean accept(ASTVisitor action) {
|
||||||
if( action.shouldVisitInitializers ){
|
if (action.shouldVisitInitializers) {
|
||||||
switch( action.visit( this ) ){
|
switch (action.visit(this)) {
|
||||||
case ASTVisitor.PROCESS_ABORT : return false;
|
case ASTVisitor.PROCESS_ABORT: return false;
|
||||||
case ASTVisitor.PROCESS_SKIP : return true;
|
case ASTVisitor.PROCESS_SKIP: return true;
|
||||||
default : break;
|
default: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (IASTInitializerClause arg : fArguments) {
|
for (IASTInitializerClause arg : fArguments) {
|
||||||
if (!arg.accept(action))
|
if (!arg.accept(action))
|
||||||
return false;
|
return false;
|
||||||
|
@ -107,7 +107,7 @@ public class CPPASTConstructorInitializer extends ASTNode implements ICPPASTCons
|
||||||
return (IASTExpression) arg;
|
return (IASTExpression) arg;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
CPPASTExpressionList result= new CPPASTExpressionList();
|
CPPASTExpressionList result= new CPPASTExpressionList();
|
||||||
for (IASTInitializerClause arg : fArguments) {
|
for (IASTInitializerClause arg : fArguments) {
|
||||||
if (arg instanceof IASTExpression) {
|
if (arg instanceof IASTExpression) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue