mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 06:02:11 +02:00
Cosmetics.
This commit is contained in:
parent
53a7c1794d
commit
58a312b4ed
2 changed files with 19 additions and 21 deletions
|
@ -27,12 +27,11 @@ import org.eclipse.cdt.internal.core.dom.parser.Value;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
|
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 class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralExpression {
|
||||||
|
public static final CPPASTLiteralExpression INT_ZERO =
|
||||||
public static final CPPASTLiteralExpression INT_ZERO = new CPPASTLiteralExpression(lk_integer_constant, new char[] {'0'} );
|
new CPPASTLiteralExpression(lk_integer_constant, new char[] {'0'});
|
||||||
|
|
||||||
|
|
||||||
private int kind;
|
private int kind;
|
||||||
private char[] value = CharArrayUtils.EMPTY;
|
private char[] value = CharArrayUtils.EMPTY;
|
||||||
|
@ -75,19 +74,19 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept( ASTVisitor action ){
|
public boolean accept(ASTVisitor action) {
|
||||||
if( action.shouldVisitExpressions ){
|
if (action.shouldVisitExpressions) {
|
||||||
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( action.shouldVisitExpressions ){
|
if (action.shouldVisitExpressions) {
|
||||||
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;
|
||||||
|
@ -136,7 +135,7 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
|
||||||
final char c = value[i];
|
final char c = value[i];
|
||||||
if (c == '"') {
|
if (c == '"') {
|
||||||
if (isRaw) {
|
if (isRaw) {
|
||||||
for (int j=i+1; j<length; j++) {
|
for (int j = i + 1; j < length; j++) {
|
||||||
final char d= value[j];
|
final char d= value[j];
|
||||||
if (d == '(') {
|
if (d == '(') {
|
||||||
length -= 2*(j-i);
|
length -= 2*(j-i);
|
||||||
|
@ -146,7 +145,7 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
|
||||||
}
|
}
|
||||||
length -= i;
|
length -= i;
|
||||||
if (length < 0)
|
if (length < 0)
|
||||||
length= 0;
|
length = 0;
|
||||||
break;
|
break;
|
||||||
} else if (c == 'R') {
|
} else if (c == 'R') {
|
||||||
isRaw = true;
|
isRaw = true;
|
||||||
|
@ -230,7 +229,6 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
|
||||||
this.value = value.toCharArray();
|
this.value = value.toCharArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated use {@link #CPPASTLiteralExpression(int, char[])}, instead.
|
* @deprecated use {@link #CPPASTLiteralExpression(int, char[])}, instead.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue