mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Cosmetics.
This commit is contained in:
parent
149937682f
commit
06bcfad238
4 changed files with 33 additions and 57 deletions
|
@ -23,15 +23,15 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
|
||||||
* An example is GCC built-in functions.
|
* An example is GCC built-in functions.
|
||||||
*/
|
*/
|
||||||
public class CPPImplicitFunction extends CPPFunction {
|
public class CPPImplicitFunction extends CPPFunction {
|
||||||
|
private ICPPParameter[] parms;
|
||||||
private ICPPParameter[] parms=null;
|
private IScope scope;
|
||||||
private IScope scope=null;
|
private ICPPFunctionType functionType;
|
||||||
private ICPPFunctionType functionType=null;
|
|
||||||
private final boolean takesVarArgs;
|
private final boolean takesVarArgs;
|
||||||
private boolean isDeleted;
|
private boolean isDeleted;
|
||||||
private final char[] name;
|
private final char[] name;
|
||||||
|
|
||||||
public CPPImplicitFunction(char[] name, IScope scope, ICPPFunctionType type, ICPPParameter[] parms, boolean takesVarArgs) {
|
public CPPImplicitFunction(char[] name, IScope scope, ICPPFunctionType type,
|
||||||
|
ICPPParameter[] parms, boolean takesVarArgs) {
|
||||||
super(null);
|
super(null);
|
||||||
this.name= name;
|
this.name= name;
|
||||||
this.scope= scope;
|
this.scope= scope;
|
||||||
|
@ -55,24 +55,16 @@ public class CPPImplicitFunction extends CPPFunction {
|
||||||
return String.valueOf(name);
|
return String.valueOf(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IBinding#getNameCharArray()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public char[] getNameCharArray() {
|
public char[] getNameCharArray() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IBinding#getScope()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public IScope getScope() {
|
public IScope getScope() {
|
||||||
return scope;
|
return scope;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IFunction#getFunctionScope()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public IScope getFunctionScope() {
|
public IScope getFunctionScope() {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -64,11 +64,12 @@ public class CPPImplicitMethod extends CPPImplicitFunction implements ICPPMethod
|
||||||
IASTDeclaration[] members = cls.getMembers();
|
IASTDeclaration[] members = cls.getMembers();
|
||||||
ICPPASTVisibilityLabel vis = null;
|
ICPPASTVisibilityLabel vis = null;
|
||||||
for (IASTDeclaration member : members) {
|
for (IASTDeclaration member : members) {
|
||||||
if( member instanceof ICPPASTVisibilityLabel )
|
if (member instanceof ICPPASTVisibilityLabel) {
|
||||||
vis = (ICPPASTVisibilityLabel) member;
|
vis = (ICPPASTVisibilityLabel) member;
|
||||||
else if( member == decl )
|
} else if (member == decl) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (vis != null) {
|
if (vis != null) {
|
||||||
return vis.getVisibility();
|
return vis.getVisibility();
|
||||||
} else if (cls.getKey() == ICPPASTCompositeTypeSpecifier.k_class) {
|
} else if (cls.getKey() == ICPPASTCompositeTypeSpecifier.k_class) {
|
||||||
|
|
|
@ -142,9 +142,6 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
|
||||||
return CPPVisitor.getContainingScope(getASTName());
|
return CPPVisitor.getContainingScope(getASTName());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod#isVirtual()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isVirtual() {
|
public boolean isVirtual() {
|
||||||
IASTDeclaration decl = getPrimaryDeclaration();
|
IASTDeclaration decl = getPrimaryDeclaration();
|
||||||
|
@ -167,9 +164,6 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
|
||||||
return declSpec;
|
return declSpec;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction#isInline()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isInline() {
|
public boolean isInline() {
|
||||||
IASTDeclaration decl = getPrimaryDeclaration();
|
IASTDeclaration decl = getPrimaryDeclaration();
|
||||||
|
@ -182,9 +176,6 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
|
||||||
return declSpec.isInline();
|
return declSpec.isInline();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction#isMutable()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isMutable() {
|
public boolean isMutable() {
|
||||||
return hasStorageClass(this, IASTDeclSpecifier.sc_mutable);
|
return hasStorageClass(this, IASTDeclSpecifier.sc_mutable);
|
||||||
|
@ -202,9 +193,6 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod#isDestructor()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isDestructor() {
|
public boolean isDestructor() {
|
||||||
char[] name = getNameCharArray();
|
char[] name = getNameCharArray();
|
||||||
|
@ -219,9 +207,6 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod#isPureVirtual()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isPureVirtual() {
|
public boolean isPureVirtual() {
|
||||||
ICPPASTFunctionDeclarator declarator = findFunctionDeclarator();
|
ICPPASTFunctionDeclarator declarator = findFunctionDeclarator();
|
||||||
|
|
|
@ -12,9 +12,6 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.pdom.dom;
|
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.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
|
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
|
||||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
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.cdt.internal.core.pdom.tag.PDOMTaggable;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.lang.reflect.Modifier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class for bindings in the PDOM.
|
* Base class for bindings in the PDOM.
|
||||||
*/
|
*/
|
||||||
|
@ -255,11 +255,9 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IPDOMBinding
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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.
|
/** For debug purposes only. */
|
||||||
* @see java.lang.Object#toString()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public final String toString() {
|
public final String toString() {
|
||||||
String name = toStringBase();
|
String name = toStringBase();
|
||||||
|
@ -300,9 +298,9 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IPDOMBinding
|
||||||
return field.getName();
|
return field.getName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IllegalAccessException iae) {
|
} catch (IllegalAccessException e) {
|
||||||
continue;
|
continue;
|
||||||
} catch (IllegalArgumentException iae) {
|
} catch (IllegalArgumentException e) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue