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

package MONAViewer.monalanguage.node;

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

public final class ADivExp extends PExp
{
    private PExp _exp_;
    private PArithExp _arith_exp_;

    public ADivExp ()
    {
    }

    public ADivExp (
            PExp _exp_,
            PArithExp _arith_exp_
    )
    {
        setExp (_exp_);
        setArithExp (_arith_exp_);
    }

    public Object clone()
    {
        return new ADivExp (
            (PExp)cloneNode (_exp_),
            (PArithExp)cloneNode (_arith_exp_)
        );
    }

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

    public PExp getExp ()
    {
        return _exp_;
    }

    public void setExp (PExp node)
    {
        if(_exp_ != null)
        {
            _exp_.parent(null);
        }

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

            node.parent(this);
        }

        _exp_ = node;
    }
    public PArithExp getArithExp ()
    {
        return _arith_exp_;
    }

    public void setArithExp (PArithExp node)
    {
        if(_arith_exp_ != null)
        {
            _arith_exp_.parent(null);
        }

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

            node.parent(this);
        }

        _arith_exp_ = node;
    }

    public String toString()
    {
        return ""
            + toString (_exp_)
            + toString (_arith_exp_)
        ;
    }

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

    void replaceChild(Node oldChild, Node newChild)
    {
        if ( _exp_ == oldChild )
        {
            setExp ((PExp) newChild);
            return;
        }
        if ( _arith_exp_ == oldChild )
        {
            setArithExp ((PArithExp) newChild);
            return;
        }
    }

}
