1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Override annotations.

This commit is contained in:
Sergey Prigogin 2011-12-05 19:40:53 -08:00
parent 02c9e05cd5
commit b140bf8ba6
4 changed files with 19 additions and 14 deletions

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Doug Schaefer (IBM) - Initial API and implementation
* Doug Schaefer (IBM) - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast;
@ -17,11 +17,10 @@ package org.eclipse.cdt.core.dom.ast;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IASTDeclarator extends IASTNode, IASTNameOwner {
/**
* Constant - empty declarator array
*/
public static final IASTDeclarator[] EMPTY_DECLARATOR_ARRAY = new IASTDeclarator[0];
public static final IASTDeclarator[] EMPTY_DECLARATOR_ARRAY = {};
/**
* <code>POINTER_OPERATOR</code> represents the relationship between an
@ -111,10 +110,12 @@ public interface IASTDeclarator extends IASTNode, IASTNameOwner {
/**
* @since 5.1
*/
@Override
public IASTDeclarator copy();
/**
* @since 5.3
*/
@Override
public IASTDeclarator copy(CopyStyle style);
}

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Doug Schaefer (IBM) - Initial API and implementation
* Doug Schaefer (IBM) - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast;
@ -15,19 +15,20 @@ package org.eclipse.cdt.core.dom.ast;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IASTPointerOperator extends IASTNode {
/**
* Constant/sentinel.
*/
public static final IASTPointerOperator[] EMPTY_ARRAY = new IASTPointerOperator[0];
public static final IASTPointerOperator[] EMPTY_ARRAY = {};
/**
* @since 5.1
*/
@Override
public IASTPointerOperator copy();
/**
* @since 5.3
*/
@Override
public IASTPointerOperator copy(CopyStyle style);
}

View file

@ -6,8 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Doug Schaefer (IBM) - Initial API and implementation
* Markus Schorn (Wind River Systems)
* Doug Schaefer (IBM) - Initial API and implementation
* Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast.cpp;
@ -20,7 +20,6 @@ import org.eclipse.cdt.core.dom.ast.IASTPointerOperator;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ICPPASTReferenceOperator extends IASTPointerOperator {
/**
* Returns whether the operator denotes a rvalue reference (e.g. <code>int &&</code>).
* @since 5.2
@ -30,10 +29,12 @@ public interface ICPPASTReferenceOperator extends IASTPointerOperator {
/**
* @since 5.1
*/
@Override
public ICPPASTReferenceOperator copy();
/**
* @since 5.3
*/
@Override
public ICPPASTReferenceOperator copy(CopyStyle style);
}

View file

@ -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;
@ -19,21 +19,23 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
* Reference operator for declarators.
*/
public class CPPASTReferenceOperator extends ASTNode implements ICPPASTReferenceOperator {
private final boolean fIsRValue;
public CPPASTReferenceOperator(boolean isRValueReference) {
fIsRValue= isRValueReference;
}
@Override
public boolean isRValueReference() {
return fIsRValue;
}
@Override
public CPPASTReferenceOperator copy() {
return copy(CopyStyle.withoutLocations);
}
@Override
public CPPASTReferenceOperator copy(CopyStyle style) {
CPPASTReferenceOperator copy = new CPPASTReferenceOperator(fIsRValue);
copy.setOffsetAndLength(this);
@ -47,8 +49,8 @@ public class CPPASTReferenceOperator extends ASTNode implements ICPPASTReference
public boolean accept(ASTVisitor action) {
if (action.shouldVisitPointerOperators) {
switch (action.visit(this)) {
case ASTVisitor.PROCESS_ABORT : return false;
case ASTVisitor.PROCESS_SKIP : return true;
case ASTVisitor.PROCESS_ABORT: return false;
case ASTVisitor.PROCESS_SKIP: return true;
}
if (action.leave(this) == ASTVisitor.PROCESS_ABORT)
return false;