当前位置: 首页>>代码示例>>Java>>正文


Java IScanner类代码示例

本文整理汇总了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);
}
 
开发者ID:buntatsu,项目名称:cdt-proc,代码行数:17,代码来源:ProCLanguage.java

示例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);
		}
	}
}
 
开发者ID:buntatsu,项目名称:cdt-proc,代码行数:41,代码来源:ProCLanguage.java

示例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);
}
 
开发者ID:buntatsu,项目名称:cdt-proc,代码行数:5,代码来源:ProCSourceParser.java

示例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);
}
 
开发者ID:buntatsu,项目名称:cdt-proc,代码行数:7,代码来源:ProCLanguage.java


注:本文中的org.eclipse.cdt.core.parser.IScanner类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。