本文整理汇总了Java中org.eclipse.cdt.core.parser.IScanner类的典型用法代码示例。如果您正苦于以下问题:Java IScanner类的具体用法?Java IScanner怎么用?Java IScanner使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IScanner类属于org.eclipse.cdt.core.parser包,在下文中一共展示了IScanner类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mycreateScanner
import org.eclipse.cdt.core.parser.IScanner; //导入依赖的package包/类
protected IScanner mycreateScanner(
FileContent content, IScannerInfo scanInfo, IncludeFileContentProvider fcp, IParserLogService log) {
/*
* gccのプロジェクト設定(include path,マクロ定義etc)を元に
* ScannerInfoを作成してProCPreprocessorに渡す
*/
String afile = content.getFileLocation();
IResource res = ParserUtil.getResourceForFilename(afile);
if (res != null) {
scanInfo =
LanguageSettingsScannerInfoProvider.getScannerInformation(
res, new String[]{"org.eclipse.cdt.core.gcc"});
}
return new ProCPreprocessor(
content, scanInfo, getParserLanguage(), log, getScannerExtensionConfiguration(scanInfo), fcp);
}
示例2: getASTTranslationUnit
import org.eclipse.cdt.core.parser.IScanner; //导入依赖的package包/类
@Override
public IASTTranslationUnit getASTTranslationUnit(FileContent reader, IScannerInfo scanInfo,
IncludeFileContentProvider fileCreator, IIndex index, int options, IParserLogService log)
throws CoreException {
//final IScanner scanner= createScanner(reader, scanInfo, fileCreator, log);
final IScanner scanner= mycreateScanner(reader, scanInfo, fileCreator, log);
scanner.setComputeImageLocations((options & OPTION_NO_IMAGE_LOCATIONS) == 0);
scanner.setProcessInactiveCode((options & OPTION_PARSE_INACTIVE_CODE) != 0);
IParserSettings parserSettings= null;
if (scanInfo instanceof ExtendedScannerInfo) {
ExtendedScannerInfo extendedScannerInfo = (ExtendedScannerInfo) scanInfo;
parserSettings = extendedScannerInfo.getParserSettings();
}
final ISourceCodeParser parser= createParser(scanner, log, index, false, options, parserSettings);
// Make it possible to cancel parser by reconciler - http://bugs.eclipse.org/226682
ICanceler canceler= null;
if (log instanceof ICanceler) {
canceler= (ICanceler) log;
canceler.setCancelable(new ICancelable() {
@Override
public void cancel() {
scanner.cancel();
parser.cancel();
}});
}
try {
// Parse
IASTTranslationUnit ast= parser.parse();
ast.setIsHeaderUnit((options & OPTION_IS_SOURCE_UNIT) == 0);
return ast;
} finally {
if (canceler != null) {
canceler.setCancelable(null);
}
}
}
示例3: ProCSourceParser
import org.eclipse.cdt.core.parser.IScanner; //导入依赖的package包/类
public ProCSourceParser(IScanner scanner, ParserMode parserMode,
IParserLogService logService, ICParserExtensionConfiguration config) {
this(scanner, parserMode, logService, config, null);
}
示例4: createParser
import org.eclipse.cdt.core.parser.IScanner; //导入依赖的package包/类
@Override
protected ISourceCodeParser createParser(IScanner scanner,
ParserMode parserMode, IParserLogService logService, IIndex index) {
return new ProCSourceParser(scanner, parserMode, logService,
getParserExtensionConfiguration(), index);
}