1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-30 21:55:31 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2012-03-16 21:06:08 -07:00
parent 626c0cdaf3
commit c0486260cc
9 changed files with 78 additions and 92 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,8 +17,8 @@ package org.eclipse.cdt.core.dom.ast;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IASTGotoStatement extends IASTStatement, IASTNameOwner {
public static final ASTNodeProperty NAME = new ASTNodeProperty("IASTGotoStatement.NAME - Name for IASTGotoStatement"); //$NON-NLS-1$
public static final ASTNodeProperty NAME =
new ASTNodeProperty("IASTGotoStatement.NAME - Name for IASTGotoStatement"); //$NON-NLS-1$
/**
* Returns the name of the label. The name resolves to a ILabel binding.
@ -46,5 +46,4 @@ public interface IASTGotoStatement extends IASTStatement, IASTNameOwner {
*/
@Override
public IASTGotoStatement copy(CopyStyle style);
}

View file

@ -21,7 +21,7 @@ public interface IASTLabelStatement extends IASTStatement, IASTNameOwner {
public static final IASTStatement[] EMPTY_LABEL_STATEMENT_ARRAY = {};
public static final ASTNodeProperty NAME = new ASTNodeProperty("IASTLabelStatement.NAME - name for IASTLabelStatement"); //$NON-NLS-1$
public static final ASTNodeProperty NESTED_STATEMENT = new ASTNodeProperty( "IASTLabelStatement.NESTED_STATEMENT - statement for IASTLabelStatement" ); //$NON-NLS-1$
public static final ASTNodeProperty NESTED_STATEMENT = new ASTNodeProperty("IASTLabelStatement.NESTED_STATEMENT - statement for IASTLabelStatement"); //$NON-NLS-1$
/**
* The name for the label. The name resolves to an ILabel binding.

View file

@ -6,8 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Doug Schaefer - Initial API and implementation
* Markus Schorn (Wind River Systems)
* Doug Schaefer - Initial API and implementation
* Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast;
@ -24,9 +24,7 @@ import org.eclipse.cdt.core.parser.IToken;
* @noextend This interface is not intended to be extended by clients.
*/
public interface IASTNode {
/**
* @since 5.3
*/
/** @since 5.3 */
public enum CopyStyle {
/**
* Copy without location, this copy is independent of the index and can be shared.

View file

@ -6,8 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Rational Software - Initial API and implementation
* Yuan Zhang / Beth Tibbitts (IBM Research)
* IBM Rational Software - Initial API and implementation
* Yuan Zhang / Beth Tibbitts (IBM Research)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.c;
@ -19,21 +19,20 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
* @author jcamelon
*/
public class CASTContinueStatement extends ASTNode implements IASTContinueStatement {
@Override
public boolean accept( ASTVisitor action ){
if( action.shouldVisitStatements ){
switch( action.visit( this ) ){
case ASTVisitor.PROCESS_ABORT : return false;
case ASTVisitor.PROCESS_SKIP : return true;
default : break;
public boolean accept(ASTVisitor action) {
if (action.shouldVisitStatements) {
switch (action.visit(this)) {
case ASTVisitor.PROCESS_ABORT: return false;
case ASTVisitor.PROCESS_SKIP: return true;
default: break;
}
}
if( action.shouldVisitStatements ){
switch( action.leave( this ) ){
case ASTVisitor.PROCESS_ABORT : return false;
case ASTVisitor.PROCESS_SKIP : return true;
default : break;
if (action.shouldVisitStatements) {
switch (action.leave(this)) {
case ASTVisitor.PROCESS_ABORT: return false;
case ASTVisitor.PROCESS_SKIP: return true;
default: break;
}
}
return true;

View file

@ -6,8 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Rational Software - Initial API and implementation
* Yuan Zhang / Beth Tibbitts (IBM Research)
* IBM Rational Software - Initial API and implementation
* Yuan Zhang / Beth Tibbitts (IBM Research)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.c;
@ -23,10 +23,8 @@ import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
* @author jcamelon
*/
public class CASTLabelStatement extends ASTNode implements IASTLabelStatement, IASTAmbiguityParent {
private IASTName name;
private IASTStatement nestedStatement;
public CASTLabelStatement() {
}
@ -69,30 +67,30 @@ public class CASTLabelStatement extends ASTNode implements IASTLabelStatement, I
}
@Override
public boolean accept( ASTVisitor action ){
if( action.shouldVisitStatements ){
switch( action.visit( this ) ){
case ASTVisitor.PROCESS_ABORT : return false;
case ASTVisitor.PROCESS_SKIP : return true;
default : break;
public boolean accept(ASTVisitor action) {
if (action.shouldVisitStatements) {
switch (action.visit(this)) {
case ASTVisitor.PROCESS_ABORT: return false;
case ASTVisitor.PROCESS_SKIP: return true;
default: break;
}
}
if( name != null ) if( !name.accept( action ) ) return false;
if( nestedStatement != null ) if( !nestedStatement.accept( action ) ) return false;
if( action.shouldVisitStatements ){
switch( action.leave( this ) ){
case ASTVisitor.PROCESS_ABORT : return false;
case ASTVisitor.PROCESS_SKIP : return true;
default : break;
if (name != null && !name.accept(action)) return false;
if (nestedStatement != null && !nestedStatement.accept(action)) return false;
if (action.shouldVisitStatements) {
switch (action.leave(this)) {
case ASTVisitor.PROCESS_ABORT: return false;
case ASTVisitor.PROCESS_SKIP: return true;
default: break;
}
}
return true;
}
@Override
public int getRoleForName(IASTName n) {
if( n == name ) return r_declaration;
if (n == name)
return r_declaration;
return r_unclear;
}
@ -113,12 +111,10 @@ public class CASTLabelStatement extends ASTNode implements IASTLabelStatement, I
@Override
public void replace(IASTNode child, IASTNode other) {
if( child == nestedStatement )
{
other.setParent( this );
other.setPropertyInParent( child.getPropertyInParent() );
if (child == nestedStatement) {
other.setParent(this);
other.setPropertyInParent(child.getPropertyInParent());
setNestedStatement((IASTStatement) other);
}
}
}

View file

@ -6,9 +6,9 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* John Camelon (IBM Rational Software) - Initial API and implementation
* Yuan Zhang / Beth Tibbitts (IBM Research)
* Markus Schorn (Wind River Systems)
* John Camelon (IBM Rational Software) - Initial API and implementation
* Yuan Zhang / Beth Tibbitts (IBM Research)
* Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.c;
@ -26,7 +26,6 @@ import org.eclipse.cdt.internal.core.dom.parser.ProblemType;
* Represents a literal
*/
public class CASTLiteralExpression extends ASTNode implements IASTLiteralExpression {
private int kind;
private char[] value = CharArrayUtils.EMPTY;
@ -81,24 +80,24 @@ public class CASTLiteralExpression extends ASTNode implements IASTLiteralExpress
}
@Override
public boolean accept( ASTVisitor action ){
if( action.shouldVisitExpressions ){
switch( action.visit( this ) ){
case ASTVisitor.PROCESS_ABORT : return false;
case ASTVisitor.PROCESS_SKIP : return true;
default : break;
public boolean accept(ASTVisitor action) {
if (action.shouldVisitExpressions) {
switch (action.visit(this)) {
case ASTVisitor.PROCESS_ABORT: return false;
case ASTVisitor.PROCESS_SKIP: return true;
default: break;
}
}
if( action.shouldVisitExpressions ){
switch( action.leave( this ) ){
case ASTVisitor.PROCESS_ABORT : return false;
case ASTVisitor.PROCESS_SKIP : return true;
default : break;
if (action.shouldVisitExpressions) {
switch (action.leave(this)) {
case ASTVisitor.PROCESS_ABORT: return false;
case ASTVisitor.PROCESS_SKIP: return true;
default: break;
}
}
return true;
}
@Override
public IType getExpressionType() {
switch (getKind()) {
@ -141,7 +140,7 @@ public class CASTLiteralExpression extends ASTNode implements IASTLiteralExpress
break;
}
}
return new CBasicType(kind, flags, this);
}

View file

@ -6,8 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Rational Software - Initial API and implementation
* Yuan Zhang / Beth Tibbitts (IBM Research)
* IBM Rational Software - Initial API and implementation
* Yuan Zhang / Beth Tibbitts (IBM Research)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.c;
@ -23,11 +23,9 @@ import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
* @author jcamelon
*/
public class CASTWhileStatement extends ASTNode implements IASTWhileStatement, IASTAmbiguityParent {
private IASTExpression condition;
private IASTStatement body;
public CASTWhileStatement() {
}
@ -84,22 +82,22 @@ public class CASTWhileStatement extends ASTNode implements IASTWhileStatement, I
}
@Override
public boolean accept( ASTVisitor action ){
if( action.shouldVisitStatements ){
switch( action.visit( this ) ){
case ASTVisitor.PROCESS_ABORT : return false;
case ASTVisitor.PROCESS_SKIP : return true;
default : break;
public boolean accept(ASTVisitor action) {
if (action.shouldVisitStatements) {
switch (action.visit(this)) {
case ASTVisitor.PROCESS_ABORT: return false;
case ASTVisitor.PROCESS_SKIP: return true;
default: break;
}
}
if( condition != null ) if( !condition.accept( action ) ) return false;
if( body != null ) if( !body.accept( action ) ) return false;
if (condition != null && !condition.accept(action)) return false;
if (body != null && !body.accept(action)) return false;
if( action.shouldVisitStatements ){
switch( action.leave( this ) ){
case ASTVisitor.PROCESS_ABORT : return false;
case ASTVisitor.PROCESS_SKIP : return true;
default : break;
if (action.shouldVisitStatements) {
switch (action.leave(this)) {
case ASTVisitor.PROCESS_ABORT: return false;
case ASTVisitor.PROCESS_SKIP: return true;
default: break;
}
}
return true;
@ -107,16 +105,14 @@ public class CASTWhileStatement extends ASTNode implements IASTWhileStatement, I
@Override
public void replace(IASTNode child, IASTNode other) {
if( body == child )
{
other.setPropertyInParent( child.getPropertyInParent() );
other.setParent( child.getParent() );
if (body == child) {
other.setPropertyInParent(child.getPropertyInParent());
other.setParent(child.getParent());
body = (IASTStatement) other;
}
if( child == condition )
{
other.setPropertyInParent( child.getPropertyInParent() );
other.setParent( child.getParent() );
if (child == condition) {
other.setPropertyInParent(child.getPropertyInParent());
other.setParent(child.getParent());
condition = (IASTExpression) other;
}
}

View file

@ -18,7 +18,6 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
* @author jcamelon
*/
public class CPPASTContinueStatement extends ASTNode implements IASTContinueStatement {
@Override
public boolean accept(ASTVisitor action) {
if (action.shouldVisitStatements) {

View file

@ -1812,7 +1812,7 @@ public class CPPSemantics {
return new CPPCompositeBinding(result);
}
static public boolean declaredBefore(Object obj, IASTNode node, boolean indexBased) {
public static boolean declaredBefore(Object obj, IASTNode node, boolean indexBased) {
if (node == null)
return true;