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


Java IIndex类代码示例

本文整理汇总了Java中org.eclipse.cdt.core.index.IIndex的典型用法代码示例。如果您正苦于以下问题:Java IIndex类的具体用法?Java IIndex怎么用?Java IIndex使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IIndex类属于org.eclipse.cdt.core.index包,在下文中一共展示了IIndex类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AbstractDispatcherVisitor

import org.eclipse.cdt.core.index.IIndex; //导入依赖的package包/类
public AbstractDispatcherVisitor(CDictionary dico, IIndex index) {
	super(/*visitNodes*/true);
	shouldVisitTemplateParameters = true;
    /* fine-tuning if visitNodes=false
    shouldVisitDeclarations = true;
    shouldVisitEnumerators = true;
    shouldVisitProblems = true;
    shouldVisitTranslationUnit = true;
    shouldVisit... */
	this.index = index;
	this.dico = dico;

	if (msgTrace() != null ) {
		Activator.log(IStatus.INFO, msgTrace());
	}
}
 
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:17,代码来源:AbstractDispatcherVisitor.java

示例2: parseExpression

import org.eclipse.cdt.core.index.IIndex; //导入依赖的package包/类
public IValue parseExpression(IString expression, IEvaluatorContext ctx) throws CoreException, IOException {
	setIEvaluatorContext(ctx);
	if (!expression.getValue().endsWith(";"))
		expression.concat(vf.string(";"));
	String expr = "void main() {\n\t" + expression.getValue() + "\n}";
	FileContent fc = FileContent.create("", expr.toCharArray());
	Map<String, String> macroDefinitions = new HashMap<String, String>();
	String[] includeSearchPaths = new String[0];
	IScannerInfo si = new ScannerInfo(macroDefinitions, includeSearchPaths);
	IncludeFileContentProvider ifcp = IncludeFileContentProvider.getEmptyFilesProvider();
	IIndex idx = null;
	int options = ILanguage.OPTION_PARSE_INACTIVE_CODE;
	IParserLogService log = new DefaultLogService();
	IASTTranslationUnit tu = GPPLanguage.getDefault().getASTTranslationUnit(fc, si, ifcp, idx, options, log);

	IASTFunctionDefinition main = (IASTFunctionDefinition) tu.getDeclarations()[0];
	IASTCompoundStatement body = (IASTCompoundStatement) main.getBody();
	IASTExpression ex = ((IASTExpressionStatement) body.getStatements()[0]).getExpression();
	ex.accept(this);
	return stack.pop();
}
 
开发者ID:cwi-swat,项目名称:clair,代码行数:22,代码来源:Parser.java

示例3: IncludeVisitor

import org.eclipse.cdt.core.index.IIndex; //导入依赖的package包/类
public IncludeVisitor(CDictionary dico, IIndex index, String rootFolder) {
	super(dico, index, rootFolder);
	unresolvedIncludes = new HashSet<String>();
	int i = rootFolder.indexOf(VerveineCParser.WORKSPACE_NAME);
	if (i > 0) {		
		this.projectRootFolder = rootFolder.substring(i+VerveineCParser.WORKSPACE_NAME.length());
	}
}
 
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:9,代码来源:IncludeVisitor.java

示例4: getAstForLanguage

import org.eclipse.cdt.core.index.IIndex; //导入依赖的package包/类
@Override
protected IASTTranslationUnit getAstForLanguage(final FileContent fc,
		final IScannerInfo si, final IncludeFileContentProvider ifcp,
		final IIndex idx, final int options, final IParserLogService log)
		throws CoreException {
	return GPPLanguage.getDefault().getASTTranslationUnit(fc, si, ifcp,
			idx, options, log);
}
 
开发者ID:mast-group,项目名称:tassal,代码行数:9,代码来源:CppASTExtractor.java

示例5: getAstForLanguage

import org.eclipse.cdt.core.index.IIndex; //导入依赖的package包/类
@Override
protected IASTTranslationUnit getAstForLanguage(final FileContent fc,
		final IScannerInfo si, final IncludeFileContentProvider ifcp,
		final IIndex idx, final int options, final IParserLogService log)
		throws CoreException {
	return GCCLanguage.getDefault().getASTTranslationUnit(fc, si, ifcp,
			idx, options, log);
}
 
开发者ID:mast-group,项目名称:tassal,代码行数:9,代码来源:CAstExtractor.java

示例6: getAST

import org.eclipse.cdt.core.index.IIndex; //导入依赖的package包/类
/**
 * Return an AST for the following CDT-compatible code;
 * 
 * @param code
 * @return
 * @throws CoreException
 */
public final IASTTranslationUnit getAST(final char[] code,
		final String baseIncludePath) throws CoreException {
	final FileContent fc = FileContent.create(baseIncludePath, code);
	final Map<String, String> macroDefinitions = Maps.newHashMap();
	final String[] includeSearchPaths = new String[0];
	final IScannerInfo si = new ScannerInfo(macroDefinitions,
			includeSearchPaths);
	final IncludeFileContentProvider ifcp = IncludeFileContentProvider
			.getEmptyFilesProvider();
	final IIndex idx = null;
	final int options = ILanguage.OPTION_IS_SOURCE_UNIT;
	final IParserLogService log = new DefaultLogService();
	return getAstForLanguage(fc, si, ifcp, idx, options, log);
}
 
开发者ID:mast-group,项目名称:tassal,代码行数:22,代码来源:AbstractCdtAstExtractor.java

示例7: getASTTranslationUnit

import org.eclipse.cdt.core.index.IIndex; //导入依赖的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

示例8: waitUntilFileIsIndexed

import org.eclipse.cdt.core.index.IIndex; //导入依赖的package包/类
/**
 * Waits until the given file is indexed. Fails if this does not happen within the
 * given time.
 *
 * @param file
 * @param maxmillis
 * @throws Exception
 * @since 4.0
 */
public static void waitUntilFileIsIndexed(IIndex index, IFile file, int maxmillis) throws Exception {
    long fileTimestamp = file.getLocalTimeStamp();
    IIndexFileLocation indexFileLocation = IndexLocationFactory.getWorkspaceIFL(file);

    long endTime = System.currentTimeMillis() + maxmillis;
    int timeLeft = maxmillis;
    while (timeLeft >= 0) {
        Assert.assertTrue(CCorePlugin.getIndexManager().joinIndexer(timeLeft, new NullProgressMonitor()));
        index.acquireReadLock();
        try {
            IIndexFile[] files = index.getFiles(ILinkage.CPP_LINKAGE_ID, indexFileLocation);
            if (files.length > 0 && areAllFilesNotOlderThan(files, fileTimestamp)) {
                Assert.assertTrue(CCorePlugin.getIndexManager().joinIndexer(timeLeft, new NullProgressMonitor()));
                return;
            }
            files = index.getFiles(ILinkage.C_LINKAGE_ID, indexFileLocation);
            if (files.length > 0 && areAllFilesNotOlderThan(files, fileTimestamp)) {
                Assert.assertTrue(CCorePlugin.getIndexManager().joinIndexer(timeLeft, new NullProgressMonitor()));
                return;
            }
        } finally {
            index.releaseReadLock();
        }

        Thread.sleep(50);
        timeLeft = (int) (endTime - System.currentTimeMillis());
    }
    Assert.fail("Indexing of " + file.getFullPath() + " did not complete in " + maxmillis / 1000. + " sec");
}
 
开发者ID:magicsky,项目名称:sya,代码行数:39,代码来源:TestSourceReader.java

示例9: createIndexBasedAST

import org.eclipse.cdt.core.index.IIndex; //导入依赖的package包/类
public static IASTTranslationUnit createIndexBasedAST(IIndex index, ICProject project, IFile file) throws CModelException, CoreException {
    ICElement elem = project.findElement(file.getFullPath());
    if (elem instanceof ITranslationUnit) {
        ITranslationUnit tu = (ITranslationUnit) elem;
        return tu.getAST(index, ITranslationUnit.AST_SKIP_INDEXED_HEADERS);
    }
    Assert.fail("Could not create AST for " + file.getFullPath());
    return null;
}
 
开发者ID:magicsky,项目名称:sya,代码行数:10,代码来源:TestSourceReader.java

示例10: NameResolver

import org.eclipse.cdt.core.index.IIndex; //导入依赖的package包/类
public NameResolver(CDictionary dico, IIndex index) {
	super();
	this.dico = dico;
	this.index = index;
}
 
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:6,代码来源:NameResolver.java

示例11: DeclaredTypeRefVisitor

import org.eclipse.cdt.core.index.IIndex; //导入依赖的package包/类
public DeclaredTypeRefVisitor(CDictionary dico, IIndex index, String rootFolder) {
	super(dico, index, rootFolder);
	inKnRParams = false;
}
 
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:5,代码来源:DeclaredTypeRefVisitor.java

示例12: ReferenceRefVisitor

import org.eclipse.cdt.core.index.IIndex; //导入依赖的package包/类
public ReferenceRefVisitor(CDictionary dico, IIndex index, String rootFolder) {
	super(dico, index, rootFolder);
}
 
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:4,代码来源:ReferenceRefVisitor.java

示例13: InvocationAccessRefVisitor

import org.eclipse.cdt.core.index.IIndex; //导入依赖的package包/类
public InvocationAccessRefVisitor(CDictionary dico, IIndex index, String rootFolder) {
	super(dico, index, rootFolder);
}
 
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:4,代码来源:InvocationAccessRefVisitor.java

示例14: AbstractRefVisitor

import org.eclipse.cdt.core.index.IIndex; //导入依赖的package包/类
public AbstractRefVisitor(CDictionary dico, IIndex index, String rootFolder) {
	super(dico, index, rootFolder);
}
 
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:4,代码来源:AbstractRefVisitor.java

示例15: InheritanceRefVisitor

import org.eclipse.cdt.core.index.IIndex; //导入依赖的package包/类
public InheritanceRefVisitor(CDictionary dico, IIndex index, String rootFolder) {
	super(dico, index, rootFolder);
}
 
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:4,代码来源:InheritanceRefVisitor.java


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