1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2013-03-20 16:57:14 -07:00
parent 440e2e87bf
commit a2ff0d2bdb
7 changed files with 36 additions and 59 deletions

View file

@ -6,11 +6,10 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Doug Schaefer (QNX) - Initial API and implementation
* Andrew Ferguson (Symbian)
* Markus Schorn (Wind River Systems)
* Doug Schaefer (QNX) - Initial API and implementation
* Andrew Ferguson (Symbian)
* Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.core.dom;
import java.util.Properties;
@ -18,14 +17,19 @@ import java.util.Properties;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.core.model.ITranslationUnit;
/**
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IPDOMIndexer {
/**
* Sets the project for which to build the index.
*/
public void setProject(ICProject project);
/**
* Returns the project associated with the indexer.
*/
public ICProject getProject();
/**
@ -58,5 +62,6 @@ public interface IPDOMIndexer {
* Creates a task that handles the changes.
* @since 4.0
*/
public IPDOMIndexerTask createTask(ITranslationUnit[] added, ITranslationUnit[] changed, ITranslationUnit[] removed);
public IPDOMIndexerTask createTask(ITranslationUnit[] added, ITranslationUnit[] changed,
ITranslationUnit[] removed);
}

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM - Initial API and implementation
* IBM - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.dom;
@ -21,17 +21,13 @@ import org.eclipse.cdt.core.parser.IScannerInfo;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IParserConfiguration {
/**
* @return IScannerInfo representing the build information required to
* parse.
* @return IScannerInfo representing the build information required to parse.
*/
public IScannerInfo getScannerInfo();
// TODO this may change
/**
* @return String representing dialect name for the language
*/
public String getParserDialect();
}

View file

@ -49,13 +49,6 @@ import org.eclipse.core.runtime.CoreException;
* {@link AbstractCLikeLanguage#createParser(IScanner scanner, ParserMode parserMode,
* IParserLogService logService, IIndex index)}.
*
* <p>
* <strong>EXPERIMENTAL</strong>. This class or interface has been added as
* part of a work in progress. There is no guarantee that this API will work or
* that it will remain the same. Please do not use this API without consulting
* with the CDT team.
* </p>
*
* @see AbstractScannerExtensionConfiguration
*
* @since 5.0
@ -69,7 +62,8 @@ public abstract class AbstractCLikeLanguage extends AbstractLanguage implements
private List<IASTName> nameList= new ArrayList<IASTName>();
@Override public int visit(IASTName name) {
@Override
public int visit(IASTName name) {
nameList.add(name);
return PROCESS_CONTINUE;
}
@ -132,7 +126,7 @@ public abstract class AbstractCLikeLanguage extends AbstractLanguage implements
final ISourceCodeParser parser= createParser(scanner, log, index, false, options);
// make it possible to cancel parser by reconciler - http://bugs.eclipse.org/226682
// Make it possible to cancel parser by reconciler - http://bugs.eclipse.org/226682
ICanceler canceler= null;
if (log instanceof ICanceler) {
canceler= (ICanceler) log;
@ -143,7 +137,7 @@ public abstract class AbstractCLikeLanguage extends AbstractLanguage implements
parser.cancel();
}});
}
try {
// Parse
IASTTranslationUnit ast= parser.parse();

View file

@ -6,19 +6,19 @@
* 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;
import java.util.Map;
/**
* Implementation for the {@link IExtendedScannerInfo} interface. Allows to configure the preprocessor.
* Implementation for the {@link IExtendedScannerInfo} interface. Allows to configure
* the preprocessor.
*/
public class ExtendedScannerInfo extends ScannerInfo implements IExtendedScannerInfo {
private static final String[] EMPTY_STRING_ARRAY = new String[0];
private static final String[] EMPTY_STRING_ARRAY = {};
private String[] macroFiles;
private String[] includeFiles;
private String[] localIncludePaths;
@ -32,7 +32,6 @@ public class ExtendedScannerInfo extends ScannerInfo implements IExtendedScanner
public ExtendedScannerInfo(Map<String, String> definedSymbols, String[] includePaths,
String[] macroFiles, String[] includeFiles) {
super(definedSymbols, includePaths);
this.macroFiles = macroFiles;
this.includeFiles = includeFiles;
@ -43,7 +42,6 @@ public class ExtendedScannerInfo extends ScannerInfo implements IExtendedScanner
*/
public ExtendedScannerInfo(Map<String, String> definedSymbols, String[] includePaths,
String[] macroFiles, String[] includeFiles, String[] localIncludePaths) {
super(definedSymbols, includePaths);
this.macroFiles = macroFiles;
this.includeFiles = includeFiles;
@ -60,9 +58,6 @@ public class ExtendedScannerInfo extends ScannerInfo implements IExtendedScanner
}
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.IExtendedScannerInfo#getMacroFiles()
*/
@Override
public String[] getMacroFiles() {
if (macroFiles == null)
@ -70,9 +65,6 @@ public class ExtendedScannerInfo extends ScannerInfo implements IExtendedScanner
return macroFiles;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.IExtendedScannerInfo#getIncludeFiles()
*/
@Override
public String[] getIncludeFiles() {
if (includeFiles == null)
@ -80,9 +72,6 @@ public class ExtendedScannerInfo extends ScannerInfo implements IExtendedScanner
return includeFiles;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.IExtendedScannerInfo#getLocalIncludePath()
*/
@Override
public String[] getLocalIncludePath() {
if (localIncludePaths == null)

View file

@ -6,8 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* John Camelon, IBM Rational Software - Initial API and implementation
* Markus Schorn (Wind River Systems)
* John Camelon, IBM Rational Software - Initial API and implementation
* Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.core.parser;
@ -15,26 +15,25 @@ package org.eclipse.cdt.core.parser;
* Extension to {@link IScannerInfo}, allows for providing additional preprocessor options.
*/
public interface IExtendedScannerInfo extends IScannerInfo {
/**
* Return an array of files which will be preprocessed before parsing the translation-unit in order
* to populate the macro-dictionary.
* Return an array of files which will be preprocessed before parsing the translation-unit in
* order to populate the macro-dictionary.
*/
public String [] getMacroFiles();
public String[] getMacroFiles();
/**
* Return an array of files that will be parsed before parsing the translation-unit as if the these
* files were included using include directives.
* Return an array of files that will be parsed before parsing the translation-unit as if
* the these files were included using include directives.
*/
public String [] getIncludeFiles();
public String[] getIncludeFiles();
/**
* Return an array of paths that is searched after the current directory, when an include directive
* with double-quotes is processed.
* Return an array of paths that is searched after the current directory, when an include
* directive with double-quotes is processed.
* <p>
* In order to suppress the use of the directory of the current file (side effect of gcc option
* -I-) you can pass '-' as one of the include paths. Other than that, the '-' will not have an
* effect, in particular it will not split the include path as the -I- option would do.
*/
public String [] getLocalIncludePath();
public String[] getLocalIncludePath();
}

View file

@ -35,17 +35,11 @@ public class ScannerInfo implements IScannerInfo {
includePaths = includeSearchPath != null ? includeSearchPath : new String[] {};
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.IScannerInfo#getDefinedSymbols()
*/
@Override
public Map<String, String> getDefinedSymbols() {
return definedSymbols;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.IScannerInfo#getIncludePaths()
*/
@Override
public String[] getIncludePaths() {
return includePaths;

View file

@ -264,9 +264,9 @@ public class IndexerPreferences {
if (project != null) {
switch (scope) {
case SCOPE_PROJECT_PRIVATE:
return new Preferences[] {getLocalPreferences(project)};
return new Preferences[] { getLocalPreferences(project) };
case SCOPE_PROJECT_SHARED:
return new Preferences[] {getProjectPreferences(project)};
return new Preferences[] { getProjectPreferences(project) };
}
}
return getInstancePreferencesArray();