mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cosmetics.
This commit is contained in:
parent
9e2fb6a53a
commit
f2a7c68c5f
7 changed files with 26 additions and 29 deletions
|
@ -6,12 +6,11 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Andrew Niefer (IBM Corporation) - initial API and implementation
|
* Andrew Niefer (IBM Corporation) - initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.core.dom.ast.cpp;
|
package org.eclipse.cdt.core.dom.ast.cpp;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for class scopes.
|
* Interface for class scopes.
|
||||||
*
|
*
|
||||||
|
@ -20,8 +19,7 @@ package org.eclipse.cdt.core.dom.ast.cpp;
|
||||||
*/
|
*/
|
||||||
public interface ICPPClassScope extends ICPPScope {
|
public interface ICPPClassScope extends ICPPScope {
|
||||||
/**
|
/**
|
||||||
* Get the binding for the class this scope is associated with
|
* Returns the binding for the class this scope is associated with.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
ICPPClassType getClassType();
|
ICPPClassType getClassType();
|
||||||
|
|
||||||
|
@ -30,7 +28,6 @@ public interface ICPPClassScope extends ICPPScope {
|
||||||
* scope. These methods may or may not have been explicitly declared in the
|
* scope. These methods may or may not have been explicitly declared in the
|
||||||
* code. The methods that will be implicitly declared are: the default
|
* code. The methods that will be implicitly declared are: the default
|
||||||
* constructor, copy constructor, copy assignment operator, and destructor
|
* constructor, copy constructor, copy assignment operator, and destructor
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public ICPPMethod[] getImplicitMethods();
|
public ICPPMethod[] getImplicitMethods();
|
||||||
|
|
||||||
|
|
|
@ -86,18 +86,17 @@ public interface ICPPClassType extends ICompositeType, ICPPBinding {
|
||||||
* Returns an array of ICPPConstructor objects representing the constructors
|
* Returns an array of ICPPConstructor objects representing the constructors
|
||||||
* for this class. This list includes both declared and implicit
|
* for this class. This list includes both declared and implicit
|
||||||
* constructors.
|
* constructors.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public ICPPConstructor[] getConstructors();
|
public ICPPConstructor[] getConstructors();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return an array of bindings for those classes/functions declared as
|
* Returns an array of bindings for those classes/functions declared as
|
||||||
* friends of this class.
|
* friends of this class.
|
||||||
*/
|
*/
|
||||||
public IBinding[] getFriends();
|
public IBinding[] getFriends();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return an array of nested classes/structures
|
* Returns an array of nested classes/structures
|
||||||
*/
|
*/
|
||||||
public ICPPClassType[] getNestedClasses();
|
public ICPPClassType[] getNestedClasses();
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,10 +6,10 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Andrew Niefer (IBM) - Initial API and implementation
|
* Andrew Niefer (IBM) - Initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
* Bryan Wilkinson (QNX)
|
* Bryan Wilkinson (QNX)
|
||||||
* Andrew Ferguson (Symbian)
|
* Andrew Ferguson (Symbian)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Sergey Prigogin (Google) - initial API and implementation
|
* Sergey Prigogin (Google) - initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,10 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
||||||
|
|
||||||
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.*;
|
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.ALLCVQ;
|
||||||
|
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.CVTYPE;
|
||||||
|
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.REF;
|
||||||
|
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.TDEF;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
@ -80,7 +83,7 @@ class BuiltinOperators {
|
||||||
Object[] globCandidates) {
|
Object[] globCandidates) {
|
||||||
fFileScope= point.getTranslationUnit().getScope();
|
fFileScope= point.getTranslationUnit().getScope();
|
||||||
fOperator= operator;
|
fOperator= operator;
|
||||||
fUnary= args.length<2;
|
fUnary= args.length < 2;
|
||||||
fGlobalCandidates= globCandidates;
|
fGlobalCandidates= globCandidates;
|
||||||
if (args.length > 0) {
|
if (args.length > 0) {
|
||||||
IType type= args[0].getTypeOrFunctionSet(point);
|
IType type= args[0].getTypeOrFunctionSet(point);
|
||||||
|
@ -95,7 +98,6 @@ class BuiltinOperators {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private ICPPFunction[] create() {
|
private ICPPFunction[] create() {
|
||||||
switch (fOperator) {
|
switch (fOperator) {
|
||||||
case ARROW:
|
case ARROW:
|
||||||
|
@ -231,8 +233,6 @@ class BuiltinOperators {
|
||||||
return fResult.toArray(new ICPPFunction[fResult.size()]);
|
return fResult.toArray(new ICPPFunction[fResult.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 13.6-3, 13.6-4, 13.6-5
|
// 13.6-3, 13.6-4, 13.6-5
|
||||||
private void opIncOrDec() {
|
private void opIncOrDec() {
|
||||||
IType[] types= getClassConversionTypes(FIRST);
|
IType[] types= getClassConversionTypes(FIRST);
|
||||||
|
@ -424,7 +424,6 @@ class BuiltinOperators {
|
||||||
return p1;
|
return p1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 13.6-13, 13.6.14
|
// 13.6-13, 13.6.14
|
||||||
private void pointerArithmetic(boolean useRef, boolean isDiff) {
|
private void pointerArithmetic(boolean useRef, boolean isDiff) {
|
||||||
IType[] types= getClassConversionTypes(FIRST);
|
IType[] types= getClassConversionTypes(FIRST);
|
||||||
|
|
|
@ -6,11 +6,10 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the possible cv-qualification of a type.
|
* Represents the possible cv-qualification of a type.
|
||||||
*/
|
*/
|
||||||
|
@ -23,16 +22,19 @@ public enum CVQualifier {
|
||||||
private static final int R = 4;
|
private static final int R = 4;
|
||||||
|
|
||||||
final private int fQualifiers;
|
final private int fQualifiers;
|
||||||
|
|
||||||
private CVQualifier(int qualifiers) {
|
private CVQualifier(int qualifiers) {
|
||||||
fQualifiers= qualifiers;
|
fQualifiers= qualifiers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isConst() {
|
public boolean isConst() {
|
||||||
return (fQualifiers & C) != 0;
|
return (fQualifiers & C) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isVolatile() {
|
public boolean isVolatile() {
|
||||||
return (fQualifiers & V) != 0;
|
return (fQualifiers & V) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isRestrict() {
|
public boolean isRestrict() {
|
||||||
return (fQualifiers & R) != 0;
|
return (fQualifiers & R) != 0;
|
||||||
}
|
}
|
||||||
|
@ -54,7 +56,7 @@ public enum CVQualifier {
|
||||||
}
|
}
|
||||||
|
|
||||||
private CVQualifier fromQualifier(final int q) {
|
private CVQualifier fromQualifier(final int q) {
|
||||||
switch(q) {
|
switch (q) {
|
||||||
case C|V|R: return CONST_VOLATILE_RESTRICT;
|
case C|V|R: return CONST_VOLATILE_RESTRICT;
|
||||||
case V|R: return VOLATILE_RESTRICT;
|
case V|R: return VOLATILE_RESTRICT;
|
||||||
case C|R: return CONST_RESTRICT;
|
case C|R: return CONST_RESTRICT;
|
||||||
|
@ -65,7 +67,7 @@ public enum CVQualifier {
|
||||||
case 0: default: return NONE;
|
case 0: default: return NONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [3.9.3-4] Implements cv-qualification (partial) comparison. There is a (partial)
|
* [3.9.3-4] Implements cv-qualification (partial) comparison. There is a (partial)
|
||||||
* ordering on cv-qualifiers, so that a type can be said to be more
|
* ordering on cv-qualifiers, so that a type can be said to be more
|
||||||
|
@ -83,12 +85,12 @@ public enum CVQualifier {
|
||||||
* </ul>
|
* </ul>
|
||||||
*/
|
*/
|
||||||
public int partialComparison(CVQualifier cv2) {
|
public int partialComparison(CVQualifier cv2) {
|
||||||
// same qualifications
|
// Same qualifications.
|
||||||
if (this == cv2)
|
if (this == cv2)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!isAtLeastAsQualifiedAs(cv2))
|
if (!isAtLeastAsQualifiedAs(cv2))
|
||||||
return -1;
|
return -1;
|
||||||
return fQualifiers-cv2.fQualifiers;
|
return fQualifiers - cv2.fQualifiers;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue