/* This file was generated by SableCC (http://www.sablecc.org/). */

package MONAViewer.monalanguage.node;

import java.util.*;
import MONAViewer.monalanguage.analysis.*;

public final class ASetExp extends PExp
{
    private PSetBody _set_body_;

    public ASetExp ()
    {
    }

    public ASetExp (
            PSetBody _set_body_
    )
    {
        setSetBody (_set_body_);
    }

    public Object clone()
    {
        return new ASetExp (
            (PSetBody)cloneNode (_set_body_)
        );
    }

    public void apply(Switch sw)
    {
        ((Analysis) sw).caseASetExp(this);
    }

    public PSetBody getSetBody ()
    {
        return _set_body_;
    }

    public void setSetBody (PSetBody node)
    {
        if(_set_body_ != null)
        {
            _set_body_.parent(null);
        }

        if(node != null)
        {
            if(node.parent() != null)
            {
                node.parent().removeChild(node);
            }

            node.parent(this);
        }

        _set_body_ = node;
    }

    public String toString()
    {
        return ""
            + toString (_set_body_)
        ;
    }

    void removeChild(Node child)
    {
        if ( _set_body_ == child )
        {
            _set_body_ = null;
            return;
        }
    }

    void replaceChild(Node oldChild, Node newChild)
    {
        if ( _set_body_ == oldChild )
        {
            setSetBody ((PSetBody) newChild);
            return;
        }
    }

}
