diff options
author | Doug Schaefer | 2004-11-17 15:02:55 +0000 |
---|---|---|
committer | Doug Schaefer | 2004-11-17 15:02:55 +0000 |
commit | 2923421fcd11bef8cc0e138771739e0fe43241fc (patch) | |
tree | 5c34f214015c173c98f3dbf77b45ddbe195596d6 | |
parent | 8e62aa6519c64d34f38c126563b90ef8338ccebb (diff) | |
download | org.eclipse.cdt-2923421fcd11bef8cc0e138771739e0fe43241fc.tar.gz org.eclipse.cdt-2923421fcd11bef8cc0e138771739e0fe43241fc.tar.xz org.eclipse.cdt-2923421fcd11bef8cc0e138771739e0fe43241fc.zip |
Start at logical support for templates.
5 files changed, 118 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassType.java index a10fbf9ff70..0bfe2ab88ca 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassType.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassType.java @@ -71,4 +71,3 @@ public interface ICPPClassType extends ICompositeType { public List getDeclaredMethods(); } - diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPTemplateDefinition.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPTemplateDefinition.java new file mode 100644 index 00000000000..2bae751ec2e --- /dev/null +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPTemplateDefinition.java @@ -0,0 +1,45 @@ +/********************************************************************** + * 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 - Initial API and implementation + **********************************************************************/ +package org.eclipse.cdt.core.dom.ast.cpp; + +import java.util.List; + +/** + * @author Doug Schaefer + */ +public interface ICPPTemplateDefinition { + + /** + * Returns the list of template parameters. If this is a template + * specialization, the parameters will be substituted by the arguments + * determined in the specialization. + * + * @return List of ICPPTemplateParameter, IType, or IASTExpression. + * The type or expression are arguments in a specialization. + */ + public List getParameters(); + + /** + * Returns whether this is a template specialization. + * + * @return is this a template specialization + */ + public boolean isSpecialization(); + + /** + * If this is a template specialization, this returns the template + * definition this is specializing. It returns null if this template + * is not a specialization. + * + * @return + */ + public ICPPTemplateDefinition getSpecializes(); +} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPTemplateNonTypeParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPTemplateNonTypeParameter.java new file mode 100644 index 00000000000..bbf3504b5f9 --- /dev/null +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPTemplateNonTypeParameter.java @@ -0,0 +1,28 @@ +/********************************************************************** + * 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 - Initial API and implementation + **********************************************************************/ +package org.eclipse.cdt.core.dom.ast.cpp; + +import org.eclipse.cdt.core.dom.ast.IASTExpression; +import org.eclipse.cdt.core.dom.ast.IVariable; + +/** + * @author Doug Schaefer + */ +public interface ICPPTemplateNonTypeParameter extends ICPPTemplateParameter, IVariable { + + /** + * The default value for this parameter. + * + * @return + */ + public IASTExpression getDefault(); + +} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPTemplateParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPTemplateParameter.java new file mode 100644 index 00000000000..0d25bad65bf --- /dev/null +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPTemplateParameter.java @@ -0,0 +1,18 @@ +/********************************************************************** + * 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 - Initial API and implementation + **********************************************************************/ +package org.eclipse.cdt.core.dom.ast.cpp; + +/** + * @author Doug Schaefer + */ +public interface ICPPTemplateParameter { + +} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPTemplateTypeParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPTemplateTypeParameter.java new file mode 100644 index 00000000000..3e5dcd9ee51 --- /dev/null +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPTemplateTypeParameter.java @@ -0,0 +1,27 @@ +/********************************************************************** + * 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 - Initial API and implementation + **********************************************************************/ +package org.eclipse.cdt.core.dom.ast.cpp; + +import org.eclipse.cdt.core.dom.ast.IType; + +/** + * @author Doug Schaefer + */ +public interface ICPPTemplateTypeParameter extends ICPPTemplateParameter, IType { + + /** + * The default type for this parameter. + * + * @return + */ + public IType getDefault(); + +} |