mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 01:35:39 +02:00
Cosmetics.
This commit is contained in:
parent
ec30f112e9
commit
a8433e7887
2 changed files with 68 additions and 57 deletions
|
@ -10,6 +10,7 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.c;
|
package org.eclipse.cdt.internal.core.dom.parser.c;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
|
||||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IArrayType;
|
import org.eclipse.cdt.core.dom.ast.IArrayType;
|
||||||
|
@ -24,9 +25,8 @@ import org.eclipse.cdt.internal.core.index.IIndexType;
|
||||||
* @author dsteffle
|
* @author dsteffle
|
||||||
*/
|
*/
|
||||||
public class CArrayType implements ICArrayType, ITypeContainer {
|
public class CArrayType implements ICArrayType, ITypeContainer {
|
||||||
|
IType type;
|
||||||
IType type = null;
|
ICASTArrayModifier mod;
|
||||||
ICASTArrayModifier mod = null;
|
|
||||||
|
|
||||||
public CArrayType(IType type) {
|
public CArrayType(IType type) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
@ -51,7 +51,7 @@ public class CArrayType implements ICArrayType, ITypeContainer {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// work around for bug 182976, no PDOMCArrayType.
|
// Workaround for bug 182976, no PDOMCArrayType.
|
||||||
else if (obj instanceof IArrayType && obj instanceof IIndexType) {
|
else if (obj instanceof IArrayType && obj instanceof IIndexType) {
|
||||||
return obj.isSameType(this);
|
return obj.isSameType(this);
|
||||||
}
|
}
|
||||||
|
@ -113,17 +113,6 @@ public class CArrayType implements ICArrayType, ITypeContainer {
|
||||||
return mod.isVariableSized();
|
return mod.isVariableSized();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object clone(){
|
|
||||||
IType t = null;
|
|
||||||
try {
|
|
||||||
t = (IType) super.clone();
|
|
||||||
} catch ( CloneNotSupportedException e ) {
|
|
||||||
//not going to happen
|
|
||||||
}
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ICASTArrayModifier getModifier() {
|
public ICASTArrayModifier getModifier() {
|
||||||
return mod;
|
return mod;
|
||||||
}
|
}
|
||||||
|
@ -136,4 +125,20 @@ public class CArrayType implements ICArrayType, ITypeContainer {
|
||||||
return mod.getConstantExpression();
|
return mod.getConstantExpression();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
IType t = null;
|
||||||
|
try {
|
||||||
|
t = (IType) super.clone();
|
||||||
|
} catch (CloneNotSupportedException e) {
|
||||||
|
// Not going to happen
|
||||||
|
}
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return ASTTypeUtil.getType(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
*/
|
*/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
|
||||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IArrayType;
|
import org.eclipse.cdt.core.dom.ast.IArrayType;
|
||||||
|
@ -25,8 +26,8 @@ import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer;
|
||||||
* @author aniefer
|
* @author aniefer
|
||||||
*/
|
*/
|
||||||
public class CPPArrayType implements IArrayType, ITypeContainer {
|
public class CPPArrayType implements IArrayType, ITypeContainer {
|
||||||
private IType type = null;
|
private IType type;
|
||||||
private IASTExpression sizeExpression = null;
|
private IASTExpression sizeExpression;
|
||||||
|
|
||||||
public CPPArrayType(IType type) {
|
public CPPArrayType(IType type) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
@ -63,21 +64,26 @@ public class CPPArrayType implements IArrayType, ITypeContainer {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object clone(){
|
|
||||||
IType t = null;
|
|
||||||
try {
|
|
||||||
t = (IType) super.clone();
|
|
||||||
} catch ( CloneNotSupportedException e ) {
|
|
||||||
//not going to happen
|
|
||||||
}
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IArrayType#getArraySizeExpression()
|
* @see org.eclipse.cdt.core.dom.ast.IArrayType#getArraySizeExpression()
|
||||||
*/
|
*/
|
||||||
public IASTExpression getArraySizeExpression() {
|
public IASTExpression getArraySizeExpression() {
|
||||||
return sizeExpression;
|
return sizeExpression;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
IType t = null;
|
||||||
|
try {
|
||||||
|
t = (IType) super.clone();
|
||||||
|
} catch (CloneNotSupportedException e) {
|
||||||
|
// Not going to happen
|
||||||
|
}
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return ASTTypeUtil.getType(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue