本文整理汇总了Java中natlab.tame.tir.TIRWhileStmt类的典型用法代码示例。如果您正苦于以下问题:Java TIRWhileStmt类的具体用法?Java TIRWhileStmt怎么用?Java TIRWhileStmt使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TIRWhileStmt类属于natlab.tame.tir包,在下文中一共展示了TIRWhileStmt类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: caseTIRWhileStmt
import natlab.tame.tir.TIRWhileStmt; //导入依赖的package包/类
@Override
public void caseTIRWhileStmt(TIRWhileStmt node) {
Name conditionVariableName = node.getCondition().getName();
if (conditionVariableName != null) {
Map<TIRNode, Integer> nodeAndColor = fUDDUWeb
.getNodeAndColorForUse(conditionVariableName
.getNodeString());
boolean isNodeAValidKeyInNodeToColorMap = nodeAndColor != null
&& nodeAndColor.containsKey(node);
if (isNodeAValidKeyInNodeToColorMap
&& isTemporaryVariable(conditionVariableName)) {
replaceUsedTempVarByDefinition(conditionVariableName, node);
}
}
caseWhileStmt(node);
}
示例2: caseTIRWhileStmt
import natlab.tame.tir.TIRWhileStmt; //导入依赖的package包/类
@Override
public void caseTIRWhileStmt(TIRWhileStmt node)
{
try
{
TIRWhileStmt whileStmtClone = (TIRWhileStmt) node.clone();
WhileStmt whileStmt = new WhileStmt();
whileStmt.setExpr(whileStmtClone.getCondition());
whileStmt.setStmtList(whileStmtClone.getStmtList());
fTIRToMcSAFIRTable.put(node, whileStmt);
if (DEBUG) printTableEntry(node, whileStmt);
caseWhileStmt(node);
} catch (CloneNotSupportedException e)
{
throw new RuntimeException(e);
}
}
示例3: caseWhileStmt
import natlab.tame.tir.TIRWhileStmt; //导入依赖的package包/类
public void caseWhileStmt(WhileStmt node) {
rewriteChildren(node);
if (node instanceof TIRStmt) return; //don't redo conversion
//pull out expr
LinkedList<AssignStmt> assign = new LinkedList<AssignStmt>();
NameExpr condition = (NameExpr)expandExpr(node.getExpr(),assign);
//copy list to end of body
for (AssignStmt a : assign){
node.getStmtList().add(a.copy());
}
//construct transformed node
newNode = new TransformedNode(assign);
newNode.add(new TIRWhileStmt(condition.getName(), new TIRStatementList(node.getStmtList())));
}
示例4: printNode
import natlab.tame.tir.TIRWhileStmt; //导入依赖的package包/类
public static String printNode(TIRNode node)
{
if (node instanceof TIRAbstractAssignStmt) return ((TIRAbstractAssignStmt) node).getStructureString();
else if (node instanceof TIRFunction) return ((TIRFunction) node).getStructureString().split("\n")[0];
else if (node instanceof TIRIfStmt) return ((TIRIfStmt) node).getStructureString().split("\n")[0];
else if (node instanceof TIRWhileStmt) return ((TIRWhileStmt) node).getStructureString().split("\n")[0];
else if (node instanceof TIRForStmt) return ((TIRForStmt) node).getStructureString().split("\n")[0];
else return null;
}
示例5: caseTIRWhileStmt
import natlab.tame.tir.TIRWhileStmt; //导入依赖的package包/类
@Override
public void caseTIRWhileStmt(TIRWhileStmt node) {
currentOutSet = copy(currentInSet);
setInOutSet(node);
fVisitedStmts.add(node);
caseWhileStmt(node);
if (DEBUG)
printMapForNode(node);
}
示例6: caseTIRWhileStmt
import natlab.tame.tir.TIRWhileStmt; //导入依赖的package包/类
@Override
public void caseTIRWhileStmt(TIRWhileStmt node)
{
fCurrentVariablesSet = newInitialFlow();
fCurrentVariablesSet.add(node.getCondition().getName().getID());
fNodeToUsedVariablesMap.put(node, fCurrentVariablesSet);
caseWhileStmt(node);
}
示例7: caseTIRWhileStmt
import natlab.tame.tir.TIRWhileStmt; //导入依赖的package包/类
@Override
public void caseTIRWhileStmt(TIRWhileStmt node)
{
Name conditionVariableName = node.getCondition().getName();
renameConditionVariableForNode(conditionVariableName, node);
caseWhileStmt(node);
}
示例8: caseTIRWhileStmt
import natlab.tame.tir.TIRWhileStmt; //导入依赖的package包/类
@Override
public void caseTIRWhileStmt(TIRWhileStmt node) {
String indent = node.getIndent();
buf.append(indent + "while ");
buf.append(node.getExpr().getPrettyPrinted());
buf.append('\n');
printStatements(node.getStmts());
buf.append(indent + "end");
}
示例9: getFortran
import natlab.tame.tir.TIRWhileStmt; //导入依赖的package包/类
/**
* WhileStmt: Statement ::= <Condition> WhileBlock: StatementSection;
*/
public Statement getFortran(
FortranCodeASTGenerator fcg,
TIRWhileStmt node) {
if (Debug) System.out.println("in while statement.");
WhileStmt stmt = new WhileStmt();
String indent = new String();
for (int i=0; i<fcg.indentNum; i++) {
indent = indent + fcg.standardIndent;
}
stmt.setIndent(indent);
stmt.setCondition(node.getCondition().getVarName());
/*
* backup this pointer! and make fcg.stmtSecForIFWhileForBlock
* point back after iterate for block.
*/
StatementSection backup = fcg.stmtSecForIfWhileForBlock;
fcg.ifWhileForBlockNest++;
StatementSection whileStmtSec = new StatementSection();
fcg.stmtSecForIfWhileForBlock = whileStmtSec;
fcg.indentNum++;
fcg.iterateStatements(node.getStatements());
stmt.setWhileBlock(whileStmtSec);
fcg.indentNum--;
fcg.ifWhileForBlockNest--;
fcg.stmtSecForIfWhileForBlock = backup;
return stmt;
}
示例10: caseTIRWhileStmt
import natlab.tame.tir.TIRWhileStmt; //导入依赖的package包/类
@Override
public void caseTIRWhileStmt(TIRWhileStmt node) {
HandleCaseTIRWhileStmt whileStmt = new HandleCaseTIRWhileStmt();
if (ifWhileForBlockNest != 0)
stmtSecForIfWhileForBlock.addStatement(
whileStmt.getFortran(this, node));
else
subprogram.getStatementSection().addStatement(
whileStmt.getFortran(this, node));
}
示例11: handleTIRWhileStmt
import natlab.tame.tir.TIRWhileStmt; //导入依赖的package包/类
public static void handleTIRWhileStmt(TIRWhileStmt node, IRx10ASTGenerator target, StmtBlock block) {
WhileStmt while_stmt = new WhileStmt();
while_stmt.setCondition(Expressions.makeIRx10Exp(node.getExpr()));
System.out.println(while_stmt.getCondition().toString());
while_stmt.setLoopBody(new LoopBody(new List<Stmt>()));
LoopBody loop_body_block = while_stmt.getLoopBody();
target.currentBlock.add(loop_body_block);
buildStmtsSubAST(node.getStmts(), target);
target.currentBlock.remove(loop_body_block);
block.addStmt(while_stmt);
System.out.println(loop_body_block.getStmts().getNumChild());
}
示例12: caseTIRWhileStmt
import natlab.tame.tir.TIRWhileStmt; //导入依赖的package包/类
@Override
public void caseTIRWhileStmt(TIRWhileStmt node){
HandleCaseTIRWhileStmt whileStmt = new HandleCaseTIRWhileStmt();
if(this.inIfWhileForBlock==true){
this.stmtSecForIfWhileForBlock.addStatement(whileStmt.getFortran(this, node));
}
else{
this.SubProgram.getStatementSection().addStatement(whileStmt.getFortran(this, node));
}
}
示例13: caseTIRWhileStmt
import natlab.tame.tir.TIRWhileStmt; //导入依赖的package包/类
@Override
public void caseTIRWhileStmt(TIRWhileStmt node) {
rewriteChildren(node);
WhileStmt outputWhileStmt = (WhileStmt) getReplacementNode(node);
fNewNode = new TransformedNode(outputWhileStmt);
}
示例14: caseTIRWhileStmt
import natlab.tame.tir.TIRWhileStmt; //导入依赖的package包/类
@Override
public void caseTIRWhileStmt(TIRWhileStmt node) {
parentForwarder.caseTIRWhileStmt(node);
}
示例15: caseTIRWhileStmt
import natlab.tame.tir.TIRWhileStmt; //导入依赖的package包/类
@Override
public void caseTIRWhileStmt(TIRWhileStmt node) {
caseWhileStmt(node);
}