Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractIndexAstChecker.java')
-rw-r--r--codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractIndexAstChecker.java73
1 files changed, 0 insertions, 73 deletions
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractIndexAstChecker.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractIndexAstChecker.java
deleted file mode 100644
index 070ddca7941..00000000000
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractIndexAstChecker.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Alena Laskavaia
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Alena Laskavaia - initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.codan.core.model;
-
-import org.eclipse.cdt.codan.core.CodanCorePlugin;
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
-import org.eclipse.cdt.core.index.IIndex;
-import org.eclipse.cdt.core.model.CoreModel;
-import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.cdt.core.model.ITranslationUnit;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-
-/**
- * @author Alena
- *
- */
-public abstract class AbstractIndexAstChecker extends AbstractChecker implements
- ICAstChecker {
- private IFile file;
-
- public IFile getFile() {
- return file;
- }
-
- void processFile(IFile file) throws CoreException, InterruptedException {
- this.file = file;
- // create translation unit and access index
- ICElement model = CoreModel.getDefault().create(file);
- if (!(model instanceof ITranslationUnit))
- return;
- ITranslationUnit tu = (ITranslationUnit) model;
- if (tu == null)
- return; // not a C/C++ file
- IIndex index = CCorePlugin.getIndexManager().getIndex(tu.getCProject());
- // lock the index for read access
- index.acquireReadLock();
- try {
- // create index based ast
- IASTTranslationUnit ast = tu.getAST(index,
- ITranslationUnit.AST_SKIP_INDEXED_HEADERS);
- // traverse the ast using the visitor pattern.
- processAst(ast);
- } finally {
- index.releaseReadLock();
- }
- }
-
- public boolean processResource(IResource resource) {
- if (resource instanceof IFile) {
- IFile file = (IFile) resource;
- try {
- processFile(file);
- } catch (CoreException e) {
- CodanCorePlugin.log(e);
- } catch (InterruptedException e) {
- // ignore
- }
- return false;
- }
- return true;
- }
-}

Back to the top