// Mike Maxim
// IRTree for jump

package edu.cmu.cs.l3.tree;

import java.util.*;

public class IRJump extends IRStatement {

    public IRJump(IRLabel l) {
	m_target = l; m_possibles = null;

	m_classname = "IRJump";
    }
    public IRJump(IRLabel l, List targ) {
	m_target = l; m_possibles = targ;

	m_classname = "IRJump";
    }

    public IRLabel getTarget() {
	return m_target;
    }

	/**
	 * @param label
	 */
	public void setTarget(IRLabel label) {
		m_target = label;
	}

	public List getPossibles() {
	return m_possibles;
    }

    public IRExpressionList getComponents() {
	return new IRExpressionList();
    }

    public IRStatement build(IRExpressionList comps) {
	return new IRJump(m_target,m_possibles);
    }

    public String toString() {
	//String loopstr = "";
	//for(Iterator it = loops.iterator(); it.hasNext(); ) {
	//    loopstr += it.next().toString();
	//    loopstr += " ";
	//}
	return "IRJump (T: " + m_target.toString() + ")";// loops: " + loopstr;
    }

    private IRLabel m_target;
    private List m_possibles;
}

