本文整理汇总了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;
}
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}