Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2012-06-01 01:47:49 +0000
committerSergey Prigogin2012-06-01 02:12:23 +0000
commit31e3729d82024b8564621cae3950030aa5587446 (patch)
treec5ee56d4970b53abc3770ac7a56adb31d28fcbf8 /core/org.eclipse.cdt.core/parser/org/eclipse
parent07f9700ccde9fdb2ced735c13f66cbcaba5f843c (diff)
downloadorg.eclipse.cdt-31e3729d82024b8564621cae3950030aa5587446.tar.gz
org.eclipse.cdt-31e3729d82024b8564621cae3950030aa5587446.tar.xz
org.eclipse.cdt-31e3729d82024b8564621cae3950030aa5587446.zip
Cosmetics.
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org/eclipse')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java29
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTypeId.java8
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IProblemType.java3
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTTypeId.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTypeId.java6
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java3
6 files changed, 23 insertions, 28 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java
index 6bceaa29dca..ee0d6e2fb11 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java
@@ -45,8 +45,8 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil;
/**
- * This is a utility class to help convert AST elements to Strings corresponding to the
- * AST element's type.
+ * This is a utility class to help convert AST elements to Strings corresponding to
+ * the AST element's type.
*
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
@@ -58,9 +58,9 @@ public class ASTTypeUtil {
private static final int DEAULT_ITYPE_SIZE = 2;
/**
- * Returns a string representation for the parameters of the given function type. The
- * representation contains the comma-separated list of the normalized parameter type
- * representations wrapped in parentheses.
+ * Returns a string representation for the parameters of the given function type.
+ * The representation contains the comma-separated list of the normalized parameter
+ * type representations wrapped in parentheses.
*/
public static String getParameterTypeString(IFunctionType type) {
StringBuilder result = new StringBuilder();
@@ -493,7 +493,7 @@ public class ASTTypeUtil {
} else {
if (type instanceof ICPPReferenceType) {
// reference types ignore cv-qualifiers
- cvq=null;
+ cvq= null;
// lvalue references win over rvalue references
if (ref == null || ref.isRValueReference()) {
// delay reference to see if there are more
@@ -599,23 +599,24 @@ public class ASTTypeUtil {
*
* @noreference This method is not intended to be referenced by clients.
*/
- public static String getType(IASTDeclarator decltor) {
+ public static String getType(IASTDeclarator declarator) {
// get the most nested declarator
- while (decltor.getNestedDeclarator() != null)
- decltor = decltor.getNestedDeclarator();
+ while (declarator.getNestedDeclarator() != null) {
+ declarator = declarator.getNestedDeclarator();
+ }
- IBinding binding = decltor.getName().resolveBinding();
+ IBinding binding = declarator.getName().resolveBinding();
IType type = null;
try {
if (binding instanceof IEnumerator) {
- type = ((IEnumerator)binding).getType();
+ type = ((IEnumerator) binding).getType();
} else if (binding instanceof IFunction) {
- type = ((IFunction)binding).getType();
+ type = ((IFunction) binding).getType();
} else if (binding instanceof ITypedef) {
- type = ((ITypedef)binding).getType();
+ type = ((ITypedef) binding).getType();
} else if (binding instanceof IVariable) {
- type = ((IVariable)binding).getType();
+ type = ((IVariable) binding).getType();
}
} catch (DOMException e) {
return EMPTY_STRING;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTypeId.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTypeId.java
index 767b376941d..13fc8a000c9 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTypeId.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTypeId.java
@@ -21,15 +21,15 @@ public interface IASTTypeId extends IASTNode {
public static final IASTTypeId[] EMPTY_TYPEID_ARRAY = new IASTTypeId[0];
/**
- * <code>DECL_SPECIFIER</code> represents the relationship between an <code>IASTTypeId</code> and
- * it's nested <code>IASTDeclSpecifier</code>.
+ * <code>DECL_SPECIFIER</code> represents the relationship between an <code>IASTTypeId</code>
+ * and it's nested <code>IASTDeclSpecifier</code>.
*/
public static final ASTNodeProperty DECL_SPECIFIER = new ASTNodeProperty(
"IASTTypeId.DECL_SPECIFIER - IASTDeclSpecifier for IASTTypeId"); //$NON-NLS-1$
/**
- * <code>ABSTRACT_DECLARATOR</code> represents the relationship between an <code>IASTTypeId</code> and
- * it's nested <code>IASTDeclarator</code>.
+ * <code>ABSTRACT_DECLARATOR</code> represents the relationship between an <code>IASTTypeId</code>
+ * and it's nested <code>IASTDeclarator</code>.
*/
public static final ASTNodeProperty ABSTRACT_DECLARATOR = new ASTNodeProperty(
"IASTTypeId.ABSTRACT_DECLARATOR - IASTDeclarator for IASTTypeId"); //$NON-NLS-1$
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IProblemType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IProblemType.java
index facc9fa48c8..abc92782df0 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IProblemType.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IProblemType.java
@@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Markus Schorn - initial API and implementation
+ * Markus Schorn - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast;
@@ -22,5 +22,4 @@ package org.eclipse.cdt.core.dom.ast;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IProblemType extends IType, ISemanticProblem {
-
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTTypeId.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTTypeId.java
index 5f7dad418f4..cab1df9c5ef 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTTypeId.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTTypeId.java
@@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Markus Schorn - initial API and implementation
+ * Markus Schorn - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast.cpp;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTypeId.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTypeId.java
index 0e0c4f67f92..ebbca66cef9 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTypeId.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTypeId.java
@@ -43,12 +43,8 @@ public class CPPASTTypeId extends ASTNode implements ICPPASTTypeId {
CPPASTTypeId copy = new CPPASTTypeId();
copy.setDeclSpecifier(declSpec == null ? null : declSpec.copy(style));
copy.setAbstractDeclarator(absDecl == null ? null : absDecl.copy(style));
- copy.setOffsetAndLength(this);
copy.isPackExpansion = isPackExpansion;
- if (style == CopyStyle.withLocations) {
- copy.setCopyLocation(this);
- }
- return copy;
+ return copy(copy, style);
}
@Override
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java
index 62279584e4b..2d1347274a9 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java
@@ -1762,10 +1762,9 @@ public class CPPVisitor extends ASTQueries {
* Creates the type for a parameter declaration.
*/
public static IType createType(final ICPPASTParameterDeclaration pdecl, boolean forFuncType) {
- IType pt;
IASTDeclSpecifier pDeclSpec = pdecl.getDeclSpecifier();
ICPPASTDeclarator pDtor = pdecl.getDeclarator();
- pt = createType(pDeclSpec);
+ IType pt = createType(pDeclSpec);
if (pDtor != null) {
pt = createType(pt, pDtor);
}

Back to the top