当前位置: 首页>>代码示例>>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;未经允许,请勿转载。