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


Java Statement.accept方法代码示例

本文整理汇总了Java中org.eclipse.jdt.core.dom.Statement.accept方法的典型用法代码示例。如果您正苦于以下问题:Java Statement.accept方法的具体用法?Java Statement.accept怎么用?Java Statement.accept使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jdt.core.dom.Statement的用法示例。


在下文中一共展示了Statement.accept方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: preNext

import org.eclipse.jdt.core.dom.Statement; //导入方法依赖的package包/类
@Override
public boolean preNext(IfStatement curElement) {

	Statement thenStatement = curElement.getThenStatement();
	Statement elseStatement = curElement.getElseStatement();
	Expression condition = curElement.getExpression();

	if (elseStatement == null) {
		compiler.println("opt " + condition.toString());
		return true;
	} else {
		compiler.println("alt " + condition.toString());
		thenStatement.accept(compiler);
		if (elseStatement instanceof IfStatement) {
			processAltStatement((IfStatement) elseStatement);
		} else {
			compiler.println("else");
			elseStatement.accept(compiler);
		}
		return false;
	}
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:23,代码来源:OptAltFragment.java

示例2: processAltStatement

import org.eclipse.jdt.core.dom.Statement; //导入方法依赖的package包/类
private void processAltStatement(IfStatement statement) {
	Statement thenStatement = statement.getThenStatement();
	Statement elseStatement = statement.getElseStatement();
	Expression condition = statement.getExpression();

	compiler.println("else " + condition.toString());
	thenStatement.accept(compiler);
	if (elseStatement != null) {
		if (elseStatement instanceof IfStatement) {
			processAltStatement((IfStatement) elseStatement);
		} else {
			compiler.println("else");
			elseStatement.accept(compiler);
		}
	}
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:17,代码来源:OptAltFragment.java

示例3: visit

import org.eclipse.jdt.core.dom.Statement; //导入方法依赖的package包/类
public boolean visit(SwitchStatement node) {
	this.buffer.append("switch (");//$NON-NLS-1$
	node.getExpression().accept(this);
	this.buffer.append(") ");//$NON-NLS-1$
	this.buffer.append("{\n");//$NON-NLS-1$
	this.indent++;
	for (Iterator it = node.statements().iterator(); it.hasNext(); ) {
		Statement s = (Statement) it.next();
		s.accept(this);
		this.indent--; // incremented in visit(SwitchCase)
	}
	this.indent--;
	printIndent();
	this.buffer.append("}\n");//$NON-NLS-1$
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:17,代码来源:NaiveASTFlattener.java

示例4: visitStatement

import org.eclipse.jdt.core.dom.Statement; //导入方法依赖的package包/类
/**
 * Get the variables for the seed statement.
 */
public boolean visitStatement(Statement node){
	/* Get the line number for the statement. */
	int line = Slicer.getLineNumber(node);
	
	if(line == this.seedLine){
		/* We need to keep track of the variables in the seed statement. */
		if(this.seedVariables.isEmpty()){
			SeedVisitor seedVisitor = new SeedVisitor(this.seedVariables);
			node.accept(seedVisitor);
		}
	}
	
	return true;
}
 
开发者ID:qhanam,项目名称:Slicer,代码行数:18,代码来源:AliasVisitor.java

示例5: visit

import org.eclipse.jdt.core.dom.Statement; //导入方法依赖的package包/类
@Override
public boolean visit(Block node) {
	this.fBuffer.append("{");//$NON-NLS-1$
	for (Iterator<Statement> it= node.statements().iterator(); it.hasNext();) {
		Statement s= it.next();
		s.accept(this);
	}
	this.fBuffer.append("}");//$NON-NLS-1$
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:11,代码来源:ASTFlattener.java

示例6: getProcedureInvocationsInternal

import org.eclipse.jdt.core.dom.Statement; //导入方法依赖的package包/类
private List<Procedure> getProcedureInvocationsInternal(final Statement statement) {
  this.procedures = Lists.newArrayList();
  statement.accept(this);
  return procedures;
}
 
开发者ID:sealuzh,项目名称:PerformanceHat,代码行数:6,代码来源:ForLoopBodyVisitor.java


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