當前位置: 首頁>>代碼示例>>Java>>正文


Java TIRWhileStmt類代碼示例

本文整理匯總了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);
}
 
開發者ID:Sable,項目名稱:mclab-core,代碼行數:17,代碼來源:TemporaryVariablesRemoval.java

示例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);
    }
}
 
開發者ID:Sable,項目名稱:mclab-core,代碼行數:22,代碼來源:TIRToMcSAFIRTableBuilder.java

示例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())));
}
 
開發者ID:Sable,項目名稱:mclab-core,代碼行數:19,代碼來源:ThreeAddressToIR.java

示例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;
}
 
開發者ID:Sable,項目名稱:mclab-core,代碼行數:10,代碼來源:NodePrinter.java

示例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);
}
 
開發者ID:Sable,項目名稱:mclab-core,代碼行數:12,代碼來源:ReachingDefinitions.java

示例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);
}
 
開發者ID:Sable,項目名稱:mclab-core,代碼行數:9,代碼來源:UsedVariablesNameCollector.java

示例7: caseTIRWhileStmt

import natlab.tame.tir.TIRWhileStmt; //導入依賴的package包/類
@Override
public void caseTIRWhileStmt(TIRWhileStmt node)
{
    Name conditionVariableName = node.getCondition().getName();
    renameConditionVariableForNode(conditionVariableName, node);
    caseWhileStmt(node);
}
 
開發者ID:Sable,項目名稱:mclab-core,代碼行數:8,代碼來源:RenameVariablesForTIRNodes.java

示例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");
}
 
開發者ID:Sable,項目名稱:mclab-core,代碼行數:10,代碼來源:ValueAnalysisPrinter.java

示例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;
}
 
開發者ID:Sable,項目名稱:Mc2For,代碼行數:34,代碼來源:HandleCaseTIRWhileStmt.java

示例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));
}
 
開發者ID:Sable,項目名稱:Mc2For,代碼行數:11,代碼來源:FortranCodeASTGenerator.java

示例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());
}
 
開發者ID:sshrdp,項目名稱:mclab,代碼行數:15,代碼來源:WhileLoopStmt.java

示例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));
	}
}
 
開發者ID:sshrdp,項目名稱:mclab,代碼行數:11,代碼來源:FortranCodeASTGenerator.java

示例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);
}
 
開發者ID:Sable,項目名稱:mclab-core,代碼行數:7,代碼來源:TIRToMcSAFIRWithoutTemp.java

示例14: caseTIRWhileStmt

import natlab.tame.tir.TIRWhileStmt; //導入依賴的package包/類
@Override
public void caseTIRWhileStmt(TIRWhileStmt node) {
    parentForwarder.caseTIRWhileStmt(node);
}
 
開發者ID:Sable,項目名稱:mclab-core,代碼行數:5,代碼來源:TIRAbstractSimpleStructuralBackwardAnalysis.java

示例15: caseTIRWhileStmt

import natlab.tame.tir.TIRWhileStmt; //導入依賴的package包/類
@Override
public void caseTIRWhileStmt(TIRWhileStmt node) {
    caseWhileStmt(node);
}
 
開發者ID:Sable,項目名稱:mclab-core,代碼行數:5,代碼來源:TIRAbstractNodeCaseHandler.java


注:本文中的natlab.tame.tir.TIRWhileStmt類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。