1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2013-05-15 17:49:42 -07:00
parent 149937682f
commit 06bcfad238
4 changed files with 33 additions and 57 deletions

View file

@ -23,25 +23,25 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
* An example is GCC built-in functions.
*/
public class CPPImplicitFunction extends CPPFunction {
private ICPPParameter[] parms=null;
private IScope scope=null;
private ICPPFunctionType functionType=null;
private ICPPParameter[] parms;
private IScope scope;
private ICPPFunctionType functionType;
private final boolean takesVarArgs;
private boolean isDeleted;
private final char[] name;
public CPPImplicitFunction(char[] name, IScope scope, ICPPFunctionType type, ICPPParameter[] parms, boolean takesVarArgs) {
super( null );
this.name=name;
this.scope=scope;
public CPPImplicitFunction(char[] name, IScope scope, ICPPFunctionType type,
ICPPParameter[] parms, boolean takesVarArgs) {
super(null);
this.name= name;
this.scope= scope;
this.functionType= type;
this.parms=parms;
this.takesVarArgs=takesVarArgs;
this.parms= parms;
this.takesVarArgs= takesVarArgs;
}
@Override
public ICPPParameter [] getParameters() {
public ICPPParameter[] getParameters() {
return parms;
}
@ -52,27 +52,19 @@ public class CPPImplicitFunction extends CPPFunction {
@Override
public String getName() {
return String.valueOf( name );
return String.valueOf(name);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IBinding#getNameCharArray()
*/
@Override
public char[] getNameCharArray() {
return name;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IBinding#getScope()
*/
@Override
public IScope getScope() {
return scope;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IFunction#getFunctionScope()
*/
@Override
public IScope getFunctionScope() {
return null;

View file

@ -61,17 +61,18 @@ public class CPPImplicitMethod extends CPPImplicitFunction implements ICPPMethod
}
if (parent instanceof IASTCompositeTypeSpecifier) {
IASTCompositeTypeSpecifier cls = (IASTCompositeTypeSpecifier) decl.getParent();
IASTDeclaration [] members = cls.getMembers();
IASTDeclaration[] members = cls.getMembers();
ICPPASTVisibilityLabel vis = null;
for (IASTDeclaration member : members) {
if( member instanceof ICPPASTVisibilityLabel )
if (member instanceof ICPPASTVisibilityLabel) {
vis = (ICPPASTVisibilityLabel) member;
else if( member == decl )
} else if (member == decl) {
break;
}
if( vis != null ){
}
if (vis != null) {
return vis.getVisibility();
} else if( cls.getKey() == ICPPASTCompositeTypeSpecifier.k_class ){
} else if (cls.getKey() == ICPPASTCompositeTypeSpecifier.k_class) {
return ICPPASTVisibilityLabel.v_private;
}
}
@ -80,7 +81,7 @@ public class CPPImplicitMethod extends CPPImplicitFunction implements ICPPMethod
@Override
public ICPPClassType getClassOwner() {
ICPPClassScope scope = (ICPPClassScope)getScope();
ICPPClassScope scope = (ICPPClassScope) getScope();
return scope.getClassType();
}
@ -167,8 +168,8 @@ public class CPPImplicitMethod extends CPPImplicitFunction implements ICPPMethod
@Override
public boolean isDestructor() {
char [] n = getNameCharArray();
if( n != null && n.length > 0 )
char[] n = getNameCharArray();
if (n != null && n.length > 0)
return n[0] == '~';
return false;
}

View file

@ -131,8 +131,8 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
dtor= ASTQueries.findInnermostDeclarator(dtor);
IASTName name= dtor.getName();
if (name instanceof ICPPASTQualifiedName) {
IASTName[] ns = ((ICPPASTQualifiedName)name).getNames();
name = ns[ ns.length - 1 ];
IASTName[] ns = ((ICPPASTQualifiedName) name).getNames();
name = ns[ns.length - 1];
}
return name;
}
@ -142,9 +142,6 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
return CPPVisitor.getContainingScope(getASTName());
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod#isVirtual()
*/
@Override
public boolean isVirtual() {
IASTDeclaration decl = getPrimaryDeclaration();
@ -167,9 +164,6 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
return declSpec;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction#isInline()
*/
@Override
public boolean isInline() {
IASTDeclaration decl = getPrimaryDeclaration();
@ -182,9 +176,6 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
return declSpec.isInline();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction#isMutable()
*/
@Override
public boolean isMutable() {
return hasStorageClass(this, IASTDeclSpecifier.sc_mutable);
@ -202,9 +193,6 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
return false;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod#isDestructor()
*/
@Override
public boolean isDestructor() {
char[] name = getNameCharArray();
@ -219,9 +207,6 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
return false;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod#isPureVirtual()
*/
@Override
public boolean isPureVirtual() {
ICPPASTFunctionDeclarator declarator = findFunctionDeclarator();

View file

@ -12,9 +12,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
import org.eclipse.cdt.core.dom.ast.DOMException;
@ -40,6 +37,9 @@ import org.eclipse.cdt.internal.core.pdom.db.IString;
import org.eclipse.cdt.internal.core.pdom.tag.PDOMTaggable;
import org.eclipse.core.runtime.CoreException;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
/**
* Base class for bindings in the PDOM.
*/
@ -255,11 +255,9 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IPDOMBinding
}
@Override
abstract protected int getRecordSize(); // superclass's implementation is no longer valid
abstract protected int getRecordSize(); // Superclass's implementation is no longer valid
/* For debug purposes only.
* @see java.lang.Object#toString()
*/
/** For debug purposes only. */
@Override
public final String toString() {
String name = toStringBase();
@ -300,9 +298,9 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IPDOMBinding
return field.getName();
}
}
} catch (IllegalAccessException iae) {
} catch (IllegalAccessException e) {
continue;
} catch (IllegalArgumentException iae) {
} catch (IllegalArgumentException e) {
continue;
}
}