本文整理汇总了Java中org.eclipse.cdt.core.dom.ast.IASTDoStatement类的典型用法代码示例。如果您正苦于以下问题:Java IASTDoStatement类的具体用法?Java IASTDoStatement怎么用?Java IASTDoStatement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IASTDoStatement类属于org.eclipse.cdt.core.dom.ast包,在下文中一共展示了IASTDoStatement类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.eclipse.cdt.core.dom.ast.IASTDoStatement; //导入依赖的package包/类
/**
* Visiting a statement. Used to compute some metrics on the methods:
* Cyclomatic Complexity and NumberOfStatements
*/
@Override
public int visit(IASTStatement node) {
// possible subtypes:
// IASTBreakStatement, IASTCaseStatement, IASTCompoundStatement, IASTContinueStatement, IASTDeclarationStatement, IASTDefaultStatement,
// IASTDoStatement, IASTExpressionStatement, IASTForStatement, IASTGotoStatement, IASTIfStatement, IASTLabelStatement, IASTNullStatement,
// IASTProblemStatement, IASTReturnStatement, IASTSwitchStatement, IASTWhileStatement, ICPPASTCatchHandler, ICPPASTCompoundStatement,
// ICPPASTForStatement, ICPPASTIfStatement, ICPPASTRangeBasedForStatement, ICPPASTSwitchStatement, ICPPASTTryBlockStatement, ICPPASTWhileStatement,
// IGNUASTGotoStatement
if ( (node instanceof IASTCaseStatement) ||
(node instanceof IASTDefaultStatement) ||
(node instanceof IASTDoStatement) ||
(node instanceof IASTForStatement) ||
(node instanceof IASTIfStatement) ||
(node instanceof IASTWhileStatement) ||
(node instanceof ICPPASTRangeBasedForStatement)||
(node instanceof ICPPASTTryBlockStatement) ) {
getContext().addTopMethodCyclo(1);
}
if ( (node instanceof IASTCaseStatement) || // not a statement but a case clause in a switch
(node instanceof IASTCompoundStatement)|| // block
(node instanceof IASTDefaultStatement) || // not a statement but the default clause in a switch
(node instanceof IASTLabelStatement) ) {
// nothing to do for these, all the rest counts as one statement (in the else clause)
}
else {
getContext().addTopMethodNOS(1);
}
return super.visit(node);
}
示例2: visit
import org.eclipse.cdt.core.dom.ast.IASTDoStatement; //导入依赖的package包/类
public int visit(IASTDoStatement statement) {
ISourceLocation loc = getSourceLocation(statement);
IList attributes = getAttributes(statement);
statement.getBody().accept(this);
IConstructor body = stack.pop();
statement.getCondition().accept(this);
IConstructor condition = stack.pop();
stack.push(builder.Statement_do(attributes, body, condition, loc));
return PROCESS_ABORT;
}