TypeUtil { public static IType getPointerToType(IType type) { type = removeQualifiers(type); if (type instanceof IPointerType) { return ((IPointerType) type).getType(); } else { return null; } }  static IType getPointerToType(IType type); static IType removeQualifiers(IType type); static boolean isIBasicType(IType type, IBasicType.Kind kind); static IBasicType asIBasicType(IType type, IBasicType.Kind... kinds); static IASTLiteralExpression asIASTLiteralExpression(IASTNode node, int... kinds); static IType resolveOuterTypedef(IType type); static int bytesOfType(IType type, AnalysisEnvironment assumptions); static int bytesOfType(IASTDeclSpecifier spec, AnalysisEnvironment assumptions);  }
@Test public void testGetPointerToType() { IASTFunctionDefinition mainFunctionDefinition = (IASTFunctionDefinition) declarationsInFile.get(0); IASTCompoundStatement body = (IASTCompoundStatement) mainFunctionDefinition.getBody(); IASTStatement[] statements = body.getStatements(); assertTrue(statements.length > 0); assertTrue(statements[1] instanceof IASTExpressionStatement); IASTExpression expr = ((IASTExpressionStatement) statements[1]).getExpression(); assertTrue(expr instanceof IASTIdExpression); assertTrue(expr.getExpressionType() instanceof IPointerType); IType pointerToType = TypeUtil.getPointerToType(expr.getExpressionType()); assertTrue(pointerToType instanceof IQualifierType); assertTrue(((IQualifierType) pointerToType).getType() instanceof IBasicType); }