当前位置: 首页>>代码示例>>Java>>正文


Java IASTDoStatement类代码示例

本文整理汇总了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);
}
 
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:36,代码来源:BehaviouralDefVisitor.java

示例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;
}
 
开发者ID:cwi-swat,项目名称:clair,代码行数:13,代码来源:Parser.java


注:本文中的org.eclipse.cdt.core.dom.ast.IASTDoStatement类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。