package edu.cmu.cs.l3.translate;

import edu.cmu.cs.l3.tree.*;
import edu.cmu.cs.l3.frame.*;
import edu.cmu.cs.l3.temp.*;

public class FragmentCode extends Fragment {

    public FragmentCode(Frame frame, String name) {
        super(frame);
        m_code = new IRLabel(new Label()); m_name = name;
    }

    public FragmentCode(Frame frame, String name, IRStatement code) {
        super(frame); m_code = code; m_name = name;
    }

    public IRStatement getCode() {
        return m_code;
    }

    public void augmentCode(IRStatement stm) {
        m_code = new IRSeq(m_code, stm);
    }

    public void setCode(IRStatement stm) {
        m_code = stm;
    }

    public String getName() {
        return m_name;
    }

    private IRStatement m_code;
    private String m_name;
}