Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2004-12-09 18:13:39 +0000
committerAndrew Niefer2004-12-09 18:13:39 +0000
commit19621807ba114e29cd8327bd77355db40281ca17 (patch)
treec1241d9a3ce0dc36d84e9e34a3558b71ae6c28b5
parentc52e89c95f7e30aa383b7f4f9d60eed3a0bf9d7d (diff)
downloadorg.eclipse.cdt-19621807ba114e29cd8327bd77355db40281ca17.tar.gz
org.eclipse.cdt-19621807ba114e29cd8327bd77355db40281ca17.tar.xz
org.eclipse.cdt-19621807ba114e29cd8327bd77355db40281ca17.zip
- IType interfaces and tests outlining how it works
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java138
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IBasicType.java22
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ICompositeType.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IEnumeration.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IFunction.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IFunctionType.java24
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IPointerType.java24
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IQualifierType.java25
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IType.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ITypedef.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/c/ICPointerType.java24
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/c/ICQualifierType.java24
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPPointerToMemberType.java25
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPReferenceType.java24
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPPointerToMemberType.java25
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPPointerType.java24
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPQualifierType.java24
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/c/CFunction.java9
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/cpp/CPPFunction.java9
19 files changed, 427 insertions, 4 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java
index 9e9004a1411..fc0bffe3de0 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java
@@ -39,14 +39,19 @@ import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression;
import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression;
+import org.eclipse.cdt.core.dom.ast.IBasicType;
import org.eclipse.cdt.core.dom.ast.ICompositeType;
import org.eclipse.cdt.core.dom.ast.IEnumeration;
import org.eclipse.cdt.core.dom.ast.IEnumerator;
import org.eclipse.cdt.core.dom.ast.IField;
import org.eclipse.cdt.core.dom.ast.IFunction;
+import org.eclipse.cdt.core.dom.ast.IFunctionType;
import org.eclipse.cdt.core.dom.ast.ILabel;
import org.eclipse.cdt.core.dom.ast.IParameter;
+import org.eclipse.cdt.core.dom.ast.IPointerType;
+import org.eclipse.cdt.core.dom.ast.IQualifierType;
import org.eclipse.cdt.core.dom.ast.IScope;
+import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.ITypedef;
import org.eclipse.cdt.core.dom.ast.IVariable;
import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier.IASTEnumerator;
@@ -870,5 +875,138 @@ public class AST2Tests extends AST2BaseTest {
}
}
+
+ public void _testBasicTypes() throws Exception {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append( "int a; \n" ); //$NON-NLS-1$
+ buffer.append( "char * b; \n" ); //$NON-NLS-1$
+ buffer.append( "const int c; \n" ); //$NON-NLS-1$
+
+ IASTTranslationUnit tu = parse( buffer.toString(), ParserLanguage.C );
+
+ IASTSimpleDeclaration decl = (IASTSimpleDeclaration) tu.getDeclarations()[0];
+ IVariable a = (IVariable) decl.getDeclarators()[0].getName().resolveBinding();
+ decl = (IASTSimpleDeclaration) tu.getDeclarations()[1];
+ IVariable b = (IVariable) decl.getDeclarators()[0].getName().resolveBinding();
+ decl = (IASTSimpleDeclaration) tu.getDeclarations()[2];
+ IVariable c = (IVariable) decl.getDeclarators()[0].getName().resolveBinding();
+
+ IType t_a_1 = a.getType();
+ assertTrue( t_a_1 instanceof IBasicType );
+
+ IType t_b_1 = b.getType();
+ assertTrue( t_b_1 instanceof IPointerType );
+ IType t_b_2 = ((IPointerType) t_b_1).getType();
+ assertTrue( t_b_2 instanceof IBasicType );
+
+ IType t_c_1 = c.getType();
+ assertTrue( t_c_1 instanceof IQualifierType );
+ assertTrue( ((IQualifierType)t_c_1).isConst());
+ IType t_c_2 = ((IQualifierType)t_c_1).getType();
+ assertTrue( t_c_2 instanceof IBasicType );
+ }
+
+ public void _testCompositeTypes() throws Exception{
+ StringBuffer buffer = new StringBuffer();
+ buffer.append( "struct A {} a1; \n"); //$NON-NLS-1$
+ buffer.append( "typedef A * AP; \n"); //$NON-NLS-1$
+ buffer.append( "struct A * const a2; \n"); //$NON-NLS-1$
+ buffer.append( "AP a3; \n"); //$NON-NLS-1$
+
+ IASTTranslationUnit tu = parse( buffer.toString(), ParserLanguage.C );
+
+ IASTSimpleDeclaration decl = (IASTSimpleDeclaration) tu.getDeclarations()[0];
+ IASTCompositeTypeSpecifier compSpec = (IASTCompositeTypeSpecifier) decl.getDeclSpecifier();
+ ICompositeType A = (ICompositeType) compSpec.getName().resolveBinding();
+ IVariable a1 = (IVariable) decl.getDeclarators()[0].getName().resolveBinding();
+ decl = (IASTSimpleDeclaration) tu.getDeclarations()[1];
+ ITypedef AP = (ITypedef) decl.getDeclarators()[0].getName().resolveBinding();
+ decl = (IASTSimpleDeclaration) tu.getDeclarations()[2];
+ IVariable a2 = (IVariable) decl.getDeclarators()[0].getName().resolveBinding();
+ decl = (IASTSimpleDeclaration) tu.getDeclarations()[3];
+ IVariable a3 = (IVariable) decl.getDeclarators()[0].getName().resolveBinding();
+
+ IType t_a1 = a1.getType();
+ assertSame( t_a1, A );
+
+ IType t_a2 = a2.getType();
+ assertTrue( t_a2 instanceof IPointerType );
+ assertTrue( ((IPointerType) t_a2).isConst() );
+ assertSame( ((IPointerType) t_a2).getType(), A );
+
+ IType t_a3 = a3.getType();
+ assertSame( t_a3, AP );
+ IType t_AP = AP.getType();
+ assertTrue( t_AP instanceof IPointerType );
+ assertSame( ((IPointerType) t_AP).getType(), A );
+ }
+
+ public void _testFunctionTypes() throws Exception{
+ StringBuffer buffer = new StringBuffer();
+ buffer.append( "struct A; \n"); //$NON-NLS-1$
+ buffer.append( "int * f( int i, char c ); \n"); //$NON-NLS-1$
+ buffer.append( "void ( *g ) ( struct A * ); \n"); //$NON-NLS-1$
+ buffer.append( "void (* (*h)(struct A**) ) ( int ); \n"); //$NON-NLS-1$
+
+ IASTTranslationUnit tu = parse( buffer.toString(), ParserLanguage.C );
+
+ IASTSimpleDeclaration decl = (IASTSimpleDeclaration) tu.getDeclarations()[0];
+ IASTElaboratedTypeSpecifier elabSpec = (IASTElaboratedTypeSpecifier) decl.getDeclSpecifier();
+ ICompositeType A = (ICompositeType) elabSpec.getName().resolveBinding();
+
+ decl = (IASTSimpleDeclaration) tu.getDeclarations()[1];
+ IFunction f = (IFunction) decl.getDeclarators()[0].getName().resolveBinding();
+
+ decl = (IASTSimpleDeclaration) tu.getDeclarations()[2];
+ IVariable g = (IVariable) decl.getDeclarators()[0].getNestedDeclarator().getName().resolveBinding();
+
+ decl = (IASTSimpleDeclaration) tu.getDeclarations()[3];
+ IVariable h = (IVariable) decl.getDeclarators()[0].getNestedDeclarator().getNestedDeclarator().getName().resolveBinding();
+
+ IFunctionType t_f = f.getType();
+ IType t_f_return = t_f.getReturnType();
+ assertTrue( t_f_return instanceof IPointerType );
+ assertTrue( ((IPointerType) t_f_return).getType() instanceof IBasicType );
+ IType [] t_f_params = t_f.getParameterTypes();
+ assertEquals( t_f_params.length, 2 );
+ assertTrue( t_f_params[0] instanceof IBasicType );
+ assertTrue( t_f_params[1] instanceof IBasicType );
+
+ //g is a pointer to a function that returns void and has 1 parameter struct A *
+ IType t_g = g.getType();
+ assertTrue( t_g instanceof IPointerType );
+ assertTrue( ((IPointerType) t_g).getType() instanceof IFunctionType );
+ IFunctionType t_g_func = (IFunctionType) ((IPointerType) t_g).getType();
+ IType t_g_func_return = t_g_func.getReturnType();
+ assertTrue( t_g_func_return instanceof IBasicType );
+ IType [] t_g_func_params = t_g_func.getParameterTypes();
+ assertEquals( t_g_func_params.length, 1 );
+ IType t_g_func_p1 = t_g_func_params[0];
+ assertTrue( t_g_func_p1 instanceof IPointerType );
+ assertSame( ((IPointerType)t_g_func_p1).getType(), A );
+
+ //h is a pointer to a function that returns a pointer to a function
+ //the returned pointer to function returns void and takes 1 parameter int
+ // the *h function takes 1 parameter struct A**
+ IType t_h = h.getType();
+ assertTrue( t_h instanceof IPointerType );
+ assertTrue( ((IPointerType) t_h).getType() instanceof IFunctionType );
+ IFunctionType t_h_func = (IFunctionType) ((IPointerType) t_h).getType();
+ IType t_h_func_return = t_g_func.getReturnType();
+ IType [] t_h_func_params = t_h_func.getParameterTypes();
+ assertEquals( t_h_func_params.length, 1 );
+ IType t_h_func_p1 = t_h_func_params[0];
+ assertTrue( t_h_func_p1 instanceof IPointerType );
+ assertTrue( ((IPointerType)t_h_func_p1).getType() instanceof IPointerType );
+ assertSame( ((IPointerType) ((IPointerType)t_h_func_p1).getType() ).getType(), A );
+
+ assertTrue( t_h_func_return instanceof IPointerType );
+ IFunctionType h_return = (IFunctionType) ((IPointerType) t_h_func_return).getType();
+ IType h_r = h_return.getReturnType();
+ IType [] h_ps = h_return.getParameterTypes();
+ assertTrue( h_r instanceof IBasicType );
+ assertEquals( h_ps.length, 1 );
+ assertTrue( h_ps[0] instanceof IBasicType );
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IBasicType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IBasicType.java
new file mode 100644
index 00000000000..92f4fb48d11
--- /dev/null
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IBasicType.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+/*
+ * Created on Dec 8, 2004
+ */
+package org.eclipse.cdt.core.dom.ast;
+
+/**
+ * @author aniefer
+ */
+public interface IBasicType extends IType {
+
+}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ICompositeType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ICompositeType.java
index 5626eff9feb..71bec6dcc4e 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ICompositeType.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ICompositeType.java
@@ -15,7 +15,7 @@ import java.util.List;
/**
* @author Doug Schaefer
*/
-public interface ICompositeType extends IType {
+public interface ICompositeType extends IBinding, IType {
/**
* what kind of composite type is this?
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IEnumeration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IEnumeration.java
index 9ce6b24949a..cfcc158ee23 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IEnumeration.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IEnumeration.java
@@ -17,6 +17,6 @@ package org.eclipse.cdt.core.dom.ast;
/**
* @author aniefer
*/
-public interface IEnumeration extends IType {
+public interface IEnumeration extends IBinding, IType {
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IFunction.java
index b99562afe08..7edc7ab47cd 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IFunction.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IFunction.java
@@ -34,4 +34,6 @@ public interface IFunction extends IBinding {
*/
public IScope getFunctionScope();
+ public IFunctionType getType();
+
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IFunctionType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IFunctionType.java
new file mode 100644
index 00000000000..5ba0fddf995
--- /dev/null
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IFunctionType.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+/*
+ * Created on Dec 8, 2004
+ */
+package org.eclipse.cdt.core.dom.ast;
+
+/**
+ * @author aniefer
+ */
+public interface IFunctionType extends IType {
+ public IType getReturnType();
+
+ public IType [] getParameterTypes();
+}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IPointerType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IPointerType.java
new file mode 100644
index 00000000000..f6c628937d4
--- /dev/null
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IPointerType.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+/*
+ * Created on Dec 8, 2004
+ */
+package org.eclipse.cdt.core.dom.ast;
+
+/**
+ * @author aniefer
+ */
+public interface IPointerType extends IType {
+ public IType getType();
+ public boolean isConst();
+ public boolean isVolatile();
+}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IQualifierType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IQualifierType.java
new file mode 100644
index 00000000000..cad1389dea6
--- /dev/null
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IQualifierType.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+/*
+ * Created on Dec 8, 2004
+ */
+package org.eclipse.cdt.core.dom.ast;
+
+/**
+ * @author aniefer
+ */
+public interface IQualifierType extends IType {
+ public boolean isConst();
+ public boolean isVolatile();
+
+ public IType getType();
+}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IType.java
index dffcc25a0e5..c990b35efe6 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IType.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IType.java
@@ -13,7 +13,7 @@ package org.eclipse.cdt.core.dom.ast;
/**
* @author Doug Schaefer
*/
-public interface IType extends IBinding {
+public interface IType {
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ITypedef.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ITypedef.java
index 935870f7115..c3d2272dc0d 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ITypedef.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ITypedef.java
@@ -13,7 +13,7 @@ package org.eclipse.cdt.core.dom.ast;
/**
* @author Doug Schaefer
*/
-public interface ITypedef extends IType {
+public interface ITypedef extends IBinding, IType {
/**
* Returns the type that this thing is a typedef of
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/c/ICPointerType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/c/ICPointerType.java
new file mode 100644
index 00000000000..485bb168c1f
--- /dev/null
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/c/ICPointerType.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+/*
+ * Created on Dec 8, 2004
+ */
+package org.eclipse.cdt.core.dom.ast.c;
+
+import org.eclipse.cdt.core.dom.ast.IPointerType;
+
+/**
+ * @author aniefer
+ */
+public interface ICPointerType extends IPointerType {
+ boolean isRestrict();
+}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/c/ICQualifierType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/c/ICQualifierType.java
new file mode 100644
index 00000000000..740bce35b53
--- /dev/null
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/c/ICQualifierType.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+/*
+ * Created on Dec 9, 2004
+ */
+package org.eclipse.cdt.core.dom.ast.c;
+
+import org.eclipse.cdt.core.dom.ast.IQualifierType;
+
+/**
+ * @author aniefer
+ */
+public interface ICQualifierType extends IQualifierType {
+ public boolean isRestrict();
+}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPPointerToMemberType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPPointerToMemberType.java
new file mode 100644
index 00000000000..d0c459cdab9
--- /dev/null
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPPointerToMemberType.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+/*
+ * Created on Dec 9, 2004
+ */
+package org.eclipse.cdt.core.dom.ast.cpp;
+
+import org.eclipse.cdt.core.dom.ast.IBinding;
+import org.eclipse.cdt.core.dom.ast.IPointerType;
+
+/**
+ * @author aniefer
+ */
+public interface ICPPPointerToMemberType extends IPointerType {
+ public IBinding getMemberOfClass();
+}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPReferenceType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPReferenceType.java
new file mode 100644
index 00000000000..727e33090a0
--- /dev/null
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPReferenceType.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+/*
+ * Created on Dec 9, 2004
+ */
+package org.eclipse.cdt.core.dom.ast.cpp;
+
+import org.eclipse.cdt.core.dom.ast.IType;
+
+/**
+ * @author aniefer
+ */
+public interface ICPPReferenceType extends IType {
+ public IType getType();
+}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPPointerToMemberType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPPointerToMemberType.java
new file mode 100644
index 00000000000..8f916d80559
--- /dev/null
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPPointerToMemberType.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+/*
+ * Created on Dec 9, 2004
+ */
+package org.eclipse.cdt.core.dom.ast.gnu.cpp;
+
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPPointerToMemberType;
+
+/**
+ * @author aniefer
+ */
+public interface IGPPPointerToMemberType extends ICPPPointerToMemberType,
+ IGPPPointerType {
+
+}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPPointerType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPPointerType.java
new file mode 100644
index 00000000000..f9d9d47f56a
--- /dev/null
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPPointerType.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+/*
+ * Created on Dec 8, 2004
+ */
+package org.eclipse.cdt.core.dom.ast.gnu.cpp;
+
+import org.eclipse.cdt.core.dom.ast.IPointerType;
+
+/**
+ * @author aniefer
+ */
+public interface IGPPPointerType extends IPointerType {
+ boolean isRestrict();
+}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPQualifierType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPQualifierType.java
new file mode 100644
index 00000000000..8717f6cd2aa
--- /dev/null
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPQualifierType.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+/*
+ * Created on Dec 9, 2004
+ */
+package org.eclipse.cdt.core.dom.ast.gnu.cpp;
+
+import org.eclipse.cdt.core.dom.ast.IQualifierType;
+
+/**
+ * @author aniefer
+ */
+public interface IGPPQualifierType extends IQualifierType {
+ public boolean isRestrict();
+}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/c/CFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/c/CFunction.java
index acd39a849e3..5df53427a43 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/c/CFunction.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/c/CFunction.java
@@ -20,6 +20,7 @@ import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration;
import org.eclipse.cdt.core.dom.ast.IFunction;
+import org.eclipse.cdt.core.dom.ast.IFunctionType;
import org.eclipse.cdt.core.dom.ast.IScope;
/**
@@ -120,6 +121,14 @@ public class CFunction implements IFunction {
}
return null;
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.dom.ast.IFunction#getType()
+ */
+ public IFunctionType getType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
// public IASTDeclaration getDeclaration(){
// return (IASTDeclaration) declarator.getParent();
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/cpp/CPPFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/cpp/CPPFunction.java
index c8724bfb2d4..088371e2e98 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/cpp/CPPFunction.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser2/cpp/CPPFunction.java
@@ -19,6 +19,7 @@ import org.eclipse.cdt.core.dom.ast.IASTFunctionDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IFunction;
+import org.eclipse.cdt.core.dom.ast.IFunctionType;
import org.eclipse.cdt.core.dom.ast.IScope;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
@@ -101,4 +102,12 @@ public class CPPFunction implements IFunction {
return null;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.dom.ast.IFunction#getType()
+ */
+ public IFunctionType getType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}

Back to the top