1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 17:26:01 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2011-10-23 21:50:39 -07:00
parent e65e1eabc1
commit b7de8668c6
2 changed files with 21 additions and 24 deletions

View file

@ -6,8 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* IBM Rational Software - Initial API and implementation * IBM Rational Software - Initial API and implementation
* Yuan Zhang / Beth Tibbitts (IBM Research) * Yuan Zhang / Beth Tibbitts (IBM Research)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.c; package org.eclipse.cdt.internal.core.dom.parser.c;
@ -21,7 +21,6 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
* @author jcamelon * @author jcamelon
*/ */
public class CASTTypeId extends ASTNode implements IASTTypeId { public class CASTTypeId extends ASTNode implements IASTTypeId {
private IASTDeclSpecifier declSpecifier; private IASTDeclSpecifier declSpecifier;
private IASTDeclarator declarator; private IASTDeclarator declarator;
@ -72,27 +71,26 @@ public class CASTTypeId extends ASTNode implements IASTTypeId {
abstractDeclarator.setParent(this); abstractDeclarator.setParent(this);
abstractDeclarator.setPropertyInParent(ABSTRACT_DECLARATOR); abstractDeclarator.setPropertyInParent(ABSTRACT_DECLARATOR);
} }
} }
@Override @Override
public boolean accept( ASTVisitor action ){ public boolean accept(ASTVisitor action) {
if( action.shouldVisitTypeIds ){ if (action.shouldVisitTypeIds) {
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( declSpecifier != null ) if( !declSpecifier.accept( action ) ) return false; if (declSpecifier != null && !declSpecifier.accept(action)) return false;
if( declarator != null ) if( !declarator.accept( action ) ) return false; if (declarator != null && !declarator.accept(action)) return false;
if( action.shouldVisitTypeIds ){ if (action.shouldVisitTypeIds) {
switch( action.leave( this ) ){ switch (action.leave(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;
} }
} }
return true; return true;

View file

@ -6,10 +6,10 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* IBM - Initial API and implementation * IBM - Initial API and implementation
* Bryan Wilkinson (QNX) * Bryan Wilkinson (QNX)
* Markus Schorn (Wind River Systems) * Markus Schorn (Wind River Systems)
* Sergey Prigogin (Google) * Sergey Prigogin (Google)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics; package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
@ -155,7 +155,7 @@ public class CPPTemplates {
private static final int PACK_SIZE_FAIL = -2; private static final int PACK_SIZE_FAIL = -2;
private static final int PACK_SIZE_NOT_FOUND = Integer.MAX_VALUE; private static final int PACK_SIZE_NOT_FOUND = Integer.MAX_VALUE;
private static final ICPPFunction[] NO_FUNCTIONS = {}; private static final ICPPFunction[] NO_FUNCTIONS = {};
static enum TypeSelection {PARAMETERS, RETURN_TYPE, PARAMETERS_AND_RETURN_TYPE} static enum TypeSelection { PARAMETERS, RETURN_TYPE, PARAMETERS_AND_RETURN_TYPE }
/** /**
* Instantiates a class template with the given arguments. May return <code>null</code>. * Instantiates a class template with the given arguments. May return <code>null</code>.
@ -183,8 +183,7 @@ public class CPPTemplates {
if (template instanceof ICPPClassTemplatePartialSpecialization) { if (template instanceof ICPPClassTemplatePartialSpecialization) {
return instantiatePartialSpecialization((ICPPClassTemplatePartialSpecialization) template, arguments, isDefinition, null); return instantiatePartialSpecialization((ICPPClassTemplatePartialSpecialization) template, arguments, isDefinition, null);
} }
final ICPPTemplateParameter[] parameters= template.getTemplateParameters(); final ICPPTemplateParameter[] parameters= template.getTemplateParameters();
final int numArgs = arguments.length; final int numArgs = arguments.length;
final int numParams= parameters.length; final int numParams= parameters.length;