1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-08 16:55:38 +02:00

Cosmetics.

Change-Id: Idbdc12de9dc54acbb0e5da1c86260ad740dd895f
This commit is contained in:
Sergey Prigogin 2016-08-19 18:44:45 -07:00
parent 9f7fd16f22
commit 58543c6245
4 changed files with 23 additions and 26 deletions

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* John Camelon (IBM Rational Software) - Initial API and implementation * John Camelon (IBM Rational Software) - Initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.dom.ast.c; package org.eclipse.cdt.core.dom.ast.c;
@ -20,7 +20,6 @@ import org.eclipse.cdt.core.dom.ast.IASTNamedTypeSpecifier;
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.
*/ */
public interface ICASTTypedefNameSpecifier extends IASTNamedTypeSpecifier, ICASTDeclSpecifier { public interface ICASTTypedefNameSpecifier extends IASTNamedTypeSpecifier, ICASTDeclSpecifier {
/** /**
* @since 5.1 * @since 5.1
*/ */

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* John Camelon (IBM) - Initial API and implementation * John Camelon (IBM) - Initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.dom.ast.cpp; package org.eclipse.cdt.core.dom.ast.cpp;
@ -19,9 +19,7 @@ import org.eclipse.cdt.core.dom.ast.IASTNamedTypeSpecifier;
* @noextend This interface is not intended to be extended by clients. * @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.
*/ */
public interface ICPPASTNamedTypeSpecifier extends IASTNamedTypeSpecifier, public interface ICPPASTNamedTypeSpecifier extends IASTNamedTypeSpecifier, ICPPASTDeclSpecifier {
ICPPASTDeclSpecifier {
/** /**
* Was typename token consumed? * Was typename token consumed?
* *
@ -48,5 +46,4 @@ public interface ICPPASTNamedTypeSpecifier extends IASTNamedTypeSpecifier,
*/ */
@Override @Override
public ICPPASTNamedTypeSpecifier copy(CopyStyle style); public ICPPASTNamedTypeSpecifier copy(CopyStyle style);
} }

View file

@ -24,9 +24,8 @@ import org.eclipse.cdt.core.parser.util.ArrayUtil;
/** /**
* @author jcamelon * @author jcamelon
*/ */
public class CASTTypedefNameSpecifier extends CASTBaseDeclSpecifier implements public class CASTTypedefNameSpecifier extends CASTBaseDeclSpecifier
ICASTTypedefNameSpecifier, IASTCompletionContext { implements ICASTTypedefNameSpecifier, IASTCompletionContext {
private IASTName name; private IASTName name;
public CASTTypedefNameSpecifier() { public CASTTypedefNameSpecifier() {
@ -64,23 +63,24 @@ public class CASTTypedefNameSpecifier extends CASTBaseDeclSpecifier implements
} }
@Override @Override
public boolean accept( ASTVisitor action ){ public boolean accept(ASTVisitor action) {
if( action.shouldVisitDeclSpecifiers ){ if (action.shouldVisitDeclSpecifiers) {
switch( action.visit( this ) ){ switch (action.visit(this)) {
case ASTVisitor.PROCESS_ABORT : return false; case ASTVisitor.PROCESS_ABORT: return false;
case ASTVisitor.PROCESS_SKIP : return true; case ASTVisitor.PROCESS_SKIP: return true;
default : break; default: break;
} }
} }
if (!visitAlignmentSpecifiers(action)) { if (!visitAlignmentSpecifiers(action))
return false; return false;
} if (name != null && !name.accept(action))
if( name != null ) if( !name.accept( action ) ) return false; return false;
if( action.shouldVisitDeclSpecifiers ){
switch( action.leave( this ) ){ if (action.shouldVisitDeclSpecifiers) {
case ASTVisitor.PROCESS_ABORT : return false; switch (action.leave(this)) {
case ASTVisitor.PROCESS_SKIP : return true; case ASTVisitor.PROCESS_ABORT: return false;
default : break; case ASTVisitor.PROCESS_SKIP: return true;
default: break;
} }
} }
return true; return true;
@ -88,7 +88,8 @@ public class CASTTypedefNameSpecifier extends CASTBaseDeclSpecifier implements
@Override @Override
public int getRoleForName(IASTName n) { public int getRoleForName(IASTName n) {
if( n == name ) return r_reference; if (n == name)
return r_reference;
return r_unclear; return r_unclear;
} }

View file

@ -92,7 +92,7 @@ public class CPPASTNamedTypeSpecifier extends CPPASTBaseDeclSpecifier
if (name != null && !name.accept(action)) if (name != null && !name.accept(action))
return false; return false;
if (action.shouldVisitDeclSpecifiers ){ if (action.shouldVisitDeclSpecifiers) {
switch (action.leave(this)) { switch (action.leave(this)) {
case ASTVisitor.PROCESS_ABORT: case ASTVisitor.PROCESS_ABORT:
return false; return false;