mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-05 08:46:02 +02:00
@Override annotations.
This commit is contained in:
parent
2e5fcb513f
commit
da95eb2605
3 changed files with 54 additions and 25 deletions
|
@ -6,8 +6,8 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM - Initial API and implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
* IBM - Initial API and implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||
|
||||
|
@ -35,10 +35,10 @@ public class CPPASTFunctionDefinition extends ASTNode
|
|||
private IASTDeclSpecifier declSpecifier;
|
||||
private IASTFunctionDeclarator declarator;
|
||||
private IASTStatement bodyStatement;
|
||||
private ICPPASTConstructorChainInitializer[] memInits = null;
|
||||
private ICPPASTConstructorChainInitializer[] memInits;
|
||||
private int memInitPos= -1;
|
||||
private boolean fDeleted= false;
|
||||
private boolean fDefaulted= false;
|
||||
private boolean fDeleted;
|
||||
private boolean fDefaulted;
|
||||
|
||||
public CPPASTFunctionDefinition() {
|
||||
}
|
||||
|
@ -50,10 +50,12 @@ public class CPPASTFunctionDefinition extends ASTNode
|
|||
setBody(bodyStatement);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CPPASTFunctionDefinition copy() {
|
||||
return copy(CopyStyle.withoutLocations);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CPPASTFunctionDefinition copy(CopyStyle style) {
|
||||
CPPASTFunctionDefinition copy = new CPPASTFunctionDefinition();
|
||||
copy.setDeclSpecifier(declSpecifier == null ? null : declSpecifier.copy(style));
|
||||
|
@ -61,8 +63,7 @@ public class CPPASTFunctionDefinition extends ASTNode
|
|||
if (declarator != null) {
|
||||
IASTDeclarator outer = ASTQueries.findOutermostDeclarator(declarator);
|
||||
outer = outer.copy(style);
|
||||
copy.setDeclarator((IASTFunctionDeclarator) ASTQueries
|
||||
.findTypeRelevantDeclarator(outer));
|
||||
copy.setDeclarator((IASTFunctionDeclarator) ASTQueries.findTypeRelevantDeclarator(outer));
|
||||
}
|
||||
|
||||
copy.setBody(bodyStatement == null ? null : bodyStatement.copy(style));
|
||||
|
@ -79,11 +80,13 @@ public class CPPASTFunctionDefinition extends ASTNode
|
|||
return copy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IASTDeclSpecifier getDeclSpecifier() {
|
||||
return declSpecifier;
|
||||
}
|
||||
|
||||
public void setDeclSpecifier(IASTDeclSpecifier declSpec) {
|
||||
@Override
|
||||
public void setDeclSpecifier(IASTDeclSpecifier declSpec) {
|
||||
assertNotFrozen();
|
||||
declSpecifier = declSpec;
|
||||
if (declSpec != null) {
|
||||
|
@ -92,11 +95,13 @@ public class CPPASTFunctionDefinition extends ASTNode
|
|||
}
|
||||
}
|
||||
|
||||
public IASTFunctionDeclarator getDeclarator() {
|
||||
@Override
|
||||
public IASTFunctionDeclarator getDeclarator() {
|
||||
return declarator;
|
||||
}
|
||||
|
||||
public void setDeclarator(IASTFunctionDeclarator declarator) {
|
||||
@Override
|
||||
public void setDeclarator(IASTFunctionDeclarator declarator) {
|
||||
assertNotFrozen();
|
||||
this.declarator = declarator;
|
||||
if (declarator != null) {
|
||||
|
@ -106,11 +111,13 @@ public class CPPASTFunctionDefinition extends ASTNode
|
|||
}
|
||||
}
|
||||
|
||||
public IASTStatement getBody() {
|
||||
@Override
|
||||
public IASTStatement getBody() {
|
||||
return bodyStatement;
|
||||
}
|
||||
|
||||
public void setBody(IASTStatement statement) {
|
||||
@Override
|
||||
public void setBody(IASTStatement statement) {
|
||||
assertNotFrozen();
|
||||
bodyStatement = statement;
|
||||
if (statement != null) {
|
||||
|
@ -119,6 +126,7 @@ public class CPPASTFunctionDefinition extends ASTNode
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addMemberInitializer(ICPPASTConstructorChainInitializer initializer) {
|
||||
assertNotFrozen();
|
||||
if (initializer != null) {
|
||||
|
@ -128,6 +136,7 @@ public class CPPASTFunctionDefinition extends ASTNode
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICPPASTConstructorChainInitializer[] getMemberInitializers() {
|
||||
if (memInits == null)
|
||||
return ICPPASTConstructorChainInitializer.EMPTY_CONSTRUCTORCHAININITIALIZER_ARRAY;
|
||||
|
@ -136,23 +145,28 @@ public class CPPASTFunctionDefinition extends ASTNode
|
|||
ICPPASTConstructorChainInitializer.class, memInits, memInitPos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IScope getScope() {
|
||||
return ((ICPPASTFunctionDeclarator) declarator).getFunctionScope();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDefaulted() {
|
||||
return fDefaulted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDeleted() {
|
||||
return fDeleted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIsDefaulted(boolean isDefaulted) {
|
||||
assertNotFrozen();
|
||||
fDefaulted= isDefaulted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIsDeleted(boolean isDeleted) {
|
||||
assertNotFrozen();
|
||||
fDeleted= isDeleted;
|
||||
|
@ -203,6 +217,7 @@ public class CPPASTFunctionDefinition extends ASTNode
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replace(IASTNode child, IASTNode other) {
|
||||
if (bodyStatement == child) {
|
||||
other.setPropertyInParent(bodyStatement.getPropertyInParent());
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* John Camelon (IBM) - Initial API and implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
* John Camelon (IBM) - Initial API and implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||
|
||||
|
@ -24,15 +24,14 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates;
|
|||
/**
|
||||
* Represents a template declaration.
|
||||
*/
|
||||
public class CPPASTTemplateDeclaration extends ASTNode implements
|
||||
ICPPASTInternalTemplateDeclaration, IASTAmbiguityParent {
|
||||
|
||||
public class CPPASTTemplateDeclaration extends ASTNode
|
||||
implements ICPPASTInternalTemplateDeclaration, IASTAmbiguityParent {
|
||||
private boolean exported;
|
||||
private byte isAssociatedWithLastName= -1;
|
||||
private short nestingLevel= -1;
|
||||
private IASTDeclaration declaration;
|
||||
private ICPPTemplateScope templateScope;
|
||||
private ICPPASTTemplateParameter[] parameters = null;
|
||||
private ICPPASTTemplateParameter[] parameters;
|
||||
private int parametersPos= -1;
|
||||
|
||||
public CPPASTTemplateDeclaration() {
|
||||
|
@ -42,10 +41,12 @@ public class CPPASTTemplateDeclaration extends ASTNode implements
|
|||
setDeclaration(declaration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CPPASTTemplateDeclaration copy() {
|
||||
return copy(CopyStyle.withoutLocations);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CPPASTTemplateDeclaration copy(CopyStyle style) {
|
||||
CPPASTTemplateDeclaration copy = new CPPASTTemplateDeclaration();
|
||||
copy.setDeclaration(declaration == null ? null : declaration.copy(style));
|
||||
|
@ -59,20 +60,24 @@ public class CPPASTTemplateDeclaration extends ASTNode implements
|
|||
return copy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isExported() {
|
||||
return exported;
|
||||
}
|
||||
|
||||
public void setExported(boolean value) {
|
||||
@Override
|
||||
public void setExported(boolean value) {
|
||||
assertNotFrozen();
|
||||
exported = value;
|
||||
}
|
||||
|
||||
public IASTDeclaration getDeclaration() {
|
||||
@Override
|
||||
public IASTDeclaration getDeclaration() {
|
||||
return declaration;
|
||||
}
|
||||
|
||||
public void setDeclaration(IASTDeclaration declaration) {
|
||||
@Override
|
||||
public void setDeclaration(IASTDeclaration declaration) {
|
||||
assertNotFrozen();
|
||||
this.declaration = declaration;
|
||||
if (declaration != null) {
|
||||
|
@ -81,13 +86,15 @@ public class CPPASTTemplateDeclaration extends ASTNode implements
|
|||
}
|
||||
}
|
||||
|
||||
public ICPPASTTemplateParameter[] getTemplateParameters() {
|
||||
@Override
|
||||
public ICPPASTTemplateParameter[] getTemplateParameters() {
|
||||
if (parameters == null) return ICPPASTTemplateParameter.EMPTY_TEMPLATEPARAMETER_ARRAY;
|
||||
parameters = (ICPPASTTemplateParameter[]) ArrayUtil.removeNullsAfter(ICPPASTTemplateParameter.class, parameters, parametersPos);
|
||||
return parameters;
|
||||
}
|
||||
|
||||
public void addTemplateParameter(ICPPASTTemplateParameter parm) {
|
||||
@Override
|
||||
public void addTemplateParameter(ICPPASTTemplateParameter parm) {
|
||||
assertNotFrozen();
|
||||
if (parm != null) {
|
||||
parameters = (ICPPASTTemplateParameter[]) ArrayUtil.append(ICPPASTTemplateParameter.class, parameters, ++parametersPos, parm);
|
||||
|
@ -97,6 +104,7 @@ public class CPPASTTemplateDeclaration extends ASTNode implements
|
|||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void addTemplateParamter(ICPPASTTemplateParameter param) {
|
||||
addTemplateParameter(param);
|
||||
}
|
||||
|
@ -128,13 +136,15 @@ public class CPPASTTemplateDeclaration extends ASTNode implements
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICPPTemplateScope getScope() {
|
||||
if (templateScope == null)
|
||||
templateScope = new CPPTemplateScope(this);
|
||||
return templateScope;
|
||||
}
|
||||
|
||||
public void replace(IASTNode child, IASTNode other) {
|
||||
@Override
|
||||
public void replace(IASTNode child, IASTNode other) {
|
||||
if (declaration == child) {
|
||||
other.setParent(child.getParent());
|
||||
other.setPropertyInParent(child.getPropertyInParent());
|
||||
|
@ -142,6 +152,7 @@ public class CPPASTTemplateDeclaration extends ASTNode implements
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getNestingLevel() {
|
||||
if (nestingLevel == -1) {
|
||||
CPPTemplates.associateTemplateDeclarations(this);
|
||||
|
@ -150,6 +161,7 @@ public class CPPASTTemplateDeclaration extends ASTNode implements
|
|||
return nestingLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAssociatedWithLastName() {
|
||||
if (isAssociatedWithLastName == -1)
|
||||
CPPTemplates.associateTemplateDeclarations(this);
|
||||
|
@ -158,10 +170,12 @@ public class CPPASTTemplateDeclaration extends ASTNode implements
|
|||
return isAssociatedWithLastName != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAssociatedWithLastName(boolean value) {
|
||||
isAssociatedWithLastName= value ? (byte) 1 : (byte) 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNestingLevel(short level) {
|
||||
assert level >= 0;
|
||||
nestingLevel= level;
|
||||
|
|
|
@ -30,7 +30,7 @@ public class ASTLiteralNode implements IASTNode {
|
|||
public ASTLiteralNode(String code) {
|
||||
fCode= code;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getRawSignature() {
|
||||
return fCode;
|
||||
|
|
Loading…
Add table
Reference in a new issue