本文整理汇总了Java中org.eclipse.cdt.core.dom.ast.IASTStandardFunctionDeclarator类的典型用法代码示例。如果您正苦于以下问题:Java IASTStandardFunctionDeclarator类的具体用法?Java IASTStandardFunctionDeclarator怎么用?Java IASTStandardFunctionDeclarator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IASTStandardFunctionDeclarator类属于org.eclipse.cdt.core.dom.ast包,在下文中一共展示了IASTStandardFunctionDeclarator类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.eclipse.cdt.core.dom.ast.IASTStandardFunctionDeclarator; //导入依赖的package包/类
@Override
public int visit(IASTDeclarator node) {
/* ********************************************************************************************
* BE CAREFULL: The order of the tests is important because choices are not mutually exclusive
* ex: ICPPASTFunctionDeclarator is a sub-interface of IASTFunctionDeclarator
* ******************************************************************************************** */
if (node instanceof ICPPASTFunctionDeclarator) {
return this.visit((ICPPASTFunctionDeclarator)node);
}
else if (node instanceof IASTStandardFunctionDeclarator) {
return this.visit((IASTStandardFunctionDeclarator)node);
}
else if (node instanceof ICASTKnRFunctionDeclarator) {
return this.visit((ICASTKnRFunctionDeclarator)node);
}
else if (node instanceof IASTFunctionDeclarator) {
return this.visit((IASTFunctionDeclarator)node);
}
else if (node instanceof IASTFieldDeclarator) { // actually seems to never occur ???
return this.visit((IASTFieldDeclarator)node);
}
/* removed to deal with C attributes: IASTDeclarators
else if (node instanceof ICPPASTDeclarator) {
return this.visit((ICPPASTDeclarator)node);
}
replaced by the following:
*/
else {
return this.visitInternal(node);
}
}
示例2: visit
import org.eclipse.cdt.core.dom.ast.IASTStandardFunctionDeclarator; //导入依赖的package包/类
@Override
protected int visit(IASTStandardFunctionDeclarator node) {
// name
signature = new QualifiedName(node.getName()).unqualifiedName();
// parameters
visitParameters(node.getParameters());
// return type
visitParent(node.getParent());
return PROCESS_SKIP;
}
示例3: visit
import org.eclipse.cdt.core.dom.ast.IASTStandardFunctionDeclarator; //导入依赖的package包/类
@Override
protected int visit(IASTStandardFunctionDeclarator node) {
// get node name and bnd
super.visit( node);
if (nodeBnd instanceof IVariable) {
// declaration of a function pointer such as var in "int (*var)(int param1, char param2)"
returnedEntity = null;
}
else {
returnedEntity = visitFunctionDeclarator(node, node.getParameters());
}
return PROCESS_SKIP;
}
示例4: visit
import org.eclipse.cdt.core.dom.ast.IASTStandardFunctionDeclarator; //导入依赖的package包/类
public int visit(IASTFunctionDeclarator declarator) {
if (declarator instanceof IASTStandardFunctionDeclarator)
visit((IASTStandardFunctionDeclarator) declarator);
else if (declarator instanceof ICASTKnRFunctionDeclarator)
visit((ICASTKnRFunctionDeclarator) declarator);
else
throw new RuntimeException(
"Unknown FunctionDeclarator subtype " + declarator.getClass().getName() + ". Exiting");
return PROCESS_ABORT;
}
示例5: testExample
import org.eclipse.cdt.core.dom.ast.IASTStandardFunctionDeclarator; //导入依赖的package包/类
public void testExample() {
IASTTranslationUnit translationUnit = parseC(getCommentAbove());
IASTSimpleDeclaration simpleDeclaration = (IASTSimpleDeclaration) translationUnit.getDeclarations()[2];
IASTStandardFunctionDeclarator functionDeclarator = (IASTStandardFunctionDeclarator) simpleDeclaration.getDeclarators()[0];
// __P((A *))
assertTrue(functionDeclarator.getParameters()[0].getDeclSpecifier() instanceof ICASTTypedefNameSpecifier);
}
示例6: testExample
import org.eclipse.cdt.core.dom.ast.IASTStandardFunctionDeclarator; //导入依赖的package包/类
public void testExample() {
IASTTranslationUnit translationUnit = parseCPP(getCommentAbove());
IASTSimpleDeclaration simpleDeclaration = (IASTSimpleDeclaration) translationUnit.getDeclarations()[0];
// (*pfi)()
assertTrue(simpleDeclaration.getDeclarators()[0] instanceof IASTStandardFunctionDeclarator);
}
示例7: visit
import org.eclipse.cdt.core.dom.ast.IASTStandardFunctionDeclarator; //导入依赖的package包/类
@Override
protected int visit(IASTStandardFunctionDeclarator node) {
BehaviouralEntity fmx;
processFunctionDeclarator(node);
fmx = (BehaviouralEntity) returnedEntity;
visitParameters(node.getParameters(), fmx);
returnedEntity = fmx;
return PROCESS_SKIP;
}