1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-21 21:52:10 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2011-02-10 23:00:05 +00:00
parent 53a7c1794d
commit 58a312b4ed
2 changed files with 19 additions and 21 deletions

View file

@ -27,12 +27,11 @@ import org.eclipse.cdt.internal.core.dom.parser.Value;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
/**
* Represents a c++ literal.
* Represents a C++ literal.
*/
public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralExpression {
public static final CPPASTLiteralExpression INT_ZERO = new CPPASTLiteralExpression(lk_integer_constant, new char[] {'0'} );
public static final CPPASTLiteralExpression INT_ZERO =
new CPPASTLiteralExpression(lk_integer_constant, new char[] {'0'});
private int kind;
private char[] value = CharArrayUtils.EMPTY;
@ -75,19 +74,19 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
}
@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;
@ -136,7 +135,7 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
final char c = value[i];
if (c == '"') {
if (isRaw) {
for (int j=i+1; j<length; j++) {
for (int j = i + 1; j < length; j++) {
final char d= value[j];
if (d == '(') {
length -= 2*(j-i);
@ -146,7 +145,7 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
}
length -= i;
if (length < 0)
length= 0;
length = 0;
break;
} else if (c == 'R') {
isRaw = true;
@ -229,7 +228,6 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
assertNotFrozen();
this.value = value.toCharArray();
}
/**
* @deprecated use {@link #CPPASTLiteralExpression(int, char[])}, instead.

View file

@ -178,10 +178,10 @@ public class CPPASTSimpleDeclSpecifier extends CPPASTBaseDeclSpecifier implement
default: break;
}
}
if (fDeclTypeExpression != null && !fDeclTypeExpression.accept(action))
return false;
if (action.shouldVisitDeclSpecifiers) {
switch (action.leave(this)) {
case ASTVisitor.PROCESS_ABORT: return false;
@ -191,7 +191,7 @@ public class CPPASTSimpleDeclSpecifier extends CPPASTBaseDeclSpecifier implement
}
return true;
}
public void replace(IASTNode child, IASTNode other) {
if (child == fDeclTypeExpression) {
other.setPropertyInParent(child.getPropertyInParent());