mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cosmetics.
This commit is contained in:
parent
9e00dad206
commit
dd039973ae
7 changed files with 424 additions and 467 deletions
|
@ -1,13 +1,13 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004, 2010 IBM Corporation 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 (c) 2004, 2010 IBM Corporation 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
|
||||
*
|
||||
* Contributors:
|
||||
* Andrew Niefer (IBM Corporation) - initial API and implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
* Contributors:
|
||||
* Andrew Niefer (IBM Corporation) - initial API and implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.dom.ast.cpp;
|
||||
|
||||
|
@ -25,8 +25,8 @@ public interface ICPPClassScope extends ICPPScope {
|
|||
|
||||
/**
|
||||
* Returns an array of methods that were implicitly added to this class
|
||||
* scope. These methods may or may not have been explicitly declared in the
|
||||
* code. The methods that will be implicitly declared are: the default
|
||||
* scope. These methods may or may not have been explicitly declared in
|
||||
* the code. The methods that will be implicitly declared are: the default
|
||||
* constructor, copy constructor, copy assignment operator, and destructor
|
||||
*/
|
||||
public ICPPMethod[] getImplicitMethods();
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM Rational Software - Initial API and implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
* IBM Rational Software - Initial API and implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.parser;
|
||||
|
||||
|
@ -19,11 +19,10 @@ import java.util.Map;
|
|||
*/
|
||||
public interface IScannerInfo {
|
||||
/**
|
||||
* Returns a <code>Map</code> containing all the defined preprocessor
|
||||
* symbols and their values.
|
||||
* Returns a {@link Map} containing all the defined preprocessor symbols and their values.
|
||||
* Symbols defined without values have an empty string for a value. For
|
||||
* example,-Dsymbol=value would have a map entry (symbol,value). A symbol
|
||||
* defined as -Dsymbol= would have a map entry of (symbol,"").
|
||||
* example, -Dsymbol=value would have a map entry (symbol, value). A symbol
|
||||
* defined as -Dsymbol= would have a map entry of (symbol, "").
|
||||
*/
|
||||
public Map<String, String> getDefinedSymbols();
|
||||
|
||||
|
@ -41,9 +40,10 @@ public interface IScannerInfo {
|
|||
* <br> E.g.: /System/Library/Frameworks/__framework__.framework/Headers/__header__,
|
||||
* /System/Library/Frameworks/__framework__.framework/PrivateHeaders/__header__
|
||||
* would handle the framework search for '/System/Library/Frameworks'
|
||||
* <br> The variables are handled only, if a search path element makes use of both of the variables.
|
||||
* The __framework__ variable will receive the first segment of the include, the __header__ variable
|
||||
* the rest. Such a search path element is not used for directives with a single segment (e.g. 'header.h')
|
||||
* <br> The variables are handled only, if a search path element makes use of both of
|
||||
* the variables. The __framework__ variable will receive the first segment of the include,
|
||||
* the __header__ variable the rest. Such a search path element is not used for directives
|
||||
* with a single segment (e.g. 'header.h')
|
||||
*/
|
||||
public String[] getIncludePaths();
|
||||
}
|
||||
|
|
|
@ -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.core.parser;
|
||||
|
||||
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM - Initial API and implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
* IBM - Initial API and implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||
|
||||
|
@ -40,8 +40,8 @@ import org.eclipse.cdt.internal.core.parser.scanner.InternalFileContent;
|
|||
* C++-specific implementation of a translation-unit.
|
||||
*/
|
||||
public class CPPASTTranslationUnit extends ASTTranslationUnit implements ICPPASTTranslationUnit, IASTAmbiguityParent {
|
||||
private CPPNamespaceScope fScope = null;
|
||||
private ICPPNamespace fBinding = null;
|
||||
private CPPNamespaceScope fScope;
|
||||
private ICPPNamespace fBinding;
|
||||
private final CPPScopeMapper fScopeMapper= new CPPScopeMapper(this);
|
||||
|
||||
public CPPASTTranslationUnit() {
|
||||
|
|
|
@ -165,7 +165,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
private final IIndex index;
|
||||
protected ICPPASTTranslationUnit translationUnit;
|
||||
|
||||
private int functionBodyCount= 0;
|
||||
private int functionBodyCount;
|
||||
private char[] currentClassName;
|
||||
|
||||
private final ICPPNodeFactory nodeFactory;
|
||||
|
@ -218,7 +218,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
private IASTName ambiguousQualifiedName(CastExprCtx ctx) throws BacktrackException, EndOfFileException {
|
||||
TemplateIdStrategy strat= new TemplateIdStrategy();
|
||||
IToken m= mark();
|
||||
for(;;) {
|
||||
while (true) {
|
||||
try {
|
||||
return qualifiedName(ctx, strat);
|
||||
} catch (BacktrackException e) {
|
||||
|
@ -250,7 +250,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
|
||||
boolean mustBeLast= false;
|
||||
boolean haveName= false;
|
||||
loop: for(;;) {
|
||||
loop: while (true) {
|
||||
boolean keywordTemplate= false;
|
||||
if (qname != null && LT(1) == IToken.t_template) {
|
||||
consume();
|
||||
|
@ -1011,7 +1011,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
|
||||
final IToken mark= mark();
|
||||
IToken lastToken= null;
|
||||
for(;;) {
|
||||
while (true) {
|
||||
try {
|
||||
IASTExpression e = castExpression(CastExprCtx.eDirectlyInBExpr, strat);
|
||||
if (variants == null) {
|
||||
|
@ -1045,7 +1045,6 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
return variants != null ? variants : singleExpression;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected IASTExpression buildBinaryExpression(int operator, IASTExpression expr1, IASTInitializerClause expr2, int lastOffset) {
|
||||
IASTBinaryExpression result = nodeFactory.newBinaryExpression(operator, expr1, expr2);
|
||||
|
@ -1063,8 +1062,8 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
backup(throwToken);
|
||||
consume();
|
||||
}
|
||||
int o = throwExpression != null ? calculateEndOffset(throwExpression)
|
||||
: throwToken.getEndOffset();
|
||||
int o = throwExpression != null ?
|
||||
calculateEndOffset(throwExpression) : throwToken.getEndOffset();
|
||||
return buildUnaryExpression(ICPPASTUnaryExpression.op_throw,
|
||||
throwExpression, throwToken.getOffset(), o); // fix for 95225
|
||||
}
|
||||
|
@ -1095,7 +1094,6 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
return deleteExpression;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Parse a new-expression. There is room for ambiguities. With P for placement, T for typeid,
|
||||
* and I for initializer the potential patterns (with the new omitted) are:
|
||||
|
@ -1190,7 +1188,6 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
endOffset2= -1;
|
||||
}
|
||||
|
||||
|
||||
if (plcmt == null || endOffset2 > endOffset)
|
||||
return newExpression(isGlobal, null, typeid2, false, init2, offset, endOffset2);
|
||||
|
||||
|
@ -1222,7 +1219,6 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
return newExpression(isGlobal, null, typeid, true, init, offset, endOffset);
|
||||
}
|
||||
|
||||
|
||||
private IASTExpression newExpression(boolean isGlobal, List<IASTInitializerClause> plcmt, IASTTypeId typeid,
|
||||
boolean isNewTypeId, IASTInitializer init, int offset, int endOffset) {
|
||||
|
||||
|
@ -1237,7 +1233,6 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected IASTExpression unaryExpression(CastExprCtx ctx, ITemplateIdStrategy strat) throws EndOfFileException, BacktrackException {
|
||||
switch (LT(1)) {
|
||||
|
@ -1341,7 +1336,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
}
|
||||
|
||||
private boolean isBinaryTrait(IToken first) {
|
||||
switch(first.getType()) {
|
||||
switch (first.getType()) {
|
||||
case IGCCToken.tTT_is_base_of:
|
||||
return true;
|
||||
}
|
||||
|
@ -1349,7 +1344,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
}
|
||||
|
||||
private Operator getBinaryTypeTraitOperator(IToken first) {
|
||||
switch(first.getType()) {
|
||||
switch (first.getType()) {
|
||||
case IGCCToken.tTT_is_base_of:
|
||||
return IASTBinaryTypeIdExpression.Operator.__is_base_of;
|
||||
}
|
||||
|
@ -1359,7 +1354,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
}
|
||||
|
||||
private int getUnaryTypeTraitOperator(IToken first) {
|
||||
switch(first.getType()) {
|
||||
switch (first.getType()) {
|
||||
case IGCCToken.tTT_has_nothrow_assign:
|
||||
return IASTTypeIdExpression.op_has_nothrow_assign;
|
||||
case IGCCToken.tTT_has_nothrow_constructor:
|
||||
|
@ -1618,7 +1613,6 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
return new CPPASTAmbiguousTemplateArgument();
|
||||
}
|
||||
|
||||
|
||||
private IASTExpression simpleTypeConstructorExpression(ICPPASTDeclSpecifier declSpec) throws EndOfFileException, BacktrackException {
|
||||
IASTInitializer initializer = bracedOrCtorStyleInitializer();
|
||||
ICPPASTSimpleTypeConstructorExpression result = nodeFactory.newSimpleTypeConstructorExpression(
|
||||
|
@ -1729,7 +1723,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
// Lambda introducer
|
||||
consume(IToken.tLBRACKET);
|
||||
boolean needComma= false;
|
||||
switch(LT(1)) {
|
||||
switch (LT(1)) {
|
||||
case IToken.tASSIGN:
|
||||
lambdaExpr.setCaptureDefault(CaptureDefault.BY_COPY);
|
||||
consume();
|
||||
|
@ -1744,7 +1738,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
}
|
||||
break;
|
||||
}
|
||||
loop: for(;;) {
|
||||
loop: while (true) {
|
||||
switch (LT(1)) {
|
||||
case IToken.tEOC:
|
||||
return setRange(lambdaExpr, offset, LA().getEndOffset());
|
||||
|
@ -1907,7 +1901,6 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* static_assert-declaration:
|
||||
static_assert ( constant-expression , string-literal ) ;
|
||||
|
@ -1953,7 +1946,6 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
return linkage;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Represents the amalgamation of template declarations, template
|
||||
* instantiations and specializations in the ANSI C++ grammar.
|
||||
|
@ -2046,7 +2038,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
try {
|
||||
List<ICPPASTTemplateParameter> result = new ArrayList<ICPPASTTemplateParameter>(DEFAULT_PARM_LIST_SIZE);
|
||||
IToken m= mark();
|
||||
for(;;) {
|
||||
while (true) {
|
||||
try {
|
||||
return templateParameterList(result);
|
||||
} catch (BacktrackException e) {
|
||||
|
@ -2173,7 +2165,6 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
return parameterDeclaration();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The most abstract construct within a translationUnit : a declaration.
|
||||
* declaration : {"asm"} asmDefinition | {"namespace"} namespaceDefinition |
|
||||
|
@ -2462,7 +2453,6 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
if (!(dtor instanceof ICPPASTFunctionDeclarator))
|
||||
throwBacktrack(firstOffset, LA(1).getEndOffset() - firstOffset);
|
||||
|
||||
|
||||
ICPPASTFunctionDefinition fdef;
|
||||
if (LT(1) == IToken.t_try) {
|
||||
consume();
|
||||
|
@ -2473,7 +2463,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
if (LT(1) == IToken.tASSIGN) {
|
||||
consume();
|
||||
IToken kind= consume();
|
||||
switch(kind.getType()) {
|
||||
switch (kind.getType()) {
|
||||
case IToken.t_default:
|
||||
fdef.setIsDefaulted(true);
|
||||
break;
|
||||
|
@ -2535,7 +2525,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
*/
|
||||
protected void ctorInitializer(ICPPASTFunctionDefinition fdef) throws EndOfFileException, BacktrackException {
|
||||
consume(IToken.tCOLON);
|
||||
loop: for(;;) {
|
||||
loop: while (true) {
|
||||
final int offset= LA(1).getOffset();
|
||||
final IASTName name = qualifiedName();
|
||||
final IASTInitializer init;
|
||||
|
@ -2592,14 +2582,12 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
return parm;
|
||||
}
|
||||
|
||||
|
||||
private final static int INLINE= 0x1, CONST= 0x2, CONSTEXPR= 0x4, RESTRICT= 0x8, VOLATILE= 0x10,
|
||||
SHORT= 0x20, UNSIGNED= 0x40, SIGNED= 0x80, COMPLEX= 0x100, IMAGINARY= 0x200,
|
||||
VIRTUAL= 0x400, EXPLICIT= 0x800, FRIEND= 0x1000, THREAD_LOCAL= 0x2000;
|
||||
private static final int FORBID_IN_EMPTY_DECLSPEC =
|
||||
CONST | RESTRICT | VOLATILE | SHORT | UNSIGNED | SIGNED | COMPLEX | IMAGINARY | FRIEND | THREAD_LOCAL;
|
||||
|
||||
|
||||
/**
|
||||
* This function parses a declaration specifier sequence, as according to
|
||||
* the ANSI C++ specification.
|
||||
|
@ -3226,7 +3214,6 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
if (name instanceof ICPPASTConversionName)
|
||||
return;
|
||||
|
||||
|
||||
if (opt == DeclarationOptions.CPP_MEMBER) {
|
||||
// Accept constructor and destructor within class body
|
||||
final char[] nchars= name.getLookupKey();
|
||||
|
@ -3467,10 +3454,9 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
*/
|
||||
private List<IASTInitializerClause> initializerList(boolean allowSkipping) throws EndOfFileException,
|
||||
BacktrackException {
|
||||
|
||||
List<IASTInitializerClause> result= null;
|
||||
// List of initializer clauses
|
||||
loop: for(;;) {
|
||||
loop: while (true) {
|
||||
// Clause may be null, add to initializer anyways, such that the size can be computed.
|
||||
IASTInitializerClause clause = initClause(allowSkipping);
|
||||
if (LT(1) == IToken.tELLIPSIS) {
|
||||
|
@ -3986,7 +3972,6 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
return d;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Parses for a bit field declarator starting with the colon
|
||||
*/
|
||||
|
@ -4223,7 +4208,6 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
return decl;
|
||||
}
|
||||
|
||||
|
||||
protected IASTStatement catchBlockCompoundStatement() throws BacktrackException, EndOfFileException {
|
||||
if (mode == ParserMode.QUICK_PARSE || mode == ParserMode.STRUCTURAL_PARSE || !isActiveCode()) {
|
||||
int offset = LA(1).getOffset();
|
||||
|
@ -4248,8 +4232,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
translationUnit = nodeFactory.newTranslationUnit(scanner);
|
||||
translationUnit.setIndex(index);
|
||||
|
||||
// add built-in names to the scope
|
||||
// add built-in names to the scope
|
||||
// Add built-in names to the scope.
|
||||
if (builtinBindingsProvider != null) {
|
||||
IScope tuScope = translationUnit.getScope();
|
||||
|
||||
|
@ -4260,7 +4243,6 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private void consumeArrayModifiers(DeclarationOptions option, List<IASTArrayModifier> collection)
|
||||
throws EndOfFileException, BacktrackException {
|
||||
boolean allowExpression= option == DeclarationOptions.TYPEID_NEW;
|
||||
|
@ -4288,7 +4270,6 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected IASTTranslationUnit getTranslationUnit() {
|
||||
return translationUnit;
|
||||
|
@ -4362,7 +4343,6 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
translationUnit = null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected IASTStatement parseWhileStatement() throws EndOfFileException, BacktrackException {
|
||||
int startOffset = consume().getOffset();
|
||||
|
@ -4422,7 +4402,6 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
if (end == null)
|
||||
return e;
|
||||
|
||||
|
||||
final int endOffset = end.getOffset();
|
||||
final int endOffset2 = end2.getOffset();
|
||||
if (endOffset == endOffset2) {
|
||||
|
@ -4446,7 +4425,6 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
return decl;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected ASTVisitor createAmbiguityNodeVisitor() {
|
||||
return new CPPASTAmbiguityResolver();
|
||||
|
@ -4481,7 +4459,6 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
}
|
||||
consume(IToken.tRPAREN);
|
||||
|
||||
|
||||
IASTStatement thenClause = statement();
|
||||
ICPPASTIfStatement new_if_statement = nodeFactory.newIfStatement();
|
||||
((ASTNode) new_if_statement).setOffset(so);
|
||||
|
@ -4545,7 +4522,6 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected IASTCompoundStatement functionBody() throws EndOfFileException, BacktrackException {
|
||||
++functionBodyCount;
|
||||
|
|
|
@ -95,7 +95,6 @@ import com.ibm.icu.text.MessageFormat;
|
|||
* @noinstantiate This class is not intended to be instantiated by clients.
|
||||
*/
|
||||
public class CCorePlugin extends Plugin {
|
||||
|
||||
public static final int STATUS_CDTPROJECT_EXISTS = 1;
|
||||
public static final int STATUS_CDTPROJECT_MISMATCH = 2;
|
||||
public static final int CDT_PROJECT_NATURE_ID_MISMATCH = 3;
|
||||
|
@ -299,7 +298,6 @@ public class CCorePlugin extends Plugin {
|
|||
return fgCPlugin;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see Plugin#shutdown
|
||||
*/
|
||||
|
@ -510,7 +508,6 @@ public class CCorePlugin extends Plugin {
|
|||
getDefault().savePluginPreferences();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create CDT console adapter for build console defined as an extension.
|
||||
* See {@code org.eclipse.cdt.core.CBuildConsole} extension point.
|
||||
|
@ -833,61 +830,61 @@ public class CCorePlugin extends Plugin {
|
|||
final IProject projectHandle,
|
||||
final String bsId,
|
||||
IProgressMonitor monitor)
|
||||
throws CoreException, OperationCanceledException {
|
||||
throws CoreException, OperationCanceledException {
|
||||
|
||||
getWorkspace().run(new IWorkspaceRunnable() {
|
||||
@Override
|
||||
public void run(IProgressMonitor monitor) throws CoreException {
|
||||
try {
|
||||
if (monitor == null) {
|
||||
monitor = new NullProgressMonitor();
|
||||
}
|
||||
monitor.beginTask("Creating C Project...", 3); //$NON-NLS-1$
|
||||
if (!projectHandle.exists()) {
|
||||
projectHandle.create(description, new SubProgressMonitor(monitor, 1));
|
||||
}
|
||||
|
||||
if (monitor.isCanceled()) {
|
||||
throw new OperationCanceledException();
|
||||
}
|
||||
|
||||
// Open first.
|
||||
projectHandle.open(IResource.BACKGROUND_REFRESH, new SubProgressMonitor(monitor, 1));
|
||||
|
||||
// mapCProjectOwner(projectHandle, projectID, false);
|
||||
|
||||
// Add C Nature ... does not add duplicates
|
||||
CProjectNature.addCNature(projectHandle, new SubProgressMonitor(monitor, 1));
|
||||
|
||||
if(bsId != null){
|
||||
ICProjectDescription projDes = createProjectDescription(projectHandle, true);
|
||||
ICConfigurationDescription cfgs[] = projDes.getConfigurations();
|
||||
ICConfigurationDescription cfg = null;
|
||||
for (ICConfigurationDescription cfg2 : cfgs) {
|
||||
if(bsId.equals(cfg2.getBuildSystemId())){
|
||||
cfg = cfg2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(cfg == null){
|
||||
ICConfigurationDescription prefCfg = getPreferenceConfiguration(bsId);
|
||||
if(prefCfg != null){
|
||||
cfg = projDes.createConfiguration(CDataUtil.genId(prefCfg.getId()), prefCfg.getName(), prefCfg);
|
||||
}
|
||||
}
|
||||
|
||||
if(cfg != null){
|
||||
setProjectDescription(projectHandle, projDes);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
monitor.done();
|
||||
getWorkspace().run(new IWorkspaceRunnable() {
|
||||
@Override
|
||||
public void run(IProgressMonitor monitor) throws CoreException {
|
||||
try {
|
||||
if (monitor == null) {
|
||||
monitor = new NullProgressMonitor();
|
||||
}
|
||||
monitor.beginTask("Creating C Project...", 3); //$NON-NLS-1$
|
||||
if (!projectHandle.exists()) {
|
||||
projectHandle.create(description, new SubProgressMonitor(monitor, 1));
|
||||
}
|
||||
|
||||
if (monitor.isCanceled()) {
|
||||
throw new OperationCanceledException();
|
||||
}
|
||||
|
||||
// Open first.
|
||||
projectHandle.open(IResource.BACKGROUND_REFRESH, new SubProgressMonitor(monitor, 1));
|
||||
|
||||
// mapCProjectOwner(projectHandle, projectID, false);
|
||||
|
||||
// Add C Nature ... does not add duplicates
|
||||
CProjectNature.addCNature(projectHandle, new SubProgressMonitor(monitor, 1));
|
||||
|
||||
if (bsId != null){
|
||||
ICProjectDescription projDes = createProjectDescription(projectHandle, true);
|
||||
ICConfigurationDescription cfgs[] = projDes.getConfigurations();
|
||||
ICConfigurationDescription cfg = null;
|
||||
for (ICConfigurationDescription cfg2 : cfgs) {
|
||||
if (bsId.equals(cfg2.getBuildSystemId())){
|
||||
cfg = cfg2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (cfg == null){
|
||||
ICConfigurationDescription prefCfg = getPreferenceConfiguration(bsId);
|
||||
if (prefCfg != null){
|
||||
cfg = projDes.createConfiguration(CDataUtil.genId(prefCfg.getId()), prefCfg.getName(), prefCfg);
|
||||
}
|
||||
}
|
||||
|
||||
if (cfg != null){
|
||||
setProjectDescription(projectHandle, projDes);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
monitor.done();
|
||||
}
|
||||
}, getWorkspace().getRoot(), 0, monitor);
|
||||
return projectHandle;
|
||||
}
|
||||
}
|
||||
}, getWorkspace().getRoot(), 0, monitor);
|
||||
return projectHandle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method convertProjectFromCtoCC converts
|
||||
|
@ -899,7 +896,6 @@ public class CCorePlugin extends Plugin {
|
|||
* @param monitor
|
||||
* @throws CoreException
|
||||
*/
|
||||
|
||||
public void convertProjectFromCtoCC(IProject projectHandle, IProgressMonitor monitor) throws CoreException {
|
||||
if ((projectHandle != null)
|
||||
&& projectHandle.hasNature(CProjectNature.C_NATURE_ID)
|
||||
|
@ -974,7 +970,7 @@ public class CCorePlugin extends Plugin {
|
|||
for (IConfigurationElement configElement : configElements) {
|
||||
if (configElement.getName().equals("processList")) { //$NON-NLS-1$
|
||||
String platform = configElement.getAttribute("platform"); //$NON-NLS-1$
|
||||
if (platform == null ) { // first contributor found with not platform will be default.
|
||||
if (platform == null) { // first contributor found with not platform will be default.
|
||||
if (defaultContributor == null) {
|
||||
defaultContributor = configElement;
|
||||
}
|
||||
|
@ -985,12 +981,11 @@ public class CCorePlugin extends Plugin {
|
|||
}
|
||||
}
|
||||
}
|
||||
if ( defaultContributor != null) {
|
||||
if (defaultContributor != null) {
|
||||
return (IProcessList) defaultContributor.createExecutableExtension("class"); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1024,7 +1019,7 @@ public class CCorePlugin extends Plugin {
|
|||
try {
|
||||
// Look up in session property for previously created provider
|
||||
QualifiedName scannerInfoProviderName = new QualifiedName(PLUGIN_ID, SCANNER_INFO_PROVIDER2_NAME);
|
||||
provider = (IScannerInfoProvider)project.getSessionProperty(scannerInfoProviderName);
|
||||
provider = (IScannerInfoProvider) project.getSessionProperty(scannerInfoProviderName);
|
||||
if (provider != null)
|
||||
return provider;
|
||||
|
||||
|
@ -1117,8 +1112,6 @@ public class CCorePlugin extends Plugin {
|
|||
CContentTypes.setUseProjectSpecificContentTypes(project, val);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static final String MODEL = CCorePlugin.PLUGIN_ID + "/debug/model" ; //$NON-NLS-1$
|
||||
private static final String PARSER = CCorePlugin.PLUGIN_ID + "/debug/parser" ; //$NON-NLS-1$
|
||||
private static final String PARSER_EXCEPTIONS = CCorePlugin.PLUGIN_ID + "/debug/parser/exceptions" ; //$NON-NLS-1$
|
||||
|
@ -1130,27 +1123,25 @@ public class CCorePlugin extends Plugin {
|
|||
* Configure the plug-in with respect to option settings defined in ".options" file
|
||||
*/
|
||||
public void configurePluginDebugOptions() {
|
||||
|
||||
if(CCorePlugin.getDefault().isDebugging()) {
|
||||
if (CCorePlugin.getDefault().isDebugging()) {
|
||||
String option = Platform.getDebugOption(PARSER);
|
||||
if(option != null) Util.VERBOSE_PARSER = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
|
||||
if (option != null) Util.VERBOSE_PARSER = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
|
||||
|
||||
option = Platform.getDebugOption(PARSER_EXCEPTIONS);
|
||||
if( option != null ) Util.PARSER_EXCEPTIONS = option.equalsIgnoreCase("true"); //$NON-NLS-1$
|
||||
if (option != null) Util.PARSER_EXCEPTIONS = option.equalsIgnoreCase("true"); //$NON-NLS-1$
|
||||
|
||||
option = Platform.getDebugOption(SCANNER);
|
||||
if( option != null ) Util.VERBOSE_SCANNER = option.equalsIgnoreCase("true"); //$NON-NLS-1$
|
||||
if (option != null) Util.VERBOSE_SCANNER = option.equalsIgnoreCase("true"); //$NON-NLS-1$
|
||||
|
||||
option = Platform.getDebugOption(MODEL);
|
||||
if(option != null) Util.VERBOSE_MODEL = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
|
||||
if (option != null) Util.VERBOSE_MODEL = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
|
||||
|
||||
option = Platform.getDebugOption(DELTA);
|
||||
if(option != null) Util.VERBOSE_DELTA= option.equalsIgnoreCase("true") ; //$NON-NLS-1$
|
||||
|
||||
if (option != null) Util.VERBOSE_DELTA= option.equalsIgnoreCase("true") ; //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
// Preference to turn on/off the use of structural parse mode to build the CModel
|
||||
// Preference to turn on/off the use of structural parse mode to build the CModel.
|
||||
public void setStructuralParseMode(boolean useNewParser) {
|
||||
getPluginPreferences().setValue(PREF_USE_STRUCTURAL_PARSE_MODE, useNewParser);
|
||||
savePluginPreferences();
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Tomasz Wesolowski - initial API and implementation
|
||||
* Tomasz Wesolowski - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.ui.editor;
|
||||
|
||||
|
@ -52,13 +52,10 @@ import org.eclipse.cdt.internal.ui.text.ICReconcilingListener;
|
|||
import org.eclipse.cdt.internal.ui.viewsupport.IndexUI;
|
||||
|
||||
public class OverrideIndicatorManager implements ICReconcilingListener {
|
||||
|
||||
static final String ANNOTATION_TYPE = "org.eclipse.cdt.ui.overrideIndicator"; //$NON-NLS-1$
|
||||
|
||||
private static final String MESSAGE_SEPARATOR = ";\n"; //$NON-NLS-1$
|
||||
|
||||
public static class OverrideInfo {
|
||||
|
||||
public int nodeOffset;
|
||||
public int resultType;
|
||||
public String message;
|
||||
|
@ -79,7 +76,6 @@ public class OverrideIndicatorManager implements ICReconcilingListener {
|
|||
public static final int RESULT_SHADOWS = 2;
|
||||
|
||||
public class OverrideIndicator extends Annotation {
|
||||
|
||||
public static final String ANNOTATION_TYPE_ID = "org.eclipse.cdt.ui.overrideIndicator"; //$NON-NLS-1$
|
||||
private int type;
|
||||
private ICElementHandle declaration;
|
||||
|
@ -108,9 +104,7 @@ public class OverrideIndicatorManager implements ICReconcilingListener {
|
|||
CDTUITools.openInEditor(declaration, true, true);
|
||||
} catch (CoreException e) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private IAnnotationModel fAnnotationModel;
|
||||
|
@ -123,7 +117,6 @@ public class OverrideIndicatorManager implements ICReconcilingListener {
|
|||
}
|
||||
|
||||
private void handleResult(OverrideInfo info, IIndex index) {
|
||||
|
||||
Position position = new Position(info.nodeOffset, info.nodeLength);
|
||||
|
||||
OverrideIndicator indicator = new OverrideIndicator(info.resultType, info.message, info.binding, index);
|
||||
|
@ -166,7 +159,7 @@ public class OverrideIndicatorManager implements ICReconcilingListener {
|
|||
}
|
||||
if (binding instanceof ICPPMethod) {
|
||||
method = (ICPPMethod) binding;
|
||||
OverrideInfo overrideInfo = testForOverride(method, declaration.getFileLocation());
|
||||
OverrideInfo overrideInfo = checkForOverride(method, declaration);
|
||||
if (overrideInfo != null) {
|
||||
handleResult(overrideInfo, index);
|
||||
}
|
||||
|
@ -209,7 +202,7 @@ public class OverrideIndicatorManager implements ICReconcilingListener {
|
|||
return PROCESS_SKIP;
|
||||
}
|
||||
ICPPMethod method = (ICPPMethod) definitionBinding;
|
||||
OverrideInfo overrideInfo = testForOverride(method, definition.getFileLocation());
|
||||
OverrideInfo overrideInfo = checkForOverride(method, definition);
|
||||
if (overrideInfo != null) {
|
||||
handleResult(overrideInfo, index);
|
||||
}
|
||||
|
@ -223,8 +216,8 @@ public class OverrideIndicatorManager implements ICReconcilingListener {
|
|||
ast.accept(new MethodDefinitionFinder());
|
||||
}
|
||||
|
||||
public static OverrideInfo testForOverride(ICPPMethod testedOverride, IASTFileLocation location) throws DOMException {
|
||||
|
||||
private static OverrideInfo checkForOverride(ICPPMethod testedOverride, IASTNode node) throws DOMException {
|
||||
IASTFileLocation location = node.getFileLocation();
|
||||
testedOverride.getClassOwner().getBases();
|
||||
|
||||
boolean onlyPureVirtual = true;
|
||||
|
@ -301,7 +294,6 @@ public class OverrideIndicatorManager implements ICReconcilingListener {
|
|||
return info;
|
||||
}
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -314,8 +306,8 @@ public class OverrideIndicatorManager implements ICReconcilingListener {
|
|||
* @throws DOMException
|
||||
*/
|
||||
private static void handleBaseClass(ICPPClassType aClass, ICPPMethod testedOverride,
|
||||
Set<ICPPMethod> foundMethods, Set<ICPPMethod> shadowedMethods, Set<ICPPClassType> alreadyTestedBases) throws DOMException {
|
||||
|
||||
Set<ICPPMethod> foundMethods, Set<ICPPMethod> shadowedMethods,
|
||||
Set<ICPPClassType> alreadyTestedBases) throws DOMException {
|
||||
if (alreadyTestedBases.contains(aClass)) {
|
||||
return;
|
||||
} else {
|
||||
|
@ -427,5 +419,4 @@ public class OverrideIndicatorManager implements ICReconcilingListener {
|
|||
}
|
||||
return annotationModel;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue