Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHansruedi Patzen2018-05-29 11:21:41 +0000
committerThomas Corbat2018-06-20 10:40:31 +0000
commitbc4aa4597dc1c98b41f1ded9d2429115a4ff1268 (patch)
tree43dfb9f3e191471351e494d9ed3d2d278484f774 /core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast
parent4c66f7c8f3e2f839e6152f522054616b15baa45a (diff)
downloadorg.eclipse.cdt-bc4aa4597dc1c98b41f1ded9d2429115a4ff1268.tar.gz
org.eclipse.cdt-bc4aa4597dc1c98b41f1ded9d2429115a4ff1268.tar.xz
org.eclipse.cdt-bc4aa4597dc1c98b41f1ded9d2429115a4ff1268.zip
Bug 535256: Rewrite removes attributes, key and base from C++ enum
Fix and tests. Change-Id: I1f5519f833563378d87b3c932b754e29c3e32b06 Signed-off-by: Hansruedi Patzen <hansruedi.patzen@hsr.ch> Signed-off-by: Thomas Corbat <tcorbat@hsr.ch>
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTEnumerationSpecifier.java24
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPNodeFactory.java9
2 files changed, 33 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTEnumerationSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTEnumerationSpecifier.java
index e419bdbda27..91de82621cd 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTEnumerationSpecifier.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTEnumerationSpecifier.java
@@ -24,6 +24,15 @@ public interface ICPPASTEnumerationSpecifier extends IASTEnumerationSpecifier, I
public static final ASTNodeProperty BASE_TYPE = new ASTNodeProperty(
"ICPPASTEnumerationSpecifier.BASE_TYPE [ICPPASTDeclSpecifier]"); //$NON-NLS-1$
+ /**
+ * @since 6.5
+ */
+ public enum ScopeStyle {
+ CLASS,
+ STRUCT,
+ NONE
+ }
+
@Override
public ICPPASTEnumerationSpecifier copy();
@@ -35,8 +44,23 @@ public interface ICPPASTEnumerationSpecifier extends IASTEnumerationSpecifier, I
/**
* Not allowed on frozen AST.
+ * @deprecated Use setScopeToken instead
+ * If {@code isScoped == true} is passed, the {@code ScopeToken.CLASS} scope token is assumed.
*/
+ @Deprecated
public void setIsScoped(boolean isScoped);
+
+ /**
+ * Not allowed on frozen AST.
+ * @since 6.5
+ */
+ public void setScopeStyle(ScopeStyle scopeStyle);
+
+ /**
+ * @since 6.5
+ */
+ public ScopeStyle getScopeStyle();
+
/**
* An enum is scoped if it uses the enumeration head {@code enum class} or {@code enum struct}.
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPNodeFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPNodeFactory.java
index 659b040f4d9..b33183bd746 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPNodeFactory.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPNodeFactory.java
@@ -30,6 +30,7 @@ import org.eclipse.cdt.core.dom.ast.IASTToken;
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
import org.eclipse.cdt.core.dom.ast.INodeFactory;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTEnumerationSpecifier.ScopeStyle;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUnaryTypeTransformation.Operator;
import org.eclipse.cdt.core.dom.ast.gnu.cpp.IGPPASTArrayRangeDesignator;
import org.eclipse.cdt.core.dom.parser.cpp.ICPPASTAttributeSpecifier;
@@ -158,9 +159,17 @@ public interface ICPPNodeFactory extends INodeFactory {
/**
* @since 5.2
+ * @deprecated Use {@code newEnumerationSpecifier(ScopeToken, IASTName, ICPPASTDeclSpecifier)} instead.
+ * If {@code isScoped == true} is passed {@code ScopeToken.CLASS} is assumed.
*/
+ @Deprecated
public ICPPASTEnumerationSpecifier newEnumerationSpecifier(boolean isScoped, IASTName name, ICPPASTDeclSpecifier baseType);
+ /**
+ * @since 6.5
+ */
+ public ICPPASTEnumerationSpecifier newEnumerationSpecifier(ScopeStyle scopeStyle, IASTName name, ICPPASTDeclSpecifier baseType);
+
public ICPPASTExplicitTemplateInstantiation newExplicitTemplateInstantiation(IASTDeclaration declaration);
@Override

Back to the top