mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 01:36:01 +02:00
Cosmetics.
This commit is contained in:
parent
3edce39739
commit
c09afdc574
6 changed files with 77 additions and 85 deletions
|
@ -19,10 +19,9 @@ import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.IValue;
|
import org.eclipse.cdt.core.dom.ast.IValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class for c- and c++ enumerators.
|
* Base class for C and C++ enumerators.
|
||||||
*/
|
*/
|
||||||
public abstract class ASTEnumerator extends ASTNode implements IASTEnumerator, IASTAmbiguityParent {
|
public abstract class ASTEnumerator extends ASTNode implements IASTEnumerator, IASTAmbiguityParent {
|
||||||
|
|
||||||
private IASTName name;
|
private IASTName name;
|
||||||
private IASTExpression value;
|
private IASTExpression value;
|
||||||
private IValue integralValue;
|
private IValue integralValue;
|
||||||
|
@ -76,8 +75,8 @@ public abstract class ASTEnumerator extends ASTNode implements IASTEnumerator, I
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( name != null ) if( !name.accept( action ) ) return false;
|
if (name != null && !name.accept(action)) return false;
|
||||||
if( value != null ) if( !value.accept( action ) ) return false;
|
if (value != null && !value.accept(action)) return false;
|
||||||
if (action.shouldVisitEnumerators) {
|
if (action.shouldVisitEnumerators) {
|
||||||
switch (action.leave(this)) {
|
switch (action.leave(this)) {
|
||||||
case ASTVisitor.PROCESS_ABORT: return false;
|
case ASTVisitor.PROCESS_ABORT: return false;
|
||||||
|
@ -88,7 +87,6 @@ public abstract class ASTEnumerator extends ASTNode implements IASTEnumerator, I
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int getRoleForName(IASTName n) {
|
public int getRoleForName(IASTName n) {
|
||||||
if (n == name)
|
if (n == name)
|
||||||
return r_definition;
|
return r_definition;
|
||||||
|
@ -97,8 +95,7 @@ public abstract class ASTEnumerator extends ASTNode implements IASTEnumerator, I
|
||||||
}
|
}
|
||||||
|
|
||||||
public void replace(IASTNode child, IASTNode other) {
|
public void replace(IASTNode child, IASTNode other) {
|
||||||
if( child == value)
|
if (child == value) {
|
||||||
{
|
|
||||||
other.setPropertyInParent(child.getPropertyInParent());
|
other.setPropertyInParent(child.getPropertyInParent());
|
||||||
other.setParent(child.getParent());
|
other.setParent(child.getParent());
|
||||||
value = (IASTExpression) other;
|
value = (IASTExpression) other;
|
||||||
|
|
|
@ -20,12 +20,10 @@ import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
|
||||||
/**
|
/**
|
||||||
* @author jcamelon
|
* @author jcamelon
|
||||||
*/
|
*/
|
||||||
public class CPPASTDeclarationStatement extends ASTNode implements
|
public class CPPASTDeclarationStatement extends ASTNode
|
||||||
IASTDeclarationStatement, IASTAmbiguityParent {
|
implements IASTDeclarationStatement, IASTAmbiguityParent {
|
||||||
|
|
||||||
private IASTDeclaration declaration;
|
private IASTDeclaration declaration;
|
||||||
|
|
||||||
|
|
||||||
public CPPASTDeclarationStatement() {
|
public CPPASTDeclarationStatement() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +67,7 @@ public class CPPASTDeclarationStatement extends ASTNode implements
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( declaration != null ) if( !declaration.accept( action ) ) return false;
|
if (declaration != null && !declaration.accept(action)) return false;
|
||||||
if (action.shouldVisitStatements) {
|
if (action.shouldVisitStatements) {
|
||||||
switch (action.leave(this)) {
|
switch (action.leave(this)) {
|
||||||
case ASTVisitor.PROCESS_ABORT: return false;
|
case ASTVisitor.PROCESS_ABORT: return false;
|
||||||
|
@ -81,8 +79,7 @@ public class CPPASTDeclarationStatement extends ASTNode implements
|
||||||
}
|
}
|
||||||
|
|
||||||
public void replace(IASTNode child, IASTNode other) {
|
public void replace(IASTNode child, IASTNode other) {
|
||||||
if( declaration == child )
|
if (declaration == child) {
|
||||||
{
|
|
||||||
other.setParent(child.getParent());
|
other.setParent(child.getParent());
|
||||||
other.setPropertyInParent(child.getPropertyInParent());
|
other.setPropertyInParent(child.getPropertyInParent());
|
||||||
declaration = (IASTDeclaration) other;
|
declaration = (IASTDeclaration) other;
|
||||||
|
|
|
@ -2042,7 +2042,6 @@ public class CPPSemantics {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (fns.size() > 0) {
|
if (fns.size() > 0) {
|
||||||
final ICPPFunction[] fnArray = fns.keyArray(ICPPFunction.class);
|
final ICPPFunction[] fnArray = fns.keyArray(ICPPFunction.class);
|
||||||
if (type != null && overrulesByRelevance(data, type, fnArray)) {
|
if (type != null && overrulesByRelevance(data, type, fnArray)) {
|
||||||
|
@ -2352,7 +2351,6 @@ public class CPPSemantics {
|
||||||
if (tmp.length == 0 || tmp[0] == null)
|
if (tmp.length == 0 || tmp[0] == null)
|
||||||
return new ProblemBinding(data.astName, IProblemBinding.SEMANTIC_NAME_NOT_FOUND, fns);
|
return new ProblemBinding(data.astName, IProblemBinding.SEMANTIC_NAME_NOT_FOUND, fns);
|
||||||
|
|
||||||
|
|
||||||
int viableCount= 0;
|
int viableCount= 0;
|
||||||
for (IFunction f : tmp) {
|
for (IFunction f : tmp) {
|
||||||
if (f instanceof ICPPUnknownBinding) {
|
if (f instanceof ICPPUnknownBinding) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue