Program: 50105
Project: 50105
Buggy source:
/** 
 * Given a C++ expression, attempts to convert it into one or more Java expressions.
 */
private List<Expression> evalExpr(IASTExpression expression,TypeEnum wanted) throws DOMException {
  List<Expression> ret=new ArrayList<Expression>();
  boolean fNeedBooleans=(wanted == TypeEnum.BOOLEAN);
  if (expression instanceof IASTLiteralExpression) {
    IASTLiteralExpression literal=(IASTLiteralExpression)expression;
switch (literal.getKind()) {
case IASTLiteralExpression.lk_char_constant:
      CharacterLiteral cl=ast.newCharacterLiteral();
    cl.setEscapedValue(new String(literal.getValue()));
  ret.add(cl);
break;
case IASTLiteralExpression.lk_false:
BooleanLiteral bl=ast.newBooleanLiteral(false);
ret.add(bl);
break;
case IASTLiteralExpression.lk_true:
BooleanLiteral bl2=ast.newBooleanLiteral(true);
ret.add(bl2);
break;
case IASTLiteralExpression.lk_float_constant:
NumberLiteral fl=ast.newNumberLiteral();
fl.setToken(new String(literal.getValue()));
ret.add(fl);
break;
case IASTLiteralExpression.lk_string_literal:
StringLiteral sl=ast.newStringLiteral();
sl.setLiteralValue(new String(literal.getValue()));
ret.add(sl);
break;
case IASTLiteralExpression.lk_integer_constant:
NumberLiteral il=ast.newNumberLiteral();
il.setToken(new String(literal.getValue()));
ret.add(il);
break;
case IASTLiteralExpression.lk_this:
ThisExpression te=ast.newThisExpression();
ret.add(te);
break;
}
}
 else if (expression instanceof IASTArraySubscriptExpression) {
IASTArraySubscriptExpression arraySubscriptExpression=(IASTArraySubscriptExpression)expression;
print("String_Node_Str");
ArrayAccess array=ast.newArrayAccess();
array.setArray(eval1Expr(arraySubscriptExpression.getArrayExpression()));
array.setIndex(eval1Expr(arraySubscriptExpression.getSubscriptExpression()));
ret.add(array);
}
 else if (expression instanceof IASTBinaryExpression) {
IASTBinaryExpression binaryExpression=(IASTBinaryExpression)expression;
print("String_Node_Str" + binaryExpression.getRawSignature());
boolean fSubsNeedBooleans=needBooleanExpressions(binaryExpression.getOperator());
if (expression instanceof IASTImplicitNameOwner && ((IASTImplicitNameOwner)expression).getImplicitNames().length != 0 && ((IASTImplicitNameOwner)expression).getImplicitNames()[0].isOperator()) {
String name=((IASTImplicitNameOwner)expression).getImplicitNames()[0].resolveBinding().getName();
String replace="String_Node_Str";
if (name.equals("String_Node_Str") && ((IASTImplicitNameOwner)expression).getImplicitNames()[0].resolveBinding() instanceof ICPPMethod) {
ICPPMethod bind=(ICPPMethod)((IASTImplicitNameOwner)expression).getImplicitNames()[0].resolveBinding();
Assignment ass=ast.newAssignment();
if (!(eval1Expr(binaryExpression.getOperand2()) instanceof ClassInstanceCreation)) {
ClassInstanceCreation create=jast.newClassCreate().type(cppToJavaType(bind.getParameters()[0].getType())).with(eval1Expr(binaryExpression.getOperand2())).toAST();
ass.setRightHandSide(create);
}
 else {
ass.setRightHandSide(eval1Expr(binaryExpression.getOperand2()));
}
ass.setLeftHandSide(eval1Expr(binaryExpression.getOperand1()));
ret.add(ass);
}
 else {
replace=normalizeName(name);
MethodInvocation method=jast.newMethod().on(eval1Expr(binaryExpression.getOperand1())).call(replace).with(eval1Expr(binaryExpression.getOperand2())).toAST();
ret.add(method);
}
}
 else if (isAssignmentExpression(binaryExpression.getOperator())) {
Assignment assign=jast.newAssign().left(eval1Expr(binaryExpression.getOperand1())).right(eval1Expr(binaryExpression.getOperand2())).op(evaluateBinaryAssignmentOperator(binaryExpression.getOperator())).toAST();
ret.add(assign);
}
 else {
InfixExpression infix=jast.newInfix().left(evalExpr(binaryExpression.getOperand1(),fSubsNeedBooleans ? TypeEnum.BOOLEAN : TypeEnum.ANY).get(0)).right(evalExpr(binaryExpression.getOperand2(),fSubsNeedBooleans ? TypeEnum.BOOLEAN : TypeEnum.ANY).get(0)).op(evaluateBinaryOperator(binaryExpression.getOperator())).toAST();
ret.add(infix);
}
}
 else if (expression instanceof IASTCastExpression) {
IASTCastExpression castExpression=(IASTCastExpression)expression;
print("String_Node_Str");
CastExpression cast=ast.newCastExpression();
cast.setExpression(eval1Expr(castExpression.getOperand()));
cast.setType(evalTypeId(castExpression.getTypeId()));
ret.add(cast);
}
 else if (expression instanceof IASTConditionalExpression) {
IASTConditionalExpression conditionalExpression=(IASTConditionalExpression)expression;
print("String_Node_Str");
ConditionalExpression conditional=ast.newConditionalExpression();
conditional.setExpression(eval1Expr(conditionalExpression.getLogicalConditionExpression()));
conditional.setThenExpression(eval1Expr(conditionalExpression.getPositiveResultExpression()));
conditional.setElseExpression(eval1Expr(conditionalExpression.getNegativeResultExpression()));
ret.add(conditional);
}
 else if (expression instanceof IASTFieldReference) {
IASTFieldReference fieldReference=(IASTFieldReference)expression;
print("String_Node_Str");
IBinding binding=fieldReference.getFieldName().resolveBinding();
boolean isBitField=false;
print(binding.getName());
FieldAccess field=jast.newField().on(eval1Expr(fieldReference.getFieldOwner())).field(getSimpleName(fieldReference.getFieldName())).toAST();
if (binding instanceof IEnumerator) {
FieldAccess access=jast.newField().on(field).field("String_Node_Str").toAST();
ret.add(access);
}
 else {
ret.add(field);
}
}
 else if (expression instanceof IASTFunctionCallExpression) {
IASTFunctionCallExpression functionCallExpression=(IASTFunctionCallExpression)expression;
print("String_Node_Str");
Expression funcCallExpr;
if (functionCallExpression.getFunctionNameExpression() instanceof IASTIdExpression && ((IASTIdExpression)functionCallExpression.getFunctionNameExpression()).getName().resolveBinding() instanceof ICPPClassType) {
ICPPClassType con=(ICPPClassType)((IASTIdExpression)functionCallExpression.getFunctionNameExpression()).getName().resolveBinding();
ClassInstanceCreation create=ast.newClassInstanceCreation();
create.setType(jast.newType(con.getName()));
MethodInvocation method=jast.newMethod().on("String_Node_Str").call("String_Node_Str").with(create).with(m_localVariableId + 1).with("String_Node_Str").toAST();
m_localVariableId++;
if (m_localVariableId > m_localVariableMaxId) m_localVariableMaxId=m_localVariableId;
if (functionCallExpression.getParameterExpression() instanceof IASTExpressionList) {
IASTExpressionList list=(IASTExpressionList)functionCallExpression.getParameterExpression();
for (IASTExpression arg : list.getExpressions()) {
create.arguments().addAll(evalExpr(arg));
}
}
 else if (functionCallExpression.getParameterExpression() instanceof IASTExpression) {
create.arguments().addAll(evalExpr((IASTExpression)functionCallExpression.getParameterExpression()));
}
funcCallExpr=(method);
ret.add(funcCallExpr);
}
 else {
JASTHelper.Method method=jast.newMethod();
if (functionCallExpression.getFunctionNameExpression() instanceof IASTFieldReference) {
IASTFieldReference fr=(IASTFieldReference)functionCallExpression.getFunctionNameExpression();
method.on(eval1Expr(fr.getFieldOwner())).call(getSimpleName(fr.getFieldName()));
}
 else if (functionCallExpression.getFunctionNameExpression() instanceof IASTIdExpression) {
IASTIdExpression id=(IASTIdExpression)functionCallExpression.getFunctionNameExpression();
if (getSimpleName(id.getName()).equals("String_Node_Str") || getSimpleName(id.getName()).equals("String_Node_Str")) {
method.on("String_Node_Str");
}
method.call(getSimpleName(id.getName()));
}
if (functionCallExpression.getParameterExpression() instanceof IASTExpressionList) {
IASTExpressionList list=(IASTExpressionList)functionCallExpression.getParameterExpression();
for (IASTExpression arg : list.getExpressions()) {
method.withArguments(evalExpr(arg));
}
}
 else if (functionCallExpression.getParameterExpression() instanceof IASTExpression) {
method.withArguments(evalExpr(functionCallExpression.getParameterExpression()));
}
funcCallExpr=(method.toAST());
if (getTypeEnum(expression.getExpressionType()) == TypeEnum.OTHER || getTypeEnum(expression.getExpressionType()) == TypeEnum.ARRAY) {
MethodInvocation method2=jast.newMethod().on("String_Node_Str").call("String_Node_Str").with(funcCallExpr).with(m_localVariableId + 1).with("String_Node_Str").toAST();
m_localVariableId++;
if (m_localVariableId > m_localVariableMaxId) m_localVariableMaxId=m_localVariableId;
ret.add(method2);
}
 else ret.add(funcCallExpr);
}
}
 else if (expression instanceof IASTIdExpression) {
IASTIdExpression idExpression=(IASTIdExpression)expression;
print("String_Node_Str");
if (isBitfield(idExpression.getName())) {
print("String_Node_Str");
MethodInvocation methodGet=jast.newMethod().call("String_Node_Str" + getSimpleName(idExpression.getName())).toAST();
ret.add(methodGet);
}
 else {
IBinding bind=idExpression.getName().resolveBinding();
if (bind instanceof IEnumerator) {
IEnumerator enumerator=(IEnumerator)bind;
String enumeration=getSimpleType(((IEnumeration)enumerator.getType()).getName());
QualifiedName qual;
if (enumeration.equals("String_Node_Str")) {
String first=((IEnumeration)enumerator.getOwner()).getEnumerators()[0].getName();
String enumName=m_anonEnumMap.get(first);
if (enumName == null) exitOnError();
qual=ast.newQualifiedName(ast.newSimpleName(enumName),ast.newSimpleName(getSimpleName(idExpression.getName())));
}
 else {
qual=ast.newQualifiedName(ast.newSimpleName(enumeration),ast.newSimpleName(getSimpleName(idExpression.getName())));
}
FieldAccess fa=jast.newField().on(qual).field("String_Node_Str").toAST();
ret.add(fa);
}
 else if (isEventualPtrOrRef(idExpression.getExpressionType())) {
FieldAccess fa=jast.newField().on(getSimpleName(idExpression.getName())).field("String_Node_Str").toAST();
ret.add(fa);
}
 else {
SimpleName nm=ast.newSimpleName(getSimpleName(idExpression.getName()));
ret.add(nm);
}
}
}
 else if (expression instanceof IASTTypeIdExpression) {
IASTTypeIdExpression typeIdExpression=(IASTTypeIdExpression)expression;
print("String_Node_Str");
printerr(typeIdExpression.getRawSignature());
FieldAccess fa=ast.newFieldAccess();
fa.setName(ast.newSimpleName("String_Node_Str"));
ret.add(fa);
evalTypeId(typeIdExpression.getTypeId());
}
 else if (expression instanceof IASTUnaryExpression) {
IASTUnaryExpression unaryExpression=(IASTUnaryExpression)expression;
print("String_Node_Str");
if (isPostfixExpression(unaryExpression.getOperator())) {
PostfixExpression post=ast.newPostfixExpression();
post.setOperator(evalUnaryPostfixOperator(unaryExpression.getOperator()));
post.setOperand(eval1Expr(unaryExpression.getOperand()));
ret.add(post);
}
 else if (isPrefixExpression(unaryExpression.getOperator())) {
PrefixExpression pre=ast.newPrefixExpression();
pre.setOperator(evalUnaryPrefixOperator(unaryExpression.getOperator()));
pre.setOperand(eval1Expr(unaryExpression.getOperand()));
ret.add(pre);
}
 else if (unaryExpression.getOperator() == IASTUnaryExpression.op_bracketedPrimary) {
ParenthesizedExpression paren=jast.newParen(eval1Expr(unaryExpression.getOperand()));
ret.add(paren);
}
 else if (unaryExpression.getOperator() == IASTUnaryExpression.op_star) {
ret.addAll(evalExpr(unaryExpression.getOperand()));
}
 else if (unaryExpression.getOperator() == IASTUnaryExpression.op_amper) {
ret.addAll(evalExpr(unaryExpression.getOperand()));
}
 else {
print("String_Node_Str");
print("String_Node_Str" + unaryExpression.getOperator());
ret.add(ast.newStringLiteral());
}
}
 else if (expression instanceof ICASTTypeIdInitializerExpression) {
ICASTTypeIdInitializerExpression typeIdInitializerExpression=(ICASTTypeIdInitializerExpression)expression;
print("String_Node_Str");
evalTypeId(typeIdInitializerExpression.getTypeId());
evaluate(typeIdInitializerExpression.getInitializer());
}
 else if (expression instanceof ICPPASTDeleteExpression) {
ICPPASTDeleteExpression deleteExpression=(ICPPASTDeleteExpression)expression;
print("String_Node_Str");
if (!deleteExpression.isVectored()) {
ret.add(jast.newMethod().on(eval1Expr(deleteExpression.getOperand()),true).call("String_Node_Str").toAST());
}
 else {
ret.add(jast.newMethod().on("String_Node_Str").call("String_Node_Str").with(eval1Expr(deleteExpression.getOperand())).toAST());
}
}
 else if (expression instanceof ICPPASTNewExpression) {
ICPPASTNewExpression newExpression=(ICPPASTNewExpression)expression;
print("String_Node_Str");
if (!newExpression.isArrayAllocation()) {
boolean isBasic=false;
if (getTypeEnum(newExpression.getExpressionType()) == TypeEnum.POINTER) {
TypeEnum teBase=getTypeEnum(getPointerBaseType(newExpression.getExpressionType()));
if (teBase == TypeEnum.CHAR || teBase == TypeEnum.NUMBER || teBase == TypeEnum.BOOLEAN) {
ret.add(ast.newNumberLiteral("String_Node_Str"));
isBasic=true;
}
}
if (!isBasic) {
ClassInstanceCreation create=ast.newClassInstanceCreation();
create.setType(evalTypeId(newExpression.getTypeId()));
if (newExpression.getNewInitializer() instanceof IASTExpressionList) {
for (IASTExpression arg : ((IASTExpressionList)newExpression.getNewInitializer()).getExpressions()) create.arguments().addAll(evalExpr(arg));
}
 else if (newExpression.getNewInitializer() instanceof IASTExpression) {
create.arguments().addAll(evalExpr((IASTExpression)newExpression.getNewInitializer()));
}
ret.add(create);
}
}
 else {
List<Expression> sizeExprs=new ArrayList<Expression>();
for (IASTExpression arraySize : newExpression.getNewTypeIdArrayExpressions()) sizeExprs.add(eval1Expr(arraySize));
Expression ex=generateArrayCreationExpression(newExpression.getExpressionType(),sizeExprs);
ret.add(ex);
}
}
 else if (expression instanceof ICPPASTSimpleTypeConstructorExpression) {
ICPPASTSimpleTypeConstructorExpression simpleTypeConstructorExpression=(ICPPASTSimpleTypeConstructorExpression)expression;
printerr("String_Node_Str");
evalExpr(simpleTypeConstructorExpression.getInitialValue());
}
 else if (expression instanceof IGNUASTCompoundStatementExpression) {
IGNUASTCompoundStatementExpression compoundStatementExpression=(IGNUASTCompoundStatementExpression)expression;
print("String_Node_Str");
evalStmt(compoundStatementExpression.getCompoundStatement());
}
 else if (expression instanceof IASTExpressionList) {
IASTExpressionList list=(IASTExpressionList)expression;
for (IASTExpression childExpression : list.getExpressions()) ret.addAll(evalExpr(childExpression));
}
 else if (expression == null) {
ret.add(null);
}
if (ret.isEmpty()) printerr(expression.getClass().getCanonicalName());
if (fNeedBooleans) ret.set(0,makeExpressionBoolean(ret.get(0),expression));
if (expression != null) print(expression.getClass().getCanonicalName());
if (ret.isEmpty()) ret.add(ast.newNumberLiteral("String_Node_Str"));
return ret;
}

Fixed version (ground truth):
/** 
 * Given a C++ expression, attempts to convert it into one or more Java expressions.
 */
private List<Expression> evalExpr(IASTExpression expression,TypeEnum wanted) throws DOMException {
  List<Expression> ret=new ArrayList<Expression>();
  boolean fNeedBooleans=(wanted == TypeEnum.BOOLEAN);
  if (expression instanceof IASTLiteralExpression) {
    IASTLiteralExpression literal=(IASTLiteralExpression)expression;
switch (literal.getKind()) {
case IASTLiteralExpression.lk_char_constant:
      CharacterLiteral cl=ast.newCharacterLiteral();
    cl.setEscapedValue(new String(literal.getValue()));
  ret.add(cl);
break;
case IASTLiteralExpression.lk_false:
BooleanLiteral bl=ast.newBooleanLiteral(false);
ret.add(bl);
break;
case IASTLiteralExpression.lk_true:
BooleanLiteral bl2=ast.newBooleanLiteral(true);
ret.add(bl2);
break;
case IASTLiteralExpression.lk_float_constant:
NumberLiteral fl=ast.newNumberLiteral();
fl.setToken(new String(literal.getValue()));
ret.add(fl);
break;
case IASTLiteralExpression.lk_string_literal:
StringLiteral sl=ast.newStringLiteral();
sl.setLiteralValue(new String(literal.getValue()));
ret.add(sl);
break;
case IASTLiteralExpression.lk_integer_constant:
NumberLiteral il=ast.newNumberLiteral();
il.setToken(new String(literal.getValue()));
ret.add(il);
break;
case IASTLiteralExpression.lk_this:
ThisExpression te=ast.newThisExpression();
ret.add(te);
break;
}
}
 else if (expression instanceof IASTArraySubscriptExpression) {
IASTArraySubscriptExpression arraySubscriptExpression=(IASTArraySubscriptExpression)expression;
print("String_Node_Str");
ArrayAccess array=ast.newArrayAccess();
array.setArray(eval1Expr(arraySubscriptExpression.getArrayExpression()));
array.setIndex(eval1Expr(arraySubscriptExpression.getSubscriptExpression()));
ret.add(array);
}
 else if (expression instanceof IASTBinaryExpression) {
IASTBinaryExpression binaryExpression=(IASTBinaryExpression)expression;
print("String_Node_Str" + binaryExpression.getRawSignature());
boolean fSubsNeedBooleans=needBooleanExpressions(binaryExpression.getOperator());
if (expression instanceof IASTImplicitNameOwner && ((IASTImplicitNameOwner)expression).getImplicitNames().length != 0 && ((IASTImplicitNameOwner)expression).getImplicitNames()[0].isOperator()) {
String name=((IASTImplicitNameOwner)expression).getImplicitNames()[0].resolveBinding().getName();
String replace="String_Node_Str";
if (name.equals("String_Node_Str") && ((IASTImplicitNameOwner)expression).getImplicitNames()[0].resolveBinding() instanceof ICPPMethod) {
ICPPMethod bind=(ICPPMethod)((IASTImplicitNameOwner)expression).getImplicitNames()[0].resolveBinding();
Assignment ass=ast.newAssignment();
if (!(eval1Expr(binaryExpression.getOperand2()) instanceof ClassInstanceCreation)) {
ClassInstanceCreation create=jast.newClassCreate().type(cppToJavaType(bind.getParameters()[0].getType())).with(eval1Expr(binaryExpression.getOperand2())).toAST();
ass.setRightHandSide(create);
}
 else {
ass.setRightHandSide(eval1Expr(binaryExpression.getOperand2()));
}
ass.setLeftHandSide(eval1Expr(binaryExpression.getOperand1()));
ret.add(ass);
}
 else {
replace=normalizeName(name);
MethodInvocation method=jast.newMethod().on(eval1Expr(binaryExpression.getOperand1())).call(replace).with(eval1Expr(binaryExpression.getOperand2())).toAST();
ret.add(method);
}
}
 else if (isAssignmentExpression(binaryExpression.getOperator())) {
Assignment assign=jast.newAssign().left(eval1Expr(binaryExpression.getOperand1())).right(eval1Expr(binaryExpression.getOperand2())).op(evaluateBinaryAssignmentOperator(binaryExpression.getOperator())).toAST();
ret.add(assign);
}
 else {
InfixExpression infix=jast.newInfix().left(eval1Expr(binaryExpression.getOperand1(),fSubsNeedBooleans ? TypeEnum.BOOLEAN : TypeEnum.ANY)).right(eval1Expr(binaryExpression.getOperand2(),fSubsNeedBooleans ? TypeEnum.BOOLEAN : TypeEnum.ANY)).op(evaluateBinaryOperator(binaryExpression.getOperator())).toAST();
ret.add(infix);
}
}
 else if (expression instanceof IASTCastExpression) {
IASTCastExpression castExpression=(IASTCastExpression)expression;
print("String_Node_Str");
CastExpression cast=ast.newCastExpression();
cast.setExpression(eval1Expr(castExpression.getOperand()));
cast.setType(evalTypeId(castExpression.getTypeId()));
ret.add(cast);
}
 else if (expression instanceof IASTConditionalExpression) {
IASTConditionalExpression conditionalExpression=(IASTConditionalExpression)expression;
print("String_Node_Str");
ConditionalExpression conditional=ast.newConditionalExpression();
conditional.setExpression(eval1Expr(conditionalExpression.getLogicalConditionExpression()));
conditional.setThenExpression(eval1Expr(conditionalExpression.getPositiveResultExpression()));
conditional.setElseExpression(eval1Expr(conditionalExpression.getNegativeResultExpression()));
ret.add(conditional);
}
 else if (expression instanceof IASTFieldReference) {
IASTFieldReference fieldReference=(IASTFieldReference)expression;
print("String_Node_Str");
IBinding binding=fieldReference.getFieldName().resolveBinding();
boolean isBitField=false;
print(binding.getName());
FieldAccess field=jast.newField().on(eval1Expr(fieldReference.getFieldOwner())).field(getSimpleName(fieldReference.getFieldName())).toAST();
if (binding instanceof IEnumerator) {
FieldAccess access=jast.newField().on(field).field("String_Node_Str").toAST();
ret.add(access);
}
 else {
ret.add(field);
}
}
 else if (expression instanceof IASTFunctionCallExpression) {
IASTFunctionCallExpression functionCallExpression=(IASTFunctionCallExpression)expression;
print("String_Node_Str");
Expression funcCallExpr;
if (functionCallExpression.getFunctionNameExpression() instanceof IASTIdExpression && ((IASTIdExpression)functionCallExpression.getFunctionNameExpression()).getName().resolveBinding() instanceof ICPPClassType) {
ICPPClassType con=(ICPPClassType)((IASTIdExpression)functionCallExpression.getFunctionNameExpression()).getName().resolveBinding();
ClassInstanceCreation create=ast.newClassInstanceCreation();
create.setType(jast.newType(con.getName()));
MethodInvocation method=jast.newMethod().on("String_Node_Str").call("String_Node_Str").with(create).with(m_localVariableId + 1).with("String_Node_Str").toAST();
m_localVariableId++;
if (m_localVariableId > m_localVariableMaxId) m_localVariableMaxId=m_localVariableId;
if (functionCallExpression.getParameterExpression() instanceof IASTExpressionList) {
IASTExpressionList list=(IASTExpressionList)functionCallExpression.getParameterExpression();
for (IASTExpression arg : list.getExpressions()) {
create.arguments().addAll(evalExpr(arg));
}
}
 else if (functionCallExpression.getParameterExpression() instanceof IASTExpression) {
create.arguments().addAll(evalExpr((IASTExpression)functionCallExpression.getParameterExpression()));
}
funcCallExpr=(method);
ret.add(funcCallExpr);
}
 else {
JASTHelper.Method method=jast.newMethod();
if (functionCallExpression.getFunctionNameExpression() instanceof IASTFieldReference) {
IASTFieldReference fr=(IASTFieldReference)functionCallExpression.getFunctionNameExpression();
method.on(eval1Expr(fr.getFieldOwner())).call(getSimpleName(fr.getFieldName()));
}
 else if (functionCallExpression.getFunctionNameExpression() instanceof IASTIdExpression) {
IASTIdExpression id=(IASTIdExpression)functionCallExpression.getFunctionNameExpression();
if (getSimpleName(id.getName()).equals("String_Node_Str") || getSimpleName(id.getName()).equals("String_Node_Str")) {
method.on("String_Node_Str");
}
method.call(getSimpleName(id.getName()));
}
if (functionCallExpression.getParameterExpression() instanceof IASTExpressionList) {
IASTExpressionList list=(IASTExpressionList)functionCallExpression.getParameterExpression();
for (IASTExpression arg : list.getExpressions()) {
method.withArguments(evalExpr(arg));
}
}
 else if (functionCallExpression.getParameterExpression() instanceof IASTExpression) {
method.withArguments(evalExpr(functionCallExpression.getParameterExpression()));
}
funcCallExpr=(method.toAST());
if (getTypeEnum(expression.getExpressionType()) == TypeEnum.OTHER || getTypeEnum(expression.getExpressionType()) == TypeEnum.ARRAY) {
MethodInvocation method2=jast.newMethod().on("String_Node_Str").call("String_Node_Str").with(funcCallExpr).with(m_localVariableId + 1).with("String_Node_Str").toAST();
m_localVariableId++;
if (m_localVariableId > m_localVariableMaxId) m_localVariableMaxId=m_localVariableId;
ret.add(method2);
}
 else ret.add(funcCallExpr);
}
}
 else if (expression instanceof IASTIdExpression) {
IASTIdExpression idExpression=(IASTIdExpression)expression;
print("String_Node_Str");
if (isBitfield(idExpression.getName())) {
print("String_Node_Str");
MethodInvocation methodGet=jast.newMethod().call("String_Node_Str" + getSimpleName(idExpression.getName())).toAST();
ret.add(methodGet);
}
 else {
IBinding bind=idExpression.getName().resolveBinding();
if (bind instanceof IEnumerator) {
IEnumerator enumerator=(IEnumerator)bind;
String enumeration=getSimpleType(((IEnumeration)enumerator.getType()).getName());
QualifiedName qual;
if (enumeration.equals("String_Node_Str")) {
String first=((IEnumeration)enumerator.getOwner()).getEnumerators()[0].getName();
String enumName=m_anonEnumMap.get(first);
if (enumName == null) exitOnError();
qual=ast.newQualifiedName(ast.newSimpleName(enumName),ast.newSimpleName(getSimpleName(idExpression.getName())));
}
 else {
qual=ast.newQualifiedName(ast.newSimpleName(enumeration),ast.newSimpleName(getSimpleName(idExpression.getName())));
}
FieldAccess fa=jast.newField().on(qual).field("String_Node_Str").toAST();
ret.add(fa);
}
 else if (isEventualPtrOrRef(idExpression.getExpressionType())) {
FieldAccess fa=jast.newField().on(getSimpleName(idExpression.getName())).field("String_Node_Str").toAST();
ret.add(fa);
}
 else {
SimpleName nm=ast.newSimpleName(getSimpleName(idExpression.getName()));
ret.add(nm);
}
}
}
 else if (expression instanceof IASTTypeIdExpression) {
IASTTypeIdExpression typeIdExpression=(IASTTypeIdExpression)expression;
print("String_Node_Str");
printerr(typeIdExpression.getRawSignature());
FieldAccess fa=ast.newFieldAccess();
fa.setName(ast.newSimpleName("String_Node_Str"));
ret.add(fa);
evalTypeId(typeIdExpression.getTypeId());
}
 else if (expression instanceof IASTUnaryExpression) {
IASTUnaryExpression unaryExpression=(IASTUnaryExpression)expression;
print("String_Node_Str");
if (isPostfixExpression(unaryExpression.getOperator())) {
PostfixExpression post=ast.newPostfixExpression();
post.setOperator(evalUnaryPostfixOperator(unaryExpression.getOperator()));
post.setOperand(eval1Expr(unaryExpression.getOperand()));
ret.add(post);
}
 else if (isPrefixExpression(unaryExpression.getOperator())) {
PrefixExpression pre=ast.newPrefixExpression();
pre.setOperator(evalUnaryPrefixOperator(unaryExpression.getOperator()));
pre.setOperand(eval1Expr(unaryExpression.getOperand()));
ret.add(pre);
}
 else if (unaryExpression.getOperator() == IASTUnaryExpression.op_bracketedPrimary) {
ParenthesizedExpression paren=jast.newParen(eval1Expr(unaryExpression.getOperand()));
ret.add(paren);
}
 else if (unaryExpression.getOperator() == IASTUnaryExpression.op_star) {
ret.addAll(evalExpr(unaryExpression.getOperand()));
}
 else if (unaryExpression.getOperator() == IASTUnaryExpression.op_amper) {
ret.addAll(evalExpr(unaryExpression.getOperand()));
}
 else {
print("String_Node_Str");
print("String_Node_Str" + unaryExpression.getOperator());
ret.add(ast.newStringLiteral());
}
}
 else if (expression instanceof ICASTTypeIdInitializerExpression) {
ICASTTypeIdInitializerExpression typeIdInitializerExpression=(ICASTTypeIdInitializerExpression)expression;
print("String_Node_Str");
evalTypeId(typeIdInitializerExpression.getTypeId());
evaluate(typeIdInitializerExpression.getInitializer());
}
 else if (expression instanceof ICPPASTDeleteExpression) {
ICPPASTDeleteExpression deleteExpression=(ICPPASTDeleteExpression)expression;
print("String_Node_Str");
if (!deleteExpression.isVectored()) {
ret.add(jast.newMethod().on(eval1Expr(deleteExpression.getOperand()),true).call("String_Node_Str").toAST());
}
 else {
ret.add(jast.newMethod().on("String_Node_Str").call("String_Node_Str").with(eval1Expr(deleteExpression.getOperand())).toAST());
}
}
 else if (expression instanceof ICPPASTNewExpression) {
ICPPASTNewExpression newExpression=(ICPPASTNewExpression)expression;
print("String_Node_Str");
if (!newExpression.isArrayAllocation()) {
boolean isBasic=false;
if (getTypeEnum(newExpression.getExpressionType()) == TypeEnum.POINTER) {
TypeEnum teBase=getTypeEnum(getPointerBaseType(newExpression.getExpressionType()));
if (teBase == TypeEnum.CHAR || teBase == TypeEnum.NUMBER || teBase == TypeEnum.BOOLEAN) {
ret.add(ast.newNumberLiteral("String_Node_Str"));
isBasic=true;
}
}
if (!isBasic) {
ClassInstanceCreation create=ast.newClassInstanceCreation();
create.setType(evalTypeId(newExpression.getTypeId()));
if (newExpression.getNewInitializer() instanceof IASTExpressionList) {
for (IASTExpression arg : ((IASTExpressionList)newExpression.getNewInitializer()).getExpressions()) create.arguments().addAll(evalExpr(arg));
}
 else if (newExpression.getNewInitializer() instanceof IASTExpression) {
create.arguments().addAll(evalExpr((IASTExpression)newExpression.getNewInitializer()));
}
ret.add(create);
}
}
 else {
List<Expression> sizeExprs=new ArrayList<Expression>();
for (IASTExpression arraySize : newExpression.getNewTypeIdArrayExpressions()) sizeExprs.add(eval1Expr(arraySize));
Expression ex=generateArrayCreationExpression(newExpression.getExpressionType(),sizeExprs);
ret.add(ex);
}
}
 else if (expression instanceof ICPPASTSimpleTypeConstructorExpression) {
ICPPASTSimpleTypeConstructorExpression simpleTypeConstructorExpression=(ICPPASTSimpleTypeConstructorExpression)expression;
printerr("String_Node_Str");
evalExpr(simpleTypeConstructorExpression.getInitialValue());
}
 else if (expression instanceof IGNUASTCompoundStatementExpression) {
IGNUASTCompoundStatementExpression compoundStatementExpression=(IGNUASTCompoundStatementExpression)expression;
print("String_Node_Str");
evalStmt(compoundStatementExpression.getCompoundStatement());
}
 else if (expression instanceof IASTExpressionList) {
IASTExpressionList list=(IASTExpressionList)expression;
for (IASTExpression childExpression : list.getExpressions()) ret.addAll(evalExpr(childExpression));
}
 else if (expression == null) {
ret.add(null);
}
if (ret.isEmpty()) printerr(expression.getClass().getCanonicalName());
if (fNeedBooleans) ret.set(0,makeExpressionBoolean(ret.get(0),expression));
if (expression != null) print(expression.getClass().getCanonicalName());
if (ret.isEmpty()) ret.add(ast.newNumberLiteral("String_Node_Str"));
return ret;
}