mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cosmetics.
This commit is contained in:
parent
a3307396d4
commit
147a6373cf
17 changed files with 67 additions and 63 deletions
|
@ -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.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.
|
||||
*/
|
||||
public interface IASTInternalNameOwner extends IASTNameOwner {
|
||||
|
||||
/**
|
||||
* 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}
|
||||
|
|
|
@ -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.internal.core.dom.parser;
|
||||
|
||||
|
|
|
@ -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.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.
|
||||
*/
|
||||
public interface IInternalVariable extends IVariable {
|
||||
|
||||
/**
|
||||
* Returns the value of the variable, or <code>null</code>.
|
||||
* If the recursion depth is reached {@link Value#UNKNOWN} will be returned.
|
||||
|
|
|
@ -6,13 +6,12 @@
|
|||
* 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.internal.core.dom.parser;
|
||||
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
|
||||
|
||||
/**
|
||||
* Interface for marshalling types for storage in the index.
|
||||
*/
|
||||
|
|
|
@ -6,13 +6,12 @@
|
|||
* 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.internal.core.dom.parser;
|
||||
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
|
||||
|
||||
/**
|
||||
* Interface for marshalling types for storage in the index.
|
||||
*/
|
||||
|
|
|
@ -18,12 +18,12 @@ import org.eclipse.cdt.core.dom.ast.IType;
|
|||
*/
|
||||
public interface ITypeContainer extends IType {
|
||||
/**
|
||||
* get the type this contains
|
||||
* Returns the type this container contains.
|
||||
*/
|
||||
IType getType();
|
||||
|
||||
/**
|
||||
* set the type this contains
|
||||
* Sets the type this container contains.
|
||||
*/
|
||||
void setType(IType type);
|
||||
}
|
||||
|
|
|
@ -6,16 +6,14 @@
|
|||
* 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.internal.core.dom.parser;
|
||||
|
||||
import org.eclipse.cdt.core.parser.AbstractParserLogService;
|
||||
import org.eclipse.cdt.core.parser.IParserLogService;
|
||||
|
||||
public class ParserLogServiceWrapper extends AbstractParserLogService {
|
||||
|
||||
private IParserLogService fDelegate;
|
||||
|
||||
public ParserLogServiceWrapper(IParserLogService log) {
|
||||
|
|
|
@ -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.core.runtime.CoreException;
|
||||
|
||||
|
||||
/**
|
||||
* Implementation of problem types.
|
||||
*/
|
||||
|
|
|
@ -78,7 +78,7 @@ public class Value implements IValue {
|
|||
private static class Reevaluation {
|
||||
public final char[] fExpression;
|
||||
private final int fPackOffset;
|
||||
public int pos=0;
|
||||
public int pos= 0;
|
||||
public final Map<String, Integer> fUnknownSigs;
|
||||
public final List<ICPPUnknownBinding> fUnknowns;
|
||||
public final IBinding[] fResolvedUnknown;
|
||||
|
@ -94,7 +94,7 @@ public class Value implements IValue {
|
|||
fMap= map;
|
||||
}
|
||||
|
||||
public void nextSeperator() throws UnknownValueException {
|
||||
public void nextSeparator() throws UnknownValueException {
|
||||
final char[] expression = fExpression;
|
||||
final int len = expression.length;
|
||||
int idx = pos;
|
||||
|
@ -783,17 +783,17 @@ public class Value implements IValue {
|
|||
switch (c) {
|
||||
case BINARY_OP_CHAR:
|
||||
int op= parseNonNegative(buf, idx + 1);
|
||||
reeval.nextSeperator();
|
||||
reeval.nextSeparator();
|
||||
Object o1= reevaluate(reeval, maxdepth);
|
||||
Object o2= reevaluate(reeval, maxdepth);
|
||||
return combineBinary(op, o1, o2);
|
||||
case UNARY_OP_CHAR:
|
||||
op= parseNonNegative(buf, idx + 1);
|
||||
reeval.nextSeperator();
|
||||
reeval.nextSeparator();
|
||||
o1= reevaluate(reeval, maxdepth);
|
||||
return combineUnary(op, o1);
|
||||
case CONDITIONAL_CHAR:
|
||||
reeval.nextSeperator();
|
||||
reeval.nextSeparator();
|
||||
Object cond= reevaluate(reeval, maxdepth);
|
||||
Object po= reevaluate(reeval, maxdepth);
|
||||
Object neg= reevaluate(reeval, maxdepth);
|
||||
|
@ -811,12 +811,12 @@ public class Value implements IValue {
|
|||
final IBinding[] resolvedUnknowns= reeval.fResolvedUnknown;
|
||||
if (num >= resolvedUnknowns.length)
|
||||
throw UNKNOWN_EX;
|
||||
reeval.nextSeperator();
|
||||
reeval.nextSeparator();
|
||||
return evaluateBinding(resolvedUnknowns[num], reeval.fUnknownSigs, reeval.fUnknowns, maxdepth);
|
||||
|
||||
case TEMPLATE_PARAM_CHAR:
|
||||
num= parseHex(buf, idx + 1);
|
||||
reeval.nextSeperator();
|
||||
reeval.nextSeparator();
|
||||
ICPPTemplateArgument arg = reeval.fMap.getArgument(num);
|
||||
if (arg != null) {
|
||||
IValue val= arg.getNonTypeValue();
|
||||
|
@ -828,7 +828,7 @@ public class Value implements IValue {
|
|||
|
||||
case TEMPLATE_PARAM_PACK_CHAR:
|
||||
num= parseHex(buf, idx + 1);
|
||||
reeval.nextSeperator();
|
||||
reeval.nextSeparator();
|
||||
arg= null;
|
||||
if (reeval.fPackOffset >= 0) {
|
||||
ICPPTemplateArgument[] args= reeval.fMap.getPackExpansion(num);
|
||||
|
@ -845,7 +845,7 @@ public class Value implements IValue {
|
|||
return createTemplateParamExpression(num, true);
|
||||
|
||||
default:
|
||||
reeval.nextSeperator();
|
||||
reeval.nextSeparator();
|
||||
return parseLong(buf, idx);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,13 +6,16 @@
|
|||
* 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.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.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.IASTExpression.ValueCategory;
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
/*
|
||||
* FunctionSetType.java
|
||||
* Created on Sep 14, 2010
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2010 Wind River Systems, Inc. and others.
|
||||
* 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;
|
||||
|
||||
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.
|
||||
*/
|
||||
public class FunctionSetType implements IType {
|
||||
|
||||
private final CPPFunctionSet fFunctionSet;
|
||||
private final boolean fPointerType;
|
||||
|
||||
|
|
|
@ -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.internal.core.dom.parser.cpp.semantics;
|
||||
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM - Initial API and implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
* Bryan Wilkinson (QNX)
|
||||
* Andrew Ferguson (Symbian)
|
||||
* Sergey Prigogin (Google)
|
||||
* IBM - Initial API and implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
* Bryan Wilkinson (QNX)
|
||||
* Andrew Ferguson (Symbian)
|
||||
* Sergey Prigogin (Google)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Markus Schorn - initial API and implementation
|
||||
* Sergey Prigogin (Google)
|
||||
* Markus Schorn - initial API and implementation
|
||||
* Sergey Prigogin (Google)
|
||||
*******************************************************************************/
|
||||
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
|
||||
*/
|
||||
class NamespaceTypeCollector extends ASTVisitor {
|
||||
|
||||
private final ICPPASTInternalScope fScope;
|
||||
|
||||
public NamespaceTypeCollector(ICPPASTInternalScope scope) {
|
||||
|
|
|
@ -6,12 +6,18 @@
|
|||
* 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.internal.core.dom.parser.cpp.semantics;
|
||||
|
||||
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.Arrays;
|
||||
|
@ -69,9 +75,8 @@ public class TemplateArgumentDeduction {
|
|||
* @param point
|
||||
*/
|
||||
static ICPPTemplateArgument[] deduceForFunctionCall(ICPPFunctionTemplate template,
|
||||
ICPPTemplateArgument[] tmplArgs, List<IType> fnArgs, List<ValueCategory> argIsLValue, CPPTemplateParameterMap map, IASTNode point)
|
||||
throws DOMException {
|
||||
|
||||
ICPPTemplateArgument[] tmplArgs, List<IType> fnArgs, List<ValueCategory> argIsLValue,
|
||||
CPPTemplateParameterMap map, IASTNode point) throws DOMException {
|
||||
final ICPPTemplateParameter[] tmplParams = template.getTemplateParameters();
|
||||
|
||||
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,
|
||||
* returns <code>false</code> if there is no mapping.
|
||||
*/
|
||||
static boolean deduceFromFunctionArgs(ICPPFunctionTemplate template, List<IType> fnArgs, List<ValueCategory> argCats,
|
||||
CPPTemplateParameterMap map, IASTNode point) {
|
||||
static boolean deduceFromFunctionArgs(ICPPFunctionTemplate template, List<IType> fnArgs,
|
||||
List<ValueCategory> argCats, CPPTemplateParameterMap map, IASTNode point) {
|
||||
try {
|
||||
IType[] fnPars = template.getType().getParameterTypes();
|
||||
final int fnParCount = fnPars.length;
|
||||
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;
|
||||
argLoop: for (int j= 0; j < fnArgs.size(); j++) {
|
||||
IType par;
|
||||
|
@ -474,7 +480,6 @@ public class TemplateArgumentDeduction {
|
|||
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.
|
||||
*/
|
||||
|
@ -543,7 +548,9 @@ public class TemplateArgumentDeduction {
|
|||
* Deduces the template parameter mapping from pairs of template arguments.
|
||||
* @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);
|
||||
final int len= a.length;
|
||||
if (p == null || p.length != len) {
|
||||
|
@ -663,7 +670,6 @@ public class TemplateArgumentDeduction {
|
|||
return fromType(p.getTypeValue(), a.getTypeValue(), false, point);
|
||||
}
|
||||
|
||||
|
||||
private boolean fromType(IType p, IType a, boolean allowCVQConversion, IASTNode point) throws DOMException {
|
||||
while (p != null) {
|
||||
while (a instanceof ITypedef)
|
||||
|
|
|
@ -6,9 +6,8 @@
|
|||
* 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.internal.core.dom.parser.cpp.semantics;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IType;
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
/*
|
||||
* UniqueType.java
|
||||
* Created on 04.10.2010
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2010 Wind River Systems, Inc. and others.
|
||||
* 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;
|
||||
|
||||
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.
|
||||
*/
|
||||
class UniqueType implements IType {
|
||||
|
||||
private boolean fForParameterPack;
|
||||
|
||||
public UniqueType(boolean forParameterPack) {
|
||||
|
|
Loading…
Add table
Reference in a new issue