}
throw new IllegalStateException("Unsupported primitive type: " + primitiveType);
}
private ICPPASTDeclSpecifier convertSimpleType(final SimpleType simpleType) {
final ICPPASTSimpleDeclSpecifier simpleDeclSpecifier = f.newSimpleDeclSpecifier();
if (simpleType.getName().isSimpleName()) {
final SimpleName simpleName = (SimpleName) simpleType.getName();
if (simpleName.getIdentifier().equals(Void.class.getName())) {
simpleDeclSpecifier.setType(IBasicType.Kind.eVoid);
return simpleDeclSpecifier;
}
if (simpleName.getIdentifier().equals(Boolean.class.getSimpleName())) {
javaDefaultValue = f.newLiteralExpression(IASTLiteralExpression.lk_false, "false");
simpleDeclSpecifier.setType(IBasicType.Kind.eBoolean);
return simpleDeclSpecifier;
}
if (simpleName.getIdentifier().equals(Character.class.getSimpleName())) {
javaDefaultValue = f.newLiteralExpression(IASTLiteralExpression.lk_char_constant, "\0");
simpleDeclSpecifier.setType(IBasicType.Kind.eChar);
return simpleDeclSpecifier;
}
if (simpleName.getIdentifier().equals(Float.class.getSimpleName())) {
javaDefaultValue = f.newLiteralExpression(IASTLiteralExpression.lk_float_constant, "0");
simpleDeclSpecifier.setType(IBasicType.Kind.eFloat);
return simpleDeclSpecifier;
}
if (simpleName.getIdentifier().equals(Double.class.getSimpleName())) {
javaDefaultValue = f.newLiteralExpression(IASTLiteralExpression.lk_float_constant, "0");
simpleDeclSpecifier.setType(IBasicType.Kind.eDouble);
return simpleDeclSpecifier;
}
if (simpleName.getIdentifier().equals(Byte.class.getSimpleName())) {
javaDefaultValue = f.newLiteralExpression(IASTLiteralExpression.lk_integer_constant, "0");
compilationUnitInfo.hppStdIncludes.add("cstdint");