本文整理汇总了Java中org.eclipse.cdt.core.model.ITranslationUnit类的典型用法代码示例。如果您正苦于以下问题:Java ITranslationUnit类的具体用法?Java ITranslationUnit怎么用?Java ITranslationUnit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITranslationUnit类属于org.eclipse.cdt.core.model包,在下文中一共展示了ITranslationUnit类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: visit
import org.eclipse.cdt.core.model.ITranslationUnit; //导入依赖的package包/类
@Override
public boolean visit(ICElement elt) {
switch (elt.getElementType()) {
case ICElement.C_PROJECT:
visit( (ICProject) elt);
break;
case ICElement.C_CCONTAINER:
visit( (ICContainer) elt);
break;
case ICElement.C_UNIT:
visit( (ITranslationUnit) elt);
break;
case ICElement.C_INCLUDE:
visit( (IInclude) elt);
break;
default:
// I believe this should never happen
}
return false;
}
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:22,代码来源:AbstractDispatcherVisitor.java
示例2: init
import org.eclipse.cdt.core.model.ITranslationUnit; //导入依赖的package包/类
/**
* We will accept the selection in the workbench to see if
* we can initialize from it.
* @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
*/
public void init(IWorkbench workbench, IStructuredSelection selection) {
this.selection = selection;
WPILibCPPPlugin.logInfo(selection.toString());
Object element = ((StructuredSelection) selection).getFirstElement();
WPILibCPPPlugin.logInfo(element.getClass().toString());
if (element instanceof IResource) {
project = ((IResource) element).getProject();
} else if (element instanceof ISourceRoot) {
project = ((ISourceRoot) element).getCProject().getProject();
} else if (element instanceof ITranslationUnit) {
project = ((ITranslationUnit) element).getCProject().getProject();
} else if (element instanceof ISourceRoot) {
project = ((ISourceRoot) element).getCProject().getProject();
} else if (element instanceof ICContainer) {
project = ((ICContainer) element).getCProject().getProject();
} else WPILibCPPPlugin.logInfo("Element not instance of IResource: "+element.getClass());
}
开发者ID:wpilibsuite,项目名称:EclipsePlugins,代码行数:23,代码来源:FileTemplateWizard.java
示例3: visit
import org.eclipse.cdt.core.model.ITranslationUnit; //导入依赖的package包/类
/**
* Overriden to initialize some flags to <code>false</code>
* (e.g. at the begining of a .c file)
*/
@Override
public void visit(ITranslationUnit elt) {
super.visit(elt);
inSizeofExpression = false;
inCastExpression = false;
inTemplateArgumentExpression = false;
}
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:13,代码来源:ReferenceRefVisitor.java
示例4: visit
import org.eclipse.cdt.core.model.ITranslationUnit; //导入依赖的package包/类
/**
* Overriden to initialize {@link #inAmpersandUnaryExpression} and {@link #inCastExpr} to <code>false</code>
* (e.g. at the begining of a .c file)
*/
@Override
public void visit(ITranslationUnit elt) {
super.visit(elt);
inAmpersandUnaryExpression = false;
inCastExpression = false;
}
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:12,代码来源:InvocationAccessRefVisitor.java
示例5: checkHeader
import org.eclipse.cdt.core.model.ITranslationUnit; //导入依赖的package包/类
protected boolean checkHeader(ITranslationUnit tu) {
if (visitHeaders) {
return FileUtil.isHeader(tu);
}
else {
return (! FileUtil.isHeader(tu) );
}
}
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:9,代码来源:AbstractVisitor.java
示例6: visit
import org.eclipse.cdt.core.model.ITranslationUnit; //导入依赖的package包/类
@Override
public void visit(ITranslationUnit elt) {
String filename = elt.getFile().getFullPath().toString(); // fullPath relative to project directory
IBinding key = resolver.mkStubKey(projPath+filename, /*container*/null, CFile.class); // better not to localize filename for the key
currentFile = dico.ensureFamixCFile(key, FileUtil.localized(filename, projectRootFolder));
// overriding superclass visit() to not visit AST but only the children
visitChildren(elt);
}
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:10,代码来源:IncludeVisitor.java
示例7: visit
import org.eclipse.cdt.core.model.ITranslationUnit; //导入依赖的package包/类
public void visit(ITranslationUnit elt) {
this.filename = FileUtil.localized(elt.getFile().getRawLocation().toString(), rootFolder);
try {
elt.getAST(index, ITranslationUnit.AST_CONFIGURE_USING_SOURCE_CONTEXT | ITranslationUnit.AST_SKIP_INDEXED_HEADERS).accept(this);
} catch (CoreException e) {
Activator.log(IStatus.ERROR,"Got CoreException (\""+ e.getMessage() +"\") while getting AST of "+ elt.getElementName() );
}
}
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:10,代码来源:CommentDefVisitor.java
示例8: visit
import org.eclipse.cdt.core.model.ITranslationUnit; //导入依赖的package包/类
/**
* Overridden to visit only .h or .c files
*/
@Override
public void visit(ITranslationUnit elt) {
// XOR operator: (headerFiles AND isHeader()) OR (!headerFiles AND !isHeader())
if (! (headerFiles ^ FileUtil.isHeader(elt)) ) {
super.visit(elt);
}
}
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:11,代码来源:BehaviouralDefVisitor.java
示例9: createIndexBasedAST
import org.eclipse.cdt.core.model.ITranslationUnit; //导入依赖的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: isHeader
import org.eclipse.cdt.core.model.ITranslationUnit; //导入依赖的package包/类
public static boolean isHeader(ITranslationUnit tu) {
return isHeader(tu.getElementName());
}
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:4,代码来源:FileUtil.java
示例11: visit
import org.eclipse.cdt.core.model.ITranslationUnit; //导入依赖的package包/类
@Override
public void visit(ITranslationUnit elt) {
setContext(new CppEntityStack());
this.filename = FileUtil.localized(elt.getFile().getRawLocation().toString(), rootFolder);
super.visit(elt);
}
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:7,代码来源:AbstractVisitor.java
示例12: visit
import org.eclipse.cdt.core.model.ITranslationUnit; //导入依赖的package包/类
/**
* Overriden to initialize {@link #currentVisibility} to null
* (e.g. at the begining of a .c file)
*/
@Override
public void visit(ITranslationUnit elt) {
super.visit(elt);
currentVisibility = null;
}
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:10,代码来源:ClassMemberDefVisitor.java
示例13: visit
import org.eclipse.cdt.core.model.ITranslationUnit; //导入依赖的package包/类
@Override
public void visit(ITranslationUnit elt) {
super.visit(elt);
}
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:5,代码来源:TypeDefVisitor.java
示例14: visit
import org.eclipse.cdt.core.model.ITranslationUnit; //导入依赖的package包/类
/**
* Files are treated as Modules
*/
@Override
public void visit(ITranslationUnit elt) {
}
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:8,代码来源:PackageDefVisitor.java
示例15: parse
import org.eclipse.cdt.core.model.ITranslationUnit; //导入依赖的package包/类
public void parse(String sourceCode){
FileContent fileContent = new InternalFileContent(defaultFileName, new CharArray(sourceCode));
enableOption(GPPLanguage.OPTION_IS_SOURCE_UNIT);
enableOption(ITranslationUnit.AST_SKIP_ALL_HEADERS);
parse(fileContent);
}
开发者ID:ricardojlrufino,项目名称:cplus-libparser,代码行数:7,代码来源:SourceParser.java
注:本文中的org.eclipse.cdt.core.model.ITranslationUnit类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论