本文整理汇总了Java中org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction类的典型用法代码示例。如果您正苦于以下问题:Java ICPPFunction类的具体用法?Java ICPPFunction怎么用?Java ICPPFunction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ICPPFunction类属于org.eclipse.cdt.core.dom.ast.cpp包,在下文中一共展示了ICPPFunction类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolveICPPBinding
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction; //导入依赖的package包/类
private ISourceLocation resolveICPPBinding(ICPPBinding binding) throws URISyntaxException {
if (binding instanceof ICPPAliasTemplateInstance)
return resolveICPPAliasTemplateInstance((ICPPAliasTemplateInstance) binding);
if (binding instanceof ICPPClassType)
return resolveICPPClassType((ICPPClassType) binding);
if (binding instanceof ICPPEnumeration)
return resolveICPPEnumeration((ICPPEnumeration) binding);
if (binding instanceof ICPPFunction)
return resolveICPPFunction((ICPPFunction) binding);
if (binding instanceof ICPPMember)
return resolveICPPMember((ICPPMember) binding);
if (binding instanceof ICPPNamespace)
return resolveICPPNamespace((ICPPNamespace) binding);
if (binding instanceof ICPPSpecialization)
return resolveICPPSpecialization((ICPPSpecialization) binding);
if (binding instanceof ICPPTemplateDefinition)
return resolveICPPTemplateDefinition((ICPPTemplateDefinition) binding);
if (binding instanceof ICPPTemplateParameter)
return resolveICPPTemplateParameter((ICPPTemplateParameter) binding);
if (binding instanceof ICPPUsingDeclaration)
return resolveICPPUsingDeclaration((ICPPUsingDeclaration) binding);
if (binding instanceof ICPPVariable)
return resolveICPPVariable((ICPPVariable) binding);
if (binding instanceof ICPPInternalBinding)
return resolveICPPInternalBinding((ICPPInternalBinding) binding);
if (binding instanceof ICPPUnknownBinding)
return resolveICPPUnknownBinding((ICPPUnknownBinding) binding);
return makeBinding("UNKNOWN3", null, null);
}
示例2: resolveICPPFunction
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction; //导入依赖的package包/类
private ISourceLocation resolveICPPFunction(ICPPFunction binding) throws URISyntaxException {
String scheme;
if (binding instanceof ICPPDeferredFunction)
scheme = "cpp+deferredFunction";
else if (binding instanceof ICPPFunctionInstance)
scheme = "cpp+functionInstance";
else if (binding instanceof ICPPFunctionSpecialization)
scheme = "cpp+functionSpecialization";
else if (binding instanceof ICPPFunctionTemplate)
scheme = "cpp+functionTemplate";
else if (binding instanceof ICPPMethod) {
if (binding instanceof ICPPConstructor) {
if (binding instanceof ICPPConstructorSpecialization)
scheme = "cpp+constructorSpecialization";
else
scheme = "cpp+constructor";
} else if (binding instanceof ICPPMethodSpecialization)
scheme = "cpp+methodSpecialization";
else
scheme = "cpp+method";
} else
scheme = "cpp+function";
StringBuilder parameters = new StringBuilder("(");
for (ICPPParameter parameter : binding.getParameters()) {
if (parameters.length() > 1)
parameters.append(',');
parameters.append(printType(parameter.getType()));
}
parameters.append(')');
ISourceLocation decl = URIUtil.changeScheme(URIUtil.getChildLocation(resolveOwner(binding), binding.getName()),
scheme);
decl = URIUtil.changePath(decl, decl.getPath() + parameters.toString());
return decl;
}
示例3: testExample
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction; //导入依赖的package包/类
public void testExample() {
IASTTranslationUnit translationUnit = parseCPP(getCommentAbove());
ASTNamesVisitor namesVisitor = new ASTNamesVisitor();
translationUnit.accept(namesVisitor);
IASTName name = namesVisitor.getNames().get(1);
ICPPFunction function = (ICPPFunction) name.resolveBinding();
assertEquals("f", function.getName());
}
示例4: resolveIFunction
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction; //导入依赖的package包/类
private ISourceLocation resolveIFunction(IFunction binding) throws URISyntaxException {
if (binding instanceof ICPPFunction)
return resolveICPPFunction((ICPPFunction) binding);
throw new RuntimeException("NYI: C IFunction");
}