1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2012-07-10 18:08:11 -07:00
parent a3307396d4
commit 147a6373cf
17 changed files with 67 additions and 63 deletions

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Markus Schorn - initial API and implementation * Markus Schorn - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser; package org.eclipse.cdt.internal.core.dom.parser;
@ -17,7 +17,6 @@ import org.eclipse.cdt.core.dom.ast.IASTNameOwner;
* Provides additional methods for internal use by the name resolution. * Provides additional methods for internal use by the name resolution.
*/ */
public interface IASTInternalNameOwner extends IASTNameOwner { public interface IASTInternalNameOwner extends IASTNameOwner {
/** /**
* Get the role for the name. If the name needs to be resolved to determine that and * Get the role for the name. If the name needs to be resolved to determine that and
* <code>allowResolution</code> is set to <code>false</code>, then {@link IASTNameOwner#r_unclear} * <code>allowResolution</code> is set to <code>false</code>, then {@link IASTNameOwner#r_unclear}

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Markus Schorn - initial API and implementation * Markus Schorn - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser; package org.eclipse.cdt.internal.core.dom.parser;

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Markus Schorn - initial API and implementation * Markus Schorn - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser; package org.eclipse.cdt.internal.core.dom.parser;
@ -17,7 +17,6 @@ import org.eclipse.cdt.core.dom.ast.IVariable;
* Internal interface for bindings in the ast that have values. * Internal interface for bindings in the ast that have values.
*/ */
public interface IInternalVariable extends IVariable { public interface IInternalVariable extends IVariable {
/** /**
* Returns the value of the variable, or <code>null</code>. * Returns the value of the variable, or <code>null</code>.
* If the recursion depth is reached {@link Value#UNKNOWN} will be returned. * If the recursion depth is reached {@link Value#UNKNOWN} will be returned.

View file

@ -6,13 +6,12 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Markus Schorn - initial API and implementation * Markus Schorn - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser; package org.eclipse.cdt.internal.core.dom.parser;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
/** /**
* Interface for marshalling types for storage in the index. * Interface for marshalling types for storage in the index.
*/ */

View file

@ -6,13 +6,12 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Markus Schorn - initial API and implementation * Markus Schorn - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser; package org.eclipse.cdt.internal.core.dom.parser;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
/** /**
* Interface for marshalling types for storage in the index. * Interface for marshalling types for storage in the index.
*/ */

View file

@ -18,12 +18,12 @@ import org.eclipse.cdt.core.dom.ast.IType;
*/ */
public interface ITypeContainer extends IType { public interface ITypeContainer extends IType {
/** /**
* get the type this contains * Returns the type this container contains.
*/ */
IType getType(); IType getType();
/** /**
* set the type this contains * Sets the type this container contains.
*/ */
void setType(IType type); void setType(IType type);
} }

View file

@ -6,16 +6,14 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Markus Schorn - initial API and implementation * Markus Schorn - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser; package org.eclipse.cdt.internal.core.dom.parser;
import org.eclipse.cdt.core.parser.AbstractParserLogService; import org.eclipse.cdt.core.parser.AbstractParserLogService;
import org.eclipse.cdt.core.parser.IParserLogService; import org.eclipse.cdt.core.parser.IParserLogService;
public class ParserLogServiceWrapper extends AbstractParserLogService { public class ParserLogServiceWrapper extends AbstractParserLogService {
private IParserLogService fDelegate; private IParserLogService fDelegate;
public ParserLogServiceWrapper(IParserLogService log) { public ParserLogServiceWrapper(IParserLogService log) {

View file

@ -16,7 +16,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionType;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPPointerType; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPPointerType;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
/** /**
* Implementation of problem types. * Implementation of problem types.
*/ */

View file

@ -78,7 +78,7 @@ public class Value implements IValue {
private static class Reevaluation { private static class Reevaluation {
public final char[] fExpression; public final char[] fExpression;
private final int fPackOffset; private final int fPackOffset;
public int pos=0; public int pos= 0;
public final Map<String, Integer> fUnknownSigs; public final Map<String, Integer> fUnknownSigs;
public final List<ICPPUnknownBinding> fUnknowns; public final List<ICPPUnknownBinding> fUnknowns;
public final IBinding[] fResolvedUnknown; public final IBinding[] fResolvedUnknown;
@ -94,7 +94,7 @@ public class Value implements IValue {
fMap= map; fMap= map;
} }
public void nextSeperator() throws UnknownValueException { public void nextSeparator() throws UnknownValueException {
final char[] expression = fExpression; final char[] expression = fExpression;
final int len = expression.length; final int len = expression.length;
int idx = pos; int idx = pos;
@ -783,17 +783,17 @@ public class Value implements IValue {
switch (c) { switch (c) {
case BINARY_OP_CHAR: case BINARY_OP_CHAR:
int op= parseNonNegative(buf, idx + 1); int op= parseNonNegative(buf, idx + 1);
reeval.nextSeperator(); reeval.nextSeparator();
Object o1= reevaluate(reeval, maxdepth); Object o1= reevaluate(reeval, maxdepth);
Object o2= reevaluate(reeval, maxdepth); Object o2= reevaluate(reeval, maxdepth);
return combineBinary(op, o1, o2); return combineBinary(op, o1, o2);
case UNARY_OP_CHAR: case UNARY_OP_CHAR:
op= parseNonNegative(buf, idx + 1); op= parseNonNegative(buf, idx + 1);
reeval.nextSeperator(); reeval.nextSeparator();
o1= reevaluate(reeval, maxdepth); o1= reevaluate(reeval, maxdepth);
return combineUnary(op, o1); return combineUnary(op, o1);
case CONDITIONAL_CHAR: case CONDITIONAL_CHAR:
reeval.nextSeperator(); reeval.nextSeparator();
Object cond= reevaluate(reeval, maxdepth); Object cond= reevaluate(reeval, maxdepth);
Object po= reevaluate(reeval, maxdepth); Object po= reevaluate(reeval, maxdepth);
Object neg= reevaluate(reeval, maxdepth); Object neg= reevaluate(reeval, maxdepth);
@ -811,12 +811,12 @@ public class Value implements IValue {
final IBinding[] resolvedUnknowns= reeval.fResolvedUnknown; final IBinding[] resolvedUnknowns= reeval.fResolvedUnknown;
if (num >= resolvedUnknowns.length) if (num >= resolvedUnknowns.length)
throw UNKNOWN_EX; throw UNKNOWN_EX;
reeval.nextSeperator(); reeval.nextSeparator();
return evaluateBinding(resolvedUnknowns[num], reeval.fUnknownSigs, reeval.fUnknowns, maxdepth); return evaluateBinding(resolvedUnknowns[num], reeval.fUnknownSigs, reeval.fUnknowns, maxdepth);
case TEMPLATE_PARAM_CHAR: case TEMPLATE_PARAM_CHAR:
num= parseHex(buf, idx + 1); num= parseHex(buf, idx + 1);
reeval.nextSeperator(); reeval.nextSeparator();
ICPPTemplateArgument arg = reeval.fMap.getArgument(num); ICPPTemplateArgument arg = reeval.fMap.getArgument(num);
if (arg != null) { if (arg != null) {
IValue val= arg.getNonTypeValue(); IValue val= arg.getNonTypeValue();
@ -828,7 +828,7 @@ public class Value implements IValue {
case TEMPLATE_PARAM_PACK_CHAR: case TEMPLATE_PARAM_PACK_CHAR:
num= parseHex(buf, idx + 1); num= parseHex(buf, idx + 1);
reeval.nextSeperator(); reeval.nextSeparator();
arg= null; arg= null;
if (reeval.fPackOffset >= 0) { if (reeval.fPackOffset >= 0) {
ICPPTemplateArgument[] args= reeval.fMap.getPackExpansion(num); ICPPTemplateArgument[] args= reeval.fMap.getPackExpansion(num);
@ -845,7 +845,7 @@ public class Value implements IValue {
return createTemplateParamExpression(num, true); return createTemplateParamExpression(num, true);
default: default:
reeval.nextSeperator(); reeval.nextSeparator();
return parseLong(buf, idx); return parseLong(buf, idx);
} }
} }

View file

@ -6,13 +6,16 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Markus Schorn - initial API and implementation * Markus Schorn - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics; package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.TypeSelection.PARAMETERS; import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.TypeSelection.PARAMETERS;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.TypeSelection.RETURN_TYPE; import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.TypeSelection.RETURN_TYPE;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.*; import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.CVTYPE;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.REF;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.TDEF;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.getNestedType;
import org.eclipse.cdt.core.dom.ast.DOMException; import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory; import org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory;

View file

@ -1,10 +1,13 @@
/* /*******************************************************************************
* FunctionSetType.java * Copyright (c) 2010 Wind River Systems, Inc. and others.
* Created on Sep 14, 2010 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* *
* Copyright 2010 Wind River Systems, Inc. All rights reserved. * Contributors:
*/ * Markus Schorn - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics; package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE; import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
@ -22,7 +25,6 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.Cost.Rank;
* Used during overload resolution as a place-holder for function sets. * Used during overload resolution as a place-holder for function sets.
*/ */
public class FunctionSetType implements IType { public class FunctionSetType implements IType {
private final CPPFunctionSet fFunctionSet; private final CPPFunctionSet fFunctionSet;
private final boolean fPointerType; private final boolean fPointerType;

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Markus Schorn - initial API and implementation * Markus Schorn - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics; package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;

View file

@ -6,11 +6,11 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* IBM - Initial API and implementation * IBM - Initial API and implementation
* Markus Schorn (Wind River Systems) * Markus Schorn (Wind River Systems)
* Bryan Wilkinson (QNX) * Bryan Wilkinson (QNX)
* Andrew Ferguson (Symbian) * Andrew Ferguson (Symbian)
* Sergey Prigogin (Google) * Sergey Prigogin (Google)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics; package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;

View file

@ -6,8 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Markus Schorn - initial API and implementation * Markus Schorn - initial API and implementation
* Sergey Prigogin (Google) * Sergey Prigogin (Google)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics; package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
@ -33,7 +33,6 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPASTInternalScope;
* Utility class to populate scope with friend declarations hidden in nested classes * Utility class to populate scope with friend declarations hidden in nested classes
*/ */
class NamespaceTypeCollector extends ASTVisitor { class NamespaceTypeCollector extends ASTVisitor {
private final ICPPASTInternalScope fScope; private final ICPPASTInternalScope fScope;
public NamespaceTypeCollector(ICPPASTInternalScope scope) { public NamespaceTypeCollector(ICPPASTInternalScope scope) {

View file

@ -6,12 +6,18 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Markus Schorn - initial API and implementation * Markus Schorn - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics; package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE; import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.*; import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.ALLCVQ;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.CVTYPE;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.REF;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.TDEF;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.getCVQualifier;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.getNestedType;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.getSimplifiedType;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -69,9 +75,8 @@ public class TemplateArgumentDeduction {
* @param point * @param point
*/ */
static ICPPTemplateArgument[] deduceForFunctionCall(ICPPFunctionTemplate template, static ICPPTemplateArgument[] deduceForFunctionCall(ICPPFunctionTemplate template,
ICPPTemplateArgument[] tmplArgs, List<IType> fnArgs, List<ValueCategory> argIsLValue, CPPTemplateParameterMap map, IASTNode point) ICPPTemplateArgument[] tmplArgs, List<IType> fnArgs, List<ValueCategory> argIsLValue,
throws DOMException { CPPTemplateParameterMap map, IASTNode point) throws DOMException {
final ICPPTemplateParameter[] tmplParams = template.getTemplateParameters(); final ICPPTemplateParameter[] tmplParams = template.getTemplateParameters();
if (tmplArgs != null && !addExplicitArguments(tmplParams, tmplArgs, map, point)) if (tmplArgs != null && !addExplicitArguments(tmplParams, tmplArgs, map, point))
@ -87,13 +92,14 @@ public class TemplateArgumentDeduction {
* Deduces the mapping for the template parameters from the function parameters, * Deduces the mapping for the template parameters from the function parameters,
* returns <code>false</code> if there is no mapping. * returns <code>false</code> if there is no mapping.
*/ */
static boolean deduceFromFunctionArgs(ICPPFunctionTemplate template, List<IType> fnArgs, List<ValueCategory> argCats, static boolean deduceFromFunctionArgs(ICPPFunctionTemplate template, List<IType> fnArgs,
CPPTemplateParameterMap map, IASTNode point) { List<ValueCategory> argCats, CPPTemplateParameterMap map, IASTNode point) {
try { try {
IType[] fnPars = template.getType().getParameterTypes(); IType[] fnPars = template.getType().getParameterTypes();
final int fnParCount = fnPars.length; final int fnParCount = fnPars.length;
final ICPPTemplateParameter[] tmplPars = template.getTemplateParameters(); final ICPPTemplateParameter[] tmplPars = template.getTemplateParameters();
TemplateArgumentDeduction deduct= new TemplateArgumentDeduction(tmplPars, map, new CPPTemplateParameterMap(fnParCount), 0); TemplateArgumentDeduction deduct=
new TemplateArgumentDeduction(tmplPars, map, new CPPTemplateParameterMap(fnParCount), 0);
IType fnParPack= null; IType fnParPack= null;
argLoop: for (int j= 0; j < fnArgs.size(); j++) { argLoop: for (int j= 0; j < fnArgs.size(); j++) {
IType par; IType par;
@ -474,7 +480,6 @@ public class TemplateArgumentDeduction {
return result.toArray(new ICPPTemplateArgument[result.size()]); return result.toArray(new ICPPTemplateArgument[result.size()]);
} }
/** /**
* 14.8.2.1.3 If P is a class and has the form template-id, then A can be a derived class of the deduced A. * 14.8.2.1.3 If P is a class and has the form template-id, then A can be a derived class of the deduced A.
*/ */
@ -543,7 +548,9 @@ public class TemplateArgumentDeduction {
* Deduces the template parameter mapping from pairs of template arguments. * Deduces the template parameter mapping from pairs of template arguments.
* @param point * @param point
*/ */
public static boolean fromTemplateArguments(final ICPPTemplateParameter[] pars, final ICPPTemplateArgument[] p, final ICPPTemplateArgument[] a, CPPTemplateParameterMap map, IASTNode point) throws DOMException { public static boolean fromTemplateArguments(final ICPPTemplateParameter[] pars,
final ICPPTemplateArgument[] p, final ICPPTemplateArgument[] a, CPPTemplateParameterMap map,
IASTNode point) throws DOMException {
TemplateArgumentDeduction deduct= new TemplateArgumentDeduction(pars, null, map, 0); TemplateArgumentDeduction deduct= new TemplateArgumentDeduction(pars, null, map, 0);
final int len= a.length; final int len= a.length;
if (p == null || p.length != len) { if (p == null || p.length != len) {
@ -663,7 +670,6 @@ public class TemplateArgumentDeduction {
return fromType(p.getTypeValue(), a.getTypeValue(), false, point); return fromType(p.getTypeValue(), a.getTypeValue(), false, point);
} }
private boolean fromType(IType p, IType a, boolean allowCVQConversion, IASTNode point) throws DOMException { private boolean fromType(IType p, IType a, boolean allowCVQConversion, IASTNode point) throws DOMException {
while (p != null) { while (p != null) {
while (a instanceof ITypedef) while (a instanceof ITypedef)

View file

@ -6,9 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Markus Schorn - initial API and implementation * Markus Schorn - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics; package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.IType;

View file

@ -1,10 +1,13 @@
/* /*******************************************************************************
* UniqueType.java * Copyright (c) 2010 Wind River Systems, Inc. and others.
* Created on 04.10.2010 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* *
* Copyright 2010 Wind River Systems, Inc. All rights reserved. * Contributors:
*/ * Markus Schorn - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics; package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.IType;
@ -13,7 +16,6 @@ import org.eclipse.cdt.core.dom.ast.IType;
* Used for computing the partial ordering of function templates. * Used for computing the partial ordering of function templates.
*/ */
class UniqueType implements IType { class UniqueType implements IType {
private boolean fForParameterPack; private boolean fForParameterPack;
public UniqueType(boolean forParameterPack) { public UniqueType(boolean forParameterPack) {