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

PDOM - Add option to skip parsing of there is no build information.

This commit is contained in:
Doug Schaefer 2006-01-24 18:23:53 +00:00
parent 4fd1cf2064
commit 2855f876ac
4 changed files with 12 additions and 1 deletions

View file

@ -45,6 +45,12 @@ public interface ILanguage extends IAdaptable {
*/
public static final int AST_SKIP_INDEXED_HEADERS = 4;
/**
* Style for getTranslationUnit. Don't parse the file if there is no build
* information for it.
*/
public static final int AST_SKIP_IF_NO_BUILD_INFO = 8;
/**
* Return the language id for this language in the given PDOM.
* This is to differentiate languages from eachother.

View file

@ -89,6 +89,8 @@ public class GCCLanguage extends PlatformObject implements ILanguage {
IScannerInfo buildScanInfo = provider.getScannerInformation(infoResource);
if (buildScanInfo != null)
scanInfo = buildScanInfo;
else if ((style & ILanguage.AST_SKIP_IF_NO_BUILD_INFO) != 0)
return null;
else
scanInfo = new ScannerInfo();
}

View file

@ -88,6 +88,8 @@ public class GPPLanguage extends PlatformObject implements ILanguage {
IScannerInfo buildScanInfo = provider.getScannerInformation(infoResource);
if (buildScanInfo != null)
scanInfo = buildScanInfo;
else if ((style & ILanguage.AST_SKIP_IF_NO_BUILD_INFO) != 0)
return null;
else
scanInfo = new ScannerInfo();
}

View file

@ -120,7 +120,8 @@ public class PDOMDatabase implements IPDOM {
IASTTranslationUnit ast = language.getTranslationUnit((IFile)tu.getResource(),
ILanguage.AST_USE_INDEX |
ILanguage.AST_SKIP_INDEXED_HEADERS);
ILanguage.AST_SKIP_INDEXED_HEADERS |
ILanguage.AST_SKIP_IF_NO_BUILD_INFO);
if (ast == null)
return;