• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IASTStatement类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.cdt.core.dom.ast.IASTStatement的典型用法代码示例。如果您正苦于以下问题:Java IASTStatement类的具体用法?Java IASTStatement怎么用?Java IASTStatement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IASTStatement类属于org.eclipse.cdt.core.dom.ast包,在下文中一共展示了IASTStatement类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: statement

import org.eclipse.cdt.core.dom.ast.IASTStatement; //导入依赖的package包/类
@Override
protected IASTStatement statement() throws EndOfFileException, BacktrackException {
	switch (LT(1)) {
	case IProCToken.tEXEC:
		switch (LT(2)) {
		case IProCToken.tSQL:
		case IProCToken.tORACLE:
		case IProCToken.tTOOLS:
		case IProCToken.tIAF:
			/*
			 * Pro*C
			 */
			return parseSqlStatement();
		}
	}

	return super.statement();
}
 
开发者ID:buntatsu,项目名称:cdt-proc,代码行数:19,代码来源:ProCSourceParser.java


示例2: visit

import org.eclipse.cdt.core.dom.ast.IASTStatement; //导入依赖的package包/类
public int visit(IASTStatement stmt) { // lots more
	
    if (stmt instanceof IASTExpressionStatement)
    {
    	if (stmt.getRawSignature().length() > 100)
    	{
    	//	System.out.println("Visiting expr: "+ stmt.getPropertyInParent() + stmt.getRawSignature());
    		return PROCESS_SKIP;
    	}		    	
    }
    if ("IASTFunctionDefinition.FUNCTION_BODY - Function Body for IASTFunctionDefinition".equals(stmt.getPropertyInParent().getName()))
    {
    	curStmt = cnt;
    	addFunctionMover(curFunc,curDecl,curStmt);
    //	curFunc = "";
    //	curDecl = -1;
    //	curStmt = -1;
    }
  //  System.out.println(stmt.getPropertyInParent().getName()+" "+"Visiting stmt: " + stmt.getRawSignature());
    setThings(stmt.getPropertyInParent().getName(),
			"Visiting stmt: " + stmt.getRawSignature());
	return PROCESS_CONTINUE;
}
 
开发者ID:elenno,项目名称:simtest,代码行数:24,代码来源:ASTVISITOR.java


示例3: visit

import org.eclipse.cdt.core.dom.ast.IASTStatement; //导入依赖的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


示例4: visit

import org.eclipse.cdt.core.dom.ast.IASTStatement; //导入依赖的package包/类
@Override
public int visit(IASTStatement statement) {
	if (statement instanceof IASTAmbiguousStatement)
		visit((IASTAmbiguousStatement) statement);
	else if (statement instanceof IASTBreakStatement)
		visit((IASTBreakStatement) statement);
	else if (statement instanceof IASTCaseStatement)
		visit((IASTCaseStatement) statement);
	else if (statement instanceof IASTCompoundStatement)
		visit((IASTCompoundStatement) statement);
	else if (statement instanceof IASTContinueStatement)
		visit((IASTContinueStatement) statement);
	else if (statement instanceof IASTDeclarationStatement)
		visit((IASTDeclarationStatement) statement);
	else if (statement instanceof IASTDefaultStatement)
		visit((IASTDefaultStatement) statement);
	else if (statement instanceof IASTDoStatement)
		visit((IASTDoStatement) statement);
	else if (statement instanceof IASTExpressionStatement)
		visit((IASTExpressionStatement) statement);
	else if (statement instanceof IASTForStatement)
		visit((IASTForStatement) statement);
	else if (statement instanceof IASTGotoStatement)
		visit((IASTGotoStatement) statement);
	else if (statement instanceof IASTIfStatement)
		visit((IASTIfStatement) statement);
	else if (statement instanceof IASTLabelStatement)
		visit((IASTLabelStatement) statement);
	else if (statement instanceof IASTNullStatement)
		visit((IASTNullStatement) statement);
	else if (statement instanceof IASTReturnStatement)
		visit((IASTReturnStatement) statement);
	else if (statement instanceof IASTSwitchStatement)
		visit((IASTSwitchStatement) statement);
	else if (statement instanceof IASTWhileStatement)
		visit((IASTWhileStatement) statement);
	else if (statement instanceof ICPPASTCatchHandler)
		visit((ICPPASTCatchHandler) statement);
	else if (statement instanceof ICPPASTRangeBasedForStatement)
		visit((ICPPASTRangeBasedForStatement) statement);
	else if (statement instanceof ICPPASTTryBlockStatement)
		visit((ICPPASTTryBlockStatement) statement);
	else if (statement instanceof IGNUASTGotoStatement)
		visit((IGNUASTGotoStatement) statement);
	else if (statement instanceof IASTProblemStatement)
		visit((IASTProblemStatement) statement);
	else {
		throw new RuntimeException(
				"Statement: encountered non-implemented subtype " + statement.getClass().getName());
	}
	return PROCESS_ABORT;
}
 
开发者ID:cwi-swat,项目名称:clair,代码行数:53,代码来源:Parser.java


示例5: problemDeclaration

import org.eclipse.cdt.core.dom.ast.IASTStatement; //导入依赖的package包/类
@Override
protected IASTDeclaration[] problemDeclaration(int offset, BacktrackException bt, DeclarationOptions option) {
	try {
		switch (LT(1)) {
		case IProCToken.tEXEC:

			switch (LT(2)) {
			case IProCToken.tSQL:
			case IProCToken.tORACLE:
			case IProCToken.tTOOLS:
			case IProCToken.tIAF:
				IASTStatement stmt = getNodeFactory().newCompoundStatement();

				// skip to semicolon or END-EXEC
				int endOfProc = IToken.tSEMI;
				IToken t = consume();
				while (true) {
					switch (t.getType()) {
					case IProCToken.tEXECUTE:
						switch (LT(1)) {
						case IProCToken.tDECLARE:
						case IProCToken.tBEGIN:
							endOfProc = IProCToken.tEND_EXEC;
							break;
						}
						break;
					}

					final int type = t.getType();

					if (type == IToken.tIDENTIFIER || type >= IProCToken.FIRST_IProCToken) {
						final int p_offset = t.getOffset();
						final int p_endOffset = t.getEndOffset();
						final int p_length = t.getLength();

						IASTName name = getNodeFactory().newName(t.getCharImage());
						((ASTNode) name).setOffsetAndLength(p_offset, p_length);

						IBinding binding = new ProCBinding(name);
						name.setBinding(binding);

						IASTLabelStatement label_statement = getNodeFactory().newLabelStatement(name, null);
						setRange(label_statement, p_offset, p_endOffset);
						label_statement.setParent(stmt);
						((IASTCompoundStatement) stmt).addStatement(label_statement);
					}

					if (type == endOfProc) {
						break;
					}

					t = consume();
				}
				return new IASTDeclaration[] {};
			}
		}
	} catch (EndOfFileException e) {
		return new IASTDeclaration[] {};
	}
	return super.problemDeclaration(offset, bt, option);
}
 
开发者ID:buntatsu,项目名称:cdt-proc,代码行数:62,代码来源:ProCSourceParser.java


示例6: visit

import org.eclipse.cdt.core.dom.ast.IASTStatement; //导入依赖的package包/类
public int visit(IASTStatement statement) {
    statements.add(statement);
    return PROCESS_CONTINUE;
}
 
开发者ID:magicsky,项目名称:sya,代码行数:5,代码来源:ASTStatementsVisitor.java


示例7: leave

import org.eclipse.cdt.core.dom.ast.IASTStatement; //导入依赖的package包/类
public int leave(IASTStatement stmt) {
	unsetThings();
	
	//System.out.println(" Leaving stmt: " + stmt.getRawSignature());
	return PROCESS_CONTINUE;
}
 
开发者ID:elenno,项目名称:simtest,代码行数:7,代码来源:ASTVISITOR.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Listener类代码示例发布时间:2022-05-22
下一篇:
Java WebSocketMessage类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap